@zonos/elements 1.3.233 → 1.3.234

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 (413) hide show
  1. package/dist/cjs/{cart-bc615014.js → cart-22ced7cc.js} +33 -29
  2. package/dist/cjs/{shouldRenderTaxIdInput-9b8a8de1.js → containsNonLatinChars-2be5129b.js} +0 -23
  3. package/dist/cjs/{hasInclusivePrice-84145546.js → hasInclusivePrice-ca85cabd.js} +1 -1
  4. package/dist/cjs/index.cjs.js +11 -7
  5. package/dist/cjs/invoice-8fd4242c.js +151 -0
  6. package/dist/cjs/{renderFallback-c2576fbe.js → isCollectMobileTablet-7962c57f.js} +2 -11
  7. package/dist/cjs/isInvoiceMobileTablet-dde41e4e.js +15 -0
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{translationStore-08d3ff9c.js → localization-8ef6250a.js} +1059 -1
  10. package/dist/cjs/{paypal-1d6f1a71.js → paypal-4a086f84.js} +7 -8
  11. package/dist/cjs/placeTestOrder-f25d08ee.js +45 -0
  12. package/dist/cjs/{placeTestOrder-a5469e40.js → renderCheckoutCurrency-5494e45b.js} +2 -42
  13. package/dist/cjs/renderFallback-78b54537.js +12 -0
  14. package/dist/cjs/shouldRenderTaxIdInput-eda13ef8.js +25 -0
  15. package/dist/cjs/throttle-7dd64984.js +76 -0
  16. package/dist/cjs/{zonos-address_11.cjs.entry.js → zonos-address-display_9.cjs.entry.js} +62 -668
  17. package/dist/cjs/zonos-address_4.cjs.entry.js +715 -0
  18. package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
  19. package/dist/cjs/{zonos-banner_2.cjs.entry.js → zonos-banner.cjs.entry.js} +0 -40
  20. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  21. package/dist/cjs/{zonos-empty-state-payment_4.cjs.entry.js → zonos-card_5.cjs.entry.js} +44 -6
  22. package/dist/cjs/{zonos-cart-items_13.cjs.entry.js → zonos-cart-items_12.cjs.entry.js} +75 -92
  23. package/dist/cjs/zonos-checkout.cjs.entry.js +20 -21
  24. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
  25. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +5 -6
  26. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +66 -65
  27. package/dist/cjs/zonos-collect.cjs.entry.js +25 -25
  28. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  29. package/dist/cjs/zonos-controller.cjs.entry.js +39 -10
  30. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -2
  31. package/dist/cjs/zonos-country-select_4.cjs.entry.js +10 -11
  32. package/dist/cjs/zonos-elements.cjs.js +1 -1
  33. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +30 -31
  34. package/dist/cjs/zonos-hello.cjs.entry.js +7 -8
  35. package/dist/cjs/zonos-input.cjs.entry.js +4 -4
  36. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +94 -0
  37. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +686 -0
  38. package/dist/cjs/zonos-invoice.cjs.entry.js +466 -0
  39. package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -6
  40. package/dist/cjs/zonos-link.cjs.entry.js +24 -0
  41. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  42. package/dist/cjs/zonos-stripe-input.cjs.entry.js +5 -5
  43. package/dist/cjs/zonos-toggle.cjs.entry.js +2 -2
  44. package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
  45. package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
  46. package/dist/collection/collection-manifest.json +8 -0
  47. package/dist/collection/components/checkout/zonos-invoice/assets/ChevronDownIcon.svg +1 -0
  48. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/assets/empty-item.jpeg +0 -0
  49. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.css +72 -0
  50. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.js +87 -0
  51. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/assets/RemoveIcon.svg +1 -0
  52. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/assets/SuccessIcon.svg +1 -0
  53. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.css +90 -0
  54. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +405 -0
  55. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/chevronDownIcon.svg +1 -0
  56. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/globe.svg +3 -0
  57. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/zonosIconDark.svg +10 -0
  58. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/zonosIconLight.svg +10 -0
  59. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/assets/zonosWordmark.svg +7 -0
  60. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.css +155 -0
  61. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.js +165 -0
  62. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-order-details/assets/ChevronDownIcon.svg +1 -0
  63. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-order-details/assets/ChevronUpIcon.svg +1 -0
  64. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-order-details/zonos-invoice-order-details.css +117 -0
  65. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-order-details/zonos-invoice-order-details.js +175 -0
  66. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/assets/CheckmarkLineIcon.svg +1 -0
  67. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/assets/RemoveLineIcon.svg +1 -0
  68. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.css +98 -0
  69. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +368 -0
  70. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.css +71 -0
  71. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.js +151 -0
  72. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.css +83 -0
  73. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.js +65 -0
  74. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice.css +350 -0
  75. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice.js +545 -0
  76. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  77. package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
  78. package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
  79. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
  80. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
  81. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  82. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
  83. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +3 -3
  84. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  85. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  86. package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.js +2 -2
  87. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  88. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  89. package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
  90. package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +1 -1
  91. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  92. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
  93. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  94. package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.js +1 -1
  95. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +5 -5
  96. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +5 -5
  97. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +5 -5
  98. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
  99. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  100. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  101. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
  102. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  103. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  104. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  105. package/dist/collection/components/main/zonos-controller.js +45 -4
  106. package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
  107. package/dist/collection/components/store/checkout/invoice.js +148 -0
  108. package/dist/collection/components/store/checkout/stripe.js +8 -3
  109. package/dist/collection/components/store/translationStore/strings.arabic.js +9 -0
  110. package/dist/collection/components/store/translationStore/strings.base.js +9 -0
  111. package/dist/collection/components/store/translationStore/strings.chinese.js +9 -0
  112. package/dist/collection/components/store/translationStore/strings.danish.js +9 -0
  113. package/dist/collection/components/store/translationStore/strings.dutch.js +9 -0
  114. package/dist/collection/components/store/translationStore/strings.french.js +9 -0
  115. package/dist/collection/components/store/translationStore/strings.german.js +9 -0
  116. package/dist/collection/components/store/translationStore/strings.hebrew.js +9 -0
  117. package/dist/collection/components/store/translationStore/strings.indonesian.js +9 -0
  118. package/dist/collection/components/store/translationStore/strings.italian.js +9 -0
  119. package/dist/collection/components/store/translationStore/strings.japanese.js +9 -0
  120. package/dist/collection/components/store/translationStore/strings.korean.js +9 -0
  121. package/dist/collection/components/store/translationStore/strings.norwegian.js +9 -0
  122. package/dist/collection/components/store/translationStore/strings.polish.js +9 -0
  123. package/dist/collection/components/store/translationStore/strings.portuguese.js +9 -0
  124. package/dist/collection/components/store/translationStore/strings.russian.js +9 -0
  125. package/dist/collection/components/store/translationStore/strings.spanish.js +9 -0
  126. package/dist/collection/components/store/translationStore/strings.swedish.js +9 -0
  127. package/dist/collection/components/store/translationStore/strings.turkish.js +9 -0
  128. package/dist/collection/components/store/translationStore/strings.vietnamese.js +9 -0
  129. package/dist/collection/components/stripe/zonos-address/zonos-address.js +8 -5
  130. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -2
  131. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
  132. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  133. package/dist/collection/components/utils/checkout/initInvoice.js +15 -0
  134. package/dist/collection/components/utils/checkout/isInvoiceMobileTablet.js +10 -0
  135. package/dist/collection/scripts/_zonosBase.js +4 -0
  136. package/dist/esm/{cart-14f305b3.js → cart-66aecbb3.js} +9 -5
  137. package/dist/esm/{shouldRenderTaxIdInput-8bc112bb.js → containsNonLatinChars-2d8810c3.js} +1 -23
  138. package/dist/esm/{hasInclusivePrice-0eda8ba9.js → hasInclusivePrice-2a1bf474.js} +1 -1
  139. package/dist/esm/index.js +11 -7
  140. package/dist/esm/invoice-c7452847.js +146 -0
  141. package/dist/esm/{renderFallback-dbf1e3ae.js → isCollectMobileTablet-921002b0.js} +3 -11
  142. package/dist/esm/isInvoiceMobileTablet-1f7b614e.js +12 -0
  143. package/dist/esm/loader.js +1 -1
  144. package/dist/esm/{translationStore-690c4e04.js → localization-04b05867.js} +1041 -2
  145. package/dist/esm/{paypal-fded8844.js → paypal-56564874.js} +2 -3
  146. package/dist/esm/placeTestOrder-6b9eda9e.js +43 -0
  147. package/dist/esm/{placeTestOrder-2250f719.js → renderCheckoutCurrency-cb808110.js} +3 -42
  148. package/dist/esm/renderFallback-3f010b48.js +10 -0
  149. package/dist/esm/shouldRenderTaxIdInput-d45ceeb4.js +23 -0
  150. package/dist/esm/throttle-ce2432ab.js +74 -0
  151. package/dist/esm/{zonos-address_11.entry.js → zonos-address-display_9.entry.js} +32 -636
  152. package/dist/esm/zonos-address_4.entry.js +708 -0
  153. package/dist/esm/zonos-badge.entry.js +3 -3
  154. package/dist/esm/{zonos-banner_2.entry.js → zonos-banner.entry.js} +1 -40
  155. package/dist/esm/zonos-button_3.entry.js +3 -3
  156. package/dist/esm/{zonos-empty-state-payment_4.entry.js → zonos-card_5.entry.js} +44 -7
  157. package/dist/esm/{zonos-cart-items_13.entry.js → zonos-cart-items_12.entry.js} +15 -31
  158. package/dist/esm/zonos-checkout.entry.js +3 -4
  159. package/dist/esm/zonos-collapse.entry.js +2 -2
  160. package/dist/esm/zonos-collect-cart-items_3.entry.js +5 -6
  161. package/dist/esm/zonos-collect-finish_6.entry.js +7 -6
  162. package/dist/esm/zonos-collect.entry.js +5 -5
  163. package/dist/esm/zonos-component.entry.js +1 -1
  164. package/dist/esm/zonos-controller.entry.js +39 -10
  165. package/dist/esm/zonos-country-flag.entry.js +1 -2
  166. package/dist/esm/zonos-country-select_4.entry.js +10 -11
  167. package/dist/esm/zonos-elements.js +1 -1
  168. package/dist/esm/zonos-hello-dialog.entry.js +6 -7
  169. package/dist/esm/zonos-hello.entry.js +1 -2
  170. package/dist/esm/zonos-input.entry.js +4 -4
  171. package/dist/esm/zonos-invoice-cart-items_2.entry.js +89 -0
  172. package/dist/esm/zonos-invoice-finish_5.entry.js +678 -0
  173. package/dist/esm/zonos-invoice.entry.js +462 -0
  174. package/dist/esm/zonos-language-select_2.entry.js +5 -6
  175. package/dist/esm/zonos-link.entry.js +20 -0
  176. package/dist/esm/zonos-logo.entry.js +2 -2
  177. package/dist/esm/zonos-stripe-input.entry.js +5 -5
  178. package/dist/esm/zonos-toggle.entry.js +2 -2
  179. package/dist/esm/zonos-tooltip.entry.js +2 -2
  180. package/dist/esm/zonos-v-stack.entry.js +2 -2
  181. package/dist/esm-es5/cart-66aecbb3.js +1 -0
  182. package/dist/esm-es5/containsNonLatinChars-2d8810c3.js +1 -0
  183. package/dist/esm-es5/{hasInclusivePrice-0eda8ba9.js → hasInclusivePrice-2a1bf474.js} +1 -1
  184. package/dist/esm-es5/index.js +1 -1
  185. package/dist/esm-es5/invoice-c7452847.js +1 -0
  186. package/dist/esm-es5/isCollectMobileTablet-921002b0.js +1 -0
  187. package/dist/esm-es5/isInvoiceMobileTablet-1f7b614e.js +1 -0
  188. package/dist/esm-es5/loader.js +1 -1
  189. package/dist/esm-es5/localization-04b05867.js +1 -0
  190. package/dist/esm-es5/{paypal-fded8844.js → paypal-56564874.js} +1 -1
  191. package/dist/esm-es5/placeTestOrder-6b9eda9e.js +1 -0
  192. package/dist/esm-es5/renderCheckoutCurrency-cb808110.js +1 -0
  193. package/dist/esm-es5/renderFallback-3f010b48.js +1 -0
  194. package/dist/esm-es5/shouldRenderTaxIdInput-d45ceeb4.js +1 -0
  195. package/dist/esm-es5/throttle-ce2432ab.js +1 -0
  196. package/dist/esm-es5/zonos-address-display_9.entry.js +1 -0
  197. package/dist/esm-es5/zonos-address_4.entry.js +1 -0
  198. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  199. package/dist/esm-es5/zonos-banner.entry.js +1 -0
  200. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  201. package/dist/esm-es5/zonos-card_5.entry.js +1 -0
  202. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -0
  203. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  204. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  205. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  206. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  207. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  208. package/dist/esm-es5/zonos-component.entry.js +1 -1
  209. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  210. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  211. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  212. package/dist/esm-es5/zonos-elements.js +1 -1
  213. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  214. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  215. package/dist/esm-es5/zonos-input.entry.js +1 -1
  216. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -0
  217. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -0
  218. package/dist/esm-es5/zonos-invoice.entry.js +1 -0
  219. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  220. package/dist/esm-es5/zonos-link.entry.js +1 -0
  221. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  222. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  223. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  224. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  225. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  226. package/dist/scripts/index.d.ts +356 -0
  227. package/dist/scripts/index.js +1 -1
  228. package/dist/scripts/loadZonos.js +1 -1
  229. package/dist/scripts/zonos.js +1 -1
  230. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.d.ts +10 -0
  231. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.d.ts +50 -0
  232. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.d.ts +25 -0
  233. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-order-details/zonos-invoice-order-details.d.ts +28 -0
  234. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.d.ts +62 -0
  235. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.d.ts +22 -0
  236. package/dist/types/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.d.ts +7 -0
  237. package/dist/types/components/checkout/zonos-invoice/zonos-invoice.d.ts +86 -0
  238. package/dist/types/components/main/zonos-controller.d.ts +4 -0
  239. package/dist/types/components/store/checkout/invoice.d.ts +19 -0
  240. package/dist/types/components/store/translationStore/strings.arabic.d.ts +9 -0
  241. package/dist/types/components/store/translationStore/strings.base.d.ts +9 -0
  242. package/dist/types/components/store/translationStore/strings.chinese.d.ts +9 -0
  243. package/dist/types/components/store/translationStore/strings.danish.d.ts +9 -0
  244. package/dist/types/components/store/translationStore/strings.dutch.d.ts +9 -0
  245. package/dist/types/components/store/translationStore/strings.french.d.ts +9 -0
  246. package/dist/types/components/store/translationStore/strings.german.d.ts +9 -0
  247. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +9 -0
  248. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +9 -0
  249. package/dist/types/components/store/translationStore/strings.italian.d.ts +9 -0
  250. package/dist/types/components/store/translationStore/strings.japanese.d.ts +9 -0
  251. package/dist/types/components/store/translationStore/strings.korean.d.ts +9 -0
  252. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +9 -0
  253. package/dist/types/components/store/translationStore/strings.polish.d.ts +9 -0
  254. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +9 -0
  255. package/dist/types/components/store/translationStore/strings.russian.d.ts +9 -0
  256. package/dist/types/components/store/translationStore/strings.spanish.d.ts +9 -0
  257. package/dist/types/components/store/translationStore/strings.swedish.d.ts +9 -0
  258. package/dist/types/components/store/translationStore/strings.turkish.d.ts +9 -0
  259. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +9 -0
  260. package/dist/types/components/utils/checkout/initInvoice.d.ts +1 -0
  261. package/dist/types/components/utils/checkout/isInvoiceMobileTablet.d.ts +4 -0
  262. package/dist/types/components.d.ts +351 -0
  263. package/dist/types/scripts/_zonosBase.d.ts +5 -0
  264. package/dist/types/types/checkout/api/CheckoutSession.d.ts +4 -0
  265. package/dist/types/types/checkout/api/PartyInfo.d.ts +21 -0
  266. package/dist/zonos-elements/index.esm.js +1 -1
  267. package/dist/zonos-elements/p-00719e49.entry.js +1 -0
  268. package/dist/zonos-elements/p-01b0a2e2.js +1 -0
  269. package/dist/zonos-elements/p-01dada4e.js +1 -0
  270. package/dist/zonos-elements/p-0c64dbbb.js +1 -0
  271. package/dist/zonos-elements/p-0cd5bcb3.entry.js +1 -0
  272. package/dist/zonos-elements/p-0e82fcea.entry.js +1 -0
  273. package/dist/zonos-elements/p-10316d4d.system.entry.js +1 -0
  274. package/dist/zonos-elements/{p-0a90dd80.system.entry.js → p-121c60c1.system.entry.js} +1 -1
  275. package/dist/zonos-elements/{p-bf9d889f.entry.js → p-14314ad3.entry.js} +1 -1
  276. package/dist/zonos-elements/p-170314a3.js +1 -0
  277. package/dist/zonos-elements/p-17a09191.entry.js +1 -0
  278. package/dist/zonos-elements/p-18bc6c7a.entry.js +1 -0
  279. package/dist/zonos-elements/{p-a25428eb.system.js → p-18d20206.system.js} +2 -2
  280. package/dist/zonos-elements/p-1a30fe18.system.entry.js +1 -0
  281. package/dist/zonos-elements/{p-c7b658cb.entry.js → p-1c4d12f0.entry.js} +1 -1
  282. package/dist/zonos-elements/p-1f3549c6.js +1 -0
  283. package/dist/zonos-elements/p-2250e585.entry.js +1 -0
  284. package/dist/zonos-elements/p-248dd596.system.entry.js +1 -0
  285. package/dist/zonos-elements/{p-5f398c28.entry.js → p-264690d7.entry.js} +1 -1
  286. package/dist/zonos-elements/p-2670438c.system.js +1 -0
  287. package/dist/zonos-elements/p-27f6930b.js +1 -0
  288. package/dist/zonos-elements/{p-eea0eb57.system.entry.js → p-2f869f2c.system.entry.js} +1 -1
  289. package/dist/zonos-elements/p-30c661b3.system.entry.js +1 -0
  290. package/dist/zonos-elements/p-34bf7bbe.system.js +1 -0
  291. package/dist/zonos-elements/p-38913b2f.entry.js +1 -0
  292. package/dist/zonos-elements/p-3bec13dd.system.js +1 -0
  293. package/dist/zonos-elements/{p-00ec22b2.entry.js → p-43a22d85.entry.js} +1 -1
  294. package/dist/zonos-elements/p-44b50260.entry.js +1 -0
  295. package/dist/zonos-elements/p-48dc96f9.system.entry.js +1 -0
  296. package/dist/zonos-elements/p-4aa86184.system.entry.js +1 -0
  297. package/dist/zonos-elements/p-4d594c8e.system.js +1 -0
  298. package/dist/zonos-elements/p-4ffbb0d6.system.js +1 -0
  299. package/dist/zonos-elements/{p-452fb638.system.entry.js → p-5062dcf3.system.entry.js} +1 -1
  300. package/dist/zonos-elements/{p-c5cb2364.system.entry.js → p-57cee1b5.system.entry.js} +1 -1
  301. package/dist/zonos-elements/p-59a76f73.entry.js +1 -0
  302. package/dist/zonos-elements/{p-d556c6d1.system.entry.js → p-5afb9260.system.entry.js} +1 -1
  303. package/dist/zonos-elements/p-5e9b45f7.entry.js +1 -0
  304. package/dist/zonos-elements/{p-88ea9f82.entry.js → p-6626d240.entry.js} +1 -1
  305. package/dist/zonos-elements/p-6688473e.entry.js +1 -0
  306. package/dist/zonos-elements/p-6f23a26a.system.js +1 -0
  307. package/dist/zonos-elements/{p-82739127.js → p-73c737aa.js} +2 -2
  308. package/dist/zonos-elements/p-757d4c62.system.entry.js +1 -0
  309. package/dist/zonos-elements/p-7aa50ef2.entry.js +1 -0
  310. package/dist/zonos-elements/p-7e17667d.js +1 -0
  311. package/dist/zonos-elements/p-7e469c5c.entry.js +1 -0
  312. package/dist/zonos-elements/p-7f91617c.system.entry.js +1 -0
  313. package/dist/zonos-elements/p-81e3eb5b.js +1 -0
  314. package/dist/zonos-elements/p-82febf70.system.js +1 -0
  315. package/dist/zonos-elements/{p-770852bf.system.entry.js → p-836db369.system.entry.js} +1 -1
  316. package/dist/zonos-elements/p-83b3f824.system.entry.js +1 -0
  317. package/dist/zonos-elements/p-851011aa.system.entry.js +1 -0
  318. package/dist/zonos-elements/{p-936b54c1.entry.js → p-865536f0.entry.js} +1 -1
  319. package/dist/zonos-elements/{p-b1fd1ec2.system.entry.js → p-8792fef2.system.entry.js} +1 -1
  320. package/dist/zonos-elements/p-890bfc42.system.entry.js +1 -0
  321. package/dist/zonos-elements/{p-c288c6da.system.entry.js → p-89a5e936.system.entry.js} +1 -1
  322. package/dist/zonos-elements/p-8af188f8.system.js +1 -0
  323. package/dist/zonos-elements/p-8d3a62fb.entry.js +1 -0
  324. package/dist/zonos-elements/{p-00ac999f.system.entry.js → p-8dc025c7.system.entry.js} +1 -1
  325. package/dist/zonos-elements/p-944d00da.entry.js +1 -0
  326. package/dist/zonos-elements/p-9479f155.system.js +1 -0
  327. package/dist/zonos-elements/p-95dc475b.system.js +1 -0
  328. package/dist/zonos-elements/p-976afc17.system.js +1 -0
  329. package/dist/zonos-elements/p-97d56c21.system.entry.js +1 -0
  330. package/dist/zonos-elements/p-9b9bfb6d.entry.js +1 -0
  331. package/dist/zonos-elements/{p-55e2e4ed.entry.js → p-9f1bd9b8.entry.js} +1 -1
  332. package/dist/zonos-elements/p-9fa32fdf.js +1 -0
  333. package/dist/zonos-elements/p-a2a0bf4e.js +1 -0
  334. package/dist/zonos-elements/p-a610c24e.system.entry.js +1 -0
  335. package/dist/zonos-elements/{p-9b8750f3.entry.js → p-aedd3911.entry.js} +1 -1
  336. package/dist/zonos-elements/{p-db628e49.system.entry.js → p-b5c31ca4.system.entry.js} +1 -1
  337. package/dist/zonos-elements/p-ba456282.system.entry.js +1 -0
  338. package/dist/zonos-elements/{p-31af91f0.entry.js → p-bd603c1a.entry.js} +1 -1
  339. package/dist/zonos-elements/p-c2442878.system.js +1 -1
  340. package/dist/zonos-elements/p-dc5fb21c.js +1 -0
  341. package/dist/zonos-elements/p-dc94d7eb.js +1 -0
  342. package/dist/zonos-elements/p-e5e64e16.system.js +1 -0
  343. package/dist/zonos-elements/{p-540cec7e.system.entry.js → p-e9e6bea7.system.entry.js} +1 -1
  344. package/dist/zonos-elements/p-eb9ee025.system.js +1 -0
  345. package/dist/zonos-elements/p-ed8ae947.system.entry.js +1 -0
  346. package/dist/zonos-elements/p-f1d9dd4e.entry.js +1 -0
  347. package/dist/zonos-elements/p-f3962950.system.entry.js +1 -0
  348. package/dist/zonos-elements/p-f4e976ae.entry.js +1 -0
  349. package/dist/zonos-elements/p-f513b231.entry.js +1 -0
  350. package/dist/zonos-elements/p-f64207fa.system.entry.js +1 -0
  351. package/dist/zonos-elements/{p-31975752.entry.js → p-fa322dc1.entry.js} +1 -1
  352. package/dist/zonos-elements/p-fb9fb873.system.entry.js +1 -0
  353. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  354. package/package.json +1 -1
  355. package/dist/cjs/localization-39516612.js +0 -884
  356. package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +0 -168
  357. package/dist/esm/localization-c5029ffc.js +0 -863
  358. package/dist/esm/zonos-confirm-dialog_2.entry.js +0 -163
  359. package/dist/esm-es5/cart-14f305b3.js +0 -1
  360. package/dist/esm-es5/localization-c5029ffc.js +0 -1
  361. package/dist/esm-es5/placeTestOrder-2250f719.js +0 -1
  362. package/dist/esm-es5/renderFallback-dbf1e3ae.js +0 -1
  363. package/dist/esm-es5/shouldRenderTaxIdInput-8bc112bb.js +0 -1
  364. package/dist/esm-es5/translationStore-690c4e04.js +0 -1
  365. package/dist/esm-es5/zonos-address_11.entry.js +0 -1
  366. package/dist/esm-es5/zonos-banner_2.entry.js +0 -1
  367. package/dist/esm-es5/zonos-cart-items_13.entry.js +0 -1
  368. package/dist/esm-es5/zonos-confirm-dialog_2.entry.js +0 -1
  369. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +0 -1
  370. package/dist/zonos-elements/p-03ff7b01.system.entry.js +0 -1
  371. package/dist/zonos-elements/p-100f6a88.system.entry.js +0 -1
  372. package/dist/zonos-elements/p-143d706b.entry.js +0 -1
  373. package/dist/zonos-elements/p-14d7489d.js +0 -1
  374. package/dist/zonos-elements/p-1bfae137.entry.js +0 -1
  375. package/dist/zonos-elements/p-1d5aa016.system.js +0 -1
  376. package/dist/zonos-elements/p-1eae4987.entry.js +0 -1
  377. package/dist/zonos-elements/p-23b45714.system.entry.js +0 -1
  378. package/dist/zonos-elements/p-2557b96b.js +0 -1
  379. package/dist/zonos-elements/p-2ca8b037.entry.js +0 -1
  380. package/dist/zonos-elements/p-2dbcecf4.entry.js +0 -1
  381. package/dist/zonos-elements/p-316f9052.system.entry.js +0 -1
  382. package/dist/zonos-elements/p-3185968f.entry.js +0 -1
  383. package/dist/zonos-elements/p-4e41143a.system.entry.js +0 -1
  384. package/dist/zonos-elements/p-52b87408.system.entry.js +0 -1
  385. package/dist/zonos-elements/p-561be3a2.system.js +0 -1
  386. package/dist/zonos-elements/p-5c680f72.js +0 -1
  387. package/dist/zonos-elements/p-5f77d19e.js +0 -1
  388. package/dist/zonos-elements/p-74ca7739.entry.js +0 -1
  389. package/dist/zonos-elements/p-767a31a8.system.js +0 -1
  390. package/dist/zonos-elements/p-78a6e775.system.js +0 -1
  391. package/dist/zonos-elements/p-7c705c76.system.js +0 -1
  392. package/dist/zonos-elements/p-81ba2820.system.entry.js +0 -1
  393. package/dist/zonos-elements/p-84078c57.system.js +0 -1
  394. package/dist/zonos-elements/p-8a23bbf5.js +0 -1
  395. package/dist/zonos-elements/p-905d2490.entry.js +0 -1
  396. package/dist/zonos-elements/p-93f2e1ee.system.entry.js +0 -1
  397. package/dist/zonos-elements/p-a0a4e43d.system.entry.js +0 -1
  398. package/dist/zonos-elements/p-a2819807.system.entry.js +0 -1
  399. package/dist/zonos-elements/p-a6e74856.entry.js +0 -1
  400. package/dist/zonos-elements/p-ae940a99.js +0 -1
  401. package/dist/zonos-elements/p-b7ea5f4f.system.entry.js +0 -1
  402. package/dist/zonos-elements/p-c0c458f7.system.entry.js +0 -1
  403. package/dist/zonos-elements/p-c1ecab92.entry.js +0 -1
  404. package/dist/zonos-elements/p-c50cc926.entry.js +0 -1
  405. package/dist/zonos-elements/p-cf765af3.system.js +0 -1
  406. package/dist/zonos-elements/p-e03e1a62.entry.js +0 -1
  407. package/dist/zonos-elements/p-e7874318.system.entry.js +0 -1
  408. package/dist/zonos-elements/p-e8949e7e.entry.js +0 -1
  409. package/dist/zonos-elements/p-ea0b5d10.system.js +0 -1
  410. package/dist/zonos-elements/p-eae3462c.entry.js +0 -1
  411. package/dist/zonos-elements/p-eeb1081e.js +0 -1
  412. package/dist/zonos-elements/p-f892595d.system.entry.js +0 -1
  413. package/dist/zonos-elements/p-fd3b46ee.entry.js +0 -1
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,o,t,r){function n(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r["throw"](e))}catch(e){s(e)}}function c(e){e.done?t(e.value):n(e.value).then(i,a)}c((r=r.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(o){return c([e,o])}}function c(a){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,a[0]&&(t=0)),t)try{if(r=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;n=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(s=t.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){t.label=a[1];break}if(a[0]===6&&t.label<s[1]){t.label=s[1];s=a;break}if(s&&t.label<s[2]){t.label=s[2];t.ops.push(a);break}if(s[2])t.ops.pop();t.trys.pop();continue}a=o.call(e,t)}catch(e){a=[6,e];n=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var r=0,n=o.length,s;r<n;r++){if(s||!(r in o)){if(!s)s=Array.prototype.slice.call(o,0,r);s[r]=o[r]}}return e.concat(s||Array.prototype.slice.call(o))};import{r as registerInstance,h,F as Fragment,H as Host}from"./index-0bbe9693.js";import{s as stripeStoreGetDomesticShippingSession,a as stripeStoreCleanupDomesticShippingSession,b as stripeStoreSaveDomesticShippingSession,c as stripeStore,i as initStripeElements,d as stripeStoreRetrievePayment,e as cartStore,f as cartStoreUpdateItems,g as cartStoreReset,h as cartStoreResetTabItems,j as cartStoreClearCheckoutInterval,k as stripeStoreInitCheckoutSession,l as stripeStoreGetPaymentIntent,m as cartStoreStartCheckoutInterval,t as trackConversionEvent,n as getCheckoutSessionBody,o as cartStoreUpdateToErrorState,p as cartStoreSetCheckoutSession,q as stripeStorePrefetchLandedCost,r as cartStoreNextStep,u as stripeStoreUpdateCheckoutSessionBaseCurrency,v as stripeStoreHandleInventoryCheck,w as stripeStoreConfirmPayment,x as stripeStoreHandleInventoryRefund,y as stripeStoreReset,z as cartStoreOnChange}from"./cart-14f305b3.js";import{p as paypalStoreHasPaypalEnabled,s as submitGtag,a as paypalStore,b as paypalInitScript}from"./paypal-fded8844.js";import{f as filterValidTests,l as localizationStore,a as localizationStoreUpdateSelectedCountryCode,g as getZCountryUrlParam,s as storageStore,V as VARIANT_TEST_KEY_EXPIRATION,b as storageStoreSetEnabledVariantTestKeys,c as localizationStoreOnChange,d as currencyFormat}from"./localization-c5029ffc.js";import{t as translate}from"./translationStore-690c4e04.js";import{z as zonosStore,g as getZonosStoreTheme,m as mergeConfig}from"./zonosStore-b434e436.js";import{b as buildCartItemsByTempCart}from"./buildCartItemsByTempCart-a117f75d.js";import{h as handleFetch,l as logError,s as sendErrorLog,b as getAdditionalLogMetadata,g as getIsTestMode,j as jsonParse,a as getIsStagingMode,i as isCheckoutMobile}from"./handleFetch-a844cac1.js";import{u as updateCheckoutSessionAttributes}from"./updateCheckoutSessionAttributes-047a6cd4.js";import{_ as _getIsValidCartId,c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector,g as getAbandonedCartRenewTokenValue}from"./CheckoutConfig-724d7bae.js";import{l as log,g as getElapsedTime,b as allLogs}from"./VarianceTest-572cecf5.js";import{c as classes}from"./classes-0d95c529.js";import{c as createCustomEvent}from"./createCustomEvent-58159025.js";import{g as getBorderRadius}from"./getBorderRadius-877f6389.js";import{i as isDarkColor}from"./isDarkColor-9ddd90cc.js";import{s as styles}from"./styles-6fc2fad9.js";import{R as RemoveIcon}from"./RemoveIcon-9dc5dd1a.js";import"./debounce-c4785346.js";var isStoreDiscountEnabled=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,o,t;return __generator(this,(function(r){switch(r.label){case 0:return[4,handleFetch("/api/zonos-elements/get-store-discount-enabled-status")];case 1:e=r.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 selectVarianceTest=function(e){return __awaiter(void 0,[e],void 0,(function(e){var o,t,r,n;var s=e.testKeys;return __generator(this,(function(e){switch(e.label){case 0:if(s.length===0){return[2,null]}return[4,handleFetch("/api/zonos-elements/select-variance-test",{body:{testKeys:s},method:"POST"})];case 1:o=e.sent(),t=o.errors,r=o.json;if(t.length||!r){return[2,null]}n=filterValidTests(r);return[2,n]}}))}))};var buildCartUrl=function(e){var o=e.cartId,t=e.checkoutSessionId,r=e.customerAddress1,n=e.customerAddress2,s=e.customerCity,i=e.customerCountry,a=e.customerEmail,c=e.customerFirstName,u=e.customerLastName,d=e.customerPhone,l=e.customerState,h=e.customerZip,f=e.hostedCheckoutUrl,m=e.isTestMode,g=e.isVariantTest;var v=new URLSearchParams;v.set("tempCartUUID",o);if(c){v.set("customerFirstName",c)}if(u){v.set("customerLastName",u)}if(a){v.set("customerEmail",a)}if(d){v.set("customerPhone",d)}if(h){v.set("customerZip",h)}if(s){v.set("customerCity",s)}if(l){v.set("customerState",l)}if(i){v.set("zCountry",i)}if(r){v.set("customerAddress1",r)}if(n){v.set("customerAddress2",n)}if(m){v.set("zonosTestMode","1")}if(t){v.set("zonosCheckoutSessionId",t)}if(g){v.set("zonosVariantTest","1")}return"".concat(f,"?").concat(v.toString())};var isDisabledCountry=function(e){if(e===void 0){e=true}if(!localizationStore.localizationLoaded){return true}if(localizationStore.isDisabledCountry){if(e){log("Checkout: disabled country")}return true}return false};var isShippableCountry=function(e){if(e===void 0){e=true}if(!localizationStore.localizationLoaded){return false}if(!localizationStore.isShippableCountry){if(e){log("Checkout: not shippable country")}return false}return true};var watchBigcommerceDomesticCheckout=function(e){var o=e.domesticRedirectedBtnSelector,t=e.onShippingAddressSessionFound;if(!window.Zonos.isBigCommerce){return}var r=new MutationObserver((function(){return __awaiter(void 0,void 0,void 0,(function(){var e,n,s,i,a;return __generator(this,(function(c){e=document.querySelector(o);n=stripeStoreGetDomesticShippingSession();if(!e&&n){s=document.createElement("button");s.style.display="none";s.id="zonos--domestic-redirected-checkout-button";document.body.appendChild(s);t===null||t===void 0?void 0:t(n);r.disconnect();return[2]}i=document.querySelector('select[name="shippingAddress.countryCode"]');a=document.querySelector("#checkout-shipping-continue");if(!i||!a){return[2]}r.disconnect();a.addEventListener("click",(function(e){return __awaiter(void 0,void 0,void 0,(function(){var o,t,r,n,s,a,c;return __generator(this,(function(u){r=i.value;if(!r){return[2]}localizationStoreUpdateSelectedCountryCode({isInitializing:false,newSelectedCountryCode:r});if(!isShippableCountry(false)){stripeStoreCleanupDomesticShippingSession();return[2]}n=document.querySelector("form");if(!n){return[2]}s=new FormData(n);a=document.querySelector("input#addressLine1Input");c={address1:(o=s.get("shippingAddress.address1"))!==null&&o!==void 0?o:a&&a.value,address2:s.get("shippingAddress.address2"),city:s.get("shippingAddress.city"),countryCode:s.get("shippingAddress.countryCode"),firstName:s.get("shippingAddress.firstName"),lastName:s.get("shippingAddress.lastName"),phone:s.get("shippingAddress.phone"),postalCode:s.get("shippingAddress.postalCode"),stateOrProvince:(t=s.get("shippingAddress.stateOrProvince"))!==null&&t!==void 0?t:s.get("shippingAddress.stateOrProvinceCode")};if(Object.values(c).some((function(e){return e===undefined||e===null}))){logError("One or more shipping address field is missing",Object.entries(c));void sendErrorLog({endpoint:"No endpoint, domestic checkout form missing fields",errors:["Bigcommerce: One or more shipping address field is missing in the domestic checkout form",JSON.stringify(Object.entries(c))],metadata:{storeId:zonosStore.storeId}});return[2]}stripeStoreSaveDomesticShippingSession({address1:c.address1,address2:c.address2,city:c.city,countryCode:c.countryCode,firstName:c.firstName,lastName:c.lastName,phone:c.phone,postalCode:c.postalCode,state:c.stateOrProvince});e.preventDefault();e.stopPropagation();window.location.href="/";return[2]}))}))}));return[2]}))}))}));r.observe(document.body,{childList:true,subtree:true})};var getLegacyQueryParams=function(){var e=new URLSearchParams(window.location.search);log("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=getZCountryUrlParam(e)||localizationStore.selectedCountryCode||"US";var r=o("customerCity");var n=o("customerEmail");var s=o("customerAddress1");var i=o("customerAddress2");var a=o("customerName");var c=o("customerPhone");var u=o("customerZip");var d=o("customerState");var l=o("customerFirstName");var h=o("customerLastName");return{customerAddress1:s,customerAddress2:i,customerCity:r,customerCountry:t,customerEmail:n,customerFirstName:l,customerLastName:h,customerName:a,customerPhone:c,customerState:d,customerZip:u}};var numberOfFailures=0;var sendBulkLoadTimeApiLog=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,o;var t;return __generator(this,(function(r){switch(r.label){case 0:if(window.Zonos.loadTimeApiInfoList.length===0){return[2]}log("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,handleFetch("/api/zonos-elements/log-bulk-load-data",{body:e,method:"POST"})];case 1:o=r.sent().errors;if(o.length){(t=window.Zonos.loadTimeApiInfoList).push.apply(t,e.data);numberOfFailures++;if(numberOfFailures>5&&window.Zonos.logIntervalId){clearInterval(window.Zonos.logIntervalId)}}return[2]}}))}))};var sendLoadCheckoutFacadeLog=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){e=getElapsedTime().elapsedTime;o={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:e,metadata:Object.assign({allLogs:allLogs},getAdditionalLogMetadata()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};void handleFetch("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2]}))}))};var sendLoadNativeCheckoutLog=function(e){return __awaiter(void 0,[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:allLogs},getAdditionalLogMetadata()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};void handleFetch("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2]}))}))};var filterExpiredTests=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 getSelectedTestVariant=function(e){var o;var t=(o=storageStore.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 isTestEnabled=function(e){return zonosStore.enabledVariantTestKeys.includes(e)};var mergeTest=function(e){var o=e.baseTestObj,t=e.mergeTestObj;return o.map((function(e){var o=e.testKey;var r=t.find((function(e){var t=e.testKey;return t===o}));return{expiresAt:(r===null||r===void 0?void 0:r.expiresAt)||Date.now()+VARIANT_TEST_KEY_EXPIRATION,selectedVariantKey:(r===null||r===void 0?void 0:r.selectedVariantKey)||null,testKey:o}}))};var getTempCartById=function(e){return __awaiter(void 0,[e],void 0,(function(e){var o,t,r,n,s;var i=e.cartId,a=e.retries;return __generator(this,(function(e){switch(e.label){case 0:o=getIsTestMode();return[4,handleFetch("/api/zonos-elements/get-temp-cart",{body:{isTestMode:o,options:{noOnlineStoreSettings:true},tempCartUUID:i},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:t=e.sent(),r=t.errors,n=t.json;s=!n||r.length;if(!(s&&a))return[3,3];log("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:a});return[4,new Promise((function(e){return setTimeout(e,500)}))];case 2:e.sent();return[2,getTempCartById({cartId:i,retries:a-1})];case 3:if(s){return[2,null]}return[2,n]}}))}))};var setupCartData=function(e){return __awaiter(void 0,void 0,void 0,(function(){var o,t,r,n;return __generator(this,(function(s){switch(s.label){case 0:o=_getIsValidCartId(e),t=o.isDgsCartId,r=o.isLegacyCartId;if(!r&&!t){logError("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,getTempCartById({cartId:e,retries:5})];case 1:n=s.sent();log("[ZONOS - loadZonos] getting temp cart data","info",n);if(!n){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}window.Zonos.storeId=n.cartData.storeId;window.Zonos.zonosApiKey=n.cartData.credentialToken;return[2,{cartData:n.cartData,storeFavicon:n.storeFaviconUrl,storeId:n.cartData.storeId,storeLogo:n.storeLogoUrl,zonosApiKey:n.cartData.credentialToken}]}}))}))};var MessageIcon='<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 zonosCheckoutCss=".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 ZonosCheckoutStyle0=zonosCheckoutCss;var CHECKOUT_SESSION_TIMEOUT=90*60*1e3;var ORDER_DUPLICATION_NOTIFICATION_EXPIRATION=6*60*60*1e3;var ZonosCheckout=function(){function e(e){var o=this;registerInstance(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.clientSecret=stripeStore.clientSecret;this.stripeCustomerSessionClientSecret=stripeStore.stripeCustomerSessionClientSecret;this.applyStripeTheme=function(){return __awaiter(o,void 0,void 0,(function(){var e,o,t,r,n;return __generator(this,(function(s){switch(s.label){case 0:n=((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme)||zonosStore.appearance.theme;return[4,initStripeElements({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:(r=this.appearanceSettingsOverride)===null||r===void 0?void 0:r.colorSecondary,overrideTheme:this.isMobile?n:undefined,paypalEnabled:paypalStoreHasPaypalEnabled()})];case 1:s.sent();return[2]}}))}))};this.checkStripePaymentIntentStatus=function(e){return __awaiter(o,[e],void 0,(function(e){var o,t,r,n,s,i,a,c,u;var d=e.triggeredButton;return __generator(this,(function(e){switch(e.label){case 0:o=d===null||d===void 0?void 0:d.matches("#".concat(checkoutHiddenBtnSelector));t=!!window.Zonos.cartData;r=new URL(window.location.href).searchParams;n=r.get("payment_intent_client_secret");s=r.get("zonosCheckoutSessionId");if(!o){log("Checkout is triggered by user, no need to check stripe payment intent status");return[2,{shouldAllowOrder:true}]}log("Payment intent exist, checking stripe payment intent status");if(!n){log("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:t}]}return[4,stripeStoreRetrievePayment({clientSecret:n})];case 1:i=e.sent(),a=i.error,c=i.status;u=new URLSearchParams(window.location.search).get("redirect_status");if(u){if(!a){log("Payment intent is succeeded or in a good state to move forward, show success screen")}else{log("Payment intent failed, show status from error")}this.open=true;storageStore.checkoutSessionId=s;stripeStore.clientSecret=n;void this.setToFinishStep(c);return[2,{shouldAllowOrder:false}]}if(!t){log("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}log("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.initializeTestKeys=function(){storageStore.enabledVariantTestKeys=filterExpiredTests(storageStore.enabledVariantTestKeys||[]);var e=zonosStore.enabledVariantTestKeys.map((function(e){var o;var t=(o=storageStore.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()+VARIANT_TEST_KEY_EXPIRATION,selectedVariantKey:(t===null||t===void 0?void 0:t.selectedVariantKey)||null,testKey:e}}));storageStoreSetEnabledVariantTestKeys(e);return{allSelected:false}};this.shouldAllowHostedVsNativeTest=function(){if(typeof zonosStore.checkoutSettings.createCartId!=="function"){return false}var e=zonosStore.enabledVariantTestKeys.includes("hosted_vs_native");if(!e){return false}return true};this.registerTestHostedVsNative=function(){return __awaiter(o,void 0,void 0,(function(){var e,o,t,r;return __generator(this,(function(n){switch(n.label){case 0:e=this.shouldAllowHostedVsNativeTest();if(!e){return[2]}log("[TEST] - Registering hosted vs native test");o=getSelectedTestVariant("hosted_vs_native");if(o){log("[TEST] - Hosted vs native test already has variant selected: ".concat(o));return[2]}return[4,selectVarianceTest({testKeys:["hosted_vs_native"]})];case 1:t=n.sent();if(!t){log("[TEST] - Failed to get selection for hosted vs native test");return[2]}r=mergeTest({baseTestObj:storageStore.enabledVariantTestKeys||[],mergeTestObj:t});storageStoreSetEnabledVariantTestKeys(r);return[2]}}))}))};this.handleHostedVsNative=function(){return __awaiter(o,void 0,void 0,(function(){var e,o,t,r,n,s,i,a;return __generator(this,(function(c){switch(c.label){case 0:o=this.shouldAllowHostedVsNativeTest();if(!o){return[2,{redirected:false}]}t=getSelectedTestVariant("hosted_vs_native");log("[TEST] - hosted_vs_native: ".concat(t));if(typeof zonosStore.checkoutSettings.createCartId!=="function"){log("[TEST] - createCartId is not provided, skipping hosted vs native test");return[2,{redirected:false}]}if(t!=="hosted"){log("[TEST] - Hosted vs native test is enabled for native, skipping");return[2,{redirected:false}]}if(!((e=zonosStore.genericSettings)===null||e===void 0?void 0:e.hostedCheckoutUrl)){log("[TEST] - Hosted checkout URL is not provided");return[2,{redirected:false}]}log('"createCartId" is provided, start building cart');return[4,zonosStore.checkoutSettings.createCartId()];case 1:r=c.sent();s=null;if(typeof r==="object"){n=r.cartId;s=r.shippingData||null}else{n=r}i=getLegacyQueryParams();a=buildCartUrl(Object.assign(Object.assign({cartId:n,checkoutSessionId:storageStore.checkoutSessionId||undefined,hostedCheckoutUrl:zonosStore.genericSettings.hostedCheckoutUrl,isTestMode:getIsTestMode(),isVariantTest:true},i),s));log("[TEST] - Redirecting to: ".concat(a));window.open(a,"_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(cartStore.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=cartStore.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(o.defaultCustomerProfileAddress.length){return o.defaultCustomerProfileAddress}if(Array.isArray(o.defaultAddress)&&o.defaultAddress.length){return o.defaultAddress}if(!Array.isArray(o.defaultAddress)&&typeof o.defaultAddress==="object"){return[o.defaultAddress]}return o.defaultAddressParams};this.handleHostedOpenWindowCallback=function(e){var o;var t=(o=zonosStore.genericSettings)===null||o===void 0?void 0:o.hostedCheckoutUrl;if(!origin){return}var r=["dev.checkout.elements.zonos.com"].some((function(o){return e.origin.includes(o)}));if(e.origin!==t&&!r){return}switch(e.data.type){case"zonos-checkout-session-update":storageStore.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){storageStore.checkoutSessionId=t}var r=storageStore.enabledVariantTestKeys||[];if(window.Zonos.isLegacyCheckout){var n=getSelectedTestVariant("hosted_vs_native");if(!n){r.push({expiresAt:Date.now()+VARIANT_TEST_KEY_EXPIRATION,selectedVariantKey:"hosted",testKey:"hosted_vs_native"});storageStoreSetEnabledVariantTestKeys(r)}else{storageStoreSetEnabledVariantTestKeys(r.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 cartStoreUpdateItems({adjustments:cartStore.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(r){if(!this.open){return[2]}if(!(e===null||e===void 0?void 0:e.confirmed)){this.confirmDialogOpen=true;return[2]}this.confirmDialogOpen=false;submitGtag("zonos-checkout-close");this.open=this.forceDialogOpen||false;if(!this.preview&&cartStore.step==="finish"){cartStoreReset()}cartStore.step="customer-info";cartStoreResetTabItems();cartStoreClearCheckoutInterval();(t=(o=zonosStore.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,r,n,s,i,a,s,i,i,c,u,s,d;return __generator(this,(function(l){switch(l.label){case 0:if(!(typeof zonosStore.checkoutSettings.createCartId==="function"))return[3,4];log('"createCartId" is provided, start building cart');return[4,zonosStore.checkoutSettings.createCartId()];case 1:e=l.sent();o=void 0;if(typeof e==="object"){log("object detected, use cartId and prefill address from createCartId","info",e);o=e.cartId;this.useShippingDataFromCreateCartId(e.shippingData);cartStore.customerAuthenticationToken=e.customerAuthenticationToken||null}else{o=e}window.Zonos.cartId=o;return[4,setupCartData(o)];case 2:t=l.sent();r=t===null||t===void 0?void 0:t.cartData;if(!r){logError("Failed to build cart, please try again.");return[2,false]}window.Zonos.cartData=r;n=buildCartItemsByTempCart(r),s=n.adjustments,i=n.cartItems;return[4,cartStoreUpdateItems({adjustments:s,cartItems:i})];case 3:l.sent();return[3,9];case 4:if(!window.Zonos.cartData)return[3,6];log("tempCartUUID is provided, start building cart");a=buildCartItemsByTempCart(window.Zonos.cartData),s=a.adjustments,i=a.cartItems;return[4,cartStoreUpdateItems({adjustments:s,cartItems:i})];case 5:l.sent();return[3,9];case 6:if(!(zonosStore.checkoutSettings.buildCartDetail&&localizationStore.selectedCountryCode))return[3,9];log("build cart detail");return[4,zonosStore.checkoutSettings.buildCartDetail({countryCode:localizationStore.selectedCountryCode,currencyCode:localizationStore.targetCurrency})];case 7:i=l.sent();c=i.filter((function(e){return e.amount>=0}));u=i.filter((function(e){return e.amount<0}));log("cartItems","info",{cartItems:i});s=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,cartStoreUpdateItems({adjustments:s,cartItems:c})];case 8:l.sent();l.label=9;case 9:if(!!storageStore.checkoutSessionId)return[3,11];return[4,stripeStoreInitCheckoutSession()];case 10:d=l.sent();log("stripeStoreInitCheckoutSession: ".concat(d));if(!d){return[2,false]}l.label=11;case 11:if(!cartStore.isStagingMode){void stripeStoreGetPaymentIntent()}return[4,this.applyStripeTheme()];case 12:l.sent();this.isRedirectAfterOrder=zonosStore.checkoutSettings.successBehavior==="REDIRECT_TO_SUCCESS_PAGE"||!!cartStore.externalConfirmationPageURL;return[2,true]}}))}))};e.prototype.reloadCheckoutSession=function(){window.location.reload()};e.prototype.handleOrderDuplication=function(){var e=jsonParse(localStorage.getItem("zonos--placed-order-info"));if(!e){localStorage.removeItem("zonos--placed-order-info");return}var o=Date.now()-e.time;log("=== 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")||ORDER_DUPLICATION_NOTIFICATION_EXPIRATION;if(o>t){log("=== Existing placed order info is older than ".concat(t,"ms, cleaning localStorage"),"warn");localStorage.removeItem("zonos--placed-order-info");return}this.placedOrderInfo=e;log("=== Showing order duplication confirmation","warn")};e.prototype.recordCheckoutInfo=function(){if(!storageStore.checkoutSessionId){return}void updateCheckoutSessionAttributes({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:storageStore.checkoutSessionId})};e.prototype.confirmProceedWithOrderDuplication=function(){this.placedOrderInfo=null;if(!storageStore.checkoutSessionId){return}void updateCheckoutSessionAttributes({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:storageStore.checkoutSessionId})};e.prototype.markTheSessionAsAbandonedCart=function(){if(!storageStore.checkoutSessionId){return}void updateCheckoutSessionAttributes({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:storageStore.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)||zonosStore.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=zonosStore.checkoutSettings.placeOrderButtonSelector;var t=zonosStore.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;log("attach checkout ".concat(o));log("attach checkout to always trigger international checkout selector: ".concat(t));if(!o&&!t&&!window.Zonos.cartData){return}var r=[o,t,"#".concat(domesticRedirectedBtnSelector),"#".concat(checkoutHiddenBtnSelector),"#".concat(checkoutHiddenInternationalBtnSelector)].filter(Boolean);var n=document.querySelectorAll(r.join(","));n.forEach((function(r){var n=r.getAttribute("data-zonos-checkout-attached");if(n){return}log("attached event to button ".concat(o),"info",{button:r});r.addEventListener("click",(function(o){return __awaiter(e,void 0,void 0,(function(){var e,n,s,i,a,c,u,d,l,h,f,m,g,v,p,z;return __generator(this,(function(S){switch(S.label){case 0:s=performance.now();i=t&&r.matches(t);a=r.matches("#".concat(checkoutHiddenInternationalBtnSelector));c=r.matches("#".concat(domesticRedirectedBtnSelector))||r.matches("#".concat(checkoutHiddenBtnSelector));if(!window.Zonos.isLegacyCheckout&&(!isShippableCountry()||isDisabledCountry())&&!i&&!a&&!c){return[2]}o.preventDefault();o.stopPropagation();log("zonos checkout button clicked");return[4,this.checkStripePaymentIntentStatus({triggeredButton:o.target})];case 1:u=S.sent().shouldAllowOrder;if(!u){return[2]}if(!window.Zonos.logIntervalId){window.Zonos.logIntervalId=setInterval((function(){void sendBulkLoadTimeApiLog()}),2e3)}if(!isTestEnabled("hosted_vs_native"))return[3,4];this.isOverlayLoading=true;return[4,this.registerTestHostedVsNative()];case 2:S.sent();return[4,this.handleHostedVsNative()];case 3:d=S.sent().redirected;this.isOverlayLoading=false;if(d){return[2]}S.label=4;case 4:stripeStore.isFetchingSession=true;this.open=true;S.label=5;case 5:S.trys.push([5,8,,9]);return[4,this.buildCartAndInit()];case 6:l=S.sent();if(!l){throw new Error("Error building cart")}(e=window.opener)===null||e===void 0?void 0:e.postMessage({checkoutSessionId:storageStore.checkoutSessionId,type:"zonos-checkout-session-update"},"*");cartStoreStartCheckoutInterval({isPreview:this.preview,sessionTimeout:CHECKOUT_SESSION_TIMEOUT});submitGtag("zonos-checkout-start");h=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:h,eventName:"checkout_open"});return[4,isStoreDiscountEnabled()];case 7:f=S.sent().enabled;cartStore.shouldHideDiscountInput=!f;this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void sendLoadCheckoutFacadeLog()}else{m=performance.now();g=m-s;void sendLoadNativeCheckoutLog({loadTime:g})}this.recordCheckoutInfo();v=!!getAbandonedCartRenewTokenValue();if(v){this.markTheSessionAsAbandonedCart()}return[3,9];case 8:p=S.sent();if(p instanceof Error){z=p.message;if(z==="Cart is expired."){this.isCartExpired=true}}stripeStore.isFetchingSession=false;logError(p);if(this.isCartExpired){stripeStore.isFetchingSession=true;return[2]}void sendErrorLog({endpoint:"Error creating Checkout",errors:[p instanceof Error?p.toString():"Unknown error"],metadata:{allLogs:allLogs,cartId:window.Zonos.cartId,checkoutSessionBody:getCheckoutSessionBody(),href:window.location.href,storeBaseUrl:((n=window.Zonos.cartData)===null||n===void 0?void 0:n.storeBaseUrl)||zonosStore.onlineStoreSettings.url}});cartStoreUpdateToErrorState({messages:[translate("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:translate("Error creating Checkout")});return[3,9];case 9:return[2]}}))}))}),{capture:true,passive:false});if(!zonosStore.checkoutSettings.disablePlaceOrderButtonActivation){r.removeAttribute("disabled")}r.setAttribute("data-zonos-checkout-attached","true");if(r.matches("#".concat(domesticRedirectedBtnSelector))){r.dispatchEvent(createCustomEvent("click"));stripeStoreCleanupDomesticShippingSession();r.remove()}if(r.matches("#".concat(checkoutHiddenBtnSelector))){r.dispatchEvent(createCustomEvent("click"));r.remove()}}))};e.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}void this.applyStripeTheme()};e.prototype.useShippingDataFromCreateCartId=function(e){if(!e){return}log("shipping data from createCartId result","info",Object.entries(e));var o=e.customerAddress1,t=e.customerAddress2,r=e.customerCity,n=e.customerCountry,s=e.customerEmail,i=e.customerFirstName,a=e.customerLastName,c=e.customerName,u=e.customerPhone,d=e.customerState,l=e.customerZip;var h=new URLSearchParams(window.location.search);var f=n||getZCountryUrlParam(h)||localizationStore.selectedCountryCode;this.applyPrefillAddress({customerAddress1:o,customerAddress2:t,customerCity:r,customerCountry:f,customerEmail:s,customerFirstName:i,customerLastName:a,customerName:c,customerPhone:u,customerState:d,customerZip:l})};e.prototype.useLegacyQueryParams=function(){var e=new URLSearchParams(window.location.search);log("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=getZCountryUrlParam(e)||localizationStore.selectedCountryCode;var r=o("customerCity");var n=o("customerEmail");var s=o("customerAddress1");var i=o("customerAddress2");var a=o("customerName");var c=o("customerFirstName");var u=o("customerLastName");var d=o("customerPhone");var l=o("customerZip");var h=o("customerState");this.applyPrefillAddress({customerAddress1:s,customerAddress2:i,customerCity:r,customerCountry:t,customerEmail:n,customerFirstName:c,customerLastName:u,customerName:a,customerPhone:d,customerState:h,customerZip:l})};e.prototype.applyPrefillAddress=function(e){var o=e.customerAddress1||"";var t=e.customerCountry||"";var r=e.customerAddress2||"";var n=e.customerCity||"";var s=e.customerEmail||"";var i=e.customerFirstName&&e.customerLastName?"".concat(e.customerFirstName," ").concat(e.customerLastName):e.customerName||"";var a=e.customerPhone||"";var c=e.customerZip||"";var u=e.customerState||"";if(!o||!i||!a||!t){log("Missing required query params so it can not be prefilled","info",[!o&&"line1",!i&&"name",!a&&"phone",!t&&"country"].filter(Boolean).join(", "));return}if(t&&localizationStore.shippingZoneCountries&&!(t in localizationStore.shippingZoneCountries)){log('Country "'.concat(t,'" is not in the shipping zone, so it can not be prefilled'),"warn");return}this.defaultAddressParams=[{address:{city:n||"",country:t,line1:o,line2:r,postal_code:c,state:u},email:s,name:i,phone:a}];log("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:e})};e.prototype.overrideStagingModeChanged=function(){cartStore.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){stripeStore.stripe=window.Zonos.stripe;this.stripe=window.Zonos.stripe;cartStore.isStagingMode=getIsStagingMode();if(typeof this.overrideStagingMode!=="undefined"){cartStore.isStagingMode=this.overrideStagingMode}watchBigcommerceDomesticCheckout({domesticRedirectedBtnSelector:domesticRedirectedBtnSelector,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(){stripeStore.stripe=window.Zonos.stripe;o.stripe=window.Zonos.stripe;if(!o.stripe){log("waiting for stripe to be loaded");return}if(o.storybookPaymentStatusOverride){clearInterval(e);return}log("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.setToFinishStep=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){cartStore.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){cartStoreSetCheckoutSession(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(checkoutHiddenInternationalBtnSelector));if(e){e.dispatchEvent(createCustomEvent("click"))}return[2]}))}))};e.prototype.handleCustomerInfoContinue=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,r,n,s,i,a;var c=this;return __generator(this,(function(u){switch(u.label){case 0:submitGtag("zonos-checkout-customer-info");n=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:n,eventName:"checkout_customerInfoCompleted"});this.submitLoading=true;return[4,stripeStorePrefetchLandedCost()];case 1:s=u.sent().isRequestNotReady;if(s&&cartStore.addressFormRenderType==="stripe"){void sendErrorLog({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:(o=(e=stripeStore.stripeAddressEventData)===null||e===void 0?void 0:e.value)===null||o===void 0?void 0:o.address,billingAddress:(r=(t=stripeStore.stripeBillingAddressEventData)===null||t===void 0?void 0:t.value)===null||r===void 0?void 0:r.address,cartId:window.Zonos.cartId}})}i=function(e){if(cartStore.step!=="customer-info"){clearInterval(e);return}if(!stripeStore.isFetchingLandedCost){if(cartStore.landedCostData){void paypalInitScript({currency:cartStore.currency});cartStoreNextStep()}c.submitLoading=false;if(e){clearInterval(e)}}};i();a=setInterval((function(){i(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){cartStoreNextStep();return[2]}))}))};e.prototype.handleInventoryCheckDialogConfirm=function(){cartStore.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,r,n;return __generator(this,(function(s){switch(s.label){case 0:e=stripeStore.checkoutSettlementCurrency==="USD";if(e&&stripeStore.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;paypalStore.paypalErrorMessage=null;stripeStore.hasPaymentError=false;this.submitLoading=true;cartStore.inventoryCheckErrorMessage=null;return[4,stripeStoreUpdateCheckoutSessionBaseCurrency()];case 1:o=s.sent();if(!o){stripeStore.hasPaymentError=true;stripeStore.customErrorMessage=translate("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:stripeStore.checkoutSettlementCurrency});this.submitLoading=false;return[2]}s.label=2;case 2:s.trys.push([2,4,,5]);t=cartStore;return[4,stripeStoreHandleInventoryCheck()];case 3:t.inventoryCheckErrorMessage=s.sent();return[3,5];case 4:r=s.sent();cartStore.inventoryCheckErrorMessage=translate("Unable to check inventory. Please try again.");return[3,5];case 5:if(cartStore.inventoryCheckErrorMessage){this.submitLoading=false;return[2]}s.label=6;case 6:s.trys.push([6,8,,9]);return[4,stripeStoreConfirmPayment()];case 7:s.sent();cartStoreNextStep();cartStoreClearCheckoutInterval();return[3,9];case 8:n=s.sent();logError(n);submitGtag("zonos-checkout-payment-fail");stripeStore.hasPaymentError=true;if(stripeStore.shouldInventoryRefund){void stripeStoreHandleInventoryRefund();stripeStore.shouldInventoryRefund=false}return[3,9];case 9:this.submitLoading=false;return[2]}}))}))};e.prototype.handleFinishClick=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,r;return __generator(this,(function(n){switch(n.label){case 0:stripeStoreReset();if(!this.preview)return[3,2];cartStore.step="customer-info";return[4,this.init()];case 1:n.sent();return[2];case 2:cartStoreReset();if(window.Zonos.isLegacyCheckout&&window.Zonos.cartData){e=window.Zonos.cartData.storeBaseUrl||zonosStore.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;r=window.location.hostname.includes("dashboard.zonos.com");if(!r){window.history.replaceState(window.history.state,document.title,t);window.location.reload()}return[2]}}))}))};e.prototype.handleWindowResize=function(){this.isMobile=isCheckoutMobile(this.mobile);void this.applyStripeTheme();log("mobile: ".concat(this.isMobile))};e.prototype.handleMobileChange=function(){this.isMobile=isCheckoutMobile(this.mobile);void this.applyStripeTheme();log("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=getZonosStoreTheme(this.appearanceSettingsOverride.theme)}};e.prototype.handleAddressChange=function(){stripeStoreReset()};e.prototype.handleCustomerProfileChange=function(){var e,o;if(!this.customerProfile){log("No customer profile","info");this.defaultCustomerProfileAddress=[];return}log("Customer profile found","info",{customerProfile:this.customerProfile});this.defaultCustomerProfileAddress=((o=(e=stripeStore.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=stripeStore.customerProfile)===null||o===void 0?void 0:o.email)||"",name:e.name||"",phone:e.phone||""}})))||[]};e.prototype.handleClientSecretChange=function(){log("==== 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 r=o.getAttribute(e);var n=t.getAttribute(e);if(r){o.removeAttribute(e);o.style.overflow=r}else{o.style.removeProperty("overflow")}if(n){t.removeAttribute(e);t.style.overflow=n}else{t.style.removeProperty("overflow")}}};e.prototype.componentWillLoad=function(){var e=this;void this.init();this.isMobile=isCheckoutMobile(this.mobile);this.isIframed=window.self!==window.top;log("iframed: ".concat(this.isIframed));if(window.Zonos.isLegacyCheckout){this.captureParamsRedirectedForVariantTest()}this.handleAppearanceSettingsOverrideChange();this.storeUnsubscribeList=[localizationStoreOnChange("selectedLocale",(function(){void e.applyStripeTheme()})),cartStoreOnChange("selectedShippingOption",(function(){var o,t,r,n;var s=cartStore.selectedShippingOption;if(((o=zonosStore.genericSettings)===null||o===void 0?void 0:o.shouldFedExShippingConsentForCanadianShopper)&&((r=(t=s===null||s===void 0?void 0:s.shippingProfile)===null||t===void 0?void 0:t.serviceLevel.code)===null||r===void 0?void 0:r.toLowerCase().startsWith("fedex."))&&((n=stripeStore.stripeAddressEventData)===null||n===void 0?void 0:n.value.address.country)==="CA"){e.shouldShowFedexShippingConsentDialog=true}}))];this.initializeTestKeys();window.addEventListener("message",this.handleHostedOpenWindowCallback);log("mobile: ".concat(this.isMobile))};e.prototype.disconnectedCallback=function(){stripeStoreReset();cartStoreReset();this.storeUnsubscribeList.forEach((function(e){return e()}));window.removeEventListener("message",this.handleHostedOpenWindowCallback)};e.prototype.render=function(){var e=this;var o,t,r,n;this.customerProfile=stripeStore.customerProfile;this.clientSecret=stripeStore.clientSecret;if(stripeStore.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=stripeStore.stripeCustomerSessionClientSecret}var s=cartStore.step!=="finish"&&cartStore.step!=="error"&&!stripeStore.stripeElements||stripeStore.isFetchingSession;var i=mergeConfig(zonosStore.appearance,this.appearanceSettingsOverride||null),a=i.colorPrimary,c=i.colorSecondary,u=i.logoUrl,d=i.style;var l=zonosStore.appearance.zonosAttribution==="ENABLED";var f=zonosStore.appearance.theme;var m=a&&isDarkColor(a)?"DARK":"LIGHT";var g=this.isMobile?f:m;var v=!this.isMobile?c:undefined;var p=localizationStore.customMessages;var z=(o=p.find((function(e){return e.pageName==="checkout_default"})))===null||o===void 0?void 0:o.message;var S=this.getCurrentLocalePageEnum();var k=p.filter((function(e){return e.pageName===S}));var w=this.getBaseCurrencySettlementInfo();var C=function(){var o=e.preview?"".concat(u,"?timestamp=").concat(Date.now()):u;return h("div",{class:"zonos--logo"},o&&h("img",{alt:"".concat(zonosStore.organizationName," logo"),src:o}))};var y=getIsTestMode();var b=function(){var o=new URLSearchParams(window.location.search);var t=o.get("zonosQaUrl");var r=o.get("zonosDebug");var n=o.get("zonosE2ETest");var s=e.overrideStagingMode||getIsStagingMode();return h("zonos-v-stack",null,h("div",{class:"zonos--logo-wrapper"},C(),y&&h("zonos-badge",{badgeColor:"orange",size:"small"},translate("Test mode")),s&&h("zonos-badge",{badgeColor:"red",size:"small"},translate("Staging mode")),r==="1"&&h("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&h("zonos-badge",{badgeColor:"purple",size:"small"},t),n&&h("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),h("zonos-checkout-progress-tabs",{backgroundColor:e.isMobile?"--zonos-elements-gray-0":null}),k.map((function(e){return h("zonos-custom-message",{icon:MessageIcon,message:e.message})})))};var _=function(){if(cartStore.checkoutSessionTimeoutShow){return h("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:translate("Your checkout session has expired. Please reload the page to continue."),restStateTitle:translate("Session timed out"),restStateType:"Warning"},h("zonos-button",{onClick:function(){return e.reloadCheckoutSession()},variant:"primary"},translate("Reload")))}return h("div",{class:"zonos--content",style:{"--zonos--border-radius":getBorderRadius({overrideBorderStyle:d})}},cartStore.step!=="finish"&&cartStore.step!=="error"&&h(Fragment,null,h("div",{class:"zonos--left","data-theme":g,style:styles({"--zonos--primary-color":!e.isMobile?a:undefined})},!e.isMobile&&b(),cartStore.step==="customer-info"&&h("zonos-customer-info",{continueLoading:e.submitLoading,defaultAddress:e.getDefaultAddress(),isMobile:e.isMobile,onContinueClicked:function(){return e.handleCustomerInfoContinue()},submitBtnColor:v}),cartStore.step==="shipping"&&h("zonos-shipping",{continueLoading:e.submitLoading,onContinueClicked:function(){return e.handleShippingContinue()},submitBtnColor:v}),cartStore.step==="payment"&&h("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:v})),h("div",{class:"zonos--right","data-theme":f},e.isMobile&&b(),h("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&h("zonos-currency-toggle",null),!e.isLegacyCheckout&&h("zonos-button",{class:"zonos--close-button",icon:h("zonos-icon",{"aria-label":"Close checkout dialog",content:RemoveIcon}),noBackground:true,onClick:function(){return e.closeDialogHandler()}})),h("div",{class:"flex--wrapper"},h("div",{class:"zonos--wrapper"},h("zonos-review",{collapsed:e.collapseReviewMobile,mobile:e.isMobile,onClick:function(){if(!e.isMobile){return}e.collapseReviewMobile=!e.collapseReviewMobile}}),h("zonos-collapse",{collapsed:e.collapseReviewMobile&&e.isMobile},h("zonos-cart-items",null),e.isMobile&&h("zonos-v-stack",{spacing:16},h("zonos-cart-subtotal",{submitBtnColor:v}),h("zonos-custom-message",{class:"zonos--checkout-default-message",icon:MessageIcon,message:z})))),h("zonos-cart-restricted-items",null),!e.isMobile&&h("zonos-v-stack",{spacing:16},h("zonos-cart-subtotal",null),h("zonos-custom-message",{class:"zonos--checkout-default-message",icon:MessageIcon,message:z}))))),(cartStore.step==="finish"||cartStore.step==="error")&&h("div",{class:"zonos--done","data-theme":f},h("div",{class:"zonos--header"},C(),!e.isRedirectAfterOrder&&h("zonos-button",{class:"zonos--close-button",icon:h("zonos-icon",{"aria-label":"Close checkout dialog",content:RemoveIcon}),noBackground:true,onClick:function(){return e.handleFinishClick()},theme:f})),h("zonos-checkout-finish",{borderRadius:d,onCloseClick:function(){return e.handleFinishClick()},overrideNotification:cartStore.step==="error"&&!!cartStore.error?Object.assign(Object.assign({},cartStore.error),{type:"error"}):undefined,storybookForceStatus:e.storybookPaymentStatusOverride})),h("zonos-checkout-footer",{"data-theme":f,mobile:e.isMobile,slot:!e.isMobile?"dialog-footer":undefined}))};return h(Host,{class:classes(["zonos--checkout zonos--elements",cartStore.step==="payment"&&"zonos--processing-payment",l&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?_():h("zonos-dialog",{borderStyle:d,"data-theme":f,height:"980px",isLoading:s,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return e.closeDialogHandler()},open:this.open,width:"1200px"},_()),h("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:translate("Don't close"),dialogConfirmBtnText:translate("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:translate("Would you like to close checkout and return to the site?"),dialogTitle:translate("Are you sure?"),onCancelClicked:function(){e.confirmDialogOpen=false},onConfirmClicked:function(){return e.closeDialogHandler({confirmed:true})}}),h("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:translate("Return to merchant site"),dialogConfirmBtnText:translate("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:((t=this.placedOrderInfo)===null||t===void 0?void 0:t.zonosOrderNumber)?translate("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)}):translate("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(((r=this.placedOrderInfo)===null||r===void 0?void 0:r.time)||null),time:this.formatTime(((n=this.placedOrderInfo)===null||n===void 0?void 0:n.time)||null)}),dialogTitle:translate("Are you sure?"),dialogWidth:530,onCancelClicked:function(){e.handleCancelOrderDuplication()},onConfirmClicked:function(){e.confirmProceedWithOrderDuplication()}}),h("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:translate("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:h(Fragment,null,translate("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."),h("zonos-link",{href:"https://ftn.fedex.com/us/assets/docs/One-Time_GAA.pdf",target:"_blank"},translate("View GAA Form."))),dialogTitle:translate("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:function(){return e.shouldShowFedexShippingConsentDialog=false}}),h("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:translate("Return to cart"),dialogIntent:"danger",dialogOpen:!!cartStore.inventoryCheckErrorMessage,dialogSubtitle:cartStore.inventoryCheckErrorMessage,dialogTitle:translate("Couldn't place order"),dialogType:"alert",onConfirmClicked:function(){return e.handleInventoryCheckDialogConfirm()}}),w&&h("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:translate("Cancel"),dialogConfirmBtnText:translate("Pay [orderTotal]",{orderTotal:currencyFormat({amount:w.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:translate("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:translate("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){e.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return e.handleStripePaymentContinue()}}),h("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:translate("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:translate("You are being sent back to the shop to re-add items to your cart."),dialogTitle:translate("Shopping cart expired"),dialogType:"alert",onConfirmClicked:function(){return e.handleCartExpiredDialogConfirm()}}),h("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}();ZonosCheckout.style=ZonosCheckoutStyle0;export{ZonosCheckout as zonos_checkout};
1
+ var __awaiter=this&&this.__awaiter||function(e,o,t,r){function n(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,s){function i(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r["throw"](e))}catch(e){s(e)}}function c(e){e.done?t(e.value):n(e.value).then(i,a)}c((r=r.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,n,s,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(o){return c([e,o])}}function c(a){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,a[0]&&(t=0)),t)try{if(r=1,n&&(s=a[0]&2?n["return"]:a[0]?n["throw"]||((s=n["return"])&&s.call(n),0):n.next)&&!(s=s.call(n,a[1])).done)return s;if(n=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;n=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(s=t.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){t.label=a[1];break}if(a[0]===6&&t.label<s[1]){t.label=s[1];s=a;break}if(s&&t.label<s[2]){t.label=s[2];t.ops.push(a);break}if(s[2])t.ops.pop();t.trys.pop();continue}a=o.call(e,t)}catch(e){a=[6,e];n=0}finally{r=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var r=0,n=o.length,s;r<n;r++){if(s||!(r in o)){if(!s)s=Array.prototype.slice.call(o,0,r);s[r]=o[r]}}return e.concat(s||Array.prototype.slice.call(o))};import{r as registerInstance,h,F as Fragment,H as Host}from"./index-0bbe9693.js";import{s as stripeStoreGetDomesticShippingSession,a as stripeStoreCleanupDomesticShippingSession,b as stripeStoreSaveDomesticShippingSession,c as stripeStore,i as initStripeElements,d as stripeStoreRetrievePayment,e as cartStore,f as cartStoreUpdateItems,g as cartStoreReset,h as cartStoreResetTabItems,j as cartStoreClearCheckoutInterval,k as stripeStoreInitCheckoutSession,l as stripeStoreGetPaymentIntent,m as cartStoreStartCheckoutInterval,t as trackConversionEvent,n as getCheckoutSessionBody,o as cartStoreUpdateToErrorState,p as cartStoreSetCheckoutSession,q as stripeStorePrefetchLandedCost,r as cartStoreNextStep,u as stripeStoreUpdateCheckoutSessionBaseCurrency,v as stripeStoreHandleInventoryCheck,w as stripeStoreConfirmPayment,x as stripeStoreHandleInventoryRefund,y as stripeStoreReset,z as cartStoreOnChange}from"./cart-66aecbb3.js";import{p as paypalStoreHasPaypalEnabled,s as submitGtag,a as paypalStore,b as paypalInitScript}from"./paypal-56564874.js";import{f as filterValidTests,l as localizationStore,a as localizationStoreUpdateSelectedCountryCode,g as getZCountryUrlParam,s as storageStore,V as VARIANT_TEST_KEY_EXPIRATION,b as storageStoreSetEnabledVariantTestKeys,t as translate,c as localizationStoreOnChange,d as currencyFormat}from"./localization-04b05867.js";import{z as zonosStore,g as getZonosStoreTheme,m as mergeConfig}from"./zonosStore-b434e436.js";import{b as buildCartItemsByTempCart}from"./buildCartItemsByTempCart-a117f75d.js";import{h as handleFetch,l as logError,s as sendErrorLog,b as getAdditionalLogMetadata,g as getIsTestMode,j as jsonParse,a as getIsStagingMode,i as isCheckoutMobile}from"./handleFetch-a844cac1.js";import{u as updateCheckoutSessionAttributes}from"./updateCheckoutSessionAttributes-047a6cd4.js";import{_ as _getIsValidCartId,c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector,g as getAbandonedCartRenewTokenValue}from"./CheckoutConfig-724d7bae.js";import{l as log,g as getElapsedTime,b as allLogs}from"./VarianceTest-572cecf5.js";import{c as classes}from"./classes-0d95c529.js";import{c as createCustomEvent}from"./createCustomEvent-58159025.js";import{g as getBorderRadius}from"./getBorderRadius-877f6389.js";import{i as isDarkColor}from"./isDarkColor-9ddd90cc.js";import{s as styles}from"./styles-6fc2fad9.js";import{R as RemoveIcon}from"./RemoveIcon-9dc5dd1a.js";import"./debounce-c4785346.js";var isStoreDiscountEnabled=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,o,t;return __generator(this,(function(r){switch(r.label){case 0:return[4,handleFetch("/api/zonos-elements/get-store-discount-enabled-status")];case 1:e=r.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 selectVarianceTest=function(e){return __awaiter(void 0,[e],void 0,(function(e){var o,t,r,n;var s=e.testKeys;return __generator(this,(function(e){switch(e.label){case 0:if(s.length===0){return[2,null]}return[4,handleFetch("/api/zonos-elements/select-variance-test",{body:{testKeys:s},method:"POST"})];case 1:o=e.sent(),t=o.errors,r=o.json;if(t.length||!r){return[2,null]}n=filterValidTests(r);return[2,n]}}))}))};var buildCartUrl=function(e){var o=e.cartId,t=e.checkoutSessionId,r=e.customerAddress1,n=e.customerAddress2,s=e.customerCity,i=e.customerCountry,a=e.customerEmail,c=e.customerFirstName,u=e.customerLastName,d=e.customerPhone,l=e.customerState,h=e.customerZip,f=e.hostedCheckoutUrl,m=e.isTestMode,g=e.isVariantTest;var v=new URLSearchParams;v.set("tempCartUUID",o);if(c){v.set("customerFirstName",c)}if(u){v.set("customerLastName",u)}if(a){v.set("customerEmail",a)}if(d){v.set("customerPhone",d)}if(h){v.set("customerZip",h)}if(s){v.set("customerCity",s)}if(l){v.set("customerState",l)}if(i){v.set("zCountry",i)}if(r){v.set("customerAddress1",r)}if(n){v.set("customerAddress2",n)}if(m){v.set("zonosTestMode","1")}if(t){v.set("zonosCheckoutSessionId",t)}if(g){v.set("zonosVariantTest","1")}return"".concat(f,"?").concat(v.toString())};var isDisabledCountry=function(e){if(e===void 0){e=true}if(!localizationStore.localizationLoaded){return true}if(localizationStore.isDisabledCountry){if(e){log("Checkout: disabled country")}return true}return false};var isShippableCountry=function(e){if(e===void 0){e=true}if(!localizationStore.localizationLoaded){return false}if(!localizationStore.isShippableCountry){if(e){log("Checkout: not shippable country")}return false}return true};var watchBigcommerceDomesticCheckout=function(e){var o=e.domesticRedirectedBtnSelector,t=e.onShippingAddressSessionFound;if(!window.Zonos.isBigCommerce){return}var r=new MutationObserver((function(){return __awaiter(void 0,void 0,void 0,(function(){var e,n,s,i,a;return __generator(this,(function(c){e=document.querySelector(o);n=stripeStoreGetDomesticShippingSession();if(!e&&n){s=document.createElement("button");s.style.display="none";s.id="zonos--domestic-redirected-checkout-button";document.body.appendChild(s);t===null||t===void 0?void 0:t(n);r.disconnect();return[2]}i=document.querySelector('select[name="shippingAddress.countryCode"]');a=document.querySelector("#checkout-shipping-continue");if(!i||!a){return[2]}r.disconnect();a.addEventListener("click",(function(e){return __awaiter(void 0,void 0,void 0,(function(){var o,t,r,n,s,a,c;return __generator(this,(function(u){r=i.value;if(!r){return[2]}localizationStoreUpdateSelectedCountryCode({isInitializing:false,newSelectedCountryCode:r});if(!isShippableCountry(false)){stripeStoreCleanupDomesticShippingSession();return[2]}n=document.querySelector("form");if(!n){return[2]}s=new FormData(n);a=document.querySelector("input#addressLine1Input");c={address1:(o=s.get("shippingAddress.address1"))!==null&&o!==void 0?o:a&&a.value,address2:s.get("shippingAddress.address2"),city:s.get("shippingAddress.city"),countryCode:s.get("shippingAddress.countryCode"),firstName:s.get("shippingAddress.firstName"),lastName:s.get("shippingAddress.lastName"),phone:s.get("shippingAddress.phone"),postalCode:s.get("shippingAddress.postalCode"),stateOrProvince:(t=s.get("shippingAddress.stateOrProvince"))!==null&&t!==void 0?t:s.get("shippingAddress.stateOrProvinceCode")};if(Object.values(c).some((function(e){return e===undefined||e===null}))){logError("One or more shipping address field is missing",Object.entries(c));void sendErrorLog({endpoint:"No endpoint, domestic checkout form missing fields",errors:["Bigcommerce: One or more shipping address field is missing in the domestic checkout form",JSON.stringify(Object.entries(c))],metadata:{storeId:zonosStore.storeId}});return[2]}stripeStoreSaveDomesticShippingSession({address1:c.address1,address2:c.address2,city:c.city,countryCode:c.countryCode,firstName:c.firstName,lastName:c.lastName,phone:c.phone,postalCode:c.postalCode,state:c.stateOrProvince});e.preventDefault();e.stopPropagation();window.location.href="/";return[2]}))}))}));return[2]}))}))}));r.observe(document.body,{childList:true,subtree:true})};var getLegacyQueryParams=function(){var e=new URLSearchParams(window.location.search);log("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=getZCountryUrlParam(e)||localizationStore.selectedCountryCode||"US";var r=o("customerCity");var n=o("customerEmail");var s=o("customerAddress1");var i=o("customerAddress2");var a=o("customerName");var c=o("customerPhone");var u=o("customerZip");var d=o("customerState");var l=o("customerFirstName");var h=o("customerLastName");return{customerAddress1:s,customerAddress2:i,customerCity:r,customerCountry:t,customerEmail:n,customerFirstName:l,customerLastName:h,customerName:a,customerPhone:c,customerState:d,customerZip:u}};var numberOfFailures=0;var sendBulkLoadTimeApiLog=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,o;var t;return __generator(this,(function(r){switch(r.label){case 0:if(window.Zonos.loadTimeApiInfoList.length===0){return[2]}log("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,handleFetch("/api/zonos-elements/log-bulk-load-data",{body:e,method:"POST"})];case 1:o=r.sent().errors;if(o.length){(t=window.Zonos.loadTimeApiInfoList).push.apply(t,e.data);numberOfFailures++;if(numberOfFailures>5&&window.Zonos.logIntervalId){clearInterval(window.Zonos.logIntervalId)}}return[2]}}))}))};var sendLoadCheckoutFacadeLog=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){e=getElapsedTime().elapsedTime;o={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:e,metadata:Object.assign({allLogs:allLogs},getAdditionalLogMetadata()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};void handleFetch("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2]}))}))};var sendLoadNativeCheckoutLog=function(e){return __awaiter(void 0,[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:allLogs},getAdditionalLogMetadata()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};void handleFetch("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2]}))}))};var filterExpiredTests=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 getSelectedTestVariant=function(e){var o;var t=(o=storageStore.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 isTestEnabled=function(e){return zonosStore.enabledVariantTestKeys.includes(e)};var mergeTest=function(e){var o=e.baseTestObj,t=e.mergeTestObj;return o.map((function(e){var o=e.testKey;var r=t.find((function(e){var t=e.testKey;return t===o}));return{expiresAt:(r===null||r===void 0?void 0:r.expiresAt)||Date.now()+VARIANT_TEST_KEY_EXPIRATION,selectedVariantKey:(r===null||r===void 0?void 0:r.selectedVariantKey)||null,testKey:o}}))};var getTempCartById=function(e){return __awaiter(void 0,[e],void 0,(function(e){var o,t,r,n,s;var i=e.cartId,a=e.retries;return __generator(this,(function(e){switch(e.label){case 0:o=getIsTestMode();return[4,handleFetch("/api/zonos-elements/get-temp-cart",{body:{isTestMode:o,options:{noOnlineStoreSettings:true},tempCartUUID:i},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:t=e.sent(),r=t.errors,n=t.json;s=!n||r.length;if(!(s&&a))return[3,3];log("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:a});return[4,new Promise((function(e){return setTimeout(e,500)}))];case 2:e.sent();return[2,getTempCartById({cartId:i,retries:a-1})];case 3:if(s){return[2,null]}return[2,n]}}))}))};var setupCartData=function(e){return __awaiter(void 0,void 0,void 0,(function(){var o,t,r,n;return __generator(this,(function(s){switch(s.label){case 0:o=_getIsValidCartId(e),t=o.isDgsCartId,r=o.isLegacyCartId;if(!r&&!t){logError("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,getTempCartById({cartId:e,retries:5})];case 1:n=s.sent();log("[ZONOS - loadZonos] getting temp cart data","info",n);if(!n){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}window.Zonos.storeId=n.cartData.storeId;window.Zonos.zonosApiKey=n.cartData.credentialToken;return[2,{cartData:n.cartData,storeFavicon:n.storeFaviconUrl,storeId:n.cartData.storeId,storeLogo:n.storeLogoUrl,zonosApiKey:n.cartData.credentialToken}]}}))}))};var MessageIcon='<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 zonosCheckoutCss=".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 ZonosCheckoutStyle0=zonosCheckoutCss;var CHECKOUT_SESSION_TIMEOUT=90*60*1e3;var ORDER_DUPLICATION_NOTIFICATION_EXPIRATION=6*60*60*1e3;var ZonosCheckout=function(){function e(e){var o=this;registerInstance(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.clientSecret=stripeStore.clientSecret;this.stripeCustomerSessionClientSecret=stripeStore.stripeCustomerSessionClientSecret;this.applyStripeTheme=function(){return __awaiter(o,void 0,void 0,(function(){var e,o,t,r,n;return __generator(this,(function(s){switch(s.label){case 0:n=((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme)||zonosStore.appearance.theme;return[4,initStripeElements({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:(r=this.appearanceSettingsOverride)===null||r===void 0?void 0:r.colorSecondary,overrideTheme:this.isMobile?n:undefined,paypalEnabled:paypalStoreHasPaypalEnabled()})];case 1:s.sent();return[2]}}))}))};this.checkStripePaymentIntentStatus=function(e){return __awaiter(o,[e],void 0,(function(e){var o,t,r,n,s,i,a,c,u;var d=e.triggeredButton;return __generator(this,(function(e){switch(e.label){case 0:o=d===null||d===void 0?void 0:d.matches("#".concat(checkoutHiddenBtnSelector));t=!!window.Zonos.cartData;r=new URL(window.location.href).searchParams;n=r.get("payment_intent_client_secret");s=r.get("zonosCheckoutSessionId");if(!o){log("Checkout is triggered by user, no need to check stripe payment intent status");return[2,{shouldAllowOrder:true}]}log("Payment intent exist, checking stripe payment intent status");if(!n){log("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:t}]}return[4,stripeStoreRetrievePayment({clientSecret:n})];case 1:i=e.sent(),a=i.error,c=i.status;u=new URLSearchParams(window.location.search).get("redirect_status");if(u){if(!a){log("Payment intent is succeeded or in a good state to move forward, show success screen")}else{log("Payment intent failed, show status from error")}this.open=true;storageStore.checkoutSessionId=s;stripeStore.clientSecret=n;void this.setToFinishStep(c);return[2,{shouldAllowOrder:false}]}if(!t){log("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}log("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.initializeTestKeys=function(){storageStore.enabledVariantTestKeys=filterExpiredTests(storageStore.enabledVariantTestKeys||[]);var e=zonosStore.enabledVariantTestKeys.map((function(e){var o;var t=(o=storageStore.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()+VARIANT_TEST_KEY_EXPIRATION,selectedVariantKey:(t===null||t===void 0?void 0:t.selectedVariantKey)||null,testKey:e}}));storageStoreSetEnabledVariantTestKeys(e);return{allSelected:false}};this.shouldAllowHostedVsNativeTest=function(){if(typeof zonosStore.checkoutSettings.createCartId!=="function"){return false}var e=zonosStore.enabledVariantTestKeys.includes("hosted_vs_native");if(!e){return false}return true};this.registerTestHostedVsNative=function(){return __awaiter(o,void 0,void 0,(function(){var e,o,t,r;return __generator(this,(function(n){switch(n.label){case 0:e=this.shouldAllowHostedVsNativeTest();if(!e){return[2]}log("[TEST] - Registering hosted vs native test");o=getSelectedTestVariant("hosted_vs_native");if(o){log("[TEST] - Hosted vs native test already has variant selected: ".concat(o));return[2]}return[4,selectVarianceTest({testKeys:["hosted_vs_native"]})];case 1:t=n.sent();if(!t){log("[TEST] - Failed to get selection for hosted vs native test");return[2]}r=mergeTest({baseTestObj:storageStore.enabledVariantTestKeys||[],mergeTestObj:t});storageStoreSetEnabledVariantTestKeys(r);return[2]}}))}))};this.handleHostedVsNative=function(){return __awaiter(o,void 0,void 0,(function(){var e,o,t,r,n,s,i,a;return __generator(this,(function(c){switch(c.label){case 0:o=this.shouldAllowHostedVsNativeTest();if(!o){return[2,{redirected:false}]}t=getSelectedTestVariant("hosted_vs_native");log("[TEST] - hosted_vs_native: ".concat(t));if(typeof zonosStore.checkoutSettings.createCartId!=="function"){log("[TEST] - createCartId is not provided, skipping hosted vs native test");return[2,{redirected:false}]}if(t!=="hosted"){log("[TEST] - Hosted vs native test is enabled for native, skipping");return[2,{redirected:false}]}if(!((e=zonosStore.genericSettings)===null||e===void 0?void 0:e.hostedCheckoutUrl)){log("[TEST] - Hosted checkout URL is not provided");return[2,{redirected:false}]}log('"createCartId" is provided, start building cart');return[4,zonosStore.checkoutSettings.createCartId()];case 1:r=c.sent();s=null;if(typeof r==="object"){n=r.cartId;s=r.shippingData||null}else{n=r}i=getLegacyQueryParams();a=buildCartUrl(Object.assign(Object.assign({cartId:n,checkoutSessionId:storageStore.checkoutSessionId||undefined,hostedCheckoutUrl:zonosStore.genericSettings.hostedCheckoutUrl,isTestMode:getIsTestMode(),isVariantTest:true},i),s));log("[TEST] - Redirecting to: ".concat(a));window.open(a,"_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(cartStore.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=cartStore.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(o.defaultCustomerProfileAddress.length){return o.defaultCustomerProfileAddress}if(Array.isArray(o.defaultAddress)&&o.defaultAddress.length){return o.defaultAddress}if(!Array.isArray(o.defaultAddress)&&typeof o.defaultAddress==="object"){return[o.defaultAddress]}return o.defaultAddressParams};this.handleHostedOpenWindowCallback=function(e){var o;var t=(o=zonosStore.genericSettings)===null||o===void 0?void 0:o.hostedCheckoutUrl;if(!origin){return}var r=["dev.checkout.elements.zonos.com"].some((function(o){return e.origin.includes(o)}));if(e.origin!==t&&!r){return}switch(e.data.type){case"zonos-checkout-session-update":storageStore.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){storageStore.checkoutSessionId=t}var r=storageStore.enabledVariantTestKeys||[];if(window.Zonos.isLegacyCheckout){var n=getSelectedTestVariant("hosted_vs_native");if(!n){r.push({expiresAt:Date.now()+VARIANT_TEST_KEY_EXPIRATION,selectedVariantKey:"hosted",testKey:"hosted_vs_native"});storageStoreSetEnabledVariantTestKeys(r)}else{storageStoreSetEnabledVariantTestKeys(r.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 cartStoreUpdateItems({adjustments:cartStore.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(r){if(!this.open){return[2]}if(!(e===null||e===void 0?void 0:e.confirmed)){this.confirmDialogOpen=true;return[2]}this.confirmDialogOpen=false;submitGtag("zonos-checkout-close");this.open=this.forceDialogOpen||false;if(!this.preview&&cartStore.step==="finish"){cartStoreReset()}cartStore.step="customer-info";cartStoreResetTabItems();cartStoreClearCheckoutInterval();(t=(o=zonosStore.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,r,n,s,i,a,s,i,i,c,u,s,d;return __generator(this,(function(l){switch(l.label){case 0:if(!(typeof zonosStore.checkoutSettings.createCartId==="function"))return[3,4];log('"createCartId" is provided, start building cart');return[4,zonosStore.checkoutSettings.createCartId()];case 1:e=l.sent();o=void 0;if(typeof e==="object"){log("object detected, use cartId and prefill address from createCartId","info",e);o=e.cartId;this.useShippingDataFromCreateCartId(e.shippingData);cartStore.customerAuthenticationToken=e.customerAuthenticationToken||null}else{o=e}window.Zonos.cartId=o;return[4,setupCartData(o)];case 2:t=l.sent();r=t===null||t===void 0?void 0:t.cartData;if(!r){logError("Failed to build cart, please try again.");return[2,false]}window.Zonos.cartData=r;n=buildCartItemsByTempCart(r),s=n.adjustments,i=n.cartItems;return[4,cartStoreUpdateItems({adjustments:s,cartItems:i})];case 3:l.sent();return[3,9];case 4:if(!window.Zonos.cartData)return[3,6];log("tempCartUUID is provided, start building cart");a=buildCartItemsByTempCart(window.Zonos.cartData),s=a.adjustments,i=a.cartItems;return[4,cartStoreUpdateItems({adjustments:s,cartItems:i})];case 5:l.sent();return[3,9];case 6:if(!(zonosStore.checkoutSettings.buildCartDetail&&localizationStore.selectedCountryCode))return[3,9];log("build cart detail");return[4,zonosStore.checkoutSettings.buildCartDetail({countryCode:localizationStore.selectedCountryCode,currencyCode:localizationStore.targetCurrency})];case 7:i=l.sent();c=i.filter((function(e){return e.amount>=0}));u=i.filter((function(e){return e.amount<0}));log("cartItems","info",{cartItems:i});s=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,cartStoreUpdateItems({adjustments:s,cartItems:c})];case 8:l.sent();l.label=9;case 9:if(!!storageStore.checkoutSessionId)return[3,11];return[4,stripeStoreInitCheckoutSession()];case 10:d=l.sent();log("stripeStoreInitCheckoutSession: ".concat(d));if(!d){return[2,false]}l.label=11;case 11:if(!cartStore.isStagingMode){void stripeStoreGetPaymentIntent()}return[4,this.applyStripeTheme()];case 12:l.sent();this.isRedirectAfterOrder=zonosStore.checkoutSettings.successBehavior==="REDIRECT_TO_SUCCESS_PAGE"||!!cartStore.externalConfirmationPageURL;return[2,true]}}))}))};e.prototype.reloadCheckoutSession=function(){window.location.reload()};e.prototype.handleOrderDuplication=function(){var e=jsonParse(localStorage.getItem("zonos--placed-order-info"));if(!e){localStorage.removeItem("zonos--placed-order-info");return}var o=Date.now()-e.time;log("=== 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")||ORDER_DUPLICATION_NOTIFICATION_EXPIRATION;if(o>t){log("=== Existing placed order info is older than ".concat(t,"ms, cleaning localStorage"),"warn");localStorage.removeItem("zonos--placed-order-info");return}this.placedOrderInfo=e;log("=== Showing order duplication confirmation","warn")};e.prototype.recordCheckoutInfo=function(){if(!storageStore.checkoutSessionId){return}void updateCheckoutSessionAttributes({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:storageStore.checkoutSessionId})};e.prototype.confirmProceedWithOrderDuplication=function(){this.placedOrderInfo=null;if(!storageStore.checkoutSessionId){return}void updateCheckoutSessionAttributes({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:storageStore.checkoutSessionId})};e.prototype.markTheSessionAsAbandonedCart=function(){if(!storageStore.checkoutSessionId){return}void updateCheckoutSessionAttributes({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:storageStore.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)||zonosStore.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=zonosStore.checkoutSettings.placeOrderButtonSelector;var t=zonosStore.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;log("attach checkout ".concat(o));log("attach checkout to always trigger international checkout selector: ".concat(t));if(!o&&!t&&!window.Zonos.cartData){return}var r=[o,t,"#".concat(domesticRedirectedBtnSelector),"#".concat(checkoutHiddenBtnSelector),"#".concat(checkoutHiddenInternationalBtnSelector)].filter(Boolean);var n=document.querySelectorAll(r.join(","));n.forEach((function(r){var n=r.getAttribute("data-zonos-checkout-attached");if(n){return}log("attached event to button ".concat(o),"info",{button:r});r.addEventListener("click",(function(o){return __awaiter(e,void 0,void 0,(function(){var e,n,s,i,a,c,u,d,l,h,f,m,g,v,p,z;return __generator(this,(function(S){switch(S.label){case 0:s=performance.now();i=t&&r.matches(t);a=r.matches("#".concat(checkoutHiddenInternationalBtnSelector));c=r.matches("#".concat(domesticRedirectedBtnSelector))||r.matches("#".concat(checkoutHiddenBtnSelector));if(!window.Zonos.isLegacyCheckout&&(!isShippableCountry()||isDisabledCountry())&&!i&&!a&&!c){return[2]}o.preventDefault();o.stopPropagation();log("zonos checkout button clicked");return[4,this.checkStripePaymentIntentStatus({triggeredButton:o.target})];case 1:u=S.sent().shouldAllowOrder;if(!u){return[2]}if(!window.Zonos.logIntervalId){window.Zonos.logIntervalId=setInterval((function(){void sendBulkLoadTimeApiLog()}),2e3)}if(!isTestEnabled("hosted_vs_native"))return[3,4];this.isOverlayLoading=true;return[4,this.registerTestHostedVsNative()];case 2:S.sent();return[4,this.handleHostedVsNative()];case 3:d=S.sent().redirected;this.isOverlayLoading=false;if(d){return[2]}S.label=4;case 4:stripeStore.isFetchingSession=true;this.open=true;S.label=5;case 5:S.trys.push([5,8,,9]);return[4,this.buildCartAndInit()];case 6:l=S.sent();if(!l){throw new Error("Error building cart")}(e=window.opener)===null||e===void 0?void 0:e.postMessage({checkoutSessionId:storageStore.checkoutSessionId,type:"zonos-checkout-session-update"},"*");cartStoreStartCheckoutInterval({isPreview:this.preview,sessionTimeout:CHECKOUT_SESSION_TIMEOUT});submitGtag("zonos-checkout-start");h=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:h,eventName:"checkout_open"});return[4,isStoreDiscountEnabled()];case 7:f=S.sent().enabled;cartStore.shouldHideDiscountInput=!f;this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void sendLoadCheckoutFacadeLog()}else{m=performance.now();g=m-s;void sendLoadNativeCheckoutLog({loadTime:g})}this.recordCheckoutInfo();v=!!getAbandonedCartRenewTokenValue();if(v){this.markTheSessionAsAbandonedCart()}return[3,9];case 8:p=S.sent();if(p instanceof Error){z=p.message;if(z==="Cart is expired."){this.isCartExpired=true}}stripeStore.isFetchingSession=false;logError(p);if(this.isCartExpired){stripeStore.isFetchingSession=true;return[2]}void sendErrorLog({endpoint:"Error creating Checkout",errors:[p instanceof Error?p.toString():"Unknown error"],metadata:{allLogs:allLogs,cartId:window.Zonos.cartId,checkoutSessionBody:getCheckoutSessionBody(),href:window.location.href,storeBaseUrl:((n=window.Zonos.cartData)===null||n===void 0?void 0:n.storeBaseUrl)||zonosStore.onlineStoreSettings.url}});cartStoreUpdateToErrorState({messages:[translate("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:translate("Error creating Checkout")});return[3,9];case 9:return[2]}}))}))}),{capture:true,passive:false});if(!zonosStore.checkoutSettings.disablePlaceOrderButtonActivation){r.removeAttribute("disabled")}r.setAttribute("data-zonos-checkout-attached","true");if(r.matches("#".concat(domesticRedirectedBtnSelector))){r.dispatchEvent(createCustomEvent("click"));stripeStoreCleanupDomesticShippingSession();r.remove()}if(r.matches("#".concat(checkoutHiddenBtnSelector))){r.dispatchEvent(createCustomEvent("click"));r.remove()}}))};e.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}void this.applyStripeTheme()};e.prototype.useShippingDataFromCreateCartId=function(e){if(!e){return}log("shipping data from createCartId result","info",Object.entries(e));var o=e.customerAddress1,t=e.customerAddress2,r=e.customerCity,n=e.customerCountry,s=e.customerEmail,i=e.customerFirstName,a=e.customerLastName,c=e.customerName,u=e.customerPhone,d=e.customerState,l=e.customerZip;var h=new URLSearchParams(window.location.search);var f=n||getZCountryUrlParam(h)||localizationStore.selectedCountryCode;this.applyPrefillAddress({customerAddress1:o,customerAddress2:t,customerCity:r,customerCountry:f,customerEmail:s,customerFirstName:i,customerLastName:a,customerName:c,customerPhone:u,customerState:d,customerZip:l})};e.prototype.useLegacyQueryParams=function(){var e=new URLSearchParams(window.location.search);log("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=getZCountryUrlParam(e)||localizationStore.selectedCountryCode;var r=o("customerCity");var n=o("customerEmail");var s=o("customerAddress1");var i=o("customerAddress2");var a=o("customerName");var c=o("customerFirstName");var u=o("customerLastName");var d=o("customerPhone");var l=o("customerZip");var h=o("customerState");this.applyPrefillAddress({customerAddress1:s,customerAddress2:i,customerCity:r,customerCountry:t,customerEmail:n,customerFirstName:c,customerLastName:u,customerName:a,customerPhone:d,customerState:h,customerZip:l})};e.prototype.applyPrefillAddress=function(e){var o=e.customerAddress1||"";var t=e.customerCountry||"";var r=e.customerAddress2||"";var n=e.customerCity||"";var s=e.customerEmail||"";var i=e.customerFirstName&&e.customerLastName?"".concat(e.customerFirstName," ").concat(e.customerLastName):e.customerName||"";var a=e.customerPhone||"";var c=e.customerZip||"";var u=e.customerState||"";if(!o||!i||!a||!t){log("Missing required query params so it can not be prefilled","info",[!o&&"line1",!i&&"name",!a&&"phone",!t&&"country"].filter(Boolean).join(", "));return}if(t&&localizationStore.shippingZoneCountries&&!(t in localizationStore.shippingZoneCountries)){log('Country "'.concat(t,'" is not in the shipping zone, so it can not be prefilled'),"warn");return}this.defaultAddressParams=[{address:{city:n||"",country:t,line1:o,line2:r,postal_code:c,state:u},email:s,name:i,phone:a}];log("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:e})};e.prototype.overrideStagingModeChanged=function(){cartStore.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){stripeStore.stripe=window.Zonos.stripe;this.stripe=window.Zonos.stripe;cartStore.isStagingMode=getIsStagingMode();if(typeof this.overrideStagingMode!=="undefined"){cartStore.isStagingMode=this.overrideStagingMode}watchBigcommerceDomesticCheckout({domesticRedirectedBtnSelector:domesticRedirectedBtnSelector,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(){stripeStore.stripe=window.Zonos.stripe;o.stripe=window.Zonos.stripe;if(!o.stripe){log("waiting for stripe to be loaded");return}if(o.storybookPaymentStatusOverride){clearInterval(e);return}log("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.setToFinishStep=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){cartStore.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){cartStoreSetCheckoutSession(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(checkoutHiddenInternationalBtnSelector));if(e){e.dispatchEvent(createCustomEvent("click"))}return[2]}))}))};e.prototype.handleCustomerInfoContinue=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,r,n,s,i,a;var c=this;return __generator(this,(function(u){switch(u.label){case 0:submitGtag("zonos-checkout-customer-info");n=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:n,eventName:"checkout_customerInfoCompleted"});this.submitLoading=true;return[4,stripeStorePrefetchLandedCost()];case 1:s=u.sent().isRequestNotReady;if(s&&cartStore.addressFormRenderType==="stripe"){void sendErrorLog({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:(o=(e=stripeStore.stripeAddressEventData)===null||e===void 0?void 0:e.value)===null||o===void 0?void 0:o.address,billingAddress:(r=(t=stripeStore.stripeBillingAddressEventData)===null||t===void 0?void 0:t.value)===null||r===void 0?void 0:r.address,cartId:window.Zonos.cartId}})}i=function(e){if(cartStore.step!=="customer-info"){clearInterval(e);return}if(!stripeStore.isFetchingLandedCost){if(cartStore.landedCostData){void paypalInitScript({currency:cartStore.currency});cartStoreNextStep()}c.submitLoading=false;if(e){clearInterval(e)}}};i();a=setInterval((function(){i(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){cartStoreNextStep();return[2]}))}))};e.prototype.handleInventoryCheckDialogConfirm=function(){cartStore.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,r,n;return __generator(this,(function(s){switch(s.label){case 0:e=stripeStore.checkoutSettlementCurrency==="USD";if(e&&stripeStore.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;paypalStore.paypalErrorMessage=null;stripeStore.hasPaymentError=false;this.submitLoading=true;cartStore.inventoryCheckErrorMessage=null;return[4,stripeStoreUpdateCheckoutSessionBaseCurrency()];case 1:o=s.sent();if(!o){stripeStore.hasPaymentError=true;stripeStore.customErrorMessage=translate("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:stripeStore.checkoutSettlementCurrency});this.submitLoading=false;return[2]}s.label=2;case 2:s.trys.push([2,4,,5]);t=cartStore;return[4,stripeStoreHandleInventoryCheck()];case 3:t.inventoryCheckErrorMessage=s.sent();return[3,5];case 4:r=s.sent();cartStore.inventoryCheckErrorMessage=translate("Unable to check inventory. Please try again.");return[3,5];case 5:if(cartStore.inventoryCheckErrorMessage){this.submitLoading=false;return[2]}s.label=6;case 6:s.trys.push([6,8,,9]);return[4,stripeStoreConfirmPayment()];case 7:s.sent();cartStoreNextStep();cartStoreClearCheckoutInterval();return[3,9];case 8:n=s.sent();logError(n);submitGtag("zonos-checkout-payment-fail");stripeStore.hasPaymentError=true;if(stripeStore.shouldInventoryRefund){void stripeStoreHandleInventoryRefund();stripeStore.shouldInventoryRefund=false}return[3,9];case 9:this.submitLoading=false;return[2]}}))}))};e.prototype.handleFinishClick=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,r;return __generator(this,(function(n){switch(n.label){case 0:stripeStoreReset();if(!this.preview)return[3,2];cartStore.step="customer-info";return[4,this.init()];case 1:n.sent();return[2];case 2:cartStoreReset();if(window.Zonos.isLegacyCheckout&&window.Zonos.cartData){e=window.Zonos.cartData.storeBaseUrl||zonosStore.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;r=window.location.hostname.includes("dashboard.zonos.com");if(!r){window.history.replaceState(window.history.state,document.title,t);window.location.reload()}return[2]}}))}))};e.prototype.handleWindowResize=function(){this.isMobile=isCheckoutMobile(this.mobile);void this.applyStripeTheme();log("mobile: ".concat(this.isMobile))};e.prototype.handleMobileChange=function(){this.isMobile=isCheckoutMobile(this.mobile);void this.applyStripeTheme();log("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=getZonosStoreTheme(this.appearanceSettingsOverride.theme)}};e.prototype.handleAddressChange=function(){stripeStoreReset()};e.prototype.handleCustomerProfileChange=function(){var e,o;if(!this.customerProfile){log("No customer profile","info");this.defaultCustomerProfileAddress=[];return}log("Customer profile found","info",{customerProfile:this.customerProfile});this.defaultCustomerProfileAddress=((o=(e=stripeStore.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=stripeStore.customerProfile)===null||o===void 0?void 0:o.email)||"",name:e.name||"",phone:e.phone||""}})))||[]};e.prototype.handleClientSecretChange=function(){log("==== 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 r=o.getAttribute(e);var n=t.getAttribute(e);if(r){o.removeAttribute(e);o.style.overflow=r}else{o.style.removeProperty("overflow")}if(n){t.removeAttribute(e);t.style.overflow=n}else{t.style.removeProperty("overflow")}}};e.prototype.componentWillLoad=function(){var e=this;void this.init();this.isMobile=isCheckoutMobile(this.mobile);this.isIframed=window.self!==window.top;log("iframed: ".concat(this.isIframed));if(window.Zonos.isLegacyCheckout){this.captureParamsRedirectedForVariantTest()}this.handleAppearanceSettingsOverrideChange();this.storeUnsubscribeList=[localizationStoreOnChange("selectedLocale",(function(){void e.applyStripeTheme()})),cartStoreOnChange("selectedShippingOption",(function(){var o,t,r,n;var s=cartStore.selectedShippingOption;if(((o=zonosStore.genericSettings)===null||o===void 0?void 0:o.shouldFedExShippingConsentForCanadianShopper)&&((r=(t=s===null||s===void 0?void 0:s.shippingProfile)===null||t===void 0?void 0:t.serviceLevel.code)===null||r===void 0?void 0:r.toLowerCase().startsWith("fedex."))&&((n=stripeStore.stripeAddressEventData)===null||n===void 0?void 0:n.value.address.country)==="CA"){e.shouldShowFedexShippingConsentDialog=true}}))];this.initializeTestKeys();window.addEventListener("message",this.handleHostedOpenWindowCallback);log("mobile: ".concat(this.isMobile))};e.prototype.disconnectedCallback=function(){stripeStoreReset();cartStoreReset();this.storeUnsubscribeList.forEach((function(e){return e()}));window.removeEventListener("message",this.handleHostedOpenWindowCallback)};e.prototype.render=function(){var e=this;var o,t,r,n;this.customerProfile=stripeStore.customerProfile;this.clientSecret=stripeStore.clientSecret;if(stripeStore.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=stripeStore.stripeCustomerSessionClientSecret}var s=cartStore.step!=="finish"&&cartStore.step!=="error"&&!stripeStore.stripeElements||stripeStore.isFetchingSession;var i=mergeConfig(zonosStore.appearance,this.appearanceSettingsOverride||null),a=i.colorPrimary,c=i.colorSecondary,u=i.logoUrl,d=i.style;var l=zonosStore.appearance.zonosAttribution==="ENABLED";var f=zonosStore.appearance.theme;var m=a&&isDarkColor(a)?"DARK":"LIGHT";var g=this.isMobile?f:m;var v=!this.isMobile?c:undefined;var p=localizationStore.customMessages;var z=(o=p.find((function(e){return e.pageName==="checkout_default"})))===null||o===void 0?void 0:o.message;var S=this.getCurrentLocalePageEnum();var k=p.filter((function(e){return e.pageName===S}));var w=this.getBaseCurrencySettlementInfo();var C=function(){var o=e.preview?"".concat(u,"?timestamp=").concat(Date.now()):u;return h("div",{class:"zonos--logo"},o&&h("img",{alt:"".concat(zonosStore.organizationName," logo"),src:o}))};var b=getIsTestMode();var y=function(){var o=new URLSearchParams(window.location.search);var t=o.get("zonosQaUrl");var r=o.get("zonosDebug");var n=o.get("zonosE2ETest");var s=e.overrideStagingMode||getIsStagingMode();return h("zonos-v-stack",null,h("div",{class:"zonos--logo-wrapper"},C(),b&&h("zonos-badge",{badgeColor:"orange",size:"small"},translate("Test mode")),s&&h("zonos-badge",{badgeColor:"red",size:"small"},translate("Staging mode")),r==="1"&&h("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&h("zonos-badge",{badgeColor:"purple",size:"small"},t),n&&h("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),h("zonos-checkout-progress-tabs",{backgroundColor:e.isMobile?"--zonos-elements-gray-0":null}),k.map((function(e){return h("zonos-custom-message",{icon:MessageIcon,message:e.message})})))};var _=function(){if(cartStore.checkoutSessionTimeoutShow){return h("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:translate("Your checkout session has expired. Please reload the page to continue."),restStateTitle:translate("Session timed out"),restStateType:"Warning"},h("zonos-button",{onClick:function(){return e.reloadCheckoutSession()},variant:"primary"},translate("Reload")))}return h("div",{class:"zonos--content",style:{"--zonos--border-radius":getBorderRadius({overrideBorderStyle:d})}},cartStore.step!=="finish"&&cartStore.step!=="error"&&h(Fragment,null,h("div",{class:"zonos--left","data-theme":g,style:styles({"--zonos--primary-color":!e.isMobile?a:undefined})},!e.isMobile&&y(),cartStore.step==="customer-info"&&h("zonos-customer-info",{continueLoading:e.submitLoading,defaultAddress:e.getDefaultAddress(),isMobile:e.isMobile,onContinueClicked:function(){return e.handleCustomerInfoContinue()},submitBtnColor:v}),cartStore.step==="shipping"&&h("zonos-shipping",{continueLoading:e.submitLoading,onContinueClicked:function(){return e.handleShippingContinue()},submitBtnColor:v}),cartStore.step==="payment"&&h("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:v})),h("div",{class:"zonos--right","data-theme":f},e.isMobile&&y(),h("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&h("zonos-currency-toggle",null),!e.isLegacyCheckout&&h("zonos-button",{class:"zonos--close-button",icon:h("zonos-icon",{"aria-label":"Close checkout dialog",content:RemoveIcon}),noBackground:true,onClick:function(){return e.closeDialogHandler()}})),h("div",{class:"flex--wrapper"},h("div",{class:"zonos--wrapper"},h("zonos-review",{collapsed:e.collapseReviewMobile,mobile:e.isMobile,onClick:function(){if(!e.isMobile){return}e.collapseReviewMobile=!e.collapseReviewMobile}}),h("zonos-collapse",{collapsed:e.collapseReviewMobile&&e.isMobile},h("zonos-cart-items",null),e.isMobile&&h("zonos-v-stack",{spacing:16},h("zonos-cart-subtotal",{submitBtnColor:v}),h("zonos-custom-message",{class:"zonos--checkout-default-message",icon:MessageIcon,message:z})))),h("zonos-cart-restricted-items",null),!e.isMobile&&h("zonos-v-stack",{spacing:16},h("zonos-cart-subtotal",null),h("zonos-custom-message",{class:"zonos--checkout-default-message",icon:MessageIcon,message:z}))))),(cartStore.step==="finish"||cartStore.step==="error")&&h("div",{class:"zonos--done","data-theme":f},h("div",{class:"zonos--header"},C(),!e.isRedirectAfterOrder&&h("zonos-button",{class:"zonos--close-button",icon:h("zonos-icon",{"aria-label":"Close checkout dialog",content:RemoveIcon}),noBackground:true,onClick:function(){return e.handleFinishClick()},theme:f})),h("zonos-checkout-finish",{borderRadius:d,onCloseClick:function(){return e.handleFinishClick()},overrideNotification:cartStore.step==="error"&&!!cartStore.error?Object.assign(Object.assign({},cartStore.error),{type:"error"}):undefined,storybookForceStatus:e.storybookPaymentStatusOverride})),h("zonos-checkout-footer",{"data-theme":f,mobile:e.isMobile,slot:!e.isMobile?"dialog-footer":undefined}))};return h(Host,{class:classes(["zonos--checkout zonos--elements",cartStore.step==="payment"&&"zonos--processing-payment",l&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?_():h("zonos-dialog",{borderStyle:d,"data-theme":f,height:"980px",isLoading:s,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return e.closeDialogHandler()},open:this.open,width:"1200px"},_()),h("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:translate("Don't close"),dialogConfirmBtnText:translate("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:translate("Would you like to close checkout and return to the site?"),dialogTitle:translate("Are you sure?"),onCancelClicked:function(){e.confirmDialogOpen=false},onConfirmClicked:function(){return e.closeDialogHandler({confirmed:true})}}),h("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:translate("Return to merchant site"),dialogConfirmBtnText:translate("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:((t=this.placedOrderInfo)===null||t===void 0?void 0:t.zonosOrderNumber)?translate("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)}):translate("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(((r=this.placedOrderInfo)===null||r===void 0?void 0:r.time)||null),time:this.formatTime(((n=this.placedOrderInfo)===null||n===void 0?void 0:n.time)||null)}),dialogTitle:translate("Are you sure?"),dialogWidth:530,onCancelClicked:function(){e.handleCancelOrderDuplication()},onConfirmClicked:function(){e.confirmProceedWithOrderDuplication()}}),h("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:translate("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:h(Fragment,null,translate("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."),h("zonos-link",{href:"https://ftn.fedex.com/us/assets/docs/One-Time_GAA.pdf",target:"_blank"},translate("View GAA Form."))),dialogTitle:translate("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:function(){return e.shouldShowFedexShippingConsentDialog=false}}),h("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:translate("Return to cart"),dialogIntent:"danger",dialogOpen:!!cartStore.inventoryCheckErrorMessage,dialogSubtitle:cartStore.inventoryCheckErrorMessage,dialogTitle:translate("Couldn't place order"),dialogType:"alert",onConfirmClicked:function(){return e.handleInventoryCheckDialogConfirm()}}),w&&h("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:translate("Cancel"),dialogConfirmBtnText:translate("Pay [orderTotal]",{orderTotal:currencyFormat({amount:w.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:translate("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:translate("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){e.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return e.handleStripePaymentContinue()}}),h("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:translate("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:translate("You are being sent back to the shop to re-add items to your cart."),dialogTitle:translate("Shopping cart expired"),dialogType:"alert",onConfirmClicked:function(){return e.handleCartExpiredDialogConfirm()}}),h("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}();ZonosCheckout.style=ZonosCheckoutStyle0;export{ZonosCheckout as zonos_checkout};
@@ -1 +1 @@
1
- import{r as registerInstance,h,H as Host,a as getElement}from"./index-0bbe9693.js";import{f as zonosStoreFontFamily}from"./zonosStore-b434e436.js";import"./VarianceTest-572cecf5.js";var zonosCollapseCss=":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{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";var ZonosCollapseStyle0=zonosCollapseCss;var ZonosCollapse=function(){function t(t){registerInstance(this,t);this.collapsed=false;this.collapseSize=0;this.height=this.el.scrollHeight;this.iframe=null}t.prototype.getElementHeight=function(){var t="".concat(this.height,"px");var o="".concat(this.collapseSize,"px");return this.collapsed?o:t};t.prototype.componentDidLoad=function(){this.height=this.el.scrollHeight};t.prototype.componentDidRender=function(){var t=this;var o,s,e;this.iframe=((o=this.el.shadowRoot)===null||o===void 0?void 0:o.querySelector("iframe"))||null;(e=(s=this.iframe)===null||s===void 0?void 0:s.contentWindow)===null||e===void 0?void 0:e.addEventListener("resize",(function(){if(!t.iframe){return}t.height=parseFloat(getComputedStyle(t.iframe).height)}))};t.prototype.render=function(){var t=this;if(!this.collapsed){setTimeout((function(){if(!t.collapsed){t.el.style.overflow="visible"}}),300)}else{this.el.style.overflow="hidden"}return h(Host,{key:"c63b825021f8aaf17727e37072c3701e4a55b992",class:"zonos--elements zonos--collapse",style:{"--zonos--font-family":zonosStoreFontFamily(),height:this.getElementHeight()}},h("div",{key:"bc51b1a1318b0934c752ae74dfeae8d5f43f1a63"},h("iframe",{key:"0bb69f8aaa5c095bc90f2210fab3770491867754",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),h("slot",{key:"64fdc09e82d28f57fd081578ebd2a3523760c7c7"})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ZonosCollapse.style=ZonosCollapseStyle0;export{ZonosCollapse as zonos_collapse};
1
+ import{r as registerInstance,h,H as Host,a as getElement}from"./index-0bbe9693.js";import{f as zonosStoreFontFamily}from"./zonosStore-b434e436.js";import"./VarianceTest-572cecf5.js";var zonosCollapseCss=":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{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";var ZonosCollapseStyle0=zonosCollapseCss;var ZonosCollapse=function(){function t(t){registerInstance(this,t);this.collapsed=false;this.collapseSize=0;this.height=this.el.scrollHeight;this.iframe=null}t.prototype.getElementHeight=function(){var t="".concat(this.height,"px");var o="".concat(this.collapseSize,"px");return this.collapsed?o:t};t.prototype.componentDidLoad=function(){this.height=this.el.scrollHeight};t.prototype.componentDidRender=function(){var t=this;var o,e,s;this.iframe=((o=this.el.shadowRoot)===null||o===void 0?void 0:o.querySelector("iframe"))||null;(s=(e=this.iframe)===null||e===void 0?void 0:e.contentWindow)===null||s===void 0?void 0:s.addEventListener("resize",(function(){if(!t.iframe){return}t.height=parseFloat(getComputedStyle(t.iframe).height)}))};t.prototype.render=function(){var t=this;if(!this.collapsed){setTimeout((function(){if(!t.collapsed){t.el.style.overflow="visible"}}),300)}else{this.el.style.overflow="hidden"}return h(Host,{key:"2a96e5ed214d93d07057eb7958a26e8a7b286ce8",class:"zonos--elements zonos--collapse",style:{"--zonos--font-family":zonosStoreFontFamily(),height:this.getElementHeight()}},h("div",{key:"d2a039a3cde3c54bd560774d91cf36924311e251"},h("iframe",{key:"a2b1494c32fcd8a467e23ae6733fd341220a9020",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),h("slot",{key:"5dd47c6e903a01824ed04a9512b847180e67f667"})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ZonosCollapse.style=ZonosCollapseStyle0;export{ZonosCollapse as zonos_collapse};
@@ -1 +1 @@
1
- var __spreadArray=this&&this.__spreadArray||function(o,t,s){if(s||arguments.length===2)for(var e=0,a=t.length,n;e<a;e++){if(n||!(e in t)){if(!n)n=Array.prototype.slice.call(t,0,e);n[e]=t[e]}}return o.concat(n||Array.prototype.slice.call(t))};import{r as registerInstance,d as getAssetPath,h,H as Host}from"./index-0bbe9693.js";import{e as cartStore}from"./cart-14f305b3.js";import{c as cleanHtmlMarkdown}from"./cleanHtmlMarkdown-b5b18743.js";import{f as zonosStoreFontFamily}from"./zonosStore-b434e436.js";import{c as classes}from"./classes-0d95c529.js";import{s as styles}from"./styles-6fc2fad9.js";import"./localization-c5029ffc.js";import"./handleFetch-a844cac1.js";import"./VarianceTest-572cecf5.js";import"./translationStore-690c4e04.js";import"./isDarkColor-9ddd90cc.js";import"./getBorderRadius-877f6389.js";var zonosCollectCartItemsCss=":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 .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:8px;padding-left:0;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column:first-child{width:48px}:host .zonos--cart-table td{vertical-align:middle}:host .zonos--cart-item-price zonos-text{white-space:nowrap}:host img{min-width:40px;margin-top:6px;-webkit-box-shadow:0 0 0 1px rgba(110, 110, 120, 0.1), 0 1px 2px 0 rgba(10, 10, 11, 0.06), 0 1px 3px 0 rgba(10, 10, 11, 0.1);box-shadow:0 0 0 1px rgba(110, 110, 120, 0.1), 0 1px 2px 0 rgba(10, 10, 11, 0.06), 0 1px 3px 0 rgba(10, 10, 11, 0.1);border-radius:10px}";var ZonosCollectCartItemsStyle0=zonosCollectCartItemsCss;var ZonosCollectCartItems=function(){function o(o){registerInstance(this,o);this.errorImages=[]}o.prototype.render=function(){var o=this;var t=getAssetPath("./assets/empty-item.jpeg");var s=cartStore.items.filter((function(o){return!o.isRestricted}));return h(Host,{key:"2f5507537492851b67a5204ab68ce2f938899f23",class:"zonos--collect-cart-items zonos--elements"},h("table",{key:"e648cda9d4c111ecde60291f420178e4e4230b50",class:"zonos--cart-table"},h("tbody",{key:"b266291e61d0df5c0ea3ae8240a3bfb6147edbb4"},s.map((function(s){var e=s.imageUrl;var a=cleanHtmlMarkdown(s.name);return h("tr",{class:"zonos--collect-cart-item"},h("td",{class:"zonos--column zonos--cart-item-image"},e&&!o.errorImages.includes(e)?h("img",{alt:s.name,onError:function(){o.errorImages=__spreadArray(__spreadArray([],o.errorImages,true),[e],false)},src:s.imageUrl,style:{"min-width":"40px"},width:40}):h("img",{alt:s.name,src:t,width:40})),h("td",{class:"zonos--column zonos--cart-item-name"},h("div",null,a.map((function(o){return h("zonos-text",{type:"semiBoldLabel"},o)})))))})))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCollectCartItems.style=ZonosCollectCartItemsStyle0;var zonosHStackCss=":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:row;flex-direction:row;gap:var(--spacing, 24px)}";var ZonosHStackStyle0=zonosHStackCss;var HStack=function(){function o(o){registerInstance(this,o);this.spacing=24}o.prototype.render=function(){return h(Host,{key:"92689fdc45c9e980d61f9b96c378ca52ed37a608",style:{"--spacing":"".concat(this.spacing,"px"),"--zonos--font-family":zonosStoreFontFamily()}},h("slot",{key:"b94e0bcd372d0194ba2a86b570914fe33af427cd"}))};return o}();HStack.style=ZonosHStackStyle0;var zonosSkeletonCss=":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:inline-block;background:var(--zonos-elements-gray-200);border-radius:var(--zonos-elements-radius-12);width:var(--zonos--skeleton-width);height:var(--zonos--skeleton-height);min-height:var(--zonos--skeleton-height);max-width:100%}";var ZonosSkeletonStyle0=zonosSkeletonCss;var ZonosSkeleton=function(){function o(o){registerInstance(this,o);this.skeletonWidth="100%";this.skeletonHeight="14px"}o.prototype.render=function(){return h(Host,{key:"4ffa2b8c03f0c8d3bd08521d950903cba9685109",class:classes(["zonos--elements zonos--skeleton"]),style:styles({"--zonos--skeleton-height":this.skeletonHeight,"--zonos--skeleton-width":this.skeletonWidth})})};return o}();ZonosSkeleton.style=ZonosSkeletonStyle0;export{ZonosCollectCartItems as zonos_collect_cart_items,HStack as zonos_h_stack,ZonosSkeleton as zonos_skeleton};
1
+ var __spreadArray=this&&this.__spreadArray||function(o,t,s){if(s||arguments.length===2)for(var e=0,a=t.length,n;e<a;e++){if(n||!(e in t)){if(!n)n=Array.prototype.slice.call(t,0,e);n[e]=t[e]}}return o.concat(n||Array.prototype.slice.call(t))};import{r as registerInstance,d as getAssetPath,h,H as Host}from"./index-0bbe9693.js";import{e as cartStore}from"./cart-66aecbb3.js";import{c as cleanHtmlMarkdown}from"./cleanHtmlMarkdown-b5b18743.js";import{f as zonosStoreFontFamily}from"./zonosStore-b434e436.js";import{c as classes}from"./classes-0d95c529.js";import{s as styles}from"./styles-6fc2fad9.js";import"./localization-04b05867.js";import"./handleFetch-a844cac1.js";import"./VarianceTest-572cecf5.js";import"./isDarkColor-9ddd90cc.js";import"./getBorderRadius-877f6389.js";var zonosCollectCartItemsCss=":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 .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:8px;padding-left:0;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column:first-child{width:48px}:host .zonos--cart-table td{vertical-align:middle}:host .zonos--cart-item-price zonos-text{white-space:nowrap}:host img{min-width:40px;margin-top:6px;-webkit-box-shadow:0 0 0 1px rgba(110, 110, 120, 0.1), 0 1px 2px 0 rgba(10, 10, 11, 0.06), 0 1px 3px 0 rgba(10, 10, 11, 0.1);box-shadow:0 0 0 1px rgba(110, 110, 120, 0.1), 0 1px 2px 0 rgba(10, 10, 11, 0.06), 0 1px 3px 0 rgba(10, 10, 11, 0.1);border-radius:10px}";var ZonosCollectCartItemsStyle0=zonosCollectCartItemsCss;var ZonosCollectCartItems=function(){function o(o){registerInstance(this,o);this.errorImages=[]}o.prototype.render=function(){var o=this;var t=getAssetPath("./assets/empty-item.jpeg");var s=cartStore.items.filter((function(o){return!o.isRestricted}));return h(Host,{key:"2f5507537492851b67a5204ab68ce2f938899f23",class:"zonos--collect-cart-items zonos--elements"},h("table",{key:"e648cda9d4c111ecde60291f420178e4e4230b50",class:"zonos--cart-table"},h("tbody",{key:"b266291e61d0df5c0ea3ae8240a3bfb6147edbb4"},s.map((function(s){var e=s.imageUrl;var a=cleanHtmlMarkdown(s.name);return h("tr",{class:"zonos--collect-cart-item"},h("td",{class:"zonos--column zonos--cart-item-image"},e&&!o.errorImages.includes(e)?h("img",{alt:s.name,onError:function(){o.errorImages=__spreadArray(__spreadArray([],o.errorImages,true),[e],false)},src:s.imageUrl,style:{"min-width":"40px"},width:40}):h("img",{alt:s.name,src:t,width:40})),h("td",{class:"zonos--column zonos--cart-item-name"},h("div",null,a.map((function(o){return h("zonos-text",{type:"semiBoldLabel"},o)})))))})))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCollectCartItems.style=ZonosCollectCartItemsStyle0;var zonosHStackCss=":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:row;flex-direction:row;gap:var(--spacing, 24px)}";var ZonosHStackStyle0=zonosHStackCss;var HStack=function(){function o(o){registerInstance(this,o);this.spacing=24}o.prototype.render=function(){return h(Host,{key:"8c80b04f02ebafcc0529bbc8a30fb71dae591a81",style:{"--spacing":"".concat(this.spacing,"px"),"--zonos--font-family":zonosStoreFontFamily()}},h("slot",{key:"9840c220581a016349627a61efdf9a4dc3f68bc9"}))};return o}();HStack.style=ZonosHStackStyle0;var zonosSkeletonCss=":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:inline-block;background:var(--zonos-elements-gray-200);border-radius:var(--zonos-elements-radius-12);width:var(--zonos--skeleton-width);height:var(--zonos--skeleton-height);min-height:var(--zonos--skeleton-height);max-width:100%}";var ZonosSkeletonStyle0=zonosSkeletonCss;var ZonosSkeleton=function(){function o(o){registerInstance(this,o);this.skeletonWidth="100%";this.skeletonHeight="14px"}o.prototype.render=function(){return h(Host,{key:"dc65462865ede6e9cb5a02f5c4f6bf43c550d0c7",class:classes(["zonos--elements zonos--skeleton"]),style:styles({"--zonos--skeleton-height":this.skeletonHeight,"--zonos--skeleton-width":this.skeletonWidth})})};return o}();ZonosSkeleton.style=ZonosSkeletonStyle0;export{ZonosCollectCartItems as zonos_collect_cart_items,HStack as zonos_h_stack,ZonosSkeleton as zonos_skeleton};