@zonos/elements 1.3.279 → 1.3.280

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 (229) hide show
  1. package/dist/cjs/{cart-e8bc11a3.js → cart-0fa312a5.js} +1 -1
  2. package/dist/cjs/{collect-e6485168.js → collect-f9c4ca7c.js} +2 -2
  3. package/dist/cjs/formatStringWithLinks-c25b4018.js +24 -0
  4. package/dist/cjs/{hasInclusivePrice-798ce42d.js → hasInclusivePrice-95431bca.js} +1 -1
  5. package/dist/cjs/index.cjs.js +7 -7
  6. package/dist/cjs/{invoice-dff7ec81.js → invoice-ce757565.js} +2 -2
  7. package/dist/cjs/isSameHostCheckoutLink-6148cabb.js +28 -0
  8. package/dist/cjs/{localization-90650d7d.js → localization-7fded969.js} +40 -40
  9. package/dist/cjs/{paypal-77bd640c.js → paypal-57ab3ab6.js} +2 -2
  10. package/dist/cjs/{placeTestOrder-7767d119.js → placeTestOrder-35e0d3bd.js} +2 -2
  11. package/dist/cjs/{renderCheckoutCurrency-66377cf5.js → renderCheckoutCurrency-41d48407.js} +2 -2
  12. package/dist/cjs/zonos-address-display_8.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
  14. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +3 -3
  15. package/dist/cjs/zonos-card_5.cjs.entry.js +3 -3
  16. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +19 -7
  17. package/dist/cjs/zonos-checkout.cjs.entry.js +189 -13
  18. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
  19. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
  20. package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
  21. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  22. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -2
  24. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +4 -3
  25. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  26. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
  27. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +6 -6
  28. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
  29. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  30. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +3 -3
  31. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +13 -1
  32. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +36 -2
  33. package/dist/collection/components/store/translationStore/strings.arabic.js +2 -2
  34. package/dist/collection/components/store/translationStore/strings.base.js +2 -2
  35. package/dist/collection/components/store/translationStore/strings.chinese.js +2 -2
  36. package/dist/collection/components/store/translationStore/strings.danish.js +2 -2
  37. package/dist/collection/components/store/translationStore/strings.dutch.js +2 -2
  38. package/dist/collection/components/store/translationStore/strings.french.js +2 -2
  39. package/dist/collection/components/store/translationStore/strings.german.js +2 -2
  40. package/dist/collection/components/store/translationStore/strings.hebrew.js +2 -2
  41. package/dist/collection/components/store/translationStore/strings.indonesian.js +2 -2
  42. package/dist/collection/components/store/translationStore/strings.italian.js +2 -2
  43. package/dist/collection/components/store/translationStore/strings.japanese.js +2 -2
  44. package/dist/collection/components/store/translationStore/strings.korean.js +2 -2
  45. package/dist/collection/components/store/translationStore/strings.norwegian.js +2 -2
  46. package/dist/collection/components/store/translationStore/strings.polish.js +2 -2
  47. package/dist/collection/components/store/translationStore/strings.portuguese.js +2 -2
  48. package/dist/collection/components/store/translationStore/strings.russian.js +2 -2
  49. package/dist/collection/components/store/translationStore/strings.spanish.js +2 -2
  50. package/dist/collection/components/store/translationStore/strings.swedish.js +2 -2
  51. package/dist/collection/components/store/translationStore/strings.turkish.js +2 -2
  52. package/dist/collection/components/store/translationStore/strings.vietnamese.js +2 -2
  53. package/dist/collection/components/utils/checkout/buildBigcommerceRedirectUrl.js +6 -1
  54. package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +144 -7
  55. package/dist/collection/components/utils/formatStringWithLinks.js +12 -6
  56. package/dist/collection/components/utils/isSameHostCheckoutLink.js +24 -0
  57. package/dist/collection/types/generated/graphql.internal.types.js +84 -0
  58. package/dist/esm/{cart-8b8dc79f.js → cart-4699e6ab.js} +2 -2
  59. package/dist/esm/{collect-f4965586.js → collect-24cc2e12.js} +2 -2
  60. package/dist/esm/formatStringWithLinks-0d48f183.js +22 -0
  61. package/dist/esm/{hasInclusivePrice-1589fef9.js → hasInclusivePrice-f81ddcd6.js} +1 -1
  62. package/dist/esm/index.js +7 -7
  63. package/dist/esm/{invoice-b7a1fb14.js → invoice-575dc93d.js} +2 -2
  64. package/dist/esm/isSameHostCheckoutLink-c1b88ab7.js +26 -0
  65. package/dist/esm/{localization-d49867ed.js → localization-da2f407f.js} +40 -40
  66. package/dist/esm/{paypal-da551105.js → paypal-d4436abd.js} +2 -2
  67. package/dist/esm/{placeTestOrder-4309b170.js → placeTestOrder-d87b2c6a.js} +2 -2
  68. package/dist/esm/{renderCheckoutCurrency-0ed221ac.js → renderCheckoutCurrency-08526996.js} +2 -2
  69. package/dist/esm/zonos-address-display_8.entry.js +2 -2
  70. package/dist/esm/zonos-address_4.entry.js +2 -2
  71. package/dist/esm/zonos-airwallex-payment.entry.js +3 -3
  72. package/dist/esm/zonos-card_5.entry.js +3 -3
  73. package/dist/esm/zonos-cart-items_12.entry.js +19 -7
  74. package/dist/esm/zonos-checkout.entry.js +189 -13
  75. package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
  76. package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
  77. package/dist/esm/zonos-collect.entry.js +4 -4
  78. package/dist/esm/zonos-controller.entry.js +2 -2
  79. package/dist/esm/zonos-country-flag.entry.js +1 -1
  80. package/dist/esm/zonos-country-select_4.entry.js +3 -2
  81. package/dist/esm/zonos-hello-dialog.entry.js +4 -3
  82. package/dist/esm/zonos-hello.entry.js +1 -1
  83. package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
  84. package/dist/esm/zonos-invoice-finish_5.entry.js +6 -6
  85. package/dist/esm/zonos-invoice.entry.js +4 -4
  86. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  87. package/dist/esm/zonos-policy-consent_2.entry.js +3 -3
  88. package/dist/esm-es5/{cart-8b8dc79f.js → cart-4699e6ab.js} +1 -1
  89. package/dist/esm-es5/{collect-f4965586.js → collect-24cc2e12.js} +1 -1
  90. package/dist/esm-es5/formatStringWithLinks-0d48f183.js +1 -0
  91. package/dist/esm-es5/{hasInclusivePrice-1589fef9.js → hasInclusivePrice-f81ddcd6.js} +1 -1
  92. package/dist/esm-es5/index.js +1 -1
  93. package/dist/esm-es5/{invoice-b7a1fb14.js → invoice-575dc93d.js} +1 -1
  94. package/dist/esm-es5/isSameHostCheckoutLink-c1b88ab7.js +1 -0
  95. package/dist/esm-es5/localization-da2f407f.js +1 -0
  96. package/dist/esm-es5/{paypal-da551105.js → paypal-d4436abd.js} +1 -1
  97. package/dist/esm-es5/{placeTestOrder-4309b170.js → placeTestOrder-d87b2c6a.js} +1 -1
  98. package/dist/esm-es5/{renderCheckoutCurrency-0ed221ac.js → renderCheckoutCurrency-08526996.js} +1 -1
  99. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
  100. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  101. package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
  102. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  103. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  104. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  105. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  106. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  107. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  108. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  109. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  110. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  111. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  112. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  113. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  114. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  115. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  116. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  117. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
  118. package/dist/scripts/index.d.ts +1 -1
  119. package/dist/scripts/index.js +1 -1
  120. package/dist/scripts/loadZonos.js +1 -1
  121. package/dist/scripts/zonos.js +1 -1
  122. package/dist/types/components/store/translationStore/strings.arabic.d.ts +1 -1
  123. package/dist/types/components/store/translationStore/strings.base.d.ts +1 -1
  124. package/dist/types/components/store/translationStore/strings.chinese.d.ts +1 -1
  125. package/dist/types/components/store/translationStore/strings.danish.d.ts +1 -1
  126. package/dist/types/components/store/translationStore/strings.dutch.d.ts +1 -1
  127. package/dist/types/components/store/translationStore/strings.french.d.ts +1 -1
  128. package/dist/types/components/store/translationStore/strings.german.d.ts +1 -1
  129. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +1 -1
  130. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +1 -1
  131. package/dist/types/components/store/translationStore/strings.italian.d.ts +1 -1
  132. package/dist/types/components/store/translationStore/strings.japanese.d.ts +1 -1
  133. package/dist/types/components/store/translationStore/strings.korean.d.ts +1 -1
  134. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +1 -1
  135. package/dist/types/components/store/translationStore/strings.polish.d.ts +1 -1
  136. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +1 -1
  137. package/dist/types/components/store/translationStore/strings.russian.d.ts +1 -1
  138. package/dist/types/components/store/translationStore/strings.spanish.d.ts +1 -1
  139. package/dist/types/components/store/translationStore/strings.swedish.d.ts +1 -1
  140. package/dist/types/components/store/translationStore/strings.turkish.d.ts +1 -1
  141. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +1 -1
  142. package/dist/types/components/utils/isSameHostCheckoutLink.d.ts +14 -0
  143. package/dist/types/types/generated/graphql.internal.types.d.ts +84 -0
  144. package/dist/types/types/generated/graphql.internal.types.ts +85 -0
  145. package/dist/zonos-elements/index.esm.js +1 -1
  146. package/dist/zonos-elements/{p-02065a08.system.js → p-016b5bde.system.js} +1 -1
  147. package/dist/zonos-elements/{p-6fae9835.system.entry.js → p-0adab1d5.system.entry.js} +1 -1
  148. package/dist/zonos-elements/p-0d2f81ce.system.js +1 -0
  149. package/dist/zonos-elements/p-11206fe2.js +1 -0
  150. package/dist/zonos-elements/{p-0402af0d.entry.js → p-12452213.entry.js} +1 -1
  151. package/dist/zonos-elements/{p-5827c868.entry.js → p-19f4e77a.entry.js} +1 -1
  152. package/dist/zonos-elements/{p-2aecc055.entry.js → p-1bb85ff1.entry.js} +1 -1
  153. package/dist/zonos-elements/{p-5c76ef2a.js → p-275fa2da.js} +1 -1
  154. package/dist/zonos-elements/{p-8b42245d.entry.js → p-28b1c189.entry.js} +1 -1
  155. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  156. package/dist/zonos-elements/p-2b97f7ed.js +1 -0
  157. package/dist/zonos-elements/{p-647438d6.system.js → p-2dbdf883.system.js} +1 -1
  158. package/dist/zonos-elements/{p-5afea02c.system.entry.js → p-3068247c.system.entry.js} +1 -1
  159. package/dist/zonos-elements/{p-7614ea6f.system.entry.js → p-362215b6.system.entry.js} +1 -1
  160. package/dist/zonos-elements/p-39e2642f.js +1 -0
  161. package/dist/zonos-elements/p-3f8f4c78.js +1 -0
  162. package/dist/zonos-elements/{p-d5945ddc.entry.js → p-3f90cb36.entry.js} +1 -1
  163. package/dist/zonos-elements/{p-1b963905.system.js → p-40a0c1d3.system.js} +1 -1
  164. package/dist/zonos-elements/{p-abf61f6f.system.entry.js → p-43a14674.system.entry.js} +1 -1
  165. package/dist/zonos-elements/{p-d7cb9ef6.system.entry.js → p-46f88c11.system.entry.js} +1 -1
  166. package/dist/zonos-elements/{p-998f9df5.system.entry.js → p-564c7bb5.system.entry.js} +1 -1
  167. package/dist/zonos-elements/p-5b54f10c.entry.js +1 -0
  168. package/dist/zonos-elements/p-6197aa73.system.entry.js +1 -0
  169. package/dist/zonos-elements/{p-b36205f4.entry.js → p-6451537c.entry.js} +1 -1
  170. package/dist/zonos-elements/p-65fe75e1.entry.js +1 -0
  171. package/dist/zonos-elements/{p-5bc43687.system.entry.js → p-66223935.system.entry.js} +1 -1
  172. package/dist/zonos-elements/p-67426156.system.js +1 -0
  173. package/dist/zonos-elements/{p-2654556b.js → p-67b2e46c.js} +1 -1
  174. package/dist/zonos-elements/p-6bea1787.entry.js +1 -0
  175. package/dist/zonos-elements/{p-cd41b16b.system.entry.js → p-7237ec6f.system.entry.js} +1 -1
  176. package/dist/zonos-elements/{p-0745e440.entry.js → p-72c1bd64.entry.js} +1 -1
  177. package/dist/zonos-elements/p-75da4ba0.entry.js +1 -0
  178. package/dist/zonos-elements/{p-3f380c8f.system.js → p-788a16bb.system.js} +1 -1
  179. package/dist/zonos-elements/p-79b6070a.js +1 -0
  180. package/dist/zonos-elements/{p-77fa437c.entry.js → p-807e7ebc.entry.js} +1 -1
  181. package/dist/zonos-elements/{p-43815edd.system.entry.js → p-81c4f04a.system.entry.js} +1 -1
  182. package/dist/zonos-elements/{p-8bd37d3b.entry.js → p-85796e67.entry.js} +1 -1
  183. package/dist/zonos-elements/p-94329e56.js +1 -0
  184. package/dist/zonos-elements/{p-ed676ad1.system.entry.js → p-944148db.system.entry.js} +1 -1
  185. package/dist/zonos-elements/{p-a8c79850.js → p-96e7b465.js} +1 -1
  186. package/dist/zonos-elements/{p-32278945.system.js → p-a30f03d6.system.js} +1 -1
  187. package/dist/zonos-elements/{p-ac59f5c1.system.entry.js → p-a5afcea1.system.entry.js} +1 -1
  188. package/dist/zonos-elements/{p-293183c1.system.entry.js → p-a7f0e824.system.entry.js} +1 -1
  189. package/dist/zonos-elements/p-aff7112b.entry.js +1 -0
  190. package/dist/zonos-elements/p-b05da593.system.entry.js +1 -0
  191. package/dist/zonos-elements/p-b330e451.system.js +1 -0
  192. package/dist/zonos-elements/{p-12a08423.system.entry.js → p-b6049eef.system.entry.js} +1 -1
  193. package/dist/zonos-elements/p-b6cd6e62.system.entry.js +1 -0
  194. package/dist/zonos-elements/{p-7365e22c.system.js → p-b8c019b9.system.js} +1 -1
  195. package/dist/zonos-elements/p-c2014d57.system.entry.js +1 -0
  196. package/dist/zonos-elements/{p-ee434a71.entry.js → p-c4a479ad.entry.js} +1 -1
  197. package/dist/zonos-elements/{p-4e6e9a3c.system.entry.js → p-cf0c8c77.system.entry.js} +1 -1
  198. package/dist/zonos-elements/{p-f44a3338.entry.js → p-db9cb522.entry.js} +1 -1
  199. package/dist/zonos-elements/{p-9beb2624.entry.js → p-dbd5be5d.entry.js} +1 -1
  200. package/dist/zonos-elements/p-dff1d3be.entry.js +1 -0
  201. package/dist/zonos-elements/{p-7e8aba66.system.entry.js → p-ec53c436.system.entry.js} +1 -1
  202. package/dist/zonos-elements/{p-74ebd766.js → p-f3759c70.js} +1 -1
  203. package/dist/zonos-elements/{p-5e09c22d.system.js → p-f55a2352.system.js} +1 -1
  204. package/dist/zonos-elements/{p-8d87e748.entry.js → p-fc2d5dd9.entry.js} +1 -1
  205. package/dist/zonos-elements/p-fd2d4d04.system.js +1 -0
  206. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  207. package/package.json +3 -3
  208. package/dist/cjs/formatStringWithLinks-52341fc7.js +0 -17
  209. package/dist/esm/formatStringWithLinks-9e819405.js +0 -15
  210. package/dist/esm-es5/formatStringWithLinks-9e819405.js +0 -1
  211. package/dist/esm-es5/localization-d49867ed.js +0 -1
  212. package/dist/zonos-elements/p-21d925d7.entry.js +0 -1
  213. package/dist/zonos-elements/p-2d6557ee.system.js +0 -1
  214. package/dist/zonos-elements/p-32704baa.js +0 -1
  215. package/dist/zonos-elements/p-3cf22558.entry.js +0 -1
  216. package/dist/zonos-elements/p-45e1c33b.entry.js +0 -1
  217. package/dist/zonos-elements/p-5d3ea491.system.entry.js +0 -1
  218. package/dist/zonos-elements/p-6b4ef7e0.entry.js +0 -1
  219. package/dist/zonos-elements/p-73d3fa61.entry.js +0 -1
  220. package/dist/zonos-elements/p-7522ec43.js +0 -1
  221. package/dist/zonos-elements/p-9fab45aa.system.js +0 -1
  222. package/dist/zonos-elements/p-a87561b8.js +0 -1
  223. package/dist/zonos-elements/p-c209e36d.js +0 -1
  224. package/dist/zonos-elements/p-d7bda14d.js +0 -1
  225. package/dist/zonos-elements/p-d93991c3.system.entry.js +0 -1
  226. package/dist/zonos-elements/p-e6165cc2.system.js +0 -1
  227. package/dist/zonos-elements/p-eb9369b9.system.entry.js +0 -1
  228. package/dist/zonos-elements/p-f3a73132.entry.js +0 -1
  229. package/dist/zonos-elements/p-ffbf87c8.system.entry.js +0 -1
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const cart = require('./cart-e8bc11a3.js');
7
- const paypal = require('./paypal-77bd640c.js');
8
- const localization = require('./localization-90650d7d.js');
6
+ const cart = require('./cart-0fa312a5.js');
7
+ const paypal = require('./paypal-57ab3ab6.js');
8
+ const localization = require('./localization-7fded969.js');
9
9
  const zonosStore = require('./zonosStore-fee716c9.js');
