@zonos/elements 1.5.1 → 1.5.2

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-CiXlehwQ.js → cart-BJpqPdFU.js} +13 -13
  2. package/dist/cjs/{collect-Drr8fY-q.js → collect-CyUttsvB.js} +3 -3
  3. package/dist/cjs/{getMissingRequiredShippingFields-DI6qF1z3.js → getMissingRequiredShippingFields-DEbNbRAZ.js} +1 -1
  4. package/dist/cjs/{handleFetch-DQLhurnE.js → handleFetch-DVfjFTYO.js} +181 -71
  5. package/dist/cjs/{hasInclusivePrice-84KS94yH.js → hasInclusivePrice-CEPf3_FG.js} +1 -1
  6. package/dist/cjs/index.cjs.js +104 -12
  7. package/dist/cjs/{invoice-5hVfSXpb.js → invoice-DzRkkpLu.js} +3 -3
  8. package/dist/cjs/{localization-B2mjW0Xa.js → localization-BhNVhLZs.js} +24 -48
  9. package/dist/cjs/{paypal-pd8Nz_R_.js → paypal-DCSqbdjW.js} +4 -4
  10. package/dist/cjs/{placeTestOrder-DrI8rD9o.js → placeTestOrder-Bkip4PUT.js} +3 -3
  11. package/dist/cjs/{renderCheckoutCurrency-u5q8YdUb.js → renderCheckoutCurrency-BDvEZ3Hv.js} +2 -2
  12. package/dist/cjs/{shouldShowLanguageSelect-gBg4KeTQ.js → shouldShowLanguageSelect-NOVWOU53.js} +1 -1
  13. package/dist/cjs/{submitGtag-Rc-S3PnH.js → submitGtag-D4sB7w4z.js} +1 -1
  14. package/dist/cjs/{taxIdFields-BrIaPTcd.js → taxIdFields-e4OCgr8K.js} +2 -2
  15. package/dist/cjs/{updateCheckoutSessionAttributes-d0IKpwW8.js → updateCheckoutSessionAttributes-KxwcsKhM.js} +1 -1
  16. package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +5 -5
  17. package/dist/cjs/zonos-address-display_2.cjs.entry.js +2 -2
  18. package/dist/cjs/zonos-address_4.cjs.entry.js +4 -4
  19. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +4 -4
  20. package/dist/cjs/zonos-card_5.cjs.entry.js +5 -5
  21. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +18 -18
  22. package/dist/cjs/zonos-checkout.cjs.entry.js +9 -9
  23. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +3 -3
  24. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +9 -9
  25. package/dist/cjs/zonos-collect.cjs.entry.js +6 -6
  26. package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
  27. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  28. package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -3
  29. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
  30. package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
  31. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +5 -5
  32. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +9 -9
  33. package/dist/cjs/zonos-invoice.cjs.entry.js +6 -6
  34. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  35. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +4 -4
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +8 -7
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +4 -3
  38. package/dist/collection/components/main/zonos-controller.js +3 -2
  39. package/dist/collection/components/store/checkout/cart.js +3 -2
  40. package/dist/collection/components/store/checkout/stripe.js +10 -9
  41. package/dist/collection/components/store/storageStore.js +7 -6
  42. package/dist/collection/components/utils/__tests__/helpers/blockStorage.js +24 -0
  43. package/dist/collection/components/utils/api/getExchangeRate.js +2 -1
  44. package/dist/collection/components/utils/handleFetch.js +19 -9
  45. package/dist/collection/components/utils/hello/countryOverrideStorage.js +17 -40
  46. package/dist/collection/components/utils/logging/installConstructorCapture.js +58 -0
  47. package/dist/collection/components/utils/logging/reportBlockedStorage.js +34 -0
  48. package/dist/collection/components/utils/logging/sendErrorLog.js +8 -1
  49. package/dist/collection/components/utils/logging/startZonosInit.js +35 -0
  50. package/dist/collection/components/utils/logging/thrownMessage.js +16 -0
  51. package/dist/collection/components/utils/safeStorage.js +39 -0
  52. package/dist/collection/scripts/_getZonosQaUrl.js +3 -2
  53. package/dist/collection/scripts/_zonosBase.js +6 -2
  54. package/dist/collection/types/generated/graphql.frontend.types.js +0 -16
  55. package/dist/collection/types/generated/graphql.internal.types.js +215 -1
  56. package/dist/esm/{cart-DmJkjiDE.js → cart-BS5mSI8x.js} +13 -13
  57. package/dist/esm/{collect-BV5GTPmh.js → collect-B9ZxDDl7.js} +3 -3
  58. package/dist/esm/{getMissingRequiredShippingFields-DljgpDZe.js → getMissingRequiredShippingFields-BkEV865q.js} +1 -1
  59. package/dist/esm/{handleFetch-D5GYDF-O.js → handleFetch-BFVO7oAR.js} +178 -72
  60. package/dist/esm/{hasInclusivePrice-DhGXpH2D.js → hasInclusivePrice-zSvDReDb.js} +1 -1
  61. package/dist/esm/index.js +104 -12
  62. package/dist/esm/{invoice-CO-iqlni.js → invoice-6iTuS6ek.js} +3 -3
  63. package/dist/esm/{localization-DHM91diu.js → localization-CXHiWcJp.js} +24 -48
  64. package/dist/esm/{paypal-BfW5aLJw.js → paypal-BE_NVBoy.js} +4 -4
  65. package/dist/esm/{placeTestOrder-CyWUFhxD.js → placeTestOrder-BXA9K9Iy.js} +3 -3
  66. package/dist/esm/{renderCheckoutCurrency-B31ZNkUv.js → renderCheckoutCurrency-KMa4HlAf.js} +2 -2
  67. package/dist/esm/{shouldShowLanguageSelect-DwSfSHar.js → shouldShowLanguageSelect-BI_ApEsQ.js} +1 -1
  68. package/dist/esm/{submitGtag-BEFrutel.js → submitGtag-C5xzFHjG.js} +1 -1
  69. package/dist/esm/{taxIdFields-ByEYfsO5.js → taxIdFields-BUKnHMaL.js} +2 -2
  70. package/dist/esm/{updateCheckoutSessionAttributes-B0bQH0uw.js → updateCheckoutSessionAttributes-C9bMKTjz.js} +1 -1
  71. package/dist/esm/zonos-address-completion-dialog_7.entry.js +5 -5
  72. package/dist/esm/zonos-address-display_2.entry.js +2 -2
  73. package/dist/esm/zonos-address_4.entry.js +4 -4
  74. package/dist/esm/zonos-airwallex-payment.entry.js +4 -4
  75. package/dist/esm/zonos-card_5.entry.js +5 -5
  76. package/dist/esm/zonos-cart-items_12.entry.js +18 -18
  77. package/dist/esm/zonos-checkout.entry.js +9 -9
  78. package/dist/esm/zonos-collect-cart-items_3.entry.js +3 -3
  79. package/dist/esm/zonos-collect-finish_6.entry.js +9 -9
  80. package/dist/esm/zonos-collect.entry.js +6 -6
  81. package/dist/esm/zonos-controller.entry.js +6 -6
  82. package/dist/esm/zonos-country-flag.entry.js +2 -2
  83. package/dist/esm/zonos-country-select_4.entry.js +3 -3
  84. package/dist/esm/zonos-hello-dialog.entry.js +3 -3
  85. package/dist/esm/zonos-hello.entry.js +2 -2
  86. package/dist/esm/zonos-invoice-cart-items_2.entry.js +5 -5
  87. package/dist/esm/zonos-invoice-finish_5.entry.js +9 -9
  88. package/dist/esm/zonos-invoice.entry.js +6 -6
  89. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  90. package/dist/esm/zonos-policy-consent_2.entry.js +4 -4
  91. package/dist/esm-es5/{cart-DmJkjiDE.js → cart-BS5mSI8x.js} +58 -58
  92. package/dist/esm-es5/{collect-BV5GTPmh.js → collect-B9ZxDDl7.js} +1 -1
  93. package/dist/esm-es5/{getMissingRequiredShippingFields-DljgpDZe.js → getMissingRequiredShippingFields-BkEV865q.js} +1 -1
  94. package/dist/esm-es5/handleFetch-BFVO7oAR.js +73 -0
  95. package/dist/esm-es5/{hasInclusivePrice-DhGXpH2D.js → hasInclusivePrice-zSvDReDb.js} +1 -1
  96. package/dist/esm-es5/index.js +26 -8
  97. package/dist/esm-es5/{invoice-CO-iqlni.js → invoice-6iTuS6ek.js} +1 -1
  98. package/dist/esm-es5/{localization-DHM91diu.js → localization-CXHiWcJp.js} +6 -9
  99. package/dist/esm-es5/{paypal-BfW5aLJw.js → paypal-BE_NVBoy.js} +1 -1
  100. package/dist/esm-es5/{placeTestOrder-CyWUFhxD.js → placeTestOrder-BXA9K9Iy.js} +1 -1
  101. package/dist/esm-es5/{renderCheckoutCurrency-B31ZNkUv.js → renderCheckoutCurrency-KMa4HlAf.js} +2 -2
  102. package/dist/esm-es5/{shouldShowLanguageSelect-DwSfSHar.js → shouldShowLanguageSelect-BI_ApEsQ.js} +1 -1
  103. package/dist/esm-es5/{submitGtag-BEFrutel.js → submitGtag-C5xzFHjG.js} +1 -1
  104. package/dist/esm-es5/{taxIdFields-ByEYfsO5.js → taxIdFields-BUKnHMaL.js} +2 -2
  105. package/dist/esm-es5/{updateCheckoutSessionAttributes-B0bQH0uw.js → updateCheckoutSessionAttributes-C9bMKTjz.js} +1 -1
  106. package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +1 -1
  107. package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
  108. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  109. package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
  110. package/dist/esm-es5/zonos-card_5.entry.js +6 -6
  111. package/dist/esm-es5/zonos-cart-items_12.entry.js +127 -127
  112. package/dist/esm-es5/zonos-checkout.entry.js +3 -3
  113. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  114. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  115. package/dist/esm-es5/zonos-collect.entry.js +6 -6
  116. package/dist/esm-es5/zonos-controller.entry.js +5 -5
  117. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  118. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  119. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  120. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  121. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  122. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  123. package/dist/esm-es5/zonos-invoice.entry.js +3 -3
  124. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  125. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
  126. package/dist/scripts/index.d.ts +6 -0
  127. package/dist/scripts/index.js +1 -1
  128. package/dist/scripts/loadZonos.js +1 -1
  129. package/dist/scripts/zonos.js +1 -1
  130. package/dist/types/components/utils/__tests__/helpers/blockStorage.d.ts +3 -0
  131. package/dist/types/components/utils/logging/installConstructorCapture.d.ts +20 -0
  132. package/dist/types/components/utils/logging/reportBlockedStorage.d.ts +16 -0
  133. package/dist/types/components/utils/logging/startZonosInit.d.ts +5 -0
  134. package/dist/types/components/utils/logging/thrownMessage.d.ts +1 -0
  135. package/dist/types/components/utils/safeStorage.d.ts +4 -0
  136. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +5 -0
  137. package/dist/types/types/generated/graphql.frontend.types.d.ts +0 -22
  138. package/dist/types/types/generated/graphql.frontend.types.ts +0 -51
  139. package/dist/types/types/generated/graphql.internal.types.d.ts +270 -1
  140. package/dist/types/types/generated/graphql.internal.types.ts +341 -1
  141. package/dist/zonos-elements/index.esm.js +1 -1
  142. package/dist/zonos-elements/{p-8fa6cfff.entry.js → p-08b01c96.entry.js} +1 -1
  143. package/dist/zonos-elements/{p-3e705c9b.entry.js → p-0909ef77.entry.js} +1 -1
  144. package/dist/zonos-elements/{p-2b63865a.system.entry.js → p-13015d34.system.entry.js} +1 -1
  145. package/dist/zonos-elements/{p-2d513aa3.entry.js → p-13d5b2f9.entry.js} +1 -1
  146. package/dist/zonos-elements/{p-46a839d2.system.entry.js → p-150047b3.system.entry.js} +16 -16
  147. package/dist/zonos-elements/{p-6e691736.entry.js → p-1986cc37.entry.js} +1 -1
  148. package/dist/zonos-elements/{p-vTIygnHq.system.js → p-1OG3IJgY.system.js} +1 -1
  149. package/dist/zonos-elements/{p-189cc594.system.entry.js → p-30bf4700.system.entry.js} +1 -1
  150. package/dist/zonos-elements/{p-4917b74d.entry.js → p-3466bcba.entry.js} +1 -1
  151. package/dist/zonos-elements/{p-12b24ebb.entry.js → p-383343c7.entry.js} +1 -1
  152. package/dist/zonos-elements/{p-5585db86.system.entry.js → p-3a506614.system.entry.js} +36 -36
  153. package/dist/zonos-elements/{p-46b9f0cf.entry.js → p-43c0ebe9.entry.js} +1 -1
  154. package/dist/zonos-elements/{p-84e76348.entry.js → p-4b65f192.entry.js} +1 -1
  155. package/dist/zonos-elements/{p-216a908d.system.entry.js → p-573a4e7c.system.entry.js} +6 -6
  156. package/dist/zonos-elements/{p-1fda4aec.system.entry.js → p-5a296dbc.system.entry.js} +87 -87
  157. package/dist/zonos-elements/{p-960070d0.system.entry.js → p-68325c5a.system.entry.js} +4 -4
  158. package/dist/zonos-elements/{p-53eac12f.system.entry.js → p-6db7317a.system.entry.js} +13 -13
  159. package/dist/zonos-elements/{p-1199baef.system.entry.js → p-709d1561.system.entry.js} +1 -1
  160. package/dist/zonos-elements/p-71d29603.entry.js +1 -0
  161. package/dist/zonos-elements/{p-064d8829.system.entry.js → p-7214c953.system.entry.js} +23 -23
  162. package/dist/zonos-elements/{p-65817880.entry.js → p-7fe83919.entry.js} +1 -1
  163. package/dist/zonos-elements/p-8ac26831.entry.js +1 -0
  164. package/dist/zonos-elements/{p-cccaad60.system.entry.js → p-8f9f859f.system.entry.js} +9 -9
  165. package/dist/zonos-elements/{p-f5f95990.system.entry.js → p-96b250d8.system.entry.js} +14 -14
  166. package/dist/zonos-elements/{p-678b9214.entry.js → p-97729873.entry.js} +1 -1
  167. package/dist/zonos-elements/{p-f3d9a380.system.entry.js → p-9b3668a4.system.entry.js} +144 -144
  168. package/dist/zonos-elements/{p-d8f375da.system.entry.js → p-9df31243.system.entry.js} +1 -1
  169. package/dist/zonos-elements/p-BI6VAB5B.js +1 -0
  170. package/dist/zonos-elements/p-BJFa5RwX.js +1 -0
  171. package/dist/zonos-elements/p-BJ_kE5rM.js +1 -0
  172. package/dist/zonos-elements/{p-XoQH3S7Z.system.js → p-BKUlQxBd.system.js} +1 -1
  173. package/dist/zonos-elements/{p-DprOoI2W.system.js → p-BUfCTQXY.system.js} +154 -154
  174. package/dist/zonos-elements/{p-CBUz18kA.system.js → p-BnQyot7Y.system.js} +23 -23
  175. package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
  176. package/dist/zonos-elements/{p-CMo3ZweU.js → p-C-zdj7MK.js} +1 -1
  177. package/dist/zonos-elements/{p-iAIzUA4k.js → p-C5fs3rIR.js} +1 -1
  178. package/dist/zonos-elements/{p-D1e9zNDA.js → p-CJmWr75U.js} +1 -1
  179. package/dist/zonos-elements/{p-Dtu_Japy.system.js → p-CMneHjck.system.js} +39 -39
  180. package/dist/zonos-elements/p-CP7KnfR3.system.js +245 -0
  181. package/dist/zonos-elements/p-CVRbGFV3.js +1 -0
  182. package/dist/zonos-elements/p-Cl5yV0ak.js +1 -0
  183. package/dist/zonos-elements/{p-CGNVm52g.system.js → p-Cp1IAJvW.system.js} +5 -5
  184. package/dist/zonos-elements/{p-6vSUiBfr.system.js → p-D-Lnf8mS.system.js} +50 -53
  185. package/dist/zonos-elements/p-D0DkOoAw.system.js +73 -0
  186. package/dist/zonos-elements/p-D4xpkSsK.js +1 -0
  187. package/dist/zonos-elements/p-DATNIakn.js +1 -0
  188. package/dist/zonos-elements/{p-CbhN65lj.system.js → p-DC1OPJDq.system.js} +1 -1
  189. package/dist/zonos-elements/{p-CHKKvuiz.js → p-DKnphvmJ.js} +1 -1
  190. package/dist/zonos-elements/{p-ojtNq-r5.system.js → p-DXlojp_Y.system.js} +1 -1
  191. package/dist/zonos-elements/{p-C9XLkmmb.system.js → p-DrS-0mk7.system.js} +1 -1
  192. package/dist/zonos-elements/{p-DpwmHU8R.js → p-DrbN3rPL.js} +2 -2
  193. package/dist/zonos-elements/{p-BrQ8n8NS.system.js → p-Dv5a-V6w.system.js} +3 -3
  194. package/dist/zonos-elements/{p-55813e9f.system.entry.js → p-a3c147d2.system.entry.js} +3 -3
  195. package/dist/zonos-elements/{p-DiMEP3mh.js → p-aK18R41t.js} +1 -1
  196. package/dist/zonos-elements/p-af4ad54b.entry.js +1 -0
  197. package/dist/zonos-elements/{p-1e6db427.entry.js → p-af741506.entry.js} +1 -1
  198. package/dist/zonos-elements/{p-2ca826b9.system.entry.js → p-b540c636.system.entry.js} +1 -1
  199. package/dist/zonos-elements/{p-636b71d4.entry.js → p-bac94956.entry.js} +1 -1
  200. package/dist/zonos-elements/{p-941a95a1.system.entry.js → p-bb1b414a.system.entry.js} +5 -5
  201. package/dist/zonos-elements/{p-e7fdb2c9.entry.js → p-bfa9e32a.entry.js} +1 -1
  202. package/dist/zonos-elements/p-cf6bf7a4.entry.js +1 -0
  203. package/dist/zonos-elements/p-dJcbnNlE.system.js +7 -0
  204. package/dist/zonos-elements/{p-7dc7f328.entry.js → p-db40b9c3.entry.js} +1 -1
  205. package/dist/zonos-elements/{p-d3345b2c.entry.js → p-dd003161.entry.js} +1 -1
  206. package/dist/zonos-elements/{p-ef5344ea.entry.js → p-e374aaa4.entry.js} +1 -1
  207. package/dist/zonos-elements/{p-6410fa11.system.entry.js → p-e43470f7.system.entry.js} +22 -22
  208. package/dist/zonos-elements/{p-fda89981.system.entry.js → p-ebc7ea54.system.entry.js} +3 -3
  209. package/dist/zonos-elements/{p-1cc42a98.system.entry.js → p-f2ed52bc.system.entry.js} +16 -16
  210. package/dist/zonos-elements/p-gEViRqvf.js +1 -0
  211. package/dist/zonos-elements/{p-DgUrB-1a.system.js → p-yv7ekcdG.system.js} +2 -2
  212. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  213. package/package.json +1 -1
  214. package/dist/esm-es5/handleFetch-D5GYDF-O.js +0 -60
  215. package/dist/zonos-elements/p-107f287b.entry.js +0 -1
  216. package/dist/zonos-elements/p-25eb99d4.entry.js +0 -1
  217. package/dist/zonos-elements/p-8f9d8795.entry.js +0 -1
  218. package/dist/zonos-elements/p-BMPYH-LT.js +0 -1
  219. package/dist/zonos-elements/p-C70h5mKA.js +0 -1
  220. package/dist/zonos-elements/p-CTiqplrr.js +0 -1
  221. package/dist/zonos-elements/p-Ch1w0Lr7.js +0 -1
  222. package/dist/zonos-elements/p-D1SmY_fZ.js +0 -1
  223. package/dist/zonos-elements/p-D6xXnsM_.js +0 -1
  224. package/dist/zonos-elements/p-DE4a-QD5.js +0 -1
  225. package/dist/zonos-elements/p-DQrMfUzi.system.js +0 -227
  226. package/dist/zonos-elements/p-DZdkJHK9.system.js +0 -7
  227. package/dist/zonos-elements/p-U33isUJG.js +0 -1
  228. package/dist/zonos-elements/p-ebe157b5.entry.js +0 -1
  229. package/dist/zonos-elements/p-zVLAvre1.system.js +0 -60
