@zonos/elements 1.3.260 → 1.3.262

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 (247) hide show
  1. package/dist/cjs/index.cjs.js +12 -9
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/{paypal-73a542cb.js → paypal-e278f405.js} +140 -6
  4. package/dist/cjs/submitGtag-4241212b.js +167 -0
  5. package/dist/cjs/zonos-address-display_8.cjs.entry.js +17 -17
  6. package/dist/cjs/zonos-address_4.cjs.entry.js +6 -6
  7. package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
  8. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  9. package/dist/cjs/zonos-card_5.cjs.entry.js +8 -8
  10. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +106 -31
  11. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +5 -5
  12. package/dist/cjs/zonos-checkout.cjs.entry.js +20 -10
  13. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
  14. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +4 -4
  15. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +19 -19
  16. package/dist/cjs/zonos-collect.cjs.entry.js +2 -2
  17. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  18. package/dist/cjs/zonos-controller.cjs.entry.js +3 -3
  19. package/dist/cjs/zonos-country-select_4.cjs.entry.js +9 -9
  20. package/dist/cjs/zonos-elements.cjs.js +1 -1
  21. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +4 -4
  22. package/dist/cjs/zonos-input.cjs.entry.js +4 -4
  23. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
  24. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +14 -14
  25. package/dist/cjs/zonos-invoice.cjs.entry.js +2 -2
  26. package/dist/cjs/zonos-language-select_2.cjs.entry.js +4 -4
  27. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  28. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  29. package/dist/cjs/zonos-stripe-input.cjs.entry.js +4 -4
  30. package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
  31. package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
  32. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +82 -15
  33. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
  34. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +7 -0
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +7 -3
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +19 -9
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +7 -0
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +5 -1
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +7 -0
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +6 -3
  41. package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.js +1 -1
  42. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +6 -6
  43. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.js +3 -3
  44. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +2 -2
  45. package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.js +3 -3
  46. package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.js +5 -5
  47. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.js +2 -2
  48. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +6 -6
  49. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.js +3 -3
  50. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +2 -2
  51. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.js +3 -3
  52. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.js +2 -2
  53. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  54. package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
  55. package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
  56. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
  57. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
  58. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  59. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
  60. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +3 -3
  61. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  62. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  63. package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.js +2 -2
  64. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  65. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  66. package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
  67. package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +1 -1
  68. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  69. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
  70. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  71. package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.js +1 -1
  72. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +4 -4
  73. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +5 -5
  74. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +5 -5
  75. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
  76. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  77. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  78. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
  79. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  80. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  81. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  82. package/dist/collection/components/main/zonos-controller.js +2 -2
  83. package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
  84. package/dist/collection/components/store/checkout/paypal.js +4 -4
  85. package/dist/collection/components/stripe/zonos-address/zonos-address.js +2 -2
  86. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -2
  87. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
  88. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  89. package/dist/collection/components/utils/analytics/analyticsRelayState.js +112 -0
  90. package/dist/collection/components/utils/analytics/mapToFbEvent.js +66 -0
  91. package/dist/collection/components/utils/submitAnalytics.js +16 -0
  92. package/dist/collection/components/utils/submitFbq.js +56 -0
  93. package/dist/collection/components/utils/submitGtag.js +15 -78
  94. package/dist/collection/scripts/_zonosBase.js +5 -2
  95. package/dist/collection/types/analyticsRelay.js +2 -2
  96. package/dist/esm/index.js +12 -9
  97. package/dist/esm/loader.js +1 -1
  98. package/dist/esm/{paypal-38ca5d21.js → paypal-d8804da5.js} +142 -9
  99. package/dist/esm/submitGtag-7f5c5bb5.js +162 -0
  100. package/dist/esm/zonos-address-display_8.entry.js +17 -17
  101. package/dist/esm/zonos-address_4.entry.js +6 -6
  102. package/dist/esm/zonos-badge.entry.js +3 -3
  103. package/dist/esm/zonos-button_3.entry.js +3 -3
  104. package/dist/esm/zonos-card_5.entry.js +8 -8
  105. package/dist/esm/zonos-cart-items_12.entry.js +106 -31
  106. package/dist/esm/zonos-checkbox_2.entry.js +5 -5
  107. package/dist/esm/zonos-checkout.entry.js +20 -10
  108. package/dist/esm/zonos-collapse.entry.js +2 -2
  109. package/dist/esm/zonos-collect-cart-items_3.entry.js +4 -4
  110. package/dist/esm/zonos-collect-finish_6.entry.js +19 -19
  111. package/dist/esm/zonos-collect.entry.js +2 -2
  112. package/dist/esm/zonos-component.entry.js +1 -1
  113. package/dist/esm/zonos-controller.entry.js +3 -3
  114. package/dist/esm/zonos-country-select_4.entry.js +9 -9
  115. package/dist/esm/zonos-elements.js +1 -1
  116. package/dist/esm/zonos-hello-dialog.entry.js +4 -4
  117. package/dist/esm/zonos-input.entry.js +4 -4
  118. package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
  119. package/dist/esm/zonos-invoice-finish_5.entry.js +14 -14
  120. package/dist/esm/zonos-invoice.entry.js +2 -2
  121. package/dist/esm/zonos-language-select_2.entry.js +4 -4
  122. package/dist/esm/zonos-link.entry.js +1 -1
  123. package/dist/esm/zonos-logo.entry.js +2 -2
  124. package/dist/esm/zonos-stripe-input.entry.js +4 -4
  125. package/dist/esm/zonos-tooltip.entry.js +2 -2
  126. package/dist/esm/zonos-v-stack.entry.js +2 -2
  127. package/dist/esm-es5/index.js +1 -1
  128. package/dist/esm-es5/loader.js +1 -1
  129. package/dist/esm-es5/paypal-d8804da5.js +17 -0
  130. package/dist/esm-es5/submitGtag-7f5c5bb5.js +1 -0
  131. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
  132. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  133. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  134. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  135. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  136. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  137. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
  138. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  139. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  140. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  141. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  142. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  143. package/dist/esm-es5/zonos-component.entry.js +1 -1
  144. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  145. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  146. package/dist/esm-es5/zonos-elements.js +1 -1
  147. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  148. package/dist/esm-es5/zonos-input.entry.js +1 -1
  149. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  150. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  151. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  152. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  153. package/dist/esm-es5/zonos-link.entry.js +1 -1
  154. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  155. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  156. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  157. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  158. package/dist/scripts/analyticsRelayOnInit.js +1 -1
  159. package/dist/scripts/index.d.ts +18 -0
  160. package/dist/scripts/index.js +1 -1
  161. package/dist/scripts/loadZonos.js +1 -1
  162. package/dist/scripts/zonos.js +1 -1
  163. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +15 -0
  164. package/dist/types/components/utils/analytics/analyticsRelayState.d.ts +43 -0
  165. package/dist/types/components/utils/analytics/mapToFbEvent.d.ts +11 -0
  166. package/dist/types/components/utils/submitAnalytics.d.ts +12 -0
  167. package/dist/types/components/utils/submitFbq.d.ts +14 -0
  168. package/dist/types/components/utils/submitGtag.d.ts +4 -9
  169. package/dist/types/scripts/_zonosBase.d.ts +11 -0
  170. package/dist/types/types/analyticsRelay.d.ts +19 -3
  171. package/dist/types/types/checkout/CheckoutConfig.d.ts +7 -0
  172. package/dist/zonos-elements/index.esm.js +1 -1
  173. package/dist/zonos-elements/{p-bb6e7e9e.entry.js → p-00bd7e5d.entry.js} +1 -1
  174. package/dist/zonos-elements/p-022ddd4a.system.entry.js +1 -0
  175. package/dist/zonos-elements/{p-da5a35a6.entry.js → p-06ef4d79.entry.js} +1 -1
  176. package/dist/zonos-elements/{p-874ccf1c.system.entry.js → p-072c5e07.system.entry.js} +1 -1
  177. package/dist/zonos-elements/{p-f7ddd288.system.entry.js → p-14f156c6.system.entry.js} +1 -1
  178. package/dist/zonos-elements/{p-66d72216.entry.js → p-155b4425.entry.js} +1 -1
  179. package/dist/zonos-elements/{p-9161f10d.system.entry.js → p-17476a30.system.entry.js} +1 -1
  180. package/dist/zonos-elements/{p-9dc671f4.entry.js → p-1916c2b0.entry.js} +1 -1
  181. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  182. package/dist/zonos-elements/{p-c09540bc.entry.js → p-34fc45e5.entry.js} +1 -1
  183. package/dist/zonos-elements/{p-e684e68f.entry.js → p-3deb91cb.entry.js} +1 -1
  184. package/dist/zonos-elements/{p-1368dce7.system.entry.js → p-4a227683.system.entry.js} +1 -1
  185. package/dist/zonos-elements/{p-bcbbe867.entry.js → p-4cee62fb.entry.js} +1 -1
  186. package/dist/zonos-elements/{p-c1ab70d2.entry.js → p-4d776228.entry.js} +1 -1
  187. package/dist/zonos-elements/{p-bdaf94a4.system.entry.js → p-50a15e3d.system.entry.js} +1 -1
  188. package/dist/zonos-elements/{p-d30e8c3a.entry.js → p-55742c52.entry.js} +1 -1
  189. package/dist/zonos-elements/{p-20842d8c.system.entry.js → p-56c11359.system.entry.js} +1 -1
  190. package/dist/zonos-elements/{p-d12fa775.entry.js → p-5a79e1f4.entry.js} +1 -1
  191. package/dist/zonos-elements/{p-df240101.system.entry.js → p-5db00bfa.system.entry.js} +1 -1
  192. package/dist/zonos-elements/p-5dd78b4b.js +1 -0
  193. package/dist/zonos-elements/{p-d2ef0416.system.entry.js → p-66934a78.system.entry.js} +1 -1
  194. package/dist/zonos-elements/p-7237f43b.system.entry.js +1 -0
  195. package/dist/zonos-elements/p-72a181b5.entry.js +1 -0
  196. package/dist/zonos-elements/p-75a27c68.entry.js +1 -0
  197. package/dist/zonos-elements/{p-6f19845a.system.entry.js → p-7dbac3ae.system.entry.js} +1 -1
  198. package/dist/zonos-elements/{p-2ac0fcb8.system.entry.js → p-7df3e44b.system.entry.js} +1 -1
  199. package/dist/zonos-elements/{p-5be87ae0.entry.js → p-80e7cab5.entry.js} +1 -1
  200. package/dist/zonos-elements/p-838e335c.entry.js +1 -0
  201. package/dist/zonos-elements/{p-dfb4360d.system.entry.js → p-9262a57c.system.entry.js} +1 -1
  202. package/dist/zonos-elements/p-947f5092.js +17 -0
  203. package/dist/zonos-elements/{p-3e7dbe9c.system.entry.js → p-9de27162.system.entry.js} +1 -1
  204. package/dist/zonos-elements/{p-bb785f33.entry.js → p-9e761130.entry.js} +1 -1
  205. package/dist/zonos-elements/{p-c908a7a3.entry.js → p-a1142a95.entry.js} +1 -1
  206. package/dist/zonos-elements/{p-d4f9e464.system.entry.js → p-a2b3c1ef.system.entry.js} +1 -1
  207. package/dist/zonos-elements/{p-8d52ac69.system.entry.js → p-a661dd45.system.entry.js} +1 -1
  208. package/dist/zonos-elements/p-a98b8b68.system.js +18 -0
  209. package/dist/zonos-elements/{p-365d4481.system.entry.js → p-aa74b61a.system.entry.js} +1 -1
  210. package/dist/zonos-elements/{p-2fa41e93.entry.js → p-ade15fd2.entry.js} +1 -1
  211. package/dist/zonos-elements/{p-87d89870.system.entry.js → p-b1c76c38.system.entry.js} +1 -1
  212. package/dist/zonos-elements/{p-770d414a.system.entry.js → p-b2cd18b4.system.entry.js} +1 -1
  213. package/dist/zonos-elements/{p-0fc5a2cc.system.entry.js → p-b47fcd8c.system.entry.js} +1 -1
  214. package/dist/zonos-elements/{p-c308c5bc.entry.js → p-c263f95f.entry.js} +1 -1
  215. package/dist/zonos-elements/p-ca411d97.entry.js +1 -0
  216. package/dist/zonos-elements/p-cab6bd98.system.js +1 -0
  217. package/dist/zonos-elements/{p-266a86d4.system.entry.js → p-d50fef06.system.entry.js} +1 -1
  218. package/dist/zonos-elements/{p-7a379538.entry.js → p-d983d472.entry.js} +1 -1
  219. package/dist/zonos-elements/{p-df578aa9.system.entry.js → p-dc4e867e.system.entry.js} +1 -1
  220. package/dist/zonos-elements/p-dee6adff.system.js +1 -0
  221. package/dist/zonos-elements/{p-2c9714e8.system.entry.js → p-e36e724b.system.entry.js} +1 -1
  222. package/dist/zonos-elements/{p-8df3c6a0.entry.js → p-e673a4d9.entry.js} +1 -1
  223. package/dist/zonos-elements/{p-d004565d.system.entry.js → p-e76dc266.system.entry.js} +1 -1
  224. package/dist/zonos-elements/{p-3576d900.entry.js → p-ed827ca3.entry.js} +1 -1
  225. package/dist/zonos-elements/{p-8dae0f0b.entry.js → p-ef12af4b.entry.js} +1 -1
  226. package/dist/zonos-elements/{p-3a198386.entry.js → p-f0046c48.entry.js} +1 -1
  227. package/dist/zonos-elements/{p-62dbc5f8.system.entry.js → p-f00a56be.system.entry.js} +1 -1
  228. package/dist/zonos-elements/{p-4416fe27.entry.js → p-f2909fb8.entry.js} +1 -1
  229. package/dist/zonos-elements/{p-fbc274a8.system.entry.js → p-f7d24382.system.entry.js} +1 -1
  230. package/dist/zonos-elements/{p-12459b59.entry.js → p-fb87172c.entry.js} +1 -1
  231. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  232. package/package.json +1 -1
  233. package/dist/cjs/submitGtag-9ac5a42e.js +0 -116
  234. package/dist/esm/submitGtag-543058f9.js +0 -113
  235. package/dist/esm-es5/paypal-38ca5d21.js +0 -17
  236. package/dist/esm-es5/submitGtag-543058f9.js +0 -1
  237. package/dist/zonos-elements/p-0ad75f38.entry.js +0 -1
  238. package/dist/zonos-elements/p-0f89fc76.system.entry.js +0 -1
  239. package/dist/zonos-elements/p-17a8a514.system.js +0 -1
  240. package/dist/zonos-elements/p-24407504.js +0 -17
  241. package/dist/zonos-elements/p-387f6a4d.js +0 -1
  242. package/dist/zonos-elements/p-47bde0ba.system.js +0 -18
  243. package/dist/zonos-elements/p-4aa5f5db.entry.js +0 -1
  244. package/dist/zonos-elements/p-70e2f9f9.system.entry.js +0 -1
  245. package/dist/zonos-elements/p-720ae42c.system.js +0 -1
  246. package/dist/zonos-elements/p-87eef44c.entry.js +0 -1
  247. package/dist/zonos-elements/p-f2a74e43.entry.js +0 -1