10
10
  const buildCartItemsByTempCart = require('./buildCartItemsByTempCart-edddbf4b.js');
11
11
  const handleFetch = require('./handleFetch-954f30e1.js');
@@ -175,10 +175,15 @@ const buildBigcommerceLoginUrl = ({ action } = {}) => {
175
175
  */
176
176
  const buildBigcommerceRedirectUrl = (pathname) => {
177
177
  const url = new URL(pathname, window.location.origin);
178
- const zonosQaUrl = new URLSearchParams(window.location.search).get('zonosQaUrl');
178
+ const searchParams = new URLSearchParams(window.location.search);
179
+ const zonosQaUrl = searchParams.get('zonosQaUrl');
179
180
  if (zonosQaUrl) {
180
181
  url.searchParams.set('zonosQaUrl', zonosQaUrl);
181
182
  }
183
+ // zonosDebug=1
184
+ if (searchParams.get('zonosDebug') === '1') {
185
+ url.searchParams.set('zonosDebug', '1');
186
+ }
182
187
  if (handleFetch.getIsTestMode()) {
183
188
  url.searchParams.set('zonosTestMode', '1');
184
189
  }
@@ -699,6 +704,11 @@ providedCountryCode) => {
699
704
  };
700
705
 
701
706
  const FALLBACK_SHIP_TO_COUNTRY_SELECTOR = 'select[name="shippingAddress.countryCode"]';
707
+ /**
708
+ * Native BigCommerce shipping-step "Continue" button. Clicking it commits the
709
+ * selected shipping address and advances to the payment step.
710
+ */
711
+ const BIGCOMMERCE_SHIPPING_CONTINUE_SELECTOR = '#checkout-shipping-continue, #checkout-billing-continue, #checkout-payment-continue';
702
712
  /**
703
713
  * Check if the logged-in user already has a shipping address on the checkout
704
714
  * that is internationally shippable. If so, optionally prompt the user to
@@ -806,11 +816,11 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
806
816
  overrideShippingCountry);
807
817
  if (!shippingCountry) {
808
818
  // do nothing if shipping country is not found
809
- return false;
819
+ return 'noAction';
810
820
  }
811
821
  if (!isShippableCountry(false, shippingCountry)) {
812
822
  // do nothing if shipping country is not shippable
813
- return false;
823
+ return 'noAction';
814
824
  }
815
825
  // Only check bypass after confirming the country is shippable (i.e. user is
816
826
  // about to be redirected to Zonos international checkout). Force-refresh so
@@ -831,7 +841,7 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
831
841
  // Logged-in customer is in a bypass group — keep them on BC native
832
842
  // checkout and stop polling / fetching further.
833
843
  VarianceTest.log('Bypass customer group detected on BC checkout, stopping interval', 'info');
834
- return true;
844
+ return 'bypass';
835
845
  }
836
846
  // Same force-login gate as the logged-in-default-address path — we run
837
847
  // it *after* the bypass check so reseller groups never see the login
@@ -839,7 +849,7 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
839
849
  const forceLogin = await checkBigCommerceForceLogin({ preFetched });
840
850
  if (forceLogin.shouldForceLogin && forceLogin.redirectUrl) {
841
851
  window.location.href = forceLogin.redirectUrl;
842
- return true;
852
+ return 'redirected';
843
853
  }
844
854
  if (onInternationalCheckoutSelected) {
845
855
  await onInternationalCheckoutSelected();
@@ -876,7 +886,135 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
876
886
  // having domestic shipping session. Carry over zonosQaUrl / zonosTestMode
877
887
  // so the destination page keeps using the same build/env.
878
888
  window.location.href = buildBigcommerceRedirectUrl('/');
879
- return true;
889
+ return 'redirected';
890
+ };
891
+ /**
892
+ * When `true`, the logged-in "Continue" hook re-dispatched the shopper's
893
+ * click so BigCommerce's own handler can run (domestic / bypass case). The
894
+ * hook's listener sees this flag and lets the event through untouched.
895
+ */
896
+ let isBypassingContinueHook = false;
897
+ /**
898
+ * Set to `true` once the document-level "Continue" click delegation has been
899
+ * attached, so opting out repeatedly doesn't bind it more than once.
900
+ */
901
+ let loggedInContinueDelegationAttached = false;
902
+ /**
903
+ * Resolve the shopper's currently-selected shipping country on the BC native
904
+ * checkout. Logged-in shoppers picking a saved address don't expose a
905
+ * country `<select>`, so read it from the active checkout consignment via the
906
+ * Storefront API; fall back to the `<select>` value when one is present.
907
+ */
908
+ const resolveSelectedShippingCountry = async () => {
909
+ var _a, _b, _c, _d;
910
+ const checkoutId = await localization.fetchCheckoutId();
911
+ if (checkoutId) {
912
+ const checkout = await localization.fetchBigCommerceCheckout(checkoutId);
913
+ const consignmentCountry = (_c = (_b = (_a = checkout === null || checkout === void 0 ? void 0 : checkout.consignments) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.shippingAddress) === null || _c === void 0 ? void 0 : _c.countryCode;
914
+ if (consignmentCountry) {
915
+ return consignmentCountry;
916
+ }
917
+ }
918
+ const shipToCountryElement = document.querySelector(((_d = zonosStore.zonosStore.genericSettings) === null || _d === void 0 ? void 0 : _d.bigcommerceDomesticCheckoutCountrySelector) ||
919
+ FALLBACK_SHIP_TO_COUNTRY_SELECTOR);
920
+ return (shipToCountryElement === null || shipToCountryElement === void 0 ? void 0 : shipToCountryElement.value) || null;
921
+ };
922
+ /**
923
+ * Req 2 (05CHECK-887): once a logged-in shopper with an international default
924
+ * address has chosen to "Stay on this page", we must still force them onto
925
+ * the Zonos international checkout if they end up committing an international
926
+ * shipping address. BC's saved-address flow exposes no country `<select>` to
927
+ * poll, so we hook the native shipping "Continue" button and re-check the
928
+ * selected consignment country when the shopper tries to advance.
929
+ */
930
+ /**
931
+ * Resolve the selected shipping country when the shopper clicks the native
932
+ * BC "Continue" button and, if it's international, redirect to the Zonos
933
+ * checkout. On any outcome other than a redirect — domestic, bypass group,
934
+ * or an unexpected error — replay the click so BigCommerce's own handler runs
935
+ * and the shopper is never left stuck on the shipping step.
936
+ */
937
+ const handleLoggedInInternationalContinue = async (continueButton, observer) => {
938
+ // Default to replaying the native click; only a confirmed international
939
+ // redirect (page navigating away) suppresses it.
940
+ let shouldReplayClick = true;
941
+ try {
942
+ let country = null;
943
+ try {
944
+ country = await resolveSelectedShippingCountry();
945
+ }
946
+ catch (error) {
947
+ handleFetch.logError('Error resolving selected shipping country on BC continue', error);
948
+ }
949
+ // When the shopper is committing an international address we're about to
950
+ // save the domestic shipping session and redirect to `/`. Disconnect this
951
+ // /checkout-page observer first: otherwise its own session-detection
952
+ // branch races the save — it would append the hidden redirect button and
953
+ // open checkout locally, consuming and clearing the session before the
954
+ // navigation to `/` lands, leaving the redirect a no-op. (The `/` page
955
+ // runs its own fresh watcher to open checkout.)
956
+ if (country && isShippableCountry(false, country)) {
957
+ observer.disconnect();
958
+ }
959
+ const decision = country
960
+ ? await handleInternationalCheckoutSelected(country)
961
+ : 'noAction';
962
+ // `redirected` → the page is navigating to the Zonos international
963
+ // checkout, so don't replay. `bypass` / `noAction` → the shopper stays on
964
+ // BC native checkout, so fall through and replay the click.
965
+ if (decision === 'redirected') {
966
+ shouldReplayClick = false;
967
+ }
968
+ }
969
+ catch (error) {
970
+ // We already blocked BC's native click; if resolving the country or the
971
+ // redirect helper throws, replay so BC can advance rather than leaving
972
+ // the shopper stuck on the shipping step.
973
+ handleFetch.logError('Error handling BC continue international redirect', error);
974
+ }
975
+ if (shouldReplayClick) {
976
+ isBypassingContinueHook = true;
977
+ continueButton.click();
978
+ isBypassingContinueHook = false;
979
+ }
980
+ };
981
+ /**
982
+ * Req 2 (05CHECK-887): attach the logged-in international-redirect hook via a
983
+ * single capture-phase listener on `document` (delegation) rather than
984
+ * binding the button node directly. Delegation is resilient to BC
985
+ * re-rendering the shipping step and — crucially — to the MutationObserver
986
+ * disconnecting once the country `<select>` path sets up its polling
987
+ * interval: the "Continue" button may only render after that point, so a
988
+ * node-bound listener attached from the observer could miss it entirely.
989
+ * Attached once, on opt-out.
990
+ */
991
+ const attachLoggedInInternationalContinueDelegation = (observer) => {
992
+ if (loggedInContinueDelegationAttached) {
993
+ return;
994
+ }
995
+ loggedInContinueDelegationAttached = true;
996
+ document.addEventListener('click', event => {
997
+ // Programmatic replay for the domestic / bypass case — let BC's own
998
+ // handler run without interference.
999
+ if (isBypassingContinueHook) {
1000
+ return;
1001
+ }
1002
+ const { target } = event;
1003
+ if (!(target instanceof Element)) {
1004
+ return;
1005
+ }
1006
+ const continueButton = target.closest(BIGCOMMERCE_SHIPPING_CONTINUE_SELECTOR);
1007
+ if (!continueButton) {
1008
+ return;
1009
+ }
1010
+ // Block BC's native advance until we know whether the selected shipping
1011
+ // country forces an international redirect. Capture phase +
1012
+ // stopImmediatePropagation (done synchronously here, before the async
1013
+ // handler) prevents BC's React click handler from firing.
1014
+ event.preventDefault();
1015
+ event.stopImmediatePropagation();
1016
+ void handleLoggedInInternationalContinue(continueButton, observer);
1017
+ }, true);
880
1018
  };
881
1019
  let isProcessing = false;
882
1020
  let intervalCreated = false;
@@ -952,6 +1090,10 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
952
1090
  // observer logic so the country-change watcher still fires when
953
1091
  // the user manually picks an international country in BC's UI.
954
1092
  loggedInAddressCheckSkipped = true;
1093
+ // Attach the "Continue" redirect hook now (once). Delegation on
1094
+ // `document` keeps it working even after this observer disconnects
1095
+ // when the country <select> path sets up its interval below.
1096
+ attachLoggedInInternationalContinueDelegation(observer);
955
1097
  }
956
1098
  }