@@ -1,24 +1,24 @@
1
- var __awaiter=this&&this.__awaiter||function(e,o,t,n){function r(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function c(e){try{a(n["throw"](e))}catch(e){i(e)}}function a(e){e.done?t(e.value):r(e.value).then(s,c)}a((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=c(0),s["throw"]=c(1),s["return"]=c(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(o){return a([e,o])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(t=0)),t)try{if(n=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:t.label++;return{value:c[1],done:false};case 5:t.label++;r=c[1];c=[0];continue;case 7:c=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1];i=c;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(c);break}if(i[2])t.ops.pop();t.trys.pop();continue}c=o.call(e,t)}catch(e){c=[6,e];r=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var n=0,r=o.length,i;n<r;n++){if(i||!(n in o)){if(!i)i=Array.prototype.slice.call(o,0,n);i[n]=o[n]}}return e.concat(i||Array.prototype.slice.call(o))};System.register(["./p-CIevpRv_.system.js","./p-DprOoI2W.system.js","./p-Dtu_Japy.system.js","./p-6vSUiBfr.system.js","./p-DTgUqgwV.system.js","./p-BDopxBpR.system.js","./p-zVLAvre1.system.js","./p-vTIygnHq.system.js","./p-BbgqQIHv.system.js","./p-smUku7Ku.system.js","./p-C2j7R11h.system.js","./p-DBOI98r5.system.js","./p-zsTASoh2.system.js","./p-DW-fW8yR.system.js","./p-BNtWsPPP.system.js","./p-0D0aCMu6.system.js","./p-CzKlS3E-.system.js","./p-DsBuZ6ob.system.js","./p-B3GRrRtL.system.js","./p-ojtNq-r5.system.js","./p-CYxMfUL7.system.js","./p-DIab60nK.system.js"],(function(e){"use strict";var o,t,n,r,i,s,c,a,u,d,l,f,h,v,m,p,g,w,z,k,y,b,_,C,x,S,T,I,A,O,B,U,L,E,P,D,j,N,R,F,M,H,K,Z,V,G,W,Q,Y,q,J,X,$,ee,oe,te,ne,re,ie,se,ce,ae,ue,de,le,fe,he,ve,me,pe,ge,we,ze,ke,ye,be,_e,Ce,xe,Se,Te,Ie,Ae,Oe,Be,Ue;return{setters:[function(e){o=e.r;t=e.h;n=e.F;r=e.a},function(e){i=e.s;s=e.a;c=e.b;a=e.i;u=e.c;d=e.g;l=e.d;f=e.e;h=e.f;v=e.p;m=e.h;p=e.j;g=e.k;w=e.l;z=e.m;k=e.n;y=e.o;b=e.t;_=e.q;C=e.r;x=e.u;S=e.v;T=e.w;I=e.x;A=e.y;O=e.z;B=e.A;U=e.B;L=e.C;E=e.D;P=e.E;D=e.F;j=e.G;N=e.H;R=e.I;F=e.J;M=e.K},function(e){H=e.p;K=e.s;Z=e.a;V=e.b},function(e){G=e.f;W=e.a;Q=e.b;Y=e.i;q=e.l;J=e.c;X=e.d;$=e.g;ee=e.s;oe=e.V;te=e.e;ne=e.t;re=e.h;ie=e.j},function(e){se=e.z;ce=e.g;ae=e.m},function(e){ue=e.b},function(e){de=e.h;le=e.g;fe=e.j;he=e.l;ve=e.b;me=e.s;pe=e.a;ge=e.i},function(e){we=e.u},function(e){ze=e.l;ke=e.g;ye=e.b},function(e){be=e._;_e=e.c;Ce=e.d;xe=e.a;Se=e.g},function(e){Te=e.c},function(e){Ie=e.c},function(e){Ae=e.g},function(e){Oe=e.i},function(e){Be=e.s},function(e){Ue=e.R},null,null,null,null,null,null],execute:function(){var Le=this;
1
+ var __awaiter=this&&this.__awaiter||function(e,o,t,n){function r(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function c(e){try{a(n["throw"](e))}catch(e){i(e)}}function a(e){e.done?t(e.value):r(e.value).then(s,c)}a((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=c(0),s["throw"]=c(1),s["return"]=c(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(o){return a([e,o])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(t=0)),t)try{if(n=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:t.label++;return{value:c[1],done:false};case 5:t.label++;r=c[1];c=[0];continue;case 7:c=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1];i=c;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(c);break}if(i[2])t.ops.pop();t.trys.pop();continue}c=o.call(e,t)}catch(e){c=[6,e];r=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var n=0,r=o.length,i;n<r;n++){if(i||!(n in o)){if(!i)i=Array.prototype.slice.call(o,0,n);i[n]=o[n]}}return e.concat(i||Array.prototype.slice.call(o))};System.register(["./p-CIevpRv_.system.js","./p-BUfCTQXY.system.js","./p-CMneHjck.system.js","./p-D-Lnf8mS.system.js","./p-DTgUqgwV.system.js","./p-BDopxBpR.system.js","./p-D0DkOoAw.system.js","./p-1OG3IJgY.system.js","./p-BbgqQIHv.system.js","./p-smUku7Ku.system.js","./p-C2j7R11h.system.js","./p-DBOI98r5.system.js","./p-zsTASoh2.system.js","./p-DW-fW8yR.system.js","./p-BNtWsPPP.system.js","./p-0D0aCMu6.system.js","./p-CzKlS3E-.system.js","./p-DsBuZ6ob.system.js","./p-B3GRrRtL.system.js","./p-DXlojp_Y.system.js","./p-CYxMfUL7.system.js","./p-DIab60nK.system.js"],(function(e){"use strict";var o,t,n,r,i,s,c,a,u,d,l,f,h,v,m,p,g,w,z,k,y,b,_,C,x,S,T,I,A,O,B,U,L,E,D,P,j,N,R,F,M,H,K,Z,G,V,Q,W,Y,q,J,X,$,ee,oe,te,ne,re,ie,se,ce,ae,ue,de,le,fe,he,ve,me,pe,ge,we,ze,ke,ye,be,_e,Ce,xe,Se,Te,Ie,Ae,Oe,Be,Ue,Le,Ee;return{setters:[function(e){o=e.r;t=e.h;n=e.F;r=e.a},function(e){i=e.s;s=e.a;c=e.b;a=e.i;u=e.c;d=e.g;l=e.d;f=e.e;h=e.f;v=e.p;m=e.h;p=e.j;g=e.k;w=e.l;z=e.m;k=e.n;y=e.o;b=e.t;_=e.q;C=e.r;x=e.u;S=e.v;T=e.w;I=e.x;A=e.y;O=e.z;B=e.A;U=e.B;L=e.C;E=e.D;D=e.E;P=e.F;j=e.G;N=e.H;R=e.I;F=e.J;M=e.K},function(e){H=e.p;K=e.s;Z=e.a;G=e.b},function(e){V=e.f;Q=e.a;W=e.b;Y=e.i;q=e.l;J=e.c;X=e.d;$=e.g;ee=e.s;oe=e.V;te=e.e;ne=e.t;re=e.h;ie=e.j},function(e){se=e.z;ce=e.g;ae=e.m},function(e){ue=e.b},function(e){de=e.h;le=e.g;fe=e.j;he=e.l;ve=e.d;me=e.c;pe=e.b;ge=e.s;we=e.a;ze=e.i},function(e){ke=e.u},function(e){ye=e.l;be=e.g;_e=e.b},function(e){Ce=e._;xe=e.c;Se=e.d;Te=e.a;Ie=e.g},function(e){Ae=e.c},function(e){Oe=e.c},function(e){Be=e.g},function(e){Ue=e.i},function(e){Le=e.s},function(e){Ee=e.R},null,null,null,null,null,null],execute:function(){var De=this;
2
2
  /**
3
3
  * Check if store discount is enabled
4
- */var Ee=function(){return __awaiter(Le,void 0,void 0,(function(){var e,o,t;return __generator(this,(function(n){switch(n.label){case 0:return[4/*yield*/,de("/api/zonos-elements/get-store-discount-enabled-status")];case 1:e=n.sent(),o=e.errors,t=e.json;if(o.length||!(t===null||t===void 0?void 0:t.enabled)){return[2/*return*/,{enabled:false}]}return[2/*return*/,{enabled:true}]}}))}))};var Pe=function(e){return __awaiter(Le,[e],void 0,(function(e){var o,t,n,r;var i=e.testKeys;return __generator(this,(function(e){switch(e.label){case 0:
4
+ */var Pe=function(){return __awaiter(De,void 0,void 0,(function(){var e,o,t;return __generator(this,(function(n){switch(n.label){case 0:return[4/*yield*/,de("/api/zonos-elements/get-store-discount-enabled-status")];case 1:e=n.sent(),o=e.errors,t=e.json;if(o.length||!(t===null||t===void 0?void 0:t.enabled)){return[2/*return*/,{enabled:false}]}return[2/*return*/,{enabled:true}]}}))}))};var je=function(e){return __awaiter(De,[e],void 0,(function(e){var o,t,n,r;var i=e.testKeys;return __generator(this,(function(e){switch(e.label){case 0:
5
5
  // Do nothing if no test keys are provided
6
- if(i.length===0){return[2/*return*/,null]}return[4/*yield*/,de("/api/zonos-elements/select-variance-test",{body:{testKeys:i},method:"POST"})];case 1:o=e.sent(),t=o.errors,n=o.json;if(t.length||!n){return[2/*return*/,null]}r=G(n);
6
+ if(i.length===0){return[2/*return*/,null]}return[4/*yield*/,de("/api/zonos-elements/select-variance-test",{body:{testKeys:i},method:"POST"})];case 1:o=e.sent(),t=o.errors,n=o.json;if(t.length||!n){return[2/*return*/,null]}r=V(n);
7
7
  // Filter the response to only include test keys that we support
8
- return[2/*return*/,r]}}))}))};var De=function(e){var o=e.cartId,t=e.checkoutSessionId,n=e.customerAddress1,r=e.customerAddress2,i=e.customerCity,s=e.customerCountry,c=e.customerEmail,a=e.customerFirstName,u=e.customerLastName,d=e.customerPhone,l=e.customerState,f=e.customerZip,h=e.hostedCheckoutUrl,v=e.isTestMode,m=e.isVariantTest;var p=new URLSearchParams;p.set("tempCartUUID",o);if(a){p.set("customerFirstName",a)}if(u){p.set("customerLastName",u)}if(c){p.set("customerEmail",c)}if(d){p.set("customerPhone",d)}if(f){p.set("customerZip",f)}if(i){p.set("customerCity",i)}if(l){p.set("customerState",l)}if(s){p.set("zCountry",s)}if(n){p.set("customerAddress1",n)}if(r){p.set("customerAddress2",r)}if(v){p.set("zonosTestMode","1")}if(t){p.set("zonosCheckoutSessionId",t)}if(m){p.set("zonosVariantTest","1")}return"".concat(h,"?").concat(p.toString())};
8
+ return[2/*return*/,r]}}))}))};var Ne=function(e){var o=e.cartId,t=e.checkoutSessionId,n=e.customerAddress1,r=e.customerAddress2,i=e.customerCity,s=e.customerCountry,c=e.customerEmail,a=e.customerFirstName,u=e.customerLastName,d=e.customerPhone,l=e.customerState,f=e.customerZip,h=e.hostedCheckoutUrl,v=e.isTestMode,m=e.isVariantTest;var p=new URLSearchParams;p.set("tempCartUUID",o);if(a){p.set("customerFirstName",a)}if(u){p.set("customerLastName",u)}if(c){p.set("customerEmail",c)}if(d){p.set("customerPhone",d)}if(f){p.set("customerZip",f)}if(i){p.set("customerCity",i)}if(l){p.set("customerState",l)}if(s){p.set("zCountry",s)}if(n){p.set("customerAddress1",n)}if(r){p.set("customerAddress2",r)}if(v){p.set("zonosTestMode","1")}if(t){p.set("zonosCheckoutSessionId",t)}if(m){p.set("zonosVariantTest","1")}return"".concat(h,"?").concat(p.toString())};
9
9
  /**
10
10
  * The query flag that BigCommerce carries back to `cart.php` after the
11
11
  * shopper logs in. When present, Zonos-elements knows to resume the
12
12
  * international checkout flow instead of letting BC's native cart UX
13
13
  * take over.
14
- */var je="isInternationalCheckout";
14
+ */var Re="isInternationalCheckout";
15
15
  /**
16
16
  * Build the `from` query value handed to BigCommerce's `/login.php` so that
17
17
  * after a successful login the shopper lands back on `cart.php` with the
18
18
  * `isInternationalCheckout=true` flag set (plus any `zonosTestMode` /
19
19
  * `zonosQaUrl` / `zonosQaUrlApi` that were on the current URL, so the
20
20
  * preview build / API host / test credentials carry through the round trip).
21
- */var Ne=function(){var e=new URLSearchParams;e.set(je,"true");var o=new URLSearchParams(window.location.search);var t=o.get("zonosQaUrl");if(t){e.set("zonosQaUrl",t)}var n=o.get("zonosQaUrlApi");if(n){e.set("zonosQaUrlApi",n)}if(le()){e.set("zonosTestMode","1")}return"cart.php?".concat(e.toString())};
21
+ */var Fe=function(){var e=new URLSearchParams;e.set(Re,"true");var o=new URLSearchParams(window.location.search);var t=o.get("zonosQaUrl");if(t){e.set("zonosQaUrl",t)}var n=o.get("zonosQaUrlApi");if(n){e.set("zonosQaUrlApi",n)}if(le()){e.set("zonosTestMode","1")}return"cart.php?".concat(e.toString())};
22
22
  /**
23
23
  * Build an absolute URL to BigCommerce's `/login.php` with the
24
24
  * `from=cart.php?isInternationalCheckout=true` round-trip encoded so the
@@ -28,13 +28,13 @@ return[2/*return*/,r]}}))}))};var De=function(e){var o=e.cartId,t=e.checkoutSess
28
28
  * URL across the redirect — the login round trip leaves BC's frontend, so
29
29
  * without this the returning `cart.php` would drop back to the production
30
30
  * build / API host.
31
- */var Re=function(e){var o=e===void 0?{}:e,t=o.action;var n=new URL("/login.php",window.location.origin);if(t){n.searchParams.set("action",t)}var r=new URLSearchParams(window.location.search);
31
+ */var Me=function(e){var o=e===void 0?{}:e,t=o.action;var n=new URL("/login.php",window.location.origin);if(t){n.searchParams.set("action",t)}var r=new URLSearchParams(window.location.search);
32
32
  // set zonosQaUrl from the current URL
33
33
  var i=r.get("zonosQaUrl");if(i){n.searchParams.set("zonosQaUrl",i)}
34
34
  // set zonosQaUrlApi from the current URL
35
35
  var s=r.get("zonosQaUrlApi");if(s){n.searchParams.set("zonosQaUrlApi",s)}
36
36
  // set zonosTestMode from the current URL
37
- if(le()){n.searchParams.set("zonosTestMode","1")}n.searchParams.set("from",Ne());return n.toString()};
37
+ if(le()){n.searchParams.set("zonosTestMode","1")}n.searchParams.set("from",Fe());return n.toString()};
38
38
  /**
39
39
  * Build an absolute redirect URL used by the BigCommerce checkout flows to
40
40
  * navigate between the BC native `/checkout` page and the Zonos international
@@ -44,31 +44,31 @@ if(le()){n.searchParams.set("zonosTestMode","1")}n.searchParams.set("from",Ne())
44
44
  * present) so the preview Zonos elements build keeps loading after the
45
45
  * redirect, and sets `zonosTestMode=1` when test mode is active so the
46
46
  * destination page continues to use the test credentials.
47
- */var Fe=function(e){var o=new URL(e,window.location.origin);var t=new URLSearchParams(window.location.search);var n=t.get("zonosQaUrl");if(n){o.searchParams.set("zonosQaUrl",n)}
47
+ */var He=function(e){var o=new URL(e,window.location.origin);var t=new URLSearchParams(window.location.search);var n=t.get("zonosQaUrl");if(n){o.searchParams.set("zonosQaUrl",n)}
48
48
  // zonosDebug=1
49
- if(t.get("zonosDebug")==="1"){o.searchParams.set("zonosDebug","1")}if(le()){o.searchParams.set("zonosTestMode","1")}return o.toString()};var Me={customerGroupId:null,shouldBypass:false};
49
+ if(t.get("zonosDebug")==="1"){o.searchParams.set("zonosDebug","1")}if(le()){o.searchParams.set("zonosTestMode","1")}return o.toString()};var Ke={customerGroupId:null,shouldBypass:false};
50
50
  /**
51
51
  * Performs the actual fetch logic to determine if the customer
52
52
  * belongs to a bypass group.
53
- */var He=function(e){return __awaiter(Le,void 0,void 0,(function(){var o,t,n,r,i,s,c,a,u,d,l,f;return __generator(this,(function(h){switch(h.label){case 0:
53
+ */var Ze=function(e){return __awaiter(De,void 0,void 0,(function(){var o,t,n,r,i,s,c,a,u,d,l,f;return __generator(this,(function(h){switch(h.label){case 0:
54
54
  // Only relevant for BigCommerce stores — permanent no-op on other platforms
55
- if(!window.Zonos.isBigCommerce){return[2/*return*/,{conclusive:true,result:Me}]}i=(o=se.genericSettings)===null||o===void 0?void 0:o.bigcommerceBypassCustomerGroupIds;if(!(i===null||i===void 0?void 0:i.length)){if(se.loadedConfig){
55
+ if(!window.Zonos.isBigCommerce){return[2/*return*/,{conclusive:true,result:Ke}]}i=(o=se.genericSettings)===null||o===void 0?void 0:o.bigcommerceBypassCustomerGroupIds;if(!(i===null||i===void 0?void 0:i.length)){if(se.loadedConfig){
56
56
  // Settings have finished loading and there are no bypass groups
57
57
  // configured — this is a permanent "bypass not configured" answer.
58
- return[2/*return*/,{conclusive:true,result:Me}]}
58
+ return[2/*return*/,{conclusive:true,result:Ke}]}
59
59
  // Settings haven't loaded yet — the empty list may be transient.
60
60
  // Mark as inconclusive so a later caller retries after config loads.
61
- return[2/*return*/,{conclusive:false,result:Me}]}if(!e)return[3/*break*/,1];c=e.checkoutId;return[3/*break*/,3];case 1:return[4/*yield*/,W()];case 2:c=h.sent();h.label=3;case 3:s=c;if(!s){
61
+ return[2/*return*/,{conclusive:false,result:Ke}]}if(!e)return[3/*break*/,1];c=e.checkoutId;return[3/*break*/,3];case 1:return[4/*yield*/,Q()];case 2:c=h.sent();h.label=3;case 3:s=c;if(!s){
62
62
  // No active cart yet — inconclusive. Common on fresh sessions where
63
63
  // `initBigCommerceBypassCheck` runs before the user has added anything
64
64
  // to their cart; once the cart exists we need to re-fetch.
65
- ze("BigCommerce bypass check: no active cart yet, will retry on next call","info");return[2/*return*/,{conclusive:false,result:Me}]}if(!e)return[3/*break*/,4];u=e.checkout;return[3/*break*/,6];case 4:return[4/*yield*/,Q(s)];case 5:u=h.sent();h.label=6;case 6:a=u;if(!a){
65
+ ye("BigCommerce bypass check: no active cart yet, will retry on next call","info");return[2/*return*/,{conclusive:false,result:Ke}]}if(!e)return[3/*break*/,4];u=e.checkout;return[3/*break*/,6];case 4:return[4/*yield*/,W(s)];case 5:u=h.sent();h.label=6;case 6:a=u;if(!a){
66
66
  // API call failed (network error, non-200, etc.) — inconclusive.
67
67
  // Caching this would permanently disable bypass for the session if
68
68
  // the logged-in user is actually a reseller.
69
- ze("BigCommerce bypass check: failed to fetch checkout data, will retry","info");return[2/*return*/,{conclusive:false,result:Me}]}d=(r=(n=(t=a.customer)===null||t===void 0?void 0:t.customerGroup)===null||n===void 0?void 0:n.id)!==null&&r!==void 0?r:null;if(d===null){ze("BigCommerce bypass check: no customer group found (guest user)","info");
69
+ ye("BigCommerce bypass check: failed to fetch checkout data, will retry","info");return[2/*return*/,{conclusive:false,result:Ke}]}d=(r=(n=(t=a.customer)===null||t===void 0?void 0:t.customerGroup)===null||n===void 0?void 0:n.id)!==null&&r!==void 0?r:null;if(d===null){ye("BigCommerce bypass check: no customer group found (guest user)","info");
70
70
  // Guest user with an active cart — a definitive "no bypass" answer.
71
- return[2/*return*/,{conclusive:true,result:Me}]}l=i.includes(d);f={customerGroupId:d,shouldBypass:l};if(l){ze("BigCommerce bypass check: customer group ".concat(String(d)," is in bypass list; caller should keep the user on BC native checkout"),"info")}else{ze("BigCommerce bypass check: customer group ".concat(String(d)," is not in bypass list"),"info")}return[2/*return*/,{conclusive:true,result:f}]}}))}))};
71
+ return[2/*return*/,{conclusive:true,result:Ke}]}l=i.includes(d);f={customerGroupId:d,shouldBypass:l};if(l){ye("BigCommerce bypass check: customer group ".concat(String(d)," is in bypass list; caller should keep the user on BC native checkout"),"info")}else{ye("BigCommerce bypass check: customer group ".concat(String(d)," is not in bypass list"),"info")}return[2/*return*/,{conclusive:true,result:f}]}}))}))};
72
72
  /**
73
73
  * Module-level promise that holds the in-flight or resolved bypass check.
74
74
  * Set by `initBigCommerceBypassCheck` on page load so the result is ready
@@ -77,17 +77,17 @@ return[2/*return*/,{conclusive:true,result:Me}]}l=i.includes(d);f={customerGroup
77
77
  * Automatically invalidated when a fetch resolves to an inconclusive outcome,
78
78
  * so subsequent callers retry (e.g. after the user adds an item to their
79
79
  * cart or after settings finish loading).
80
- */var Ke=null;var Ze=function(e){var o=He(e);var t=o.then((function(e){var o=e.conclusive,n=e.result;if(!o&&Ke===t){
80
+ */var Ge=null;var Ve=function(e){var o=Ze(e);var t=o.then((function(e){var o=e.conclusive,n=e.result;if(!o&&Ge===t){
81
81
  // Invalidate cache so the next caller performs a fresh fetch.
82
- Ke=null}return n}));Ke=t;return t};
82
+ Ge=null}return n}));Ge=t;return t};
83
83
  /**
84
84
  * Start fetching the BigCommerce customer group on page load.
85
85
  * Call this once during initialization (e.g. in `zonos-checkout.init()`).
86
86
  * The fetch runs in the background; `checkBigCommerceBypassCustomerGroup`
87
87
  * will await the result when needed.
88
- */var Ve=function(){var e;if(!window.Zonos.isBigCommerce){return}var o=(e=se.genericSettings)===null||e===void 0?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(o===null||o===void 0?void 0:o.length)){return}
88
+ */var Qe=function(){var e;if(!window.Zonos.isBigCommerce){return}var o=(e=se.genericSettings)===null||e===void 0?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(o===null||o===void 0?void 0:o.length)){return}
89
89
  // Fire the fetch immediately; consumers will await the same promise
90
- void Ze()};
90
+ void Ve()};
91
91
  /**
92
92
  * Check if the current BigCommerce customer belongs to a customer group
93
93
  * that should bypass Zonos Checkout.
@@ -102,20 +102,20 @@ void Ze()};
102
102
  * always fetches fresh BigCommerce checkout data. Use this on the
103
103
  * BigCommerce domestic checkout page when the shipping country changes,
104
104
  * to ensure the customer group reflects the current checkout state.
105
- */var Ge=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(Le,__spreadArray([],e,true),void 0,(function(e){if(e===void 0){e={}}return __generator(this,(function(o){if(e.forceRefresh||!Ke){return[2/*return*/,Ze(e.preFetched)]}return[2/*return*/,Ke]}))}))};var We={guestCheckoutType:null};
105
+ */var We=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(De,__spreadArray([],e,true),void 0,(function(e){if(e===void 0){e={}}return __generator(this,(function(o){if(e.forceRefresh||!Ge){return[2/*return*/,Ve(e.preFetched)]}return[2/*return*/,Ge]}))}))};var Ye={guestCheckoutType:null};
106
106
  /**
107
107
  * BigCommerce's `/checkouts/settings` values almost never change after a
108
108
  * merchant's initial setup, so we persist the result in `localStorage` and
109
109
  * reuse it across page loads up to this TTL. Short enough that if the
110
110
  * merchant flips `guest_checkout_type` the change still propagates within
111
111
  * an hour.
112
- */var Qe=60*60*1e3;var Ye="zonos--bc-checkout-settings";var qe=function(e){try{var o=window.localStorage.getItem(Ye);if(!o){return null}var t=fe(o);if(!t){return null}
112
+ */var qe=60*60*1e3;var Je="zonos--bc-checkout-settings";var Xe=function(e){try{var o=window.localStorage.getItem(Je);if(!o){return null}var t=fe(o);if(!t){return null}
113
113
  // Different store on the same origin (e.g. zonosQaUrl preview) — ignore.
114
114
  if(t.storeHash!==e){return null}if(t.expiresAt<Date.now()){return null}return{guestCheckoutType:t.guestCheckoutType}}catch(e){
115
115
  // localStorage access can throw in blocked-storage contexts (Safari
116
116
  // private mode, cross-origin iframes) — treat as a cache miss so the
117
117
  // network fallback runs.
118
- return null}};var Je=function(e,o){try{var t={expiresAt:Date.now()+Qe,guestCheckoutType:o.guestCheckoutType,storeHash:e};window.localStorage.setItem(Ye,JSON.stringify(t))}catch(e){
118
+ return null}};var $e=function(e,o){try{var t={expiresAt:Date.now()+qe,guestCheckoutType:o.guestCheckoutType,storeHash:e};window.localStorage.setItem(Je,JSON.stringify(t))}catch(e){
119
119
  // localStorage can be disabled / quota-exceeded in some browser contexts
120
120
  // (private mode, cross-origin iframes) — drop silently since caching
121
121
  // is only an optimization.
@@ -128,7 +128,7 @@ return null}};var Je=function(e,o){try{var t={expiresAt:Date.now()+Qe,guestCheck
128
128
  * Results are cached in `localStorage` for `CACHE_TTL_MS` so navigations
129
129
  * inside the same store don't all pay the proxy round trip — the setting
130
130
  * is merchant-level and rarely changes.
131
- */var Xe=function(){return __awaiter(Le,void 0,void 0,(function(){var e,o,t,n,r,i,s;return __generator(this,(function(c){switch(c.label){case 0:if(!window.Zonos.isBigCommerce){return[2/*return*/,We]}o=(e=se.checkoutSettings.bigCommerceConfig)===null||e===void 0?void 0:e.storeHash;if(!o){ze("BigCommerce checkout settings: no storeHash provided — skipping fetch","info");return[2/*return*/,We]}t=qe(o);if(t){return[2/*return*/,t]}return[4/*yield*/,de("/api/bigcommerce/checkout-settings",{body:{storeHash:o},method:"POST"})];case 1:n=c.sent(),r=n.errors,i=n.json;if(r.length||!i){ze("BigCommerce checkout settings: proxy call failed, falling back to guest-allowed behavior","info");return[2/*return*/,We]}s={guestCheckoutType:i.guestCheckoutType};Je(o,s);return[2/*return*/,s]}}))}))};var $e={redirectUrl:null,shouldForceLogin:false};
131
+ */var eo=function(){return __awaiter(De,void 0,void 0,(function(){var e,o,t,n,r,i,s;return __generator(this,(function(c){switch(c.label){case 0:if(!window.Zonos.isBigCommerce){return[2/*return*/,Ye]}o=(e=se.checkoutSettings.bigCommerceConfig)===null||e===void 0?void 0:e.storeHash;if(!o){ye("BigCommerce checkout settings: no storeHash provided — skipping fetch","info");return[2/*return*/,Ye]}t=Xe(o);if(t){return[2/*return*/,t]}return[4/*yield*/,de("/api/bigcommerce/checkout-settings",{body:{storeHash:o},method:"POST"})];case 1:n=c.sent(),r=n.errors,i=n.json;if(r.length||!i){ye("BigCommerce checkout settings: proxy call failed, falling back to guest-allowed behavior","info");return[2/*return*/,Ye]}s={guestCheckoutType:i.guestCheckoutType};$e(o,s);return[2/*return*/,s]}}))}))};var oo={redirectUrl:null,shouldForceLogin:false};
132
132
  /**
133
133
  * Session cache for the merchant-level "does BC require login?" answer.
134
134
  * Hitting `/checkouts/settings` on every checkout open would add a visible
@@ -137,22 +137,22 @@ return null}};var Je=function(e,o){try{var t={expiresAt:Date.now()+Qe,guestCheck
137
137
  *
138
138
  * `null` means we haven't kicked off the fetch yet; the promise holds the
139
139
  * eventual boolean so multiple concurrent callers deduplicate.
140
- */var eo=null;var oo=function(){if(!eo){var e=Xe().then((function(o){var t=o.guestCheckoutType;if(!t){
140
+ */var to=null;var no=function(){if(!to){var e=eo().then((function(o){var t=o.guestCheckoutType;if(!t){
141
141
  // `null` here means either the proxy call failed (transient) or the
142
142
  // storeHash wasn't known yet. Fail open for this call, but clear
143
143
  // the cached promise so the next caller retries instead of
144
144
  // permanently disabling force-login for the rest of the session.
145
- if(eo===e){eo=null}return false}return t==="no_guest_checkout"})).catch((function(){
145
+ if(to===e){to=null}return false}return t==="no_guest_checkout"})).catch((function(){
146
146
  // Defense-in-depth: `fetchBigCommerceCheckoutSettings` is expected to
147
147
  // swallow its own errors, but if anything above does reject we fail
148
148
  // open and clear the cached promise so the next caller can retry.
149
- if(eo===e){eo=null}return false}));eo=e}return eo};
149
+ if(to===e){to=null}return false}));to=e}return to};
150
150
  /**
151
151
  * Kick off the `/checkouts/settings` fetch in the background on page load
152
152
  * so the result is warm by the time the shopper opens checkout. Safe to
153
153
  * call more than once — re-invocations reuse the in-flight/resolved
154
154
  * promise.
155
- */var to=function(){if(!window.Zonos.isBigCommerce){return}void oo()};
155
+ */var ro=function(){if(!window.Zonos.isBigCommerce){return}void no()};
156
156
  /**
157
157
  * Decide whether the current BigCommerce shopper must sign in before the
158
158
  * Zonos international checkout is allowed to open.
@@ -167,18 +167,18 @@ if(eo===e){eo=null}return false}));eo=e}return eo};
167
167
  * Returning a `redirectUrl` is an instruction, not an action: callers drive
168
168
  * the navigation themselves so they can short-circuit any UI state (loading
169
169
  * overlays, dialog open flags) before `window.location.href` flips.
170
- */var no=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(Le,__spreadArray([],e,true),void 0,(function(e){var o,t,n,r,i;var s=e===void 0?{}:e,c=s.preFetched;return __generator(this,(function(e){switch(e.label){case 0:if(!window.Zonos.isBigCommerce){return[2/*return*/,$e]}return[4/*yield*/,oo()];case 1:o=e.sent();if(!o){return[2/*return*/,$e]}if(!c)return[3/*break*/,2];n=c.checkoutId;return[3/*break*/,4];case 2:return[4/*yield*/,W()];case 3:n=e.sent();e.label=4;case 4:t=n;if(!t){
170
+ */var io=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(De,__spreadArray([],e,true),void 0,(function(e){var o,t,n,r,i;var s=e===void 0?{}:e,c=s.preFetched;return __generator(this,(function(e){switch(e.label){case 0:if(!window.Zonos.isBigCommerce){return[2/*return*/,oo]}return[4/*yield*/,no()];case 1:o=e.sent();if(!o){return[2/*return*/,oo]}if(!c)return[3/*break*/,2];n=c.checkoutId;return[3/*break*/,4];case 2:return[4/*yield*/,Q()];case 3:n=e.sent();e.label=4;case 4:t=n;if(!t){
171
171
  // No active cart — nothing to protect. Force-login only matters once
172
172
  // the shopper has a cart we're about to carry into Zonos checkout.
173
- return[2/*return*/,$e]}if(!c)return[3/*break*/,5];i=c.checkout;return[3/*break*/,7];case 5:return[4/*yield*/,Q(t)];case 6:i=e.sent();e.label=7;case 7:r=i;if(!r){
173
+ return[2/*return*/,oo]}if(!c)return[3/*break*/,5];i=c.checkout;return[3/*break*/,7];case 5:return[4/*yield*/,W(t)];case 6:i=e.sent();e.label=7;case 7:r=i;if(!r){
174
174
  // Storefront API failure — fail open so a transient outage doesn't
175
175
  // block the shopper. The merchant's BC checkout will still enforce
176
176
  // login server-side as a last line of defense.
177
- ze("BigCommerce force-login check: failed to fetch checkout data, allowing flow to continue","info");return[2/*return*/,$e]}if(Y(r)){return[2/*return*/,$e]}ze("BigCommerce force-login check: guest shopper on no-guest-checkout store, redirecting to /login.php","info");return[2/*return*/,{redirectUrl:Re(),shouldForceLogin:true}]}}))}))};
177
+ ye("BigCommerce force-login check: failed to fetch checkout data, allowing flow to continue","info");return[2/*return*/,oo]}if(Y(r)){return[2/*return*/,oo]}ye("BigCommerce force-login check: guest shopper on no-guest-checkout store, redirecting to /login.php","info");return[2/*return*/,{redirectUrl:Me(),shouldForceLogin:true}]}}))}))};
178
178
  /**
179
179
  * Mark we've already rewritten a given anchor so the MutationObserver
180
180
  * doesn't loop on its own mutation.
181
- */var ro="data-zonos-login-from-rewritten";var io='a[href*="login.php?action=create_account"]:not(['+ro+"])";var so=function(){var e=document.querySelectorAll(io);if(!e.length){return}var o=Re({action:"create_account"});e.forEach((function(e){e.setAttribute("href",o);e.setAttribute(ro,"true")}))};
181
+ */var so="data-zonos-login-from-rewritten";var co='a[href*="login.php?action=create_account"]:not(['+so+"])";var ao=function(){var e=document.querySelectorAll(co);if(!e.length){return}var o=Me({action:"create_account"});e.forEach((function(e){e.setAttribute("href",o);e.setAttribute(so,"true")}))};
182
182
  /**
183
183
  * On BigCommerce's `/login.php`, the default **Create account** button links
184
184
  * to `login.php?action=create_account` without the `from=cart.php...`
@@ -194,19 +194,19 @@ ze("BigCommerce force-login check: failed to fetch checkout data, allowing flow
194
194
  *
195
195
  * Safe to call more than once — idempotent thanks to the `data-zonos-…`
196
196
  * attribute on rewritten anchors.
197
- */var co=function(){if(!window.Zonos.isBigCommerce){return}if(!window.location.pathname.includes("/login.php")){return}so();
197
+ */var uo=function(){if(!window.Zonos.isBigCommerce){return}if(!window.location.pathname.includes("/login.php")){return}ao();
198
198
  // BC's login page often renders the auth form asynchronously, so the
199
199
  // anchor may not exist yet when this runs. Observe for a short window,
200
200
  // then stop so we don't leak a listener for the rest of the session.
201
- var e=new MutationObserver((function(){so()}));e.observe(document.body,{childList:true,subtree:true});
201
+ var e=new MutationObserver((function(){ao()}));e.observe(document.body,{childList:true,subtree:true});
202
202
  // 10 seconds is plenty for the login form to mount; stopping the observer
203
203
  // avoids churn from the rest of the page's normal DOM activity.
204
- setTimeout((function(){return e.disconnect()}),1e4)};var ao=function(e,o){
204
+ setTimeout((function(){return e.disconnect()}),1e4)};var lo=function(e,o){
205
205
  // Skip entries missing the fields the address form treats as required.
206
206
  if(!e.address1||!e.countryCode){return null}var t=[e.firstName,e.lastName].filter(Boolean).join(" ").trim();return{address:{city:e.city||"",country:e.countryCode,line1:e.address1,line2:e.address2||"",postal_code:e.postalCode||"",
207
207
  // Prefer the ISO subdivision code when present so it round-trips through
208
208
  // Stripe; fall back to the human-readable state name.
209
- state:e.stateOrProvinceCode||e.stateOrProvince||""},email:o,name:t,phone:e.phone||""}};var uo=function(e){return[e.address.line1,e.address.line2||"",e.address.postal_code,e.address.country].join("|").toLowerCase()};
209
+ state:e.stateOrProvinceCode||e.stateOrProvince||""},email:o,name:t,phone:e.phone||""}};var fo=function(e){return[e.address.line1,e.address.line2||"",e.address.postal_code,e.address.country].join("|").toLowerCase()};
210
210
  /**
211
211
  * Extract a logged-in BigCommerce shopper's known addresses from a Storefront
212
212
  * API checkout response and convert them into the shape that `zonos-address`
@@ -226,37 +226,37 @@ state:e.stateOrProvinceCode||e.stateOrProvince||""},email:o,name:t,phone:e.phone
226
226
  *
227
227
  * Returns an empty list for guest sessions (no `customer.id`) or when the
228
228
  * checkout response is missing the relevant includes.
229
- */var lo=function(e,o){var t,n,r,i;if(!((t=e===null||e===void 0?void 0:e.customer)===null||t===void 0?void 0:t.id)){return[]}var s=o.isShippable,c=o.selectedCountryCode;var a=e.customer.email||"";var u=(r=(n=e.consignments)===null||n===void 0?void 0:n.flatMap((function(e){return e.shippingAddress?[e.shippingAddress]:[]})))!==null&&r!==void 0?r:[];var d=(i=e.customer.addresses)!==null&&i!==void 0?i:[];var l=new Set;var f=[];
229
+ */var ho=function(e,o){var t,n,r,i;if(!((t=e===null||e===void 0?void 0:e.customer)===null||t===void 0?void 0:t.id)){return[]}var s=o.isShippable,c=o.selectedCountryCode;var a=e.customer.email||"";var u=(r=(n=e.consignments)===null||n===void 0?void 0:n.flatMap((function(e){return e.shippingAddress?[e.shippingAddress]:[]})))!==null&&r!==void 0?r:[];var d=(i=e.customer.addresses)!==null&&i!==void 0?i:[];var l=new Set;var f=[];
230
230
  // Iterate saved addresses first so the dedup key for an address present in
231
231
  // both lists keeps the saved-book version (which carries an `id` and is the
232
232
  // shopper's canonical entry).
233
- for(var h=0,v=__spreadArray(__spreadArray([],d,true),u,true);h<v.length;h++){var m=v[h];var p=ao(m,a);if(!p){continue}if(!s(p.address.country)){continue}var g=uo(p);if(l.has(g)){continue}l.add(g);f.push(p)}if(!c){return f}
233
+ for(var h=0,v=__spreadArray(__spreadArray([],d,true),u,true);h<v.length;h++){var m=v[h];var p=lo(m,a);if(!p){continue}if(!s(p.address.country)){continue}var g=fo(p);if(l.has(g)){continue}l.add(g);f.push(p)}if(!c){return f}
234
234
  // Stable-sort the survivors so addresses matching the currently-selected
235
235
  // country come first while everything else keeps its original order.
236
- return f.map((function(e,o){return{index:o,option:e}})).sort((function(e,o){var t=e.option.address.country===c;var n=o.option.address.country===c;if(t===n){return e.index-o.index}return t?-1:1})).map((function(e){return e.option}))};var fo=function(e){if(e===void 0){e=true}if(!q.localizationLoaded){return true}if(q.isDisabledCountry){if(e){ze("Checkout: disabled country")}return true}return false};
236
+ return f.map((function(e,o){return{index:o,option:e}})).sort((function(e,o){var t=e.option.address.country===c;var n=o.option.address.country===c;if(t===n){return e.index-o.index}return t?-1:1})).map((function(e){return e.option}))};var vo=function(e){if(e===void 0){e=true}if(!q.localizationLoaded){return true}if(q.isDisabledCountry){if(e){ye("Checkout: disabled country")}return true}return false};
237
237
  /**
238
238
  * BigCommerce checkout depends on storefront callbacks (clear cart, inventory).
239
239
  * The hosted variant leaves the storefront, so the test does not apply there.
240
- */var ho=function(e){var o=e.createCartId,t=e.enabledTestKeys,n=e.isBigCommerce;if(n){return false}if(typeof o!=="function"){return false}return t.includes("hosted_vs_native")};var vo=function(e,
240
+ */var mo=function(e){var o=e.createCartId,t=e.enabledTestKeys,n=e.isBigCommerce;if(n){return false}if(typeof o!=="function"){return false}return t.includes("hosted_vs_native")};var po=function(e,
241
241
  /**
242
242
  * If provided, will check if the country is shippable based on the provided country code instead of the Hello selected country code
243
243
  */
244
- o){if(e===void 0){e=true}if(!q.localizationLoaded){return false}if(o){var t=J(o);if(e&&!t){ze("Checkout: ".concat(o," is not a shippable country: ").concat(t))}return t}
244
+ o){if(e===void 0){e=true}if(!q.localizationLoaded){return false}if(o){var t=J(o);if(e&&!t){ye("Checkout: ".concat(o," is not a shippable country: ").concat(t))}return t}
245
245
  // if localization is loaded and the localization is not a shippable country, keep the original click event
246
- if(!q.isShippableCountry){if(e){ze("Checkout: not shippable country")}return false}return true};var mo=["1","true","yes"];
246
+ if(!q.isShippableCountry){if(e){ye("Checkout: not shippable country")}return false}return true};var go=["1","true","yes"];
247
247
  /**
248
248
  * Page-load result of reading the checkout `zBypass` query. Later calls on the
249
249
  * same checkout URL reuse this so stripping the parameter does not change the
250
250
  * answer.
251
- */var po=null;var go=function(){return window.location.pathname.includes("/checkout")};var wo=function(e){if(e===null){return false}return mo.includes(e.trim().toLowerCase())};
251
+ */var wo=null;var zo=function(){return window.location.pathname.includes("/checkout")};var ko=function(e){if(e===null){return false}return go.includes(e.trim().toLowerCase())};
252
252
  /**
253
253
  * True only when zonos-settings set
254
254
  * `checkoutSettings.plugins.bigcommerce.allowBypassQuery` to `true`.
255
- */var zo=function(){var e,o;return((o=(e=se.checkoutSettings.plugins)===null||e===void 0?void 0:e.bigcommerce)===null||o===void 0?void 0:o.allowBypassQuery)===true};
255
+ */var yo=function(){var e,o;return((o=(e=se.checkoutSettings.plugins)===null||e===void 0?void 0:e.bigcommerce)===null||o===void 0?void 0:o.allowBypassQuery)===true};
256
256
  /**
257
257
  * Read an accepted `zBypass` query on the checkout page once, then remove it
258
258
  * from the URL. A later call on that same URL returns the same answer.
259
- */var ko=function(){var e=window.location,o=e.pathname,t=e.search;if(po&&po.pathname===o&&po.search===t){return po.enabled}var n=new URLSearchParams(t);var r=wo(n.get("zBypass"));if(!r){po={enabled:false,pathname:o,search:t};return false}n.delete("zBypass");var i=n.toString();var s=window.location.hash||"";var c="".concat(o).concat(i?"?".concat(i):"").concat(s);window.history.replaceState(window.history.state,document.title,c);var a=zo();po={enabled:a,pathname:o,search:window.location.search};return a};
259
+ */var bo=function(){var e=window.location,o=e.pathname,t=e.search;if(wo&&wo.pathname===o&&wo.search===t){return wo.enabled}var n=new URLSearchParams(t);var r=ko(n.get("zBypass"));if(!r){wo={enabled:false,pathname:o,search:t};return false}n.delete("zBypass");var i=n.toString();var s=window.location.hash||"";var c="".concat(o).concat(i?"?".concat(i):"").concat(s);window.history.replaceState(window.history.state,document.title,c);var a=yo();wo={enabled:a,pathname:o,search:window.location.search};return a};
260
260
  /**
261
261
  * True when this BigCommerce checkout page should skip address detection.
262
262
  * That is only when zonos-settings allows the `zBypass` query and this
@@ -264,17 +264,17 @@ if(!q.isShippableCountry){if(e){ze("Checkout: not shippable country")}return fal
264
264
  * the query stays in the URL until checkout. The query is removed once, and
265
265
  * later calls on that checkout URL keep the same answer. Nothing is written
266
266
  * to storage.
267
- */var yo=function(){var e;if(!((e=window.Zonos)===null||e===void 0?void 0:e.isBigCommerce)||!go()){return false}return ko()};var bo='select[name="shippingAddress.countryCode"]';
267
+ */var _o=function(){var e;if(!((e=window.Zonos)===null||e===void 0?void 0:e.isBigCommerce)||!zo()){return false}return bo()};var Co='select[name="shippingAddress.countryCode"]';
268
268
  /**
269
269
  * Native BigCommerce shipping-step "Continue" button. Clicking it commits the
270
270
  * selected shipping address and advances to the payment step.
271
- */var _o="#checkout-shipping-continue, #checkout-billing-continue, #checkout-payment-continue";
271
+ */var xo="#checkout-shipping-continue, #checkout-billing-continue, #checkout-payment-continue";
272
272
  /**
273
273
  * Check if the logged-in user already has a shipping address on the checkout
274
274
  * that is internationally shippable. If so, optionally prompt the user to
275
275
  * confirm before saving the address to session and redirecting to the home
276
276
  * page to open the international checkout.
277
- */var Co=function(e){return __awaiter(Le,[e],void 0,(function(e){var o,t,n,r,i,c,a,u,d,l,f,h,v,m,p,g,w,z;var k=e.onInternationalCheckoutSelected,y=e.onLoggedInInternationalAddressDetected;return __generator(this,(function(e){switch(e.label){case 0:return[4/*yield*/,W()];case 1:f=e.sent();if(!f){return[2/*return*/,"noAction"]}return[4/*yield*/,Q(f)];case 2:h=e.sent();v={checkout:h,checkoutId:f};return[4/*yield*/,Ge({preFetched:v})];case 3:m=e.sent().shouldBypass;if(m){return[2/*return*/,"noAction"]}p=(t=(o=h===null||h===void 0?void 0:h.consignments)===null||o===void 0?void 0:o[0])===null||t===void 0?void 0:t.shippingAddress;if(!(p===null||p===void 0?void 0:p.countryCode)){return[2/*return*/,"noAction"]}g=p.countryCode;if(!vo(false,g)){return[2/*return*/,"noAction"]}ze(y?"Logged-in user has international shipping address: ".concat(g,", prompting user to choose checkout"):"Logged-in user has international shipping address: ".concat(g,", redirecting automatically (legacy behavior)"),"info");if(!y)return[3/*break*/,5];return[4/*yield*/,y()];case 4:w=e.sent();if(w==="stay"){ze("User opted to stay on BigCommerce native checkout despite international default address","info");return[2/*return*/,"optedOut"]}e.label=5;case 5:return[4/*yield*/,no({preFetched:v})];case 6:z=e.sent();if(z.shouldForceLogin&&z.redirectUrl){window.location.href=z.redirectUrl;return[2/*return*/,"redirected"]}if(!k)return[3/*break*/,8];return[4/*yield*/,k()];case 7:e.sent();e.label=8;case 8:
277
+ */var So=function(e){return __awaiter(De,[e],void 0,(function(e){var o,t,n,r,i,c,a,u,d,l,f,h,v,m,p,g,w,z;var k=e.onInternationalCheckoutSelected,y=e.onLoggedInInternationalAddressDetected;return __generator(this,(function(e){switch(e.label){case 0:return[4/*yield*/,Q()];case 1:f=e.sent();if(!f){return[2/*return*/,"noAction"]}return[4/*yield*/,W(f)];case 2:h=e.sent();v={checkout:h,checkoutId:f};return[4/*yield*/,We({preFetched:v})];case 3:m=e.sent().shouldBypass;if(m){return[2/*return*/,"noAction"]}p=(t=(o=h===null||h===void 0?void 0:h.consignments)===null||o===void 0?void 0:o[0])===null||t===void 0?void 0:t.shippingAddress;if(!(p===null||p===void 0?void 0:p.countryCode)){return[2/*return*/,"noAction"]}g=p.countryCode;if(!po(false,g)){return[2/*return*/,"noAction"]}ye(y?"Logged-in user has international shipping address: ".concat(g,", prompting user to choose checkout"):"Logged-in user has international shipping address: ".concat(g,", redirecting automatically (legacy behavior)"),"info");if(!y)return[3/*break*/,5];return[4/*yield*/,y()];case 4:w=e.sent();if(w==="stay"){ye("User opted to stay on BigCommerce native checkout despite international default address","info");return[2/*return*/,"optedOut"]}e.label=5;case 5:return[4/*yield*/,io({preFetched:v})];case 6:z=e.sent();if(z.shouldForceLogin&&z.redirectUrl){window.location.href=z.redirectUrl;return[2/*return*/,"redirected"]}if(!k)return[3/*break*/,8];return[4/*yield*/,k()];case 7:e.sent();e.label=8;case 8:
278
278
  // Update localization store with the detected country
279
279
  X({isInitializing:false,newSelectedCountryCode:g,persistOverride:false});
280
280
  // Save the shipping address to session storage for the international checkout
@@ -282,28 +282,28 @@ s({address1:(n=p.address1)!==null&&n!==void 0?n:"",address2:(r=p.address2)!==nul
282
282
  // Redirect to home page — the home page will open the international checkout
283
283
  // when it detects the domestic shipping session. Carry over zonosQaUrl /
284
284
  // zonosTestMode so the destination page keeps using the same build/env.
285
- window.location.href=Fe("/");return[2/*return*/,"redirected"]}}))}))};
285
+ window.location.href=He("/");return[2/*return*/,"redirected"]}}))}))};
286
286
  /**
287
287
  * Watch for changes in domestic checkout step. Redirects user to home page to open international checkout when user selects a country in the international shipping zone.
288
288
  * @note Only works on default bigcommerce checkout page
289
- */var xo=function(e){var o=e.domesticRedirectedBtnSelector,t=e.onInternationalCheckoutSelected,n=e.onLoggedInInternationalAddressDetected,r=e.onShippingAddressSessionFound;if(!window.Zonos.isBigCommerce){return}
289
+ */var To=function(e){var o=e.domesticRedirectedBtnSelector,t=e.onInternationalCheckoutSelected,n=e.onLoggedInInternationalAddressDetected,r=e.onShippingAddressSessionFound;if(!window.Zonos.isBigCommerce){return}
290
290
  // Only the native checkout page skips address detection. Storefront pages
291
291
  // still run the domestic-session handoff below, and they do not consume
292
292
  // a `zBypass` query, so the parameter can survive until `/checkout`.
293
- if(window.location.pathname.includes("/checkout")&&yo()){return}
293
+ if(window.location.pathname.includes("/checkout")&&_o()){return}
294
294
  /**
295
295
  * Keep checking.
296
296
  * @returns `true` if the caller should stop polling — either because the user
297
297
  * is being redirected to Zonos international checkout, or because the
298
298
  * logged-in customer is in a bypass group and should stay on BC checkout.
299
- */var c=function(e){return __awaiter(Le,void 0,void 0,(function(){var o,n,r,i,c,a,u,d,l,f;return __generator(this,(function(h){switch(h.label){case 0:n=document.querySelector(((o=se.genericSettings)===null||o===void 0?void 0:o.bigcommerceDomesticCheckoutCountrySelector)||bo);r=(n===null||n===void 0?void 0:n.value)||e;if(!r){
299
+ */var c=function(e){return __awaiter(De,void 0,void 0,(function(){var o,n,r,i,c,a,u,d,l,f;return __generator(this,(function(h){switch(h.label){case 0:n=document.querySelector(((o=se.genericSettings)===null||o===void 0?void 0:o.bigcommerceDomesticCheckoutCountrySelector)||Co);r=(n===null||n===void 0?void 0:n.value)||e;if(!r){
300
300
  // do nothing if shipping country is not found
301
- return[2/*return*/,"noAction"]}if(!vo(false,r)){
301
+ return[2/*return*/,"noAction"]}if(!po(false,r)){
302
302
  // do nothing if shipping country is not shippable
303
- return[2/*return*/,"noAction"]}return[4/*yield*/,W()];case 1:i=h.sent();if(!i)return[3/*break*/,3];return[4/*yield*/,Q(i)];case 2:a=h.sent();return[3/*break*/,4];case 3:a=null;h.label=4;case 4:c=a;u={checkout:c,checkoutId:i};return[4/*yield*/,Ge({forceRefresh:true,preFetched:u})];case 5:d=h.sent().shouldBypass;if(d){
303
+ return[2/*return*/,"noAction"]}return[4/*yield*/,Q()];case 1:i=h.sent();if(!i)return[3/*break*/,3];return[4/*yield*/,W(i)];case 2:a=h.sent();return[3/*break*/,4];case 3:a=null;h.label=4;case 4:c=a;u={checkout:c,checkoutId:i};return[4/*yield*/,We({forceRefresh:true,preFetched:u})];case 5:d=h.sent().shouldBypass;if(d){
304
304
  // Logged-in customer is in a bypass group — keep them on BC native
305
305
  // checkout and stop polling / fetching further.
306
- ze("Bypass customer group detected on BC checkout, stopping interval","info");return[2/*return*/,"bypass"]}return[4/*yield*/,no({preFetched:u})];case 6:l=h.sent();if(l.shouldForceLogin&&l.redirectUrl){window.location.href=l.redirectUrl;return[2/*return*/,"redirected"]}if(!t)return[3/*break*/,8];return[4/*yield*/,t()];case 7:h.sent();h.label=8;case 8:
306
+ ye("Bypass customer group detected on BC checkout, stopping interval","info");return[2/*return*/,"bypass"]}return[4/*yield*/,io({preFetched:u})];case 6:l=h.sent();if(l.shouldForceLogin&&l.redirectUrl){window.location.href=l.redirectUrl;return[2/*return*/,"redirected"]}if(!t)return[3/*break*/,8];return[4/*yield*/,t()];case 7:h.sent();h.label=8;case 8:
307
307
  // update the country code in localization store and check if it's shippable
308
308
  X({isInitializing:false,newSelectedCountryCode:r,persistOverride:false});f={address1:"",address2:"",city:"",countryCode:r,firstName:"",lastName:"",phone:"",postalCode:"",stateOrProvince:""};
309
309
  // save the shipping address to session storage
@@ -311,7 +311,7 @@ s({address1:f.address1,address2:f.address2,city:f.city,countryCode:f.countryCode
311
311
  // redirect to home page, home page then will open the checkout dialog if
312
312
  // having domestic shipping session. Carry over zonosQaUrl / zonosTestMode
313
313
  // so the destination page keeps using the same build/env.
314
- window.location.href=Fe("/");return[2/*return*/,"redirected"]}}))}))};
314
+ window.location.href=He("/");return[2/*return*/,"redirected"]}}))}))};
315
315
  /**
316
316
  * When `true`, the logged-in "Continue" hook re-dispatched the shopper's
317
317
  * click so BigCommerce's own handler can run (domestic / bypass case). The
@@ -326,7 +326,7 @@ window.location.href=Fe("/");return[2/*return*/,"redirected"]}}))}))};
326
326
  * checkout. Logged-in shoppers picking a saved address don't expose a
