@zonos/elements 1.3.217 → 1.3.219

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 (411) hide show
  1. package/dist/cjs/buildCartItemsByTempCart-309fcebf.js +28 -0
  2. package/dist/cjs/{cart-54ff39d6.js → cart-9a2b32e4.js} +91 -48
  3. package/dist/cjs/cleanHtmlMarkdown-577d0a77.js +999 -0
  4. package/dist/cjs/{handleFetch-0313ebba.js → handleFetch-45f35cac.js} +2 -1
  5. package/dist/cjs/index.cjs.js +20 -10
  6. package/dist/cjs/isCollectMobileTablet-7e57fd90.js +172 -0
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/localization-b12edb2a.js +738 -0
  9. package/dist/cjs/{paypal-e7504122.js → paypal-e80871d0.js} +13 -9
  10. package/dist/cjs/placeTestOrder-8222fe95.js +93 -0
  11. package/dist/cjs/{localization-721a5ec3.js → translationStore-20a6d8bf.js} +963 -734
  12. package/dist/cjs/{updateCheckoutSessionAttributes-8db49644.js → updateCheckoutSessionAttributes-c0853fdd.js} +1 -1
  13. package/dist/cjs/zonos-address_11.cjs.entry.js +103 -73
  14. package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
  15. package/dist/cjs/{zonos-banner.cjs.entry.js → zonos-banner_2.cjs.entry.js} +40 -0
  16. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  17. package/dist/cjs/{zonos-cart-items_14.cjs.entry.js → zonos-cart-items_12.cjs.entry.js} +75 -1294
  18. package/dist/cjs/zonos-checkout.cjs.entry.js +27 -50
  19. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
  20. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +92 -0
  21. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +810 -0
  22. package/dist/cjs/zonos-collect.cjs.entry.js +468 -0
  23. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  24. package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +168 -0
  25. package/dist/cjs/zonos-controller.cjs.entry.js +85 -29
  26. package/dist/cjs/zonos-country-flag.cjs.entry.js +3 -2
  27. package/dist/cjs/zonos-country-select_4.cjs.entry.js +12 -11
  28. package/dist/cjs/zonos-elements.cjs.js +1 -1
  29. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +16 -6
  30. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +35 -34
  31. package/dist/cjs/zonos-hello.cjs.entry.js +9 -8
  32. package/dist/cjs/zonos-input.cjs.entry.js +4 -4
  33. package/dist/cjs/zonos-language-select_2.cjs.entry.js +7 -6
  34. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  35. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  36. package/dist/cjs/zonos-stripe-input.cjs.entry.js +8 -5
  37. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  38. package/dist/cjs/zonos-toggle.cjs.entry.js +2 -2
  39. package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
  40. package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
  41. package/dist/collection/collection-manifest.json +10 -0
  42. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +3 -0
  43. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +2 -2
  44. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +5 -1
  45. package/dist/collection/components/checkout/zonos-collect/assets/ChevronDownIcon.svg +1 -0
  46. package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/assets/empty-item.jpeg +0 -0
  47. package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.css +60 -0
  48. package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.js +39 -0
  49. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/assets/RemoveIcon.svg +1 -0
  50. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/assets/SuccessIcon.svg +1 -0
  51. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.css +84 -0
  52. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +403 -0
  53. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/chevronDownIcon.svg +1 -0
  54. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/globe.svg +3 -0
  55. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosIconDark.svg +10 -0
  56. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosIconLight.svg +10 -0
  57. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/assets/zonosWordmark.svg +7 -0
  58. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.css +152 -0
  59. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.js +164 -0
  60. package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/assets/ChevronDownIcon.svg +1 -0
  61. package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/assets/ChevronUpIcon.svg +1 -0
  62. package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.css +109 -0
  63. package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.js +194 -0
  64. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/assets/CheckmarkLineIcon.svg +1 -0
  65. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/assets/RemoveLineIcon.svg +1 -0
  66. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.css +98 -0
  67. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +369 -0
  68. package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.css +68 -0
  69. package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.js +151 -0
  70. package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.css +78 -0
  71. package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.js +115 -0
  72. package/dist/collection/components/checkout/zonos-collect/zonos-collect.css +349 -0
  73. package/dist/collection/components/checkout/zonos-collect/zonos-collect.js +547 -0
  74. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  75. package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
  76. package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
  77. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
  78. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
  79. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  80. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
  81. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +3 -3
  82. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  83. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  84. package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.css +38 -0
  85. package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.js +63 -0
  86. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  87. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  88. package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
  89. package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +1 -1
  90. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  91. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
  92. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  93. package/dist/collection/components/common/zonos-skeleton/assets/RemoveLineIcon.svg +3 -0
  94. package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.css +40 -0
  95. package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.js +102 -0
  96. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +8 -5
  97. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +5 -5
  98. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +5 -5
  99. package/dist/collection/components/common/zonos-text/zonos-text.css +1 -0
  100. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
  101. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  102. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  103. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
  104. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  105. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  106. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  107. package/dist/collection/components/main/zonos-controller.js +91 -25
  108. package/dist/collection/components/paypal/zonos-paypal-payment.js +13 -2
  109. package/dist/collection/components/store/checkout/cart.js +36 -15
  110. package/dist/collection/components/store/checkout/collect.js +157 -0
  111. package/dist/collection/components/store/checkout/paypal.js +4 -2
  112. package/dist/collection/components/store/checkout/stripe.js +31 -12
  113. package/dist/collection/components/store/translationStore/strings.arabic.js +48 -0
  114. package/dist/collection/components/store/translationStore/strings.base.js +48 -0
  115. package/dist/collection/components/store/translationStore/strings.chinese.js +48 -0
  116. package/dist/collection/components/store/translationStore/strings.danish.js +48 -0
  117. package/dist/collection/components/store/translationStore/strings.dutch.js +48 -0
  118. package/dist/collection/components/store/translationStore/strings.french.js +48 -0
  119. package/dist/collection/components/store/translationStore/strings.german.js +48 -0
  120. package/dist/collection/components/store/translationStore/strings.hebrew.js +48 -0
  121. package/dist/collection/components/store/translationStore/strings.indonesian.js +48 -0
  122. package/dist/collection/components/store/translationStore/strings.italian.js +48 -0
  123. package/dist/collection/components/store/translationStore/strings.japanese.js +48 -0
  124. package/dist/collection/components/store/translationStore/strings.korean.js +48 -0
  125. package/dist/collection/components/store/translationStore/strings.norwegian.js +48 -0
  126. package/dist/collection/components/store/translationStore/strings.polish.js +48 -0
  127. package/dist/collection/components/store/translationStore/strings.portuguese.js +48 -0
  128. package/dist/collection/components/store/translationStore/strings.russian.js +48 -0
  129. package/dist/collection/components/store/translationStore/strings.spanish.js +48 -0
  130. package/dist/collection/components/store/translationStore/strings.swedish.js +48 -0
  131. package/dist/collection/components/store/translationStore/strings.turkish.js +48 -0
  132. package/dist/collection/components/store/translationStore/strings.vietnamese.js +48 -0
  133. package/dist/collection/components/store/translationStore.js +2 -1
  134. package/dist/collection/components/stripe/zonos-address/zonos-address.js +35 -18
  135. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -2
  136. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
  137. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +15 -2
  138. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  139. package/dist/collection/components/utils/checkout/initCollect.js +15 -0
  140. package/dist/collection/components/utils/checkout/isCollectMobileTablet.js +10 -0
  141. package/dist/collection/components/utils/checkout/renderCheckoutCurrency.js +10 -1
  142. package/dist/collection/components/utils/getNextFallbackApi.js +1 -1
  143. package/dist/collection/components/utils/handleFetch.js +1 -0
  144. package/dist/collection/components/utils/renderFallback.js +7 -0
  145. package/dist/collection/scripts/_getZonosQaUrl.js +5 -1
  146. package/dist/collection/scripts/_zonosBase.js +7 -1
  147. package/dist/collection/types/checkout/api/PartyInfo.js +1 -0
  148. package/dist/collection/types/generated/graphql.internal.types.js +103 -0
  149. package/dist/collection/types/index.js +1 -0
  150. package/dist/esm/buildCartItemsByTempCart-c4488f73.js +26 -0
  151. package/dist/esm/{cart-010402f9.js → cart-acf4ebf5.js} +69 -28
  152. package/dist/esm/cleanHtmlMarkdown-b5b18743.js +997 -0
  153. package/dist/esm/{handleFetch-fa90f7f6.js → handleFetch-99218189.js} +2 -1
  154. package/dist/esm/index.js +20 -10
  155. package/dist/esm/isCollectMobileTablet-b72b81c5.js +165 -0
  156. package/dist/esm/loader.js +1 -1
  157. package/dist/esm/localization-8646f526.js +719 -0
  158. package/dist/esm/{paypal-70b140d9.js → paypal-2fa930eb.js} +8 -5
  159. package/dist/esm/placeTestOrder-d1ad9cf6.js +90 -0
  160. package/dist/esm/{localization-9db8b6e9.js → translationStore-c9743292.js} +963 -718
  161. package/dist/esm/{updateCheckoutSessionAttributes-691cdc6d.js → updateCheckoutSessionAttributes-92f42882.js} +1 -1
  162. package/dist/esm/zonos-address_11.entry.js +72 -42
  163. package/dist/esm/zonos-badge.entry.js +3 -3
  164. package/dist/esm/{zonos-banner.entry.js → zonos-banner_2.entry.js} +40 -1
  165. package/dist/esm/zonos-button_3.entry.js +3 -3
  166. package/dist/esm/{zonos-cart-items_14.entry.js → zonos-cart-items_12.entry.js} +24 -1241
  167. package/dist/esm/zonos-checkout.entry.js +8 -31
  168. package/dist/esm/zonos-collapse.entry.js +2 -2
  169. package/dist/esm/zonos-collect-cart-items_3.entry.js +86 -0
  170. package/dist/esm/zonos-collect-finish_6.entry.js +801 -0
  171. package/dist/esm/zonos-collect.entry.js +464 -0
  172. package/dist/esm/zonos-component.entry.js +1 -1
  173. package/dist/esm/zonos-confirm-dialog_2.entry.js +163 -0
  174. package/dist/esm/zonos-controller.entry.js +85 -29
  175. package/dist/esm/zonos-country-flag.entry.js +3 -2
  176. package/dist/esm/zonos-country-select_4.entry.js +12 -11
  177. package/dist/esm/zonos-elements.js +1 -1
  178. package/dist/esm/zonos-empty-state-payment_4.entry.js +16 -6
  179. package/dist/esm/zonos-hello-dialog.entry.js +7 -6
  180. package/dist/esm/zonos-hello.entry.js +3 -2
  181. package/dist/esm/zonos-input.entry.js +4 -4
  182. package/dist/esm/zonos-language-select_2.entry.js +7 -6
  183. package/dist/esm/zonos-link.entry.js +1 -1
  184. package/dist/esm/zonos-logo.entry.js +2 -2
  185. package/dist/esm/zonos-stripe-input.entry.js +9 -6
  186. package/dist/esm/zonos-text.entry.js +1 -1
  187. package/dist/esm/zonos-toggle.entry.js +2 -2
  188. package/dist/esm/zonos-tooltip.entry.js +2 -2
  189. package/dist/esm/zonos-v-stack.entry.js +2 -2
  190. package/dist/esm-es5/buildCartItemsByTempCart-c4488f73.js +1 -0
  191. package/dist/esm-es5/cart-acf4ebf5.js +1 -0
  192. package/dist/esm-es5/cleanHtmlMarkdown-b5b18743.js +1 -0
  193. package/dist/esm-es5/{handleFetch-fa90f7f6.js → handleFetch-99218189.js} +1 -1
  194. package/dist/esm-es5/index.js +1 -1
  195. package/dist/esm-es5/isCollectMobileTablet-b72b81c5.js +1 -0
  196. package/dist/esm-es5/loader.js +1 -1
  197. package/dist/esm-es5/localization-8646f526.js +1 -0
  198. package/dist/esm-es5/paypal-2fa930eb.js +17 -0
  199. package/dist/esm-es5/placeTestOrder-d1ad9cf6.js +1 -0
  200. package/dist/esm-es5/translationStore-c9743292.js +1 -0
  201. package/dist/esm-es5/{updateCheckoutSessionAttributes-691cdc6d.js → updateCheckoutSessionAttributes-92f42882.js} +1 -1
  202. package/dist/esm-es5/zonos-address_11.entry.js +1 -1
  203. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  204. package/dist/esm-es5/zonos-banner_2.entry.js +1 -0
  205. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  206. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -0
  207. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  208. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  209. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -0
  210. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -0
  211. package/dist/esm-es5/zonos-collect.entry.js +1 -0
  212. package/dist/esm-es5/zonos-component.entry.js +1 -1
  213. package/dist/esm-es5/zonos-confirm-dialog_2.entry.js +1 -0
  214. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  215. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  216. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  217. package/dist/esm-es5/zonos-elements.js +1 -1
  218. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  219. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  220. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  221. package/dist/esm-es5/zonos-input.entry.js +1 -1
  222. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  223. package/dist/esm-es5/zonos-link.entry.js +1 -1
  224. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  225. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  226. package/dist/esm-es5/zonos-text.entry.js +1 -1
  227. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  228. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  229. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  230. package/dist/scripts/index.d.ts +471 -4
  231. package/dist/scripts/index.js +1 -1
  232. package/dist/scripts/loadZonos.js +1 -1
  233. package/dist/scripts/zonos.js +1 -1
  234. package/dist/types/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.d.ts +4 -0
  235. package/dist/types/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.d.ts +49 -0
  236. package/dist/types/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.d.ts +25 -0
  237. package/dist/types/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.d.ts +29 -0
  238. package/dist/types/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.d.ts +62 -0
  239. package/dist/types/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.d.ts +22 -0
  240. package/dist/types/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.d.ts +10 -0
  241. package/dist/types/components/checkout/zonos-collect/zonos-collect.d.ts +86 -0
  242. package/dist/types/components/common/zonos-h-stack/zonos-h-stack.d.ts +9 -0
  243. package/dist/types/components/common/zonos-skeleton/zonos-skeleton.d.ts +17 -0
  244. package/dist/types/components/main/zonos-controller.d.ts +5 -0
  245. package/dist/types/components/paypal/zonos-paypal-payment.d.ts +3 -0
  246. package/dist/types/components/store/checkout/cart.d.ts +23 -3
  247. package/dist/types/components/store/checkout/collect.d.ts +21 -0
  248. package/dist/types/components/store/checkout/paypal.d.ts +4 -3
  249. package/dist/types/components/store/checkout/stripe.d.ts +6 -2
  250. package/dist/types/components/store/translationStore/strings.arabic.d.ts +48 -0
  251. package/dist/types/components/store/translationStore/strings.base.d.ts +48 -0
  252. package/dist/types/components/store/translationStore/strings.chinese.d.ts +48 -0
  253. package/dist/types/components/store/translationStore/strings.danish.d.ts +48 -0
  254. package/dist/types/components/store/translationStore/strings.dutch.d.ts +48 -0
  255. package/dist/types/components/store/translationStore/strings.french.d.ts +48 -0
  256. package/dist/types/components/store/translationStore/strings.german.d.ts +48 -0
  257. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +48 -0
  258. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +48 -0
  259. package/dist/types/components/store/translationStore/strings.italian.d.ts +48 -0
  260. package/dist/types/components/store/translationStore/strings.japanese.d.ts +48 -0
  261. package/dist/types/components/store/translationStore/strings.korean.d.ts +48 -0
  262. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +48 -0
  263. package/dist/types/components/store/translationStore/strings.polish.d.ts +48 -0
  264. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +48 -0
  265. package/dist/types/components/store/translationStore/strings.russian.d.ts +48 -0
  266. package/dist/types/components/store/translationStore/strings.spanish.d.ts +48 -0
  267. package/dist/types/components/store/translationStore/strings.swedish.d.ts +48 -0
  268. package/dist/types/components/store/translationStore/strings.turkish.d.ts +48 -0
  269. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +48 -0
  270. package/dist/types/components/store/translationStore.d.ts +2 -1
  271. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +1 -2
  272. package/dist/types/components/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +2 -0
  273. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  274. package/dist/types/components/utils/checkout/initCollect.d.ts +1 -0
  275. package/dist/types/components/utils/checkout/isCollectMobileTablet.d.ts +4 -0
  276. package/dist/types/components/utils/getNextFallbackApi.d.ts +2 -2
  277. package/dist/types/components/utils/renderFallback.d.ts +6 -0
  278. package/dist/types/components.d.ts +401 -2
  279. package/dist/types/scripts/_zonosBase.d.ts +5 -0
  280. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +5 -0
  281. package/dist/types/types/checkout/api/CheckoutSession.d.ts +9 -1
  282. package/dist/types/types/checkout/api/CreateParty.d.ts +24 -0
  283. package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +6 -1
  284. package/dist/types/types/checkout/api/PartyInfo.d.ts +24 -0
  285. package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
  286. package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
  287. package/dist/types/types/generated/graphql.internal.types.d.ts +431 -9
  288. package/dist/types/types/generated/graphql.internal.types.ts +428 -10
  289. package/dist/types/types/index.d.ts +1 -0
  290. package/dist/zonos-elements/index.esm.js +1 -1
  291. package/dist/zonos-elements/{p-288761b1.system.entry.js → p-009c3ac5.system.entry.js} +1 -1
  292. package/dist/zonos-elements/{p-c7d5d45d.entry.js → p-03980f76.entry.js} +1 -1
  293. package/dist/zonos-elements/{p-c1d86f32.system.js → p-062430f9.system.js} +1 -1
  294. package/dist/zonos-elements/p-07bea979.system.js +1 -0
  295. package/dist/zonos-elements/p-0cec2dd2.system.entry.js +1 -0
  296. package/dist/zonos-elements/p-0d6c6a38.entry.js +1 -0
  297. package/dist/zonos-elements/p-0e28207a.js +1 -0
  298. package/dist/zonos-elements/{p-1efc348b.system.js → p-0ed63ce0.system.js} +1 -1
  299. package/dist/zonos-elements/p-0ef2a242.js +1 -0
  300. package/dist/zonos-elements/p-106ae0f1.entry.js +1 -0
  301. package/dist/zonos-elements/p-10797d2b.system.entry.js +1 -0
  302. package/dist/zonos-elements/p-195b33b6.system.entry.js +1 -0
  303. package/dist/zonos-elements/p-1fe5d4da.system.entry.js +1 -0
  304. package/dist/zonos-elements/{p-da4c01da.system.entry.js → p-2323ff0f.system.entry.js} +1 -1
  305. package/dist/zonos-elements/p-23293a0b.entry.js +1 -0
  306. package/dist/zonos-elements/{p-62813488.entry.js → p-23735db6.entry.js} +1 -1
  307. package/dist/zonos-elements/{p-ebaaaee9.entry.js → p-26573347.entry.js} +1 -1
  308. package/dist/zonos-elements/{p-e640e8b8.entry.js → p-29499a5f.entry.js} +1 -1
  309. package/dist/zonos-elements/p-29c80a34.js +1 -0
  310. package/dist/zonos-elements/{p-edc77ea1.entry.js → p-2a9681b4.entry.js} +1 -1
  311. package/dist/zonos-elements/{p-3f31901f.entry.js → p-2c9381be.entry.js} +1 -1
  312. package/dist/zonos-elements/p-2cc031b3.js +17 -0
  313. package/dist/zonos-elements/{p-7ab62a26.system.entry.js → p-34a37ce7.system.entry.js} +1 -1
  314. package/dist/zonos-elements/p-3c9714a8.system.entry.js +1 -0
  315. package/dist/zonos-elements/p-485416ec.js +1 -0
  316. package/dist/zonos-elements/p-56ee6d4b.system.entry.js +1 -0
  317. package/dist/zonos-elements/p-58afbe2b.entry.js +1 -0
  318. package/dist/zonos-elements/p-5e372fb9.entry.js +1 -0
  319. package/dist/zonos-elements/p-5ff4f9df.system.js +1 -0
  320. package/dist/zonos-elements/{p-92cc26b7.system.entry.js → p-60c61982.system.entry.js} +1 -1
  321. package/dist/zonos-elements/p-61c2c336.entry.js +1 -0
  322. package/dist/zonos-elements/p-6696617a.system.entry.js +1 -0
  323. package/dist/zonos-elements/p-6761091e.entry.js +1 -0
  324. package/dist/zonos-elements/p-6761286d.js +1 -0
  325. package/dist/zonos-elements/p-69451a50.system.js +1 -0
  326. package/dist/zonos-elements/p-69fd1b88.js +1 -0
  327. package/dist/zonos-elements/p-6dd63754.system.js +1 -0
  328. package/dist/zonos-elements/p-6e8aae27.system.entry.js +1 -0
  329. package/dist/zonos-elements/{p-1c45cd15.entry.js → p-70b81bbc.entry.js} +1 -1
  330. package/dist/zonos-elements/{p-eeb01de6.system.entry.js → p-750b7f32.system.entry.js} +1 -1
  331. package/dist/zonos-elements/p-772ac0b7.js +1 -0
  332. package/dist/zonos-elements/p-81b357f7.system.js +1 -1
  333. package/dist/zonos-elements/p-81e23f30.system.js +1 -0
  334. package/dist/zonos-elements/p-873b698a.entry.js +1 -0
  335. package/dist/zonos-elements/p-87e2a777.entry.js +1 -0
  336. package/dist/zonos-elements/p-8ca25e6c.entry.js +1 -0
  337. package/dist/zonos-elements/p-909d36bf.entry.js +1 -0
  338. package/dist/zonos-elements/p-95461a1b.system.entry.js +1 -0
  339. package/dist/zonos-elements/p-986ebccc.js +1 -0
  340. package/dist/zonos-elements/p-9c0b78bf.system.entry.js +1 -0
  341. package/dist/zonos-elements/p-a61a9b65.system.entry.js +1 -0
  342. package/dist/zonos-elements/p-a7204d41.entry.js +1 -0
  343. package/dist/zonos-elements/{p-d93ecc57.js → p-a8a312b2.js} +1 -1
  344. package/dist/zonos-elements/p-aca272ea.entry.js +1 -0
  345. package/dist/zonos-elements/p-b12ec9f2.system.entry.js +1 -0
  346. package/dist/zonos-elements/p-b1bd9fe7.system.entry.js +1 -0
  347. package/dist/zonos-elements/p-b2ae8eb7.system.js +1 -0
  348. package/dist/zonos-elements/{p-77666360.entry.js → p-b5406d26.entry.js} +1 -1
  349. package/dist/zonos-elements/p-bfbc081f.entry.js +1 -0
  350. package/dist/zonos-elements/p-c0a54cf6.system.js +1 -0
  351. package/dist/zonos-elements/p-c3c9b089.entry.js +1 -0
  352. package/dist/zonos-elements/p-c8784a01.system.entry.js +1 -0
  353. package/dist/zonos-elements/{p-7b5de646.entry.js → p-d045e2e5.entry.js} +1 -1
  354. package/dist/zonos-elements/p-d26cffba.entry.js +1 -0
  355. package/dist/zonos-elements/{p-544c173a.system.entry.js → p-d351ece6.system.entry.js} +1 -1
  356. package/dist/zonos-elements/p-d63696ac.system.js +17 -0
  357. package/dist/zonos-elements/p-ddb29c2a.system.entry.js +1 -0
  358. package/dist/zonos-elements/{p-d6fa2dc2.entry.js → p-dfb92907.entry.js} +1 -1
  359. package/dist/zonos-elements/{p-714c28b1.system.entry.js → p-e2a45188.system.entry.js} +1 -1
  360. package/dist/zonos-elements/{p-1ac8bfbb.system.entry.js → p-e455f060.system.entry.js} +1 -1
  361. package/dist/zonos-elements/p-eb54ece4.system.entry.js +1 -0
  362. package/dist/zonos-elements/{p-a98b1e8d.entry.js → p-efa6203f.entry.js} +1 -1
  363. package/dist/zonos-elements/{p-59eaebe3.system.entry.js → p-f0be0ca9.system.entry.js} +1 -1
  364. package/dist/zonos-elements/p-f129a83b.system.entry.js +1 -0
  365. package/dist/zonos-elements/p-f17fde5f.system.js +1 -0
  366. package/dist/zonos-elements/{p-47ffacd8.system.entry.js → p-f74a6b78.system.entry.js} +1 -1
  367. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  368. package/package.json +1 -1
  369. package/dist/cjs/zonos-card.cjs.entry.js +0 -49
  370. package/dist/esm/zonos-card.entry.js +0 -45
  371. package/dist/esm-es5/cart-010402f9.js +0 -1
  372. package/dist/esm-es5/localization-9db8b6e9.js +0 -1
  373. package/dist/esm-es5/paypal-70b140d9.js +0 -17
  374. package/dist/esm-es5/zonos-banner.entry.js +0 -1
  375. package/dist/esm-es5/zonos-card.entry.js +0 -1
  376. package/dist/esm-es5/zonos-cart-items_14.entry.js +0 -1
  377. package/dist/zonos-elements/p-043f57e8.system.entry.js +0 -1
  378. package/dist/zonos-elements/p-0a7ef032.entry.js +0 -1
  379. package/dist/zonos-elements/p-0e8bdf5c.js +0 -1
  380. package/dist/zonos-elements/p-164ba7ae.system.entry.js +0 -1
  381. package/dist/zonos-elements/p-242dd7ca.system.entry.js +0 -1
  382. package/dist/zonos-elements/p-300e0d47.system.entry.js +0 -1
  383. package/dist/zonos-elements/p-37aa481c.system.entry.js +0 -1
  384. package/dist/zonos-elements/p-3a1513ae.system.entry.js +0 -1
  385. package/dist/zonos-elements/p-425096c9.js +0 -1
  386. package/dist/zonos-elements/p-4cd33d08.entry.js +0 -1
  387. package/dist/zonos-elements/p-57f391e6.system.entry.js +0 -1
  388. package/dist/zonos-elements/p-58b3a0fc.entry.js +0 -1
  389. package/dist/zonos-elements/p-605a21ac.entry.js +0 -1
  390. package/dist/zonos-elements/p-608f965f.system.js +0 -1
  391. package/dist/zonos-elements/p-65c68531.js +0 -1
  392. package/dist/zonos-elements/p-680149ed.entry.js +0 -1
  393. package/dist/zonos-elements/p-6d44f441.system.js +0 -1
  394. package/dist/zonos-elements/p-7c88d2ac.entry.js +0 -1
  395. package/dist/zonos-elements/p-9ddb4533.system.entry.js +0 -1
  396. package/dist/zonos-elements/p-a91024b6.system.entry.js +0 -1
  397. package/dist/zonos-elements/p-a9d41e7c.system.entry.js +0 -1
  398. package/dist/zonos-elements/p-ad556be6.entry.js +0 -1
  399. package/dist/zonos-elements/p-ad8b1fe8.entry.js +0 -1
  400. package/dist/zonos-elements/p-afa4b4f0.js +0 -17
  401. package/dist/zonos-elements/p-b83b382e.system.js +0 -1
  402. package/dist/zonos-elements/p-b9ff6458.entry.js +0 -1
  403. package/dist/zonos-elements/p-d55aec11.system.entry.js +0 -1
  404. package/dist/zonos-elements/p-dcedcdda.entry.js +0 -1
  405. package/dist/zonos-elements/p-e11c61a5.entry.js +0 -1
  406. package/dist/zonos-elements/p-e17ac0d1.system.js +0 -17
  407. package/dist/zonos-elements/p-e1a7a85f.system.entry.js +0 -1
  408. package/dist/zonos-elements/p-ef1ce617.system.entry.js +0 -1
  409. package/dist/zonos-elements/p-ef34e1ce.entry.js +0 -1
  410. package/dist/zonos-elements/p-f54123b5.entry.js +0 -1
  411. package/dist/zonos-elements/p-f7300f5b.system.entry.js +0 -1
