@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,98 @@
1
+ :host {
2
+ font-family: var(--zonos--font-family, Inter), Inter;
3
+ display: block;
4
+ white-space: normal;
5
+ }
6
+ :host * {
7
+ font-family: var(--zonos--font-family, Inter), Inter;
8
+ }
9
+ :host img {
10
+ max-width: 100%;
11
+ }
12
+ :host dl,
13
+ :host dd,
14
+ :host h1,
15
+ :host h2,
16
+ :host h3,
17
+ :host h4,
18
+ :host h5,
19
+ :host h6,
20
+ :host hr,
21
+ :host figure,
22
+ :host p,
23
+ :host pre {
24
+ margin: 0;
25
+ }
26
+
27
+ /* All sets of variable are here */
28
+ /* smooth font rendering */
29
+ :host {
30
+ -moz-osx-font-smoothing: grayscale;
31
+ -webkit-font-smoothing: antialiased;
32
+ }
33
+
34
+ :host {
35
+ overflow: hidden;
36
+ display: flex;
37
+ flex-direction: column;
38
+ flex: 1;
39
+ }
40
+ :host .zonos--title {
41
+ margin-bottom: 24px;
42
+ }
43
+ :host .zonos--group {
44
+ margin-bottom: 20px;
45
+ overflow: auto;
46
+ padding: 5px;
47
+ display: flex;
48
+ flex-direction: column;
49
+ flex: 1;
50
+ overscroll-behavior: contain;
51
+ }
52
+ :host .zonos--group::-webkit-scrollbar {
53
+ width: 10px;
54
+ }
55
+ :host .zonos--group::-webkit-scrollbar-track {
56
+ background: var(--zonos-elements-gray-50);
57
+ }
58
+ :host .zonos--group::-webkit-scrollbar-thumb {
59
+ border-radius: 10px;
60
+ background: #cccccc;
61
+ border: 3px solid transparent;
62
+ background-clip: content-box;
63
+ }
64
+ :host .zonos--group::-webkit-scrollbar-thumb:hover {
65
+ background: #d6d6d6;
66
+ }
67
+ :host .zonos--payment-error-banner {
68
+ margin-bottom: 8px;
69
+ }
70
+ :host .zonos--error-banner {
71
+ margin-bottom: 16px;
72
+ }
73
+ :host zonos-button {
74
+ box-shadow: 0 0 1px 0 var(--zonos-elements-gray-600);
75
+ }
76
+ :host .zonos--pay-in-base-currency-btn {
77
+ box-shadow: none;
78
+ }
79
+ :host .zonos--group-btn {
80
+ position: sticky;
81
+ display: flex;
82
+ justify-content: center;
83
+ flex-direction: column;
84
+ gap: 12px;
85
+ bottom: -5px;
86
+ padding-top: 12px;
87
+ background: var(--zonos--primary-color, var(--zonos-elements-gray-0));
88
+ }
89
+ :host .zonos--group-btn zonos-text {
90
+ text-align: center;
91
+ }
92
+ :host .zonos--group-btn zonos-button {
93
+ width: 100%;
94
+ }
95
+ :host .zonos--test-cards {
96
+ margin-top: auto;
97
+ padding-top: 16px;
98
+ }
@@ -0,0 +1,369 @@
1
+ import { Fragment, h, Host, } from "@stencil/core";
2
+ import { cartStore, cartStoreNextStep, cartStoreOnChange, } from "../../../store/checkout/cart";
3
+ import { collectStore } from "../../../store/checkout/collect";
4
+ import { paypalInitScript, paypalStore, } from "../../../store/checkout/paypal";
5
+ import { stripeStore } from "../../../store/checkout/stripe";
6
+ import { translate } from "../../../store/translationStore";
7
+ import { zonosStore } from "../../../store/zonosStore";
8
+ import { placeTestOrder } from "../../../utils/api/placeTestOrder";
9
+ import { getIsStagingMode } from "../../../utils/checkout/getIsStagingMode";
10
+ import { getIsTestMode } from "../../../utils/checkout/getIsTestMode";
11
+ import { renderCheckoutCurrency } from "../../../utils/checkout/renderCheckoutCurrency";
12
+ import { log } from "../../../utils/logging/log";
13
+ import { submitGtag } from "../../../utils/submitGtag";
14
+ // eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
15
+ import CheckmarkLineIcon from "./assets/CheckmarkLineIcon.svg";
16
+ // eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
17
+ import RemoveLineIcon from "./assets/RemoveLineIcon.svg";
18
+ export class ZonosCollectPayment {
19
+ constructor() {
20
+ this.storeUnsubscribeList = [];
21
+ /**
22
+ * Whether or not the continue button is loading
23
+ */
24
+ this.continueLoading = false;
25
+ /**
26
+ * Show error banner when the form is not complete, and user clicks on `Submit` button
27
+ * @default false
28
+ */
29
+ this.showErrorBanner = false;
30
+ /**
31
+ * Show payment error banner when the payment is failed
32
+ */
33
+ this.hasStripePaymentError = false;
34
+ /**
35
+ * Error message when the staging order creation is failed
36
+ */
37
+ this.stagingOrderCreateErrorMessage = '';
38
+ /**
39
+ * Internal state to handle continue loading
40
+ */
41
+ this.internalContinueLoading = this.continueLoading;
42
+ this.handleValidate = () => {
43
+ var _a;
44
+ return !!((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.complete);
45
+ };
46
+ /**
47
+ * handler for continue button click
48
+ */
49
+ this.continueClickHandler = async ({ currencyCode, }) => {
50
+ var _a, _b;
51
+ if (!this.handleValidate()) {
52
+ // Attempt to get the value of the billing address element to validate the form
53
+ void ((_a = stripeStore.stripeBillingAddressElement) === null || _a === void 0 ? void 0 : _a.getValue());
54
+ this.showErrorBanner = true;
55
+ // Attempt to submit the form so the missing input error will be shown in Stripe
56
+ void ((_b = stripeStore.stripeElements) === null || _b === void 0 ? void 0 : _b.submit());
57
+ setTimeout(() => {
58
+ var _a;
59
+ (_a = this.ele.querySelector('zonos-banner')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
60
+ behavior: 'smooth',
61
+ });
62
+ }, 10);
63
+ return;
64
+ }
65
+ stripeStore.checkoutSettlementCurrency = currencyCode;
66
+ // submit google tag when the form is complete
67
+ submitGtag('zonos-checkout-payment-info');
68
+ this.continueClicked.emit();
69
+ };
70
+ this.copyCardToClipboard = async (cardNumber) => {
71
+ try {
72
+ await navigator.clipboard.writeText(cardNumber);
73
+ }
74
+ catch (_a) {
75
+ // Copy happens in the iframe and it's not allowed to copy to the clipboard
76
+ const hiddenTextarea = document.createElement('textarea');
77
+ hiddenTextarea.style.position = 'fixed';
78
+ hiddenTextarea.style.left = '-1000px';
79
+ hiddenTextarea.style.top = '-1000px';
80
+ hiddenTextarea.style.width = '1px';
81
+ hiddenTextarea.style.height = '1px';
82
+ hiddenTextarea.value = cardNumber;
83
+ hiddenTextarea.id = 'zonos-copy-card-number';
84
+ document.body.appendChild(hiddenTextarea);
85
+ hiddenTextarea.select();
86
+ // Have to use deprecated method execCommand because it's the only way to copy to the clipboard in the iframe
87
+ // eslint-disable-next-line deprecation/deprecation
88
+ document.execCommand('copy');
89
+ document.body.removeChild(hiddenTextarea);
90
+ }
91
+ window.Zonos.showNotification({
92
+ message: translate('Card number copied to clipboard'),
93
+ timeout: 4000,
94
+ type: 'success',
95
+ });
96
+ };
97
+ this.placeTestOrder = async () => {
98
+ this.internalContinueLoading = true;
99
+ const { errors } = await placeTestOrder();
100
+ if (errors.length) {
101
+ this.stagingOrderCreateErrorMessage =
102
+ errors[0] || 'Failed to create staging order. Please try again.';
103
+ this.internalContinueLoading = false;
104
+ return;
105
+ }
106
+ this.internalContinueLoading = false;
107
+ // continue to the next step
108
+ cartStoreNextStep();
109
+ };
110
+ }
111
+ continueLoadingWatcher() {
112
+ this.internalContinueLoading = this.continueLoading;
113
+ }
114
+ stripePaymentErrorWatcher() {
115
+ if (this.hasStripePaymentError) {
116
+ setTimeout(() => {
117
+ var _a;
118
+ // scroll to the top of the page when the payment error is shown
119
+ (_a = this.ele.querySelector('zonos-banner')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
120
+ behavior: 'smooth',
121
+ });
122
+ }, 50);
123
+ }
124
+ }
125
+ componentWillLoad() {
126
+ this.storeUnsubscribeList = [
127
+ cartStoreOnChange('currency', () => {
128
+ // start init paypal with the presentment currency when landed cost is fetched
129
+ void paypalInitScript({
130
+ currency: cartStore.currency,
131
+ });
132
+ }),
133
+ ];
134
+ // start init paypal with the presentment currency when landed cost is fetched
135
+ void paypalInitScript({
136
+ currency: cartStore.currency,
137
+ });
138
+ }
139
+ disconnectedCallback() {
140
+ this.storeUnsubscribeList.forEach(unsubscribe => unsubscribe());
141
+ }
142
+ render() {
143
+ var _a;
144
+ this.hasStripePaymentError = stripeStore.hasPaymentError;
145
+ if (!stripeStore.stripeElements) {
146
+ return null;
147
+ }
148
+ if (!stripeStore.clientSecret) {
149
+ return null;
150
+ }
151
+ // start validate on typing after error banner is shown, and hide it if the form is complete
152
+ if (this.showErrorBanner) {
153
+ this.showErrorBanner = !this.handleValidate();
154
+ }
155
+ const isTestMode = getIsTestMode();
156
+ const isStagingMode = cartStore.isStagingMode || getIsStagingMode();
157
+ const isPaypalTabSelected = ((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
158
+ const renderPayment = () => {
159
+ if (isStagingMode) {
160
+ // If in mobile, use the theme from the store since the UI is solely by theme
161
+ const theme = zonosStore.appearance.theme;
162
+ 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: () => {
163
+ void this.placeTestOrder();
164
+ }, size: "lg",
165
+ // use primary type when on mobile mode
166
+ variant: this.submitBtnType }, translate('Place test order')))));
167
+ }
168
+ if (stripeStore.isFetchingSession ||
169
+ collectStore.isFetchingShippingInfo) {
170
+ return null;
171
+ }
172
+ 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 ||
173
+ 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 &&
174
+ stripeStore.checkoutSettlementCurrency === 'USD', loading: this.continueLoading &&
175
+ stripeStore.checkoutSettlementCurrency !== 'USD', onClick: async () => {
176
+ if (!cartStore.checkoutSession) {
177
+ log('Checkout session is not found');
178
+ return;
179
+ }
180
+ await this.continueClickHandler({
181
+ currencyCode: cartStore.checkoutSession.subtotals
182
+ .presentmentCurrencyCode,
183
+ });
184
+ }, size: "lg",
185
+ // use primary type when on mobile mode
186
+ variant: this.submitBtnType }, translate('Pay [orderTotal]', {
187
+ orderTotal: renderCheckoutCurrency({
188
+ amount: collectStore.amountDutyTaxFeeTotal || 0,
189
+ isForeign: true,
190
+ }),
191
+ })), stripeStore.shouldRenderPayInUsdButton && (h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
192
+ stripeStore.checkoutSettlementCurrency !== 'USD', loading: this.continueLoading &&
193
+ stripeStore.checkoutSettlementCurrency === 'USD', onClick: async () => {
194
+ await this.continueClickHandler({
195
+ currencyCode: 'USD',
196
+ });
197
+ }, size: "lg", variant: "subtle" }, translate('Click to pay in USD'))))), h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
198
+ this.paypalSessionDone.emit(orderId);
199
+ }, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
200
+ display: isPaypalTabSelected ? 'block' : 'none',
201
+ } })), 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)))));
202
+ };
203
+ 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())));
204
+ }
205
+ static get is() { return "zonos-collect-payment"; }
206
+ static get encapsulation() { return "scoped"; }
207
+ static get originalStyleUrls() {
208
+ return {
209
+ "$": ["zonos-collect-payment.scss"]
210
+ };
211
+ }
212
+ static get styleUrls() {
213
+ return {
214
+ "$": ["zonos-collect-payment.css"]
215
+ };
216
+ }
217
+ static get properties() {
218
+ return {
219
+ "submitBtnType": {
220
+ "type": "string",
221
+ "mutable": false,
222
+ "complexType": {
223
+ "original": "HTMLZonosButtonElement['variant']",
224
+ "resolved": "\"danger\" | \"outline\" | \"primary\" | \"standard\" | \"subtle\" | \"success\" | \"warning\" | undefined",
225
+ "references": {
226
+ "HTMLZonosButtonElement": {
227
+ "location": "global",
228
+ "id": "global::HTMLZonosButtonElement"
229
+ }
230
+ }
231
+ },
232
+ "required": false,
233
+ "optional": true,
234
+ "docs": {
235
+ "tags": [],
236
+ "text": "Whether or not the checkout is in mobile mode"
237
+ },
238
+ "getter": false,
239
+ "setter": false,
240
+ "attribute": "submit-btn-type",
241
+ "reflect": false
242
+ },
243
+ "continueLoading": {
244
+ "type": "boolean",
245
+ "mutable": false,
246
+ "complexType": {
247
+ "original": "boolean",
248
+ "resolved": "boolean",
249
+ "references": {}
250
+ },
251
+ "required": false,
252
+ "optional": false,
253
+ "docs": {
254
+ "tags": [],
255
+ "text": "Whether or not the continue button is loading"
256
+ },
257
+ "getter": false,
258
+ "setter": false,
259
+ "attribute": "continue-loading",
260
+ "reflect": false,
261
+ "defaultValue": "false"
262
+ },
263
+ "submitBtnColor": {
264
+ "type": "string",
265
+ "mutable": false,
266
+ "complexType": {
267
+ "original": "string",
268
+ "resolved": "string | undefined",
269
+ "references": {}
270
+ },
271
+ "required": false,
272
+ "optional": true,
273
+ "docs": {
274
+ "tags": [],
275
+ "text": "Submit button main color"
276
+ },
277
+ "getter": false,
278
+ "setter": false,
279
+ "attribute": "submit-btn-color",
280
+ "reflect": false
281
+ },
282
+ "overridePrimaryColor": {
283
+ "type": "string",
284
+ "mutable": false,
285
+ "complexType": {
286
+ "original": "string",
287
+ "resolved": "string | undefined",
288
+ "references": {}
289
+ },
290
+ "required": false,
291
+ "optional": true,
292
+ "docs": {
293
+ "tags": [],
294
+ "text": "Primary color to override primary color from appearance primary color in setting."
295
+ },
296
+ "getter": false,
297
+ "setter": false,
298
+ "attribute": "override-primary-color",
299
+ "reflect": false
300
+ }
301
+ };
302
+ }
303
+ static get states() {
304
+ return {
305
+ "showErrorBanner": {},
306
+ "hasStripePaymentError": {},
307
+ "stagingOrderCreateErrorMessage": {},
308
+ "internalContinueLoading": {}
309
+ };
310
+ }
311
+ static get events() {
312
+ return [{
313
+ "method": "continueClicked",
314
+ "name": "continueClicked",
315
+ "bubbles": true,
316
+ "cancelable": true,
317
+ "composed": true,
318
+ "docs": {
319
+ "tags": [],
320
+ "text": "Event to emit when the continue button is clicked"
321
+ },
322
+ "complexType": {
323
+ "original": "void",
324
+ "resolved": "void",
325
+ "references": {}
326
+ }
327
+ }, {
328
+ "method": "paypalSessionFailed",
329
+ "name": "paypalSessionFailed",
330
+ "bubbles": true,
331
+ "cancelable": true,
332
+ "composed": true,
333
+ "docs": {
334
+ "tags": [],
335
+ "text": "Event to emit when the paypal session failed"
336
+ },
337
+ "complexType": {
338
+ "original": "void",
339
+ "resolved": "void",
340
+ "references": {}
341
+ }
342
+ }, {
343
+ "method": "paypalSessionDone",
344
+ "name": "paypalSessionDone",
345
+ "bubbles": true,
346
+ "cancelable": true,
347
+ "composed": true,
348
+ "docs": {
349
+ "tags": [],
350
+ "text": "Event to emit when the paypal session is done"
351
+ },
352
+ "complexType": {
353
+ "original": "string",
354
+ "resolved": "string",
355
+ "references": {}
356
+ }
357
+ }];
358
+ }
359
+ static get elementRef() { return "ele"; }
360
+ static get watchers() {
361
+ return [{
362
+ "propName": "continueLoading",
363
+ "methodName": "continueLoadingWatcher"
364
+ }, {
365
+ "propName": "hasStripePaymentError",
366
+ "methodName": "stripePaymentErrorWatcher"
367
+ }];
368
+ }
369
+ }
@@ -0,0 +1,68 @@
1
+ :host {
2
+ font-family: var(--zonos--font-family, Inter), Inter;
3
+ display: block;
4
+ white-space: normal;
5
+ }
6
+ :host * {
7
+ font-family: var(--zonos--font-family, Inter), Inter;
8
+ }
9
+ :host img {
10
+ max-width: 100%;
11
+ }
12
+ :host dl,
13
+ :host dd,
14
+ :host h1,
15
+ :host h2,
16
+ :host h3,
17
+ :host h4,
18
+ :host h5,
19
+ :host h6,
20
+ :host hr,
21
+ :host figure,
22
+ :host p,
23
+ :host pre {
24
+ margin: 0;
25
+ }
26
+
27
+ /* All sets of variable are here */
28
+ /* smooth font rendering */
29
+ :host {
30
+ -moz-osx-font-smoothing: grayscale;
31
+ -webkit-font-smoothing: antialiased;
32
+ }
33
+
34
+ :host {
35
+ position: sticky;
36
+ top: 0;
37
+ background-color: var(--zonos-elements-gray-0);
38
+ z-index: 1;
39
+ }
40
+ :host .zonos--total-pay {
41
+ margin: 8px 0 24px;
42
+ display: flex;
43
+ flex-grow: 1;
44
+ flex-shrink: 0;
45
+ align-items: center;
46
+ gap: 48px;
47
+ }
48
+ :host .zonos--total-pay::after {
49
+ content: "";
50
+ position: relative;
51
+ height: 1px;
52
+ width: 100%;
53
+ background: var(--zonos-elements-gray-200);
54
+ }
55
+
56
+ :host(.mobile),
57
+ :host(.tablet) {
58
+ display: flex;
59
+ flex-direction: column;
60
+ gap: 8px;
61
+ padding: 4px 0;
62
+ background-color: transparent;
63
+ position: relative;
64
+ }
65
+ :host(.mobile) .zonos--total-pay,
66
+ :host(.tablet) .zonos--total-pay {
67
+ margin: 0;
68
+ }
@@ -0,0 +1,151 @@
1
+ import { h, Host } from "@stencil/core";
2
+ import { collectStore } from "../../../store/checkout/collect";
3
+ import { translate } from "../../../store/translationStore";
4
+ import { zonosStore } from "../../../store/zonosStore";
5
+ import { isCollectMobile, isCollectTablet, } from "../../../utils/checkout/isCollectMobileTablet";
6
+ import { renderCheckoutCurrency } from "../../../utils/checkout/renderCheckoutCurrency";
7
+ import { classes } from "../../../utils/classes";
8
+ import { renderFallback } from "../../../utils/renderFallback";
9
+ export class ZonosCollectReview {
10
+ constructor() {
11
+ /**
12
+ * Whether or not the component is being rendered with mobile styles
13
+ */
14
+ this.mobile = false;
15
+ /**
16
+ * Whether or not the component is being rendered with tablet styles
17
+ */
18
+ this.tablet = false;
19
+ /**
20
+ * Whether or not to show the collapse icon
21
+ * This is controled from the collapsed state of the zonos-collapse component
22
+ * to show the collapse icon
23
+ */
24
+ this.collapsed = false;
25
+ this.isMobile = false;
26
+ this.isTablet = false;
27
+ this.isLoading = true;
28
+ }
29
+ handleWindowResize() {
30
+ this.isMobile = isCollectMobile(this.mobile);
31
+ this.isTablet = isCollectTablet(this.tablet);
32
+ }
33
+ componentWillLoad() {
34
+ this.handleWindowResize();
35
+ // Wait for the data to load
36
+ setTimeout(() => {
37
+ this.isLoading = false;
38
+ }, 1000);
39
+ }
40
+ render() {
41
+ const titleTextColor = this.isMobile ? 'gray-1000' : 'gray-800';
42
+ return (h(Host, { key: '0ad612b9bd517bde855d648cd49c853f0e76c584', class: classes([
43
+ 'zonos--collect-review zonos--elements',
44
+ this.isMobile && 'mobile',
45
+ this.isTablet && 'tablet',
46
+ ]) }, h("div", { key: 'e7f6ba00c7129d537cabd37ed0583e4385bd3e4b', class: "zonos--title" }, h("zonos-text", { key: 'eda6c8358bde6ecf2b200878b0c3cb52d71d3abe', textColor: titleTextColor, type: 'semiBoldLabel' }, translate('Pay [organizationName]', {
47
+ organizationName: zonosStore.organizationName,
48
+ }))), h("div", { key: '7247a4bc5d030c3fa605946a6acb9c9698055633', class: "zonos--total-pay" }, renderFallback({
49
+ content: (h("zonos-text", { type: 'secondaryPageHeader' }, renderCheckoutCurrency({
50
+ amount: collectStore.amountDutyTaxFeeTotal || 0,
51
+ isForeign: false,
52
+ }))),
53
+ isLoading: collectStore.isFetchingShippingInfo,
54
+ skeletonHeight: '36px',
55
+ skeletonWidth: '150px',
56
+ }))));
57
+ }
58
+ static get is() { return "zonos-collect-review"; }
59
+ static get encapsulation() { return "shadow"; }
60
+ static get originalStyleUrls() {
61
+ return {
62
+ "$": ["zonos-collect-review.scss"]
63
+ };
64
+ }
65
+ static get styleUrls() {
66
+ return {
67
+ "$": ["zonos-collect-review.css"]
68
+ };
69
+ }
70
+ static get assetsDirs() { return ["assets"]; }
71
+ static get properties() {
72
+ return {
73
+ "mobile": {
74
+ "type": "boolean",
75
+ "mutable": false,
76
+ "complexType": {
77
+ "original": "boolean",
78
+ "resolved": "boolean",
79
+ "references": {}
80
+ },
81
+ "required": false,
82
+ "optional": false,
83
+ "docs": {
84
+ "tags": [],
85
+ "text": "Whether or not the component is being rendered with mobile styles"
86
+ },
87
+ "getter": false,
88
+ "setter": false,
89
+ "attribute": "mobile",
90
+ "reflect": false,
91
+ "defaultValue": "false"
92
+ },
93
+ "tablet": {
94
+ "type": "boolean",
95
+ "mutable": false,
96
+ "complexType": {
97
+ "original": "boolean",
98
+ "resolved": "boolean",
99
+ "references": {}
100
+ },
101
+ "required": false,
102
+ "optional": false,
103
+ "docs": {
104
+ "tags": [],
105
+ "text": "Whether or not the component is being rendered with tablet styles"
106
+ },
107
+ "getter": false,
108
+ "setter": false,
109
+ "attribute": "tablet",
110
+ "reflect": false,
111
+ "defaultValue": "false"
112
+ },
113
+ "collapsed": {
114
+ "type": "boolean",
115
+ "mutable": false,
116
+ "complexType": {
117
+ "original": "boolean",
118
+ "resolved": "boolean",
119
+ "references": {}
120
+ },
121
+ "required": false,
122
+ "optional": false,
123
+ "docs": {
124
+ "tags": [],
125
+ "text": "Whether or not to show the collapse icon\nThis is controled from the collapsed state of the zonos-collapse component\nto show the collapse icon"
126
+ },
127
+ "getter": false,
128
+ "setter": false,
129
+ "attribute": "collapsed",
130
+ "reflect": false,
131
+ "defaultValue": "false"
132
+ }
133
+ };
134
+ }
135
+ static get states() {
136
+ return {
137
+ "isMobile": {},
138
+ "isTablet": {},
139
+ "isLoading": {}
140
+ };
141
+ }
142
+ static get listeners() {
143
+ return [{
144
+ "name": "resize",
145
+ "method": "handleWindowResize",
146
+ "target": "window",
147
+ "capture": false,
148
+ "passive": true
149
+ }];
150
+ }
151
+ }