327
327
  * country `<select>`, so read it from the active checkout consignment via the
328
328
  * Storefront API; fall back to the `<select>` value when one is present.
329
- */var d=function(){return __awaiter(Le,void 0,void 0,(function(){var e,o,t,n,r,i,s,c;return __generator(this,(function(a){switch(a.label){case 0:return[4/*yield*/,W()];case 1:r=a.sent();if(!r)return[3/*break*/,3];return[4/*yield*/,Q(r)];case 2:i=a.sent();s=(t=(o=(e=i===null||i===void 0?void 0:i.consignments)===null||e===void 0?void 0:e[0])===null||o===void 0?void 0:o.shippingAddress)===null||t===void 0?void 0:t.countryCode;if(s){return[2/*return*/,s]}a.label=3;case 3:c=document.querySelector(((n=se.genericSettings)===null||n===void 0?void 0:n.bigcommerceDomesticCheckoutCountrySelector)||bo);return[2/*return*/,(c===null||c===void 0?void 0:c.value)||null]}}))}))};
329
+ */var d=function(){return __awaiter(De,void 0,void 0,(function(){var e,o,t,n,r,i,s,c;return __generator(this,(function(a){switch(a.label){case 0:return[4/*yield*/,Q()];case 1:r=a.sent();if(!r)return[3/*break*/,3];return[4/*yield*/,W(r)];case 2:i=a.sent();s=(t=(o=(e=i===null||i===void 0?void 0:i.consignments)===null||e===void 0?void 0:e[0])===null||o===void 0?void 0:o.shippingAddress)===null||t===void 0?void 0:t.countryCode;if(s){return[2/*return*/,s]}a.label=3;case 3:c=document.querySelector(((n=se.genericSettings)===null||n===void 0?void 0:n.bigcommerceDomesticCheckoutCountrySelector)||Co);return[2/*return*/,(c===null||c===void 0?void 0:c.value)||null]}}))}))};
330
330
  /**
331
331
  * Req 2 (05CHECK-887): once a logged-in shopper with an international default
332
332
  * address has chosen to "Stay on this page", we must still force them onto
@@ -341,7 +341,7 @@ window.location.href=Fe("/");return[2/*return*/,"redirected"]}}))}))};
341
341
  * checkout. On any outcome other than a redirect — domestic, bypass group,
