@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.
Files changed (321) hide show
  1. package/dist/cjs/{cart-CV4buPlT.js → cart-7DceSLKl.js} +3 -3
  2. package/dist/cjs/{collect-jzWKzrV7.js → collect-C08DUE1L.js} +3 -3
  3. package/dist/cjs/{debounce-5sZmmlCI.js → debounce-Cd2emZPn.js} +2 -2
  4. package/dist/cjs/{debounce-Nu2lJW4A.js → debounce-vY0QYT6o.js} +1 -1
  5. package/dist/cjs/{getBorderRadius-DGZiQu09.js → getBorderRadius-CyYZw4qq.js} +1 -1
  6. package/dist/cjs/{getMissingRequiredShippingFields-r5vYIqoX.js → getMissingRequiredShippingFields-Duz8xpmf.js} +1 -1
  7. package/dist/cjs/{hasInclusivePrice-BZMQohG9.js → hasInclusivePrice-C-iyXqJ0.js} +1 -1
  8. package/dist/cjs/index.cjs.js +8 -9
  9. package/dist/cjs/{invoice-CHw-mJdS.js → invoice-DSuHUQpi.js} +3 -3
  10. package/dist/cjs/{localization-CxXsmxs5.js → localization-BJqYz_PB.js} +192 -69
  11. package/dist/cjs/{paypal-BLuHeOJH.js → paypal-CZoctP9S.js} +4 -4
  12. package/dist/cjs/{placeTestOrder-VK_CMeq0.js → placeTestOrder-D7baFuaV.js} +2 -2
  13. package/dist/cjs/{renderCheckoutCurrency-CC4CAy-a.js → renderCheckoutCurrency-Ca2HH1Gc.js} +2 -2
  14. package/dist/cjs/{shouldShowLanguageSelect-Bj_jKWPK.js → shouldShowLanguageSelect-FyTdz7U_.js} +1 -1
  15. package/dist/cjs/{submitGtag-CcEL-w5D.js → submitGtag-D79e8u6s.js} +1 -1
  16. package/dist/cjs/{throttle-BcxGntLr.js → throttle-zSVRQLC0.js} +2 -2
  17. package/dist/cjs/{updateCheckoutSessionAttributes-Dltl5RBx.js → updateCheckoutSessionAttributes-jMtfOL2m.js} +1 -1
  18. package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +11 -11
  19. package/dist/cjs/zonos-address-display_2.cjs.entry.js +3 -3
  20. package/dist/cjs/zonos-address_4.cjs.entry.js +8 -8
  21. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +5 -5
  22. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  24. package/dist/cjs/zonos-button_3.cjs.entry.js +2 -2
  25. package/dist/cjs/zonos-card_5.cjs.entry.js +7 -7
  26. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +15 -15
  27. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +2 -2
  28. package/dist/cjs/zonos-checkout.cjs.entry.js +12 -12
  29. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  30. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +4 -4
  31. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +11 -11
  32. package/dist/cjs/zonos-collect.cjs.entry.js +7 -7
  33. package/dist/cjs/zonos-controller.cjs.entry.js +7 -7
  34. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  35. package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -3
  36. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
  37. package/dist/cjs/zonos-hello.cjs.entry.js +129 -51
  38. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  39. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +6 -6
  40. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +11 -11
  41. package/dist/cjs/zonos-invoice.cjs.entry.js +7 -7
  42. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  43. package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
  44. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +5 -5
  45. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
  46. package/dist/cjs/zonos-stripe-input.cjs.entry.js +3 -3
  47. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  48. package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
  49. package/dist/cjs/{zonosStore-BCNYr6Tk.js → zonosStore-Bx9jK82G.js} +2 -0
  50. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +1 -1
  51. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +1 -1
  52. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +1 -1
  53. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +1 -1
  54. package/dist/collection/components/hello/zonos-hello/zonos-hello.css +17 -15
  55. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +29 -52
  56. package/dist/collection/components/main/zonos-controller.js +2 -2
  57. package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -2
  58. package/dist/collection/components/store/hello/localization.js +69 -34
  59. package/dist/collection/components/store/zonosStore.js +2 -0
  60. package/dist/collection/components/stripe/zonos-address/zonos-address.js +2 -2
  61. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -3
  62. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
  63. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +0 -1
  64. package/dist/collection/components/utils/api/getLocalization.js +2 -2
  65. package/dist/collection/components/utils/checkout/isShippableCountry.js +2 -4
  66. package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +1 -0
  67. package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +2 -0
  68. package/dist/collection/components/utils/formatDate.js +1 -3
  69. package/dist/collection/components/utils/getOverridenZCountry.js +3 -5
  70. package/dist/collection/components/utils/hello/countryOverrideStorage.js +49 -0
  71. package/dist/collection/components/utils/hello/getZCountryUrlParam.js +5 -9
  72. package/dist/collection/components/utils/hello/isCountryCode.js +1 -0
  73. package/dist/collection/components/utils/hello/isCountryInShippingZone.js +8 -0
  74. package/dist/collection/components/utils/hello/reconcileRememberedCountryOverride.js +37 -0
  75. package/dist/collection/components/utils/hello/resolveHelloFloatPlacement.js +98 -0
  76. package/dist/collection/components/utils/hello/shouldShowHelloWidget.js +27 -20
  77. package/dist/collection/environment.js +0 -1
  78. package/dist/collection/scripts/_stripe.js +0 -2
  79. package/dist/collection/scripts/_zonosBase.js +1 -1
  80. package/dist/collection/types/generated/graphql.frontend.types.js +218 -63
  81. package/dist/collection/types/generated/graphql.internal.types.js +815 -152
  82. package/dist/collection/utils/formattedCloudflareApiUrl.js +1 -0
  83. package/dist/collection/utils/generateCloudflareDeployUrl.js +5 -2
  84. package/dist/esm/{cart-ekBk_gxV.js → cart-Cleo1j5P.js} +3 -3
  85. package/dist/esm/{collect-33rMINDo.js → collect-CspdWIRo.js} +3 -3
  86. package/dist/esm/{debounce-D4ko2kvZ.js → debounce-BR3PaG8X.js} +1 -1
  87. package/dist/esm/{debounce-DWPsxJsW.js → debounce-CrmpwbEE.js} +2 -2
  88. package/dist/esm/{getBorderRadius-HwG64EKM.js → getBorderRadius-DYfkeXdx.js} +1 -1
  89. package/dist/esm/{getMissingRequiredShippingFields-u1nhQzJ1.js → getMissingRequiredShippingFields-B1IL1-gn.js} +1 -1
  90. package/dist/esm/{hasInclusivePrice-CAVXi310.js → hasInclusivePrice-DKRplpLX.js} +1 -1
  91. package/dist/esm/index.js +8 -9
  92. package/dist/esm/{invoice-BNDWuVsD.js → invoice-D49igPQ9.js} +3 -3
  93. package/dist/esm/{localization-AOqYXGdP.js → localization-BiL8bPsY.js} +192 -70
  94. package/dist/esm/{paypal-CW1D2XqZ.js → paypal-D4vWRxHJ.js} +4 -4
  95. package/dist/esm/{placeTestOrder-nhmsLLOA.js → placeTestOrder-BNmc5RCo.js} +2 -2
  96. package/dist/esm/{renderCheckoutCurrency-BQANmZyM.js → renderCheckoutCurrency-BNbwijGo.js} +2 -2
  97. package/dist/esm/{shouldShowLanguageSelect-BQFCXouB.js → shouldShowLanguageSelect-B82gTfHz.js} +1 -1
  98. package/dist/esm/{submitGtag-CCGQS060.js → submitGtag-df9AQ2zL.js} +1 -1
  99. package/dist/esm/{throttle-D5GyA3yr.js → throttle-Cvlvb-dm.js} +2 -2
  100. package/dist/esm/{updateCheckoutSessionAttributes-eRSqdC74.js → updateCheckoutSessionAttributes-4Jq6V4pO.js} +1 -1
  101. package/dist/esm/zonos-address-completion-dialog_7.entry.js +11 -11
  102. package/dist/esm/zonos-address-display_2.entry.js +3 -3
  103. package/dist/esm/zonos-address_4.entry.js +8 -8
  104. package/dist/esm/zonos-airwallex-payment.entry.js +5 -5
  105. package/dist/esm/zonos-badge.entry.js +1 -1
  106. package/dist/esm/zonos-banner.entry.js +1 -1
  107. package/dist/esm/zonos-button_3.entry.js +2 -2
  108. package/dist/esm/zonos-card_5.entry.js +7 -7
  109. package/dist/esm/zonos-cart-items_12.entry.js +15 -15
  110. package/dist/esm/zonos-checkbox_2.entry.js +2 -2
  111. package/dist/esm/zonos-checkout.entry.js +12 -12
  112. package/dist/esm/zonos-collapse.entry.js +1 -1
  113. package/dist/esm/zonos-collect-cart-items_3.entry.js +4 -4
  114. package/dist/esm/zonos-collect-finish_6.entry.js +11 -11
  115. package/dist/esm/zonos-collect.entry.js +7 -7
  116. package/dist/esm/zonos-controller.entry.js +7 -7
  117. package/dist/esm/zonos-country-flag.entry.js +2 -2
  118. package/dist/esm/zonos-country-select_4.entry.js +3 -3
  119. package/dist/esm/zonos-hello-dialog.entry.js +3 -3
  120. package/dist/esm/zonos-hello.entry.js +129 -51
  121. package/dist/esm/zonos-input.entry.js +2 -2
  122. package/dist/esm/zonos-invoice-cart-items_2.entry.js +6 -6
  123. package/dist/esm/zonos-invoice-finish_5.entry.js +11 -11
  124. package/dist/esm/zonos-invoice.entry.js +7 -7
  125. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  126. package/dist/esm/zonos-logo.entry.js +1 -1
  127. package/dist/esm/zonos-policy-consent_2.entry.js +5 -5
  128. package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
  129. package/dist/esm/zonos-stripe-input.entry.js +3 -3
  130. package/dist/esm/zonos-text.entry.js +1 -1
  131. package/dist/esm/zonos-v-stack.entry.js +1 -1
  132. package/dist/esm/{zonosStore-DrIOAz4M.js → zonosStore-msUlqmSD.js} +2 -0
  133. package/dist/esm-es5/{cart-ekBk_gxV.js → cart-Cleo1j5P.js} +8 -8
  134. package/dist/esm-es5/{collect-33rMINDo.js → collect-CspdWIRo.js} +1 -1
  135. package/dist/esm-es5/{debounce-D4ko2kvZ.js → debounce-BR3PaG8X.js} +7 -7
  136. package/dist/esm-es5/debounce-CrmpwbEE.js +1 -0
  137. package/dist/esm-es5/{getBorderRadius-HwG64EKM.js → getBorderRadius-DYfkeXdx.js} +1 -1
  138. package/dist/esm-es5/{getMissingRequiredShippingFields-u1nhQzJ1.js → getMissingRequiredShippingFields-B1IL1-gn.js} +3 -3
  139. package/dist/esm-es5/{hasInclusivePrice-CAVXi310.js → hasInclusivePrice-DKRplpLX.js} +1 -1
  140. package/dist/esm-es5/index.js +6 -8
  141. package/dist/esm-es5/{invoice-BNDWuVsD.js → invoice-D49igPQ9.js} +1 -1
  142. package/dist/esm-es5/{localization-AOqYXGdP.js → localization-BiL8bPsY.js} +74 -68
  143. package/dist/esm-es5/{paypal-CW1D2XqZ.js → paypal-D4vWRxHJ.js} +1 -1
  144. package/dist/esm-es5/{placeTestOrder-nhmsLLOA.js → placeTestOrder-BNmc5RCo.js} +1 -1
  145. package/dist/esm-es5/{renderCheckoutCurrency-BQANmZyM.js → renderCheckoutCurrency-BNbwijGo.js} +1 -1
  146. package/dist/esm-es5/{shouldShowLanguageSelect-BQFCXouB.js → shouldShowLanguageSelect-B82gTfHz.js} +1 -1
  147. package/dist/esm-es5/{submitGtag-CCGQS060.js → submitGtag-df9AQ2zL.js} +1 -1
  148. package/dist/esm-es5/{throttle-D5GyA3yr.js → throttle-Cvlvb-dm.js} +2 -2
  149. package/dist/esm-es5/{updateCheckoutSessionAttributes-eRSqdC74.js → updateCheckoutSessionAttributes-4Jq6V4pO.js} +1 -1
  150. package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +3 -3
  151. package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
  152. package/dist/esm-es5/zonos-address_4.entry.js +2 -2
  153. package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
  154. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  155. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  156. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  157. package/dist/esm-es5/zonos-card_5.entry.js +2 -2
  158. package/dist/esm-es5/zonos-cart-items_12.entry.js +2 -2
  159. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
  160. package/dist/esm-es5/zonos-checkout.entry.js +6 -6
  161. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  162. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  163. package/dist/esm-es5/zonos-collect-finish_6.entry.js +2 -2
  164. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  165. package/dist/esm-es5/zonos-controller.entry.js +3 -3
  166. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  167. package/dist/esm-es5/zonos-country-select_4.entry.js +2 -2
  168. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  169. package/dist/esm-es5/zonos-hello.entry.js +21 -24
  170. package/dist/esm-es5/zonos-input.entry.js +1 -1
  171. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +2 -2
  172. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +2 -2
  173. package/dist/esm-es5/zonos-invoice.entry.js +3 -3
  174. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  175. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  176. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
  177. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  178. package/dist/esm-es5/zonos-stripe-input.entry.js +2 -2
  179. package/dist/esm-es5/zonos-text.entry.js +1 -1
  180. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  181. package/dist/esm-es5/{zonosStore-DrIOAz4M.js → zonosStore-msUlqmSD.js} +1 -1
  182. package/dist/scripts/index.d.ts +36 -6
  183. package/dist/scripts/index.js +1 -1
  184. package/dist/scripts/loadZonos.js +1 -1
  185. package/dist/scripts/zonos.js +1 -1
  186. package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +5 -3
  187. package/dist/types/components/store/hello/localization.d.ts +2 -1
  188. package/dist/types/components/utils/api/getLocalization.d.ts +3 -1
  189. package/dist/types/components/utils/getOverridenZCountry.d.ts +2 -3
  190. package/dist/types/components/utils/hello/countryOverrideStorage.d.ts +5 -0
  191. package/dist/types/components/utils/hello/isCountryCode.d.ts +2 -0
  192. package/dist/types/components/utils/hello/isCountryInShippingZone.d.ts +2 -0
  193. package/dist/types/components/utils/hello/reconcileRememberedCountryOverride.d.ts +18 -0
  194. package/dist/types/components/utils/hello/resolveHelloFloatPlacement.d.ts +39 -0
  195. package/dist/types/components/utils/hello/shouldShowHelloWidget.d.ts +8 -4
  196. package/dist/types/components.d.ts +4 -6
  197. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +10 -0
  198. package/dist/types/types/generated/graphql.frontend.types.d.ts +41 -52
  199. package/dist/types/types/generated/graphql.frontend.types.ts +226 -114
  200. package/dist/types/types/generated/graphql.internal.types.d.ts +465 -100
  201. package/dist/types/types/generated/graphql.internal.types.ts +1007 -253
  202. package/dist/types/types/hello/HelloConfig.d.ts +12 -0
  203. package/dist/types/utils/formattedCloudflareApiUrl.d.ts +1 -0
  204. package/dist/types/utils/generateCloudflareDeployUrl.d.ts +5 -2
  205. package/dist/zonos-elements/index.esm.js +1 -1
  206. package/dist/zonos-elements/{p-39c8a898.entry.js → p-028e0500.entry.js} +1 -1
  207. package/dist/zonos-elements/p-079af8c0.system.entry.js +118 -0
  208. package/dist/zonos-elements/{p-058f07aa.system.entry.js → p-0a4a7742.system.entry.js} +1 -1
  209. package/dist/zonos-elements/{p-04cc0dac.system.entry.js → p-0dca8a26.system.entry.js} +47 -47
  210. package/dist/zonos-elements/{p-d33dfc78.system.entry.js → p-0ee74bf3.system.entry.js} +30 -30
  211. package/dist/zonos-elements/{p-e284d329.entry.js → p-11bab88b.entry.js} +1 -1
  212. package/dist/zonos-elements/{p-7a5d2211.system.entry.js → p-13d3a372.system.entry.js} +18 -18
  213. package/dist/zonos-elements/{p-1568ab06.system.entry.js → p-1409de3b.system.entry.js} +1 -1
  214. package/dist/zonos-elements/{p-8328f44d.entry.js → p-193d9722.entry.js} +1 -1
  215. package/dist/zonos-elements/{p-dcdbc610.system.entry.js → p-195f6e38.system.entry.js} +2 -2
  216. package/dist/zonos-elements/{p-daf9fa07.system.entry.js → p-1b77464d.system.entry.js} +16 -16
  217. package/dist/zonos-elements/{p-cc5306fe.system.entry.js → p-1bac5ac1.system.entry.js} +1 -1
  218. package/dist/zonos-elements/{p-128485dc.entry.js → p-1c150f26.entry.js} +1 -1
  219. package/dist/zonos-elements/{p-cf5688f7.entry.js → p-234c202c.entry.js} +1 -1
  220. package/dist/zonos-elements/{p-5a631080.system.entry.js → p-23f6346b.system.entry.js} +1 -1
  221. package/dist/zonos-elements/{p-cc949df1.system.entry.js → p-244e0302.system.entry.js} +1 -1
  222. package/dist/zonos-elements/{p-7681798d.entry.js → p-24f3c547.entry.js} +1 -1
  223. package/dist/zonos-elements/{p-5c08d36b.entry.js → p-2603dce0.entry.js} +1 -1
  224. package/dist/zonos-elements/{p-6b0afaa7.entry.js → p-26295311.entry.js} +1 -1
  225. package/dist/zonos-elements/{p-d4c4a00e.entry.js → p-34c5e145.entry.js} +1 -1
  226. package/dist/zonos-elements/{p-f6e0aeba.system.entry.js → p-35509b10.system.entry.js} +185 -185
  227. package/dist/zonos-elements/{p-4a54f664.entry.js → p-35539d3d.entry.js} +1 -1
  228. package/dist/zonos-elements/{p-5024df2d.system.entry.js → p-3c800376.system.entry.js} +61 -61
  229. package/dist/zonos-elements/{p-f8fd756a.system.entry.js → p-474e8a92.system.entry.js} +1 -1
  230. package/dist/zonos-elements/{p-d55b9664.system.entry.js → p-481ecc23.system.entry.js} +20 -20
  231. package/dist/zonos-elements/{p-4973f8d8.system.entry.js → p-4fd78ecf.system.entry.js} +14 -14
  232. package/dist/zonos-elements/{p-8cd3f1e2.entry.js → p-52d9fd3a.entry.js} +1 -1
  233. package/dist/zonos-elements/{p-a6faab6a.entry.js → p-55916c90.entry.js} +1 -1
  234. package/dist/zonos-elements/p-5b06f069.entry.js +1 -0
  235. package/dist/zonos-elements/{p-5d3079e8.entry.js → p-5df25a1a.entry.js} +1 -1
  236. package/dist/zonos-elements/{p-450ed170.system.entry.js → p-5f347f91.system.entry.js} +3 -3
  237. package/dist/zonos-elements/{p-beeb9d36.system.entry.js → p-756d303f.system.entry.js} +1 -1
  238. package/dist/zonos-elements/{p-5836d426.system.entry.js → p-79ddb12a.system.entry.js} +1 -1
  239. package/dist/zonos-elements/{p-f27317d3.system.entry.js → p-7d284341.system.entry.js} +4 -4
  240. package/dist/zonos-elements/{p-f6ba59f6.system.entry.js → p-7e1050dd.system.entry.js} +10 -10
  241. package/dist/zonos-elements/{p-02ef0f99.system.entry.js → p-7ee2af6e.system.entry.js} +1 -1
  242. package/dist/zonos-elements/{p-34d1545a.entry.js → p-83aa1c8c.entry.js} +1 -1
  243. package/dist/zonos-elements/{p-9818f823.entry.js → p-84c9ce16.entry.js} +1 -1
  244. package/dist/zonos-elements/{p-CaUXHglQ.system.js → p-8PPEbm_0.system.js} +9 -9
  245. package/dist/zonos-elements/{p-b6deae2b.system.entry.js → p-92fe9a1f.system.entry.js} +2 -2
  246. package/dist/zonos-elements/{p-f57495dc.entry.js → p-990b49f2.entry.js} +1 -1
  247. package/dist/zonos-elements/{p-cadf6b63.system.entry.js → p-9ef0f69e.system.entry.js} +10 -10
  248. package/dist/zonos-elements/{p-CZl1nwqv.system.js → p-B4Ufchqh.system.js} +3 -3
  249. package/dist/zonos-elements/{p-BtMauqj_.system.js → p-B5NDhB1w.system.js} +6 -8
  250. package/dist/zonos-elements/{p-CJCoACvU.js → p-BDrM4x5N.js} +2 -2
  251. package/dist/zonos-elements/p-BGktDPwA.system.js +1 -0
  252. package/dist/zonos-elements/{p-C19J2XSh.js → p-BJzAgoqz.js} +1 -1
  253. package/dist/zonos-elements/p-BKoLoalh.js +1 -0
  254. package/dist/zonos-elements/{p-Dj-O6VfM.system.js → p-BT9_ehlh.system.js} +2 -2
  255. package/dist/zonos-elements/{p-B2EZRfoq.system.js → p-B_5RofQ9.system.js} +15 -15
  256. package/dist/zonos-elements/p-BaF00SfB.js +1 -0
  257. package/dist/zonos-elements/{p-D0erXw7p.js → p-BpDCLBwW.js} +1 -1
  258. package/dist/zonos-elements/{p-DkpYo2Fs.js → p-BtWDzGMx.js} +1 -1
  259. package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
  260. package/dist/zonos-elements/{p-CPnR_T0a.system.js → p-BuU_p5DP.system.js} +58 -58
  261. package/dist/zonos-elements/{p-D5AtAlJx.system.js → p-CASTsiDR.system.js} +3 -3
  262. package/dist/zonos-elements/{p-CaAod213.system.js → p-CBx5nYet.system.js} +1 -1
  263. package/dist/zonos-elements/{p-DIJaXkiE.system.js → p-CEmXVahp.system.js} +111 -105
  264. package/dist/zonos-elements/{p-nU86HJ5w.js → p-CUaf1cEg.js} +1 -1
  265. package/dist/zonos-elements/p-CX_vfdWt.js +1 -0
  266. package/dist/zonos-elements/p-C_z9WL8a.js +1 -0
  267. package/dist/zonos-elements/p-CcJF6xhQ.js +1 -0
  268. package/dist/zonos-elements/{p-DjuFsKLG.js → p-CewmhMGk.js} +1 -1
  269. package/dist/zonos-elements/{p-CYdt69j5.system.js → p-Cpe_ISNt.system.js} +18 -18
  270. package/dist/zonos-elements/{p-DTgv0QpG.js → p-Cuk0LLGQ.js} +1 -1
  271. package/dist/zonos-elements/p-Cxuiqv1I.js +1 -0
  272. package/dist/zonos-elements/p-DQZncB2d.system.js +9 -0
  273. package/dist/zonos-elements/{p-D-DawUYF.system.js → p-DVITR-Eu.system.js} +1 -1
  274. package/dist/zonos-elements/{p-DGsEWFDU.system.js → p-DYIisqF7.system.js} +1 -1
  275. package/dist/zonos-elements/{p-uV7m6KrY.system.js → p-DoEHepOc.system.js} +1 -1
  276. package/dist/zonos-elements/{p-DHwpNxG9.js → p-DwkyNtpD.js} +1 -1
  277. package/dist/zonos-elements/{p-CKTIJ2Gr.js → p-NJVOYjda.js} +1 -1
  278. package/dist/zonos-elements/{p-CtEsvWI6.js → p-W82paT5F.js} +1 -1
  279. package/dist/zonos-elements/{p-04bfcd72.system.entry.js → p-a571beaa.system.entry.js} +13 -13
  280. package/dist/zonos-elements/{p-5562a955.system.entry.js → p-a5c25829.system.entry.js} +3 -3
  281. package/dist/zonos-elements/{p-b68ca96f.entry.js → p-a938c174.entry.js} +1 -1
  282. package/dist/zonos-elements/{p-844a743a.entry.js → p-ab54d0a1.entry.js} +1 -1
  283. package/dist/zonos-elements/{p-9ebe9a36.entry.js → p-acd50b0b.entry.js} +1 -1
  284. package/dist/zonos-elements/{p-0f603278.system.entry.js → p-b5882fbb.system.entry.js} +2 -2
  285. package/dist/zonos-elements/{p-891b47d7.entry.js → p-ba510730.entry.js} +1 -1
  286. package/dist/zonos-elements/{p-e9320825.entry.js → p-c3b02dbf.entry.js} +1 -1
  287. package/dist/zonos-elements/{p-be64d823.system.entry.js → p-c403f004.system.entry.js} +1 -1
  288. package/dist/zonos-elements/{p-64e7bc5b.entry.js → p-c4ad6d4b.entry.js} +1 -1
  289. package/dist/zonos-elements/p-ca3175d9.entry.js +1 -0
  290. package/dist/zonos-elements/{p-a38e62cc.entry.js → p-d3d0656a.entry.js} +1 -1
  291. package/dist/zonos-elements/{p-9b6482ef.entry.js → p-d4d2b39e.entry.js} +1 -1
  292. package/dist/zonos-elements/{p-ea8790aa.entry.js → p-d6b72f6d.entry.js} +1 -1
  293. package/dist/zonos-elements/p-d74bc3e8.entry.js +1 -0
  294. package/dist/zonos-elements/p-db75322d.entry.js +1 -0
  295. package/dist/zonos-elements/p-dd8ca91e.entry.js +1 -0
  296. package/dist/zonos-elements/{p-7ae48e31.entry.js → p-ddca5ee1.entry.js} +1 -1
  297. package/dist/zonos-elements/{p-bdba7d9e.system.entry.js → p-dfc87b10.system.entry.js} +1 -1
  298. package/dist/zonos-elements/{p-e101d722.system.entry.js → p-f37b8aaf.system.entry.js} +2 -2
  299. package/dist/zonos-elements/{p-b14819ab.system.entry.js → p-fb869759.system.entry.js} +1 -1
  300. package/dist/zonos-elements/{p-i1iCWKdv.js → p-sz4L-ZnB.js} +1 -1
  301. package/dist/zonos-elements/{p-D31lQiWo.system.js → p-tGJYTlGL.system.js} +4 -4
  302. package/dist/zonos-elements/p-tkSf-lrO.system.js +13 -0
  303. package/dist/zonos-elements/{p-DPW1yXt9.system.js → p-uuZUZPIm.system.js} +61 -61
  304. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  305. package/package.json +12 -11
  306. package/dist/esm-es5/debounce-DWPsxJsW.js +0 -1
  307. package/dist/zonos-elements/p-0466650f.entry.js +0 -1
  308. package/dist/zonos-elements/p-2ba738ec.entry.js +0 -1
  309. package/dist/zonos-elements/p-3ERbuo5a.js +0 -1
  310. package/dist/zonos-elements/p-6f742021.entry.js +0 -1
  311. package/dist/zonos-elements/p-89ddab88.entry.js +0 -1
  312. package/dist/zonos-elements/p-BANhKkF2.system.js +0 -1
  313. package/dist/zonos-elements/p-BJufDgh3.js +0 -1
  314. package/dist/zonos-elements/p-BSgVcCxT.system.js +0 -9
  315. package/dist/zonos-elements/p-CQqNJo0D.system.js +0 -13
  316. package/dist/zonos-elements/p-LypTHRUC.js +0 -1
  317. package/dist/zonos-elements/p-adfee3a3.entry.js +0 -1
  318. package/dist/zonos-elements/p-f2cedbcd.system.entry.js +0 -121
  319. package/dist/zonos-elements/p-lGLcGvEA.js +0 -1
  320. package/dist/zonos-elements/p-pfIceXbY.js +0 -1
  321. package/dist/zonos-elements/p-t_ClFAJR.js +0 -1