@@ -1 +0,0 @@
1
- import{z as zonosStore}from"./zonosStore-f1d45eac.js";import{g as getIsTestMode}from"./handleFetch-a844cac1.js";import{l as log}from"./VarianceTest-572cecf5.js";var ZONOS_ANALYTIC_TYPE="zonos-analytic";var RELAY_PING_TYPE="zonos-analytics-relay-ping";var RELAY_READY_TYPE="zonos-analytics-relay-ready";var parentGtagReady=false;var relayListenerAdded=false;var queuedEvents=[];function flushQueuedEvents(){while(queuedEvents.length>0){var e=queuedEvents.shift(),n=e.event,t=e.payload;try{window.parent.postMessage({event:n,metadata:t,type:ZONOS_ANALYTIC_TYPE},"*")}catch(e){}}}function ensureRelayListener(){if(relayListenerAdded)return;relayListenerAdded=true;window.addEventListener("message",(function(e){var n;if(((n=e.data)===null||n===void 0?void 0:n.type)===RELAY_READY_TYPE){parentGtagReady=true;if(typeof window.Zonos!=="undefined"){window.Zonos.googleAnalyticReady=true}flushQueuedEvents()}}))}function sendPingToParent(){try{var e=typeof window.Zonos!=="undefined"?window.Zonos.googleAnalyticId:undefined;window.parent.postMessage({googleAnalyticId:e,type:RELAY_PING_TYPE},"*")}catch(e){}}function ensureAnalyticsRelayPing(){if(typeof window==="undefined"||window.parent===window||parentGtagReady){return}ensureRelayListener();sendPingToParent()}var submitGtag=function(e){var n=e.event,t=e.metadata;var a=zonosStore.checkoutSettings.analyticsProviders.find((function(e){return e.type==="GOOGLE_ANALYTICS"}));if(!a||(a===null||a===void 0?void 0:a.status)==="DISABLED"){return}var r=getIsTestMode();var o=Object.assign(Object.assign({},t),r&&{isTestMode:true});var i=Object.fromEntries(Object.entries(o).filter((function(e){var n=e[0],t=e[1];return t!==null})));var d=typeof window!=="undefined"&&window.parent!==window;if(d){ensureRelayListener();if(parentGtagReady){try{window.parent.postMessage({event:n,metadata:i,type:ZONOS_ANALYTIC_TYPE},"*")}catch(e){}}else{queuedEvents.push({event:n,payload:i});sendPingToParent()}return}if(typeof window.gtag==="function"){log("Zonos submits gtag event","log",n);window.gtag("event",n,i)}};export{ensureAnalyticsRelayPing as e,submitGtag as s};
@@ -1 +0,0 @@
1
- import{r as o,d as e,h as t,F as s,a as n,g as l}from"./p-ce75b047.js";import{b as a,c as i,t as c,L as r,C as d,M as h,d as p,r as m,D as f}from"./p-a8bb461c.js";import{c as b,a as u,b as z}from"./p-24407504.js";import{t as y,s as g,l as x,p as v}from"./p-a75b8ad7.js";import{z as w}from"./p-ed9385f4.js";import{h as k,s as C,g as L,i as S,a as I}from"./p-41dd1cb8.js";import{c as H}from"./p-595f5dd2.js";import{g as j}from"./p-5beab541.js";import{l as M,b as _}from"./p-0a377722.js";import{s as Z}from"./p-387f6a4d.js";import{i as P,a as D,e as W}from"./p-b5223840.js";import{c as B}from"./p-b4b7f705.js";import{l as F}from"./p-97aceb11.js";import{r as U}from"./p-721fadd5.js";import{p as V}from"./p-7c5c5318.js";import{r as T}from"./p-1b8771bb.js";import"./p-f6922df5.js";import"./p-7d9bbdc8.js";const $=class{constructor(t){o(this,t),this.closeClick=e(this,"closeClick",7),this.borderRadius="ROUNDED",this.confirmationId=null,this.isLoading=!0,this.notificationType="success",this.notificationTitle="",this.notificationMessages=[],this.notificationActionText=y("Keep shopping"),this.order=null,this.isWaitingToRedirect=!0,this.pullOrder=async()=>{var o,e;const t=g.checkoutSessionId,s=new URLSearchParams;s.set("checkoutSessionId",t||"");const{baseUrl:n,errors:l,json:a}=await k(`/api/zonos-elements/get-order?${s.toString()}`);return l.length||!(null==a?void 0:a.id)?{baseUrl:n,order:null}:(await(null===(e=(o=w.checkoutSettings).onOrderSuccess)||void 0===e?void 0:e.call(o,{zonosApiRoute:n,zonosOrder:a})),{baseUrl:n,order:a})},this.handleSuccessBehavior=async()=>{this.isLoading=!1,await this.getPullOrder()},this.getPullOrder=async(o=0)=>{var e,t;0===o&&M("=== Start to poll for order info","info");const{baseUrl:s,order:n}=await this.pullOrder(),l=!!(null===(t=null===(e=null==n?void 0:n.references)||void 0===e?void 0:e.find((o=>"zonosOrderNumber"===(null==o?void 0:o.key))))||void 0===t?void 0:t.value),a=g.checkoutSessionId,i=parseFloat(new URLSearchParams(window.location.search).get("maxPollingRetries")||"0")||30;M(`=== Polling order (${o} attemps)`,"info"),n?(M("=== CollectOrder info found","info"),o>10&&C({endpoint:`${s}/api/zonos-elements/get-order?checkoutSessionId=${a}&orderId=${n.id}`,errors:[`Collect order found after ${o} attempts`],metadata:{allLogs:_,checkoutSessionId:g.checkoutSessionId||"",orderId:n.id,storeId:w.storeId}}),this.order=n):n&&l||!(o<i)?C({endpoint:`${s}/api/zonos-elements/get-order?checkoutSessionId=${a}`,errors:[`Collect order not found after ${i} attempts`],metadata:{allLogs:_,checkoutSessionId:g.checkoutSessionId||"",storeId:w.storeId}}):(await new Promise((o=>setTimeout(o,1e3))),await this.getPullOrder(o+1))},this.checkStripePaymentStatus=async()=>{const o=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||a.clientSecret;if(o||this.storybookForceStatus){const{error:e,messages:t,status:s}=await i({clientSecret:o,storybookForceStatus:this.storybookForceStatus}),n="requires_action"===s||e;this.notificationType=n?"error":"success",this.notificationMessages=t||[],this.notificationTitle=y(n?"Payment failed":"You're all set!"),M("=== Payment intent retrieve status","info",{clientSecret:o,error:e,messages:t,status:s});const l=new URL(window.location.href);if(l.searchParams.delete("payment_intent_client_secret"),l.searchParams.delete("payment_intent"),l.searchParams.delete("redirect_status"),l.searchParams.delete("zonosCheckoutSessionId"),window.history.replaceState({},"",l.toString()),e&&(null==t?void 0:t.length))Z({event:"zonos-checkout-payment-fail"}),C({endpoint:"Stripe payment failed",errors:[`Payment intent "${o.split("_secret_")[0]||o}" status: ${s} - checkout session: ${g.checkoutSessionId}`],metadata:{allLogs:_,credentialToken:window.Zonos.zonosApiKey}});else{Z({event:"zonos-checkout-success"}),c({checkoutSessionId:g.checkoutSessionId,eventName:"checkout_orderCompleted"});const o=H("zonos-checkout-success",{message:"Zonos Checkout successfully processed order"});document.dispatchEvent(o),await this.handleSuccessBehavior()}}this.isLoading=!1,r(),d(),g.checkoutSessionId=null},this.checkStagingOrderStatus=async()=>{this.notificationType="success",this.notificationTitle=y("You're all set!"),this.notificationMessages=h("succeeded").messages,await this.handleSuccessBehavior(),r(),d(),b(),g.checkoutSessionId=null},this.checkPaypalPaymentStatus=async()=>{if(u.paypalErrorMessage)return this.notificationType="error",this.notificationTitle=y("Payment failed"),this.notificationMessages=[u.paypalErrorMessage],void(this.isLoading=!1);this.isLoading=!1,u.orderIdCreated&&(Z({event:"zonos-checkout-success"}),c({checkoutSessionId:g.checkoutSessionId,eventName:"checkout_orderCompleted"}),this.notificationType="success",this.notificationTitle=y("You're all set!"),this.notificationMessages=h("succeeded").messages,await this.handleSuccessBehavior()),r(),d(),b(),g.checkoutSessionId=null},this.getReceiptUrl=({cartId:o})=>{const e=new URL(`${window.location.origin}/receipt`);e.searchParams.set("referenceId",o),L()&&e.searchParams.set("zonosTestMode","1");const t=new URLSearchParams(window.location.search).get("zonosQaUrl");return t&&e.searchParams.set("zonosQaUrl",t),e.toString()}}componentDidLoad(){if(this.overrideNotification)return this.notificationType=this.overrideNotification.type,this.notificationTitle=this.overrideNotification.title,this.notificationMessages=this.overrideNotification.messages,void(this.isLoading=!1);p.isStagingMode?this.checkStagingOrderStatus():u.orderIdCreated?this.checkPaypalPaymentStatus():this.checkStripePaymentStatus()}render(){const o=window.Zonos.cartId;return t(n,{key:"c085862ecf1f50752634fb44f99b5cb5d82a9e24",class:"zonos--checkout-finish zonos--elements",style:{"--zonos--border-radius":j({overrideBorderStyle:this.borderRadius})}},!this.isLoading&&t("div",{key:"9b30b12c817c3422b355a2f544bbf2908f736c80",class:"zonos--finish-details"},t("div",{key:"697fff3258a6e74d99500ec25f5d3923f8c7cfc2",class:"zonos--group"},t("zonos-icon","success"===this.notificationType?{"aria-label":"Order success",content:'<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"blue-800",size:50}:{"aria-label":"Order failed",content:'<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"red-800",size:50}),t("zonos-text",{key:"8457c0c9b22c2fb6374b60e492099981026d2690",class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),this.confirmationId&&t("zonos-badge",{key:"21ab18878abb37a2c37d873c494d71aee3d4ed71",badgeColor:"gray"},this.confirmationId),t("zonos-text",{key:"389918dd57e6ce5744b7192baa3c06c6db3f70cd",class:"zonos--subtitle",textColor:"gray-600"},this.notificationMessages.map((o=>t(s,null,o,t("br",null))))),this.order&&o&&t("div",{key:"cca6b625a6bea62b788cf8dd6bb9e03e6505d81c",class:"zonos--button-container"},t("zonos-button",{key:"0f45987515ae99045e5b449b5b1aaae11d70d9fb",onClick:()=>{window.open(this.getReceiptUrl({cartId:o}),"_blank")},size:"lg",variant:"primary"},y("View receipt"))))))}static get assetsDirs(){return["assets"]}};$.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:24px;border-radius:var(--zonos--border-radius, 10px);gap:24px;margin-top:24px;background-color:var(--zonos-elements-gray-50);padding:48px}:host .zonos--finish-details{max-width:640px;min-width:300px;line-height:24px;width:0 auto;margin:auto}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .zonos--finish-button-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto;margin-top:48px;max-width:300px}:host .zonos--button-container{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto}:host .zonos--subtitle{text-align:center}:host .zonos--order-number{background-color:var(--zonos-elements-gray-0);border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800);border-radius:var(--zonos-elements-radius-6);padding:4px 8px}";const R=class{constructor(e){o(this,e),this.mobile=!1,this.tablet=!1,this.showLanguageDialog=!1,this.isMobile=!1,this.isTablet=!1}handleGlobalClick(o){!this.el.contains(o.target)&&this.showLanguageDialog&&(this.showLanguageDialog=!1)}toggleLanguageDialog(){this.showLanguageDialog=!this.showLanguageDialog}handleMobileChange(){this.isMobile=P(this.mobile)}handleTabletChange(){this.isTablet=D(this.tablet)}componentWillLoad(){this.isMobile=P(this.mobile),this.isTablet=D(this.tablet)}render(){var o;const e=null===(o=F.find((o=>o.code===x.selectedLocale)))||void 0===o?void 0:o.label,s="gray-1000";return t(n,{key:"9509e7325ad0153d2f5c9ba3b5689fdb3ad6313e",class:B(["zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},t("div",{key:"250716798bf30901678b16e1ac159810f1d7a6ad",class:"zonos--collect-footer"},t("div",{key:"ab61803d4b5348b8978e7dfcb16a5733cca5dd29",class:"zonos--collect-locale-wrapper"},t("zonos-button",{key:"6c5dcd25d5ef73b2098269d840e291343d30cb81",buttonColor:s,class:"zonos--collect-footer-language-button",icon:t("zonos-icon",{"aria-label":"Language select",content:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM11.4709 5.80634C11.7686 5.53723 11.9541 5.5 12 5.5C12.0459 5.5 12.2314 5.53723 12.5291 5.80634C12.8115 6.06164 13.1289 6.46913 13.4271 7.03651C13.9505 8.03191 14.3838 9.46098 14.48 11.25H9.51996C9.61624 9.46098 10.0495 8.03191 10.5729 7.03651C10.8711 6.46913 11.1885 6.06164 11.4709 5.80634ZM8.01802 11.25C8.11591 9.23031 8.60319 7.55958 9.24516 6.33849C9.29983 6.23451 9.35585 6.13335 9.41312 6.03514C7.32916 6.94017 5.81218 8.90533 5.5428 11.25H8.01802ZM5.5428 12.75H8.01802C8.11591 14.7697 8.60319 16.4404 9.24516 17.6615C9.29983 17.7655 9.35585 17.8666 9.41312 17.9649C7.32916 17.0598 5.81218 15.0947 5.5428 12.75ZM9.51996 12.75H14.48C14.3838 14.539 13.9505 15.9681 13.4271 16.9635C13.1289 17.5309 12.8115 17.9384 12.5291 18.1937C12.2314 18.4628 12.0459 18.5 12 18.5C11.9541 18.5 11.7686 18.4628 11.4709 18.1937C11.1885 17.9384 10.8711 17.5309 10.5729 16.9635C10.0495 15.9681 9.61624 14.539 9.51996 12.75ZM15.982 12.75C15.8841 14.7697 15.3968 16.4404 14.7548 17.6615C14.7002 17.7655 14.6441 17.8666 14.5869 17.9649C16.6708 17.0598 18.1878 15.0947 18.4572 12.75H15.982ZM18.4572 11.25C18.1878 8.90533 16.6708 6.94017 14.5869 6.03514C14.6441 6.13335 14.7002 6.23451 14.7548 6.33849C15.3968 7.55958 15.8841 9.23031 15.982 11.25H18.4572Z" fill="currentColor"/>\n</svg>\n',iconColor:s}),onClick:()=>this.toggleLanguageDialog(),variant:"subtle"},e),t("div",{key:"d1a367cd19b36f1a0f49ccfe78e750218b50a03e",class:B(["zonos--collect-language-dialog",this.showLanguageDialog&&"zonos--collect-language-dialog-open"])},t("zonos-language-select",{key:"02f446b8f4e3dc875f78d5ac2f0b9aa6dd071f1c",handleOnClose:()=>this.toggleLanguageDialog()}))),t("div",{key:"b713a78cbd3d3f131c6c473bb1d979899d40b13b",class:"zonos--collect-footer-icon-wrapper"},t("div",{key:"97eab5909d556f13fa2acc0628d583d49f13d3a2",class:"zonos--collect-footer-logo"},t("zonos-text",{key:"a6488e084f153305eed8d6f65341d7ab00297adb",textColor:s},"Powered by"),t("a",{key:"c63a6e1064dbd733add1cc3b1df1456484e2f103",href:"https://zonos.com",target:"_blank",title:"Zonos website"},t("zonos-icon",{key:"081cae2c34e58478a8c20f0f9a9f20dc0b47c9b7",autoHeight:!0,content:'<svg width="43" height="10" viewBox="0 0 43 10" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.35896 0.0640869H0.30768C0.166068 0.0640869 0.0512695 0.178886 0.0512695 0.320497V1.85896C0.0512695 2.00057 0.166068 2.11537 0.30768 2.11537H4.44439C4.54964 2.11537 4.61005 2.2352 4.54745 2.31982L0.151823 8.2615C0.0865163 8.34978 0.0512695 8.45669 0.0512695 8.56649V9.67947C0.0512695 9.82108 0.166068 9.93588 0.30768 9.93588H7.35896C7.50057 9.93588 7.61537 9.82108 7.61537 9.67947V8.14101C7.61537 7.9994 7.50057 7.8846 7.35896 7.8846H3.22226C3.117 7.8846 3.05659 7.76477 3.11919 7.68015L7.51482 1.73847C7.58013 1.65019 7.61537 1.54328 7.61537 1.43348V0.320497C7.61537 0.178886 7.50057 0.0640869 7.35896 0.0640869Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M11.718 0C10.1602 0 8.89746 1.26279 8.89746 2.82051V7.17949C8.89746 8.73721 10.1602 10 11.718 10H13.6411C15.1988 10 16.4616 8.73721 16.4616 7.17949V2.82051C16.4616 1.26279 15.1988 0 13.6411 0H11.718ZM11.718 2.05128C11.2931 2.05128 10.9487 2.39568 10.9487 2.82051V7.17949C10.9487 7.60432 11.2931 7.94872 11.718 7.94872H13.6411C14.0659 7.94872 14.4103 7.60432 14.4103 7.17949V5V2.82051C14.4103 2.39568 14.0659 2.05128 13.6411 2.05128H11.718Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M17.7437 0.436316V9.71132C17.7437 9.85293 17.8585 9.96773 18.0001 9.96773H19.5385C19.6801 9.96773 19.7949 9.85293 19.7949 9.71132V3.74801C19.7949 3.44829 19.969 3.17587 20.241 3.04996L22.1641 2.15964C22.6739 1.92363 23.2565 2.29592 23.2565 2.85769V9.71132C23.2565 9.85293 23.3713 9.96773 23.5129 9.96773H25.0513C25.193 9.96773 25.3078 9.85293 25.3078 9.71132V2.85595C25.3078 0.79631 23.1718 -0.568775 21.3027 0.296257L19.9742 0.911055C19.8685 0.959946 19.7432 0.931536 19.669 0.84187L19.2748 0.365697C19.1773 0.248019 19.0325 0.179905 18.8797 0.179905H18.0001C17.8585 0.179905 17.7437 0.294704 17.7437 0.436316Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M29.4104 0C27.8526 0 26.5898 1.26279 26.5898 2.82051V7.17949C26.5898 8.73721 27.8526 10 29.4104 10H31.3334C32.8912 10 34.1539 8.73721 34.1539 7.17949V2.82051C34.1539 1.26279 32.8912 0 31.3334 0H29.4104ZM29.4104 2.05128C28.9855 2.05128 28.6411 2.39568 28.6411 2.82051V7.17949C28.6411 7.60432 28.9855 7.94872 29.4104 7.94872H31.3334C31.7583 7.94872 32.1027 7.60432 32.1027 7.17949V2.82051C32.1027 2.39568 31.7583 2.05128 31.3334 2.05128H29.4104Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M38.2085 0.0640869H40.3889C41.8309 0.0640869 42.9999 1.23306 42.9999 2.67506C42.9999 2.79477 42.9108 2.89574 42.792 2.91059L41.1732 3.11293C41.054 3.12784 40.9486 3.03485 40.9486 2.91466C40.9486 2.47322 40.5908 2.11537 40.1493 2.11537H38.3397C37.8688 2.11537 37.4871 2.49712 37.4871 2.96803C37.4871 3.3685 37.7658 3.71501 38.1569 3.80087L40.7916 4.37922C42.0811 4.66229 42.9999 5.80462 42.9999 7.12486C42.9999 8.67735 41.7414 9.93588 40.1889 9.93588H38.0468C36.6048 9.93588 35.4358 8.76691 35.4358 7.32491C35.4358 7.2052 35.5249 7.10423 35.6437 7.08938L37.2625 6.88703C37.3817 6.87213 37.4871 6.96512 37.4871 7.08531C37.4871 7.52675 37.8449 7.8846 38.2864 7.8846H40.1176C40.5765 7.8846 40.9486 7.51252 40.9486 7.05354C40.9486 6.67478 40.6925 6.34394 40.3258 6.24901L37.5136 5.52093C36.2902 5.20422 35.4358 4.10042 35.4358 2.83676C35.4358 1.30545 36.6772 0.0640869 38.2085 0.0640869Z" fill="var(--zonos-elements-gray-700)"/>\n</svg>\n',size:42}))),t("div",{key:"0862a11838e62f425d38066230b01f445999d751",class:"dot"}),t("a",{key:"b13f3af014b5d970e45f88cbb0ef669a0f9aa2ac",href:"https://zonos.com/docs/legal/zonos-privacy-policy",target:"_blank"},t("zonos-text",{key:"a675218a36da83427c2ce517a15b1ed5ea5910d6",textColor:s},"Privacy policy")))))}get el(){return l(this)}static get watchers(){return{mobile:["handleMobileChange"],tablet:["handleTabletChange"]}}};R.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:absolute;bottom:0;left:32px;right:32px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--collect-footer{gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;padding-left:0;-ms-flex-align:center;align-items:center;width:100%}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:16px}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo a{line-height:0}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper a{text-decoration:none}:host .zonos--collect-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--collect-footer .zonos--collect-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--collect-footer .zonos--collect-locale-wrapper{gap:4px}}:host .zonos--collect-footer .zonos--collect-language-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);width:360px;max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar{width:10px}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--collect-footer .zonos--collect-language-dialog.zonos--collect-language-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .dot{display:-ms-inline-flexbox;display:inline-flex;background:var(--zonos-elements-gray-400);width:6px;height:6px;border-radius:50%}:host(.mobile),:host(.tablet){background-color:var(--zonos-elements-gray-0);width:100%;position:-webkit-sticky;position:sticky;bottom:0}:host(.tablet) .zonos--collect-footer{width:100%;max-width:800px;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex}:host(.mobile) .zonos--collect-locale-wrapper{display:none}:host(.mobile) .zonos--collect-footer{-ms-flex-pack:center;justify-content:center}";const O=class{constructor(t){o(this,t),this.collapseClicked=e(this,"collapseClicked",7),this.mobile=!0,this.landedCostId="",this.isMobile=!1,this.collapseState=this.collapsed}handleCollapseChangeFromProp(o){this.collapseState=o}handleCollapseChange(o){this.collapseClicked.emit(o)}handleWindowResize(){this.isMobile=S(this.mobile)}componentWillLoad(){this.handleWindowResize()}renderShippingAddress(){if(W.isFetchingShippingInfo)return t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},t("zonos-skeleton",{skeletonWidth:"99px"})),t("div",{class:"zonos--collect-order-shipping-info"},t("zonos-skeleton",{skeletonWidth:"152px"}),t("zonos-h-stack",{spacing:8},t("zonos-skeleton",{skeletonWidth:"75px"}),t("zonos-skeleton",{skeletonWidth:"75px"})),t("zonos-skeleton",{skeletonWidth:"50px"})));const o=W.shippingAddress;return o?t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},y("Shipping address")),t("div",{class:"zonos--collect-order-shipping-info"},[[o.location.line1,o.location.line2].filter(Boolean).join(" "),[o.location.locality,o.location.administrativeAreaCode,o.location.postalCode].filter(Boolean).join(", "),o.location.countryCode].map((o=>t("zonos-text",null,o))))):null}render(){return t(n,{class:B(["zonos--collect-order-details zonos--elements",this.isMobile&&"mobile"])},t("div",{class:"zonos--wrapper"},t("button",{class:"zonos--order-details-header",onClick:()=>{this.collapseState=!this.collapseState},type:"button"},t("zonos-text",{type:"semiBoldLabel"},y("Order details")),(()=>t("zonos-icon",this.collapseState?{"aria-label":"Collapse expanded section",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"}:{"aria-label":"Expand collapsed section",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"}))()),t("div",{class:"zonos--order-details-wrapper"},t("zonos-collapse",{collapsed:this.collapseState},t("div",{class:"zonos--collect-order-details-content"},t("zonos-collect-cart-items",null),t("div",{class:"zonos--collect-order-info"},t("div",{class:"zonos--collect-order-details-row"},null!==W.amountTotalPaid&&t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},y("Total paid")),t("zonos-text",null,U({amount:W.amountTotalPaid||0,isForeign:!0}))),W.originCompanyName&&t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},y("Ordered from")),t("zonos-text",null,W.originCompanyName||""))),this.renderShippingAddress()))))))}static get assetsDirs(){return["assets"]}static get watchers(){return{collapsed:["handleCollapseChangeFromProp"],collapseState:["handleCollapseChange"]}}};O.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{height:100%}:host *{-ms-scroll-chaining:none;overscroll-behavior:contain}:host *::-webkit-scrollbar{width:10px}:host *::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host *::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host *::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--wrapper{overflow:auto;background-color:var(--zonos-elements-gray-50);border-radius:16px;height:100%;min-height:56px}:host .zonos--order-details-header{position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--zonos-elements-gray-50);border:none;display:-ms-flexbox;display:flex;padding:16px 16px 0 16px;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .zonos--order-details-header:focus-visible{outline:none}:host .zonos--order-details-wrapper{position:relative;padding:0 16px 16px 16px}:host .zonos--collect-order-details-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:28px}:host .zonos--collect-order-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}:host .zonos--collect-order-info .zonos--collect-order-details-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}:host .zonos--collect-order-info .zonos--collect-order-details-row>*{-ms-flex:1 1 150px;flex:1 1 150px}:host .zonos--collect-order-info .zonos--collect-order-details-column{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--collect-order-info .zonos--collect-order-shipping-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0}";const N=class{constructor(t){o(this,t),this.continueClicked=e(this,"continueClicked",7),this.paypalSessionFailed=e(this,"paypalSessionFailed",7),this.paypalSessionDone=e(this,"paypalSessionDone",7),this.storeUnsubscribeList=[],this.continueLoading=!1,this.showErrorBanner=!1,this.hasStripePaymentError=!1,this.stagingOrderCreateErrorMessage="",this.internalContinueLoading=this.continueLoading,this.handleValidate=()=>{var o;return!!(null===(o=a.stripePaymentEventData)||void 0===o?void 0:o.complete)},this.continueClickHandler=async({currencyCode:o})=>{var e,t;if(!this.handleValidate())return null===(e=a.stripeBillingAddressElement)||void 0===e||e.getValue(),this.showErrorBanner=!0,null===(t=a.stripeElements)||void 0===t||t.submit(),void setTimeout((()=>{var o;null===(o=this.ele.querySelector("zonos-banner"))||void 0===o||o.scrollIntoView({behavior:"smooth"})}),10);a.checkoutSettlementCurrency=o,Z({event:"zonos-checkout-payment-info"}),this.continueClicked.emit()},this.copyCardToClipboard=async o=>{try{await navigator.clipboard.writeText(o)}catch(e){const t=document.createElement("textarea");t.style.position="fixed",t.style.left="-1000px",t.style.top="-1000px",t.style.width="1px",t.style.height="1px",t.value=o,t.id="zonos-copy-card-number",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}window.Zonos.showNotification({message:y("Card number copied to clipboard"),timeout:4e3,type:"success"})},this.placeTestOrder=async()=>{this.internalContinueLoading=!0;const{errors:o}=await V();if(o.length)return this.stagingOrderCreateErrorMessage=o[0]||"Failed to create staging order. Please try again.",void(this.internalContinueLoading=!1);this.internalContinueLoading=!1,m()}}continueLoadingWatcher(){this.internalContinueLoading=this.continueLoading}stripePaymentErrorWatcher(){this.hasStripePaymentError&&setTimeout((()=>{var o;null===(o=this.ele.querySelector("zonos-banner"))||void 0===o||o.scrollIntoView({behavior:"smooth"})}),50)}componentWillLoad(){this.storeUnsubscribeList=[f("currency",(()=>{z({currency:p.currency})}))],z({currency:p.currency})}disconnectedCallback(){this.storeUnsubscribeList.forEach((o=>o()))}render(){var o;if(this.hasStripePaymentError=a.hasPaymentError,!a.stripeElements)return null;if(!a.clientSecret)return null;this.showErrorBanner&&(this.showErrorBanner=!this.handleValidate());const e=L(),l=p.isStagingMode||I(),i="external_paypal"===(null===(o=a.stripePaymentEventData)||void 0===o?void 0:o.value.type);return t(n,{class:"zonos--checkout-payment zonos--elements"},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},y("Payment method")),(()=>{if(l){const o=w.appearance.theme;return t(s,null,this.stagingOrderCreateErrorMessage&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},this.stagingOrderCreateErrorMessage),t("zonos-empty-state-payment",{emptyStateText:y("No payment method needed for staging"),theme:o}),t("div",{class:"zonos--group-btn"},t("zonos-button",{backgroundColor:this.submitBtnColor,loading:this.internalContinueLoading,onClick:()=>{this.placeTestOrder()},size:"lg",variant:this.submitBtnType},y("Place test order"))))}return a.isFetchingSession||W.isFetchingShippingInfo?null:t(s,null,this.showErrorBanner&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},y("Missing required fields. Make sure all fields are completed.")),this.hasStripePaymentError&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},a.customErrorMessage||y("We couldn't complete your payment. Please verify the payment details and try again.")),u.paypalErrorMessage&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},u.paypalErrorMessage),t("zonos-payment",null),t("div",{class:"zonos--group-btn"},!i&&t(s,null,t("zonos-button",{backgroundColor:this.submitBtnColor,bold:!0,isDisabled:this.continueLoading&&"USD"===a.checkoutSettlementCurrency,loading:this.continueLoading&&"USD"!==a.checkoutSettlementCurrency,onClick:async()=>{p.checkoutSession?await this.continueClickHandler({currencyCode:p.checkoutSession.subtotals.presentmentCurrencyCode}):M("Checkout session is not found")},size:"lg",variant:this.submitBtnType},y("Pay [orderTotal]",{orderTotal:U({amount:W.amountDutyTaxFeeTotal||0,isForeign:!0})})),a.shouldRenderPayInUsdButton&&t("zonos-button",{class:"zonos--pay-in-base-currency-btn",isDisabled:this.continueLoading&&"USD"!==a.checkoutSettlementCurrency,loading:this.continueLoading&&"USD"===a.checkoutSettlementCurrency,onClick:async()=>{await this.continueClickHandler({currencyCode:"USD"})},size:"lg",variant:"subtle"},y("Click to pay in USD"))),t("zonos-paypal-payment",{onPaypalSessionDone:({detail:{orderId:o}})=>{this.paypalSessionDone.emit(o)},onPaypalSessionFail:()=>this.paypalSessionFailed.emit(),style:{display:i?"block":"none"}})),e&&t("zonos-card",{backgroundColor:"gray-100",borderRadius:12,class:"zonos--test-cards"},t("zonos-v-stack",{spacing:16},t("div",null,t("zonos-text",{type:"semiBoldLabel"},y("Test cards")),t("zonos-text",{textColor:"gray-700"},y("Click to copy the card number. Use any future expiration date and three number CVC."))),t("zonos-button",{icon:t("zonos-icon",{content:'<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M15.342 10.21a.75.75 0 0 0-1.184-.92l-2.978 3.829-1.4-1.4a.75.75 0 1 0-1.06 1.061l1.8 1.8a1 1 0 0 0 1.496-.093l3.326-4.277Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>'}),justifyContent:"flex-start",onClick:()=>this.copyCardToClipboard("4242424242424242")},y("Success")," (****4242)"),t("zonos-button",{icon:t("zonos-icon",{content:'<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M14.475 10.586a.75.75 0 1 0-1.06-1.06L12 10.938l-1.414-1.414a.75.75 0 0 0-1.06 1.06L10.938 12l-1.414 1.414a.75.75 0 1 0 1.06 1.06L12 13.062l1.414 1.414a.75.75 0 0 0 1.06-1.06L13.062 12l1.414-1.414Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>'}),justifyContent:"flex-start",onClick:()=>this.copyCardToClipboard("4000000000000002")},y("Failure")," (****0002)")),t("zonos-notification",null)))})()))}get ele(){return l(this)}static get watchers(){return{continueLoading:["continueLoadingWatcher"],hasStripePaymentError:["stripePaymentErrorWatcher"]}}};N.style=".sc-zonos-collect-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-payment-h *.sc-zonos-collect-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-payment-h img.sc-zonos-collect-payment{max-width:100%}.sc-zonos-collect-payment-h dl.sc-zonos-collect-payment,.sc-zonos-collect-payment-h dd.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h1.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h2.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h3.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h4.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h5.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h6.sc-zonos-collect-payment,.sc-zonos-collect-payment-h hr.sc-zonos-collect-payment,.sc-zonos-collect-payment-h figure.sc-zonos-collect-payment,.sc-zonos-collect-payment-h p.sc-zonos-collect-payment,.sc-zonos-collect-payment-h pre.sc-zonos-collect-payment{margin:0}.sc-zonos-collect-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--title.sc-zonos-collect-payment{margin-bottom:24px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar{width:10px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-payment-h .zonos--payment-error-banner.sc-zonos-collect-payment{margin-bottom:8px}.sc-zonos-collect-payment-h .zonos--error-banner.sc-zonos-collect-payment{margin-bottom:16px}.sc-zonos-collect-payment-h zonos-button.sc-zonos-collect-payment{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-collect-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-collect-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:12px;bottom:-4px;padding-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-text.sc-zonos-collect-payment{text-align:center}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-button.sc-zonos-collect-payment{width:100%}.sc-zonos-collect-payment-h .zonos--test-cards.sc-zonos-collect-payment{margin-top:auto;padding-top:16px}";const E=class{constructor(e){o(this,e),this.mobile=!1,this.tablet=!1,this.collapsed=!1,this.isMobile=!1,this.isTablet=!1,this.isLoading=!0}handleWindowResize(){this.isMobile=P(this.mobile),this.isTablet=D(this.tablet)}componentWillLoad(){this.handleWindowResize(),setTimeout((()=>{this.isLoading=!1}),1e3)}render(){const o=this.isMobile?"gray-1000":"gray-800";return t(n,{key:"6432c5dd5afd628e33ba26385ecfecb470f1757e",class:B(["zonos--collect-review zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},t("div",{key:"e4d113ff1268c36119e1f80164b6cfd702c67f75",class:"zonos--title"},t("zonos-text",{key:"aad9ad9b526ac65d97a88df516e8e7b34fc3d2b1",textColor:o,type:"semiBoldLabel"},y("Pay [organizationName]",{organizationName:w.organizationName}))),t("div",{key:"fcdaebc734a270742fbe21ff932550994e522ea6",class:"zonos--total-pay"},T({content:t("zonos-text",{type:"secondaryPageHeader"},U({amount:W.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"36px",skeletonWidth:"150px"})))}static get assetsDirs(){return["assets"]}};E.style=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:-webkit-sticky;position:sticky;top:0;background-color:var(--zonos-elements-gray-0);z-index:1}:host .zonos--total-pay{margin:8px 0 24px;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;gap:48px}:host .zonos--total-pay zonos-text{-ms-flex-negative:0;flex-shrink:0}:host .zonos--total-pay::after{content:"";position:relative;height:1px;width:100%;background:var(--zonos-elements-gray-200)}:host(.mobile),:host(.tablet){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;padding:4px 0;background-color:transparent;position:relative}:host(.mobile) .zonos--total-pay,:host(.tablet) .zonos--total-pay{margin:0}';const Y=class{constructor(e){o(this,e),this.storeUnsubscribeList=[],this.subtotals={},this.initSubtotalData=()=>{var o;const e=null===(o=p.checkoutSession)||void 0===o?void 0:o.subtotals;if(!e)return;const t=y("Duties"),s=y("Taxes"),n=y("Fees"),l={[t]:0,[n]:0,[s]:0},a=e.duties,i=e.taxes,c=e.fees;void 0!==a&&(l[t]||(l[t]=0),l[t]+=a),void 0!==i&&(l[s]||(l[s]=0),l[s]+=i),void 0!==c&&(l[n]||(l[n]=0),l[n]+=c),this.subtotals=l}}disconnectedCallback(){this.storeUnsubscribeList.forEach((o=>o()))}componentWillLoad(){this.storeUnsubscribeList=[f("checkoutSession",this.initSubtotalData),v("translatedChunks",this.initSubtotalData)]}render(){return this.initSubtotalData(),t(n,{key:"ab687a6e1ec67f6609081036a75e9905ff34c6b1",class:"zonos--collect-subtotal zonos--elements"},t("table",{key:"303b8c49983e9f7aea4d31400fed53d858eb078d",class:"zonos--collect-table"},!!this.subtotals[y("Duties")]&&t("tr",{key:"a60fa4f1f1afacef0144b86c054f44572576f7af",class:"zonos--row zonos--collect-duty"},t("td",{key:"aeaf798e26bbd482196d7208eb05657a1d15dad8",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"835d817709ae3b7e2d888d618e0856fb2e637e4d",type:"semiBoldLabel"},y("Duties"))),t("td",{key:"5bb47a115ea61fa897a3f48bbd10c5f78af3703e",class:"zonos--column"}),t("td",{key:"32632c4beb855ca687c615f5e6c63c82e2e05c80",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"label"},U({amount:this.subtotals[y("Duties")]||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[y("Taxes")]&&t("tr",{key:"055bb237dafaea8de18b127641c8fd7e1ece563b",class:"zonos--row zonos--collect-tax"},t("td",{key:"1e73b140c2c9090ccfb91ce4efca483e8fb56e9e",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"a3375ecd77460c78c7c5f59bf7b9b8612cd53e41",type:"semiBoldLabel"},y("Taxes"))),t("td",{key:"20685646be29873967c2f335c775046068248ad3",class:"zonos--column"}),t("td",{key:"2e2c6af2c1a7840df03351178ddf3107fcc36494",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"label"},U({amount:this.subtotals[y("Taxes")]||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[y("Fees")]&&t("tr",{key:"8157aba5c6a23680b0bc681adc127747f01a2973",class:"zonos--row zonos--collect-fee"},t("td",{key:"8266654f9e65003f297222bb935013a8b9b3b430",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"8399000a5f61e4737764b68b89799b409dce6034",type:"semiBoldLabel"},y("Fees"))),t("td",{key:"2a9763f2401967ea1bdfa2c17514d18e2a4e0db6",class:"zonos--column"}),t("td",{key:"ac2f275312c2ba69888e6e57dde8b4b451839b86",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"label"},U({amount:this.subtotals[y("Fees")]||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),t("tr",{key:"a293d1b9342251f7326c1ac68e2bab83eae2ed80",class:"zonos--row zonos--collect-spacing"},t("td",{key:"c136b1b807f32dc21c131326d70500d2e2c64efe",class:"zonos--column",colSpan:3})),t("tr",{key:"59747101f1a9ef7c8fad60e90ea5b8c31015438c",class:"zonos--row zonos--collect-total zonos--collect-total-subtotal"},t("td",{key:"96d201ba6f3e571adac265127229c94cdc96be2a",class:"zonos--column"}),t("td",{key:"f2f4cb751e35fc0ebaa803659f26a2314d8bf639",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"b4f89ea1e523af8a5aead4ef007a6f0dc7e7f441",type:"label"},y("Subtotal"))),t("td",{key:"28b6aea6363b2bef1d072ad77f409ae77976305c",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"label"},U({amount:W.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),t("tr",{key:"f0072cdd200e8483421265af39a90fb655fb2ef0",class:"zonos--row zonos--collect-total"},t("td",{key:"88a007048d33c919a6c5f87cf7cd071f83e7448b",class:"zonos--column"}),t("td",{key:"24bba9e9b81ff443dd5ca4832c3169e3605a93b8",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"594d4e96bec3a2153f6622c6842970ebee5bb463",type:"semiBoldLabel"},y("Customs fees total"))),t("td",{key:"b3ffd6dcae747dd2ed68ae16fb60d9655f7669dc",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"semiBoldLabel"},U({amount:W.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"})))))}static get assetsDirs(){return["assets"]}};Y.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:-webkit-sticky;position:sticky;bottom:60px}:host .zonos--collect-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--collect-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--collect-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--collect-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--collect-subtotal-price{text-align:right}:host .zonos--collect-subtotal-price zonos-text{white-space:nowrap}:host .zonos--collect-total .zonos--column{padding:16px 0}:host .zonos--collect-total-subtotal .zonos--collect-subtotal-title,:host .zonos--collect-total-subtotal .zonos--collect-subtotal-price{border-bottom:1px solid var(--zonos-elements-gray-200)}:host .zonos--collect-subtotal-price zonos-text,:host .zonos--collect-pay-total zonos-text{white-space:nowrap}";export{$ as zonos_collect_finish,R as zonos_collect_footer,O as zonos_collect_order_details,N as zonos_collect_payment,E as zonos_collect_review,Y as zonos_collect_subtotal}
@@ -1 +0,0 @@
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;return s={next:c(0),throw:c(1),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-7261e245.system.js","./p-196423ad.system.js","./p-47bde0ba.system.js","./p-248bdea2.system.js","./p-15ef7644.system.js","./p-398d9022.system.js","./p-01174496.system.js","./p-53fe581b.system.js","./p-d938f42f.system.js","./p-40a4c8a2.system.js","./p-23e7c655.system.js","./p-bf37ccc7.system.js","./p-8bce79f4.system.js","./p-61be7d98.system.js","./p-1aa93d1e.system.js","./p-17a8a514.system.js","./p-2770ba48.system.js","./p-43a6e469.system.js","./p-e25e0b4b.system.js"],(function(e){"use strict";var o,t,n,r,i,s,c,a,u,d,l,h,f,v,m,g,p,w,z,k,y,b,_,C,x,S,T,I,A,O,E,U,L,B,P,N,j,D,R,F,M,H,Z,G,K,V,Q,W,Y,q,J,X,$,ee,oe,te,ne,re,ie,se,ce,ae,ue,de,le,he,fe,ve,me,ge,pe,we,ze,ke,ye,be,_e;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.d;l=e.e;h=e.f;f=e.g;v=e.h;m=e.j;g=e.k;p=e.l;w=e.t;z=e.m;k=e.n;y=e.o;b=e.p;_=e.q;C=e.r;x=e.u;S=e.v;T=e.w;I=e.x;A=e.y;O=e.z;E=e.A;U=e.B;L=e.C;B=e.D;P=e.E;N=e.F},function(e){j=e.p;D=e.a;R=e.b},function(e){F=e.f;M=e.l;H=e.a;Z=e.g;G=e.s;K=e.V;V=e.b;Q=e.t;W=e.c;Y=e.d},function(e){q=e.z;J=e.g;X=e.m},function(e){$=e.b},function(e){ee=e.h;oe=e.g;te=e.l;ne=e.j;re=e.b;ie=e.s;se=e.a;ce=e.i},function(e){ae=e.u},function(e){ue=e.l;de=e.g;le=e.b},function(e){he=e._;fe=e.c;ve=e.a;me=e.d;ge=e.g},function(e){pe=e.c},function(e){we=e.c},function(e){ze=e.g},function(e){ke=e.i},function(e){ye=e.s},function(e){be=e.s},function(e){_e=e.R},function(){},function(){}],execute:function(){var Ce=this;var xe=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o,t;return __generator(this,(function(n){switch(n.label){case 0:return[4,ee("/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,{enabled:false}]}return[2,{enabled:true}]}}))}))};var Se=function(e){return __awaiter(Ce,[e],void 0,(function(e){var o,t,n,r;var i=e.testKeys;return __generator(this,(function(e){switch(e.label){case 0:if(i.length===0){return[2,null]}return[4,ee("/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,null]}r=F(n);return[2,r]}}))}))};var Te=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,h=e.customerZip,f=e.hostedCheckoutUrl,v=e.isTestMode,m=e.isVariantTest;var g=new URLSearchParams;g.set("tempCartUUID",o);if(a){g.set("customerFirstName",a)}if(u){g.set("customerLastName",u)}if(c){g.set("customerEmail",c)}if(d){g.set("customerPhone",d)}if(h){g.set("customerZip",h)}if(i){g.set("customerCity",i)}if(l){g.set("customerState",l)}if(s){g.set("zCountry",s)}if(n){g.set("customerAddress1",n)}if(r){g.set("customerAddress2",r)}if(v){g.set("zonosTestMode","1")}if(t){g.set("zonosCheckoutSessionId",t)}if(m){g.set("zonosVariantTest","1")}return"".concat(f,"?").concat(g.toString())};var Ie="isInternationalCheckout";var Ae=function(){var e=new URLSearchParams;e.set(Ie,"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(oe()){e.set("zonosTestMode","1")}return"cart.php?".concat(e.toString())};var Oe=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);var i=r.get("zonosQaUrl");if(i){n.searchParams.set("zonosQaUrl",i)}var s=r.get("zonosQaUrlApi");if(s){n.searchParams.set("zonosQaUrlApi",s)}if(oe()){n.searchParams.set("zonosTestMode","1")}n.searchParams.set("from",Ae());return n.toString()};var Ee=function(e){var o=new URL(e,window.location.origin);var t=new URLSearchParams(window.location.search).get("zonosQaUrl");if(t){o.searchParams.set("zonosQaUrl",t)}if(oe()){o.searchParams.set("zonosTestMode","1")}return o.toString()};var Ue=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,fetch("/api/storefront/cart",{credentials:"same-origin",headers:{Accept:"application/json"}})];case 1:t=i.sent();if(!t.ok){ue("Failed to fetch BigCommerce cart: ".concat(String(t.status)),"error");return[2,null]}return[4,t.json()];case 2:n=i.sent();return[2,(o=(e=n===null||n===void 0?void 0:n[0])===null||e===void 0?void 0:e.id)!==null&&o!==void 0?o:null];case 3:r=i.sent();te("Error fetching BigCommerce cart data",r);return[2,null];case 4:return[2]}}))}))};var Le=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,t;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,fetch("/api/storefront/checkouts/".concat(e,"?include=customer.customerGroup"),{credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}})];case 1:o=n.sent();if(!o.ok){ue("Failed to fetch BigCommerce checkout: ".concat(String(o.status)),"error");return[2,null]}return[4,o.json()];case 2:return[2,n.sent()];case 3:t=n.sent();te("Error fetching BigCommerce checkout data",t);return[2,null];case 4:return[2]}}))}))};var Be=function(e){var o;return!!((o=e===null||e===void 0?void 0:e.customer)===null||o===void 0?void 0:o.id)};var Pe={customerGroupId:null,shouldBypass:false};var Ne=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,t,n,r,i,s,c,a,u,d,l,h;return __generator(this,(function(f){switch(f.label){case 0:if(!window.Zonos.isBigCommerce){return[2,{conclusive:true,result:Pe}]}i=(o=q.genericSettings)===null||o===void 0?void 0:o.bigcommerceBypassCustomerGroupIds;if(!(i===null||i===void 0?void 0:i.length)){if(q.loadedConfig){return[2,{conclusive:true,result:Pe}]}return[2,{conclusive:false,result:Pe}]}if(!e)return[3,1];c=e.checkoutId;return[3,3];case 1:return[4,Ue()];case 2:c=f.sent();f.label=3;case 3:s=c;if(!s){ue("BigCommerce bypass check: no active cart yet, will retry on next call","info");return[2,{conclusive:false,result:Pe}]}if(!e)return[3,4];u=e.checkout;return[3,6];case 4:return[4,Le(s)];case 5:u=f.sent();f.label=6;case 6:a=u;if(!a){ue("BigCommerce bypass check: failed to fetch checkout data, will retry","info");return[2,{conclusive:false,result:Pe}]}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){ue("BigCommerce bypass check: no customer group found (guest user)","info");return[2,{conclusive:true,result:Pe}]}l=i.includes(d);h={customerGroupId:d,shouldBypass:l};if(l){ue("BigCommerce bypass check: customer group ".concat(String(d)," is in bypass list; caller should keep the user on BC native checkout"),"info")}else{ue("BigCommerce bypass check: customer group ".concat(String(d)," is not in bypass list"),"info")}return[2,{conclusive:true,result:h}]}}))}))};var je=null;var De=function(e){var o=Ne(e);var t=o.then((function(e){var o=e.conclusive,n=e.result;if(!o&&je===t){je=null}return n}));je=t;return t};var Re=function(){var e;if(!window.Zonos.isBigCommerce){return}var o=(e=q.genericSettings)===null||e===void 0?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(o===null||o===void 0?void 0:o.length)){return}void De()};var Fe=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(Ce,__spreadArray([],e,true),void 0,(function(e){if(e===void 0){e={}}return __generator(this,(function(o){if(e.forceRefresh||!je){return[2,De(e.preFetched)]}return[2,je]}))}))};var Me={guestCheckoutType:null};var He=60*60*1e3;var Ze="zonos--bc-checkout-settings";var Ge=function(e){try{var o=window.localStorage.getItem(Ze);if(!o){return null}var t=ne(o);if(!t){return null}if(t.storeHash!==e){return null}if(t.expiresAt<Date.now()){return null}return{guestCheckoutType:t.guestCheckoutType}}catch(e){return null}};var Ke=function(e,o){try{var t={expiresAt:Date.now()+He,guestCheckoutType:o.guestCheckoutType,storeHash:e};window.localStorage.setItem(Ze,JSON.stringify(t))}catch(e){}};var Ve=function(){return __awaiter(Ce,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,Me]}o=(e=q.checkoutSettings.bigCommerceConfig)===null||e===void 0?void 0:e.storeHash;if(!o){ue("BigCommerce checkout settings: no storeHash provided — skipping fetch","info");return[2,Me]}t=Ge(o);if(t){return[2,t]}return[4,ee("/api/bigcommerce/checkout-settings",{body:{storeHash:o},method:"POST"})];case 1:n=c.sent(),r=n.errors,i=n.json;if(r.length||!i){ue("BigCommerce checkout settings: proxy call failed, falling back to guest-allowed behavior","info");return[2,Me]}s={guestCheckoutType:i.guestCheckoutType};Ke(o,s);return[2,s]}}))}))};var Qe={redirectUrl:null,shouldForceLogin:false};var We=null;var Ye=function(){if(!We){var e=Ve().then((function(o){var t=o.guestCheckoutType;if(!t){if(We===e){We=null}return false}return t==="no_guest_checkout"})).catch((function(){if(We===e){We=null}return false}));We=e}return We};var qe=function(){if(!window.Zonos.isBigCommerce){return}void Ye()};var Je=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(Ce,__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,Qe]}return[4,Ye()];case 1:o=e.sent();if(!o){return[2,Qe]}if(!c)return[3,2];n=c.checkoutId;return[3,4];case 2:return[4,Ue()];case 3:n=e.sent();e.label=4;case 4:t=n;if(!t){return[2,Qe]}if(!c)return[3,5];i=c.checkout;return[3,7];case 5:return[4,Le(t)];case 6:i=e.sent();e.label=7;case 7:r=i;if(!r){ue("BigCommerce force-login check: failed to fetch checkout data, allowing flow to continue","info");return[2,Qe]}if(Be(r)){return[2,Qe]}ue("BigCommerce force-login check: guest shopper on no-guest-checkout store, redirecting to /login.php","info");return[2,{redirectUrl:Oe(),shouldForceLogin:true}]}}))}))};var Xe="data-zonos-login-from-rewritten";var $e='a[href*="login.php?action=create_account"]:not(['+Xe+"])";var eo=function(){var e=document.querySelectorAll($e);if(!e.length){return}var o=Oe({action:"create_account"});e.forEach((function(e){e.setAttribute("href",o);e.setAttribute(Xe,"true")}))};var oo=function(){if(!window.Zonos.isBigCommerce){return}if(!window.location.pathname.includes("/login.php")){return}eo();var e=new MutationObserver((function(){eo()}));e.observe(document.body,{childList:true,subtree:true});setTimeout((function(){return e.disconnect()}),1e4)};var to=function(e){if(e===void 0){e=true}if(!M.localizationLoaded){return true}if(M.isDisabledCountry){if(e){ue("Checkout: disabled country")}return true}return false};var no=function(e,o){if(e===void 0){e=true}var t;if(!M.localizationLoaded){return false}if(o){var n=!!((t=M.shippingZoneCountries)===null||t===void 0?void 0:t[o])&&!q.disabledCountries.includes(o);if(e&&!n){ue("Checkout: ".concat(o," is not a shippable country: ").concat(n))}return n}if(!M.isShippableCountry){if(e){ue("Checkout: not shippable country")}return false}return true};var ro='select[name="shippingAddress.countryCode"]';var io=function(e){return __awaiter(Ce,[e],void 0,(function(e){var o,t,n,r,i,c,a,u,d,l,h,f,v,m,g,p,w,z;var k=e.onInternationalCheckoutSelected,y=e.onLoggedInInternationalAddressDetected;return __generator(this,(function(e){switch(e.label){case 0:return[4,Ue()];case 1:h=e.sent();if(!h){return[2,"noAction"]}return[4,Le(h)];case 2:f=e.sent();v={checkout:f,checkoutId:h};return[4,Fe({preFetched:v})];case 3:m=e.sent().shouldBypass;if(m){return[2,"noAction"]}g=(t=(o=f===null||f===void 0?void 0:f.consignments)===null||o===void 0?void 0:o[0])===null||t===void 0?void 0:t.shippingAddress;if(!(g===null||g===void 0?void 0:g.countryCode)){return[2,"noAction"]}p=g.countryCode;if(!no(false,p)){return[2,"noAction"]}ue(y?"Logged-in user has international shipping address: ".concat(p,", prompting user to choose checkout"):"Logged-in user has international shipping address: ".concat(p,", redirecting automatically (legacy behavior)"),"info");if(!y)return[3,5];return[4,y()];case 4:w=e.sent();if(w==="stay"){ue("User opted to stay on BigCommerce native checkout despite international default address","info");return[2,"optedOut"]}e.label=5;case 5:return[4,Je({preFetched:v})];case 6:z=e.sent();if(z.shouldForceLogin&&z.redirectUrl){window.location.href=z.redirectUrl;return[2,"redirected"]}if(!k)return[3,8];return[4,k()];case 7:e.sent();e.label=8;case 8:H({isInitializing:false,newSelectedCountryCode:p});s({address1:(n=g.address1)!==null&&n!==void 0?n:"",address2:(r=g.address2)!==null&&r!==void 0?r:"",city:(i=g.city)!==null&&i!==void 0?i:"",countryCode:p,firstName:(c=g.firstName)!==null&&c!==void 0?c:"",lastName:(a=g.lastName)!==null&&a!==void 0?a:"",phone:(u=g.phone)!==null&&u!==void 0?u:"",postalCode:(d=g.postalCode)!==null&&d!==void 0?d:"",state:(l=g.stateOrProvince)!==null&&l!==void 0?l:""});window.location.href=Ee("/");return[2,"redirected"]}}))}))};var so=function(e){var o=e.domesticRedirectedBtnSelector,t=e.onInternationalCheckoutSelected,n=e.onLoggedInInternationalAddressDetected,r=e.onShippingAddressSessionFound;if(!window.Zonos.isBigCommerce){return}var c=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,n,r,i,c,a,u,d,l,h;return __generator(this,(function(f){switch(f.label){case 0:n=document.querySelector(((o=q.genericSettings)===null||o===void 0?void 0:o.bigcommerceDomesticCheckoutCountrySelector)||ro);r=(n===null||n===void 0?void 0:n.value)||e;if(!r){return[2,false]}if(!no(false,r)){return[2,false]}return[4,Ue()];case 1:i=f.sent();if(!i)return[3,3];return[4,Le(i)];case 2:a=f.sent();return[3,4];case 3:a=null;f.label=4;case 4:c=a;u={checkout:c,checkoutId:i};return[4,Fe({forceRefresh:true,preFetched:u})];case 5:d=f.sent().shouldBypass;if(d){ue("Bypass customer group detected on BC checkout, stopping interval","info");return[2,true]}return[4,Je({preFetched:u})];case 6:l=f.sent();if(l.shouldForceLogin&&l.redirectUrl){window.location.href=l.redirectUrl;return[2,true]}if(!t)return[3,8];return[4,t()];case 7:f.sent();f.label=8;case 8:H({isInitializing:false,newSelectedCountryCode:r});h={address1:"",address2:"",city:"",countryCode:r,firstName:"",lastName:"",phone:"",postalCode:"",stateOrProvince:""};s({address1:h.address1,address2:h.address2,city:h.city,countryCode:h.countryCode,firstName:h.firstName,lastName:h.lastName,phone:h.phone,postalCode:h.postalCode,state:h.stateOrProvince});window.location.href=Ee("/");return[2,true]}}))}))};var a=false;var u=false;var d=false;var l=false;var h=false;var f=new MutationObserver((function(){return __awaiter(Ce,void 0,void 0,(function(){var e,s,v,m,g,p,w,z,k,y;var b=this;return __generator(this,(function(_){switch(_.label){case 0:s=document.querySelector(o);v=i();if(!s&&v){m=document.createElement("button");m.style.display="none";m.id="zonos--domestic-redirected-checkout-button";document.body.appendChild(m);r===null||r===void 0?void 0:r(v);f.disconnect();return[2]}g=window.location.pathname.includes("/checkout")&&window.Zonos.isBigCommerce;if(!g){f.disconnect();return[2]}if(!(!l&&!d))return[3,5];d=true;h=true;_.label=1;case 1:_.trys.push([1,3,4,5]);return[4,io({onInternationalCheckoutSelected:t,onLoggedInInternationalAddressDetected:n})];case 2:p=_.sent();if(p==="redirected"){f.disconnect();return[2]}if(p==="optedOut"){l=true}return[3,5];case 3:w=_.sent();te("Error checking logged-in user shipping address",w);return[3,5];case 4:d=false;h=false;return[7];case 5:z=document.querySelector(((e=q.genericSettings)===null||e===void 0?void 0:e.bigcommerceDomesticCheckoutCountrySelector)||ro);if(!z){return[2]}ue("Domestic checkout found - Listening for shipping country change","info",{value:z.value});if(u){return[2]}u=true;f.disconnect();k=setInterval((function(){return __awaiter(b,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){switch(t.label){case 0:if(a||h){return[2]}a=true;t.label=1;case 1:t.trys.push([1,3,,4]);return[4,c()];case 2:e=t.sent();if(e){clearInterval(k);return[2]}a=false;return[3,4];case 3:o=t.sent();a=false;return[3,4];case 4:return[2]}}))}))}),1e3);y=setInterval((function(){var e;if(!window.bcStripeElements){clearInterval(y);return}var o=(e=window.bcStripeElements)===null||e===void 0?void 0:e.getElement("address");if(!o){return}clearInterval(y);o.on("change",(function(e){var o=e.value.address.country;if(o&&!h){void c(o)}}))}),500);return[2]}}))}))}));f.observe(document.body,{childList:true,subtree:true})};var co=function(){var e=new URLSearchParams(window.location.search);ue("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=Z(e)||M.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 h=o("customerLastName");return{customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:l,customerLastName:h,customerName:c,customerPhone:a,customerState:d,customerZip:u}};var ao=0;var uo=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o;var t;return __generator(this,(function(n){switch(n.label){case 0:if(window.Zonos.loadTimeApiInfoList.length===0){return[2]}ue("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});e={data:__spreadArray([],window.Zonos.loadTimeApiInfoList,true),storeId:window.Zonos.storeId||0};window.Zonos.loadTimeApiInfoList.length=0;return[4,ee("/api/zonos-elements/log-bulk-load-data",{body:e,method:"POST"})];case 1:o=n.sent().errors;if(o.length){(t=window.Zonos.loadTimeApiInfoList).push.apply(t,e.data);ao++;if(ao>5&&window.Zonos.logIntervalId){clearInterval(window.Zonos.logIntervalId)}}return[2]}}))}))};var lo=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){e=de().elapsedTime;o={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:e,metadata:Object.assign({allLogs:le},re()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};void ee("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2]}))}))};var ho=function(e){return __awaiter(Ce,[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:le},re()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};void ee("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2]}))}))};var fo=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 vo=function(e){var o;var t=(o=G.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 mo=function(e){return q.enabledVariantTestKeys.includes(e)};var go=function(e){var o=e.baseTestObj,t=e.mergeTestObj;return o.map((function(e){var o=e.testKey;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()+K,selectedVariantKey:(n===null||n===void 0?void 0:n.selectedVariantKey)||null,testKey:o}}))};var po=function(e){return __awaiter(Ce,[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=oe();return[4,ee("/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,3];ue("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:c});return[4,new Promise((function(e){return setTimeout(e,500)}))];case 2:e.sent();return[2,po({cartId:s,retries:c-1})];case 3:if(i){return[2,null]}return[2,r]}}))}))};var wo=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:o=he(e),t=o.isDgsCartId,n=o.isLegacyCartId;if(!n&&!t){te("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,po({cartId:e,retries:5})];case 1:r=i.sent();ue("[ZONOS - loadZonos] getting temp cart data","info",r);if(!r){te("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}window.Zonos.storeId=r.cartData.storeId;window.Zonos.zonosApiKey=r.cartData.credentialToken;return[2,{cartData:r.cartData,storeFavicon:r.storeFaviconUrl,storeId:r.cartData.storeId,storeLogo:r.storeLogoUrl,zonosApiKey:r.cartData.credentialToken}]}}))}))};var zo='<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 ko=".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}";var yo=ko;var bo=90*60*1e3;var _o=6*60*60*1e3;var Co=e("zonos_checkout",function(){function e(e){var t=this;o(this,e);this.storeUnsubscribeList=[];this.isRedirectAfterOrder=false;this.preview=false;this.hiddenMode=false;this.mobile=false;this.defaultAddress=[];this.forceDialogOpen=false;this.defaultAddressParams=[];this.defaultCustomerProfileAddress=[];this.customerProfile=null;this.open=this.forceDialogOpen;this.isOverlayLoading=false;this.stripe=window.Zonos.stripe;this.submitLoading=false;this.collapseReviewMobile=true;this.isAttachError=false;this.isMobile=false;this.isIframed=false;this.isLegacyCheckout=window.Zonos.isLegacyCheckout;this.confirmDialogOpen=false;this.isCartExpired=false;this.payInUsdConfirmDialogOpen=false;this.inventoryCheckErrorMessage=null;this.placedOrderInfo=null;this.shouldShowFedexShippingConsentDialog=false;this.detectedDomesticCheckoutDialogOpen=false;this.redirectToDomesticCheckoutDialogOpen=false;this.loggedInIntlAddressConfirmDialogOpen=false;this.loggedInIntlAddressResolver=null;this.clientSecret=c.clientSecret;this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret;this.applyStripeTheme=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:r=((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme)||q.appearance.theme;return[4,a({overrideBorderRadius:(o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.style,overridePrimaryColor:(t=this.appearanceSettingsOverride)===null||t===void 0?void 0:t.colorPrimary,overrideSecondaryColor:(n=this.appearanceSettingsOverride)===null||n===void 0?void 0:n.colorSecondary,overrideTheme:this.isMobile?r:undefined,paypalEnabled:j()})];case 1:i.sent();return[2]}}))}))};this.checkStripePaymentIntentStatus=function(e){return __awaiter(t,[e],void 0,(function(e){var o,t,n,r,i,s,a,d,l;var h=e.triggeredButton;return __generator(this,(function(e){switch(e.label){case 0:o=h===null||h===void 0?void 0:h.matches("#".concat(fe));t=!!window.Zonos.cartData;n=new URL(window.location.href).searchParams;r=n.get("payment_intent_client_secret");i=n.get("zonosCheckoutSessionId");if(!o){ue("Checkout is triggered by user, no need to check stripe payment intent status");return[2,{shouldAllowOrder:true}]}ue("Payment intent exist, checking stripe payment intent status");if(!r){ue("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:t}]}return[4,u({clientSecret:r})];case 1:s=e.sent(),a=s.error,d=s.status;l=new URLSearchParams(window.location.search).get("redirect_status");if(l){if(!a){ue("Payment intent is succeeded or in a good state to move forward, show success screen")}else{ue("Payment intent failed, show status from error")}this.open=true;G.checkoutSessionId=i;c.clientSecret=r;void this.setToFinishStep(d);return[2,{shouldAllowOrder:false}]}if(!t){ue("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}ue("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.initializeTestKeys=function(){G.enabledVariantTestKeys=fo(G.enabledVariantTestKeys||[]);var e=q.enabledVariantTestKeys.map((function(e){var o;var t=(o=G.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()+K,selectedVariantKey:(t===null||t===void 0?void 0:t.selectedVariantKey)||null,testKey:e}}));V(e);return{allSelected:false}};this.shouldAllowHostedVsNativeTest=function(){if(typeof q.checkoutSettings.createCartId!=="function"){return false}var e=q.enabledVariantTestKeys.includes("hosted_vs_native");if(!e){return false}return true};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]}ue("[TEST] - Registering hosted vs native test");o=vo("hosted_vs_native");if(o){ue("[TEST] - Hosted vs native test already has variant selected: ".concat(o));return[2]}return[4,Se({testKeys:["hosted_vs_native"]})];case 1:t=r.sent();if(!t){ue("[TEST] - Failed to get selection for hosted vs native test");return[2]}n=go({baseTestObj:G.enabledVariantTestKeys||[],mergeTestObj:t});V(n);return[2]}}))}))};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,{redirected:false}]}t=vo("hosted_vs_native");ue("[TEST] - hosted_vs_native: ".concat(t));if(typeof q.checkoutSettings.createCartId!=="function"){ue("[TEST] - createCartId is not provided, skipping hosted vs native test");return[2,{redirected:false}]}if(t!=="hosted"){ue("[TEST] - Hosted vs native test is enabled for native, skipping");return[2,{redirected:false}]}if(!((e=q.genericSettings)===null||e===void 0?void 0:e.hostedCheckoutUrl)){ue("[TEST] - Hosted checkout URL is not provided");return[2,{redirected:false}]}ue('"createCartId" is provided, start building cart');return[4,q.checkoutSettings.createCartId()];case 1:n=a.sent();i=null;if(typeof n==="object"){r=n.cartId;i=n.shippingData||null}else{r=n}s=co();c=Te(Object.assign(Object.assign({cartId:r,checkoutSessionId:G.checkoutSessionId||undefined,hostedCheckoutUrl:q.genericSettings.hostedCheckoutUrl,isTestMode:oe(),isVariantTest:true},s),i));ue("[TEST] - Redirecting to: ".concat(c));window.open(c,"_blank");return[2,{redirected:true}]}}))}))};this.formatDate=function(e){if(!e){return""}var o=new Date(e);return o.toLocaleDateString()};this.formatTime=function(e){if(!e){return""}var o=new Date(e);return o.toLocaleTimeString()};this.getCurrentLocalePageEnum=function(){switch(d.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}};this.getBaseCurrencySettlementInfo=function(){var e=d.selectedLandedCost;if(!e){return null}var o=e.landedCost.amountSubtotals;if(!o){return null}var t=(o.discounts||0)+o.items+o.landedCostTotal+o.shipping;return{settlementAmount:t}};this.getDefaultAddress=function(){if(t.defaultCustomerProfileAddress.length){return t.defaultCustomerProfileAddress}if(Array.isArray(t.defaultAddress)&&t.defaultAddress.length){return t.defaultAddress}if(!Array.isArray(t.defaultAddress)&&typeof t.defaultAddress==="object"){return[t.defaultAddress]}return t.defaultAddressParams};this.handleHostedOpenWindowCallback=function(e){var o;var t=(o=q.genericSettings)===null||o===void 0?void 0:o.hostedCheckoutUrl;if(!origin){return}var n=["dev.checkout.elements.zonos.com"].some((function(o){return e.origin.includes(o)}));if(e.origin!==t&&!n){return}switch(e.data.type){case"zonos-checkout-session-update":G.checkoutSessionId=e.data.checkoutSessionId;break}};this.captureParamsRedirectedForVariantTest=function(){var e=new URL(window.location.href);var o=e.searchParams.get("zonosVariantTest")==="1";if(!o){return}var t=e.searchParams.get("zonosCheckoutSessionId");if(t){G.checkoutSessionId=t}var n=G.enabledVariantTestKeys||[];if(window.Zonos.isLegacyCheckout){var r=vo("hosted_vs_native");if(!r){n.push({expiresAt:Date.now()+K,selectedVariantKey:"hosted",testKey:"hosted_vs_native"});V(n)}else{V(n.map((function(e){if(e.testKey==="hosted_vs_native"){return Object.assign(Object.assign({},e),{selectedVariantKey:"hosted"})}return e})))}}e.searchParams.delete("zonosCheckoutSessionId");e.searchParams.delete("zonosVariantTest");window.history.replaceState({},"",e.toString())}}e.prototype.initCartInfoHandler=function(e){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(t){o=e.detail;void l({adjustments:d.adjustments,cartItems:o});return[2]}))}))};e.prototype.handleKeyPress=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){if(e.key==="Escape"){void this.closeDialogHandler()}return[2]}))}))};e.prototype.closeDialogHandler=function(e){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(n){if(!this.open){return[2]}if(!(e===null||e===void 0?void 0:e.confirmed)){this.confirmDialogOpen=true;return[2]}this.confirmDialogOpen=false;be({event:"zonos-checkout-close",metadata:{checkoutSessionId:G.checkoutSessionId}});this.open=this.forceDialogOpen||false;if(!this.preview&&d.step==="finish"){h()}d.step="customer-info";f();v();(t=(o=q.checkoutSettings).onClose)===null||t===void 0?void 0:t.call(o);return[2]}))}))};e.prototype.buildCartAndInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,c,i,s,s,a,u,i,h;return __generator(this,(function(f){switch(f.label){case 0:if(!(typeof q.checkoutSettings.createCartId==="function"))return[3,4];ue('"createCartId" is provided, start building cart');return[4,q.checkoutSettings.createCartId()];case 1:e=f.sent();o=void 0;if(typeof e==="object"){ue("object detected, use cartId and prefill address from createCartId","info",e);o=e.cartId;this.useShippingDataFromCreateCartId(e.shippingData);d.customerAuthenticationToken=e.customerAuthenticationToken||null}else{o=e}window.Zonos.cartId=o;return[4,wo(o)];case 2:t=f.sent();n=t===null||t===void 0?void 0:t.cartData;if(!n){te("Failed to build cart, please try again.");return[2,false]}window.Zonos.cartData=n;r=$(n),i=r.adjustments,s=r.cartItems;return[4,l({adjustments:i,cartItems:s})];case 3:f.sent();return[3,9];case 4:if(!window.Zonos.cartData)return[3,6];ue("tempCartUUID is provided, start building cart");c=$(window.Zonos.cartData),i=c.adjustments,s=c.cartItems;return[4,l({adjustments:i,cartItems:s})];case 5:f.sent();return[3,9];case 6:if(!(q.checkoutSettings.buildCartDetail&&M.selectedCountryCode))return[3,9];ue("build cart detail");return[4,q.checkoutSettings.buildCartDetail({countryCode:M.selectedCountryCode,currencyCode:M.targetCurrency})];case 7:s=f.sent();a=s.filter((function(e){return e.amount>=0}));u=s.filter((function(e){return e.amount<0}));ue("cartItems","info",{cartItems:s});i=u.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,l({adjustments:i,cartItems:a})];case 8:f.sent();f.label=9;case 9:if(!!G.checkoutSessionId)return[3,11];return[4,m()];case 10:h=f.sent();ue("stripeStoreInitCheckoutSession: ".concat(h));if(!h){return[2,false]}f.label=11;case 11:if(!d.isStagingMode){void g()}return[4,this.applyStripeTheme()];case 12:f.sent();this.isRedirectAfterOrder=q.checkoutSettings.successBehavior==="REDIRECT_TO_SUCCESS_PAGE"||!!d.externalConfirmationPageURL;return[2,true]}}))}))};e.prototype.reloadCheckoutSession=function(){window.location.reload()};e.prototype.handleOrderDuplication=function(){var e=ne(localStorage.getItem("zonos--placed-order-info"));if(!e){localStorage.removeItem("zonos--placed-order-info");return}var o=Date.now()-e.time;ue("=== 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")||_o;if(o>t){ue("=== Existing placed order info is older than ".concat(t,"ms, cleaning localStorage"),"warn");localStorage.removeItem("zonos--placed-order-info");return}this.placedOrderInfo=e;ue("=== Showing order duplication confirmation","warn")};e.prototype.recordCheckoutInfo=function(){if(!G.checkoutSessionId){return}void ae({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:G.checkoutSessionId})};e.prototype.confirmProceedWithOrderDuplication=function(){this.placedOrderInfo=null;if(!G.checkoutSessionId){return}void ae({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:G.checkoutSessionId})};e.prototype.markTheSessionAsAbandonedCart=function(){if(!G.checkoutSessionId){return}void ae({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:G.checkoutSessionId})};e.prototype.handleCancelOrderDuplication=function(){var e;this.placedOrderInfo=null;if(this.isLegacyCheckout){var o=((e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl)||q.onlineStoreSettings.url;if(!o){return}if(window.parent){window.parent.location.href=o}window.location.href=o;return}void this.closeDialogHandler({confirmed:true})};e.prototype.attachCheckout=function(){var e=this;var o=q.checkoutSettings.placeOrderButtonSelector;var t=q.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;ue("attach checkout ".concat(o));ue("attach checkout to always trigger international checkout selector: ".concat(t));if(!o&&!t&&!window.Zonos.cartData){return}var n=[o,t,"#".concat(me),"#".concat(fe),"#".concat(ve)].filter(Boolean);var r=document.querySelectorAll(n.join(","));r.forEach((function(n){var r=n.getAttribute("data-zonos-checkout-attached");if(r){return}ue("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,l,h,f,v,m,g,y,b,_,C,x,S;return __generator(this,(function(T){switch(T.label){case 0:i=performance.now();s=t&&n.matches(t);a=n.matches("#".concat(ve));u=n.matches("#".concat(me))||n.matches("#".concat(fe));if(!window.Zonos.isLegacyCheckout&&(!no()||to())&&!s&&!a&&!u){return[2]}o.preventDefault();o.stopPropagation();ue("zonos checkout button clicked");return[4,this.checkStripePaymentIntentStatus({triggeredButton:o.target})];case 1:l=T.sent().shouldAllowOrder;if(!l){return[2]}if(!window.Zonos.logIntervalId){window.Zonos.logIntervalId=setInterval((function(){void uo()}),2e3)}if(!mo("hosted_vs_native"))return[3,4];this.isOverlayLoading=true;return[4,this.registerTestHostedVsNative()];case 2:T.sent();return[4,this.handleHostedVsNative()];case 3:h=T.sent().redirected;this.isOverlayLoading=false;if(h){return[2]}T.label=4;case 4:if(!window.Zonos.isBigCommerce)return[3,7];return[4,Fe()];case 5:f=T.sent().shouldBypass;if(f){ue("Bypass customer group detected, redirecting to BigCommerce native checkout","info");window.location.href=Ee("/checkout");return[2]}return[4,Je()];case 6:v=T.sent();if(v.shouldForceLogin&&v.redirectUrl){window.location.href=v.redirectUrl;return[2]}T.label=7;case 7:c.isFetchingSession=true;this.open=true;T.label=8;case 8:T.trys.push([8,11,,12]);return[4,this.buildCartAndInit()];case 9:m=T.sent();if(!m){throw new Error("Error building cart")}(e=window.opener)===null||e===void 0?void 0:e.postMessage({checkoutSessionId:G.checkoutSessionId,type:"zonos-checkout-session-update"},"*");p({isPreview:this.preview,sessionTimeout:bo});be({event:"zonos-checkout-start",metadata:{checkoutSessionId:G.checkoutSessionId}});g=G.checkoutSessionId;void w({checkoutSessionId:g,eventName:"checkout_open"});return[4,xe()];case 10:y=T.sent().enabled;d.shouldHideDiscountInput=!y;this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void lo()}else{b=performance.now();_=b-i;void ho({loadTime:_})}this.recordCheckoutInfo();C=!!ge();if(C){this.markTheSessionAsAbandonedCart()}return[3,12];case 11:x=T.sent();if(x instanceof Error){S=x.message;if(S==="Cart is expired."){this.isCartExpired=true}}c.isFetchingSession=false;te(x);if(this.isCartExpired){c.isFetchingSession=true;return[2]}void ie({endpoint:"Error creating Checkout",errors:[x instanceof Error?x.toString():"Unknown error"],metadata:{allLogs:le,cartId:window.Zonos.cartId,checkoutSessionBody:z(),href:window.location.href,storeBaseUrl:((r=window.Zonos.cartData)===null||r===void 0?void 0:r.storeBaseUrl)||q.onlineStoreSettings.url}});k({messages:[Q("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:Q("Error creating Checkout")});return[3,12];case 12:return[2]}}))}))}),{capture:true,passive:false});if(!q.checkoutSettings.disablePlaceOrderButtonActivation){n.removeAttribute("disabled")}n.setAttribute("data-zonos-checkout-attached","true");if(n.matches("#".concat(me))){n.dispatchEvent(we("click"));y();n.remove()}if(n.matches("#".concat(fe))){n.dispatchEvent(we("click"));n.remove()}}))};e.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}void this.applyStripeTheme()};e.prototype.useShippingDataFromCreateCartId=function(e){if(!e){return}ue("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 h=new URLSearchParams(window.location.search);var f=r||Z(h)||M.selectedCountryCode;this.applyPrefillAddress({customerAddress1:o,customerAddress2:t,customerCity:n,customerCountry:f,customerEmail:i,customerFirstName:s,customerLastName:c,customerName:a,customerPhone:u,customerState:d,customerZip:l})};e.prototype.useLegacyQueryParams=function(){var e=new URLSearchParams(window.location.search);ue("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=Z(e)||M.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 h=o("customerState");this.applyPrefillAddress({customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:a,customerLastName:u,customerName:c,customerPhone:d,customerState:h,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||"";if(!o||!s||!c||!t){ue("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&&M.shippingZoneCountries&&!(t in M.shippingZoneCountries)){ue('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}];ue("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:e})};e.prototype.overrideStagingModeChanged=function(){d.isStagingMode=!!this.overrideStagingMode};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;d.isStagingMode=se();if(typeof this.overrideStagingMode!=="undefined"){d.isStagingMode=this.overrideStagingMode}Re();qe();oo();this.handleBigcommerceInternationalResumeFlag();so({domesticRedirectedBtnSelector:me,onInternationalCheckoutSelected:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.detectedDomesticCheckoutDialogOpen=true;return[4,new Promise((function(e){return setTimeout(e,2e3)}))];case 1:e.sent();return[2]}}))}))},onLoggedInInternationalAddressDetected:function(){return new Promise((function(e){o.loggedInIntlAddressResolver=e;o.loggedInIntlAddressConfirmDialogOpen=true}))},onShippingAddressSessionFound:function(e){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}]}});if(window.Zonos){this.useLegacyQueryParams()}e=setInterval((function(){c.stripe=window.Zonos.stripe;o.stripe=window.Zonos.stripe;if(!o.stripe){ue("waiting for stripe to be loaded");return}if(o.storybookPaymentStatusOverride){clearInterval(e);return}ue("init checkout");if(o.preview||o.forceDialogOpen){void o.buildCartAndInit()}else if(window.Zonos.isLegacyCheckout){o.attachCheckout()}else if(window){o.attachCheckout();var t=new MutationObserver((function(){o.attachCheckout()}));t.observe(document.body,{childList:true,subtree:true})}clearInterval(e)}),50);setTimeout((function(){clearInterval(e)}),1e4);return[2]}))}))};e.prototype.handleBigcommerceInternationalResumeFlag=function(){if(!window.Zonos.isBigCommerce){return}var e=new URL(window.location.href);if(e.searchParams.get(Ie)!=="true"){return}e.searchParams.delete(Ie);window.history.replaceState({},"",e.toString());var o=Date.now();var t=setInterval((function(){if(!M.localizationLoaded||!M.selectedCountryCode){if(Date.now()-o>15e3){clearInterval(t);ue("BigCommerce international checkout resume flag: localization did not initialize within 15s","info")}return}var e=document.querySelector("#".concat(ve));if(e){clearInterval(t);e.dispatchEvent(we("click"));return}if(Date.now()-o>15e3){clearInterval(t);ue("BigCommerce international checkout resume flag: trigger button did not mount within 15s","info")}}),200)};e.prototype.setToFinishStep=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){d.step="finish";this.storybookPaymentStatusOverride=e;return[2]}))}))};e.prototype.mockCheckoutSession=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){b(e);return[2]}))}))};e.prototype.triggerCheckoutInternational=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(o){e=document.querySelector("#".concat(ve));if(e){e.dispatchEvent(we("click"))}return[2]}))}))};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(l){switch(l.label){case 0:be({event:"zonos-checkout-customer-info",metadata:{checkoutSessionId:G.checkoutSessionId}});r=G.checkoutSessionId;void w({checkoutSessionId:r,eventName:"checkout_customerInfoCompleted"});this.submitLoading=true;return[4,_()];case 1:i=l.sent().isRequestNotReady;if(i&&d.addressFormRenderType==="stripe"){void ie({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(d.step!=="customer-info"){clearInterval(e);return}if(!c.isFetchingLandedCost){if(d.landedCostData){void R({currency:d.currency});C()}u.submitLoading=false;if(e){clearInterval(e)}}};s();a=setInterval((function(){s(a)}),20);setTimeout((function(){clearInterval(a)}),1e4);return[2]}}))}))};e.prototype.handleShippingContinue=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){C();return[2]}))}))};e.prototype.handleInventoryCheckDialogConfirm=function(){d.inventoryCheckErrorMessage=null;if(!this.isLegacyCheckout){void this.closeDialogHandler({confirmed:true})}};e.prototype.handleCartExpiredDialogConfirm=function(){var e;this.isCartExpired=false;if(this.isLegacyCheckout){var o=(e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl;if(!o){return}if(window.parent){window.parent.location.href=o}window.location.href=o;return}if(window.parent){window.parent.location.href=window.location.href}window.location.reload()};e.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,a,u,l;return __generator(this,(function(h){switch(h.label){case 0:e=c.checkoutSettlementCurrency==="USD";if(e&&c.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;D.paypalErrorMessage=null;c.hasPaymentError=false;this.submitLoading=true;d.inventoryCheckErrorMessage=null;return[4,x()];case 1:o=h.sent();if(!o){c.hasPaymentError=true;c.customErrorMessage=Q("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:c.checkoutSettlementCurrency});this.submitLoading=false;return[2]}h.label=2;case 2:h.trys.push([2,4,,5]);t=d;return[4,S()];case 3:t.inventoryCheckErrorMessage=h.sent();return[3,5];case 4:n=h.sent();d.inventoryCheckErrorMessage=Q("Unable to check inventory. Please try again.");return[3,5];case 5:if(d.inventoryCheckErrorMessage){this.submitLoading=false;return[2]}r=N();if(!(r>0))return[3,7];return[4,T()];case 6:i=h.sent();if(!i.success){c.hasPaymentError=true;c.customErrorMessage=i.error||Q("Unable to apply store credit. Please try again.");this.submitLoading=false;return[2]}h.label=7;case 7:if(!I())return[3,13];h.label=8;case 8:h.trys.push([8,11,,12]);return[4,A()];case 9:s=h.sent();if(!s.valid){c.hasPaymentError=true;c.customErrorMessage=s.errorMessage;this.submitLoading=false;return[2]}return[4,O()];case 10:a=h.sent();if(!a.success){c.hasPaymentError=true;c.customErrorMessage=a.error||Q("Unable to place order with store credit. Please try again.");this.submitLoading=false;return[2]}C();v();return[3,12];case 11:u=h.sent();te(u);be({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:G.checkoutSessionId}});c.hasPaymentError=true;return[3,12];case 12:this.submitLoading=false;return[2];case 13:h.trys.push([13,15,,16]);return[4,E()];case 14:h.sent();C();v();return[3,16];case 15:l=h.sent();te(l);be({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:G.checkoutSessionId}});c.hasPaymentError=true;if(c.shouldInventoryRefund){void U();c.shouldInventoryRefund=false}return[3,16];case 16:this.submitLoading=false;return[2]}}))}))};e.prototype.handleFinishClick=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:L();if(!this.preview)return[3,2];d.step="customer-info";return[4,this.init()];case 1:r.sent();return[2];case 2:h();if(window.Zonos.isLegacyCheckout&&window.Zonos.cartData){e=window.Zonos.cartData.storeBaseUrl||q.onlineStoreSettings.url;if(window.parent){window.parent.location.href=e}window.location.href=e;return[2]}o=window.location.href;t=o.split("?")[0];this.open=false;n=window.location.hostname.includes("dashboard.zonos.com");if(!n){window.history.replaceState(window.history.state,document.title,t);window.location.reload()}return[2]}}))}))};e.prototype.handleWindowResize=function(){this.isMobile=ce(this.mobile);void this.applyStripeTheme();ue("mobile: ".concat(this.isMobile))};e.prototype.handleMobileChange=function(){this.isMobile=ce(this.mobile);void this.applyStripeTheme();ue("mobile: ".concat(this.isMobile))};e.prototype.handleAppearanceSettingsOverrideChange=function(){var e;if((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme){this.appearanceSettingsOverride.theme=J(this.appearanceSettingsOverride.theme)}};e.prototype.handleAddressChange=function(){L()};e.prototype.handleCustomerProfileChange=function(){var e,o;if(!this.customerProfile){ue("No customer profile","info");this.defaultCustomerProfileAddress=[];return}ue("Customer profile found","info",{customerProfile:this.customerProfile});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(){ue("==== Client secret changed","info",{clientSecret:this.clientSecret,stripeCustomerSessionClientSecret:this.stripeCustomerSessionClientSecret});void this.applyStripeTheme()};e.prototype.handleOpenChange=function(){var e="data-zonos-overflow-origin";var o=document.body;var t=document.documentElement;if(this.open){window.Zonos.openHelloDialog(false);if(o.style.overflow){o.setAttribute(e,o.style.overflow)}o.style.overflow="hidden";if(t.style.overflow){t.setAttribute(e,t.style.overflow)}t.style.overflow="hidden"}else{this.stripeCustomerSessionClientSecret=null;var n=o.getAttribute(e);var r=t.getAttribute(e);if(n){o.removeAttribute(e);o.style.overflow=n}else{o.style.removeProperty("overflow")}if(r){t.removeAttribute(e);t.style.overflow=r}else{t.style.removeProperty("overflow")}}};e.prototype.componentWillLoad=function(){var e=this;void this.init();this.isMobile=ce(this.mobile);this.isIframed=window.self!==window.top;ue("iframed: ".concat(this.isIframed));if(window.Zonos.isLegacyCheckout){this.captureParamsRedirectedForVariantTest()}this.handleAppearanceSettingsOverrideChange();this.storeUnsubscribeList=[W("selectedLocale",(function(){void e.applyStripeTheme()})),B("selectedShippingOption",(function(){var o,t,n,r;var i=d.selectedShippingOption;if(((o=q.genericSettings)===null||o===void 0?void 0:o.shouldFedExShippingConsentForCanadianShopper)&&((n=(t=i===null||i===void 0?void 0:i.shippingProfile)===null||t===void 0?void 0:t.serviceLevel.code)===null||n===void 0?void 0:n.toLowerCase().startsWith("fedex."))&&((r=c.stripeAddressEventData)===null||r===void 0?void 0:r.value.address.country)==="CA"){e.shouldShowFedexShippingConsentDialog=true}})),P("stripeAddressEventData",(function(o){var t;if(!window.Zonos.isBigCommerce||!o||e.redirectToDomesticCheckoutDialogOpen||!((t=q.genericSettings)===null||t===void 0?void 0:t.isBigcommerceDomesticCheckoutRedirectEnabled)||q.sourceCurrency!=="USD"){return}if(!e.open){return}if(window.location.pathname.includes("/checkout")){return}var n=o.value.address.country;if(n&&q.disabledCountries.includes(n)){e.redirectToDomesticCheckoutDialogOpen=true;ue("Domestic country ".concat(n," selected in international checkout, redirecting to BigCommerce domestic checkout"),"info");setTimeout((function(){window.location.href=Ee("/checkout")}),2e3)}}))];this.initializeTestKeys();window.addEventListener("message",this.handleHostedOpenWindowCallback);ue("mobile: ".concat(this.isMobile))};e.prototype.disconnectedCallback=function(){L();h();this.storeUnsubscribeList.forEach((function(e){return e()}));window.removeEventListener("message",this.handleHostedOpenWindowCallback)};e.prototype.render=function(){var e=this;var o,i,s,a;this.customerProfile=c.customerProfile;this.clientSecret=c.clientSecret;if(c.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret}var u=d.step!=="finish"&&d.step!=="error"&&!c.stripeElements||c.isFetchingSession;var l=X(q.appearance,this.appearanceSettingsOverride||null),h=l.colorPrimary,f=l.colorSecondary,v=l.logoUrl,m=l.style;var g=q.appearance.zonosAttribution==="ENABLED";var p=q.appearance.theme;var w=h&&ke(h)?"DARK":"LIGHT";var z=this.isMobile?p:w;var k=!this.isMobile?f:undefined;var y=M.customMessages;var b=(o=y.find((function(e){return e.pageName==="checkout_default"})))===null||o===void 0?void 0:o.message;var _=this.getCurrentLocalePageEnum();var C=y.filter((function(e){return e.pageName===_}));var x=this.getBaseCurrencySettlementInfo();var S=function(){var o=e.preview?"".concat(v,"?timestamp=").concat(Date.now()):v;return t("div",{class:"zonos--logo"},o&&t("img",{alt:"".concat(q.organizationName," logo"),src:o}))};var T=oe();var I=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||se();return t("zonos-v-stack",null,t("div",{class:"zonos--logo-wrapper"},S(),T&&t("zonos-badge",{badgeColor:"orange",size:"small"},Q("Test mode")),s&&t("zonos-badge",{badgeColor:"red",size:"small"},Q("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")),t("zonos-checkout-progress-tabs",{backgroundColor:e.isMobile?"--zonos-elements-gray-0":null}),C.map((function(e){return t("zonos-custom-message",{icon:zo,message:e.message})})))};var A=function(){if(d.checkoutSessionTimeoutShow){return t("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:Q("Your checkout session has expired. Please reload the page to continue."),restStateTitle:Q("Session timed out"),restStateType:"Warning"},t("zonos-button",{onClick:function(){return e.reloadCheckoutSession()},variant:"primary"},Q("Reload")))}return t("div",{class:"zonos--content",style:{"--zonos--border-radius":ze({overrideBorderStyle:m})}},d.step!=="finish"&&d.step!=="error"&&t(n,null,t("div",{class:"zonos--left","data-theme":z,style:ye({"--zonos--primary-color":!e.isMobile?h:undefined})},!e.isMobile&&I(),d.step==="customer-info"&&t("zonos-customer-info",{continueLoading:e.submitLoading,defaultAddress:e.getDefaultAddress(),isMobile:e.isMobile,onContinueClicked:function(){return e.handleCustomerInfoContinue()},submitBtnColor:k}),d.step==="shipping"&&t("zonos-shipping",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return e.handleShippingContinue()},submitBtnColor:k}),d.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,this.handleStripePaymentContinue()];case 1:e.sent();return[2]}}))}))},submitBtnColor:k})),t("div",{class:"zonos--right","data-theme":p},e.isMobile&&I(),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:_e}),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(){if(!e.isMobile){return}e.collapseReviewMobile=!e.collapseReviewMobile}}),t("zonos-collapse",{collapsed:e.collapseReviewMobile&&e.isMobile},t("zonos-cart-items",null),e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",{submitBtnColor:k}),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:zo,message:b})))),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:zo,message:b}))))),(d.step==="finish"||d.step==="error")&&t("div",{class:"zonos--done","data-theme":p},t("div",{class:"zonos--header"},S(),!e.isRedirectAfterOrder&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:_e}),noBackground:true,onClick:function(){return e.handleFinishClick()},theme:p})),t("zonos-checkout-finish",{borderRadius:m,onCloseClick:function(){return e.handleFinishClick()},overrideNotification:d.step==="error"&&!!d.error?Object.assign(Object.assign({},d.error),{type:"error"}):undefined,storybookForceStatus:e.storybookPaymentStatusOverride})),t("zonos-checkout-footer",{"data-theme":p,mobile:e.isMobile,slot:!e.isMobile?"dialog-footer":undefined}))};return t(r,{class:pe(["zonos--checkout zonos--elements",d.step==="payment"&&"zonos--processing-payment",g&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?A():t("zonos-dialog",{borderStyle:m,class:"zonos--checkout-dialog","data-theme":p,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"},A()),t("zonos-dialog",{isLoading:true,loadingText:Q("You will be redirected to international checkout shortly."),loadingTitle:Q("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:Q("You will be redirected to domestic checkout shortly."),loadingTitle:Q("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:Q("Stay on this page"),dialogConfirmBtnText:Q("Continue to international checkout"),dialogIntent:"info",dialogOpen:this.loggedInIntlAddressConfirmDialogOpen,dialogSubtitle:Q("Your saved default address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?"),dialogTitle:Q("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:Q("Don't close"),dialogConfirmBtnText:Q("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:Q("Would you like to close checkout and return to the site?"),dialogTitle:Q("Are you sure?"),onCancelClicked:function(){e.confirmDialogOpen=false},onConfirmClicked:function(){return e.closeDialogHandler({confirmed:true})}}),t("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:Q("Return to merchant site"),dialogConfirmBtnText:Q("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:((i=this.placedOrderInfo)===null||i===void 0?void 0:i.zonosOrderNumber)?Q("It looks like you placed an order recently ([date] at [time]) under order number #[orderNumber]. Check your email for the order confirmation. Are you sure you want to place another order?",{date:this.formatDate(this.placedOrderInfo.time),orderNumber:this.placedOrderInfo.zonosOrderNumber,time:this.formatTime(this.placedOrderInfo.time)}):Q("It looks like you placed an order recently ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate(((s=this.placedOrderInfo)===null||s===void 0?void 0:s.time)||null),time:this.formatTime(((a=this.placedOrderInfo)===null||a===void 0?void 0:a.time)||null)}),dialogTitle:Q("Are you sure?"),dialogWidth:530,onCancelClicked:function(){e.handleCancelOrderDuplication()},onConfirmClicked:function(){e.confirmProceedWithOrderDuplication()}}),t("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:Q("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:t(n,null,Q("If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request."),t("zonos-link",{href:"https://ftn.fedex.com/us/assets/docs/One-Time_GAA.pdf",target:"_blank"},Q("View GAA Form."))),dialogTitle:Q("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:function(){return e.shouldShowFedexShippingConsentDialog=false}}),t("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:Q("Return to cart"),dialogIntent:"danger",dialogOpen:!!d.inventoryCheckErrorMessage,dialogSubtitle:d.inventoryCheckErrorMessage,dialogTitle:Q("Couldn't place order"),dialogType:"alert",onConfirmClicked:function(){return e.handleInventoryCheckDialogConfirm()}}),x&&t("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:Q("Cancel"),dialogConfirmBtnText:Q("Pay [orderTotal]",{orderTotal:Y({amount:x.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:Q("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:Q("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){e.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return e.handleStripePaymentContinue()}}),t("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:Q("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:Q("You are being sent back to the shop to re-add items to your cart."),dialogTitle:Q("Shopping cart expired"),dialogType:"alert",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","handleAppearanceSettingsOverrideChange"],overrideStagingMode:["overrideStagingModeChanged"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"],customerProfile:["handleCustomerProfileChange"],clientSecret:["handleClientSecretChange"],stripeCustomerSessionClientSecret:["handleClientSecretChange"],open:["handleOpenChange"]}},enumerable:false,configurable:true});return e}());Co.style=yo}}}));
@@ -1 +0,0 @@
1
- System.register(["./p-15ef7644.system.js","./p-01174496.system.js","./p-d938f42f.system.js"],(function(n){"use strict";var e,t,i;return{setters:[function(n){e=n.z},function(n){t=n.g},function(n){i=n.l}],execute:function(){n("e",v);var o="zonos-analytic";var r="zonos-analytics-relay-ping";var a="zonos-analytics-relay-ready";var d=false;var f=false;var u=[];function w(){while(u.length>0){var n=u.shift(),e=n.event,t=n.payload;try{window.parent.postMessage({event:e,metadata:t,type:o},"*")}catch(n){}}}function c(){if(f)return;f=true;window.addEventListener("message",(function(n){var e;if(((e=n.data)===null||e===void 0?void 0:e.type)===a){d=true;if(typeof window.Zonos!=="undefined"){window.Zonos.googleAnalyticReady=true}w()}}))}function s(){try{var n=typeof window.Zonos!=="undefined"?window.Zonos.googleAnalyticId:undefined;window.parent.postMessage({googleAnalyticId:n,type:r},"*")}catch(n){}}function v(){if(typeof window==="undefined"||window.parent===window||d){return}c();s()}var y=n("s",(function(n){var r=n.event,a=n.metadata;var f=e.checkoutSettings.analyticsProviders.find((function(n){return n.type==="GOOGLE_ANALYTICS"}));if(!f||(f===null||f===void 0?void 0:f.status)==="DISABLED"){return}var w=t();var v=Object.assign(Object.assign({},a),w&&{isTestMode:true});var y=Object.fromEntries(Object.entries(v).filter((function(n){var e=n[0],t=n[1];return t!==null})));var l=typeof window!=="undefined"&&window.parent!==window;if(l){c();if(d){try{window.parent.postMessage({event:r,metadata:y,type:o},"*")}catch(n){}}else{u.push({event:r,payload:y});s()}return}if(typeof window.gtag==="function"){i("Zonos submits gtag event","log",r);window.gtag("event",r,y)}}))}}}));
@@ -1,17 +0,0 @@
1
- import{c as e,z as o}from"./p-ed9385f4.js";import{t as n,y as r,b as t,d as a,v as i,w as s,x as c,z as l,r as u,h as d,F as p}from"./p-a8bb461c.js";import{t as f,s as y}from"./p-a75b8ad7.js";import{h as v,l as b,j as h}from"./p-41dd1cb8.js";import{i as w}from"./p-7d9bbdc8.js";import{l as m}from"./p-0a377722.js";import{s as P}from"./p-387f6a4d.js";
2
- /*!
3
- * paypal-js v8.4.2 (2025-09-04T17:21:30.135Z)
4
- * Copyright 2020-present, PayPal, Inc. All rights reserved.
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */function j(e,o){void 0===o&&(o={});var n=document.createElement("script");return n.src=e,Object.keys(o).forEach((function(e){n.setAttribute(e,o[e]),"data-csp-nonce"===e&&n.setAttribute("nonce",o["data-csp-nonce"])})),n}function k(e,o){if(void 0===o&&(o=Promise),S(e,o),"undefined"==typeof document)return o.resolve(null);var n=function(e){var o,n,r=e.sdkBaseUrl,t=e.environment,a=function(e,o){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)o.indexOf(r[t])<0&&Object.prototype.propertyIsEnumerable.call(e,r[t])&&(n[r[t]]=e[r[t]])}return n}(e,["sdkBaseUrl","environment"]),i=r||function(e){return"sandbox"===e?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}(t),s=a,c=Object.keys(s).filter((function(e){return null!=s[e]&&""!==s[e]})).reduce((function(e,o){var n=s[o].toString();return"data"===(o=o.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,o){return(o?"-":"")+e.toLowerCase()}))).substring(0,4)||"crossorigin"===o?e.attributes[o]=n:e.queryParams[o]=n,e}),{queryParams:{},attributes:{}}),l=c.queryParams,u=c.attributes;return l["merchant-id"]&&-1!==l["merchant-id"].indexOf(",")&&(u["data-merchant-id"]=l["merchant-id"],l["merchant-id"]="*"),{url:"".concat(i,"?").concat((o=l,n="",Object.keys(o).forEach((function(e){0!==n.length&&(n+="&"),n+=e+"="+o[e]})),n)),attributes:u}}(e),r=n.url,t=n.attributes,a=t["data-namespace"]||"paypal",i=I(a);return t["data-js-sdk-library"]||(t["data-js-sdk-library"]="paypal-js"),function(e,o){var n=document.querySelector('script[src="'.concat(e,'"]'));if(null===n)return null;var r=j(e,o),t=n.cloneNode();if(delete t.dataset.uidAuto,Object.keys(t.dataset).length!==Object.keys(r.dataset).length)return null;var a=!0;return Object.keys(t.dataset).forEach((function(e){t.dataset[e]!==r.dataset[e]&&(a=!1)})),a?n:null}(r,t)&&i?o.resolve(i):function(e,o){void 0===o&&(o=Promise),S(e,o);var n=e.url,r=e.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==r&&"object"!=typeof r)throw new Error("Expected attributes to be an object.");return new o((function(e,o){if("undefined"==typeof document)return e();!function(e){var o=e.onSuccess,n=e.onError,r=j(e.url,e.attributes);r.onerror=n,r.onload=o,document.head.insertBefore(r,document.head.firstElementChild)}({url:n,attributes:r,onSuccess:function(){return e()},onError:function(){var e=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return o(e)}})}))}({url:r,attributes:t},o).then((function(){var e=I(a);if(e)return e;throw new Error("The window.".concat(a," global variable is not available."))}))}function I(e){return window[e]}function S(e,o){if("object"!=typeof e||null===e)throw new Error("Expected an options object.");var n=e.environment;if(n&&"production"!==n&&"sandbox"!==n)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==o&&"function"!=typeof o)throw new Error("Expected PromisePonyfill to be a function.")}"function"==typeof SuppressedError&&SuppressedError;const{onChange:E,reset:g,state:A}=e((()=>({intent:"capture",orderIdCreated:null,paypal:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}))),O=({checkoutSessionId:e,onPaypalFail:y,onPaypalSessionDone:m,overrideBorderRaidus:j,overridePrimaryColor:k})=>({createOrder:async()=>{n({checkoutSessionId:e,eventName:"checkout_paymentInfoCompleted",metadata:{paymentMethod:"paypal"}});const o=await r();if(!o.valid)return A.paypalErrorMessage=o.errorMessage,t.hasPaymentError=!1,t.customErrorMessage=null,P({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:e}}),null==y||y(),"";try{A.paypalErrorMessage=null,a.inventoryCheckErrorMessage=null;try{a.inventoryCheckErrorMessage=await i()}catch(e){a.inventoryCheckErrorMessage=f("Unable to check inventory. Please try again.")}if(a.inventoryCheckErrorMessage)return"";if(p()>0){const e=await s();if(!e.success)return A.paypalErrorMessage=e.error||f("Unable to apply store credit. Please try again."),null==y||y(),""}if(c()){const e=await l();return e.success?(null==m||m({orderId:e.orderId||""}),u(),d(),""):(A.paypalErrorMessage=e.error||f("Unable to place order with store credit. Please try again."),null==y||y(),"")}return await(async({checkoutSessionId:e})=>{var o,n;const r=A.intent.toUpperCase(),{errors:t,json:a}=await(async({checkoutSessionId:e,intent:o})=>{const{errors:n,json:r}=await v("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:e,intent:o},method:"POST"});return{errors:n,json:r}})({checkoutSessionId:e,intent:r}),i=null===(o=null==a?void 0:a.paypalOrderCreate)||void 0===o?void 0:o.paypalOrderId;if(t.length||!i)throw new Error((null===(n=t.find(Boolean))||void 0===n?void 0:n.message)||"An unexpected error occurred when creating paypal order.");return i})({checkoutSessionId:e})}catch(o){return b("Failed to create paypal order",o),A.paypalErrorMessage=f("Failed to create PayPal order. Please try again, or consider using an alternative method."),t.hasPaymentError=!1,t.customErrorMessage=null,P({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:e}}),null==y||y(),""}},onApprove:async()=>{try{A.paypalErrorMessage=null,P({event:"zonos-checkout-payment-info",metadata:{checkoutSessionId:e,paymentMethod:"paypal"}});const o=await(async({checkoutSessionId:e,paypalMockResponse:o})=>{var n,r;const{errors:t,json:a}=await(async({checkoutSessionId:e,paypalMockResponse:o})=>{const{errors:n,json:r}=await v("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:e,paypalMockResponse:o},method:"POST"});return{errors:n,json:r}})({checkoutSessionId:e,paypalMockResponse:o}),i=null===(n=null==a?void 0:a.paypalOrderCapture.order)||void 0===n?void 0:n.id;if(t.length||!i)throw new Error((null===(r=t.find(Boolean))||void 0===r?void 0:r.message)||f("An unexpected error occurred when processing PayPal order."));return i})({checkoutSessionId:e,paypalMockResponse:window.Zonos._paypalMockResponse});A.orderIdCreated=o,null==m||m({orderId:o}),u(),d()}catch(e){if(b("==== Failed to capture paypal order",e),e instanceof Error)return(({error:e})=>{var o;const n=h(e.message),r=null===(o=null==n?void 0:n.errors.find(Boolean))||void 0===o?void 0:o.message,t=(null==r?void 0:r.match(/\[(.*?)\] (.*)/i))||[];t||(A.paypalErrorMessage=f("An unexpected error occurred when processing PayPal order."));const a=t[2]||f("An unexpected error occurred when processing PayPal order.");A.paypalErrorMessage=a})({error:e});null==y||y()}},style:{borderRadius:"SHARP"===j?0:10,color:w({backgroundColor1:"#ffc33a",backgroundColor2:k||o.appearance.colorPrimary||""})?"gold":"blue",shape:"rect"}}),x=async({currency:e})=>{var n;if(!(null===(n=o.checkoutSettings.externalPaymentMethods)||void 0===n?void 0:n.find((e=>"PAYPAL"===e.type&&"ENABLED"===e.status))))return void m("=== Paypal is disabled for this store","warn");const r=o.checkoutSettings.externalServiceTokens.find((e=>"PAYPAL_CLIENT_ID"===e.type));if(!r)return void m("Failed to load paypal -- missing paypal publishable key","warn");const t=o.zonosMode&&"production"!==o.zonosMode||"LIVE"!==o.checkoutSettings.mode?"sandbox":"production";A.intent=o.checkoutSettings.captureDelay&&o.checkoutSettings.captureDelay>0?"authorize":"capture",m("==== Paypal order intent","info",A.intent),window.Zonos.paypal=await k({clientId:r.token,currency:e,environment:t,intent:A.intent}),A.paypal=window.Zonos.paypal,m("==== Paypal script loaded")},B=e=>{var o;const n=window.Zonos.paypal;if(!n)return m("Paypal is not available"),null;const r=y.checkoutSessionId;if(!r)return m("Paypal is not available due to checkoutSessionId is not available"),null;m("==== Loading Paypal buttons"),A.paypalButtons.length&&(A.paypalButtons.forEach((async e=>{await e.close()})),A.paypalButtons=[]);const t=[null===(o=n.FUNDING)||void 0===o?void 0:o.PAYPAL].filter(Boolean);return A.paypalButtons=t.map((o=>{var t;let a=null;try{a=(null===(t=n.Buttons)||void 0===t?void 0:t.call(n,Object.assign(Object.assign({},O(Object.assign({checkoutSessionId:r,fundingSource:o},e))),{fundingSource:o})))||null}catch(e){m(`===== Failed to load paypal's "${o}" button`,"warn",e)}return(null==a?void 0:a.isEligible())?(m(`==== Paypal button ${o} loaded`),a):null})).filter(Boolean),A.paypalButtons},z=()=>{var e,n;return"ENABLED"===(null===(n=null===(e=o.checkoutSettings.externalPaymentMethods)||void 0===e?void 0:e.find((e=>"PAYPAL"===e.type)))||void 0===n?void 0:n.status)||!!A.paypalButtons.length};export{A as a,x as b,g as c,B as d,E as e,z as p}
@@ -1 +0,0 @@
1
- import{z as o}from"./p-ed9385f4.js";import{g as n}from"./p-41dd1cb8.js";import{l as t}from"./p-0a377722.js";const e="zonos-analytic",i="zonos-analytics-relay-ping",d="zonos-analytics-relay-ready";let a=!1,w=!1;const s=[];function c(){w||(w=!0,window.addEventListener("message",(o=>{var n;(null===(n=o.data)||void 0===n?void 0:n.type)===d&&(a=!0,void 0!==window.Zonos&&(window.Zonos.googleAnalyticReady=!0),function(){for(;s.length>0;){const{event:o,payload:n}=s.shift();try{window.parent.postMessage({event:o,metadata:n,type:e},"*")}catch(o){}}}())})))}function l(){try{const o=void 0!==window.Zonos?window.Zonos.googleAnalyticId:void 0;window.parent.postMessage({googleAnalyticId:o,type:i},"*")}catch(o){}}function f(){"undefined"==typeof window||window.parent===window||a||(c(),l())}const y=({event:i,metadata:d})=>{const w=o.checkoutSettings.analyticsProviders.find((o=>"GOOGLE_ANALYTICS"===o.type));if(!w||"DISABLED"===(null==w?void 0:w.status))return;const f=n(),y=Object.assign(Object.assign({},d),f&&{isTestMode:!0}),r=Object.fromEntries(Object.entries(y).filter((([o,n])=>null!==n)));if("undefined"!=typeof window&&window.parent!==window)if(c(),a)try{window.parent.postMessage({event:i,metadata:r,type:e},"*")}catch(o){}else s.push({event:i,payload:r}),l();else"function"==typeof window.gtag&&(t("Zonos submits gtag event","log",i),window.gtag("event",i,r))};export{f as e,y as s}
@@ -1,18 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(r,n,e,t){function o(r){return r instanceof e?r:new e((function(n){n(r)}))}return new(e||(e=Promise))((function(e,a){function i(r){try{c(t.next(r))}catch(r){a(r)}}function u(r){try{c(t["throw"](r))}catch(r){a(r)}}function c(r){r.done?e(r.value):o(r.value).then(i,u)}c((t=t.apply(r,n||[])).next())}))};var __generator=this&&this.__generator||function(r,n){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},t,o,a,i;return i={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function u(r){return function(n){return c([r,n])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(i&&(i=0,u[0]&&(e=0)),e)try{if(t=1,o&&(a=u[0]&2?o["return"]:u[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,u[1])).done)return a;if(o=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(a=e.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){e.label=u[1];break}if(u[0]===6&&e.label<a[1]){e.label=a[1];a=u;break}if(a&&e.label<a[2]){e.label=a[2];e.ops.push(u);break}if(a[2])e.ops.pop();e.trys.pop();continue}u=n.call(r,e)}catch(r){u=[6,r];o=0}finally{t=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-15ef7644.system.js","./p-196423ad.system.js","./p-248bdea2.system.js","./p-01174496.system.js","./p-43a6e469.system.js","./p-d938f42f.system.js","./p-17a8a514.system.js"],(function(r){"use strict";var n,e,t,o,a,i,u,c,s,l,d,f,v,p,y,h,w,b,m,_,P;return{setters:[function(r){n=r.c;e=r.z},function(r){t=r.t;o=r.y;a=r.b;i=r.d;u=r.v;c=r.w;s=r.x;l=r.z;d=r.r;f=r.h;v=r.F},function(r){p=r.t;y=r.s},function(r){h=r.h;w=r.l;b=r.j},function(r){m=r.i},function(r){_=r.l},function(r){P=r.s}],execute:function(){
2
- /*!
3
- * paypal-js v8.4.2 (2025-09-04T17:21:30.135Z)
4
- * Copyright 2020-present, PayPal, Inc. All rights reserved.
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- var g=this;function k(r,n){var e={};for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&n.indexOf(t)<0)e[t]=r[t];if(r!=null&&typeof Object.getOwnPropertySymbols==="function")for(var o=0,t=Object.getOwnPropertySymbols(r);o<t.length;o++){if(n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(r,t[o]))e[t[o]]=r[t[o]]}return e}typeof SuppressedError==="function"?SuppressedError:function(r,n,e){var t=new Error(e);return t.name="SuppressedError",t.error=r,t.suppressed=n,t};function j(r,n){var e=document.querySelector('script[src="'.concat(r,'"]'));if(e===null)return null;var t=x(r,n);var o=e.cloneNode();delete o.dataset.uidAuto;if(Object.keys(o.dataset).length!==Object.keys(t.dataset).length){return null}var a=true;Object.keys(o.dataset).forEach((function(r){if(o.dataset[r]!==t.dataset[r]){a=false}}));return a?e:null}function E(r){var n=r.url,e=r.attributes,t=r.onSuccess,o=r.onError;var a=x(n,e);a.onerror=o;a.onload=t;document.head.insertBefore(a,document.head.firstElementChild)}function S(r){var n=r.sdkBaseUrl,e=r.environment,t=k(r,["sdkBaseUrl","environment"]);var o=n||O(e);var a=t;var i=Object.keys(a).filter((function(r){return typeof a[r]!=="undefined"&&a[r]!==null&&a[r]!==""})).reduce((function(r,n){var e=a[n].toString();n=I(n);if(n.substring(0,4)==="data"||n==="crossorigin"){r.attributes[n]=e}else{r.queryParams[n]=e}return r}),{queryParams:{},attributes:{}}),u=i.queryParams,c=i.attributes;if(u["merchant-id"]&&u["merchant-id"].indexOf(",")!==-1){c["data-merchant-id"]=u["merchant-id"];u["merchant-id"]="*"}return{url:"".concat(o,"?").concat(A(u)),attributes:c}}function I(r){var n=function(r,n){return(n?"-":"")+r.toLowerCase()};return r.replace(/[A-Z]+(?![a-z])|[A-Z]/g,n)}function A(r){var n="";Object.keys(r).forEach((function(e){if(n.length!==0)n+="&";n+=e+"="+r[e]}));return n}function O(r){return r==="sandbox"?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}function x(r,n){if(n===void 0){n={}}var e=document.createElement("script");e.src=r;Object.keys(n).forEach((function(r){e.setAttribute(r,n[r]);if(r==="data-csp-nonce"){e.setAttribute("nonce",n["data-csp-nonce"])}}));return e}function T(r,n){if(n===void 0){n=Promise}z(r,n);if(typeof document==="undefined")return n.resolve(null);var e=S(r),t=e.url,o=e.attributes;var a=o["data-namespace"]||"paypal";var i=L(a);if(!o["data-js-sdk-library"]){o["data-js-sdk-library"]="paypal-js"}if(j(t,o)&&i){return n.resolve(i)}return B({url:t,attributes:o},n).then((function(){var r=L(a);if(r){return r}throw new Error("The window.".concat(a," global variable is not available."))}))}function B(r,n){if(n===void 0){n=Promise}z(r,n);var e=r.url,t=r.attributes;if(typeof e!=="string"||e.length===0){throw new Error("Invalid url.")}if(typeof t!=="undefined"&&typeof t!=="object"){throw new Error("Expected attributes to be an object.")}return new n((function(r,n){if(typeof document==="undefined")return r();E({url:e,attributes:t,onSuccess:function(){return r()},onError:function(){var r=new Error('The script "'.concat(e,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return n(r)}})}))}function L(r){return window[r]}function z(r,n){if(typeof r!=="object"||r===null){throw new Error("Expected an options object.")}var e=r.environment;if(e&&e!=="production"&&e!=="sandbox"){throw new Error('The `environment` option must be either "production" or "sandbox".')}if(typeof n!=="undefined"&&typeof n!=="function"){throw new Error("Expected PromisePonyfill to be a function.")}}var C=function(r){return __awaiter(g,[r],void 0,(function(r){var n,e,t;var o=r.checkoutSessionId,a=r.paypalMockResponse;return __generator(this,(function(r){switch(r.label){case 0:return[4,h("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:o,paypalMockResponse:a},method:"POST"})];case 1:n=r.sent(),e=n.errors,t=n.json;return[2,{errors:e,json:t}]}}))}))};var M=function(r){return __awaiter(g,[r],void 0,(function(r){var n,e,t;var o=r.checkoutSessionId,a=r.intent;return __generator(this,(function(r){switch(r.label){case 0:return[4,h("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:o,intent:a},method:"POST"})];case 1:n=r.sent(),e=n.errors,t=n.json;return[2,{errors:e,json:t}]}}))}))};var F=n((function(){return{intent:"capture",orderIdCreated:null,paypal:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}})),R=F.onChange,D=F.reset,N=F.state;r({e:R,c:D,a:N});var U=function(r){return __awaiter(g,[r],void 0,(function(r){var n,e,t,o,a,i,u;var c=r.checkoutSessionId;return __generator(this,(function(r){switch(r.label){case 0:t=N.intent.toUpperCase();return[4,M({checkoutSessionId:c,intent:t})];case 1:o=r.sent(),a=o.errors,i=o.json;u=(n=i===null||i===void 0?void 0:i.paypalOrderCreate)===null||n===void 0?void 0:n.paypalOrderId;if(a.length||!u){throw new Error(((e=a.find(Boolean))===null||e===void 0?void 0:e.message)||"An unexpected error occurred when creating paypal order.")}return[2,u]}}))}))};var Y=function(r){return __awaiter(g,[r],void 0,(function(r){var n,e,t,o,a,i;var u=r.checkoutSessionId,c=r.paypalMockResponse;return __generator(this,(function(r){switch(r.label){case 0:return[4,C({checkoutSessionId:u,paypalMockResponse:c})];case 1:t=r.sent(),o=t.errors,a=t.json;i=(n=a===null||a===void 0?void 0:a.paypalOrderCapture.order)===null||n===void 0?void 0:n.id;if(o.length||!i){throw new Error(((e=o.find(Boolean))===null||e===void 0?void 0:e.message)||p("An unexpected error occurred when processing PayPal order."))}return[2,i]}}))}))};var H=function(r){var n=r.error;var e;var t=b(n.message);var o=(e=t===null||t===void 0?void 0:t.errors.find(Boolean))===null||e===void 0?void 0:e.message;var a=(o===null||o===void 0?void 0:o.match(/\[(.*?)\] (.*)/i))||[];if(!a){N.paypalErrorMessage=p("An unexpected error occurred when processing PayPal order.")}var i=a[2]||p("An unexpected error occurred when processing PayPal order.");N.paypalErrorMessage=i};var Z=function(r){var n=r.checkoutSessionId,y=r.onPaypalFail,h=r.onPaypalSessionDone,b=r.overrideBorderRaidus,_=r.overridePrimaryColor;var k=_||e.appearance.colorPrimary;var j="#ffc33a";var E=m({backgroundColor1:j,backgroundColor2:k||""});return{createOrder:function(){return __awaiter(g,void 0,void 0,(function(){var r,e,b,m,_,g,k,j;return __generator(this,(function(E){switch(E.label){case 0:void t({checkoutSessionId:n,eventName:"checkout_paymentInfoCompleted",metadata:{paymentMethod:"paypal"}});return[4,o()];case 1:r=E.sent();if(!r.valid){N.paypalErrorMessage=r.errorMessage;a.hasPaymentError=false;a.customErrorMessage=null;P({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:n}});y===null||y===void 0?void 0:y();return[2,""]}E.label=2;case 2:E.trys.push([2,12,,13]);N.paypalErrorMessage=null;i.inventoryCheckErrorMessage=null;E.label=3;case 3:E.trys.push([3,5,,6]);e=i;return[4,u()];case 4:e.inventoryCheckErrorMessage=E.sent();return[3,6];case 5:b=E.sent();i.inventoryCheckErrorMessage=p("Unable to check inventory. Please try again.");return[3,6];case 6:if(i.inventoryCheckErrorMessage){return[2,""]}m=v();if(!(m>0))return[3,8];return[4,c()];case 7:_=E.sent();if(!_.success){N.paypalErrorMessage=_.error||p("Unable to apply store credit. Please try again.");y===null||y===void 0?void 0:y();return[2,""]}E.label=8;case 8:if(!s())return[3,10];return[4,l()];case 9:g=E.sent();if(!g.success){N.paypalErrorMessage=g.error||p("Unable to place order with store credit. Please try again.");y===null||y===void 0?void 0:y();return[2,""]}h===null||h===void 0?void 0:h({orderId:g.orderId||""});d();f();return[2,""];case 10:return[4,U({checkoutSessionId:n})];case 11:k=E.sent();return[2,k];case 12:j=E.sent();w("Failed to create paypal order",j);N.paypalErrorMessage=p("Failed to create PayPal order. Please try again, or consider using an alternative method.");a.hasPaymentError=false;a.customErrorMessage=null;P({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:n}});y===null||y===void 0?void 0:y();return[2,""];case 13:return[2]}}))}))},onApprove:function(r,e){return __awaiter(g,void 0,void 0,(function(){var r,e;return __generator(this,(function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);N.paypalErrorMessage=null;P({event:"zonos-checkout-payment-info",metadata:{checkoutSessionId:n,paymentMethod:"paypal"}});return[4,Y({checkoutSessionId:n,paypalMockResponse:window.Zonos._paypalMockResponse})];case 1:r=t.sent();N.orderIdCreated=r;h===null||h===void 0?void 0:h({orderId:r});d();f();return[3,3];case 2:e=t.sent();w("==== Failed to capture paypal order",e);if(e instanceof Error){return[2,H({error:e})]}y===null||y===void 0?void 0:y();return[3,3];case 3:return[2]}}))}))},style:{borderRadius:b==="SHARP"?0:10,color:E?"gold":"blue",shape:"rect"}}};var q=function(){if(!N.paypalButtons.length){return}N.paypalButtons.forEach((function(r){return __awaiter(g,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,r.close()];case 1:n.sent();return[2]}}))}))}));N.paypalButtons=[]};var G=r("b",(function(r){return __awaiter(g,[r],void 0,(function(r){var n,t,o,a,i,u;var c=r.currency;return __generator(this,(function(r){switch(r.label){case 0:t=!!((n=e.checkoutSettings.externalPaymentMethods)===null||n===void 0?void 0:n.find((function(r){return r.type==="PAYPAL"&&r.status==="ENABLED"})));if(!t){_("=== Paypal is disabled for this store","warn");return[2]}o=e.checkoutSettings.externalServiceTokens.find((function(r){return r.type==="PAYPAL_CLIENT_ID"}));if(!o){_("Failed to load paypal -- missing paypal publishable key","warn");return[2]}a=(!e.zonosMode||e.zonosMode==="production")&&e.checkoutSettings.mode==="LIVE"?"production":"sandbox";i=e.checkoutSettings.captureDelay&&e.checkoutSettings.captureDelay>0;N.intent=i?"authorize":"capture";_("==== Paypal order intent","info",N.intent);u=window.Zonos;return[4,T({clientId:o.token,currency:c,environment:a,intent:N.intent})];case 1:u.paypal=r.sent();N.paypal=window.Zonos.paypal;_("==== Paypal script loaded");return[2]}}))}))}));var V=r("d",(function(r){var n;var e=window.Zonos.paypal;if(!e){_("Paypal is not available");return null}var t=y.checkoutSessionId;if(!t){_("Paypal is not available due to checkoutSessionId is not available");return null}_("==== Loading Paypal buttons");q();var o=[(n=e.FUNDING)===null||n===void 0?void 0:n.PAYPAL].filter(Boolean);N.paypalButtons=o.map((function(n){var o;var a=null;try{a=((o=e.Buttons)===null||o===void 0?void 0:o.call(e,Object.assign(Object.assign({},Z(Object.assign({checkoutSessionId:t,fundingSource:n},r))),{fundingSource:n})))||null}catch(r){_("===== Failed to load paypal's \"".concat(n,'" button'),"warn",r)}if(a===null||a===void 0?void 0:a.isEligible()){_("==== Paypal button ".concat(n," loaded"));return a}return null})).filter(Boolean);return N.paypalButtons}));var J=r("p",(function(){var r,n;var t=((n=(r=e.checkoutSettings.externalPaymentMethods)===null||r===void 0?void 0:r.find((function(r){return r.type==="PAYPAL"})))===null||n===void 0?void 0:n.status)==="ENABLED";return t||!!N.paypalButtons.length}))}}}));
@@ -1 +0,0 @@
1
- import{r as o,h as e,F as t,a as s}from"./p-ce75b047.js";import{s as n,a as i,b as c,i as r,c as a,d,e as l,f as u,g as h,h as m,j as p,k as g,l as f,t as w,m as z,n as k,o as v,p as y,q as C,r as b,u as S,v as x,w as I,x as T,y as A,z as O,A as _,B as L,C as P,D as B,E,F as U}from"./p-a8bb461c.js";import{p as D,a as N,b as j}from"./p-24407504.js";import{f as $,l as R,a as F,g as M,s as H,V as K,b as Z,t as V,c as G,d as W}from"./p-a75b8ad7.js";import{z as Q,g as Y,m as q}from"./p-ed9385f4.js";import{b as J}from"./p-83666056.js";import{h as X,g as oo,l as eo,j as to,b as so,s as no,a as io,i as co}from"./p-41dd1cb8.js";import{u as ro}from"./p-09307a03.js";import{l as ao,g as lo,b as uo}from"./p-0a377722.js";import{_ as ho,c as mo,a as po,d as go,g as fo}from"./p-b2d81c98.js";import{c as wo}from"./p-b4b7f705.js";import{c as zo}from"./p-595f5dd2.js";import{g as ko}from"./p-5beab541.js";import{i as vo}from"./p-f6922df5.js";import{s as yo}from"./p-96d77739.js";import{s as Co}from"./p-387f6a4d.js";import{R as bo}from"./p-08e7107d.js";import"./p-7d9bbdc8.js";import"./p-2f924331.js";const So="isInternationalCheckout",xo=({action:o}={})=>{const e=new URL("/login.php",window.location.origin);o&&e.searchParams.set("action",o);const t=new URLSearchParams(window.location.search),s=t.get("zonosQaUrl");s&&e.searchParams.set("zonosQaUrl",s);const n=t.get("zonosQaUrlApi");return n&&e.searchParams.set("zonosQaUrlApi",n),oo()&&e.searchParams.set("zonosTestMode","1"),e.searchParams.set("from",(()=>{const o=new URLSearchParams;o.set(So,"true");const e=new URLSearchParams(window.location.search),t=e.get("zonosQaUrl");t&&o.set("zonosQaUrl",t);const s=e.get("zonosQaUrlApi");return s&&o.set("zonosQaUrlApi",s),oo()&&o.set("zonosTestMode","1"),`cart.php?${o.toString()}`})()),e.toString()},Io=o=>{const e=new URL(o,window.location.origin),t=new URLSearchParams(window.location.search).get("zonosQaUrl");return t&&e.searchParams.set("zonosQaUrl",t),oo()&&e.searchParams.set("zonosTestMode","1"),e.toString()},To=async()=>{var o,e;try{const t=await fetch("/api/storefront/cart",{credentials:"same-origin",headers:{Accept:"application/json"}});if(!t.ok)return ao(`Failed to fetch BigCommerce cart: ${String(t.status)}`,"error"),null;const s=await t.json();return null!==(e=null===(o=null==s?void 0:s[0])||void 0===o?void 0:o.id)&&void 0!==e?e:null}catch(o){return eo("Error fetching BigCommerce cart data",o),null}},Ao=async o=>{try{const e=await fetch(`/api/storefront/checkouts/${o}?include=customer.customerGroup`,{credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}});return e.ok?await e.json():(ao(`Failed to fetch BigCommerce checkout: ${String(e.status)}`,"error"),null)}catch(o){return eo("Error fetching BigCommerce checkout data",o),null}},Oo={customerGroupId:null,shouldBypass:!1};let _o=null;const Lo=o=>{const e=(async o=>{var e,t,s,n;if(!window.Zonos.isBigCommerce)return{conclusive:!0,result:Oo};const i=null===(e=Q.genericSettings)||void 0===e?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(null==i?void 0:i.length))return Q.loadedConfig?{conclusive:!0,result:Oo}:{conclusive:!1,result:Oo};const c=o?o.checkoutId:await To();if(!c)return ao("BigCommerce bypass check: no active cart yet, will retry on next call","info"),{conclusive:!1,result:Oo};const r=o?o.checkout:await Ao(c);if(!r)return ao("BigCommerce bypass check: failed to fetch checkout data, will retry","info"),{conclusive:!1,result:Oo};const a=null!==(n=null===(s=null===(t=r.customer)||void 0===t?void 0:t.customerGroup)||void 0===s?void 0:s.id)&&void 0!==n?n:null;if(null===a)return ao("BigCommerce bypass check: no customer group found (guest user)","info"),{conclusive:!0,result:Oo};const d=i.includes(a),l={customerGroupId:a,shouldBypass:d};return ao(d?`BigCommerce bypass check: customer group ${String(a)} is in bypass list; caller should keep the user on BC native checkout`:`BigCommerce bypass check: customer group ${String(a)} is not in bypass list`,"info"),{conclusive:!0,result:l}})(o),t=e.then((({conclusive:o,result:e})=>(o||_o!==t||(_o=null),e)));return _o=t,t},Po=async(o={})=>o.forceRefresh||!_o?Lo(o.preFetched):_o,Bo={guestCheckoutType:null},Eo="zonos--bc-checkout-settings",Uo={redirectUrl:null,shouldForceLogin:!1};let Do=null;const No=()=>{if(!Do){const o=(async()=>{var o;if(!window.Zonos.isBigCommerce)return Bo;const e=null===(o=Q.checkoutSettings.bigCommerceConfig)||void 0===o?void 0:o.storeHash;if(!e)return ao("BigCommerce checkout settings: no storeHash provided — skipping fetch","info"),Bo;const t=(o=>{try{const e=window.localStorage.getItem(Eo);if(!e)return null;const t=to(e);return t?t.storeHash!==o||t.expiresAt<Date.now()?null:{guestCheckoutType:t.guestCheckoutType}:null}catch(o){return null}})(e);if(t)return t;const{errors:s,json:n}=await X("/api/bigcommerce/checkout-settings",{body:{storeHash:e},method:"POST"});if(s.length||!n)return ao("BigCommerce checkout settings: proxy call failed, falling back to guest-allowed behavior","info"),Bo;const i={guestCheckoutType:n.guestCheckoutType};return((o,e)=>{try{const t={expiresAt:Date.now()+36e5,guestCheckoutType:e.guestCheckoutType,storeHash:o};window.localStorage.setItem(Eo,JSON.stringify(t))}catch(o){}})(e,i),i})().then((({guestCheckoutType:e})=>e?"no_guest_checkout"===e:(Do===o&&(Do=null),!1))).catch((()=>(Do===o&&(Do=null),!1)));Do=o}return Do},jo=async({preFetched:o}={})=>{if(!window.Zonos.isBigCommerce)return Uo;if(!await No())return Uo;const e=o?o.checkoutId:await To();if(!e)return Uo;const t=o?o.checkout:await Ao(e);return t?(o=>{var e;return!!(null===(e=null==o?void 0:o.customer)||void 0===e?void 0:e.id)})(t)?Uo:(ao("BigCommerce force-login check: guest shopper on no-guest-checkout store, redirecting to /login.php","info"),{redirectUrl:xo(),shouldForceLogin:!0}):(ao("BigCommerce force-login check: failed to fetch checkout data, allowing flow to continue","info"),Uo)},$o="data-zonos-login-from-rewritten",Ro='a[href*="login.php?action=create_account"]:not(['+$o+"])",Fo=()=>{const o=document.querySelectorAll(Ro);if(!o.length)return;const e=xo({action:"create_account"});o.forEach((o=>{o.setAttribute("href",e),o.setAttribute($o,"true")}))},Mo=(o=!0,e)=>{var t;if(!R.localizationLoaded)return!1;if(e){const s=!!(null===(t=R.shippingZoneCountries)||void 0===t?void 0:t[e])&&!Q.disabledCountries.includes(e);return o&&!s&&ao(`Checkout: ${e} is not a shippable country: ${s}`),s}return!!R.isShippableCountry||(o&&ao("Checkout: not shippable country"),!1)},Ho='select[name="shippingAddress.countryCode"]';let Ko=0;const Zo=o=>{var e;const t=null===(e=H.enabledVariantTestKeys)||void 0===e?void 0:e.find((e=>e.testKey===o));return(null==t?void 0:t.selectedVariantKey)||null},Vo=async({cartId:o,retries:e})=>{const t=oo(),{errors:s,json:n}=await X("/api/zonos-elements/get-temp-cart",{body:{isTestMode:t,options:{noOnlineStoreSettings:!0},tempCartUUID:o},headers:{"Content-Type":"application/json"},method:"POST"}),i=!n||s.length;return i&&e?(ao("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:e}),await new Promise((o=>setTimeout(o,500))),Vo({cartId:o,retries:e-1})):i?null:n},Go='<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',Wo=class{constructor(e){o(this,e),this.storeUnsubscribeList=[],this.isRedirectAfterOrder=!1,this.preview=!1,this.hiddenMode=!1,this.mobile=!1,this.defaultAddress=[],this.forceDialogOpen=!1,this.defaultAddressParams=[],this.defaultCustomerProfileAddress=[],this.customerProfile=null,this.open=this.forceDialogOpen,this.isOverlayLoading=!1,this.stripe=window.Zonos.stripe,this.submitLoading=!1,this.collapseReviewMobile=!0,this.isAttachError=!1,this.isMobile=!1,this.isIframed=!1,this.isLegacyCheckout=window.Zonos.isLegacyCheckout,this.confirmDialogOpen=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.placedOrderInfo=null,this.shouldShowFedexShippingConsentDialog=!1,this.detectedDomesticCheckoutDialogOpen=!1,this.redirectToDomesticCheckoutDialogOpen=!1,this.loggedInIntlAddressConfirmDialogOpen=!1,this.loggedInIntlAddressResolver=null,this.clientSecret=c.clientSecret,this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret,this.applyStripeTheme=async()=>{var o,e,t,s;const n=(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)||Q.appearance.theme;await r({overrideBorderRadius:null===(e=this.appearanceSettingsOverride)||void 0===e?void 0:e.style,overridePrimaryColor:null===(t=this.appearanceSettingsOverride)||void 0===t?void 0:t.colorPrimary,overrideSecondaryColor:null===(s=this.appearanceSettingsOverride)||void 0===s?void 0:s.colorSecondary,overrideTheme:this.isMobile?n:void 0,paypalEnabled:D()})},this.checkStripePaymentIntentStatus=async({triggeredButton:o})=>{const e=null==o?void 0:o.matches(`#${mo}`),t=!!window.Zonos.cartData,s=new URL(window.location.href).searchParams,n=s.get("payment_intent_client_secret"),i=s.get("zonosCheckoutSessionId");if(!e)return ao("Checkout is triggered by user, no need to check stripe payment intent status"),{shouldAllowOrder:!0};if(ao("Payment intent exist, checking stripe payment intent status"),!n)return ao("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:t};const{error:r,status:d}=await a({clientSecret:n});return new URLSearchParams(window.location.search).get("redirect_status")?(ao(r?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen"),this.open=!0,H.checkoutSessionId=i,c.clientSecret=n,this.setToFinishStep(d),{shouldAllowOrder:!1}):t?(ao("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(ao("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})},this.initializeTestKeys=()=>{var o;H.enabledVariantTestKeys=(null==(o=H.enabledVariantTestKeys||[])?void 0:o.filter((o=>!(o.expiresAt&&o.expiresAt<Date.now()||!o.expiresAt))))||[];const e=Q.enabledVariantTestKeys.map((o=>{var e;const t=null===(e=H.enabledVariantTestKeys)||void 0===e?void 0:e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+K,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}}));return Z(e),{allSelected:!1}},this.shouldAllowHostedVsNativeTest=()=>"function"==typeof Q.checkoutSettings.createCartId&&!!Q.enabledVariantTestKeys.includes("hosted_vs_native"),this.registerTestHostedVsNative=async()=>{if(!this.shouldAllowHostedVsNativeTest())return;ao("[TEST] - Registering hosted vs native test");const o=Zo("hosted_vs_native");if(o)return void ao(`[TEST] - Hosted vs native test already has variant selected: ${o}`);const e=await(async({testKeys:o})=>{if(0===o.length)return null;const{errors:e,json:t}=await X("/api/zonos-elements/select-variance-test",{body:{testKeys:o},method:"POST"});return e.length||!t?null:$(t)})({testKeys:["hosted_vs_native"]});if(!e)return void ao("[TEST] - Failed to get selection for hosted vs native test");const t=(({baseTestObj:o,mergeTestObj:e})=>o.map((({testKey:o})=>{const t=e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+K,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}})))({baseTestObj:H.enabledVariantTestKeys||[],mergeTestObj:e});Z(t)},this.handleHostedVsNative=async()=>{var o;if(!this.shouldAllowHostedVsNativeTest())return{redirected:!1};const e=Zo("hosted_vs_native");if(ao(`[TEST] - hosted_vs_native: ${e}`),"function"!=typeof Q.checkoutSettings.createCartId)return ao("[TEST] - createCartId is not provided, skipping hosted vs native test"),{redirected:!1};if("hosted"!==e)return ao("[TEST] - Hosted vs native test is enabled for native, skipping"),{redirected:!1};if(!(null===(o=Q.genericSettings)||void 0===o?void 0:o.hostedCheckoutUrl))return ao("[TEST] - Hosted checkout URL is not provided"),{redirected:!1};ao('"createCartId" is provided, start building cart');const t=await Q.checkoutSettings.createCartId();let s,n=null;"object"==typeof t?(s=t.cartId,n=t.shippingData||null):s=t;const i=(()=>{const o=new URLSearchParams(window.location.search);ao("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:""},t=M(o)||R.selectedCountryCode||"US",s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerPhone"),d=e("customerZip"),l=e("customerState");return{customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:e("customerFirstName"),customerLastName:e("customerLastName"),customerName:r,customerPhone:a,customerState:l,customerZip:d}})(),c=(({cartId:o,checkoutSessionId:e,customerAddress1:t,customerAddress2:s,customerCity:n,customerCountry:i,customerEmail:c,customerFirstName:r,customerLastName:a,customerPhone:d,customerState:l,customerZip:u,hostedCheckoutUrl:h,isTestMode:m,isVariantTest:p})=>{const g=new URLSearchParams;return g.set("tempCartUUID",o),r&&g.set("customerFirstName",r),a&&g.set("customerLastName",a),c&&g.set("customerEmail",c),d&&g.set("customerPhone",d),u&&g.set("customerZip",u),n&&g.set("customerCity",n),l&&g.set("customerState",l),i&&g.set("zCountry",i),t&&g.set("customerAddress1",t),s&&g.set("customerAddress2",s),m&&g.set("zonosTestMode","1"),e&&g.set("zonosCheckoutSessionId",e),p&&g.set("zonosVariantTest","1"),`${h}?${g.toString()}`})(Object.assign(Object.assign({cartId:s,checkoutSessionId:H.checkoutSessionId||void 0,hostedCheckoutUrl:Q.genericSettings.hostedCheckoutUrl,isTestMode:oo(),isVariantTest:!0},i),n));return ao(`[TEST] - Redirecting to: ${c}`),window.open(c,"_blank"),{redirected:!0}},this.formatDate=o=>o?new Date(o).toLocaleDateString():"",this.formatTime=o=>o?new Date(o).toLocaleTimeString():"",this.getCurrentLocalePageEnum=()=>{switch(d.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}},this.getBaseCurrencySettlementInfo=()=>{const o=d.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:e}}=o;return e?{settlementAmount:(e.discounts||0)+e.items+e.landedCostTotal+e.shipping}:null},this.getDefaultAddress=()=>this.defaultCustomerProfileAddress.length?this.defaultCustomerProfileAddress:Array.isArray(this.defaultAddress)&&this.defaultAddress.length?this.defaultAddress:Array.isArray(this.defaultAddress)||"object"!=typeof this.defaultAddress?this.defaultAddressParams:[this.defaultAddress],this.handleHostedOpenWindowCallback=o=>{var e;const t=null===(e=Q.genericSettings)||void 0===e?void 0:e.hostedCheckoutUrl;if(!origin)return;const s=["dev.checkout.elements.zonos.com"].some((e=>o.origin.includes(e)));o.origin!==t&&!s||"zonos-checkout-session-update"!==o.data.type||(H.checkoutSessionId=o.data.checkoutSessionId)},this.captureParamsRedirectedForVariantTest=()=>{const o=new URL(window.location.href);if("1"!==o.searchParams.get("zonosVariantTest"))return;const e=o.searchParams.get("zonosCheckoutSessionId");e&&(H.checkoutSessionId=e);const t=H.enabledVariantTestKeys||[];window.Zonos.isLegacyCheckout&&(Zo("hosted_vs_native")?Z(t.map((o=>"hosted_vs_native"===o.testKey?Object.assign(Object.assign({},o),{selectedVariantKey:"hosted"}):o))):(t.push({expiresAt:Date.now()+K,selectedVariantKey:"hosted",testKey:"hosted_vs_native"}),Z(t))),o.searchParams.delete("zonosCheckoutSessionId"),o.searchParams.delete("zonosVariantTest"),window.history.replaceState({},"",o.toString())}}async initCartInfoHandler(o){l({adjustments:d.adjustments,cartItems:o.detail})}async handleKeyPress(o){"Escape"===o.key&&this.closeDialogHandler()}async closeDialogHandler(o){var e,t;this.open&&((null==o?void 0:o.confirmed)?(this.confirmDialogOpen=!1,Co({event:"zonos-checkout-close",metadata:{checkoutSessionId:H.checkoutSessionId}}),this.open=this.forceDialogOpen||!1,this.preview||"finish"!==d.step||u(),d.step="customer-info",h(),m(),null===(t=(e=Q.checkoutSettings).onClose)||void 0===t||t.call(e)):this.confirmDialogOpen=!0)}async buildCartAndInit(){if("function"==typeof Q.checkoutSettings.createCartId){ao('"createCartId" is provided, start building cart');const o=await Q.checkoutSettings.createCartId();let e;"object"==typeof o?(ao("object detected, use cartId and prefill address from createCartId","info",o),e=o.cartId,this.useShippingDataFromCreateCartId(o.shippingData),d.customerAuthenticationToken=o.customerAuthenticationToken||null):e=o,window.Zonos.cartId=e;const t=await(async o=>{const{isDgsCartId:e,isLegacyCartId:t}=ho(o);if(!t&&!e)return eo("[ZONOS - loadZonos] invalid cart id"),null;const s=await Vo({cartId:o,retries:5});return ao("[ZONOS - loadZonos] getting temp cart data","info",s),s?(window.Zonos.storeId=s.cartData.storeId,window.Zonos.zonosApiKey=s.cartData.credentialToken,{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}):(eo("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(e),s=null==t?void 0:t.cartData;if(!s)return eo("Failed to build cart, please try again."),!1;window.Zonos.cartData=s;const{adjustments:n,cartItems:i}=J(s);await l({adjustments:n,cartItems:i})}else if(window.Zonos.cartData){ao("tempCartUUID is provided, start building cart");const{adjustments:o,cartItems:e}=J(window.Zonos.cartData);await l({adjustments:o,cartItems:e})}else if(Q.checkoutSettings.buildCartDetail&&R.selectedCountryCode){ao("build cart detail");const o=await Q.checkoutSettings.buildCartDetail({countryCode:R.selectedCountryCode,currencyCode:R.targetCurrency}),e=o.filter((o=>o.amount>=0)),t=o.filter((o=>o.amount<0));ao("cartItems","info",{cartItems:o});const s=t.map((o=>({amount:o.amount,currencyCode:o.currencyCode,description:o.name||o.description||"",productId:o.productId||null,sku:o.sku||null,type:"CART_TOTAL"})));await l({adjustments:s,cartItems:e})}if(!H.checkoutSessionId){const o=await p();if(ao(`stripeStoreInitCheckoutSession: ${o}`),!o)return!1}return d.isStagingMode||g(),await this.applyStripeTheme(),this.isRedirectAfterOrder="REDIRECT_TO_SUCCESS_PAGE"===Q.checkoutSettings.successBehavior||!!d.externalConfirmationPageURL,!0}reloadCheckoutSession(){window.location.reload()}handleOrderDuplication(){const o=to(localStorage.getItem("zonos--placed-order-info"));if(!o)return void localStorage.removeItem("zonos--placed-order-info");const e=Date.now()-o.time;ao(`=== Existing placed order info: ${o.orderId} - ${this.formatDate(o.time)} - elapsed in hh:ss format: ${new Date(e).toISOString().substring(11,8)}`,"warn");const t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||216e5;if(e>t)return ao(`=== Existing placed order info is older than ${t}ms, cleaning localStorage`,"warn"),void localStorage.removeItem("zonos--placed-order-info");this.placedOrderInfo=o,ao("=== Showing order duplication confirmation","warn")}recordCheckoutInfo(){H.checkoutSessionId&&ro({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:H.checkoutSessionId})}confirmProceedWithOrderDuplication(){this.placedOrderInfo=null,H.checkoutSessionId&&ro({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:H.checkoutSessionId})}markTheSessionAsAbandonedCart(){H.checkoutSessionId&&ro({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:H.checkoutSessionId})}handleCancelOrderDuplication(){var o;if(this.placedOrderInfo=null,this.isLegacyCheckout){const e=(null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl)||Q.onlineStoreSettings.url;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}this.closeDialogHandler({confirmed:!0})}attachCheckout(){const o=Q.checkoutSettings.placeOrderButtonSelector,e=Q.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;if(ao(`attach checkout ${o}`),ao(`attach checkout to always trigger international checkout selector: ${e}`),!o&&!e&&!window.Zonos.cartData)return;const t=[o,e,`#${go}`,`#${mo}`,`#${po}`].filter(Boolean);document.querySelectorAll(t.join(",")).forEach((t=>{t.getAttribute("data-zonos-checkout-attached")||(ao(`attached event to button ${o}`,"info",{button:t}),t.addEventListener("click",(async o=>{var s,n;const i=performance.now(),r=e&&t.matches(e),a=t.matches(`#${po}`),l=t.matches(`#${go}`)||t.matches(`#${mo}`);if(!window.Zonos.isLegacyCheckout&&(!Mo()||((o=!0)=>!R.localizationLoaded||!!R.isDisabledCountry&&(o&&ao("Checkout: disabled country"),!0))())&&!r&&!a&&!l)return;o.preventDefault(),o.stopPropagation(),ao("zonos checkout button clicked");const{shouldAllowOrder:u}=await this.checkStripePaymentIntentStatus({triggeredButton:o.target});if(u){if(window.Zonos.logIntervalId||(window.Zonos.logIntervalId=setInterval((()=>{(async()=>{if(0===window.Zonos.loadTimeApiInfoList.length)return;ao("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});const o={data:[...window.Zonos.loadTimeApiInfoList],storeId:window.Zonos.storeId||0};window.Zonos.loadTimeApiInfoList.length=0;const{errors:e}=await X("/api/zonos-elements/log-bulk-load-data",{body:o,method:"POST"});e.length&&(window.Zonos.loadTimeApiInfoList.push(...o.data),Ko++,Ko>5&&window.Zonos.logIntervalId&&clearInterval(window.Zonos.logIntervalId))})()}),2e3)),Q.enabledVariantTestKeys.includes("hosted_vs_native")){this.isOverlayLoading=!0,await this.registerTestHostedVsNative();const{redirected:o}=await this.handleHostedVsNative();if(this.isOverlayLoading=!1,o)return}if(window.Zonos.isBigCommerce){const{shouldBypass:o}=await Po();if(o)return ao("Bypass customer group detected, redirecting to BigCommerce native checkout","info"),void(window.location.href=Io("/checkout"));const e=await jo();if(e.shouldForceLogin&&e.redirectUrl)return void(window.location.href=e.redirectUrl)}c.isFetchingSession=!0,this.open=!0;try{if(!await this.buildCartAndInit())throw new Error("Error building cart");null===(s=window.opener)||void 0===s||s.postMessage({checkoutSessionId:H.checkoutSessionId,type:"zonos-checkout-session-update"},"*"),f({isPreview:this.preview,sessionTimeout:54e5}),Co({event:"zonos-checkout-start",metadata:{checkoutSessionId:H.checkoutSessionId}}),w({checkoutSessionId:H.checkoutSessionId,eventName:"checkout_open"});const{enabled:o}=await(async()=>{const{errors:o,json:e}=await X("/api/zonos-elements/get-store-discount-enabled-status");return o.length||!(null==e?void 0:e.enabled)?{enabled:!1}:{enabled:!0}})();if(d.shouldHideDiscountInput=!o,this.handleOrderDuplication(),window.Zonos.isLegacyCheckout)(async()=>{const{elapsedTime:o}=lo(),e={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:uo},so()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};X("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})();else{(async({loadTime:o})=>{const e={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:uo},so()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};X("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})({loadTime:performance.now()-i})}this.recordCheckoutInfo(),fo()&&this.markTheSessionAsAbandonedCart()}catch(o){if(o instanceof Error&&"Cart is expired."===o.message&&(this.isCartExpired=!0),c.isFetchingSession=!1,eo(o),this.isCartExpired)return void(c.isFetchingSession=!0);no({endpoint:"Error creating Checkout",errors:[o instanceof Error?o.toString():"Unknown error"],metadata:{allLogs:uo,cartId:window.Zonos.cartId,checkoutSessionBody:z(),href:window.location.href,storeBaseUrl:(null===(n=window.Zonos.cartData)||void 0===n?void 0:n.storeBaseUrl)||Q.onlineStoreSettings.url}}),k({messages:[V("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:V("Error creating Checkout")})}}}),{capture:!0,passive:!1}),Q.checkoutSettings.disablePlaceOrderButtonActivation||t.removeAttribute("disabled"),t.setAttribute("data-zonos-checkout-attached","true"),t.matches(`#${go}`)&&(t.dispatchEvent(zo("click")),v(),t.remove()),t.matches(`#${mo}`)&&(t.dispatchEvent(zo("click")),t.remove()))}))}appearanceSettingsOverrideChanged(){this.appearanceSettingsOverride&&this.applyStripeTheme()}useShippingDataFromCreateCartId(o){if(!o)return;ao("shipping data from createCartId result","info",Object.entries(o));const{customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:n,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:u}=o,h=new URLSearchParams(window.location.search),m=n||M(h)||R.selectedCountryCode;this.applyPrefillAddress({customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:m,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:u})}useLegacyQueryParams(){const o=new URLSearchParams(window.location.search);ao("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:null},t=M(o)||R.selectedCountryCode,s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerFirstName"),d=e("customerLastName"),l=e("customerPhone"),u=e("customerZip"),h=e("customerState");this.applyPrefillAddress({customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:a,customerLastName:d,customerName:r,customerPhone:l,customerState:h,customerZip:u})}applyPrefillAddress(o){const e=o.customerAddress1||"",t=o.customerCountry||"",s=o.customerAddress2||"",n=o.customerCity||"",i=o.customerEmail||"",c=o.customerFirstName&&o.customerLastName?`${o.customerFirstName} ${o.customerLastName}`:o.customerName||"",r=o.customerPhone||"",a=o.customerZip||"",d=o.customerState||"";e&&c&&r&&t?t&&R.shippingZoneCountries&&!(t in R.shippingZoneCountries)?ao(`Country "${t}" is not in the shipping zone, so it can not be prefilled`,"warn"):(this.defaultAddressParams=[{address:{city:n||"",country:t,line1:e,line2:s,postal_code:a,state:d},email:i,name:c,phone:r}],ao("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:o})):ao("Missing required query params so it can not be prefilled","info",[!e&&"line1",!c&&"name",!r&&"phone",!t&&"country"].filter(Boolean).join(", "))}overrideStagingModeChanged(){d.isStagingMode=!!this.overrideStagingMode}async init(){c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,d.isStagingMode=io(),void 0!==this.overrideStagingMode&&(d.isStagingMode=this.overrideStagingMode),(()=>{var o;if(!window.Zonos.isBigCommerce)return;const e=null===(o=Q.genericSettings)||void 0===o?void 0:o.bigcommerceBypassCustomerGroupIds;(null==e?void 0:e.length)&&Lo()})(),window.Zonos.isBigCommerce&&No(),(()=>{if(!window.Zonos.isBigCommerce)return;if(!window.location.pathname.includes("/login.php"))return;Fo();const o=new MutationObserver((()=>{Fo()}));o.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>o.disconnect()),1e4)})(),this.handleBigcommerceInternationalResumeFlag(),(({domesticRedirectedBtnSelector:o,onInternationalCheckoutSelected:e,onLoggedInInternationalAddressDetected:t,onShippingAddressSessionFound:s})=>{if(!window.Zonos.isBigCommerce)return;const c=async o=>{var t;const s=document.querySelector((null===(t=Q.genericSettings)||void 0===t?void 0:t.bigcommerceDomesticCheckoutCountrySelector)||Ho),n=(null==s?void 0:s.value)||o;if(!n)return!1;if(!Mo(!1,n))return!1;const c=await To(),r={checkout:c?await Ao(c):null,checkoutId:c},{shouldBypass:a}=await Po({forceRefresh:!0,preFetched:r});if(a)return ao("Bypass customer group detected on BC checkout, stopping interval","info"),!0;const d=await jo({preFetched:r});if(d.shouldForceLogin&&d.redirectUrl)return window.location.href=d.redirectUrl,!0;e&&await e(),F({isInitializing:!1,newSelectedCountryCode:n});const l={address1:"",address2:"",city:"",countryCode:n,firstName:"",lastName:"",phone:"",postalCode:"",stateOrProvince:""};return i({address1:l.address1,address2:l.address2,city:l.city,countryCode:l.countryCode,firstName:l.firstName,lastName:l.lastName,phone:l.phone,postalCode:l.postalCode,state:l.stateOrProvince}),window.location.href=Io("/"),!0};let r=!1,a=!1,d=!1,l=!1,u=!1;const h=new MutationObserver((async()=>{var m;const p=document.querySelector(o),g=n();if(!p&&g){const o=document.createElement("button");return o.style.display="none",o.id="zonos--domestic-redirected-checkout-button",document.body.appendChild(o),null==s||s(g),void h.disconnect()}if(!window.location.pathname.includes("/checkout")||!window.Zonos.isBigCommerce)return void h.disconnect();if(!l&&!d){d=!0,u=!0;try{const o=await(async({onInternationalCheckoutSelected:o,onLoggedInInternationalAddressDetected:e})=>{var t,s,n,c,r,a,d,l,u,h;const m=await To();if(!m)return"noAction";const p=await Ao(m),g={checkout:p,checkoutId:m},{shouldBypass:f}=await Po({preFetched:g});if(f)return"noAction";const w=null===(s=null===(t=null==p?void 0:p.consignments)||void 0===t?void 0:t[0])||void 0===s?void 0:s.shippingAddress;if(!(null==w?void 0:w.countryCode))return"noAction";const z=w.countryCode;if(!Mo(!1,z))return"noAction";if(ao(e?`Logged-in user has international shipping address: ${z}, prompting user to choose checkout`:`Logged-in user has international shipping address: ${z}, redirecting automatically (legacy behavior)`,"info"),e&&"stay"===await e())return ao("User opted to stay on BigCommerce native checkout despite international default address","info"),"optedOut";const k=await jo({preFetched:g});return k.shouldForceLogin&&k.redirectUrl?(window.location.href=k.redirectUrl,"redirected"):(o&&await o(),F({isInitializing:!1,newSelectedCountryCode:z}),i({address1:null!==(n=w.address1)&&void 0!==n?n:"",address2:null!==(c=w.address2)&&void 0!==c?c:"",city:null!==(r=w.city)&&void 0!==r?r:"",countryCode:z,firstName:null!==(a=w.firstName)&&void 0!==a?a:"",lastName:null!==(d=w.lastName)&&void 0!==d?d:"",phone:null!==(l=w.phone)&&void 0!==l?l:"",postalCode:null!==(u=w.postalCode)&&void 0!==u?u:"",state:null!==(h=w.stateOrProvince)&&void 0!==h?h:""}),window.location.href=Io("/"),"redirected")})({onInternationalCheckoutSelected:e,onLoggedInInternationalAddressDetected:t});if("redirected"===o)return void h.disconnect();"optedOut"===o&&(l=!0)}catch(o){eo("Error checking logged-in user shipping address",o)}finally{d=!1,u=!1}}const f=document.querySelector((null===(m=Q.genericSettings)||void 0===m?void 0:m.bigcommerceDomesticCheckoutCountrySelector)||Ho);if(!f)return;if(ao("Domestic checkout found - Listening for shipping country change","info",{value:f.value}),a)return;a=!0,h.disconnect();const w=setInterval((async()=>{if(!r&&!u){r=!0;try{if(await c())return void clearInterval(w);r=!1}catch(o){r=!1}}}),1e3),z=setInterval((()=>{var o;if(!window.bcStripeElements)return void clearInterval(z);const e=null===(o=window.bcStripeElements)||void 0===o?void 0:o.getElement("address");e&&(clearInterval(z),e.on("change",(o=>{const e=o.value.address.country;e&&!u&&c(e)})))}),500)}));h.observe(document.body,{childList:!0,subtree:!0})})({domesticRedirectedBtnSelector:go,onInternationalCheckoutSelected:async()=>{this.detectedDomesticCheckoutDialogOpen=!0,await new Promise((o=>setTimeout(o,2e3)))},onLoggedInInternationalAddressDetected:()=>new Promise((o=>{this.loggedInIntlAddressResolver=o,this.loggedInIntlAddressConfirmDialogOpen=!0})),onShippingAddressSessionFound:o=>{this.defaultAddress=[{address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:`${o.firstName} ${o.lastName}`,phone:o.phone}]}}),window.Zonos&&this.useLegacyQueryParams();const o=setInterval((()=>{c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,this.stripe?(this.storybookPaymentStatusOverride||(ao("init checkout"),this.preview||this.forceDialogOpen?this.buildCartAndInit():window.Zonos.isLegacyCheckout?this.attachCheckout():window&&(this.attachCheckout(),new MutationObserver((()=>{this.attachCheckout()})).observe(document.body,{childList:!0,subtree:!0}))),clearInterval(o)):ao("waiting for stripe to be loaded")}),50);setTimeout((()=>{clearInterval(o)}),1e4)}handleBigcommerceInternationalResumeFlag(){if(!window.Zonos.isBigCommerce)return;const o=new URL(window.location.href);if("true"!==o.searchParams.get(So))return;o.searchParams.delete(So),window.history.replaceState({},"",o.toString());const e=Date.now(),t=setInterval((()=>{if(!R.localizationLoaded||!R.selectedCountryCode)return void(Date.now()-e>15e3&&(clearInterval(t),ao("BigCommerce international checkout resume flag: localization did not initialize within 15s","info")));const o=document.querySelector(`#${po}`);if(o)return clearInterval(t),void o.dispatchEvent(zo("click"));Date.now()-e>15e3&&(clearInterval(t),ao("BigCommerce international checkout resume flag: trigger button did not mount within 15s","info"))}),200)}async setToFinishStep(o){d.step="finish",this.storybookPaymentStatusOverride=o}async mockCheckoutSession(o){y(o)}async triggerCheckoutInternational(){const o=document.querySelector(`#${po}`);o&&o.dispatchEvent(zo("click"))}async handleCustomerInfoContinue(){var o,e,t,s;Co({event:"zonos-checkout-customer-info",metadata:{checkoutSessionId:H.checkoutSessionId}}),w({checkoutSessionId:H.checkoutSessionId,eventName:"checkout_customerInfoCompleted"}),this.submitLoading=!0;const{isRequestNotReady:n}=await C();n&&"stripe"===d.addressFormRenderType&&no({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:null===(e=null===(o=c.stripeAddressEventData)||void 0===o?void 0:o.value)||void 0===e?void 0:e.address,billingAddress:null===(s=null===(t=c.stripeBillingAddressEventData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.address,cartId:window.Zonos.cartId}});const i=o=>{"customer-info"===d.step?c.isFetchingLandedCost||(d.landedCostData&&(j({currency:d.currency}),b()),this.submitLoading=!1,o&&clearInterval(o)):clearInterval(o)};i();const r=setInterval((()=>{i(r)}),20);setTimeout((()=>{clearInterval(r)}),1e4)}async handleShippingContinue(){b()}handleInventoryCheckDialogConfirm(){d.inventoryCheckErrorMessage=null,this.isLegacyCheckout||this.closeDialogHandler({confirmed:!0})}handleCartExpiredDialogConfirm(){var o;if(this.isCartExpired=!1,this.isLegacyCheckout){const e=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}window.parent&&(window.parent.location.href=window.location.href),window.location.reload()}async handleStripePaymentContinue(){if("USD"!==c.checkoutSettlementCurrency||!c.shouldRenderPayInUsdButton||this.payInUsdConfirmDialogOpen){if(this.payInUsdConfirmDialogOpen=!1,N.paypalErrorMessage=null,c.hasPaymentError=!1,this.submitLoading=!0,d.inventoryCheckErrorMessage=null,!await S())return c.hasPaymentError=!0,c.customErrorMessage=V("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:c.checkoutSettlementCurrency}),void(this.submitLoading=!1);try{d.inventoryCheckErrorMessage=await x()}catch(o){d.inventoryCheckErrorMessage=V("Unable to check inventory. Please try again.")}if(d.inventoryCheckErrorMessage)this.submitLoading=!1;else{if(U()>0){const o=await I();if(!o.success)return c.hasPaymentError=!0,c.customErrorMessage=o.error||V("Unable to apply store credit. Please try again."),void(this.submitLoading=!1)}if(T()){try{const o=await A();if(!o.valid)return c.hasPaymentError=!0,c.customErrorMessage=o.errorMessage,void(this.submitLoading=!1);const e=await O();if(!e.success)return c.hasPaymentError=!0,c.customErrorMessage=e.error||V("Unable to place order with store credit. Please try again."),void(this.submitLoading=!1);b(),m()}catch(o){eo(o),Co({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:H.checkoutSessionId}}),c.hasPaymentError=!0}this.submitLoading=!1}else{try{await _(),b(),m()}catch(o){eo(o),Co({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:H.checkoutSessionId}}),c.hasPaymentError=!0,c.shouldInventoryRefund&&(L(),c.shouldInventoryRefund=!1)}this.submitLoading=!1}}}else this.payInUsdConfirmDialogOpen=!0}async handleFinishClick(){if(P(),this.preview)return d.step="customer-info",void await this.init();if(u(),window.Zonos.isLegacyCheckout&&window.Zonos.cartData){const o=window.Zonos.cartData.storeBaseUrl||Q.onlineStoreSettings.url;return window.parent&&(window.parent.location.href=o),void(window.location.href=o)}const o=window.location.href.split("?")[0];this.open=!1,window.location.hostname.includes("dashboard.zonos.com")||(window.history.replaceState(window.history.state,document.title,o),window.location.reload())}handleWindowResize(){this.isMobile=co(this.mobile),this.applyStripeTheme(),ao(`mobile: ${this.isMobile}`)}handleMobileChange(){this.isMobile=co(this.mobile),this.applyStripeTheme(),ao(`mobile: ${this.isMobile}`)}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=Y(this.appearanceSettingsOverride.theme))}handleAddressChange(){P()}handleCustomerProfileChange(){var o,e;if(!this.customerProfile)return ao("No customer profile","info"),void(this.defaultCustomerProfileAddress=[]);ao("Customer profile found","info",{customerProfile:this.customerProfile}),this.defaultCustomerProfileAddress=(null===(e=null===(o=c.customerProfile)||void 0===o?void 0:o.locations)||void 0===e?void 0:e.map((o=>{var e;return{address:{city:o.locality,country:o.countryCode,line1:o.line1,line2:o.line2||"",postal_code:o.postalCode,state:o.administrativeArea},email:o.email||(null===(e=c.customerProfile)||void 0===e?void 0:e.email)||"",name:o.name||"",phone:o.phone||""}})))||[]}handleClientSecretChange(){ao("==== Client secret changed","info",{clientSecret:this.clientSecret,stripeCustomerSessionClientSecret:this.stripeCustomerSessionClientSecret}),this.applyStripeTheme()}handleOpenChange(){const o="data-zonos-overflow-origin",e=document.body,t=document.documentElement;if(this.open)window.Zonos.openHelloDialog(!1),e.style.overflow&&e.setAttribute(o,e.style.overflow),e.style.overflow="hidden",t.style.overflow&&t.setAttribute(o,t.style.overflow),t.style.overflow="hidden";else{this.stripeCustomerSessionClientSecret=null;const s=e.getAttribute(o),n=t.getAttribute(o);s?(e.removeAttribute(o),e.style.overflow=s):e.style.removeProperty("overflow"),n?(t.removeAttribute(o),t.style.overflow=n):t.style.removeProperty("overflow")}}componentWillLoad(){this.init(),this.isMobile=co(this.mobile),this.isIframed=window.self!==window.top,ao(`iframed: ${this.isIframed}`),window.Zonos.isLegacyCheckout&&this.captureParamsRedirectedForVariantTest(),this.handleAppearanceSettingsOverrideChange(),this.storeUnsubscribeList=[G("selectedLocale",(()=>{this.applyStripeTheme()})),B("selectedShippingOption",(()=>{var o,e,t,s;const n=d.selectedShippingOption;(null===(o=Q.genericSettings)||void 0===o?void 0:o.shouldFedExShippingConsentForCanadianShopper)&&(null===(t=null===(e=null==n?void 0:n.shippingProfile)||void 0===e?void 0:e.serviceLevel.code)||void 0===t?void 0:t.toLowerCase().startsWith("fedex."))&&"CA"===(null===(s=c.stripeAddressEventData)||void 0===s?void 0:s.value.address.country)&&(this.shouldShowFedexShippingConsentDialog=!0)})),E("stripeAddressEventData",(o=>{var e;if(!window.Zonos.isBigCommerce||!o||this.redirectToDomesticCheckoutDialogOpen||!(null===(e=Q.genericSettings)||void 0===e?void 0:e.isBigcommerceDomesticCheckoutRedirectEnabled)||"USD"!==Q.sourceCurrency)return;if(!this.open)return;if(window.location.pathname.includes("/checkout"))return;const t=o.value.address.country;t&&Q.disabledCountries.includes(t)&&(this.redirectToDomesticCheckoutDialogOpen=!0,ao(`Domestic country ${t} selected in international checkout, redirecting to BigCommerce domestic checkout`,"info"),setTimeout((()=>{window.location.href=Io("/checkout")}),2e3))}))],this.initializeTestKeys(),window.addEventListener("message",this.handleHostedOpenWindowCallback),ao(`mobile: ${this.isMobile}`)}disconnectedCallback(){P(),u(),this.storeUnsubscribeList.forEach((o=>o())),window.removeEventListener("message",this.handleHostedOpenWindowCallback)}render(){var o,n,i,r;this.customerProfile=c.customerProfile,this.clientSecret=c.clientSecret,c.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret);const a="finish"!==d.step&&"error"!==d.step&&!c.stripeElements||c.isFetchingSession,{colorPrimary:l,colorSecondary:u,logoUrl:h,style:m}=q(Q.appearance,this.appearanceSettingsOverride||null),p="ENABLED"===Q.appearance.zonosAttribution,g=Q.appearance.theme,f=l&&vo(l)?"DARK":"LIGHT",w=this.isMobile?g:f,z=this.isMobile?void 0:u,{customMessages:k}=R,v=null===(o=k.find((o=>"checkout_default"===o.pageName)))||void 0===o?void 0:o.message,y=this.getCurrentLocalePageEnum(),C=k.filter((o=>o.pageName===y)),b=this.getBaseCurrencySettlementInfo(),S=()=>{const o=this.preview?`${h}?timestamp=${Date.now()}`:h;return e("div",{class:"zonos--logo"},o&&e("img",{alt:`${Q.organizationName} logo`,src:o}))},x=oo(),I=()=>{const o=new URLSearchParams(window.location.search),t=o.get("zonosQaUrl"),s=o.get("zonosDebug"),n=o.get("zonosE2ETest"),i=this.overrideStagingMode||io();return e("zonos-v-stack",null,e("div",{class:"zonos--logo-wrapper"},S(),x&&e("zonos-badge",{badgeColor:"orange",size:"small"},V("Test mode")),i&&e("zonos-badge",{badgeColor:"red",size:"small"},V("Staging mode")),"1"===s&&e("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&e("zonos-badge",{badgeColor:"purple",size:"small"},t),n&&e("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),e("zonos-checkout-progress-tabs",{backgroundColor:this.isMobile?"--zonos-elements-gray-0":null}),C.map((o=>e("zonos-custom-message",{icon:Go,message:o.message}))))},T=()=>d.checkoutSessionTimeoutShow?e("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:V("Your checkout session has expired. Please reload the page to continue."),restStateTitle:V("Session timed out"),restStateType:"Warning"},e("zonos-button",{onClick:()=>this.reloadCheckoutSession(),variant:"primary"},V("Reload"))):e("div",{class:"zonos--content",style:{"--zonos--border-radius":ko({overrideBorderStyle:m})}},"finish"!==d.step&&"error"!==d.step&&e(t,null,e("div",{class:"zonos--left","data-theme":w,style:yo({"--zonos--primary-color":this.isMobile?void 0:l})},!this.isMobile&&I(),"customer-info"===d.step&&e("zonos-customer-info",{continueLoading:this.submitLoading,defaultAddress:this.getDefaultAddress(),isMobile:this.isMobile,onContinueClicked:()=>this.handleCustomerInfoContinue(),submitBtnColor:z}),"shipping"===d.step&&e("zonos-shipping",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:()=>this.handleShippingContinue(),submitBtnColor:z}),"payment"===d.step&&e("zonos-checkout-payment",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:async()=>{await this.handleStripePaymentContinue()},submitBtnColor:z})),e("div",{class:"zonos--right","data-theme":g},this.isMobile&&I(),e("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&e("zonos-currency-toggle",null),!this.isLegacyCheckout&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:bo}),noBackground:!0,onClick:()=>this.closeDialogHandler()})),e("div",{class:"flex--wrapper"},e("div",{class:"zonos--wrapper"},e("zonos-review",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onClick:()=>{this.isMobile&&(this.collapseReviewMobile=!this.collapseReviewMobile)}}),e("zonos-collapse",{collapsed:this.collapseReviewMobile&&this.isMobile},e("zonos-cart-items",null),this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",{submitBtnColor:z}),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Go,message:v})))),e("zonos-cart-restricted-items",null),!this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",null),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Go,message:v}))))),("finish"===d.step||"error"===d.step)&&e("div",{class:"zonos--done","data-theme":g},e("div",{class:"zonos--header"},S(),!this.isRedirectAfterOrder&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:bo}),noBackground:!0,onClick:()=>this.handleFinishClick(),theme:g})),e("zonos-checkout-finish",{borderRadius:m,onCloseClick:()=>this.handleFinishClick(),overrideNotification:"error"===d.step&&d.error?Object.assign(Object.assign({},d.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),e("zonos-checkout-footer",{"data-theme":g,mobile:this.isMobile,slot:this.isMobile?void 0:"dialog-footer"}));return e(s,{class:wo(["zonos--checkout zonos--elements","payment"===d.step&&"zonos--processing-payment",p&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?T():e("zonos-dialog",{borderStyle:m,class:"zonos--checkout-dialog","data-theme":g,height:"980px",isLoading:a,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeDialogHandler(),open:this.open,width:"1200px"},T()),e("zonos-dialog",{isLoading:!0,loadingText:V("You will be redirected to international checkout shortly."),loadingTitle:V("We detected that you are shipping to an international address."),noClickOutside:!0,noCloseButton:!0,open:this.detectedDomesticCheckoutDialogOpen,width:"450px"}),e("zonos-dialog",{isLoading:!0,loadingText:V("You will be redirected to domestic checkout shortly."),loadingTitle:V("We detected that you are shipping to a domestic address."),noClickOutside:!0,noCloseButton:!0,open:this.redirectToDomesticCheckoutDialogOpen,width:"450px"}),e("zonos-confirm-dialog",{class:"zonos--logged-in-intl-address-dialog",dialogCancelBtnText:V("Stay on this page"),dialogConfirmBtnText:V("Continue to international checkout"),dialogIntent:"info",dialogOpen:this.loggedInIntlAddressConfirmDialogOpen,dialogSubtitle:V("Your saved default address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?"),dialogTitle:V("International shipping address detected"),dialogWidth:480,onCancelClicked:()=>{var o;this.loggedInIntlAddressConfirmDialogOpen=!1,null===(o=this.loggedInIntlAddressResolver)||void 0===o||o.call(this,"stay"),this.loggedInIntlAddressResolver=null},onConfirmClicked:()=>{var o;this.loggedInIntlAddressConfirmDialogOpen=!1,null===(o=this.loggedInIntlAddressResolver)||void 0===o||o.call(this,"redirect"),this.loggedInIntlAddressResolver=null}}),e("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:V("Don't close"),dialogConfirmBtnText:V("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:V("Would you like to close checkout and return to the site?"),dialogTitle:V("Are you sure?"),onCancelClicked:()=>{this.confirmDialogOpen=!1},onConfirmClicked:()=>this.closeDialogHandler({confirmed:!0})}),e("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:V("Return to merchant site"),dialogConfirmBtnText:V("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:(null===(n=this.placedOrderInfo)||void 0===n?void 0:n.zonosOrderNumber)?V("It looks like you placed an order recently ([date] at [time]) under order number #[orderNumber]. Check your email for the order confirmation. Are you sure you want to place another order?",{date:this.formatDate(this.placedOrderInfo.time),orderNumber:this.placedOrderInfo.zonosOrderNumber,time:this.formatTime(this.placedOrderInfo.time)}):V("It looks like you placed an order recently ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate((null===(i=this.placedOrderInfo)||void 0===i?void 0:i.time)||null),time:this.formatTime((null===(r=this.placedOrderInfo)||void 0===r?void 0:r.time)||null)}),dialogTitle:V("Are you sure?"),dialogWidth:530,onCancelClicked:()=>{this.handleCancelOrderDuplication()},onConfirmClicked:()=>{this.confirmProceedWithOrderDuplication()}}),e("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:V("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:e(t,null,V("If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request."),e("zonos-link",{href:"https://ftn.fedex.com/us/assets/docs/One-Time_GAA.pdf",target:"_blank"},V("View GAA Form."))),dialogTitle:V("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:()=>this.shouldShowFedexShippingConsentDialog=!1}),e("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:V("Return to cart"),dialogIntent:"danger",dialogOpen:!!d.inventoryCheckErrorMessage,dialogSubtitle:d.inventoryCheckErrorMessage,dialogTitle:V("Couldn't place order"),dialogType:"alert",onConfirmClicked:()=>this.handleInventoryCheckDialogConfirm()}),b&&e("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:V("Cancel"),dialogConfirmBtnText:V("Pay [orderTotal]",{orderTotal:W({amount:b.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:V("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:V("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),e("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:V("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:V("You are being sent back to the shop to re-add items to your cart."),dialogTitle:V("Shopping cart expired"),dialogType:"alert",onConfirmClicked:()=>this.handleCartExpiredDialogConfirm()}),e("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}static get watchers(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],overrideStagingMode:["overrideStagingModeChanged"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"],customerProfile:["handleCustomerProfileChange"],clientSecret:["handleClientSecretChange"],stripeCustomerSessionClientSecret:["handleClientSecretChange"],open:["handleOpenChange"]}}};Wo.style=".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}";export{Wo as zonos_checkout}