342
342
  * or an unexpected error — replay the click so BigCommerce's own handler runs
343
343
  * and the shopper is never left stuck on the shipping step.
344
- */var l=function(e,o){return __awaiter(Le,void 0,void 0,(function(){var t,n,r,i,s,u;return __generator(this,(function(l){switch(l.label){case 0:t=true;l.label=1;case 1:l.trys.push([1,9,,10]);n=null;l.label=2;case 2:l.trys.push([2,4,,5]);return[4/*yield*/,d()];case 3:n=l.sent();return[3/*break*/,5];case 4:r=l.sent();he("Error resolving selected shipping country on BC continue",r);return[3/*break*/,5];case 5:
344
+ */var l=function(e,o){return __awaiter(De,void 0,void 0,(function(){var t,n,r,i,s,u;return __generator(this,(function(l){switch(l.label){case 0:t=true;l.label=1;case 1:l.trys.push([1,9,,10]);n=null;l.label=2;case 2:l.trys.push([2,4,,5]);return[4/*yield*/,d()];case 3:n=l.sent();return[3/*break*/,5];case 4:r=l.sent();he("Error resolving selected shipping country on BC continue",r);return[3/*break*/,5];case 5:
345
345
  // When the shopper is committing an international address we're about to
346
346
  // save the domestic shipping session and redirect to `/`. Disconnect this
347
347
  // /checkout-page observer first: otherwise its own session-detection
@@ -349,7 +349,7 @@ window.location.href=Fe("/");return[2/*return*/,"redirected"]}}))}))};
349
349
  // open checkout locally, consuming and clearing the session before the
350
350
  // navigation to `/` lands, leaving the redirect a no-op. (The `/` page
351
351
  // runs its own fresh watcher to open checkout.)
352
- if(n&&vo(false,n)){o.disconnect()}if(!n)return[3/*break*/,7];return[4/*yield*/,c(n)];case 6:s=l.sent();return[3/*break*/,8];case 7:s="noAction";l.label=8;case 8:i=s;
352
+ if(n&&po(false,n)){o.disconnect()}if(!n)return[3/*break*/,7];return[4/*yield*/,c(n)];case 6:s=l.sent();return[3/*break*/,8];case 7:s="noAction";l.label=8;case 8:i=s;
353
353
  // `redirected` → the page is navigating to the Zonos international
354
354
  // checkout, so don't replay. `bypass` / `noAction` → the shopper stays on
355
355
  // BC native checkout, so fall through and replay the click.
@@ -370,7 +370,7 @@ he("Error handling BC continue international redirect",u);return[3/*break*/,10];
370
370
  */var f=function(e){if(u){return}u=true;document.addEventListener("click",(function(o){
371
371
  // Programmatic replay for the domestic / bypass case — let BC's own
372
372
  // handler run without interference.
373
- if(a){return}var t=o.target;if(!(t instanceof Element)){return}var n=t.closest(_o);if(!n){return}
373
+ if(a){return}var t=o.target;if(!(t instanceof Element)){return}var n=t.closest(xo);if(!n){return}
374
374
  // Block BC's native advance until we know whether the selected shipping
375
375
  // country forces an international redirect. Capture phase +
376
376
  // stopImmediatePropagation (done synchronously here, before the async
@@ -399,13 +399,13 @@ o.preventDefault();o.stopImmediatePropagation();void l(n,e)}),true)};var h=false
399
399
  // `handleInternationalCheckoutSelected` (both consult the helper), so the
400
400
  // top-level gate is redundant. `initBigCommerceBypassCheck()` is called on
401
401
  // page load so those inner calls typically resolve against a warm cache.
402
- var w=new MutationObserver((function(){return __awaiter(Le,void 0,void 0,(function(){var e,s,a,u,d,l,z,k,y,b;var _=this;return __generator(this,(function(C){switch(C.label){case 0:s=document.querySelector(o);a=i();
402
+ var w=new MutationObserver((function(){return __awaiter(De,void 0,void 0,(function(){var e,s,a,u,d,l,z,k,y,b;var _=this;return __generator(this,(function(C){switch(C.label){case 0:s=document.querySelector(o);a=i();
403
403
  // append a hidden button to the body if the shipping address session is found
404
404
  if(!s&&a){u=document.createElement("button");u.style.display="none";u.id="zonos--domestic-redirected-checkout-button";document.body.appendChild(u);r===null||r===void 0?void 0:r(a);
405
405
  // disconnect the observer after we found the shipping continue button
406
406
  w.disconnect();return[2/*return*/]}d=window.location.pathname.includes("/checkout")&&window.Zonos.isBigCommerce;
407
407
  // Should just disconnect the observer if it's not bigcommerce domestic checkout page
408
- if(!d){w.disconnect();return[2/*return*/]}if(!(!p&&!m))return[3/*break*/,5];m=true;g=true;C.label=1;case 1:C.trys.push([1,3,4,5]);return[4/*yield*/,Co({onInternationalCheckoutSelected:t,onLoggedInInternationalAddressDetected:n})];case 2:l=C.sent();if(l==="redirected"){w.disconnect();return[2/*return*/]}if(l==="optedOut"){
408
+ if(!d){w.disconnect();return[2/*return*/]}if(!(!p&&!m))return[3/*break*/,5];m=true;g=true;C.label=1;case 1:C.trys.push([1,3,4,5]);return[4/*yield*/,So({onInternationalCheckoutSelected:t,onLoggedInInternationalAddressDetected:n})];case 2:l=C.sent();if(l==="redirected"){w.disconnect();return[2/*return*/]}if(l==="optedOut"){
409
409
  // User elected to stay on BC native checkout — don't prompt again
410
410
  // for the rest of this session. Continue with the rest of the
411
411
  // observer logic so the country-change watcher still fires when
@@ -414,11 +414,11 @@ p=true;
414
414
  // Attach the "Continue" redirect hook now (once). Delegation on
415
415
  // `document` keeps it working even after this observer disconnects
416
416
  // when the country <select> path sets up its interval below.
417
- f(w)}return[3/*break*/,5];case 3:z=C.sent();he("Error checking logged-in user shipping address",z);return[3/*break*/,5];case 4:m=false;g=false;return[7/*endfinally*/];case 5:k=document.querySelector(((e=se.genericSettings)===null||e===void 0?void 0:e.bigcommerceDomesticCheckoutCountrySelector)||bo);
417
+ f(w)}return[3/*break*/,5];case 3:z=C.sent();he("Error checking logged-in user shipping address",z);return[3/*break*/,5];case 4:m=false;g=false;return[7/*endfinally*/];case 5:k=document.querySelector(((e=se.genericSettings)===null||e===void 0?void 0:e.bigcommerceDomesticCheckoutCountrySelector)||Co);
418
418
  // Shouldn't do anything if it's not bigcommerce domestic checkout page
419
419
  if(!k){
420
420
  // do nothing if shipping country and the continue button is not found
421
- return[2/*return*/]}ze("Domestic checkout found - Listening for shipping country change","info",{value:k.value});
421
+ return[2/*return*/]}ye("Domestic checkout found - Listening for shipping country change","info",{value:k.value});
422
422
  // Should not create a new interval if it's already created
423
423
  if(v){return[2/*return*/]}v=true;
424
424
  // disconnect the observer after we know that's bigcommerce domestic checkout page
@@ -431,27 +431,27 @@ if(h||g){return[2/*return*/]}h=true;t.label=1;case 1:t.trys.push([1,3,,4]);retur
431
431
  // - the logged-in customer is in a bypass group (stay on BC checkout)
432
432
  if(e==="redirected"||e==="bypass"){clearInterval(y);return[2/*return*/]}h=false;return[3/*break*/,4];case 3:o=t.sent();h=false;return[3/*break*/,4];case 4:return[2/*return*/]}}))}))}),1e3);b=setInterval((function(){var e;if(!window.bcStripeElements){clearInterval(b);return}var o=(e=window.bcStripeElements)===null||e===void 0?void 0:e.getElement("address");if(!o){return}clearInterval(b);o.on("change",(function(e){var o=e.value.address.country;if(o&&!g){void c(o)}}));
433
433
  // we want to attacch event to addressElement as soon as it's loaded
434
- }),500);return[2/*return*/]}}))}))}));w.observe(document.body,{childList:true,subtree:true})};var So=function(){var e=new URLSearchParams(window.location.search);ze("legacy urlParams","info",Object.fromEntries(e.entries()));var o=function(o){var t=e.get(o);if(!t||t==="undefined"){return""}return t};var t=
434
+ }),500);return[2/*return*/]}}))}))}));w.observe(document.body,{childList:true,subtree:true})};var Io=function(){var e=new URLSearchParams(window.location.search);ye("legacy urlParams","info",Object.fromEntries(e.entries()));var o=function(o){var t=e.get(o);if(!t||t==="undefined"){return""}return t};var t=
435
435
  // fallback to selected country code if country is not provided
436
- $(e)||q.selectedCountryCode||"US";var n=o("customerCity");var r=o("customerEmail");var i=o("customerAddress1");var s=o("customerAddress2");var c=o("customerName");var a=o("customerPhone");var u=o("customerZip");var d=o("customerState");var l=o("customerFirstName");var f=o("customerLastName");return{customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:l,customerLastName:f,customerName:c,customerPhone:a,customerState:d,customerZip:u}};var To=0;var Io=function(){return __awaiter(Le,void 0,void 0,(function(){var e,o;var t;return __generator(this,(function(n){switch(n.label){case 0:
436
+ $(e)||q.selectedCountryCode||"US";var n=o("customerCity");var r=o("customerEmail");var i=o("customerAddress1");var s=o("customerAddress2");var c=o("customerName");var a=o("customerPhone");var u=o("customerZip");var d=o("customerState");var l=o("customerFirstName");var f=o("customerLastName");return{customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:l,customerLastName:f,customerName:c,customerPhone:a,customerState:d,customerZip:u}};var Ao=0;var Oo=function(){return __awaiter(De,void 0,void 0,(function(){var e,o;var t;return __generator(this,(function(n){switch(n.label){case 0:
437
437
  // Don't send the log if there are no API calls to send
438
- if(window.Zonos.loadTimeApiInfoList.length===0){return[2/*return*/]}ze("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});e={data:__spreadArray([],window.Zonos.loadTimeApiInfoList,true),storeId:window.Zonos.storeId||0};
438
+ if(window.Zonos.loadTimeApiInfoList.length===0){return[2/*return*/]}ye("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});e={data:__spreadArray([],window.Zonos.loadTimeApiInfoList,true),storeId:window.Zonos.storeId||0};
439
439
  // Clear the list after sending the log successfully
440
440
  window.Zonos.loadTimeApiInfoList.length=0;return[4/*yield*/,de("/api/zonos-elements/log-bulk-load-data",{body:e,method:"POST"})];case 1:o=n.sent().errors;if(o.length){
441
441
  // If there are errors, add the logs back to the list so we can try again later
442
- (t=window.Zonos.loadTimeApiInfoList).push.apply(t,e.data);To++;if(To>5&&window.Zonos.logIntervalId){
442
+ (t=window.Zonos.loadTimeApiInfoList).push.apply(t,e.data);Ao++;if(Ao>5&&window.Zonos.logIntervalId){
443
443
  // If there are more than 3 failures, stop the interval
444
- clearInterval(window.Zonos.logIntervalId)}}return[2/*return*/]}}))}))};var Ao=function(){return __awaiter(Le,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){e=ke().elapsedTime;o={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:e,metadata:Object.assign({allLogs:ye},ve()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};void de("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2/*return*/]}))}))};var Oo=function(e){return __awaiter(Le,[e],void 0,(function(e){var o;var t=e.loadTime;return __generator(this,(function(e){o={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:t,metadata:Object.assign({allLogs:ye},ve()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};void de("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2/*return*/]}))}))};var Bo=function(e){return(e===null||e===void 0?void 0:e.filter((function(e){if(e.expiresAt&&e.expiresAt<Date.now()||!e.expiresAt){return false}return true})))||[]};var Uo=function(e){var o;var t=(o=ee.enabledVariantTestKeys)===null||o===void 0?void 0:o.find((function(o){return o.testKey===e}));return(t===null||t===void 0?void 0:t.selectedVariantKey)||null};var Lo=function(e){return se.enabledVariantTestKeys.includes(e)};var Eo=function(e){var o=e.baseTestObj,t=e.mergeTestObj;return o.map((function(e){var o=e.testKey;
444
+ clearInterval(window.Zonos.logIntervalId)}}return[2/*return*/]}}))}))};var Bo=function(){return __awaiter(De,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){e=be().elapsedTime;o={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:e,metadata:Object.assign({allLogs:_e},ve()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};void de("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2/*return*/]}))}))};var Uo=function(e){return __awaiter(De,[e],void 0,(function(e){var o;var t=e.loadTime;return __generator(this,(function(e){o={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:t,metadata:Object.assign({allLogs:_e},ve()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};void de("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2/*return*/]}))}))};var Lo=function(e){return(e===null||e===void 0?void 0:e.filter((function(e){if(e.expiresAt&&e.expiresAt<Date.now()||!e.expiresAt){return false}return true})))||[]};var Eo=function(e){var o;var t=(o=ee.enabledVariantTestKeys)===null||o===void 0?void 0:o.find((function(o){return o.testKey===e}));return(t===null||t===void 0?void 0:t.selectedVariantKey)||null};var Do=function(e){return se.enabledVariantTestKeys.includes(e)};var Po=function(e){var o=e.baseTestObj,t=e.mergeTestObj;return o.map((function(e){var o=e.testKey;
445
445
  // We will attempt to get the enabled selection from localStorage first and only re-fetch if the testKeys are changed
446
- var n=t.find((function(e){var t=e.testKey;return t===o}));return{expiresAt:(n===null||n===void 0?void 0:n.expiresAt)||Date.now()+oe,selectedVariantKey:(n===null||n===void 0?void 0:n.selectedVariantKey)||null,testKey:o}}))};var Po=function(e){return __awaiter(Le,[e],void 0,(function(e){var o,t,n,r,i;var s=e.cartId,c=e.retries;return __generator(this,(function(e){switch(e.label){case 0:o=le();return[4/*yield*/,de("/api/zonos-elements/get-temp-cart",{body:{isTestMode:o,options:{noOnlineStoreSettings:true},tempCartUUID:s},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:t=e.sent(),n=t.errors,r=t.json;i=!r||n.length;if(!(i&&c))return[3/*break*/,3];ze("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:c});
446
+ var n=t.find((function(e){var t=e.testKey;return t===o}));return{expiresAt:(n===null||n===void 0?void 0:n.expiresAt)||Date.now()+oe,selectedVariantKey:(n===null||n===void 0?void 0:n.selectedVariantKey)||null,testKey:o}}))};var jo=function(e){return __awaiter(De,[e],void 0,(function(e){var o,t,n,r,i;var s=e.cartId,c=e.retries;return __generator(this,(function(e){switch(e.label){case 0:o=le();return[4/*yield*/,de("/api/zonos-elements/get-temp-cart",{body:{isTestMode:o,options:{noOnlineStoreSettings:true},tempCartUUID:s},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:t=e.sent(),n=t.errors,r=t.json;i=!r||n.length;if(!(i&&c))return[3/*break*/,3];ye("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:c});
447
447
  // wait 1 second before retrying
448
448
  return[4/*yield*/,new Promise((function(e){return setTimeout(e,500)}))];case 2:
449
449
  // wait 1 second before retrying
450
- e.sent();return[2/*return*/,Po({cartId:s,retries:c-1})];case 3:if(i){return[2/*return*/,null]}return[2/*return*/,r]}}))}))};var Do=function(e){return __awaiter(Le,void 0,void 0,(function(){var o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:o=be(e),t=o.isDgsCartId,n=o.isLegacyCartId;if(!n&&!t){he("[ZONOS - loadZonos] invalid cart id");return[2/*return*/,null]}return[4/*yield*/,Po({cartId:e,retries:5})];case 1:r=i.sent();ze("[ZONOS - loadZonos] getting temp cart data","info",r);if(!r){he("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2/*return*/,null]}window.Zonos.storeId=r.cartData.storeId;window.Zonos.zonosApiKey=r.cartData.credentialToken;return[2/*return*/,{cartData:r.cartData,storeFavicon:r.storeFaviconUrl,storeId:r.cartData.storeId,storeLogo:r.storeLogoUrl,zonosApiKey:r.cartData.credentialToken}]}}))}))};var jo='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var No=function(){return".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h{z-index:2147483647;position:fixed}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto;position:relative}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.hidden-mode.sc-zonos-checkout-h{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0;z-index:-1}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}.zonos--processing-payment.sc-zonos-checkout-h{z-index:2147483646}"};
450
+ e.sent();return[2/*return*/,jo({cartId:s,retries:c-1})];case 3:if(i){return[2/*return*/,null]}return[2/*return*/,r]}}))}))};var No=function(e){return __awaiter(De,void 0,void 0,(function(){var o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:o=Ce(e),t=o.isDgsCartId,n=o.isLegacyCartId;if(!n&&!t){he("[ZONOS - loadZonos] invalid cart id");return[2/*return*/,null]}return[4/*yield*/,jo({cartId:e,retries:5})];case 1:r=i.sent();ye("[ZONOS - loadZonos] getting temp cart data","info",r);if(!r){he("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2/*return*/,null]}window.Zonos.storeId=r.cartData.storeId;window.Zonos.zonosApiKey=r.cartData.credentialToken;return[2/*return*/,{cartData:r.cartData,storeFavicon:r.storeFaviconUrl,storeId:r.cartData.storeId,storeLogo:r.storeLogoUrl,zonosApiKey:r.cartData.credentialToken}]}}))}))};var Ro='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var Fo=function(){return".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h{z-index:2147483647;position:fixed}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto;position:relative}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.hidden-mode.sc-zonos-checkout-h{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0;z-index:-1}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}.zonos--processing-payment.sc-zonos-checkout-h{z-index:2147483646}"};
451
451
  // 90 minutes
452
- var Ro=90*60*1e3;
452
+ var Mo=90*60*1e3;
453
453
  // 6 hours
454
- var Fo=6*60*60*1e3;var Mo=e("zonos_checkout",/** @class */function(){function e(e){var t=this;o(this,e);this.storeUnsubscribeList=[];this.isRedirectAfterOrder=false;
454
+ var Ho=6*60*60*1e3;var Ko=e("zonos_checkout",/** @class */function(){function e(e){var t=this;o(this,e);this.storeUnsubscribeList=[];this.isRedirectAfterOrder=false;
455
455
  /**
456
456
  * Preview checkout without needing to click on the button. This would be useful for demo purpose
457
457
  */this.preview=false;
@@ -537,13 +537,13 @@ this.collapseReviewMobile=true;
537
537
  overrideTheme:this.isMobile?r:undefined,paypalEnabled:H()})];case 1:i.sent();return[2/*return*/]}}))}))};
538
538
  /**
539
539
  * Check if stripe payment intent is succeeded or in a good state to move forward
540
- */this.checkStripePaymentIntentStatus=function(e){return __awaiter(t,[e],void 0,(function(e){var o,t,n,r,i,s,a,d,l;var f=e.triggeredButton;return __generator(this,(function(e){switch(e.label){case 0:o=f===null||f===void 0?void 0:f.matches("#".concat(_e));t=!!window.Zonos.cartData;n=new URL(window.location.href).searchParams;r=n.get("payment_intent_client_secret");i=n.get("zonosCheckoutSessionId");
540
+ */this.checkStripePaymentIntentStatus=function(e){return __awaiter(t,[e],void 0,(function(e){var o,t,n,r,i,s,a,d,l;var f=e.triggeredButton;return __generator(this,(function(e){switch(e.label){case 0:o=f===null||f===void 0?void 0:f.matches("#".concat(xe));t=!!window.Zonos.cartData;n=new URL(window.location.href).searchParams;r=n.get("payment_intent_client_secret");i=n.get("zonosCheckoutSessionId");
541
541
  // Allow to proceed to order if Checkout is triggered by Checkout button click by user
542
- if(!o){ze("Checkout is triggered by user, no need to check stripe payment intent status");return[2/*return*/,{shouldAllowOrder:true}]}ze("Payment intent exist, checking stripe payment intent status");
542
+ if(!o){ye("Checkout is triggered by user, no need to check stripe payment intent status");return[2/*return*/,{shouldAllowOrder:true}]}ye("Payment intent exist, checking stripe payment intent status");
543
543
  // Allow to proceed to order if there's no stripe client secret and cart data is available
544
- if(!r){ze("No stripe client secret found in the URL, proceed to order if cart data is available");return[2/*return*/,{shouldAllowOrder:t}]}return[4/*yield*/,u({clientSecret:r})];case 1:s=e.sent(),a=s.error,d=s.status;l=new URLSearchParams(window.location.search).get("redirect_status");
544
+ if(!r){ye("No stripe client secret found in the URL, proceed to order if cart data is available");return[2/*return*/,{shouldAllowOrder:t}]}return[4/*yield*/,u({clientSecret:r})];case 1:s=e.sent(),a=s.error,d=s.status;l=new URLSearchParams(window.location.search).get("redirect_status");
545
545
  // If just redirected from Payment provider, show the success screen or error screen based on the status
546
- if(l){if(!a){ze("Payment intent is succeeded or in a good state to move forward, show success screen")}else{ze("Payment intent failed, show status from error")}this.open=true;ee.checkoutSessionId=i;c.clientSecret=r;void this.setToFinishStep(d);return[2/*return*/,{shouldAllowOrder:false}]}if(!t){ze("Cart data is not available, only check payment intent status, skip order.");return[2/*return*/,{shouldAllowOrder:false}]}ze("Payment intent is not succeeded, proceed to order");return[2/*return*/,{shouldAllowOrder:true}]}}))}))};
546
+ if(l){if(!a){ye("Payment intent is succeeded or in a good state to move forward, show success screen")}else{ye("Payment intent failed, show status from error")}this.open=true;ee.checkoutSessionId=i;c.clientSecret=r;void this.setToFinishStep(d);return[2/*return*/,{shouldAllowOrder:false}]}if(!t){ye("Cart data is not available, only check payment intent status, skip order.");return[2/*return*/,{shouldAllowOrder:false}]}ye("Payment intent is not succeeded, proceed to order");return[2/*return*/,{shouldAllowOrder:true}]}}))}))};
547
547
  /**
548
548
  * Recover an order-modification payment-only session that was already
549
549
  * completed (or already paid but not yet completed) by the time this cart
@@ -565,25 +565,25 @@ ee.checkoutSessionId=e;return[4/*yield*/,d()];case 1:o=s.sent(),t=o.errors,n=o.j
565
565
  // treat every first-ever open as already paid, so both must be true.
566
566
  if(r.completedAt&&r.order){void this.setToFinishStep("succeeded");return[2/*return*/,true]}if(!r.clientSecret)return[3/*break*/,3];return[4/*yield*/,u({clientSecret:r.clientSecret})];case 2:i=s.sent().status;if(i==="processing"||i==="succeeded"){c.clientSecret=r.clientSecret;void this.setToFinishStep(i);return[2/*return*/,true]}s.label=3;case 3:return[2/*return*/,false]}}))}))};this.initializeTestKeys=function(){
567
567
  // cleanup expired test keys
568
- ee.enabledVariantTestKeys=Bo(ee.enabledVariantTestKeys||[]);
568
+ ee.enabledVariantTestKeys=Lo(ee.enabledVariantTestKeys||[]);
569
569
  // map existingSelection to the enabled variant test keys from database
570
570
  var e=se.enabledVariantTestKeys.map((function(e){var o;
571
571
  // We will attempt to get the enabled selection from localStorage first and only re-fetch if the testKeys are changed
572
- var t=(o=ee.enabledVariantTestKeys)===null||o===void 0?void 0:o.find((function(o){var t=o.testKey;return t===e}));return{expiresAt:(t===null||t===void 0?void 0:t.expiresAt)||Date.now()+oe,selectedVariantKey:(t===null||t===void 0?void 0:t.selectedVariantKey)||null,testKey:e}}));te(e);return{allSelected:false}};this.shouldAllowHostedVsNativeTest=function(){var e;return ho({createCartId:se.checkoutSettings.createCartId,enabledTestKeys:se.enabledVariantTestKeys,isBigCommerce:Boolean((e=window.Zonos)===null||e===void 0?void 0:e.isBigCommerce)})};
572
+ var t=(o=ee.enabledVariantTestKeys)===null||o===void 0?void 0:o.find((function(o){var t=o.testKey;return t===e}));return{expiresAt:(t===null||t===void 0?void 0:t.expiresAt)||Date.now()+oe,selectedVariantKey:(t===null||t===void 0?void 0:t.selectedVariantKey)||null,testKey:e}}));te(e);return{allSelected:false}};this.shouldAllowHostedVsNativeTest=function(){var e;return mo({createCartId:se.checkoutSettings.createCartId,enabledTestKeys:se.enabledVariantTestKeys,isBigCommerce:Boolean((e=window.Zonos)===null||e===void 0?void 0:e.isBigCommerce)})};
573
573
  // Register test hosted vs native if needed to get the variant selection for this test