@@ -0,0 +1,801 @@
1
+ import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host, a as getElement } from './index-55a03023.js';
2
+ import { c as stripeStore, d as stripeStoreRetrievePayment, t as trackConversionEvent, G as stripeStoreResetPromoCode, y as stripeStoreReset, H as stripeStoreMessageBasedOnStatus, e as cartStore, r as cartStoreNextStep, K as cartStoreOnChange } from './cart-acf4ebf5.js';
3
+ import { s as submitGtag, c as paypalStoreReset, a as paypalStore, b as paypalInitScript } from './paypal-2fa930eb.js';
4
+ import { s as storageStore, l as localizationStore } from './localization-8646f526.js';
5
+ import { t as translate, b as translationStoreOnChange } from './translationStore-c9743292.js';
6
+ import { z as zonosStore } from './zonosStore-c456b933.js';
7
+ import { c as createCustomEvent } from './createCustomEvent-58159025.js';
8
+ import { g as getBorderRadius } from './getBorderRadius-87593ff4.js';
9
+ import { h as handleFetch, l as log, s as sendErrorLog, d as allLogs, i as isCheckoutMobile, g as getIsTestMode, a as getIsStagingMode } from './handleFetch-99218189.js';
10
+ import { i as isCollectMobile, a as isCollectTablet, e as collectStore } from './isCollectMobileTablet-b72b81c5.js';
11
+ import { c as classes } from './classes-0d95c529.js';
12
+ import { l as languages } from './ILanguage-cd6acb72.js';
13
+ import { r as renderCheckoutCurrency, p as placeTestOrder } from './placeTestOrder-d1ad9cf6.js';
14
+ import './isDarkColor-1f58b6be.js';
15
+ import './VarianceTest-fef2d958.js';
16
+
17
+ const RemoveIcon = `<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
18
+
19
+ const SuccessIcon = `<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
20
+
21
+ const zonosCollectFinishCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:24px;border-radius:var(--zonos--border-radius, 10px);gap:24px;margin-top:24px;background-color:var(--zonos-elements-gray-50);padding:48px}:host .zonos--finish-details{max-width:640px;min-width:300px;line-height:24px;width:0 auto;margin:auto}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .zonos--finish-button-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto;margin-top:48px;max-width:300px}:host .zonos--subtitle{text-align:center}:host .zonos--order-number{background-color:var(--zonos-elements-gray-0);border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800);border-radius:var(--zonos-elements-radius-6);padding:4px 8px}";
22
+ const ZonosCollectFinishStyle0 = zonosCollectFinishCss;
23
+
24
+ /**
25
+ * Maximum number of retries to pull order info (gap between each retry is 1 second)
26
+ */
27
+ const MAX_RETRIES = 30;
28
+ const ZonosCollectFinish = class {
29
+ constructor(hostRef) {
30
+ registerInstance(this, hostRef);
31
+ this.closeClick = createEvent(this, "closeClick", 7);
32
+ /**
33
+ * The border radius style of the dialog
34
+ */
35
+ this.borderRadius = 'ROUNDED';
36
+ /**
37
+ * The confirmation id for the collect order
38
+ */
39
+ this.confirmationId = null;
40
+ this.isLoading = true;
41
+ this.notificationType = 'success';
42
+ this.notificationTitle = '';
43
+ this.notificationMessages = [];
44
+ this.notificationActionText = translate('Keep shopping');
45
+ this.order = null;
46
+ /**
47
+ * Is waiting to redirect to a different page
48
+ */
49
+ this.isWaitingToRedirect = true;
50
+ this.pullOrder = async () => {
51
+ var _a, _b;
52
+ const checkoutSessionId = storageStore.checkoutSessionId;
53
+ const searchParams = new URLSearchParams();
54
+ searchParams.set('checkoutSessionId', checkoutSessionId || '');
55
+ const { baseUrl, errors, json } = await handleFetch(`/api/zonos-elements/get-order?${searchParams.toString()}`);
56
+ if (errors.length || !(json === null || json === void 0 ? void 0 : json.id)) {
57
+ return {
58
+ baseUrl,
59
+ order: null,
60
+ };
61
+ }
62
+ // onOrderSuccess callback may be provided on Zonos.init
63
+ await ((_b = (_a = zonosStore.checkoutSettings).onOrderSuccess) === null || _b === void 0 ? void 0 : _b.call(_a, {
64
+ zonosApiRoute: baseUrl,
65
+ zonosOrder: json,
66
+ }));
67
+ return {
68
+ baseUrl,
69
+ order: json,
70
+ };
71
+ };
72
+ this.handleSuccessBehavior = async () => {
73
+ // Do nothing, display Zonos success page
74
+ this.isLoading = false;
75
+ await this.getPullOrder();
76
+ };
77
+ // TODO: This method of pulling orders is temporary. Once we have a working event registry system, we will rely on that to tell us when the order is ready to trigger onOrderSuccess
78
+ this.getPullOrder = async (attempts = 0) => {
79
+ var _a, _b;
80
+ if (attempts === 0) {
81
+ log('=== Start to poll for order info', 'info');
82
+ }
83
+ const { baseUrl, order } = await this.pullOrder();
84
+ const foundLegacyOrderNumber = !!((_b = (_a = order === null || order === void 0 ? void 0 : order.references) === null || _a === void 0 ? void 0 : _a.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'zonosOrderNumber')) === null || _b === void 0 ? void 0 : _b.value);
85
+ const checkoutSessionId = storageStore.checkoutSessionId;
86
+ const maxRetries = parseFloat(new URLSearchParams(window.location.search).get('maxPollingRetries') ||
87
+ '0') || MAX_RETRIES;
88
+ log(`=== Polling order (${attempts} attemps)`, 'info');
89
+ if (
90
+ // Order found, in legacy checkout facade and still haven't found the legacy order number
91
+ order &&
92
+ attempts >= maxRetries) {
93
+ log('=== CollectOrder info found', 'info');
94
+ if (order && !foundLegacyOrderNumber) {
95
+ // We pushed this one through without the legacy order number, so we should log this
96
+ void sendErrorLog({
97
+ endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}&orderId=${order.id}`,
98
+ errors: [
99
+ `Collect order found but legacy order number doesn't exist after ${maxRetries} attempts`,
100
+ ],
101
+ metadata: {
102
+ allLogs,
103
+ checkoutSessionId: storageStore.checkoutSessionId || '',
104
+ orderId: order.id,
105
+ storeId: zonosStore.storeId,
106
+ },
107
+ });
108
+ return;
109
+ }
110
+ else if (attempts > 10) {
111
+ // Log out all the logs if we have tried more than 10 times
112
+ void sendErrorLog({
113
+ endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}&orderId=${order.id}`,
114
+ errors: [`Collect order found after ${attempts} attempts`],
115
+ metadata: {
116
+ allLogs,
117
+ checkoutSessionId: storageStore.checkoutSessionId || '',
118
+ orderId: order.id,
119
+ storeId: zonosStore.storeId,
120
+ },
121
+ });
122
+ }
123
+ this.order = order;
124
+ }
125
+ else if ((!order || !foundLegacyOrderNumber) && attempts < maxRetries) {
126
+ // Wait for 1 second before the next attempt
127
+ await new Promise(resolve => setTimeout(resolve, 1000));
128
+ await this.getPullOrder(attempts + 1);
129
+ }
130
+ else {
131
+ void sendErrorLog({
132
+ endpoint: `${baseUrl}/api/zonos-elements/get-order?checkoutSessionId=${checkoutSessionId}`,
133
+ errors: [`Collect order not found after ${maxRetries} attempts`],
134
+ metadata: {
135
+ allLogs,
136
+ checkoutSessionId: storageStore.checkoutSessionId || '',
137
+ storeId: zonosStore.storeId,
138
+ },
139
+ });
140
+ }
141
+ };
142
+ this.checkStripePaymentStatus = async () => {
143
+ const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || stripeStore.clientSecret;
144
+ if (clientSecret || this.storybookForceStatus) {
145
+ const { error, messages, status } = await stripeStoreRetrievePayment({
146
+ clientSecret,
147
+ storybookForceStatus: this.storybookForceStatus,
148
+ });
149
+ const isError = status === 'requires_action' || error;
150
+ this.notificationType = isError ? 'error' : 'success';
151
+ this.notificationMessages = messages || [];
152
+ this.notificationTitle = isError
153
+ ? translate('Payment failed')
154
+ : translate("You're all set!");
155
+ log('=== Payment intent retrieve status', 'info', {
156
+ clientSecret,
157
+ error,
158
+ messages,
159
+ status,
160
+ });
161
+ // remove the client secret from the url
162
+ const url = new URL(window.location.href);
163
+ url.searchParams.delete('payment_intent_client_secret');
164
+ url.searchParams.delete('payment_intent');
165
+ url.searchParams.delete('redirect_status');
166
+ // Clean up the url if it's a redirect behavior
167
+ url.searchParams.delete('zonosCheckoutSessionId');
168
+ window.history.replaceState({}, '', url.toString());
169
+ // Payment doesn't go through
170
+ if (error && (messages === null || messages === void 0 ? void 0 : messages.length)) {
171
+ submitGtag('zonos-checkout-payment-fail');
172
+ void sendErrorLog({
173
+ endpoint: 'Stripe payment failed',
174
+ errors: [
175
+ `Payment intent "${clientSecret.split('_secret_')[0] || clientSecret}" status: ${status} - checkout session: ${storageStore.checkoutSessionId}`,
176
+ ],
177
+ metadata: {
178
+ allLogs,
179
+ credentialToken: window.Zonos.zonosApiKey,
180
+ },
181
+ });
182
+ }
183
+ else {
184
+ submitGtag('zonos-checkout-success');
185
+ const checkoutSessionId = storageStore.checkoutSessionId;
186
+ void trackConversionEvent({
187
+ checkoutSessionId,
188
+ eventName: 'checkout_orderCompleted',
189
+ });
190
+ const successEvent = createCustomEvent('zonos-checkout-success', {
191
+ message: 'Zonos Checkout successfully processed order',
192
+ });
193
+ document.dispatchEvent(successEvent);
194
+ // wait this to finish before resetting store and checkout session id
195
+ await this.handleSuccessBehavior();
196
+ }
197
+ }
198
+ // Make sure to stop the loading spinner even when there's an error
199
+ this.isLoading = false;
200
+ // reset promo when checkout is finished
201
+ stripeStoreResetPromoCode();
202
+ stripeStoreReset();
203
+ storageStore.checkoutSessionId = null;
204
+ };
205
+ this.checkStagingOrderStatus = async () => {
206
+ this.notificationType = 'success';
207
+ this.notificationTitle = translate("You're all set!");
208
+ this.notificationMessages =
209
+ stripeStoreMessageBasedOnStatus('succeeded').messages;
210
+ await this.handleSuccessBehavior();
211
+ // reset promo when checkout is finished
212
+ stripeStoreResetPromoCode();
213
+ stripeStoreReset();
214
+ paypalStoreReset();
215
+ storageStore.checkoutSessionId = null;
216
+ };
217
+ this.checkPaypalPaymentStatus = async () => {
218
+ // render error message if there's an error
219
+ if (paypalStore.paypalErrorMessage) {
220
+ this.notificationType = 'error';
221
+ this.notificationTitle = translate('Payment failed');
222
+ this.notificationMessages = [paypalStore.paypalErrorMessage];
223
+ this.isLoading = false;
224
+ return;
225
+ }
226
+ // show success message right away when order id is already created
227
+ this.isLoading = false;
228
+ if (paypalStore.orderIdCreated) {
229
+ submitGtag('zonos-checkout-success');
230
+ const checkoutSessionId = storageStore.checkoutSessionId;
231
+ void trackConversionEvent({
232
+ checkoutSessionId,
233
+ eventName: 'checkout_orderCompleted',
234
+ });
235
+ this.notificationType = 'success';
236
+ this.notificationTitle = translate("You're all set!");
237
+ this.notificationMessages =
238
+ stripeStoreMessageBasedOnStatus('succeeded').messages;
239
+ // wait this to finish before resetting store and checkout session id
240
+ await this.handleSuccessBehavior();
241
+ }
242
+ // reset promo when checkout is finished
243
+ stripeStoreResetPromoCode();
244
+ stripeStoreReset();
245
+ paypalStoreReset();
246
+ storageStore.checkoutSessionId = null;
247
+ };
248
+ }
249
+ componentDidLoad() {
250
+ if (this.overrideNotification) {
251
+ // just show the notification and don't check any of the payment status
252
+ this.notificationType = this.overrideNotification.type;
253
+ this.notificationTitle = this.overrideNotification.title;
254
+ this.notificationMessages = this.overrideNotification.messages;
255
+ this.isLoading = false;
256
+ return;
257
+ }
258
+ if (cartStore.isStagingMode) {
259
+ void this.checkStagingOrderStatus();
260
+ }
261
+ else if (paypalStore.orderIdCreated) {
262
+ void this.checkPaypalPaymentStatus();
263
+ }
264
+ else {
265
+ void this.checkStripePaymentStatus();
266
+ }
267
+ }
268
+ render() {
269
+ return (h(Host, { key: 'c8310458ed1264e1f799c5e89dbb5e98229b2a08', class: "zonos--checkout-finish zonos--elements", style: {
270
+ '--zonos--border-radius': getBorderRadius({
271
+ overrideBorderStyle: this.borderRadius,
272
+ }),
273
+ } }, !this.isLoading && (h("div", { key: 'df8c6b30dc371111c192a24263afa79814d429fb', class: "zonos--finish-details" }, h("div", { key: 'c799b8f13474a996d5603636cc8730657508d2ac', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: '9365caeb15712f54ae9777b9e6acf67e572f7e43', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), this.confirmationId && (h("zonos-badge", { key: '3cca628ac3b7ae3e819296299d0c3f0c8531ddbb', badgeColor: "gray" }, this.confirmationId)), h("zonos-text", { key: '52136526f5b90feaa68a526c099fdd95e24ea23e', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))))))));
274
+ }
275
+ static get assetsDirs() { return ["assets"]; }
276
+ };
277
+ ZonosCollectFinish.style = ZonosCollectFinishStyle0;
278
+
279
+ const Globe = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg">
280
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM11.4709 5.80634C11.7686 5.53723 11.9541 5.5 12 5.5C12.0459 5.5 12.2314 5.53723 12.5291 5.80634C12.8115 6.06164 13.1289 6.46913 13.4271 7.03651C13.9505 8.03191 14.3838 9.46098 14.48 11.25H9.51996C9.61624 9.46098 10.0495 8.03191 10.5729 7.03651C10.8711 6.46913 11.1885 6.06164 11.4709 5.80634ZM8.01802 11.25C8.11591 9.23031 8.60319 7.55958 9.24516 6.33849C9.29983 6.23451 9.35585 6.13335 9.41312 6.03514C7.32916 6.94017 5.81218 8.90533 5.5428 11.25H8.01802ZM5.5428 12.75H8.01802C8.11591 14.7697 8.60319 16.4404 9.24516 17.6615C9.29983 17.7655 9.35585 17.8666 9.41312 17.9649C7.32916 17.0598 5.81218 15.0947 5.5428 12.75ZM9.51996 12.75H14.48C14.3838 14.539 13.9505 15.9681 13.4271 16.9635C13.1289 17.5309 12.8115 17.9384 12.5291 18.1937C12.2314 18.4628 12.0459 18.5 12 18.5C11.9541 18.5 11.7686 18.4628 11.4709 18.1937C11.1885 17.9384 10.8711 17.5309 10.5729 16.9635C10.0495 15.9681 9.61624 14.539 9.51996 12.75ZM15.982 12.75C15.8841 14.7697 15.3968 16.4404 14.7548 17.6615C14.7002 17.7655 14.6441 17.8666 14.5869 17.9649C16.6708 17.0598 18.1878 15.0947 18.4572 12.75H15.982ZM18.4572 11.25C18.1878 8.90533 16.6708 6.94017 14.5869 6.03514C14.6441 6.13335 14.7002 6.23451 14.7548 6.33849C15.3968 7.55958 15.8841 9.23031 15.982 11.25H18.4572Z" fill="currentColor"/>
281
+ </svg>
282
+ `;
283
+
284
+ const ZonosWordmark = `<svg width="43" height="10" viewBox="0 0 43 10" fill="none" xmlns="http://www.w3.org/2000/svg">
285
+ <path d="M7.35896 0.0640869H0.30768C0.166068 0.0640869 0.0512695 0.178886 0.0512695 0.320497V1.85896C0.0512695 2.00057 0.166068 2.11537 0.30768 2.11537H4.44439C4.54964 2.11537 4.61005 2.2352 4.54745 2.31982L0.151823 8.2615C0.0865163 8.34978 0.0512695 8.45669 0.0512695 8.56649V9.67947C0.0512695 9.82108 0.166068 9.93588 0.30768 9.93588H7.35896C7.50057 9.93588 7.61537 9.82108 7.61537 9.67947V8.14101C7.61537 7.9994 7.50057 7.8846 7.35896 7.8846H3.22226C3.117 7.8846 3.05659 7.76477 3.11919 7.68015L7.51482 1.73847C7.58013 1.65019 7.61537 1.54328 7.61537 1.43348V0.320497C7.61537 0.178886 7.50057 0.0640869 7.35896 0.0640869Z" fill="var(--zonos-elements-gray-800)"/>
286
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M11.718 0C10.1602 0 8.89746 1.26279 8.89746 2.82051V7.17949C8.89746 8.73721 10.1602 10 11.718 10H13.6411C15.1988 10 16.4616 8.73721 16.4616 7.17949V2.82051C16.4616 1.26279 15.1988 0 13.6411 0H11.718ZM11.718 2.05128C11.2931 2.05128 10.9487 2.39568 10.9487 2.82051V7.17949C10.9487 7.60432 11.2931 7.94872 11.718 7.94872H13.6411C14.0659 7.94872 14.4103 7.60432 14.4103 7.17949V5V2.82051C14.4103 2.39568 14.0659 2.05128 13.6411 2.05128H11.718Z" fill="var(--zonos-elements-gray-800)"/>
287
+ <path d="M17.7437 0.436316V9.71132C17.7437 9.85293 17.8585 9.96773 18.0001 9.96773H19.5385C19.6801 9.96773 19.7949 9.85293 19.7949 9.71132V3.74801C19.7949 3.44829 19.969 3.17587 20.241 3.04996L22.1641 2.15964C22.6739 1.92363 23.2565 2.29592 23.2565 2.85769V9.71132C23.2565 9.85293 23.3713 9.96773 23.5129 9.96773H25.0513C25.193 9.96773 25.3078 9.85293 25.3078 9.71132V2.85595C25.3078 0.79631 23.1718 -0.568775 21.3027 0.296257L19.9742 0.911055C19.8685 0.959946 19.7432 0.931536 19.669 0.84187L19.2748 0.365697C19.1773 0.248019 19.0325 0.179905 18.8797 0.179905H18.0001C17.8585 0.179905 17.7437 0.294704 17.7437 0.436316Z" fill="var(--zonos-elements-gray-800)"/>
288
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M29.4104 0C27.8526 0 26.5898 1.26279 26.5898 2.82051V7.17949C26.5898 8.73721 27.8526 10 29.4104 10H31.3334C32.8912 10 34.1539 8.73721 34.1539 7.17949V2.82051C34.1539 1.26279 32.8912 0 31.3334 0H29.4104ZM29.4104 2.05128C28.9855 2.05128 28.6411 2.39568 28.6411 2.82051V7.17949C28.6411 7.60432 28.9855 7.94872 29.4104 7.94872H31.3334C31.7583 7.94872 32.1027 7.60432 32.1027 7.17949V2.82051C32.1027 2.39568 31.7583 2.05128 31.3334 2.05128H29.4104Z" fill="var(--zonos-elements-gray-800)"/>
289
+ <path d="M38.2085 0.0640869H40.3889C41.8309 0.0640869 42.9999 1.23306 42.9999 2.67506C42.9999 2.79477 42.9108 2.89574 42.792 2.91059L41.1732 3.11293C41.054 3.12784 40.9486 3.03485 40.9486 2.91466C40.9486 2.47322 40.5908 2.11537 40.1493 2.11537H38.3397C37.8688 2.11537 37.4871 2.49712 37.4871 2.96803C37.4871 3.3685 37.7658 3.71501 38.1569 3.80087L40.7916 4.37922C42.0811 4.66229 42.9999 5.80462 42.9999 7.12486C42.9999 8.67735 41.7414 9.93588 40.1889 9.93588H38.0468C36.6048 9.93588 35.4358 8.76691 35.4358 7.32491C35.4358 7.2052 35.5249 7.10423 35.6437 7.08938L37.2625 6.88703C37.3817 6.87213 37.4871 6.96512 37.4871 7.08531C37.4871 7.52675 37.8449 7.8846 38.2864 7.8846H40.1176C40.5765 7.8846 40.9486 7.51252 40.9486 7.05354C40.9486 6.67478 40.6925 6.34394 40.3258 6.24901L37.5136 5.52093C36.2902 5.20422 35.4358 4.10042 35.4358 2.83676C35.4358 1.30545 36.6772 0.0640869 38.2085 0.0640869Z" fill="var(--zonos-elements-gray-700)"/>
290
+ </svg>
291
+ `;
292
+
293
+ const zonosCollectFooterCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:absolute;bottom:0;left:32px;right:32px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--collect-footer{gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;padding-left:0;-ms-flex-align:center;align-items:center;width:100%}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:16px}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo a{line-height:0}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper a{text-decoration:none}:host .zonos--collect-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--collect-footer .zonos--collect-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--collect-footer .zonos--collect-locale-wrapper{gap:4px}}:host .zonos--collect-footer .zonos--collect-language-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);width:360px;max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar{width:10px}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--collect-footer .zonos--collect-language-dialog.zonos--collect-language-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .dot{display:-ms-inline-flexbox;display:inline-flex;background:var(--zonos-elements-gray-400);width:6px;height:6px;border-radius:50%}:host(.mobile),:host(.tablet){background-color:var(--zonos-elements-gray-0);width:100%;position:-webkit-sticky;position:sticky;bottom:0}:host(.tablet) .zonos--collect-footer{width:100%;max-width:800px;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex}:host(.mobile) .zonos--collect-locale-wrapper{display:none}:host(.mobile) .zonos--collect-footer{-ms-flex-pack:center;justify-content:center}";
294
+ const ZonosCollectFooterStyle0 = zonosCollectFooterCss;
295
+
296
+ const ZonosCollectFooter = class {
297
+ constructor(hostRef) {
298
+ registerInstance(this, hostRef);
299
+ /**
300
+ * Override mobile mode
301
+ */
302
+ this.mobile = false;
303
+ /**
304
+ * Override tablet mode
305
+ */
306
+ this.tablet = false;
307
+ this.showLanguageDialog = false;
308
+ this.isMobile = false;
309
+ this.isTablet = false;
310
+ }
311
+ handleGlobalClick(e) {
312
+ if (!this.el.contains(e.target) && this.showLanguageDialog) {
313
+ this.showLanguageDialog = false;
314
+ }
315
+ }
316
+ toggleLanguageDialog() {
317
+ this.showLanguageDialog = !this.showLanguageDialog;
318
+ }
319
+ handleMobileChange() {
320
+ this.isMobile = isCollectMobile(this.mobile);
321
+ }
322
+ handleTabletChange() {
323
+ this.isTablet = isCollectTablet(this.tablet);
324
+ }
325
+ componentWillLoad() {
326
+ this.isMobile = isCollectMobile(this.mobile);
327
+ this.isTablet = isCollectTablet(this.tablet);
328
+ }
329
+ render() {
330
+ var _a;
331
+ const languageLabel = (_a = languages.find(x => x.code === localizationStore.selectedLocale)) === null || _a === void 0 ? void 0 : _a.label;
332
+ // reverse color when on desktop. With the coversheet backdrop, the color should be white
333
+ const colorDesktop = 'gray-1000';
334
+ return (h(Host, { key: 'f8415c3fa7cf1e02b956ee91d5c2b8c92aba83f0', class: classes([
335
+ 'zonos--elements',
336
+ this.isMobile && 'mobile',
337
+ this.isTablet && 'tablet',
338
+ ]) }, h("div", { key: 'ba5a7bd33565ec92bbde5135da011e833e1b5f54', class: "zonos--collect-footer" }, h("div", { key: 'ba2523ad59a5308317c2127f597116bf13a5bf5c', class: "zonos--collect-locale-wrapper" }, h("zonos-button", { key: '01cc5e41f2c00fb797f67a7e5187cc614974b381', buttonColor: colorDesktop, class: "zonos--collect-footer-language-button", icon: h("zonos-icon", { "aria-label": "Language select", content: Globe, iconColor: colorDesktop }), onClick: () => this.toggleLanguageDialog(), variant: "subtle" }, languageLabel), h("div", { key: '577572370a3364384054451a935bbcfe29681932', class: classes([
339
+ 'zonos--collect-language-dialog',
340
+ this.showLanguageDialog &&
341
+ 'zonos--collect-language-dialog-open',
342
+ ]) }, h("zonos-language-select", { key: 'ab7ad7f5ac46b8b718ed658e003ea9c54fc0e509', handleOnClose: () => this.toggleLanguageDialog() }))), h("div", { key: '13a5458f90a1f8899ba772a2dd8d4c9ed3b93bbe', class: "zonos--collect-footer-icon-wrapper" }, h("div", { key: 'aa0e23159a9a2ed22c7809dcf55a4be24114f8a4', class: "zonos--collect-footer-logo" }, h("zonos-text", { key: '33cb521cfc71be6f909d1457b792d515b80f1e04', textColor: colorDesktop }, "Powered by"), h("a", { key: '75dc6b0a319d1dd017f0e108975b7cfabe4d30fb', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: '8a8628f4258ea36b86df16b8ed0139c13e04a67e', autoHeight: true, content: ZonosWordmark, size: 42 }))), h("div", { key: 'a24bc9f48cd16e8acd668fe23ad3b9427dd1b4ba', class: "dot" }), h("a", { key: '32d1c85120322d79fac8ed449cceeea39e065bba', href: "https://zonos.com/docs/legal/zonos-privacy-policy", target: "_blank" }, h("zonos-text", { key: 'bb3f04f0ebe79e03d1d7a70978acafa7ce7069cd', textColor: colorDesktop }, "Privacy policy"))))));
343
+ }
344
+ get el() { return getElement(this); }
345
+ static get watchers() { return {
346
+ "mobile": ["handleMobileChange"],
347
+ "tablet": ["handleTabletChange"]
348
+ }; }
349
+ };
350
+ ZonosCollectFooter.style = ZonosCollectFooterStyle0;
351
+
352
+ const ChevronDownIcon = `<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
353
+
354
+ const ChevronUpIcon = `<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
355
+
356
+ const zonosCollectOrderDetailsCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{height:100%}:host *{-ms-scroll-chaining:none;overscroll-behavior:contain}:host *::-webkit-scrollbar{width:10px}:host *::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host *::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host *::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--wrapper{overflow:auto;background-color:var(--zonos-elements-gray-50);border-radius:16px;height:100%;min-height:56px}:host .zonos--order-details-header{position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--zonos-elements-gray-50);border:none;display:-ms-flexbox;display:flex;padding:16px 16px 0 16px;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .zonos--order-details-header:focus-visible{outline:none}:host .zonos--order-details-wrapper{position:relative;padding:0 16px 16px 16px}:host .zonos--collect-order-details-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:28px}:host .zonos--collect-order-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}:host .zonos--collect-order-info .zonos--collect-order-details-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}:host .zonos--collect-order-info .zonos--collect-order-details-row>*{-ms-flex:1 1 150px;flex:1 1 150px}:host .zonos--collect-order-info .zonos--collect-order-details-column{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--collect-order-info .zonos--collect-order-shipping-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0}";
357
+ const ZonosCollectOrderDetailsStyle0 = zonosCollectOrderDetailsCss;
358
+
359
+ const ZonosCollectOrderDetails = class {
360
+ constructor(hostRef) {
361
+ registerInstance(this, hostRef);
362
+ this.collapseClicked = createEvent(this, "collapseClicked", 7);
363
+ /**
364
+ * Whether or not the component is being rendered with mobile styles
365
+ */
366
+ this.mobile = true;
367
+ /**
368
+ * The landed cost id that is used to fetch the shipping address
369
+ */
370
+ this.landedCostId = '';
371
+ this.isMobile = false;
372
+ this.collapseState = this.collapsed;
373
+ }
374
+ handleCollapseChangeFromProp(collapsed) {
375
+ this.collapseState = collapsed;
376
+ }
377
+ handleCollapseChange(collapsed) {
378
+ this.collapseClicked.emit(collapsed);
379
+ }
380
+ handleWindowResize() {
381
+ this.isMobile = isCheckoutMobile(this.mobile);
382
+ }
383
+ componentWillLoad() {
384
+ this.handleWindowResize();
385
+ }
386
+ renderShippingAddress() {
387
+ if (collectStore.isFetchingShippingInfo) {
388
+ return (h("div", { class: "zonos--collect-order-details-column" }, h("zonos-text", { type: "smallHeader" }, h("zonos-skeleton", { skeletonWidth: "99px" })), h("div", { class: "zonos--collect-order-shipping-info" }, h("zonos-skeleton", { skeletonWidth: "152px" }), h("zonos-h-stack", { spacing: 8 }, h("zonos-skeleton", { skeletonWidth: "75px" }), h("zonos-skeleton", { skeletonWidth: "75px" })), h("zonos-skeleton", { skeletonWidth: "50px" }))));
389
+ }
390
+ const shippingAddress = collectStore.shippingAddress;
391
+ if (!shippingAddress) {
392
+ return null;
393
+ }
394
+ return (h("div", { class: "zonos--collect-order-details-column" }, h("zonos-text", { type: "smallHeader" }, translate('Shipping address')), h("div", { class: "zonos--collect-order-shipping-info" }, [
395
+ [shippingAddress.location.line1, shippingAddress.location.line2]
396
+ .filter(Boolean)
397
+ .join(' '),
398
+ [
399
+ shippingAddress.location.locality,
400
+ shippingAddress.location.administrativeAreaCode,
401
+ shippingAddress.location.postalCode,
402
+ ]
403
+ .filter(Boolean)
404
+ .join(', '),
405
+ shippingAddress.location.countryCode,
406
+ ].map(item => (h("zonos-text", null, item))))));
407
+ }
408
+ render() {
409
+ const renderCollapseIcon = () => {
410
+ if (this.collapseState) {
411
+ return (h("zonos-icon", { "aria-label": "Collapse expanded section", content: ChevronDownIcon, iconColor: "gray-1200" }));
412
+ }
413
+ return (h("zonos-icon", { "aria-label": "Expand collapsed section", content: ChevronUpIcon, iconColor: "gray-1200" }));
414
+ };
415
+ return (h(Host, { class: classes([
416
+ 'zonos--collect-order-details zonos--elements',
417
+ this.isMobile && 'mobile',
418
+ ]) }, h("div", { class: "zonos--wrapper" }, h("button", { class: "zonos--order-details-header", onClick: () => {
419
+ this.collapseState = !this.collapseState;
420
+ }, type: "button" }, h("zonos-text", { type: "semiBoldLabel" }, translate('Order details')), renderCollapseIcon()), h("div", { class: "zonos--order-details-wrapper" }, h("zonos-collapse", { collapsed: this.collapseState }, h("div", { class: "zonos--collect-order-details-content" }, h("zonos-collect-cart-items", null), h("div", { class: "zonos--collect-order-info" }, h("div", { class: "zonos--collect-order-details-row" }, collectStore.amountTotalPaid !== null && (h("div", { class: "zonos--collect-order-details-column" }, h("zonos-text", { type: "smallHeader" }, translate('Total paid')), h("zonos-text", null, renderCheckoutCurrency({
421
+ amount: collectStore.amountTotalPaid || 0,
422
+ isForeign: true,
423
+ })))), collectStore.originCompanyName && (h("div", { class: "zonos--collect-order-details-column" }, h("zonos-text", { type: "smallHeader" }, translate('Ordered from')), h("zonos-text", null, collectStore.originCompanyName || '')))), this.renderShippingAddress())))))));
424
+ }
425
+ static get assetsDirs() { return ["assets"]; }
426
+ static get watchers() { return {
427
+ "collapsed": ["handleCollapseChangeFromProp"],
428
+ "collapseState": ["handleCollapseChange"]
429
+ }; }
430
+ };
431
+ ZonosCollectOrderDetails.style = ZonosCollectOrderDetailsStyle0;
432
+
433
+ const CheckmarkLineIcon = `<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M15.342 10.21a.75.75 0 0 0-1.184-.92l-2.978 3.829-1.4-1.4a.75.75 0 1 0-1.06 1.061l1.8 1.8a1 1 0 0 0 1.496-.093l3.326-4.277Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>`;
434
+
435
+ const RemoveLineIcon = `<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M14.475 10.586a.75.75 0 1 0-1.06-1.06L12 10.938l-1.414-1.414a.75.75 0 0 0-1.06 1.06L10.938 12l-1.414 1.414a.75.75 0 1 0 1.06 1.06L12 13.062l1.414 1.414a.75.75 0 0 0 1.06-1.06L13.062 12l1.414-1.414Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>`;
436
+
437
+ const zonosCollectPaymentCss = ".sc-zonos-collect-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-payment-h *.sc-zonos-collect-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-payment-h img.sc-zonos-collect-payment{max-width:100%}.sc-zonos-collect-payment-h dl.sc-zonos-collect-payment,.sc-zonos-collect-payment-h dd.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h1.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h2.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h3.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h4.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h5.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h6.sc-zonos-collect-payment,.sc-zonos-collect-payment-h hr.sc-zonos-collect-payment,.sc-zonos-collect-payment-h figure.sc-zonos-collect-payment,.sc-zonos-collect-payment-h p.sc-zonos-collect-payment,.sc-zonos-collect-payment-h pre.sc-zonos-collect-payment{margin:0}.sc-zonos-collect-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--title.sc-zonos-collect-payment{margin-bottom:24px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar{width:10px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-payment-h .zonos--payment-error-banner.sc-zonos-collect-payment{margin-bottom:8px}.sc-zonos-collect-payment-h .zonos--error-banner.sc-zonos-collect-payment{margin-bottom:16px}.sc-zonos-collect-payment-h zonos-button.sc-zonos-collect-payment{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-collect-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-collect-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:12px;bottom:-5px;padding-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-text.sc-zonos-collect-payment{text-align:center}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-button.sc-zonos-collect-payment{width:100%}.sc-zonos-collect-payment-h .zonos--test-cards.sc-zonos-collect-payment{margin-top:auto;padding-top:16px}";
438
+ const ZonosCollectPaymentStyle0 = zonosCollectPaymentCss;
439
+
440
+ const ZonosCollectPayment = class {
441
+ constructor(hostRef) {
442
+ registerInstance(this, hostRef);
443
+ this.continueClicked = createEvent(this, "continueClicked", 7);
444
+ this.paypalSessionFailed = createEvent(this, "paypalSessionFailed", 7);
445
+ this.paypalSessionDone = createEvent(this, "paypalSessionDone", 7);
446
+ this.storeUnsubscribeList = [];
447
+ /**
448
+ * Whether or not the continue button is loading
449
+ */
450
+ this.continueLoading = false;
451
+ /**
452
+ * Show error banner when the form is not complete, and user clicks on `Submit` button
453
+ * @default false
454
+ */
455
+ this.showErrorBanner = false;
456
+ /**
457
+ * Show payment error banner when the payment is failed
458
+ */
459
+ this.hasStripePaymentError = false;
460
+ /**
461
+ * Error message when the staging order creation is failed
462
+ */
463
+ this.stagingOrderCreateErrorMessage = '';
464
+ /**
465
+ * Internal state to handle continue loading
466
+ */
467
+ this.internalContinueLoading = this.continueLoading;
468
+ this.handleValidate = () => {
469
+ var _a;
470
+ return !!((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.complete);
471
+ };
472
+ /**
473
+ * handler for continue button click
474
+ */
475
+ this.continueClickHandler = async ({ currencyCode, }) => {
476
+ var _a, _b;
477
+ if (!this.handleValidate()) {
478
+ // Attempt to get the value of the billing address element to validate the form
479
+ void ((_a = stripeStore.stripeBillingAddressElement) === null || _a === void 0 ? void 0 : _a.getValue());
480
+ this.showErrorBanner = true;
481
+ // Attempt to submit the form so the missing input error will be shown in Stripe
482
+ void ((_b = stripeStore.stripeElements) === null || _b === void 0 ? void 0 : _b.submit());
483
+ setTimeout(() => {
484
+ var _a;
485
+ (_a = this.ele.querySelector('zonos-banner')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
486
+ behavior: 'smooth',
487
+ });
488
+ }, 10);
489
+ return;
490
+ }
491
+ stripeStore.checkoutSettlementCurrency = currencyCode;
492
+ // submit google tag when the form is complete
493
+ submitGtag('zonos-checkout-payment-info');
494
+ this.continueClicked.emit();
495
+ };
496
+ this.copyCardToClipboard = async (cardNumber) => {
497
+ try {
498
+ await navigator.clipboard.writeText(cardNumber);
499
+ }
500
+ catch (_a) {
501
+ // Copy happens in the iframe and it's not allowed to copy to the clipboard
502
+ const hiddenTextarea = document.createElement('textarea');
503
+ hiddenTextarea.style.position = 'fixed';
504
+ hiddenTextarea.style.left = '-1000px';
505
+ hiddenTextarea.style.top = '-1000px';
506
+ hiddenTextarea.style.width = '1px';
507
+ hiddenTextarea.style.height = '1px';
508
+ hiddenTextarea.value = cardNumber;
509
+ hiddenTextarea.id = 'zonos-copy-card-number';
510
+ document.body.appendChild(hiddenTextarea);
511
+ hiddenTextarea.select();
512
+ // Have to use deprecated method execCommand because it's the only way to copy to the clipboard in the iframe
513
+ // eslint-disable-next-line deprecation/deprecation
514
+ document.execCommand('copy');
515
+ document.body.removeChild(hiddenTextarea);
516
+ }
517
+ window.Zonos.showNotification({
518
+ message: translate('Card number copied to clipboard'),
519
+ timeout: 4000,
520
+ type: 'success',
521
+ });
522
+ };
523
+ this.placeTestOrder = async () => {
524
+ this.internalContinueLoading = true;
525
+ const { errors } = await placeTestOrder();
526
+ if (errors.length) {
527
+ this.stagingOrderCreateErrorMessage =
528
+ errors[0] || 'Failed to create staging order. Please try again.';
529
+ this.internalContinueLoading = false;
530
+ return;
531
+ }
532
+ this.internalContinueLoading = false;
533
+ // continue to the next step
534
+ cartStoreNextStep();
535
+ };
536
+ }
537
+ continueLoadingWatcher() {
538
+ this.internalContinueLoading = this.continueLoading;
539
+ }
540
+ stripePaymentErrorWatcher() {
541
+ if (this.hasStripePaymentError) {
542
+ setTimeout(() => {
543
+ var _a;
544
+ // scroll to the top of the page when the payment error is shown
545
+ (_a = this.ele.querySelector('zonos-banner')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
546
+ behavior: 'smooth',
547
+ });
548
+ }, 50);
549
+ }
550
+ }
551
+ componentWillLoad() {
552
+ this.storeUnsubscribeList = [
553
+ cartStoreOnChange('currency', () => {
554
+ // start init paypal with the presentment currency when landed cost is fetched
555
+ void paypalInitScript({
556
+ currency: cartStore.currency,
557
+ });
558
+ }),
559
+ ];
560
+ // start init paypal with the presentment currency when landed cost is fetched
561
+ void paypalInitScript({
562
+ currency: cartStore.currency,
563
+ });
564
+ }
565
+ disconnectedCallback() {
566
+ this.storeUnsubscribeList.forEach(unsubscribe => unsubscribe());
567
+ }
568
+ render() {
569
+ var _a;
570
+ this.hasStripePaymentError = stripeStore.hasPaymentError;
571
+ if (!stripeStore.stripeElements) {
572
+ return null;
573
+ }
574
+ if (!stripeStore.clientSecret) {
575
+ return null;
576
+ }
577
+ // start validate on typing after error banner is shown, and hide it if the form is complete
578
+ if (this.showErrorBanner) {
579
+ this.showErrorBanner = !this.handleValidate();
580
+ }
581
+ const isTestMode = getIsTestMode();
582
+ const isStagingMode = cartStore.isStagingMode || getIsStagingMode();
583
+ const isPaypalTabSelected = ((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
584
+ const renderPayment = () => {
585
+ if (isStagingMode) {
586
+ // If in mobile, use the theme from the store since the UI is solely by theme
587
+ const theme = zonosStore.appearance.theme;
588
+ return (h(Fragment, null, this.stagingOrderCreateErrorMessage && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, this.stagingOrderCreateErrorMessage)), h("zonos-empty-state-payment", { emptyStateText: translate('No payment method needed for staging'), theme: theme }), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.internalContinueLoading, onClick: () => {
589
+ void this.placeTestOrder();
590
+ }, size: "lg",
591
+ // use primary type when on mobile mode
592
+ variant: this.submitBtnType }, translate('Place test order')))));
593
+ }
594
+ if (stripeStore.isFetchingSession ||
595
+ collectStore.isFetchingShippingInfo) {
596
+ return null;
597
+ }
598
+ return (h(Fragment, null, this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), this.hasStripePaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, stripeStore.customErrorMessage ||
599
+ translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (h(Fragment, null, h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
600
+ stripeStore.checkoutSettlementCurrency === 'USD', loading: this.continueLoading &&
601
+ stripeStore.checkoutSettlementCurrency !== 'USD', onClick: async () => {
602
+ if (!cartStore.checkoutSession) {
603
+ log('Checkout session is not found');
604
+ return;
605
+ }
606
+ await this.continueClickHandler({
607
+ currencyCode: cartStore.checkoutSession.subtotals
608
+ .presentmentCurrencyCode,
609
+ });
610
+ }, size: "lg",
611
+ // use primary type when on mobile mode
612
+ variant: this.submitBtnType }, translate('Pay [orderTotal]', {
613
+ orderTotal: renderCheckoutCurrency({
614
+ amount: collectStore.amountDutyTaxFeeTotal || 0,
615
+ isForeign: true,
616
+ }),
617
+ })), stripeStore.shouldRenderPayInUsdButton && (h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
618
+ stripeStore.checkoutSettlementCurrency !== 'USD', loading: this.continueLoading &&
619
+ stripeStore.checkoutSettlementCurrency === 'USD', onClick: async () => {
620
+ await this.continueClickHandler({
621
+ currencyCode: 'USD',
622
+ });
623
+ }, size: "lg", variant: "subtle" }, translate('Click to pay in USD'))))), h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
624
+ this.paypalSessionDone.emit(orderId);
625
+ }, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
626
+ display: isPaypalTabSelected ? 'block' : 'none',
627
+ } })), isTestMode && (h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, h("zonos-v-stack", { spacing: 16 }, h("div", null, h("zonos-text", { type: "semiBoldLabel" }, translate('Test cards')), h("zonos-text", { textColor: "gray-700" }, translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), h("zonos-button", { icon: h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, translate('Success'), " (****4242)"), h("zonos-button", { icon: h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, translate('Failure'), " (****0002)")), h("zonos-notification", null)))));
628
+ };
629
+ return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), renderPayment())));
630
+ }
631
+ get ele() { return getElement(this); }
632
+ static get watchers() { return {
633
+ "continueLoading": ["continueLoadingWatcher"],
634
+ "hasStripePaymentError": ["stripePaymentErrorWatcher"]
635
+ }; }
636
+ };
637
+ ZonosCollectPayment.style = ZonosCollectPaymentStyle0;
638
+
639
+ const renderFallback = ({ content, isLoading, skeletonHeight, skeletonWidth, }) => {
640
+ if (isLoading) {
641
+ return (h("zonos-skeleton", { skeletonHeight: skeletonHeight, skeletonWidth: skeletonWidth }));
642
+ }
643
+ return content;
644
+ };
645
+
646
+ const zonosCollectReviewCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:-webkit-sticky;position:sticky;top:0;background-color:var(--zonos-elements-gray-0);z-index:1}:host .zonos--total-pay{margin:8px 0 24px;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;gap:48px}:host .zonos--total-pay::after{content:\"\";position:relative;height:1px;width:100%;background:var(--zonos-elements-gray-200)}:host(.mobile),:host(.tablet){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;padding:4px 0;background-color:transparent;position:relative}:host(.mobile) .zonos--total-pay,:host(.tablet) .zonos--total-pay{margin:0}";
647
+ const ZonosCollectReviewStyle0 = zonosCollectReviewCss;
648
+
649
+ const ZonosCollectReview = class {
650
+ constructor(hostRef) {
651
+ registerInstance(this, hostRef);
652
+ /**
653
+ * Whether or not the component is being rendered with mobile styles
654
+ */
655
+ this.mobile = false;
656
+ /**
657
+ * Whether or not the component is being rendered with tablet styles
658
+ */
659
+ this.tablet = false;
660
+ /**
661
+ * Whether or not to show the collapse icon
662
+ * This is controled from the collapsed state of the zonos-collapse component
663
+ * to show the collapse icon
664
+ */
665
+ this.collapsed = false;
666
+ this.isMobile = false;
667
+ this.isTablet = false;
668
+ this.isLoading = true;
669
+ }
670
+ handleWindowResize() {
671
+ this.isMobile = isCollectMobile(this.mobile);
672
+ this.isTablet = isCollectTablet(this.tablet);
673
+ }
674
+ componentWillLoad() {
675
+ this.handleWindowResize();
676
+ // Wait for the data to load
677
+ setTimeout(() => {
678
+ this.isLoading = false;
679
+ }, 1000);
680
+ }
681
+ render() {
682
+ const titleTextColor = this.isMobile ? 'gray-1000' : 'gray-800';
683
+ return (h(Host, { key: '0ad612b9bd517bde855d648cd49c853f0e76c584', class: classes([
684
+ 'zonos--collect-review zonos--elements',
685
+ this.isMobile && 'mobile',
686
+ this.isTablet && 'tablet',
687
+ ]) }, h("div", { key: 'e7f6ba00c7129d537cabd37ed0583e4385bd3e4b', class: "zonos--title" }, h("zonos-text", { key: 'eda6c8358bde6ecf2b200878b0c3cb52d71d3abe', textColor: titleTextColor, type: 'semiBoldLabel' }, translate('Pay [organizationName]', {
688
+ organizationName: zonosStore.organizationName,
689
+ }))), h("div", { key: '7247a4bc5d030c3fa605946a6acb9c9698055633', class: "zonos--total-pay" }, renderFallback({
690
+ content: (h("zonos-text", { type: 'secondaryPageHeader' }, renderCheckoutCurrency({
691
+ amount: collectStore.amountDutyTaxFeeTotal || 0,
692
+ isForeign: false,
693
+ }))),
694
+ isLoading: collectStore.isFetchingShippingInfo,
695
+ skeletonHeight: '36px',
696
+ skeletonWidth: '150px',
697
+ }))));
698
+ }
699
+ static get assetsDirs() { return ["assets"]; }
700
+ };
701
+ ZonosCollectReview.style = ZonosCollectReviewStyle0;
702
+
703
+ const zonosCollectSubtotalCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:-webkit-sticky;position:sticky;bottom:60px}:host .zonos--collect-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--collect-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--collect-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--collect-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--collect-subtotal-price{text-align:right}:host .zonos--collect-subtotal-price zonos-text{white-space:nowrap}:host .zonos--collect-total .zonos--column{padding:16px 0}:host .zonos--collect-total-subtotal .zonos--collect-subtotal-title,:host .zonos--collect-total-subtotal .zonos--collect-subtotal-price{border-bottom:1px solid var(--zonos-elements-gray-200)}:host .zonos--collect-subtotal-price zonos-text,:host .zonos--collect-pay-total zonos-text{white-space:nowrap}";
704
+ const ZonosCollectSubtotalStyle0 = zonosCollectSubtotalCss;
705
+
706
+ const ZonosCollectSubtotal = class {
707
+ constructor(hostRef) {
708
+ registerInstance(this, hostRef);
709
+ this.storeUnsubscribeList = [];
710
+ this.subtotals = {};
711
+ this.initSubtotalData = () => {
712
+ var _a, _b;
713
+ const cartLandedCostSubtotal = (_b = (_a = cartStore.checkoutSession) === null || _a === void 0 ? void 0 : _a.landedCost) === null || _b === void 0 ? void 0 : _b.amountSubtotals;
714
+ if (!cartLandedCostSubtotal) {
715
+ return;
716
+ }
717
+ // Some countries have same name for duties, taxes and fees in their language. If that happens, we need to group their values by name
718
+ const translatedDutyLabel = translate('Duties');
719
+ const translatedTaxLabel = translate('Taxes');
720
+ const translatedFeeLabel = translate('Fees');
721
+ const subtotalMap = {
722
+ [translatedDutyLabel]: 0,
723
+ [translatedFeeLabel]: 0,
724
+ [translatedTaxLabel]: 0,
725
+ };
726
+ const duties = cartLandedCostSubtotal.duties;
727
+ const taxes = cartLandedCostSubtotal.taxes;
728
+ const fees = cartLandedCostSubtotal.fees;
729
+ if (duties !== undefined) {
730
+ subtotalMap[translatedDutyLabel] || (subtotalMap[translatedDutyLabel] = 0);
731
+ subtotalMap[translatedDutyLabel] += duties;
732
+ }
733
+ if (taxes !== undefined) {
734
+ subtotalMap[translatedTaxLabel] || (subtotalMap[translatedTaxLabel] = 0);
735
+ subtotalMap[translatedTaxLabel] += taxes;
736
+ }
737
+ if (fees !== undefined) {
738
+ subtotalMap[translatedFeeLabel] || (subtotalMap[translatedFeeLabel] = 0);
739
+ subtotalMap[translatedFeeLabel] += fees;
740
+ }
741
+ this.subtotals = subtotalMap;
742
+ };
743
+ }
744
+ disconnectedCallback() {
745
+ this.storeUnsubscribeList.forEach(unsubscribe => unsubscribe());
746
+ }
747
+ componentWillLoad() {
748
+ this.storeUnsubscribeList = [
749
+ cartStoreOnChange('checkoutSession', this.initSubtotalData),
750
+ translationStoreOnChange('translatedChunks', this.initSubtotalData),
751
+ ];
752
+ }
753
+ render() {
754
+ this.initSubtotalData();
755
+ return (h(Host, { key: '802f3c4e95ac387e1635fda8c60650baa6c2a921', class: "zonos--collect-subtotal zonos--elements" }, h("table", { key: '5fb1bc3eea8cb032df0073797a03f29aad0c6a4a', class: "zonos--collect-table" }, !!this.subtotals[translate('Duties')] && (h("tr", { key: 'f0c9c76e23a98f2638132530bf162f17d1c4d369', class: "zonos--row zonos--collect-duty" }, h("td", { key: '3563ad4d3ebe19d70701dd6d846ce93f81fb620b', class: "zonos--column zonos--collect-subtotal-title" }, h("zonos-text", { key: 'a181f357c9ed0a51fd2edf6a321718e859a001b6', type: "semiBoldLabel" }, translate('Duties'))), h("td", { key: '1e35333b4f2768f52084f1ed8044b20b8ef6dcdd', class: "zonos--column" }), h("td", { key: 'd810adf7cb68dbe4abd7a50a3f136b1c8de6927c', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
756
+ content: (h("zonos-text", { type: "label" }, renderCheckoutCurrency({
757
+ amount: this.subtotals[translate('Duties')] || 0,
758
+ isForeign: true,
759
+ }))),
760
+ isLoading: collectStore.isFetchingShippingInfo,
761
+ skeletonHeight: '14px',
762
+ skeletonWidth: '150px',
763
+ })))), !!this.subtotals[translate('Taxes')] && (h("tr", { key: 'b6bf34665036c13663685f5d88f030663478d013', class: "zonos--row zonos--collect-tax" }, h("td", { key: '6595bd3da49f934a560b215774a977db6ee054f4', class: "zonos--column zonos--collect-subtotal-title" }, h("zonos-text", { key: 'b707928fc729029e601b03b1a07d00782bc805be', type: "semiBoldLabel" }, translate('Taxes'))), h("td", { key: '198d8a22daaac2b96a86ff831b40cefb8d6be057', class: "zonos--column" }), h("td", { key: '6f673d2bd36b3cc17d83732c37c21080358961b5', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
764
+ content: (h("zonos-text", { type: "label" }, renderCheckoutCurrency({
765
+ amount: this.subtotals[translate('Taxes')] || 0,
766
+ isForeign: true,
767
+ }))),
768
+ isLoading: collectStore.isFetchingShippingInfo,
769
+ skeletonHeight: '14px',
770
+ skeletonWidth: '150px',
771
+ })))), !!this.subtotals[translate('Fees')] && (h("tr", { key: 'b3392d88def450ba48cf35a7209a3f987ba2513a', class: "zonos--row zonos--collect-fee" }, h("td", { key: 'b37890202522d65bb307bf7490cafb9686ed0d83', class: "zonos--column zonos--collect-subtotal-title" }, h("zonos-text", { key: '1248245b912e6a0f7b5236c2fae13f4d33b84805', type: "semiBoldLabel" }, translate('Fees'))), h("td", { key: '47e9ad0b21ad389f1eb029ef7f8f805388f529b0', class: "zonos--column" }), h("td", { key: '6fd116a562463aa95a21f6f1635d9b33d8b9c577', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
772
+ content: (h("zonos-text", { type: "label" }, renderCheckoutCurrency({
773
+ amount: this.subtotals[translate('Fees')] || 0,
774
+ isForeign: true,
775
+ }))),
776
+ isLoading: collectStore.isFetchingShippingInfo,
777
+ skeletonHeight: '14px',
778
+ skeletonWidth: '150px',
779
+ })))), h("tr", { key: '76c57539723bd54d09a45a8d0051240ecb39db03', class: "zonos--row zonos--collect-spacing" }, h("td", { key: 'b26e8493902267d9ab81907b976af59d961a792a', class: "zonos--column", colSpan: 3 })), h("tr", { key: '20110aaeccafea4372d91e79062ec5344353e4bc', class: "zonos--row zonos--collect-total zonos--collect-total-subtotal" }, h("td", { key: 'a6463d8923e162864002121e63decb286b3a0fc8', class: "zonos--column" }), h("td", { key: '49b504de5994357d849e38c0156c5192cdad07db', class: "zonos--column zonos--collect-subtotal-title" }, h("zonos-text", { key: 'c76f8e4fba2ea9025b009ae400b5b89d30b14997', type: "label" }, translate('Subtotal'))), h("td", { key: '6568a8e64b3e1b426bb8fdf4aff9354bb1ac4b18', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
780
+ content: (h("zonos-text", { type: "label" }, renderCheckoutCurrency({
781
+ amount: collectStore.amountDutyTaxFeeTotal || 0,
782
+ isForeign: true,
783
+ }))),
784
+ isLoading: collectStore.isFetchingShippingInfo,
785
+ skeletonHeight: '14px',
786
+ skeletonWidth: '150px',
787
+ }))), h("tr", { key: 'ff9ffa08886829765a5c5c5120fdf450dab78d70', class: "zonos--row zonos--collect-total" }, h("td", { key: '1d3169797facacf6824badd69996a8d4671fa21f', class: "zonos--column" }), h("td", { key: '559350e976dae25212dab5dc3bd4a3c27ddb50e3', class: "zonos--column zonos--collect-subtotal-title" }, h("zonos-text", { key: '926be9acc7b9bc06755319a2af594a76ddc0ab2e', type: "semiBoldLabel" }, translate('Customs fees total'))), h("td", { key: '22d88d0f09b37aaf521b6e535b31fdcb00b18faa', class: "zonos--column zonos--collect-subtotal-price" }, renderFallback({
788
+ content: (h("zonos-text", { type: "semiBoldLabel" }, renderCheckoutCurrency({
789
+ amount: collectStore.amountDutyTaxFeeTotal || 0,
790
+ isForeign: true,
791
+ }))),
792
+ isLoading: collectStore.isFetchingShippingInfo,
793
+ skeletonHeight: '14px',
794
+ skeletonWidth: '150px',
795
+ }))))));
796
+ }
797
+ static get assetsDirs() { return ["assets"]; }
798
+ };
799
+ ZonosCollectSubtotal.style = ZonosCollectSubtotalStyle0;
800
+
801
+ export { ZonosCollectFinish as zonos_collect_finish, ZonosCollectFooter as zonos_collect_footer, ZonosCollectOrderDetails as zonos_collect_order_details, ZonosCollectPayment as zonos_collect_payment, ZonosCollectReview as zonos_collect_review, ZonosCollectSubtotal as zonos_collect_subtotal };