@@ -11,6 +11,7 @@ import { generateCloudflareDeployUrl } from "./generateCloudflareDeployUrl";
11
11
  * "url" is the API url in Cloudflare
12
12
  * @returns
13
13
  * - `https://<branch_name>.<project_name>.pages.dev` if is Preview
14
+ * (Pages branch aliases; Workers previews use versioned `*.workers.dev` URLs)
14
15
  * - `https://route.elements.zonos.com` if is Production
15
16
  */
16
17
  export const formattedCloudflareApiUrl = ({ branchName, inCI: _inCI, inGithubAction, inVercel: _inVercel, isVercelPreview: _isVercelPreview, url, }) => {
@@ -1,8 +1,11 @@
1
1
  /**
2
- * Generate a Cloudflare deploy URL based on the branch name and project name
2
+ * Generate a Cloudflare Pages-style deploy URL based on the branch name and project name.
3
+ * Workers preview URLs are version-prefixed (`<version>-<worker>.<account>.workers.dev`)
4
+ * and cannot be derived from a branch name, so Pages aliases remain the preview mapping
5
+ * until a matching Workers alias exists.
3
6
  * @note not including https://
4
7
  * @return {url} string
5
- * @urlExample build-cloudflare-2.zonos-elements.page.dev
8
+ * @urlExample build-cloudflare-2.zonos-elements.pages.dev
6
9
  */
7
10
  export const generateCloudflareDeployUrl = ({ branchName, projectName, }) => {
8
11
  const normalizedProjectName = projectName.toLowerCase().replace(/\s+/g, '-');
@@ -1,9 +1,9 @@
1
- import { c as createStore, z as zonosStore } from './zonosStore-DrIOAz4M.js';
2
- import { s as storageStore, t as translate, k as getOverridenZCountry, l as localizationStore, f as filterValidTests, d as storageStoreSetEnabledVariantTestKeys } from './localization-AOqYXGdP.js';
1
+ import { c as createStore, z as zonosStore } from './zonosStore-msUlqmSD.js';
2
+ import { s as storageStore, t as translate, m as getOverridenZCountry, l as localizationStore, f as filterValidTests, e as storageStoreSetEnabledVariantTestKeys } from './localization-BiL8bPsY.js';
3
3
  import { l as log, b as allLogs } from './VarianceTest-BJmZPrZl.js';
4
4
  import { h as handleFetch, l as logError, f as fallbackApiList, g as getIsTestMode, a as getIsStagingMode, s as sendErrorLog, j as jsonParse } from './handleFetch-D5GYDF-O.js';
5
5
  import { i as isDarkColor } from './isDarkColor-YdrG78th.js';
6
- import { g as getBorderRadius } from './getBorderRadius-HwG64EKM.js';
6
+ import { g as getBorderRadius } from './getBorderRadius-DYfkeXdx.js';
7
7
  import { e as euCountryCodes } from './TaxId-Cye-evFK.js';
8
8
 
9
9
  const getCheckoutSession = async () => {
@@ -1,8 +1,8 @@
1
- import { c as createStore, z as zonosStore } from './zonosStore-DrIOAz4M.js';
2
- import { t as translate, l as localizationStore, s as storageStore } from './localization-AOqYXGdP.js';
1
+ import { c as createStore, z as zonosStore } from './zonosStore-msUlqmSD.js';
2
+ import { t as translate, l as localizationStore, s as storageStore } from './localization-BiL8bPsY.js';
3
3
  import { l as logError$1, h as handleFetch, s as sendErrorLog } from './handleFetch-D5GYDF-O.js';
4
4
  import { l as log, b as allLogs } from './VarianceTest-BJmZPrZl.js';
5
- import { d as cartStore, Y as cartStoreUpdateSelectedShippingOption, b as stripeStore, a0 as stripeStoreBuildAddressForPartyCreate } from './cart-ekBk_gxV.js';
5
+ import { d as cartStore, Y as cartStoreUpdateSelectedShippingOption, b as stripeStore, a0 as stripeStoreBuildAddressForPartyCreate } from './cart-Cleo1j5P.js';
6
6
 
7
7
  // src/constant/common.ts
8
8
  function _array_like_to_array(arr, len) {
@@ -1,4 +1,4 @@
1
- import { f as require_root, h as require_baseGetTag, i as requireIsObjectLike, r as requireIsObject } from './zonosStore-DrIOAz4M.js';
1
+ import { f as require_root, h as require_baseGetTag, i as requireIsObjectLike, r as requireIsObject } from './zonosStore-msUlqmSD.js';
2
2
 
3
3
  var now_1;
4
4
  var hasRequiredNow;
@@ -1,5 +1,5 @@
1
- import { e as getDefaultExportFromCjs } from './zonosStore-DrIOAz4M.js';
2
- import { r as requireDebounce } from './debounce-D4ko2kvZ.js';
1
+ import { e as getDefaultExportFromCjs } from './zonosStore-msUlqmSD.js';
2
+ import { r as requireDebounce } from './debounce-BR3PaG8X.js';
3
3
 
4
4
  var debounceExports = requireDebounce();
5
5
  var debounce = /*@__PURE__*/getDefaultExportFromCjs(debounceExports);
@@ -1,4 +1,4 @@
1
- import { z as zonosStore } from './zonosStore-DrIOAz4M.js';
1
+ import { z as zonosStore } from './zonosStore-msUlqmSD.js';
2
2
 
3
3
  /**
4
4
  * Get the border radius for the elements based on the style
@@ -1,4 +1,4 @@
1
- import { U as extractName } from './cart-ekBk_gxV.js';
1
+ import { U as extractName } from './cart-Cleo1j5P.js';
2
2
 
3
3
  /**
4
4
  * Minimum number of characters we treat as a valid postal code. Mirrors the
@@ -1,4 +1,4 @@
1
- import { l as localizationStore } from './localization-AOqYXGdP.js';
1
+ import { l as localizationStore } from './localization-BiL8bPsY.js';
2
2
 
3
3
  /**
4
4
  * Since the backend and the frontend are using the same keys,
package/dist/esm/index.js CHANGED
@@ -131,7 +131,7 @@ const getZonosQaUrl = () => {
131
131
  return null;
132
132
  }
133
133
  const qaUrl = extractZonosQaUrl(window.location.href);
134
- const cdnUrl = "https://v1.3.288.js.zonos.com";
134
+ const cdnUrl = "https://v1.3.290.js.zonos.com";
135
135
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
136
136
  if (!qaUrl &&
137
137
  (cdnUrl.includes('test.') ||
@@ -258,7 +258,6 @@ const zonosStripeLoadScript = (params) => {
258
258
  });
259
259
  return stripePromise$1;
260
260
  };
261
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
262
261
  const registerWrapper = (stripe, startTime) => {
263
262
  if (!stripe || !stripe._registerWrapper) {
264
263
  return;
@@ -395,10 +394,10 @@ const zonosLoadUrl = (() => {
395
394
  return null;
396
395
  })();
397
396
  const startLoadTime = Date.now();
398
- const ZONOS_URL = "https://v1.3.288.js.zonos.com";
399
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.288";
400
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.288";
401
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.288";
397
+ const ZONOS_URL = "https://v1.3.290.js.zonos.com";
398
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.290";
399
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.290";
400
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.290";
402
401
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
403
402
  const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
404
403
  class Zonos {
@@ -416,7 +415,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
416
415
  ? new URLSearchParams(window.location.search).get('iframeLogType')
417
416
  : null;
418
417
  Zonos.isBigCommerce = false;
419
- Zonos.releaseDate = "1788456575866";
418
+ Zonos.releaseDate = "1790609993128";
420
419
  Zonos.isLegacyCheckout = false;
421
420
  Zonos.googleAnalyticId = null;
422
421
  Zonos.googleAnalyticReady = false;
@@ -441,7 +440,7 @@ Zonos.isNpm = true;
441
440
  Zonos.zonosQaUrl = null;
442
441
  Zonos.zonosQaUrlApi = null;
443
442
  Zonos.trackEventLogs = [];
444
- Zonos.version = `v${"1.3.288"}`;
443
+ Zonos.version = `v${"1.3.290"}`;
445
444
  Zonos.modeAlerted = false;
446
445
  Zonos.cartData = null;
447
446
  Zonos.paypal = null;
@@ -457,7 +456,7 @@ Zonos.init = async (params) => {
457
456
  // Expose the checkout cart callbacks on the global so Stripe loading can be
458
457
  // gated on whether at least one of them is configured.
459
458
  _a.createCartId = checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.createCartId;
460
- // eslint-disable-next-line deprecation/deprecation -- intentionally mirror the (deprecated) callback so Stripe loading can be gated on it
459
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- intentionally mirror the (deprecated) callback so Stripe loading can be gated on it
461
460
  _a.buildCartDetail = checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.buildCartDetail;
462
461
  if (_a.doneInit) {
463
462
  // do nothing if zonos is already initialized
@@ -1,6 +1,6 @@
1
- import { c as createStore, z as zonosStore } from './zonosStore-DrIOAz4M.js';
2
- import { d as cartStore, Y as cartStoreUpdateSelectedShippingOption, b as stripeStore, a0 as stripeStoreBuildAddressForPartyCreate } from './cart-ekBk_gxV.js';
3
- import { s as storageStore } from './localization-AOqYXGdP.js';
1
+ import { c as createStore, z as zonosStore } from './zonosStore-msUlqmSD.js';
2
+ import { d as cartStore, Y as cartStoreUpdateSelectedShippingOption, b as stripeStore, a0 as stripeStoreBuildAddressForPartyCreate } from './cart-Cleo1j5P.js';
3
+ import { s as storageStore } from './localization-BiL8bPsY.js';
4
4
  import { h as handleFetch, s as sendErrorLog, l as logError } from './handleFetch-D5GYDF-O.js';
5
5
  import { b as allLogs } from './VarianceTest-BJmZPrZl.js';
6
6
 
@@ -1,4 +1,4 @@
1
- import { c as createStore, z as zonosStore } from './zonosStore-DrIOAz4M.js';
1
+ import { c as createStore, z as zonosStore } from './zonosStore-msUlqmSD.js';
2
2
  import { j as jsonParse, h as handleFetch, l as logError } from './handleFetch-D5GYDF-O.js';
3
3
  import { a as availableTestKeys, l as log } from './VarianceTest-BJmZPrZl.js';
4
4
 
@@ -17652,19 +17652,65 @@ const getLocaleMessages = async ({ countryCode, localeTo, storeId, }) => {
17652
17652
  return json.locale_countryCodesPage;
17653
17653
  };
17654
17654
 
17655
- const validateCountryCode = (countryCode) => {
17656
- // Check that the country is two characters and is upper case
17657
- if (countryCode && /^[A-Z]{2}$/.test(countryCode)) {
17658
- return countryCode;
17655
+ const isCountryCode = (value) => /^[A-Z]{2}$/.test(value);
17656
+
17657
+ const COUNTRY_OVERRIDE_KEY = 'zonos--country';
17658
+ const withBlockedStorage = (run) => {
17659
+ try {
17660
+ run();
17659
17661
  }
17660
- return null;
17662
+ catch (_a) {
17663
+ // localStorage/sessionStorage can throw in blocked-storage contexts
17664
+ // (Safari private mode, cross-origin iframes).
17665
+ }
17666
+ };
17667
+ const clearSessionOverride = () => {
17668
+ window.sessionStorage.removeItem(COUNTRY_OVERRIDE_KEY);
17661
17669
  };
17670
+ const readStoredCountry = (storage) => {
17671
+ try {
17672
+ const value = storage.getItem(COUNTRY_OVERRIDE_KEY);
17673
+ if (!value || !isCountryCode(value)) {
17674
+ return null;
17675
+ }
17676
+ return value;
17677
+ }
17678
+ catch (_a) {
17679
+ return null;
17680
+ }
17681
+ };
17682
+ const getCountryOverrideStorage = () => {
17683
+ var _a;
17684
+ return (_a = readStoredCountry(window.localStorage)) !== null && _a !== void 0 ? _a : readStoredCountry(window.sessionStorage);
17685
+ };
17686
+ const migrateCountryOverrideStorage = () => {
17687
+ withBlockedStorage(() => {
17688
+ if (readStoredCountry(window.localStorage)) {
17689
+ clearSessionOverride();
17690
+ }
17691
+ });
17692
+ };
17693
+ const setCountryOverrideStorage = (countryCode) => {
17694
+ withBlockedStorage(() => {
17695
+ window.localStorage.setItem(COUNTRY_OVERRIDE_KEY, countryCode);
17696
+ clearSessionOverride();
17697
+ });
17698
+ };
17699
+ const clearCountryOverrideStorage = () => {
17700
+ withBlockedStorage(() => {
17701
+ window.localStorage.removeItem(COUNTRY_OVERRIDE_KEY);
17702
+ clearSessionOverride();
17703
+ });
17704
+ };
17705
+
17662
17706
  const getZCountryUrlParam = (urlParams) => {
17663
17707
  const urlSearchParams = new URLSearchParams(urlParams || window.location.search);
17664
17708
  const getCountryParam = (param) => {
17665
17709
  const country = urlSearchParams.get(param);
17666
- // Check that the country is two characters and is upper case
17667
- return validateCountryCode(country);
17710
+ if (country && isCountryCode(country)) {
17711
+ return country;
17712
+ }
17713
+ return null;
17668
17714
  };
17669
17715
  const zCountry = getCountryParam('zCountry');
17670
17716
  // Fallback to legacy 'country'
@@ -17675,19 +17721,16 @@ const getZCountryUrlParam = (urlParams) => {
17675
17721
  };
17676
17722
 
17677
17723
  /**
17678
- * Retrieve the zCountry from the URL or session storage.
17724
+ * Retrieve the shopper country override from the URL or remembered storage.
17679
17725
  */
17680
17726
  const getOverridenZCountry = () => {
17681
17727
  const currentUrl = new URL(window.location.href);
17682
- // load and use country from session storage when zCountry query param is not present
17683
- const countryLoadedSession = window.sessionStorage.getItem('zonos--country');
17684
- const zCountry = getZCountryUrlParam(currentUrl.searchParams) || countryLoadedSession;
17685
- return zCountry;
17728
+ return (getZCountryUrlParam(currentUrl.searchParams) || getCountryOverrideStorage());
17686
17729
  };
17687
17730
 
17688
- const getLocalization = async () => {
17731
+ const getLocalization = async ({ ignoreCountryOverride = false, } = {}) => {
17689
17732
  try {
17690
- const zCountry = getOverridenZCountry();
17733
+ const zCountry = ignoreCountryOverride ? null : getOverridenZCountry();
17691
17734
  const searchParams = new URLSearchParams();
17692
17735
  if (zCountry) {
17693
17736
  searchParams.set('zCountry', zCountry);
@@ -17807,35 +17850,31 @@ const deleteBigCommerceConsignment = async (checkoutId, consignmentId) => {
17807
17850
  */
17808
17851
  const isBigCommerceCustomerLoggedIn = (checkout) => { var _a; return !!((_a = checkout === null || checkout === void 0 ? void 0 : checkout.customer) === null || _a === void 0 ? void 0 : _a.id); };
17809
17852
 
17853
+ const isCountryInShippingZone = (countryCode) => {
17854
+ var _a;
17855
+ return !!countryCode &&
17856
+ !!((_a = localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[countryCode]) &&
17857
+ !zonosStore.disabledCountries.includes(countryCode);
17858
+ };
17859
+
17810
17860
  /**
17811
- * Whether the Hello widget should be shown for the current shopper. This is the
17812
- * single source of truth for Hello's visibility decision — the `zonos-hello`
17813
- * component renders by it, and other features (e.g. BigCommerce cart shipping
17814
- * cleanup) gate on it so their behavior stays in lockstep with what the shopper
17815
- * actually sees.
17816
- *
17817
- * Resolves the configured `widgetVisibility` behavior (with the deprecated
17818
- * `showForCountries` override) against the selected country and shipping-zone
17819
- * state, then applies the include/exclude country overrides.
17820
- *
17821
- * @param showLog - emit a debug log when the shopper is not in a shipping zone.
17822
- * Defaults to `true`; pass `false` from non-rendering callers to avoid log
17823
- * noise.
17861
+ * Visibility rules for Hello, ignoring whether localization has finished
17862
+ * loading. Used during init reconcile before `localizationLoaded` is set.
17863
+ * Pass `countryCode` to evaluate a remembered country instead of the
17864
+ * currently selected one.
17824
17865
  */
17825
- const shouldShowHelloWidget = (showLog = true) => {
17866
+ const getHelloWidgetVisibility = (showLog = true, countryCode = localizationStore.selectedCountryCode) => {
17826
17867
  var _a, _b;
17827
- if (!localizationStore.localizationLoaded) {
17828
- return false;
17829
- }
17830
17868
  const { countryDisplayRules, showForCountries } = zonosStore.helloSettings;
17831
17869
  const visibilityRules = countryDisplayRules === null || countryDisplayRules === void 0 ? void 0 : countryDisplayRules.widgetVisibility;
17832
- const selectedCountry = localizationStore.selectedCountryCode;
17870
+ const selectedCountry = countryCode;
17871
+ const isShippableCountry = isCountryInShippingZone(countryCode);
17833
17872
  // Resolve behavior: deprecated showForCountries overrides widgetVisibility.behavior
17834
17873
  // If showForCountries is an array of country codes, treat as legacy explicit list
17835
17874
  const behavior = Array.isArray(showForCountries)
17836
17875
  ? showForCountries
17837
17876
  : (showForCountries !== null && showForCountries !== void 0 ? showForCountries : visibilityRules === null || visibilityRules === void 0 ? void 0 : visibilityRules.behavior);
17838
- if (showLog && !localizationStore.isShippableCountry) {
17877
+ if (showLog && !isShippableCountry) {
17839
17878
  log(`Hello: not shippable country - Show for countries: ${behavior}`);
17840
17879
  }
17841
17880
  // Legacy: explicit list of country codes from deprecated showForCountries
@@ -17849,7 +17888,7 @@ const shouldShowHelloWidget = (showLog = true) => {
17849
17888
  }
17850
17889
  else {
17851
17890
  // Default: ONLY_SHIPPABLE
17852
- isVisible = localizationStore.isShippableCountry;
17891
+ isVisible = isShippableCountry;
17853
17892
  }
17854
17893
  // Apply includedCountries — force show the widget for these countries
17855
17894
  if (!isVisible &&
@@ -17865,6 +17904,23 @@ const shouldShowHelloWidget = (showLog = true) => {
17865
17904
  }
17866
17905
  return isVisible;
17867
17906
  };
17907
+ /**
17908
+ * Whether the Hello widget should be shown for the current shopper. This is the
17909
+ * single source of truth for Hello's visibility decision — the `zonos-hello`
17910
+ * component renders by it, and other features (e.g. BigCommerce cart shipping
17911
+ * cleanup) gate on it so their behavior stays in lockstep with what the shopper
17912
+ * actually sees.
17913
+ *
17914
+ * @param showLog - emit a debug log when the shopper is not in a shipping zone.
17915
+ * Defaults to `true`; pass `false` from non-rendering callers to avoid log
17916
+ * noise.
17917
+ */
17918
+ const shouldShowHelloWidget = (showLog = true) => {
17919
+ if (!localizationStore.localizationLoaded) {
17920
+ return false;
17921
+ }
17922
+ return getHelloWidgetVisibility(showLog);
17923
+ };
17868
17924
 
17869
17925
  /**
17870
17926
  * Guard against overlapping passes. `removeBigcommerceCartShipping` is fired on
@@ -18331,6 +18387,41 @@ const getCurrencyCode = (code) => {
18331
18387
  return null;
18332
18388
  };
18333
18389
 
18390
+ /**
18391
+ * Drop a remembered Hello country when widgetVisibility would hide the
18392
+ * widget for it, then fall back to geo.
18393
+ *
18394
+ * Does not mutate the localization store — the caller applies the returned
18395
+ * country. Pass `geoCountry` when init already fetched IP localization so
18396
+ * discard does not wait on a second round trip. Pass `urlCountryAtLoad`
18397
+ * from the URL as it was at page load (before init writes `zCountry` for
18398
+ * URL_PARAM merchants). Do not omit it after a live URL write — the
18399
+ * default is `null`, not the current URL. Storage is cleared when geo
18400
+ * succeeds, or when a load-time URL country won and the stored country
18401
+ * would be hidden.
18402
+ */
18403
+ const reconcileRememberedCountryOverride = async ({ geoCountry, urlCountryAtLoad = null, } = {}) => {
18404
+ const storedCountry = getCountryOverrideStorage();
18405
+ if (!storedCountry) {
18406
+ return null;
18407
+ }
18408
+ if (getHelloWidgetVisibility(false, storedCountry)) {
18409
+ return null;
18410
+ }
18411
+ if (urlCountryAtLoad) {
18412
+ clearCountryOverrideStorage();
18413
+ return null;
18414
+ }
18415
+ const country = geoCountry !== undefined
18416
+ ? geoCountry
18417
+ : (await getLocalization({ ignoreCountryOverride: true })).country;
18418
+ if (!country) {
18419
+ return null;
18420
+ }
18421
+ clearCountryOverrideStorage();
18422
+ return country;
18423
+ };
18424
+
18334
18425
  const setZCountryUrlParam = (selectedCountryCode) => {
18335
18426
  if (!selectedCountryCode) {
18336
18427
  return;
@@ -18502,19 +18593,23 @@ const getNewLocalization = async ({ isInitializing, }) => {
18502
18593
  }
18503
18594
  };
18504
18595
  const getCustomMessages = async () => {
18505
- log(`Getting custom messages for ${localizationStore.selectedCountryCode}`);
18506
- if (!localizationStore.selectedCountryCode || !zonosStore.storeId) {
18596
+ const countryCode = localizationStore.selectedCountryCode;
18597
+ log(`Getting custom messages for ${countryCode}`);
18598
+ if (!countryCode || !zonosStore.storeId) {
18507
18599
  return;
18508
18600
  }
18509
18601
  const localeMessages = await getLocaleMessages({
18510
- countryCode: localizationStore.selectedCountryCode,
18602
+ countryCode,
18511
18603
  localeTo: localizationStore.selectedLocale,
18512
18604
  storeId: zonosStore.storeId,
18513
18605
  });
18606
+ if (localizationStore.selectedCountryCode !== countryCode) {
18607
+ return;
18608
+ }
18514
18609
  const allMessages = localeMessages.flatMap(x => {
18515
18610
  var _a;
18516
18611
  return {
18517
- countryCode: localizationStore.selectedCountryCode,
18612
+ countryCode,
18518
18613
  message: (_a = x.countryCodesPageMessageLinks.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message.textTo,
18519
18614
  pageName: x.pageName,
18520
18615
  };
@@ -18557,17 +18652,19 @@ const getValidLocale = (locale) => {
18557
18652
  log(`Locale ${locale} is not offered, falling back to ${fallback === null || fallback === void 0 ? void 0 : fallback.code}`);
18558
18653
  return (fallback === null || fallback === void 0 ? void 0 : fallback.code) || 'en';
18559
18654
  };
18560
- const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelectedCountryCode, }) => {
18561
- var _a, _b, _c;
18655
+ const syncSelectedCountryToPage = (selectedCountryCode) => {
18656
+ var _a;
18657
+ setZCountryUrlParam(selectedCountryCode);
18658
+ (_a = document
18659
+ .querySelector('zonos-hello')) === null || _a === void 0 ? void 0 : _a.setAttribute('z-country', selectedCountryCode);
18660
+ };
18661
+ const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelectedCountryCode, persistOverride, }) => {
18662
+ var _a;
18562
18663
  log(`Updating selected country code to ${newSelectedCountryCode}`);
18563
18664
  const isFirstTime = !localizationStore.selectedCountryCode;
18564
18665
  localizationStore.selectedCountryCode = getValidCountryCode(newSelectedCountryCode);
18565
- const { selectedCountryCode, shippingZoneCountries } = localizationStore;
18566
- const isShippableCountry = !!shippingZoneCountries &&
18567
- !!selectedCountryCode &&
18568
- !!shippingZoneCountries[selectedCountryCode] &&
18569
- // Make sure the country is not in the disabled countries list
18570
- !zonosStore.disabledCountries.includes(selectedCountryCode);
18666
+ const { selectedCountryCode } = localizationStore;
18667
+ const isShippableCountry = isCountryInShippingZone(selectedCountryCode);
18571
18668
  // update shippable country
18572
18669
  localizationStore.isShippableCountry = isShippableCountry;
18573
18670
  log(`${localizationStore.selectedCountryCode} is a shippable country: ${localizationStore.isShippableCountry}`);
@@ -18590,9 +18687,10 @@ const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelecte
18590
18687
  return;
18591
18688
  }
18592
18689
  const currencyCode = getCurrencyCode(selectedCountryCode);
18593
- // Only trigger callback onCountryChange if the country code has been set before
18594
- if (!isFirstTime) {
18595
- // Trigger callback onCountryChange
18690
+ const shouldPersistOverride = persistOverride !== null && persistOverride !== void 0 ? persistOverride : !isInitializing;
18691
+ // Only trigger onCountryChange after init — the first apply, and any
18692
+ // reconcile fallback during init, are not shopper-selected changes.
18693
+ if (!isFirstTime && !isInitializing) {
18596
18694
  (_a = zonosStore.onCountryChange) === null || _a === void 0 ? void 0 : _a.call(zonosStore, {
18597
18695
  countryCode: selectedCountryCode,
18598
18696
  currencyCode,
@@ -18622,27 +18720,24 @@ const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelecte
18622
18720
  localizationStore.countryLandedCost = null;
18623
18721
  localizationStore.inclusivePricingConfigurations = [];
18624
18722
  currencyDisplay();
18723
+ }
18724
+ else {
18725
+ localizationStore.targetCurrency = currencyCode;
18726
+ // Init may apply a remembered country that reconcile then discards. Fetch
18727
+ // exchange rates once after reconcile for the final country instead.
18625
18728
  if (!isInitializing) {
18626
- void getCustomMessages();
18729
+ void getNewLocalization({ isInitializing: false });
18627
18730
  }
18628
- // Clear session so the next visit falls back to geolocation, but keep
18629
- // the current shopper's explicit selection visible in the URL (so a
18630
- // same-tab reload still honors it) and on the hello element.
18631
- window.sessionStorage.removeItem('zonos--country');
18632
- setZCountryUrlParam(selectedCountryCode);
18633
- (_b = document
18634
- .querySelector('zonos-hello')) === null || _b === void 0 ? void 0 : _b.setAttribute('z-country', selectedCountryCode);
18635
- return;
18636
18731
  }
18637
- localizationStore.targetCurrency = currencyCode;
18638
- void getNewLocalization({ isInitializing: isInitializing });
18639
18732
  if (!isInitializing) {
18640
18733
  void getCustomMessages();
18641
18734
  }
18642
- window.sessionStorage.setItem('zonos--country', selectedCountryCode);
18643
- setZCountryUrlParam(selectedCountryCode);
18644
- (_c = document
18645
- .querySelector('zonos-hello')) === null || _c === void 0 ? void 0 : _c.setAttribute('z-country', selectedCountryCode);
18735
+ if (shouldPersistOverride) {
18736
+ setCountryOverrideStorage(selectedCountryCode);
18737
+ }
18738
+ if (!isInitializing) {
18739
+ syncSelectedCountryToPage(selectedCountryCode);
18740
+ }
18646
18741
  };
18647
18742
  const initHelloCountryList = (allCountries) => {
18648
18743
  var _a, _b, _c, _d, _e, _f;
@@ -18721,12 +18816,25 @@ const localizationStoreUpdateSelectedLocale = (requestedLocale) => {
18721
18816
  localizationStore.selectedLocale = newSelectedLocale;
18722
18817
  translationStoreUpdateLanguage(newSelectedLocale);
18723
18818
  void updateCheckoutSessionLanguage();
18724
- void getCustomMessages();
18819
+ if (localizationStore.localizationLoaded) {
18820
+ void getCustomMessages();
18821
+ }
18725
18822
  };
18726
18823
  const initLocalizationStore = async () => {
18727
18824
  var _a;
18825
+ migrateCountryOverrideStorage();
18826
+ const urlCountryAtLoad = getZCountryUrlParam();
18827
+ const storedCountryAtLoad = getCountryOverrideStorage();
18828
+ const shouldPrefetchGeo = !!storedCountryAtLoad && !urlCountryAtLoad;
18728
18829
  // all countries from countries.json, shipping zone and localization
18729
- const [allCountries, shippingZoneCountries, localization] = await Promise.all([getCountries(), getShippingZones(), getLocalization()]);
18830
+ const [allCountries, shippingZoneCountries, localization, geoLocalization] = await Promise.all([
18831
+ getCountries(),
18832
+ getShippingZones(),
18833
+ getLocalization(),
18834
+ shouldPrefetchGeo
18835
+ ? getLocalization({ ignoreCountryOverride: true })
18836
+ : Promise.resolve(undefined),
18837
+ ]);
18730
18838
  // Filter countries to only include countries in the shipping zone
18731
18839
  const filteredCountries = shippingZoneCountries === null || shippingZoneCountries === void 0 ? void 0 : shippingZoneCountries.reduce((acc, countryCode) => {
18732
18840
  const countryInfo = allCountries === null || allCountries === void 0 ? void 0 : allCountries[countryCode];
@@ -18745,7 +18853,7 @@ const initLocalizationStore = async () => {
18745
18853
  // update selected country code in store
18746
18854
  localizationStoreUpdateSelectedCountryCode({
18747
18855
  isInitializing: true,
18748
- newSelectedCountryCode: country || null,
18856
+ newSelectedCountryCode: country || storedCountryAtLoad,
18749
18857
  });
18750
18858
  // use locale from params if it exists, otherwise use locale from localization
18751
18859
  const overrideLocale = getOverrideLocale();
@@ -18767,12 +18875,26 @@ const initLocalizationStore = async () => {
18767
18875
  newSelectedCountryCode: 'CA',
18768
18876
  });
18769
18877
  }
18878
+ const fallbackCountry = await reconcileRememberedCountryOverride({
18879
+ geoCountry: geoLocalization === null || geoLocalization === void 0 ? void 0 : geoLocalization.country,
18880
+ urlCountryAtLoad,
18881
+ });
18882
+ if (fallbackCountry) {
18883
+ localizationStoreUpdateSelectedCountryCode({
18884
+ isInitializing: true,
18885
+ newSelectedCountryCode: fallbackCountry,
18886
+ });
18887
+ }
18888
+ if (localizationStore.selectedCountryCode) {
18889
+ syncSelectedCountryToPage(localizationStore.selectedCountryCode);
18890
+ }
18891
+ void getCustomMessages();
18892
+ void getNewLocalization({ isInitializing: true });
18770
18893
  if (!localizationStore.localizationLoaded) {
18771
18894
  localizationStore.localizationLoaded = true;
18772
18895
  void removeBigcommerceCartShipping();
18773
- // shouldShowHelloWidget is false because localization is not loaded yet
18774
18896
  void toggleBigcommerceNativeCurrencySelector();
18775
18897
  }
18776
18898
  };
18777
18899
 
18778
- 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 };
18900
+ 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,10 +1,10 @@
1
- import { z as zonosStore, c as createStore } from './zonosStore-DrIOAz4M.js';
2
- 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-ekBk_gxV.js';
3
- import { s as storageStore, t as translate } from './localization-AOqYXGdP.js';
1
+ import { z as zonosStore, c as createStore } from './zonosStore-msUlqmSD.js';
2
+ 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';
3
+ import { s as storageStore, t as translate } from './localization-BiL8bPsY.js';
4
4
  import { h as handleFetch, g as getIsTestMode, l as logError, j as jsonParse } from './handleFetch-D5GYDF-O.js';
5
5
  import { i as isContrastColor } from './isContrastColor-CWLU13s9.js';
6
6
  import { l as log } from './VarianceTest-BJmZPrZl.js';
7
- import { i as isAnalyticsRelayInIframe, a as enqueueRelayEvent, s as submitGtag } from './submitGtag-CCGQS060.js';
7
+ import { i as isAnalyticsRelayInIframe, a as enqueueRelayEvent, s as submitGtag } from './submitGtag-df9AQ2zL.js';
8
8
 
9
9
  /*!
10
10
  * paypal-js v8.4.2 (2025-09-04T17:21:30.135Z)
@@ -1,5 +1,5 @@
1
- import { d as cartStore } from './cart-ekBk_gxV.js';
2
- import { s as storageStore } from './localization-AOqYXGdP.js';
1
+ import { d as cartStore } from './cart-Cleo1j5P.js';
2
+ import { s as storageStore } from './localization-BiL8bPsY.js';
3
3
  import { l as logError, h as handleFetch } from './handleFetch-D5GYDF-O.js';
4
4
 
5
5
  const placeTestOrder = async () => {
@@ -1,5 +1,5 @@
1
- import { d as cartStore } from './cart-ekBk_gxV.js';
2
- import { A as applyInclusiveEffectiveRate, h as currencyFormat } from './localization-AOqYXGdP.js';
1
+ import { d as cartStore } from './cart-Cleo1j5P.js';
2
+ import { B as applyInclusiveEffectiveRate, j as currencyFormat } from './localization-BiL8bPsY.js';
3
3
 
4
4
  const getDisplayCurrency = () => {
5
5
  var _a, _b;
@@ -1,4 +1,4 @@
1
- import { z as getSupportedLanguages } from './localization-AOqYXGdP.js';
1
+ import { A as getSupportedLanguages } from './localization-BiL8bPsY.js';
2
2
 
3
3
  /**
4
4
  * Whether to offer the language selector. Hidden when the merchant has narrowed
@@ -1,4 +1,4 @@
1
- import { z as zonosStore } from './zonosStore-DrIOAz4M.js';
1
+ import { z as zonosStore } from './zonosStore-msUlqmSD.js';
2
2
  import { g as getIsTestMode } from './handleFetch-D5GYDF-O.js';
3
3
  import { l as log } from './VarianceTest-BJmZPrZl.js';
4
4
 
@@ -1,5 +1,5 @@
1
- import { r as requireIsObject, e as getDefaultExportFromCjs } from './zonosStore-DrIOAz4M.js';
2
- import { r as requireDebounce } from './debounce-D4ko2kvZ.js';
1
+ import { r as requireIsObject, e as getDefaultExportFromCjs } from './zonosStore-msUlqmSD.js';
2
+ import { r as requireDebounce } from './debounce-BR3PaG8X.js';
3
3
 
4
4
  var throttle_1;
5
5
  var hasRequiredThrottle;
@@ -1,4 +1,4 @@
1
- import { d as debounce } from './debounce-DWPsxJsW.js';
1
+ import { d as debounce } from './debounce-CrmpwbEE.js';
2
2
  import { h as handleFetch, l as logError } from './handleFetch-D5GYDF-O.js';
3
3
 
4
4
  const attributesToUpdate = {};