574
- this.registerTestHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:e=this.shouldAllowHostedVsNativeTest();if(!e){return[2/*return*/]}ze("[TEST] - Registering hosted vs native test");o=Uo("hosted_vs_native");
574
+ this.registerTestHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:e=this.shouldAllowHostedVsNativeTest();if(!e){return[2/*return*/]}ye("[TEST] - Registering hosted vs native test");o=Eo("hosted_vs_native");
575
575
  // No need to request variant test for this test if the test already has variant selected
576
- if(o){ze("[TEST] - Hosted vs native test already has variant selected: ".concat(o));return[2/*return*/]}return[4/*yield*/,Pe({testKeys:["hosted_vs_native"]})];case 1:t=r.sent();
576
+ if(o){ye("[TEST] - Hosted vs native test already has variant selected: ".concat(o));return[2/*return*/]}return[4/*yield*/,je({testKeys:["hosted_vs_native"]})];case 1:t=r.sent();
577
577
  // Do not prevent user from proceeding if the test is not enabled or failed to get selection
578
- if(!t){ze("[TEST] - Failed to get selection for hosted vs native test");return[2/*return*/]}n=Eo({baseTestObj:ee.enabledVariantTestKeys||[],mergeTestObj:t});
578
+ if(!t){ye("[TEST] - Failed to get selection for hosted vs native test");return[2/*return*/]}n=Po({baseTestObj:ee.enabledVariantTestKeys||[],mergeTestObj:t});
579
579
  // Set the selected variant to the storage store
580
580
  te(n);return[2/*return*/]}}))}))};
581
581
  // Handle hosted vs native test
582
- this.handleHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n,r,i,s,c;return __generator(this,(function(a){switch(a.label){case 0:o=this.shouldAllowHostedVsNativeTest();if(!o){return[2/*return*/,{redirected:false}]}t=Uo("hosted_vs_native");ze("[TEST] - hosted_vs_native: ".concat(t));
582
+ this.handleHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n,r,i,s,c;return __generator(this,(function(a){switch(a.label){case 0:o=this.shouldAllowHostedVsNativeTest();if(!o){return[2/*return*/,{redirected:false}]}t=Eo("hosted_vs_native");ye("[TEST] - hosted_vs_native: ".concat(t));
583
583
  // This test is only applicable to checkout that's using createCartid callback
584
- if(typeof se.checkoutSettings.createCartId!=="function"){ze("[TEST] - createCartId is not provided, skipping hosted vs native test");return[2/*return*/,{redirected:false}]}
584
+ if(typeof se.checkoutSettings.createCartId!=="function"){ye("[TEST] - createCartId is not provided, skipping hosted vs native test");return[2/*return*/,{redirected:false}]}
585
585
  // No need to do anything if the test is enabled for native
586
- if(t!=="hosted"){ze("[TEST] - Hosted vs native test is enabled for native, skipping");return[2/*return*/,{redirected:false}]}if(!((e=se.genericSettings)===null||e===void 0?void 0:e.hostedCheckoutUrl)){ze("[TEST] - Hosted checkout URL is not provided");return[2/*return*/,{redirected:false}]}ze('"createCartId" is provided, start building cart');return[4/*yield*/,se.checkoutSettings.createCartId()];case 1:n=a.sent();i=null;if(typeof n==="object"){r=n.cartId;i=n.shippingData||null}else{r=n}s=So();c=De(Object.assign(Object.assign({cartId:r,checkoutSessionId:ee.checkoutSessionId||undefined,hostedCheckoutUrl:se.genericSettings.hostedCheckoutUrl,isTestMode:le(),isVariantTest:true},s),i));ze("[TEST] - Redirecting to: ".concat(c));
586
+ if(t!=="hosted"){ye("[TEST] - Hosted vs native test is enabled for native, skipping");return[2/*return*/,{redirected:false}]}if(!((e=se.genericSettings)===null||e===void 0?void 0:e.hostedCheckoutUrl)){ye("[TEST] - Hosted checkout URL is not provided");return[2/*return*/,{redirected:false}]}ye('"createCartId" is provided, start building cart');return[4/*yield*/,se.checkoutSettings.createCartId()];case 1:n=a.sent();i=null;if(typeof n==="object"){r=n.cartId;i=n.shippingData||null}else{r=n}s=Io();c=Ne(Object.assign(Object.assign({cartId:r,checkoutSessionId:ee.checkoutSessionId||undefined,hostedCheckoutUrl:se.genericSettings.hostedCheckoutUrl,isTestMode:le(),isVariantTest:true},s),i));ye("[TEST] - Redirecting to: ".concat(c));
587
587
  // Open new page with the cart URL
588
588
  window.open(c,"_blank");return[2/*return*/,{redirected:true}]}}))}))};this.formatDate=function(e){if(!e){return""}
589
589
  // get date in 24/12/2024 format (without time)
@@ -597,10 +597,10 @@ var o=new Date(e);return o.toLocaleTimeString()};this.getCurrentLocalePageEnum=f
597
597
  * forcing them to retype anything. Skips when an address has already been