957
1099
  catch (error) {
@@ -987,11 +1129,11 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
987
1129
  }
988
1130
  isProcessing = true;
989
1131
  try {
990
- const shouldStopPolling = await handleInternationalCheckoutSelected();
1132
+ const decision = await handleInternationalCheckoutSelected();
991
1133
  // Stop the interval once either:
992
1134
  // - the user is being redirected to Zonos international checkout
993
1135
  // - the logged-in customer is in a bypass group (stay on BC checkout)
994
- if (shouldStopPolling) {
1136
+ if (decision === 'redirected' || decision === 'bypass') {
995
1137
  clearInterval(interval);
996
1138
  return;
997
1139
  }
@@ -1931,7 +2073,9 @@ const ZonosCheckout = class {
1931
2073
  // selector configured yet) — otherwise the redirect-back never reopens
1932
2074
  // the checkout dialog to show the success/finish screen.
1933
2075
  const hasRedirectHiddenButton = !!document.querySelector(`#${CheckoutConfig.checkoutHiddenBtnSelector}`);
1934
- VarianceTest.log(`attach checkout ${buttonAnchorSelector}`);
2076
+ VarianceTest.log(`attach checkout ${buttonAnchorSelector}`, 'info', {
2077
+ href: window.location.href,
2078
+ });
1935
2079
  VarianceTest.log(`attach checkout to always trigger international checkout selector: ${alwaysTriggerInternationalCheckoutSelector}`);
1936
2080
  // allow to load checkout if cartData is ready (Checkout can be loaded right away if tempCartUUID is in the URL)
1937
2081
  if (!buttonAnchorSelector &&
@@ -2053,6 +2197,38 @@ const ZonosCheckout = class {
2053
2197
  if (!result) {
2054
2198
  throw new Error('Error building cart');
2055
2199
  }
2200
+ // Early inventory / stock check (05CHECK-887): mirror the native
2201
+ // cart, which blocks checkout when an item has sold out, instead of
2202
+ // only catching it at payment time (which abandons late). The cart
2203
+ // items are now built and the dialog is still in its loading state,
2204
+ // so run the merchant `onInventoryCheck` callback now. Skip legacy
2205
+ // checkout — its inventory check reserves stock, and reserving here
2206
+ // *and* at pay time would double-reserve; legacy keeps its
2207
+ // pay-time-only check. `stripeStoreHandleInventoryCheck` no-ops when
2208
+ // no `onInventoryCheck` callback is configured.
2209
+ if (!window.Zonos.isLegacyCheckout) {
2210
+ let earlyInventoryMessage = null;
2211
+ try {
2212
+ earlyInventoryMessage = await cart.stripeStoreHandleInventoryCheck();
2213
+ }
2214
+ catch (_c) {
2215
+ // A throwing merchant callback should stop checkout, not open it.
2216
+ earlyInventoryMessage = localization.translate('Unable to check inventory. Please try again.');
2217
+ }
2218
+ if (earlyInventoryMessage) {
2219
+ // Surface the same "Couldn't place order" dialog and stop
2220
+ // before the checkout is revealed. We return here before the
2221
+ // session/analytics setup below runs, so close the (still
2222
+ // loading) checkout dialog rather than leaving a
2223
+ // half-initialized checkout visible behind the alert. The
2224
+ // inventory-failure dialog renders independently of `this.open`,
2225
+ // and "Return to cart" resets the message + closes cleanly.
2226
+ cart.cartStore.inventoryCheckErrorMessage = earlyInventoryMessage;
2227
+ cart.stripeStore.isFetchingSession = false;
2228
+ this.open = false;
2229
+ return;
2230
+ }
2231
+ }
2056
2232
  (_a = window.opener) === null || _a === void 0 ? void 0 : _a.postMessage({
2057
2233
  checkoutSessionId: localization.storageStore.checkoutSessionId,
2058
2234
  type: 'zonos-checkout-session-update',
@@ -3001,7 +3177,7 @@ const ZonosCheckout = class {
3001
3177
  this.isMobile && 'mobile',
3002
3178
  this.isIframed && 'iframed',
3003
3179
  this.hiddenMode && 'hidden-mode',
3004
- ]) }, this.preview ? (renderContent()) : (index.h("zonos-dialog", { borderStyle: style, class: "zonos--checkout-dialog", "data-theme": rightSideTheme, height: "980px", isLoading: dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialogHandler(), open: this.open, width: "1200px" }, renderContent())), index.h("zonos-dialog", { isLoading: true, loadingText: localization.translate('You will be redirected to international checkout shortly.'), loadingTitle: localization.translate('We detected that you are shipping to an international address.'), noClickOutside: true, noCloseButton: true, open: this.detectedDomesticCheckoutDialogOpen, width: "450px" }), index.h("zonos-dialog", { isLoading: true, loadingText: localization.translate('You will be redirected to domestic checkout shortly.'), loadingTitle: localization.translate('We detected that you are shipping to a domestic address.'), noClickOutside: true, noCloseButton: true, open: this.redirectToDomesticCheckoutDialogOpen, width: "450px" }), index.h("zonos-confirm-dialog", { class: "zonos--logged-in-intl-address-dialog", dialogCancelBtnText: localization.translate('Stay on this page'), dialogConfirmBtnText: localization.translate('Continue to international checkout'), dialogIntent: "info", dialogOpen: this.loggedInIntlAddressConfirmDialogOpen, dialogSubtitle: localization.translate('Your saved default address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?'), dialogTitle: localization.translate('International shipping address detected'), dialogWidth: 480, onCancelClicked: () => {
3180
+ ]) }, this.preview ? (renderContent()) : (index.h("zonos-dialog", { borderStyle: style, class: "zonos--checkout-dialog", "data-theme": rightSideTheme, height: "980px", isLoading: dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialogHandler(), open: this.open, width: "1200px" }, renderContent())), index.h("zonos-dialog", { isLoading: true, loadingText: localization.translate('You will be redirected to international checkout shortly.'), loadingTitle: localization.translate('We detected that you are shipping to an international address.'), noClickOutside: true, noCloseButton: true, open: this.detectedDomesticCheckoutDialogOpen, width: "450px" }), index.h("zonos-dialog", { isLoading: true, loadingText: localization.translate('You will be redirected to domestic checkout shortly.'), loadingTitle: localization.translate('We detected that you are shipping to a domestic address.'), noClickOutside: true, noCloseButton: true, open: this.redirectToDomesticCheckoutDialogOpen, width: "450px" }), index.h("zonos-confirm-dialog", { class: "zonos--logged-in-intl-address-dialog", dialogCancelBtnText: localization.translate('Stay on this page'), dialogConfirmBtnText: localization.translate('Continue to international checkout'), dialogIntent: "info", dialogOpen: this.loggedInIntlAddressConfirmDialogOpen, dialogSubtitle: localization.translate('Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?'), dialogTitle: localization.translate('International shipping address detected'), dialogWidth: 480, onCancelClicked: () => {
3005
3181
  var _a;
3006
3182
  this.loggedInIntlAddressConfirmDialogOpen = false;
3007
3183
  (_a = this.loggedInIntlAddressResolver) === null || _a === void 0 ? void 0 : _a.call(this, 'stay');
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const cart = require('./cart-e8bc11a3.js');
6
+ const cart = require('./cart-0fa312a5.js');
7
7
  const cleanHtmlMarkdown = require('./cleanHtmlMarkdown-57147de7.js');
8
8
  const zonosStore = require('./zonosStore-fee716c9.js');
9
9
  const classes = require('./classes-b7918f56.js');
10
10
  const styles = require('./styles-d1e64fb9.js');
11
- require('./localization-90650d7d.js');
11
+ require('./localization-7fded969.js');
12
12
  require('./handleFetch-954f30e1.js');
13
13
  require('./VarianceTest-bec00ea8.js');
14
14
  require('./isDarkColor-ebc74b4d.js');
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const collect = require('./collect-e6485168.js');
7
- const cart = require('./cart-e8bc11a3.js');
8
- const paypal = require('./paypal-77bd640c.js');
9
- const localization = require('./localization-90650d7d.js');
6
+ const collect = require('./collect-f9c4ca7c.js');
7
+ const cart = require('./cart-0fa312a5.js');
8
+ const paypal = require('./paypal-57ab3ab6.js');
9
+ const localization = require('./localization-7fded969.js');
10
10
  const zonosStore = require('./zonosStore-fee716c9.js');
11
11
  const handleFetch = require('./handleFetch-954f30e1.js');
12
12
  const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
@@ -15,8 +15,8 @@ const VarianceTest = require('./VarianceTest-bec00ea8.js');
15
15
  const isCollectMobileTablet = require('./isCollectMobileTablet-884d4280.js');
16
16
  const classes = require('./classes-b7918f56.js');
17
17
  const ILanguage = require('./ILanguage-98b04442.js');
18
- const renderCheckoutCurrency = require('./renderCheckoutCurrency-66377cf5.js');
19
- const placeTestOrder = require('./placeTestOrder-7767d119.js');
18
+ const renderCheckoutCurrency = require('./renderCheckoutCurrency-41d48407.js');
19
+ const placeTestOrder = require('./placeTestOrder-35e0d3bd.js');
20
20
  const renderFallback = require('./renderFallback-bc20ee20.js');
21
21
  require('./isDarkColor-ebc74b4d.js');
22
22
  require('./TaxId-12acedde.js');
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const collect = require('./collect-e6485168.js');
7
- const cart = require('./cart-e8bc11a3.js');
8
- const paypal = require('./paypal-77bd640c.js');
9
- const localization = require('./localization-90650d7d.js');
6
+ const collect = require('./collect-f9c4ca7c.js');
7
+ const cart = require('./cart-0fa312a5.js');
8
+ const paypal = require('./paypal-57ab3ab6.js');
9
+ const localization = require('./localization-7fded969.js');
10
10
  const zonosStore = require('./zonosStore-fee716c9.js');
11
11
  const buildCartItemsByTempCart = require('./buildCartItemsByTempCart-edddbf4b.js');
12
12
  const handleFetch = require('./handleFetch-954f30e1.js');
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const cart = require('./cart-e8bc11a3.js');
7
- const localization = require('./localization-90650d7d.js');
6
+ const cart = require('./cart-0fa312a5.js');
7
+ const localization = require('./localization-7fded969.js');
8
8
  const zonosStore = require('./zonosStore-fee716c9.js');
9
9
  const getGenericSettingsOverride = require('./getGenericSettingsOverride-c0ca32b9.js');
10
10
  const handleFetch = require('./handleFetch-954f30e1.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const localization = require('./localization-90650d7d.js');
6
+ const localization = require('./localization-7fded969.js');
7
7
  const zonosStore = require('./zonosStore-fee716c9.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  require('./handleFetch-954f30e1.js');
@@ -3,14 +3,15 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const localization = require('./localization-90650d7d.js');
6
+ const localization = require('./localization-7fded969.js');
7
7
  const zonosStore = require('./zonosStore-fee716c9.js');
8
- const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
8
+ const formatStringWithLinks = require('./formatStringWithLinks-c25b4018.js');
9
9
  const isDarkColor = require('./isDarkColor-ebc74b4d.js');
10
10
  const ILanguage = require('./ILanguage-98b04442.js');
11
11
  const classes = require('./classes-b7918f56.js');
12
12
  require('./handleFetch-954f30e1.js');
13
13
  require('./VarianceTest-bec00ea8.js');
14
+ require('./isSameHostCheckoutLink-6148cabb.js');
14
15
 
15
16
  /**
16
17
  * Fuse.js v7.4.2 - Lightweight fuzzy-search (http://fusejs.io)
@@ -3,15 +3,16 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const localization = require('./localization-90650d7d.js');
6
+ const localization = require('./localization-7fded969.js');
7
7
  const zonosStore = require('./zonosStore-fee716c9.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
- const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
10
- const hasInclusivePrice = require('./hasInclusivePrice-798ce42d.js');
9
+ const formatStringWithLinks = require('./formatStringWithLinks-c25b4018.js');
10
+ const hasInclusivePrice = require('./hasInclusivePrice-95431bca.js');
11
11
  const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
12
12
  const TaxId = require('./TaxId-12acedde.js');
13
13
  require('./handleFetch-954f30e1.js');
14
14
  require('./VarianceTest-bec00ea8.js');
15
+ require('./isSameHostCheckoutLink-6148cabb.js');
15
16
 
16
17
  const getHasMoreSpaceAbove = (ref) => {
17
18
  const componentRect = ref.getBoundingClientRect();
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
6
  const debounce = require('./debounce-9a712c79.js');
7
- const localization = require('./localization-90650d7d.js');
7
+ const localization = require('./localization-7fded969.js');
8
8
  const zonosStore = require('./zonosStore-fee716c9.js');
9
9
  const classes = require('./classes-b7918f56.js');
10
10
  const handleFetch = require('./handleFetch-954f30e1.js');
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const cart = require('./cart-e8bc11a3.js');
7
- const localization = require('./localization-90650d7d.js');
8
- const renderCheckoutCurrency = require('./renderCheckoutCurrency-66377cf5.js');
6
+ const cart = require('./cart-0fa312a5.js');
7
+ const localization = require('./localization-7fded969.js');
8
+ const renderCheckoutCurrency = require('./renderCheckoutCurrency-41d48407.js');
9
9
  const classes = require('./classes-b7918f56.js');
10
- const invoice = require('./invoice-dff7ec81.js');
10
+ const invoice = require('./invoice-ce757565.js');
11
11
  const renderFallback = require('./renderFallback-bc20ee20.js');
12
12
  require('./zonosStore-fee716c9.js');
13
13
  require('./VarianceTest-bec00ea8.js');
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const cart = require('./cart-e8bc11a3.js');
7
- const paypal = require('./paypal-77bd640c.js');
8
- const localization = require('./localization-90650d7d.js');
6
+ const cart = require('./cart-0fa312a5.js');
7
+ const paypal = require('./paypal-57ab3ab6.js');
8
+ const localization = require('./localization-7fded969.js');
9
9
  const zonosStore = require('./zonosStore-fee716c9.js');
10
10
  const handleFetch = require('./handleFetch-954f30e1.js');
11
11
  const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
@@ -14,9 +14,9 @@ const VarianceTest = require('./VarianceTest-bec00ea8.js');
14
14
  const isInvoiceMobileTablet = require('./isInvoiceMobileTablet-dde41e4e.js');
15
15
  const classes = require('./classes-b7918f56.js');
16
16
  const ILanguage = require('./ILanguage-98b04442.js');
17
- const invoice = require('./invoice-dff7ec81.js');
18
- const renderCheckoutCurrency = require('./renderCheckoutCurrency-66377cf5.js');
19
- const placeTestOrder = require('./placeTestOrder-7767d119.js');
17
+ const invoice = require('./invoice-ce757565.js');
18
+ const renderCheckoutCurrency = require('./renderCheckoutCurrency-41d48407.js');
19
+ const placeTestOrder = require('./placeTestOrder-35e0d3bd.js');
20
20
  const renderFallback = require('./renderFallback-bc20ee20.js');
21
21
  require('./isDarkColor-ebc74b4d.js');
22
22
  require('./TaxId-12acedde.js');
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const cart = require('./cart-e8bc11a3.js');
7
- const invoice = require('./invoice-dff7ec81.js');
8
- const paypal = require('./paypal-77bd640c.js');
9
- const localization = require('./localization-90650d7d.js');
6
+ const cart = require('./cart-0fa312a5.js');
7
+ const invoice = require('./invoice-ce757565.js');
8
+ const paypal = require('./paypal-57ab3ab6.js');
9
+ const localization = require('./localization-7fded969.js');
10
10
  const zonosStore = require('./zonosStore-fee716c9.js');
11
11
  const buildCartItemsByTempCart = require('./buildCartItemsByTempCart-edddbf4b.js');
12
12
  const handleFetch = require('./handleFetch-954f30e1.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const localization = require('./localization-90650d7d.js');
6
+ const localization = require('./localization-7fded969.js');
7
7
  const zonosStore = require('./zonosStore-fee716c9.js');
8
8
  const ILanguage = require('./ILanguage-98b04442.js');
9
9
  require('./handleFetch-954f30e1.js');
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const cart = require('./cart-e8bc11a3.js');
7
- const localization = require('./localization-90650d7d.js');
6
+ const cart = require('./cart-0fa312a5.js');
7
+ const localization = require('./localization-7fded969.js');
8
8
  const zonosStore = require('./zonosStore-fee716c9.js');
9
- const renderCheckoutCurrency = require('./renderCheckoutCurrency-66377cf5.js');
9
+ const renderCheckoutCurrency = require('./renderCheckoutCurrency-41d48407.js');
10
10
  const getBorderRadius = require('./getBorderRadius-4da24d7c.js');
11
11
  require('./VarianceTest-bec00ea8.js');
12
12
  require('./handleFetch-954f30e1.js');
@@ -7,6 +7,7 @@ import { zonosStore } from "../../../store/zonosStore";
7
7
  import { isEuDapRemittance } from "../../../utils/checkout/isEuDapRemittance";
8
8
  import { renderCheckoutCurrency } from "../../../utils/checkout/renderCheckoutCurrency";
9
9
  import { hasInclusivePrice } from "../../../utils/hasInclusivePrice";
10
+ import { isSameHostCheckoutLink } from "../../../utils/isSameHostCheckoutLink";
10
11
  import { parseLinkedText } from "../../../utils/parseLinkedText";
11
12
  import { DUTY_KEY, TAXES_KEY } from "../../../../constants/key";
12
13
  export class ZonosCartSubtotal {
@@ -39,7 +40,18 @@ export class ZonosCartSubtotal {
39
40
  * [[parseLinkedText]] and are emitted as VNodes (never `innerHTML`) so
40
41
  * untrusted strings can't inject HTML.
41
42
  */
42
- this.renderMessageLine = (line) => parseLinkedText(line).map(segment => segment.type === 'link' ? (h("zonos-link", { href: segment.href, rel: "noopener noreferrer", target: "_blank" }, segment.text)) : (segment.value));
43
+ this.renderMessageLine = (line) => parseLinkedText(line).map(segment => {
44
+ var _a;
45
+ if (segment.type !== 'link') {
46
+ return segment.value;
47
+ }
48
+ // For BigCommerce, a same-host `/checkout` link should navigate the
49
+ // current tab (`_self`) instead of opening a new one — this unloads the
50
+ // Zonos checkout and opens the native checkout in its place rather than
51
+ // leaving two checkouts open at once (05CHECK-887).
52
+ const shouldRedirectInPlace = !!((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.isBigCommerce) && isSameHostCheckoutLink(segment.href);
53
+ return (h("zonos-link", { href: segment.href, rel: "noopener noreferrer", target: shouldRedirectInPlace ? '_self' : '_blank' }, segment.text));
54
+ });
43
55
  this.renderCustomMessage = () => {
44
56
  const messageLines = cartStore.customMessage.filter(line => !!line.trim());
45
57
  if (!messageLines.length) {
@@ -763,7 +763,9 @@ export class ZonosCheckout {
763
763
  // selector configured yet) — otherwise the redirect-back never reopens
764
764
  // the checkout dialog to show the success/finish screen.
765
765
  const hasRedirectHiddenButton = !!document.querySelector(`#${checkoutHiddenBtnSelector}`);
766
- log(`attach checkout ${buttonAnchorSelector}`);
766
+ log(`attach checkout ${buttonAnchorSelector}`, 'info', {
767
+ href: window.location.href,
768
+ });
767
769
  log(`attach checkout to always trigger international checkout selector: ${alwaysTriggerInternationalCheckoutSelector}`);
768
770
  // allow to load checkout if cartData is ready (Checkout can be loaded right away if tempCartUUID is in the URL)
769
771
  if (!buttonAnchorSelector &&
@@ -885,6 +887,38 @@ export class ZonosCheckout {
885
887
  if (!result) {
886
888
  throw new Error('Error building cart');
887
889
  }
890
+ // Early inventory / stock check (05CHECK-887): mirror the native
891
+ // cart, which blocks checkout when an item has sold out, instead of
892
+ // only catching it at payment time (which abandons late). The cart
893
+ // items are now built and the dialog is still in its loading state,
894
+ // so run the merchant `onInventoryCheck` callback now. Skip legacy
895
+ // checkout — its inventory check reserves stock, and reserving here
896
+ // *and* at pay time would double-reserve; legacy keeps its
897
+ // pay-time-only check. `stripeStoreHandleInventoryCheck` no-ops when
898
+ // no `onInventoryCheck` callback is configured.
899
+ if (!window.Zonos.isLegacyCheckout) {
900
+ let earlyInventoryMessage = null;
901
+ try {
902
+ earlyInventoryMessage = await stripeStoreHandleInventoryCheck();
903
+ }
904
+ catch (_c) {
905
+ // A throwing merchant callback should stop checkout, not open it.
906
+ earlyInventoryMessage = translate('Unable to check inventory. Please try again.');
907
+ }
908
+ if (earlyInventoryMessage) {
909
+ // Surface the same "Couldn't place order" dialog and stop
910
+ // before the checkout is revealed. We return here before the
911
+ // session/analytics setup below runs, so close the (still
912
+ // loading) checkout dialog rather than leaving a
913
+ // half-initialized checkout visible behind the alert. The
914
+ // inventory-failure dialog renders independently of `this.open`,
915
+ // and "Return to cart" resets the message + closes cleanly.
916
+ cartStore.inventoryCheckErrorMessage = earlyInventoryMessage;
917
+ stripeStore.isFetchingSession = false;
918
+ this.open = false;
919
+ return;
920
+ }
921
+ }
888
922
  (_a = window.opener) === null || _a === void 0 ? void 0 : _a.postMessage({
889
923
  checkoutSessionId: storageStore.checkoutSessionId,
890
924
  type: 'zonos-checkout-session-update',
@@ -1833,7 +1867,7 @@ export class ZonosCheckout {
1833
1867
  this.isMobile && 'mobile',
1834
1868
  this.isIframed && 'iframed',
1835
1869
  this.hiddenMode && 'hidden-mode',
1836
- ]) }, this.preview ? (renderContent()) : (h("zonos-dialog", { borderStyle: style, class: "zonos--checkout-dialog", "data-theme": rightSideTheme, height: "980px", isLoading: dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialogHandler(), open: this.open, width: "1200px" }, renderContent())), h("zonos-dialog", { isLoading: true, loadingText: translate('You will be redirected to international checkout shortly.'), loadingTitle: translate('We detected that you are shipping to an international address.'), noClickOutside: true, noCloseButton: true, open: this.detectedDomesticCheckoutDialogOpen, width: "450px" }), h("zonos-dialog", { isLoading: true, loadingText: translate('You will be redirected to domestic checkout shortly.'), loadingTitle: translate('We detected that you are shipping to a domestic address.'), noClickOutside: true, noCloseButton: true, open: this.redirectToDomesticCheckoutDialogOpen, width: "450px" }), h("zonos-confirm-dialog", { class: "zonos--logged-in-intl-address-dialog", dialogCancelBtnText: translate('Stay on this page'), dialogConfirmBtnText: translate('Continue to international checkout'), dialogIntent: "info", dialogOpen: this.loggedInIntlAddressConfirmDialogOpen, dialogSubtitle: translate('Your saved default address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?'), dialogTitle: translate('International shipping address detected'), dialogWidth: 480, onCancelClicked: () => {
1870
+ ]) }, this.preview ? (renderContent()) : (h("zonos-dialog", { borderStyle: style, class: "zonos--checkout-dialog", "data-theme": rightSideTheme, height: "980px", isLoading: dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialogHandler(), open: this.open, width: "1200px" }, renderContent())), h("zonos-dialog", { isLoading: true, loadingText: translate('You will be redirected to international checkout shortly.'), loadingTitle: translate('We detected that you are shipping to an international address.'), noClickOutside: true, noCloseButton: true, open: this.detectedDomesticCheckoutDialogOpen, width: "450px" }), h("zonos-dialog", { isLoading: true, loadingText: translate('You will be redirected to domestic checkout shortly.'), loadingTitle: translate('We detected that you are shipping to a domestic address.'), noClickOutside: true, noCloseButton: true, open: this.redirectToDomesticCheckoutDialogOpen, width: "450px" }), h("zonos-confirm-dialog", { class: "zonos--logged-in-intl-address-dialog", dialogCancelBtnText: translate('Stay on this page'), dialogConfirmBtnText: translate('Continue to international checkout'), dialogIntent: "info", dialogOpen: this.loggedInIntlAddressConfirmDialogOpen, dialogSubtitle: translate('Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?'), dialogTitle: translate('International shipping address detected'), dialogWidth: 480, onCancelClicked: () => {
1837
1871
  var _a;
1838
1872
  this.loggedInIntlAddressConfirmDialogOpen = false;
1839
1873
  (_a = this.loggedInIntlAddressResolver) === null || _a === void 0 ? void 0 : _a.call(this, 'stay');
@@ -818,8 +818,8 @@ export const stringsArabic = {
818
818
  'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
819
819
  value: 'تمت عملية الدفع بنجاح! شكرا لتسوقك معنا! نأمل أن تكون قد استمتعت بتجربة رائعة ودعمك يعني لنا الكثير.',
820
820
  },
821
- 'Your saved default address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
822
- value: 'عنوانك الافتراضي المحفوظ يتم شحنه دوليًا. هل ترغب في الاستمرار إلى الدفع الدولي، أم البقاء هنا واختيار عنوان محلي؟',
821
+ 'Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?': {
822
+ value: 'عنوانك المحدد يتم شحنه دوليًا. هل ترغب في الاستمرار إلى الدفع الدولي، أم البقاء هنا واختيار عنوان محلي؟',
823
823
  },
824
824
  'Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.': {
825
825
  value: 'طريقة الدفع التي اخترتها تتطلب تحققًا إضافيًا. يرجى اتباع التعليمات المقدمة من مزود الدفع الخاص بك لإكمال المعاملة.',