598
598
  * prefilled by another path (Stripe customer profile, merchant-provided
599
599
  * `defaultAddress`, or the BC redirect's session-storage handoff).
600
- */this.prefillBigCommerceCustomerAddresses=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:if(!window.Zonos.isBigCommerce){return[2/*return*/]}if(this.defaultCustomerProfileAddress.length){return[2/*return*/]}e=Array.isArray(this.defaultAddress)&&this.defaultAddress.length>0||!Array.isArray(this.defaultAddress)&&typeof this.defaultAddress==="object"&&this.defaultAddress!==null;if(e){return[2/*return*/]}return[4/*yield*/,W()];case 1:o=r.sent();if(!o){return[2/*return*/]}return[4/*yield*/,Q(o)];case 2:t=r.sent();if(!Y(t)){return[2/*return*/]}n=lo(t,{isShippable:function(e){return vo(false,e)},selectedCountryCode:q.selectedCountryCode||undefined});if(!n.length){return[2/*return*/]}
600
+ */this.prefillBigCommerceCustomerAddresses=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:if(!window.Zonos.isBigCommerce){return[2/*return*/]}if(this.defaultCustomerProfileAddress.length){return[2/*return*/]}e=Array.isArray(this.defaultAddress)&&this.defaultAddress.length>0||!Array.isArray(this.defaultAddress)&&typeof this.defaultAddress==="object"&&this.defaultAddress!==null;if(e){return[2/*return*/]}return[4/*yield*/,Q()];case 1:o=r.sent();if(!o){return[2/*return*/]}return[4/*yield*/,W(o)];case 2:t=r.sent();if(!Y(t)){return[2/*return*/]}n=ho(t,{isShippable:function(e){return po(false,e)},selectedCountryCode:q.selectedCountryCode||undefined});if(!n.length){return[2/*return*/]}
601
601
  // Re-check after the awaits — another prefill path may have populated state
602
602
  // while we were waiting on the network.
603
- if(this.defaultCustomerProfileAddress.length){return[2/*return*/]}this.defaultCustomerProfileAddress=n;ze("Prefilled ".concat(String(n.length)," BigCommerce customer address(es) for logged-in shopper"),"info");return[2/*return*/]}}))}))};this.getDefaultAddress=function(){
603
+ if(this.defaultCustomerProfileAddress.length){return[2/*return*/]}this.defaultCustomerProfileAddress=n;ye("Prefilled ".concat(String(n.length)," BigCommerce customer address(es) for logged-in shopper"),"info");return[2/*return*/]}}))}))};this.getDefaultAddress=function(){
604
604
  // If checkout customer is authenticated, use the address from the customer profile
605
605
  if(t.defaultCustomerProfileAddress.length){return t.defaultCustomerProfileAddress}
606
606
  // If default address is provided directly from the component, use it
@@ -626,7 +626,7 @@ if(!o){return}var t=e.searchParams.get("zonosCheckoutSessionId");if(t){ee.checko
626
626
  // merge variant test input from url to storageStore.enabledVariantTestKeys
627
627
  var n=ee.enabledVariantTestKeys||[];
628
628
  // override the selected variant key if it's not "hosted" since we are in hosted checkout tab
629
- if(window.Zonos.isLegacyCheckout){var r=Uo("hosted_vs_native");
629
+ if(window.Zonos.isLegacyCheckout){var r=Eo("hosted_vs_native");
630
630
  // Set selected variant key "hosted" to enabledVariantTestKeys if it's not in enabledVariantTestKeys already
631
631
  if(!r){n.push({expiresAt:Date.now()+oe,selectedVariantKey:"hosted",testKey:"hosted_vs_native"});te(n)}else{te(n.map((function(e){if(e.testKey==="hosted_vs_native"){return Object.assign(Object.assign({},e),{selectedVariantKey:"hosted"})}return e})))}}
632
632
  // Remove query params from the url
@@ -657,16 +657,16 @@ m();
657
657
  p();
658
658
  /**
659
659
  * Trigger callback when the checkout is closed
660
- */(t=(o=se.checkoutSettings).onClose)===null||t===void 0?void 0:t.call(o);return[2/*return*/]}))}))};e.prototype.buildCartAndInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,a,u,d,h,s,a,a,v,m,s,p,k,y,b;return __generator(this,(function(_){switch(_.label){case 0:if(!(typeof se.checkoutSettings.createCartId==="function"))return[3/*break*/,4];ze('"createCartId" is provided, start building cart');
660
+ */(t=(o=se.checkoutSettings).onClose)===null||t===void 0?void 0:t.call(o);return[2/*return*/]}))}))};e.prototype.buildCartAndInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,a,u,d,h,s,a,a,v,m,s,p,k,y,b;return __generator(this,(function(_){switch(_.label){case 0:if(!(typeof se.checkoutSettings.createCartId==="function"))return[3/*break*/,4];ye('"createCartId" is provided, start building cart');
661
661
  // Reset before awaiting the merchant callback so a stale banner from a
662
662
  // previous open is not visible while the network call is in flight.
663
- l.customMessage=[];return[4/*yield*/,se.checkoutSettings.createCartId()];case 1:o=_.sent();t=void 0;if(typeof o==="object"){ze("object detected, use cartId and prefill address from createCartId","info",o);t=o.cartId;
663
+ l.customMessage=[];return[4/*yield*/,se.checkoutSettings.createCartId()];case 1:o=_.sent();t=void 0;if(typeof o==="object"){ye("object detected, use cartId and prefill address from createCartId","info",o);t=o.cartId;
664
664
  // set prefill address if provided in createCartId callback result
665
665
  this.useShippingDataFromCreateCartId(o.shippingData);l.customerAuthenticationToken=o.customerAuthenticationToken||null;
666
666
  // Normalize against misbehaving merchant callbacks: only accept an
667
667
  // array of strings, drop everything else so a bad value can't crash
668
668
  // the renderer (`.filter(...)` would throw on non-arrays).
669
- l.customMessage=Array.isArray(o.customMessage)?o.customMessage.filter((function(e){return typeof e==="string"})):[]}else{t=o}window.Zonos.cartId=t;return[4/*yield*/,Do(t)];case 2:n=_.sent();r=n===null||n===void 0?void 0:n.cartData;if(!r){he("Failed to build cart, please try again.");return[2/*return*/,false]}window.Zonos.cartData=r;i=ue(r),s=i.adjustments,a=i.cartItems;return[4/*yield*/,f({adjustments:s,cartItems:a})];case 3:_.sent();return[3/*break*/,12];case 4:if(!window.Zonos.cartData)return[3/*break*/,9];ze("tempCartUUID is provided, start building cart");u=(e=window.Zonos.cartData.references)===null||e===void 0?void 0:e.checkoutSessionId;if(!u)return[3/*break*/,6];ze("Setting checkout session id from cart reference","info",u);return[4/*yield*/,this.recoverCompletedOrderModificationSession(u)];case 5:d=_.sent();if(d){
669
+ l.customMessage=Array.isArray(o.customMessage)?o.customMessage.filter((function(e){return typeof e==="string"})):[]}else{t=o}window.Zonos.cartId=t;return[4/*yield*/,No(t)];case 2:n=_.sent();r=n===null||n===void 0?void 0:n.cartData;if(!r){he("Failed to build cart, please try again.");return[2/*return*/,false]}window.Zonos.cartData=r;i=ue(r),s=i.adjustments,a=i.cartItems;return[4/*yield*/,f({adjustments:s,cartItems:a})];case 3:_.sent();return[3/*break*/,12];case 4:if(!window.Zonos.cartData)return[3/*break*/,9];ye("tempCartUUID is provided, start building cart");u=(e=window.Zonos.cartData.references)===null||e===void 0?void 0:e.checkoutSessionId;if(!u)return[3/*break*/,6];ye("Setting checkout session id from cart reference","info",u);return[4/*yield*/,this.recoverCompletedOrderModificationSession(u)];case 5:d=_.sent();if(d){
670
670
  // Recovery routes straight to the finish step, bypassing the
671
671
  // cartStoreUpdateItems call below that would normally clear this -
672
672
  // without it, the finish screen would spin forever (dialogLoading
@@ -675,7 +675,7 @@ c.isFetchingSession=false;return[2/*return*/,true]}ee.checkoutSessionId=u;return
675
675
  // Same as zonos-collect/zonos-invoice: without this, a checkout
676
676
  // session id left over from a previous cart in this tab would leak
677
677
  // into this unrelated one.
678
- ze("Clear checkout session id from storage so we start from a fresh session for this cart");ee.checkoutSessionId=null;_.label=7;case 7:h=ue(window.Zonos.cartData),s=h.adjustments,a=h.cartItems;return[4/*yield*/,f({adjustments:s,cartItems:a})];case 8:_.sent();return[3/*break*/,12];case 9:if(!(se.checkoutSettings.buildCartDetail&&q.selectedCountryCode))return[3/*break*/,12];ze("build cart detail");return[4/*yield*/,se.checkoutSettings.buildCartDetail({countryCode:q.selectedCountryCode,currencyCode:q.targetCurrency})];case 10:a=_.sent();v=a.filter((function(e){return e.amount>=0}));m=a.filter((function(e){return e.amount<0}));ze("cartItems","info",{cartItems:a});s=m.map((function(e){return{amount:e.amount,currencyCode:e.currencyCode,description:e.name||e.description||"",productId:e.productId||null,sku:e.sku||null,type:"CART_TOTAL"}}));return[4/*yield*/,f({adjustments:s,cartItems:v})];case 11:_.sent();_.label=12;case 12:if(!!ee.checkoutSessionId)return[3/*break*/,14];return[4/*yield*/,g()];case 13:p=_.sent();ze("stripeStoreInitCheckoutSession: ".concat(p));if(!p){return[2/*return*/,false]}_.label=14;case 14:
678
+ ye("Clear checkout session id from storage so we start from a fresh session for this cart");ee.checkoutSessionId=null;_.label=7;case 7:h=ue(window.Zonos.cartData),s=h.adjustments,a=h.cartItems;return[4/*yield*/,f({adjustments:s,cartItems:a})];case 8:_.sent();return[3/*break*/,12];case 9:if(!(se.checkoutSettings.buildCartDetail&&q.selectedCountryCode))return[3/*break*/,12];ye("build cart detail");return[4/*yield*/,se.checkoutSettings.buildCartDetail({countryCode:q.selectedCountryCode,currencyCode:q.targetCurrency})];case 10:a=_.sent();v=a.filter((function(e){return e.amount>=0}));m=a.filter((function(e){return e.amount<0}));ye("cartItems","info",{cartItems:a});s=m.map((function(e){return{amount:e.amount,currencyCode:e.currencyCode,description:e.name||e.description||"",productId:e.productId||null,sku:e.sku||null,type:"CART_TOTAL"}}));return[4/*yield*/,f({adjustments:s,cartItems:v})];case 11:_.sent();_.label=12;case 12:if(!!ee.checkoutSessionId)return[3/*break*/,14];return[4/*yield*/,g()];case 13:p=_.sent();ye("stripeStoreInitCheckoutSession: ".concat(p));if(!p){return[2/*return*/,false]}_.label=14;case 14:
679
679
  // get and set payment intent async except for staging mode
680
680
  if(!l.isStagingMode){void w()}
681
681
  // apply theme to stripe elements
@@ -690,19 +690,19 @@ _.sent();k=se.checkoutSettings,y=k.successBehavior,b=k.successRedirectUrl;this.i
690
690
  // to payment, same as the Collect flow does for its own cart type. Lives
691
691
  // here (rather than at each buildCartAndInit call site) so every caller
692
692
  // gets it, including the forceDialogOpen/preview init path.
693
- if(z()){l.step="payment"}return[2/*return*/,true]}}))}))};e.prototype.reloadCheckoutSession=function(){window.location.reload()};e.prototype.handleOrderDuplication=function(){var e=fe(localStorage.getItem("zonos--placed-order-info"));if(!e){localStorage.removeItem("zonos--placed-order-info");return}var o=Date.now()-e.time;ze("=== Existing placed order info: ".concat(e.orderId," - ").concat(this.formatDate(e.time)," - elapsed in hh:ss format: ").concat(new Date(o).toISOString().substring(11,8)),"warn");var t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||Fo;
693
+ if(z()){l.step="payment"}return[2/*return*/,true]}}))}))};e.prototype.reloadCheckoutSession=function(){window.location.reload()};e.prototype.handleOrderDuplication=function(){var e=fe(me("local","zonos--placed-order-info"));if(!e){pe("local","zonos--placed-order-info");return}var o=Date.now()-e.time;ye("=== Existing placed order info: ".concat(e.orderId," - ").concat(this.formatDate(e.time)," - elapsed in hh:ss format: ").concat(new Date(o).toISOString().substring(11,8)),"warn");var t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||Ho;
694
694
  // if the order is placed within 5 minutes, confirm with the user to proceed with the order duplication
695
- if(o>t){ze("=== Existing placed order info is older than ".concat(t,"ms, cleaning localStorage"),"warn");
695
+ if(o>t){ye("=== Existing placed order info is older than ".concat(t,"ms, cleaning localStorage"),"warn");
696
696
  // remove the placed order info if it's older than 5 minutes and do nothing.
697
- localStorage.removeItem("zonos--placed-order-info");return}
697
+ pe("local","zonos--placed-order-info");return}
698
698
  // Set placed order info to show the confirm notification to the user
699
- this.placedOrderInfo=e;ze("=== Showing order duplication confirmation","warn")};e.prototype.recordCheckoutInfo=function(){if(!ee.checkoutSessionId){return}
699
+ this.placedOrderInfo=e;ye("=== Showing order duplication confirmation","warn")};e.prototype.recordCheckoutInfo=function(){if(!ee.checkoutSessionId){return}
700
700
  // Record the order duplication consent so we know user did see the notification and proceed with the order duplication
701
- void we({attributes:[{key:"APP_VERSION",value:window.Zonos.version},{key:"APP_VERSION_NPM_INTEGRATION",value:window.Zonos.isNpm?"1":"0"},{key:"LEGACY_CHECKOUT_FACADE",value:window.Zonos.isLegacyCheckout?"1":"0"}],checkoutSessionId:ee.checkoutSessionId})};e.prototype.confirmProceedWithOrderDuplication=function(){
701
+ void ke({attributes:[{key:"APP_VERSION",value:window.Zonos.version},{key:"APP_VERSION_NPM_INTEGRATION",value:window.Zonos.isNpm?"1":"0"},{key:"LEGACY_CHECKOUT_FACADE",value:window.Zonos.isLegacyCheckout?"1":"0"}],checkoutSessionId:ee.checkoutSessionId})};e.prototype.confirmProceedWithOrderDuplication=function(){
702
702
  // Reset the placed order info
703
703
  this.placedOrderInfo=null;if(!ee.checkoutSessionId){return}
704
704
  // Record the order duplication consent so we know user did see the notification and proceed with the order duplication
705
- void we({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:ee.checkoutSessionId})};e.prototype.markTheSessionAsAbandonedCart=function(){if(!ee.checkoutSessionId){return}void we({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:ee.checkoutSessionId})};e.prototype.handleCancelOrderDuplication=function(){var e;
705
+ void ke({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:ee.checkoutSessionId})};e.prototype.markTheSessionAsAbandonedCart=function(){if(!ee.checkoutSessionId){return}void ke({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:ee.checkoutSessionId})};e.prototype.handleCancelOrderDuplication=function(){var e;
706
706
  // Reset the placed order info
707
707
  this.placedOrderInfo=null;
708
708
  // Redirect to the vendor store url if this is legacy checkout
@@ -713,25 +713,25 @@ if(this.isLegacyCheckout){var o=((e=window.Zonos.cartData)===null||e===void 0?vo
713
713
  // is on a `buildCartDetail` only setup (no cartId / no place-order
714
714
  // selector configured yet) — otherwise the redirect-back never reopens
715
715
  // the checkout dialog to show the success/finish screen.
716
- var n=!!document.querySelector("#".concat(_e));ze("attach checkout ".concat(o),"info",{href:window.location.href});ze("attach checkout to always trigger international checkout selector: ".concat(t));
716
+ var n=!!document.querySelector("#".concat(xe));ye("attach checkout ".concat(o),"info",{href:window.location.href});ye("attach checkout to always trigger international checkout selector: ".concat(t));
717
717
  // allow to load checkout if cartData is ready (Checkout can be loaded right away if tempCartUUID is in the URL)
718
718
  if(!o&&!t&&!window.Zonos.cartData&&!n){
719
719
  // do nothing if button element is not found
720
720
  return}var r=[o,t,
721
721
  // hidden button for domestic redirected
722
- "#".concat(Ce),
722
+ "#".concat(Se),
723
723
  // hidden button for legacy checkout facade and when client secret is provided in the query param or session storage when user is redirected from stripe
724
- "#".concat(_e),
724
+ "#".concat(xe),
725
725
  // hidden button for international checkout
726
- "#".concat(xe)].filter(Boolean);
726
+ "#".concat(Te)].filter(Boolean);
727
727
  // also attach event to hidden button if user was redirected with shipping address session
728
728
  var i=document.querySelectorAll(r.join(","));
729
729
  // only attach event once, and looping through all of the button elements
730
730
  i.forEach((function(n){var r=n.getAttribute("data-zonos-checkout-attached");if(r){
731
731
  // do nothing if event is already attached
732
- return}ze("attached event to button ".concat(o),"info",{button:n});n.addEventListener("click",(function(o){return __awaiter(e,void 0,void 0,(function(){var e,r,i,s,a,u,d,f,h,v,m,p,g,w,z,x,S,T,I,A;return __generator(this,(function(O){switch(O.label){case 0:i=performance.now();s=t&&n.matches(t);a=n.matches("#".concat(xe));u=n.matches("#".concat(Ce))||n.matches("#".concat(_e));
732
+ return}ye("attached event to button ".concat(o),"info",{button:n});n.addEventListener("click",(function(o){return __awaiter(e,void 0,void 0,(function(){var e,r,i,s,a,u,d,f,h,v,m,p,g,w,z,x,S,T,I,A;return __generator(this,(function(O){switch(O.label){case 0:i=performance.now();s=t&&n.matches(t);a=n.matches("#".concat(Te));u=n.matches("#".concat(Se))||n.matches("#".concat(xe));
733
733
  // Allow no country set for legacy facades. Otherwise enforce it being a shippable country and not disabled.
734
- if(!window.Zonos.isLegacyCheckout&&(!vo()||fo())&&!s&&!a&&!u){return[2/*return*/]}o.preventDefault();o.stopPropagation();ze("zonos checkout button clicked");return[4/*yield*/,this.checkStripePaymentIntentStatus({triggeredButton:o.target})];case 1:d=O.sent().shouldAllowOrder;
734
+ if(!window.Zonos.isLegacyCheckout&&(!po()||vo())&&!s&&!a&&!u){return[2/*return*/]}o.preventDefault();o.stopPropagation();ye("zonos checkout button clicked");return[4/*yield*/,this.checkStripePaymentIntentStatus({triggeredButton:o.target})];case 1:d=O.sent().shouldAllowOrder;
735
735
  // Only allow order to proceed if payment intent is not succeeded
736
736
  if(!d){return[2/*return*/]}
737
737
  /**
@@ -739,12 +739,12 @@ if(!d){return[2/*return*/]}
739
739
  * Move the logic below checking Stripe payment state so we don't record the load time on page load and only do so when checkout modal is actually showed up.
740
740
  */if(!window.Zonos.logIntervalId){
741
741
  // log the load time of all API calls every 2 seconds. This is to track the load time of all API calls for checkout user
742
- window.Zonos.logIntervalId=setInterval((function(){void Io()}),2e3)}if(!Lo("hosted_vs_native"))return[3/*break*/,4];this.isOverlayLoading=true;return[4/*yield*/,this.registerTestHostedVsNative()];case 2:O.sent();return[4/*yield*/,this.handleHostedVsNative()];case 3:f=O.sent().redirected;this.isOverlayLoading=false;
742
+ window.Zonos.logIntervalId=setInterval((function(){void Oo()}),2e3)}if(!Do("hosted_vs_native"))return[3/*break*/,4];this.isOverlayLoading=true;return[4/*yield*/,this.registerTestHostedVsNative()];case 2:O.sent();return[4/*yield*/,this.handleHostedVsNative()];case 3:f=O.sent().redirected;this.isOverlayLoading=false;
743
743
  // Stop the process if the user is being redirected to the hosted checkout page
744
- if(f){return[2/*return*/]}O.label=4;case 4:if(!window.Zonos.isBigCommerce)return[3/*break*/,7];return[4/*yield*/,Ge()];case 5:h=O.sent().shouldBypass;if(h){ze("Bypass customer group detected, redirecting to BigCommerce native checkout","info");
744
+ if(f){return[2/*return*/]}O.label=4;case 4:if(!window.Zonos.isBigCommerce)return[3/*break*/,7];return[4/*yield*/,We()];case 5:h=O.sent().shouldBypass;if(h){ye("Bypass customer group detected, redirecting to BigCommerce native checkout","info");
745
745
  // Carry over zonosQaUrl / zonosTestMode so the BC native
746
746
  // checkout keeps loading the same Zonos elements build/env.
747
- window.location.href=Fe("/checkout");return[2/*return*/]}return[4/*yield*/,no()];case 6:v=O.sent();if(v.shouldForceLogin&&v.redirectUrl){window.location.href=v.redirectUrl;return[2/*return*/]}O.label=7;case 7:
747
+ window.location.href=He("/checkout");return[2/*return*/]}return[4/*yield*/,io()];case 6:v=O.sent();if(v.shouldForceLogin&&v.redirectUrl){window.location.href=v.redirectUrl;return[2/*return*/]}O.label=7;case 7:
748
748
  // start loading
749
749
  c.isFetchingSession=true;this.open=true;O.label=8;case 8:O.trys.push([8,16,,17]);return[4/*yield*/,this.buildCartAndInit()];case 9:m=O.sent();if(!m){throw new Error("Error building cart")}if(!!window.Zonos.isLegacyCheckout)return[3/*break*/,14];p=null;O.label=10;case 10:O.trys.push([10,12,,13]);return[4/*yield*/,k()];case 11:p=O.sent();return[3/*break*/,13];case 12:g=O.sent();
750
750
  // A throwing merchant callback should stop checkout, not open it.
@@ -758,58 +758,58 @@ p=ne("Unable to check inventory. Please try again.");return[3/*break*/,13];case
758
758
  // and "Return to cart" resets the message + closes cleanly.
759
759
  l.inventoryCheckErrorMessage=p;c.isFetchingSession=false;this.open=false;return[2/*return*/]}O.label=14;case 14:(e=window.opener)===null||e===void 0?void 0:e.postMessage({checkoutSessionId:ee.checkoutSessionId,type:"zonos-checkout-session-update"},"*");
760
760
  // start the timer to validate the price
761
- y({isPreview:this.preview,sessionTimeout:Ro});K({event:"zonos-checkout-start",metadata:{checkoutSessionId:ee.checkoutSessionId}});w=ee.checkoutSessionId;void b({checkoutSessionId:w,eventName:"checkout_open"});return[4/*yield*/,Ee()];case 15:z=O.sent().enabled;
761
+ y({isPreview:this.preview,sessionTimeout:Mo});K({event:"zonos-checkout-start",metadata:{checkoutSessionId:ee.checkoutSessionId}});w=ee.checkoutSessionId;void b({checkoutSessionId:w,eventName:"checkout_open"});return[4/*yield*/,Pe()];case 15:z=O.sent().enabled;
762
762
  // Hide discount input if there's no active discount configured for the store
763
- l.shouldHideDiscountInput=!z;this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void Ao()}else{x=performance.now();S=x-i;void Oo({loadTime:S})}this.recordCheckoutInfo();T=!!Se();if(T){this.markTheSessionAsAbandonedCart()}return[3/*break*/,17];case 16:I=O.sent();if(I instanceof Error){A=I.message;if(A==="Cart is expired."){this.isCartExpired=true}}
763
+ l.shouldHideDiscountInput=!z;this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void Bo()}else{x=performance.now();S=x-i;void Uo({loadTime:S})}this.recordCheckoutInfo();T=!!Ie();if(T){this.markTheSessionAsAbandonedCart()}return[3/*break*/,17];case 16:I=O.sent();if(I instanceof Error){A=I.message;if(A==="Cart is expired."){this.isCartExpired=true}}
764
764
  // stop loading
765
765
  c.isFetchingSession=false;he(I);if(this.isCartExpired){c.isFetchingSession=true;return[2/*return*/]}
766
766
  // We want to log the error anytime we fail to create a checkout session
767
- void me({endpoint:"Error creating Checkout",errors:[I instanceof Error?I.toString():"Unknown error"],metadata:{allLogs:ye,cartId:window.Zonos.cartId,checkoutSessionBody:_(),href:window.location.href,storeBaseUrl:((r=window.Zonos.cartData)===null||r===void 0?void 0:r.storeBaseUrl)||se.onlineStoreSettings.url}});C({messages:[ne("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:ne("Error creating Checkout")});return[3/*break*/,17];case 17:return[2/*return*/]}}))}))}),{
767
+ void ge({endpoint:"Error creating Checkout",errors:[I instanceof Error?I.toString():"Unknown error"],metadata:{allLogs:_e,cartId:window.Zonos.cartId,checkoutSessionBody:_(),href:window.location.href,storeBaseUrl:((r=window.Zonos.cartData)===null||r===void 0?void 0:r.storeBaseUrl)||se.onlineStoreSettings.url}});C({messages:[ne("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:ne("Error creating Checkout")});return[3/*break*/,17];case 17:return[2/*return*/]}}))}))}),{
768
768
  // Trigger this event before any other event
769
769
  capture:true,passive:false});if(!se.checkoutSettings.disablePlaceOrderButtonActivation){n.removeAttribute("disabled")}n.setAttribute("data-zonos-checkout-attached","true");
770
770
  // if this button is the hidden button, trigger the click event
771
- if(n.matches("#".concat(Ce))){n.dispatchEvent(Ie("click"));
771
+ if(n.matches("#".concat(Se))){n.dispatchEvent(Oe("click"));
772
772
  // cleanup shipping session after button is clicked
773
773
  x();
774
774
  // remove the button after it's clicked
775
775
  n.remove()}
776
776
  // For legacy checkout facade and in case the cart or stripe client secret is provided in the query param, open Checkout right away
777
- if(n.matches("#".concat(_e))){
777
+ if(n.matches("#".concat(xe))){
778
778
  // trigger the click event on the button
779
- n.dispatchEvent(Ie("click"));n.remove()}}))};e.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}
779
+ n.dispatchEvent(Oe("click"));n.remove()}}))};e.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}
780
780
  // apply theme to stripe elements
781
781
  void this.applyStripeTheme()};e.prototype.useShippingDataFromCreateCartId=function(e){
782
782
  // Do only if prefill address is provided
783
- if(!e){return}ze("shipping data from createCartId result","info",Object.entries(e));var o=e.customerAddress1,t=e.customerAddress2,n=e.customerCity,r=e.customerCountry,i=e.customerEmail,s=e.customerFirstName,c=e.customerLastName,a=e.customerName,u=e.customerPhone,d=e.customerState,l=e.customerZip;var f=new URLSearchParams(window.location.search);var h=// fallback to selected country code if country is not provided
783
+ if(!e){return}ye("shipping data from createCartId result","info",Object.entries(e));var o=e.customerAddress1,t=e.customerAddress2,n=e.customerCity,r=e.customerCountry,i=e.customerEmail,s=e.customerFirstName,c=e.customerLastName,a=e.customerName,u=e.customerPhone,d=e.customerState,l=e.customerZip;var f=new URLSearchParams(window.location.search);var h=// fallback to selected country code if country is not provided
784
784
  r||$(f)||q.selectedCountryCode;this.applyPrefillAddress({customerAddress1:o,customerAddress2:t,customerCity:n,customerCountry:h,customerEmail:i,customerFirstName:s,customerLastName:c,customerName:a,customerPhone:u,customerState:d,customerZip:l})};
785
785
  /**
786
786
  * Set default address from query param if it's valid
787
- */e.prototype.useLegacyQueryParams=function(){var e=new URLSearchParams(window.location.search);ze("legacy urlParams","info",Object.fromEntries(e.entries()));var o=function(o){var t=e.get(o);if(!t||t==="undefined"){return null}return t};var t=
787
+ */e.prototype.useLegacyQueryParams=function(){var e=new URLSearchParams(window.location.search);ye("legacy urlParams","info",Object.fromEntries(e.entries()));var o=function(o){var t=e.get(o);if(!t||t==="undefined"){return null}return t};var t=
788
788
  // fallback to selected country code if country is not provided
789
789
  $(e)||q.selectedCountryCode;var n=o("customerCity");var r=o("customerEmail");var i=o("customerAddress1");var s=o("customerAddress2");var c=o("customerName");var a=o("customerFirstName");var u=o("customerLastName");var d=o("customerPhone");var l=o("customerZip");var f=o("customerState");this.applyPrefillAddress({customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:a,customerLastName:u,customerName:c,customerPhone:d,customerState:f,customerZip:l})};e.prototype.applyPrefillAddress=function(e){var o=e.customerAddress1||"";var t=e.customerCountry||"";var n=e.customerAddress2||"";var r=e.customerCity||"";var i=e.customerEmail||"";var s=e.customerFirstName&&e.customerLastName?"".concat(e.customerFirstName," ").concat(e.customerLastName):e.customerName||"";var c=e.customerPhone||"";var a=e.customerZip||"";var u=e.customerState||"";
790
790
  /**
791
791
  * If one of the value is null, no need to preset the default address.
792
792
  * City and state are optional (they are not always provided for example Puerto Rico)
793
- **/if(!o||!s||!c||!t){ze("Missing required query params so it can not be prefilled","info",[!o&&"line1",!s&&"name",!c&&"phone",!t&&"country"].filter(Boolean).join(", "));return}if(t&&q.shippingZoneCountries&&!(t in q.shippingZoneCountries)){ze('Country "'.concat(t,'" is not in the shipping zone, so it can not be prefilled'),"warn");return}this.defaultAddressParams=[{address:{city:r||"",country:t,line1:o,line2:n,postal_code:a,state:u},email:i,name:s,phone:c}];ze("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:e})};e.prototype.overrideStagingModeChanged=function(){l.isStagingMode=!!this.overrideStagingMode};
793
+ **/if(!o||!s||!c||!t){ye("Missing required query params so it can not be prefilled","info",[!o&&"line1",!s&&"name",!c&&"phone",!t&&"country"].filter(Boolean).join(", "));return}if(t&&q.shippingZoneCountries&&!(t in q.shippingZoneCountries)){ye('Country "'.concat(t,'" is not in the shipping zone, so it can not be prefilled'),"warn");return}this.defaultAddressParams=[{address:{city:r||"",country:t,line1:o,line2:n,postal_code:a,state:u},email:i,name:s,phone:c}];ye("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:e})};e.prototype.overrideStagingModeChanged=function(){l.isStagingMode=!!this.overrideStagingMode};
794
794
  /**
795
795
  * Setup all of the event listeners for the component on first load
796
796
  */e.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var e;var o=this;return __generator(this,(function(t){c.stripe=window.Zonos.stripe;this.stripe=window.Zonos.stripe;
797
797
  // Set staging mode on init
798
- l.isStagingMode=pe();
798
+ l.isStagingMode=we();
799
799
  // Override staging mode if it's provided
800
800
  if(typeof this.overrideStagingMode!=="undefined"){l.isStagingMode=this.overrideStagingMode}
801
801
  // Start fetching BigCommerce customer group on page load so the bypass
802
802
  // result is ready by the time checkout opens or the BC watcher fires
803
- Ve();
803
+ Qe();
804
804
  // Warm the BigCommerce `/checkouts/settings` fetch (merchant's
805
805
  // `guest_checkout_type`) so force-login gating resolves instantly when
806
806
  // the shopper clicks checkout — otherwise the first checkout open
807
807
  // would block on a proxy round trip.
808
- to();
808
+ ro();
809
809
  // On BC's `/login.php`, rewrite the "Create account" button href so
810
810
  // the post-signup round trip preserves the `from=cart.php?...` flag
811
811
  // that carries the shopper back into Zonos international checkout.
812
- co();
812
+ uo();
813
813
  // If BC redirected the shopper back here after login with the Zonos
814
814
  // resume flag, auto-open the international checkout. Strip the flag
815
815
  // from the URL so a refresh doesn't keep re-triggering the dialog.
@@ -820,7 +820,7 @@ this.handleBigcommerceInternationalResumeFlag();
820
820
  // the prefill itself guards against overwriting other prefill sources.
821
821
  void this.prefillBigCommerceCustomerAddresses();
822
822
  // check if bigcommerce, if user enters the shipping address that's in the shipping zone at bigcommerce checkout
823
- xo({domesticRedirectedBtnSelector:Ce,onInternationalCheckoutSelected:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.detectedDomesticCheckoutDialogOpen=true;
823
+ To({domesticRedirectedBtnSelector:Se,onInternationalCheckoutSelected:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.detectedDomesticCheckoutDialogOpen=true;
824
824
  // wait for 2 secs
825
825
  return[4/*yield*/,new Promise((function(e){return setTimeout(e,2e3)}))];case 1:
826
826
  // wait for 2 secs
@@ -836,7 +836,7 @@ onLoggedInInternationalAddressDetected:function(){return new Promise((function(e
836
836
  o.defaultAddress=[{address:{city:e.city,country:e.countryCode,line1:e.address1,line2:e.address2,postal_code:e.postalCode,state:e.state},email:"",name:"".concat(e.firstName," ").concat(e.lastName),phone:e.phone}]}});
837
837
  /**
838
838
  * When temp cart data is available, set default address if it exists
839
- */if(window.Zonos){this.useLegacyQueryParams()}e=setInterval((function(){c.stripe=window.Zonos.stripe;o.stripe=window.Zonos.stripe;if(!o.stripe){ze("waiting for stripe to be loaded");return}if(o.storybookPaymentStatusOverride){clearInterval(e);return}ze("init checkout");if(o.preview||o.forceDialogOpen){void o.buildCartAndInit()}else if(window.Zonos.isLegacyCheckout){
839
+ */if(window.Zonos){this.useLegacyQueryParams()}e=setInterval((function(){c.stripe=window.Zonos.stripe;o.stripe=window.Zonos.stripe;if(!o.stripe){ye("waiting for stripe to be loaded");return}if(o.storybookPaymentStatusOverride){clearInterval(e);return}ye("init checkout");if(o.preview||o.forceDialogOpen){void o.buildCartAndInit()}else if(window.Zonos.isLegacyCheckout){
840
840
  // With legacy checkout, avoid the mutation observer. We are using a hidden button to trigger checkout.
841
841
  o.attachCheckout()}else if(window){o.attachCheckout();
842
842
  // create a mutation observer to see if any new elements that match our selector is added to the DOM
@@ -857,7 +857,7 @@ clearInterval(e)}),1e4);return[2/*return*/]}))}))};
857
857
  * fires against a half-initialized store, which is what happens when
858
858
  * the shopper refreshes back into cart.php straight from the login
859
859
  * round trip.
860
- */e.prototype.handleBigcommerceInternationalResumeFlag=function(){if(!window.Zonos.isBigCommerce){return}var e=new URL(window.location.href);if(e.searchParams.get(je)!=="true"){return}e.searchParams.delete(je);window.history.replaceState({},"",e.toString());var o=Date.now();var t=setInterval((function(){if(!q.localizationLoaded||!q.selectedCountryCode){if(Date.now()-o>15e3){clearInterval(t);ze("BigCommerce international checkout resume flag: localization did not initialize within 15s","info")}return}var e=document.querySelector("#".concat(xe));if(e){clearInterval(t);e.dispatchEvent(Ie("click"));return}if(Date.now()-o>15e3){clearInterval(t);ze("BigCommerce international checkout resume flag: trigger button did not mount within 15s","info")}}),200)};
860
+ */e.prototype.handleBigcommerceInternationalResumeFlag=function(){if(!window.Zonos.isBigCommerce){return}var e=new URL(window.location.href);if(e.searchParams.get(Re)!=="true"){return}e.searchParams.delete(Re);window.history.replaceState({},"",e.toString());var o=Date.now();var t=setInterval((function(){if(!q.localizationLoaded||!q.selectedCountryCode){if(Date.now()-o>15e3){clearInterval(t);ye("BigCommerce international checkout resume flag: localization did not initialize within 15s","info")}return}var e=document.querySelector("#".concat(Te));if(e){clearInterval(t);e.dispatchEvent(Oe("click"));return}if(Date.now()-o>15e3){clearInterval(t);ye("BigCommerce international checkout resume flag: trigger button did not mount within 15s","info")}}),200)};
861
861
  /**
862
862
  * For storybook to set to finish step, this is to trigger in the story for zonos-checkout-finish
863
863
  */e.prototype.setToFinishStep=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){l.step="finish";this.storybookPaymentStatusOverride=e;return[2/*return*/]}))}))};
@@ -866,15 +866,15 @@ clearInterval(e)}),1e4);return[2/*return*/]}))}))};
866
866
  */e.prototype.mockCheckoutSession=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){S(e);return[2/*return*/]}))}))};
867
867
  /**
868
868
  * Trigger the checkout international button
869
- */e.prototype.triggerCheckoutInternational=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(o){e=document.querySelector("#".concat(xe));if(e){e.dispatchEvent(Ie("click"))}return[2/*return*/]}))}))};e.prototype.handleCustomerInfoContinue=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,a;var u=this;return __generator(this,(function(d){switch(d.label){case 0:
869
+ */e.prototype.triggerCheckoutInternational=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(o){e=document.querySelector("#".concat(Te));if(e){e.dispatchEvent(Oe("click"))}return[2/*return*/]}))}))};e.prototype.handleCustomerInfoContinue=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,a;var u=this;return __generator(this,(function(d){switch(d.label){case 0:
870
870
  // submit google tag when the form is complete
871
871
  K({event:"zonos-checkout-customer-info",metadata:{checkoutSessionId:ee.checkoutSessionId}});r=ee.checkoutSessionId;void b({checkoutSessionId:r,eventName:"checkout_customerInfoCompleted"});this.submitLoading=true;return[4/*yield*/,T()];case 1:i=d.sent().isRequestNotReady;
872
872
  // If the request is not ready at the time user click Continue, logging it out so we can investigate the issue
873
- if(i&&l.addressFormRenderType==="stripe"){void me({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:(o=(e=c.stripeAddressEventData)===null||e===void 0?void 0:e.value)===null||o===void 0?void 0:o.address,billingAddress:(n=(t=c.stripeBillingAddressEventData)===null||t===void 0?void 0:t.value)===null||n===void 0?void 0:n.address,cartId:window.Zonos.cartId}})}s=function(e){if(l.step!=="customer-info"){
873
+ if(i&&l.addressFormRenderType==="stripe"){void ge({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:(o=(e=c.stripeAddressEventData)===null||e===void 0?void 0:e.value)===null||o===void 0?void 0:o.address,billingAddress:(n=(t=c.stripeBillingAddressEventData)===null||t===void 0?void 0:t.value)===null||n===void 0?void 0:n.address,cartId:window.Zonos.cartId}})}s=function(e){if(l.step!=="customer-info"){
874
874
  // stop interval if the step is not customer-info
875
875
  clearInterval(e);return}if(!c.isFetchingLandedCost){if(l.landedCostData){
876
876
  // start init paypal with the presentment currency when landed cost is fetched
877
- void V({currency:l.currency});
877
+ void G({currency:l.currency});
878
878
  // only go to next step if landed cost data is ready
879
879
  I()}u.submitLoading=false;if(e){clearInterval(e)}}};
880
880
  // Immediately move to the next step
@@ -919,7 +919,7 @@ this.submitLoading=false;return[2/*return*/]}i=M();if(!(i>0))return[3/*break*/,8
919
919
  // so cartStore.selectedLandedCost is never populated — bypass the
920
920
  // landed-cost guard the same way zonos-collect does for its own
921
921
  // no-shipping-step flow.
922
- return[4/*yield*/,P({noLandedCostCheck:z()})];case 15:
922
+ return[4/*yield*/,D({noLandedCostCheck:z()})];case 15:
923
923
  // Order-modification payment-only sessions skip the shipping step,
924
924
  // so cartStore.selectedLandedCost is never populated — bypass the
925
925
  // landed-cost guard the same way zonos-collect does for its own
@@ -928,7 +928,7 @@ h.sent();I();
928
928
  // clear the checkout session timeout timer when purchase is complete
929
929
  p();return[3/*break*/,17];case 16:f=h.sent();he(f);K({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:ee.checkoutSessionId}});c.hasPaymentError=true;
930
930
  // should request inventory refund if there's an error during payment
931
- if(c.shouldInventoryRefund){void D();c.shouldInventoryRefund=false}return[3/*break*/,17];case 17:this.submitLoading=false;return[3/*break*/,19];case 18:
931
+ if(c.shouldInventoryRefund){void P();c.shouldInventoryRefund=false}return[3/*break*/,17];case 17:this.submitLoading=false;return[3/*break*/,19];case 18:
932
932
  // Release the consent lock on every terminal exit (success or failure)
933
933
  // so the buyer can re-toggle / retry. On success the cart advances and
934
934
  // the close-handler reset would clean this up anyway.
@@ -950,15 +950,15 @@ if(window.Zonos.isLegacyCheckout&&window.Zonos.cartData){e=window.Zonos.cartData
950
950
  * @ref https://github.com/vercel/next.js/issues/33233#issuecomment-1052349396
951
951
  **/if(!n){window.history.replaceState(window.history.state,document.title,t);
952
952
  // Reload the page
953
- window.location.reload()}return[2/*return*/]}}))}))};e.prototype.handleWindowResize=function(){this.isMobile=ge(this.mobile);
953
+ window.location.reload()}return[2/*return*/]}}))}))};e.prototype.handleWindowResize=function(){this.isMobile=ze(this.mobile);
954
954
  // apply theme to stripe elements
955
- void this.applyStripeTheme();ze("mobile: ".concat(this.isMobile))};e.prototype.handleMobileChange=function(){this.isMobile=ge(this.mobile);
955
+ void this.applyStripeTheme();ye("mobile: ".concat(this.isMobile))};e.prototype.handleMobileChange=function(){this.isMobile=ze(this.mobile);
956
956
  // apply theme to stripe elements
957
- void this.applyStripeTheme();ze("mobile: ".concat(this.isMobile))};e.prototype.handleAppearanceSettingsOverrideChange=function(){var e;if((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme){
957
+ void this.applyStripeTheme();ye("mobile: ".concat(this.isMobile))};e.prototype.handleAppearanceSettingsOverrideChange=function(){var e;if((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme){
958
958
  // update theme to browser preference theme if appearance theme is system
959
- this.appearanceSettingsOverride.theme=ce(this.appearanceSettingsOverride.theme)}};e.prototype.handleAddressChange=function(){N()};e.prototype.handleCustomerProfileChange=function(){var e,o;if(!this.customerProfile){ze("No customer profile","info");this.defaultCustomerProfileAddress=[];return}ze("Customer profile found","info",{customerProfile:this.customerProfile});
959
+ this.appearanceSettingsOverride.theme=ce(this.appearanceSettingsOverride.theme)}};e.prototype.handleAddressChange=function(){N()};e.prototype.handleCustomerProfileChange=function(){var e,o;if(!this.customerProfile){ye("No customer profile","info");this.defaultCustomerProfileAddress=[];return}ye("Customer profile found","info",{customerProfile:this.customerProfile});
960
960
  // Build and set saved locations from checkout customers
961
- this.defaultCustomerProfileAddress=((o=(e=c.customerProfile)===null||e===void 0?void 0:e.locations)===null||o===void 0?void 0:o.map((function(e){var o;return{address:{city:e.locality,country:e.countryCode,line1:e.line1,line2:e.line2||"",postal_code:e.postalCode,state:e.administrativeArea},email:e.email||((o=c.customerProfile)===null||o===void 0?void 0:o.email)||"",name:e.name||"",phone:e.phone||""}})))||[]};e.prototype.handleClientSecretChange=function(){ze("==== Client secret changed","info",{clientSecret:this.clientSecret,stripeCustomerSessionClientSecret:this.stripeCustomerSessionClientSecret});
961
+ this.defaultCustomerProfileAddress=((o=(e=c.customerProfile)===null||e===void 0?void 0:e.locations)===null||o===void 0?void 0:o.map((function(e){var o;return{address:{city:e.locality,country:e.countryCode,line1:e.line1,line2:e.line2||"",postal_code:e.postalCode,state:e.administrativeArea},email:e.email||((o=c.customerProfile)===null||o===void 0?void 0:o.email)||"",name:e.name||"",phone:e.phone||""}})))||[]};e.prototype.handleClientSecretChange=function(){ye("==== Client secret changed","info",{clientSecret:this.clientSecret,stripeCustomerSessionClientSecret:this.stripeCustomerSessionClientSecret});
962
962
  // apply theme to stripe elements
963
963
  void this.applyStripeTheme()};e.prototype.handleOpenChange=function(){var e="data-zonos-overflow-origin";var o=document.body;var t=document.documentElement;
964
964
  // disable scroll on the body when dialog is open
@@ -976,7 +976,7 @@ o.style.removeProperty("overflow")}
976
976
  // reset overflow state to original state
977
977
  if(r){t.removeAttribute(e);t.style.overflow=r}else{
978
978
  // just remove the overflow style if it's not set
979
- t.style.removeProperty("overflow")}}};e.prototype.componentWillLoad=function(){var e=this;void this.init();this.isMobile=ge(this.mobile);this.isIframed=window.self!==window.top;ze("iframed: ".concat(this.isIframed));
979
+ t.style.removeProperty("overflow")}}};e.prototype.componentWillLoad=function(){var e=this;void this.init();this.isMobile=ze(this.mobile);this.isIframed=window.self!==window.top;ye("iframed: ".concat(this.isIframed));
980
980
  // Set checkout session if redirect
981
981
  if(window.Zonos.isLegacyCheckout){this.captureParamsRedirectedForVariantTest()}
982
982
  // update theme to browser preference theme if appearance theme is system
@@ -991,12 +991,12 @@ if(!window.Zonos.isBigCommerce||!o||e.redirectToDomesticCheckoutDialogOpen||!((t
991
991
  // Only redirect when checkout modal is opened
992
992
  if(!e.open){return}
993
993
  // Check if the page is checkout page, if so, do nothing since they're already at the right page
994
- if(window.location.pathname.includes("/checkout")){return}var n=o.value.address.country;if(n&&se.disabledCountries.includes(n)){e.redirectToDomesticCheckoutDialogOpen=true;ze("Domestic country ".concat(n," selected in international checkout, redirecting to BigCommerce domestic checkout"),"info");setTimeout((function(){
994
+ if(window.location.pathname.includes("/checkout")){return}var n=o.value.address.country;if(n&&se.disabledCountries.includes(n)){e.redirectToDomesticCheckoutDialogOpen=true;ye("Domestic country ".concat(n," selected in international checkout, redirecting to BigCommerce domestic checkout"),"info");setTimeout((function(){
995
995
  // Carry over zonosQaUrl / zonosTestMode so the BC native checkout
996
996
  // keeps loading the same Zonos elements build/env.
997
- window.location.href=Fe("/checkout")}),2e3)}}))];
997
+ window.location.href=He("/checkout")}),2e3)}}))];
998
998
  // Initialize test keys
999
- this.initializeTestKeys();window.addEventListener("message",this.handleHostedOpenWindowCallback);ze("mobile: ".concat(this.isMobile))};
999
+ this.initializeTestKeys();window.addEventListener("message",this.handleHostedOpenWindowCallback);ye("mobile: ".concat(this.isMobile))};
1000
1000
  // do clean up when component is unmounted
1001
1001
  e.prototype.disconnectedCallback=function(){
1002
1002
  // reset stripe store
@@ -1021,7 +1021,7 @@ l.step!=="finish"&&l.step!=="error"&&!c.stripeElements||c.isFetchingSession;
1021
1021
  // track completion via cartStore.tabItems, only ever flipped by those
1022
1022
  // steps' own continue handlers) would otherwise show a stale, frozen
1023
1023
  // bar instead of reflecting that this is a single-step flow.
1024
- var d=z();var f=ae(se.appearance,this.appearanceSettingsOverride||null),h=f.colorPrimary,v=f.colorSecondary,m=f.logoUrl,p=f.style;var g=se.appearance.zonosAttribution==="ENABLED";var w=se.appearance.theme;var k=h&&Oe(h)?"DARK":"LIGHT";
1024
+ var d=z();var f=ae(se.appearance,this.appearanceSettingsOverride||null),h=f.colorPrimary,v=f.colorSecondary,m=f.logoUrl,p=f.style;var g=se.appearance.zonosAttribution==="ENABLED";var w=se.appearance.theme;var k=h&&Ue(h)?"DARK":"LIGHT";
1025
1025
  // use right side theme if it's mobile, otherwise use themePrimaryColorBased
1026
1026
  var y=this.isMobile?w:k;
1027
1027
  // only use submit button color if it's on desktop
@@ -1029,19 +1029,19 @@ var b=!this.isMobile?v:undefined;var _=q.customMessages;var C=(o=_.find((functio
1029
1029
 
1030
1030
  var T=this.getBaseCurrencySettlementInfo();var I=function(){
1031
1031
  // add timestamp to logo url if it's preview mode so browser won't cache it on the dashboard setting
1032
- var o=e.preview?"".concat(m,"?timestamp=").concat(Date.now()):m;return t("div",{class:"zonos--logo"},o&&t("img",{alt:"".concat(se.organizationName," logo"),src:o}))};var A=le();var O=function(){var o=new URLSearchParams(window.location.search);var n=o.get("zonosQaUrl");var r=o.get("zonosDebug");var i=o.get("zonosE2ETest");var s=e.overrideStagingMode||pe();return t("zonos-v-stack",null,t("div",{class:"zonos--logo-wrapper"},I(),A&&t("zonos-badge",{badgeColor:"orange",size:"small"},ne("Test mode")),s&&t("zonos-badge",{badgeColor:"red",size:"small"},ne("Staging mode")),r==="1"&&t("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),n&&t("zonos-badge",{badgeColor:"purple",size:"small"},n),i&&t("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),!d&&t("zonos-checkout-progress-tabs",{backgroundColor:
1032
+ var o=e.preview?"".concat(m,"?timestamp=").concat(Date.now()):m;return t("div",{class:"zonos--logo"},o&&t("img",{alt:"".concat(se.organizationName," logo"),src:o}))};var A=le();var O=function(){var o=new URLSearchParams(window.location.search);var n=o.get("zonosQaUrl");var r=o.get("zonosDebug");var i=o.get("zonosE2ETest");var s=e.overrideStagingMode||we();return t("zonos-v-stack",null,t("div",{class:"zonos--logo-wrapper"},I(),A&&t("zonos-badge",{badgeColor:"orange",size:"small"},ne("Test mode")),s&&t("zonos-badge",{badgeColor:"red",size:"small"},ne("Staging mode")),r==="1"&&t("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),n&&t("zonos-badge",{badgeColor:"purple",size:"small"},n),i&&t("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),!d&&t("zonos-checkout-progress-tabs",{backgroundColor:
1033
1033
  // only use different contrast color when the secondary color is too off with the background in mobile
1034
- e.isMobile?"--zonos-elements-gray-0":null}),S.map((function(e){return t("zonos-custom-message",{icon:jo,message:e.message})})))};var B=function(){if(l.checkoutSessionTimeoutShow){return t("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:ne("Your checkout session has expired. Please reload the page to continue."),restStateTitle:ne("Session timed out"),restStateType:"Warning"},t("zonos-button",{onClick:function(){return e.reloadCheckoutSession()},variant:"primary"},ne("Reload")))}return t("div",{class:"zonos--content",style:{"--zonos--border-radius":Ae({overrideBorderStyle:p})}},l.step!=="finish"&&l.step!=="error"&&t(n,null,t("div",{class:"zonos--left","data-theme":y,style:Be({"--zonos--primary-color":!e.isMobile?h:undefined})},!e.isMobile&&O(),l.step==="customer-info"&&t("zonos-customer-info",{continueLoading:e.submitLoading,defaultAddress:e.getDefaultAddress(),isMobile:e.isMobile,onContinueClicked:function(){return e.handleCustomerInfoContinue()},submitBtnColor:b}),l.step==="shipping"&&t("zonos-shipping",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return e.handleShippingContinue()},submitBtnColor:b}),l.step==="payment"&&t("zonos-checkout-payment",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4/*yield*/,this.handleStripePaymentContinue()];case 1:e.sent();return[2/*return*/]}}))}))},submitBtnColor:b})),t("div",{class:"zonos--right","data-theme":w},e.isMobile&&O(),t("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&t("zonos-currency-toggle",null),!e.isLegacyCheckout&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:Ue}),noBackground:true,onClick:function(){return e.closeDialogHandler()}})),t("div",{class:"flex--wrapper"},t("div",{class:"zonos--wrapper"},t("zonos-review",{collapsed:e.collapseReviewMobile,mobile:e.isMobile,onClick:function(){
1034
+ e.isMobile?"--zonos-elements-gray-0":null}),S.map((function(e){return t("zonos-custom-message",{icon:Ro,message:e.message})})))};var B=function(){if(l.checkoutSessionTimeoutShow){return t("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:ne("Your checkout session has expired. Please reload the page to continue."),restStateTitle:ne("Session timed out"),restStateType:"Warning"},t("zonos-button",{onClick:function(){return e.reloadCheckoutSession()},variant:"primary"},ne("Reload")))}return t("div",{class:"zonos--content",style:{"--zonos--border-radius":Be({overrideBorderStyle:p})}},l.step!=="finish"&&l.step!=="error"&&t(n,null,t("div",{class:"zonos--left","data-theme":y,style:Le({"--zonos--primary-color":!e.isMobile?h:undefined})},!e.isMobile&&O(),l.step==="customer-info"&&t("zonos-customer-info",{continueLoading:e.submitLoading,defaultAddress:e.getDefaultAddress(),isMobile:e.isMobile,onContinueClicked:function(){return e.handleCustomerInfoContinue()},submitBtnColor:b}),l.step==="shipping"&&t("zonos-shipping",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return e.handleShippingContinue()},submitBtnColor:b}),l.step==="payment"&&t("zonos-checkout-payment",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4/*yield*/,this.handleStripePaymentContinue()];case 1:e.sent();return[2/*return*/]}}))}))},submitBtnColor:b})),t("div",{class:"zonos--right","data-theme":w},e.isMobile&&O(),t("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&t("zonos-currency-toggle",null),!e.isLegacyCheckout&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:Ee}),noBackground:true,onClick:function(){return e.closeDialogHandler()}})),t("div",{class:"flex--wrapper"},t("div",{class:"zonos--wrapper"},t("zonos-review",{collapsed:e.collapseReviewMobile,mobile:e.isMobile,onClick:function(){
1035
1035
  // do nothing if it's not mobile
1036
1036
  if(!e.isMobile){return}e.collapseReviewMobile=!e.collapseReviewMobile}}),t("zonos-collapse",{
1037
1037
  // only collapsible on mobile
1038
- collapsed:e.collapseReviewMobile&&e.isMobile},t("zonos-cart-items",null),e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",{submitBtnColor:b}),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:jo,message:C})))),t("zonos-cart-restricted-items",null),!e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",null),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:jo,message:C}))))),(l.step==="finish"||l.step==="error")&&t("div",{class:"zonos--done","data-theme":w},t("div",{class:"zonos--header"},I(),!e.isRedirectAfterOrder&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:Ue}),noBackground:true,onClick:function(){return e.handleFinishClick()},theme:w})),t("zonos-checkout-finish",{borderRadius:p,onCloseClick:function(){return e.handleFinishClick()},overrideNotification:l.step==="error"&&!!l.error?Object.assign(Object.assign({},l.error),{type:"error"}):undefined,storybookForceStatus:e.storybookPaymentStatusOverride})),t("zonos-checkout-footer",{"data-theme":w,mobile:e.isMobile,
1038
+ collapsed:e.collapseReviewMobile&&e.isMobile},t("zonos-cart-items",null),e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",{submitBtnColor:b}),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Ro,message:C})))),t("zonos-cart-restricted-items",null),!e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",null),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Ro,message:C}))))),(l.step==="finish"||l.step==="error")&&t("div",{class:"zonos--done","data-theme":w},t("div",{class:"zonos--header"},I(),!e.isRedirectAfterOrder&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:Ee}),noBackground:true,onClick:function(){return e.handleFinishClick()},theme:w})),t("zonos-checkout-finish",{borderRadius:p,onCloseClick:function(){return e.handleFinishClick()},overrideNotification:l.step==="error"&&!!l.error?Object.assign(Object.assign({},l.error),{type:"error"}):undefined,storybookForceStatus:e.storybookPaymentStatusOverride})),t("zonos-checkout-footer",{"data-theme":w,mobile:e.isMobile,
1039
1039
  /**
1040
1040
  * For this component, use slot instead of passing JSX through prop of other component. Because
1041
1041
  * the click outside event will be triggered on and targeted to whichever component that it's attached to.
1042
1042
  * Move it into <slot /> would resolve the issue.
1043
1043
  */
1044
- slot:!e.isMobile?"dialog-footer":undefined}))};return t(r,{class:Te(["zonos--checkout zonos--elements",l.step==="payment"&&"zonos--processing-payment",g&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?B():t("zonos-dialog",{borderStyle:p,class:"zonos--checkout-dialog","data-theme":w,height:"980px",isLoading:u,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return e.closeDialogHandler()},open:this.open,width:"1200px"},B()),t("zonos-dialog",{isLoading:true,loadingText:ne("You will be redirected to international checkout shortly."),loadingTitle:ne("We detected that you are shipping to an international address."),noClickOutside:true,noCloseButton:true,open:this.detectedDomesticCheckoutDialogOpen,width:"450px"}),t("zonos-dialog",{isLoading:true,loadingText:ne("You will be redirected to domestic checkout shortly."),loadingTitle:ne("We detected that you are shipping to a domestic address."),noClickOutside:true,noCloseButton:true,open:this.redirectToDomesticCheckoutDialogOpen,width:"450px"}),t("zonos-confirm-dialog",{class:"zonos--logged-in-intl-address-dialog",dialogCancelBtnText:ne("Stay on this page"),dialogConfirmBtnText:ne("Continue to international checkout"),dialogIntent:"info",dialogOpen:this.loggedInIntlAddressConfirmDialogOpen,dialogSubtitle:ne("Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?"),dialogTitle:ne("International shipping address detected"),dialogWidth:480,onCancelClicked:function(){var o;e.loggedInIntlAddressConfirmDialogOpen=false;(o=e.loggedInIntlAddressResolver)===null||o===void 0?void 0:o.call(e,"stay");e.loggedInIntlAddressResolver=null},onConfirmClicked:function(){var o;e.loggedInIntlAddressConfirmDialogOpen=false;(o=e.loggedInIntlAddressResolver)===null||o===void 0?void 0:o.call(e,"redirect");e.loggedInIntlAddressResolver=null}}),t("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:ne("Don't close"),dialogConfirmBtnText:ne("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:ne("Would you like to close checkout and return to the site?"),dialogTitle:ne("Are you sure?"),onCancelClicked:function(){e.confirmDialogOpen=false},
1044
+ slot:!e.isMobile?"dialog-footer":undefined}))};return t(r,{class:Ae(["zonos--checkout zonos--elements",l.step==="payment"&&"zonos--processing-payment",g&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?B():t("zonos-dialog",{borderStyle:p,class:"zonos--checkout-dialog","data-theme":w,height:"980px",isLoading:u,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return e.closeDialogHandler()},open:this.open,width:"1200px"},B()),t("zonos-dialog",{isLoading:true,loadingText:ne("You will be redirected to international checkout shortly."),loadingTitle:ne("We detected that you are shipping to an international address."),noClickOutside:true,noCloseButton:true,open:this.detectedDomesticCheckoutDialogOpen,width:"450px"}),t("zonos-dialog",{isLoading:true,loadingText:ne("You will be redirected to domestic checkout shortly."),loadingTitle:ne("We detected that you are shipping to a domestic address."),noClickOutside:true,noCloseButton:true,open:this.redirectToDomesticCheckoutDialogOpen,width:"450px"}),t("zonos-confirm-dialog",{class:"zonos--logged-in-intl-address-dialog",dialogCancelBtnText:ne("Stay on this page"),dialogConfirmBtnText:ne("Continue to international checkout"),dialogIntent:"info",dialogOpen:this.loggedInIntlAddressConfirmDialogOpen,dialogSubtitle:ne("Your selected address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?"),dialogTitle:ne("International shipping address detected"),dialogWidth:480,onCancelClicked:function(){var o;e.loggedInIntlAddressConfirmDialogOpen=false;(o=e.loggedInIntlAddressResolver)===null||o===void 0?void 0:o.call(e,"stay");e.loggedInIntlAddressResolver=null},onConfirmClicked:function(){var o;e.loggedInIntlAddressConfirmDialogOpen=false;(o=e.loggedInIntlAddressResolver)===null||o===void 0?void 0:o.call(e,"redirect");e.loggedInIntlAddressResolver=null}}),t("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:ne("Don't close"),dialogConfirmBtnText:ne("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:ne("Would you like to close checkout and return to the site?"),dialogTitle:ne("Are you sure?"),onCancelClicked:function(){e.confirmDialogOpen=false},
1045
1045
  // Mark user selected confirm to close the dialog
1046
1046
  onConfirmClicked:function(){return e.closeDialogHandler({confirmed:true})}}),t("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:ne("Return to merchant site"),dialogConfirmBtnText:ne("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:
1047
1047
  /**
@@ -1065,4 +1065,4 @@ dialogOpen:this.isCartExpired,
1065
1065
  // If dialog is in open state, the message should not be null
1066
1066
  dialogSubtitle:ne("You are being sent back to the shop to re-add items to your cart."),dialogTitle:ne("Shopping cart expired"),dialogType:"alert",
1067
1067
  // Mark user selected confirm to close the dialog
1068
- onConfirmClicked:function(){return e.handleCartExpiredDialogConfirm()}}),t("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{appearanceSettingsOverride:[{appearanceSettingsOverrideChanged:0},{handleAppearanceSettingsOverrideChange:0}],overrideStagingMode:[{overrideStagingModeChanged:0}],mobile:[{handleMobileChange:0}],defaultAddress:[{handleAddressChange:0}],customerProfile:[{handleCustomerProfileChange:0}],clientSecret:[{handleClientSecretChange:0}],stripeCustomerSessionClientSecret:[{handleClientSecretChange:0}],open:[{handleOpenChange:0}]}},enumerable:false,configurable:true});return e}());Mo.style=No()}}}));
1068
+ onConfirmClicked:function(){return e.handleCartExpiredDialogConfirm()}}),t("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{appearanceSettingsOverride:[{appearanceSettingsOverrideChanged:0},{handleAppearanceSettingsOverrideChange:0}],overrideStagingMode:[{overrideStagingModeChanged:0}],mobile:[{handleMobileChange:0}],defaultAddress:[{handleAddressChange:0}],customerProfile:[{handleCustomerProfileChange:0}],clientSecret:[{handleClientSecretChange:0}],stripeCustomerSessionClientSecret:[{handleClientSecretChange:0}],open:[{handleOpenChange:0}]}},enumerable:false,configurable:true});return e}());Ko.style=Fo()}}}));