@zonos/elements 1.3.5 → 1.3.7-alpha.0

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/ILanguage-d247b45b.js +26 -0
  2. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  3. package/dist/cjs/{localization-d43e1540.js → cart-ecc80eb0.js} +1086 -2
  4. package/dist/cjs/{getBorderRadius-cd7ef574.js → getBorderRadius-834c321d.js} +8 -4
  5. package/dist/cjs/index.cjs.js +0 -21
  6. package/dist/cjs/{isDarkColor-5eda1323.js → isDarkColor-924e6a7a.js} +1 -1
  7. package/dist/cjs/loader.cjs.js +5 -3
  8. package/dist/cjs/{submitGtag-bd6e9b42.js → submitGtag-907e71d3.js} +3 -3
  9. package/dist/cjs/zonos-address_4.cjs.entry.js +301 -0
  10. package/dist/cjs/zonos-badge_2.cjs.entry.js +57 -0
  11. package/dist/cjs/zonos-banner.cjs.entry.js +4 -9
  12. package/dist/cjs/{zonos-button_2.cjs.entry.js → zonos-button_3.cjs.entry.js} +42 -15
  13. package/dist/cjs/zonos-card_2.cjs.entry.js +28 -14
  14. package/dist/cjs/{zonos-cart-items_10.cjs.entry.js → zonos-cart-items_9.cjs.entry.js} +98 -99
  15. package/dist/cjs/zonos-checkout.cjs.entry.js +25 -27
  16. package/dist/cjs/zonos-component.cjs.entry.js +2 -2
  17. package/dist/cjs/zonos-controller.cjs.entry.js +29 -30
  18. package/dist/cjs/zonos-country-flag.cjs.entry.js +42 -0
  19. package/dist/cjs/{zonos-country-flag_4.cjs.entry.js → zonos-country-select_3.cjs.entry.js} +31 -56
  20. package/dist/cjs/zonos-elements.cjs.js +6 -4
  21. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +29 -22
  22. package/dist/cjs/zonos-hello.cjs.entry.js +35 -33
  23. package/dist/cjs/zonos-logo.cjs.entry.js +32 -0
  24. package/dist/cjs/zonos-notification.cjs.entry.js +5 -6
  25. package/dist/cjs/zonos-payment.cjs.entry.js +6 -7
  26. package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +45 -0
  27. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +4 -4
  28. package/dist/cjs/zonos-text.cjs.entry.js +4 -6
  29. package/dist/cjs/{zonosStore-b88b5671.js → zonosStore-49d4c92a.js} +5 -5
  30. package/dist/collection/collection-manifest.json +6 -1
  31. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +1 -1
  32. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +13 -8
  33. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/chevronDownIcon.svg +1 -0
  34. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/globe.svg +3 -0
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/zonosIcon.svg +5 -0
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.css +126 -0
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +60 -0
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +1 -1
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +12 -21
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +4 -5
  41. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +11 -1
  42. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +12 -4
  43. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +3 -3
  44. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +1 -1
  45. package/dist/collection/components/common/zonos-badge/zonos-badge.js +7 -26
  46. package/dist/collection/components/common/zonos-banner/zonos-banner.js +2 -25
  47. package/dist/collection/components/common/zonos-button/zonos-button.css +18 -0
  48. package/dist/collection/components/common/zonos-button/zonos-button.js +9 -28
  49. package/dist/collection/components/common/zonos-card/zonos-card.js +2 -20
  50. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.css +82 -0
  51. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +218 -0
  52. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +15 -2
  53. package/dist/collection/components/common/zonos-country-flag/zonos-country-flag.js +1 -20
  54. package/dist/collection/components/common/zonos-country-select/assets/greenCheckDuotone.svg +4 -0
  55. package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +11 -10
  56. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +7 -11
  57. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  58. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  59. package/dist/collection/components/common/zonos-icon/zonos-icon.js +4 -4
  60. package/dist/collection/components/common/zonos-language-select/assets/greenCheckDuotone.svg +4 -0
  61. package/dist/collection/components/common/zonos-language-select/zonos-language-select.css +61 -0
  62. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +58 -0
  63. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -21
  64. package/dist/collection/components/common/zonos-notification/zonos-notification.js +3 -26
  65. package/dist/collection/components/common/zonos-select-dialog-header/assets/removeIcon.svg +1 -0
  66. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.css +45 -0
  67. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +68 -0
  68. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +1 -1
  69. package/dist/collection/components/common/zonos-spinner/zonos-spinner.js +4 -4
  70. package/dist/collection/components/common/zonos-text/zonos-text.js +4 -24
  71. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.css +55 -0
  72. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +72 -0
  73. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -21
  74. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  75. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/globe.svg +3 -0
  76. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.css +10 -0
  77. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +27 -5
  78. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.css +16 -2
  79. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +11 -5
  80. package/dist/collection/components/main/zonos-controller.js +1 -1
  81. package/dist/collection/components/store/checkout/stripe.js +31 -7
  82. package/dist/collection/components/store/hello/localization.js +32 -2
  83. package/dist/collection/components/store/translationStore/strings.arabic.js +18 -0
  84. package/dist/collection/components/store/translationStore/strings.base.js +18 -0
  85. package/dist/collection/components/store/translationStore/strings.chinese.js +18 -0
  86. package/dist/collection/components/store/translationStore/strings.danish.js +18 -0
  87. package/dist/collection/components/store/translationStore/strings.dutch.js +18 -0
  88. package/dist/collection/components/store/translationStore/strings.french.js +18 -0
  89. package/dist/collection/components/store/translationStore/strings.german.js +18 -0
  90. package/dist/collection/components/store/translationStore/strings.hebrew.js +18 -0
  91. package/dist/collection/components/store/translationStore/strings.indonesian.js +18 -0
  92. package/dist/collection/components/store/translationStore/strings.italian.js +18 -0
  93. package/dist/collection/components/store/translationStore/strings.japanese.js +18 -0
  94. package/dist/collection/components/store/translationStore/strings.korean.js +18 -0
  95. package/dist/collection/components/store/translationStore/strings.norwegian.js +18 -0
  96. package/dist/collection/components/store/translationStore/strings.polish.js +18 -0
  97. package/dist/collection/components/store/translationStore/strings.portuguese.js +18 -0
  98. package/dist/collection/components/store/translationStore/strings.russian.js +18 -0
  99. package/dist/collection/components/store/translationStore/strings.spanish.js +18 -0
  100. package/dist/collection/components/store/translationStore/strings.swedish.js +18 -0
  101. package/dist/collection/components/store/translationStore/strings.turkish.js +18 -0
  102. package/dist/collection/components/store/translationStore/strings.vietnamese.js +18 -0
  103. package/dist/collection/components/store/zonosStore.js +4 -4
  104. package/dist/collection/components/stripe/zonos-address/zonos-address.js +63 -24
  105. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
  106. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  107. package/dist/collection/components/utils/api/prepCalculateLandedCost.js +19 -1
  108. package/dist/collection/components/utils/api/triggerBuildLandedCost.js +11 -5
  109. package/dist/collection/components/utils/getBorderRadius.js +7 -3
  110. package/dist/collection/types/ILanguage.js +22 -0
  111. package/dist/collection/types/generated/graphql.customer.types.js +19 -0
  112. package/dist/collection/types/index.js +0 -1
  113. package/dist/collection/types/styles/Color.js +9 -0
  114. package/dist/components/ILanguage.js +24 -0
  115. package/dist/components/getBorderRadius.js +7 -3
  116. package/dist/components/index.js +0 -1
  117. package/dist/components/isDarkColor.js +1 -1
  118. package/dist/components/{localization.js → stripe.js} +1070 -2
  119. package/dist/components/submitGtag.js +1 -1
  120. package/dist/components/zonos-address2.js +64 -26
  121. package/dist/components/zonos-badge2.js +8 -10
  122. package/dist/components/zonos-banner2.js +3 -9
  123. package/dist/components/zonos-button2.js +10 -12
  124. package/dist/components/zonos-card2.js +3 -5
  125. package/dist/components/zonos-cart-items2.js +1 -1
  126. package/dist/components/zonos-cart-subtotal2.js +14 -9
  127. package/dist/components/zonos-checkbox.d.ts +11 -0
  128. package/dist/components/zonos-checkbox.js +6 -0
  129. package/dist/components/zonos-checkbox2.js +87 -0
  130. package/dist/components/zonos-checkout-finish2.js +15 -7
  131. package/dist/components/zonos-checkout-footer.d.ts +11 -0
  132. package/dist/components/zonos-checkout-footer.js +6 -0
  133. package/dist/components/zonos-checkout-footer2.js +109 -0
  134. package/dist/components/zonos-checkout-payment2.js +2 -3
  135. package/dist/components/zonos-checkout.js +74 -52
  136. package/dist/components/zonos-collapse2.js +16 -3
  137. package/dist/components/zonos-component.js +1 -1
  138. package/dist/components/zonos-controller.js +3 -4
  139. package/dist/components/zonos-country-flag2.js +3 -5
  140. package/dist/components/zonos-country-select2.js +26 -19
  141. package/dist/components/zonos-custom-message2.js +3 -3
  142. package/dist/components/zonos-customer-info2.js +30 -11
  143. package/dist/components/zonos-dialog2.js +4 -4
  144. package/dist/components/zonos-hello-dialog-footer2.js +23 -10
  145. package/dist/components/zonos-hello-dialog2.js +41 -23
  146. package/dist/components/zonos-hello.js +31 -19
  147. package/dist/components/zonos-icon2.js +4 -4
  148. package/dist/components/zonos-language-select.d.ts +11 -0
  149. package/dist/components/zonos-language-select.js +6 -0
  150. package/dist/components/zonos-language-select2.js +87 -0
  151. package/dist/components/zonos-link-authentication2.js +2 -2
  152. package/dist/components/zonos-logo.js +44 -1
  153. package/dist/components/zonos-notification2.js +4 -6
  154. package/dist/components/zonos-payment2.js +2 -2
  155. package/dist/components/zonos-review2.js +4 -5
  156. package/dist/components/zonos-select-dialog-header.d.ts +11 -0
  157. package/dist/components/zonos-select-dialog-header.js +6 -0
  158. package/dist/components/zonos-select-dialog-header2.js +71 -0
  159. package/dist/components/zonos-shipping-rich-radio2.js +2 -2
  160. package/dist/components/zonos-shipping2.js +2 -3
  161. package/dist/components/zonos-spinner2.js +3 -3
  162. package/dist/components/zonos-text2.js +4 -7
  163. package/dist/components/zonos-tooltip.d.ts +11 -0
  164. package/dist/components/zonos-tooltip.js +6 -0
  165. package/dist/components/zonos-tooltip2.js +48 -0
  166. package/dist/components/zonos-v-stack2.js +4 -6
  167. package/dist/components/zonosStore.js +5 -5
  168. package/dist/esm/ILanguage-97790bee.js +24 -0
  169. package/dist/esm/app-globals-0f993ce5.js +3 -0
  170. package/dist/esm/{localization-5d83fde2.js → cart-2a0a6871.js} +1071 -3
  171. package/dist/esm/getBorderRadius-0c7dfcf0.js +20 -0
  172. package/dist/esm/index.js +1 -6
  173. package/dist/esm/{isDarkColor-8696cb70.js → isDarkColor-d0a57fd2.js} +1 -1
  174. package/dist/esm/loader.js +6 -4
  175. package/dist/esm/{submitGtag-776c5e10.js → submitGtag-a38aed23.js} +2 -2
  176. package/dist/esm/zonos-address_4.entry.js +294 -0
  177. package/dist/esm/zonos-badge_2.entry.js +52 -0
  178. package/dist/esm/zonos-banner.entry.js +4 -9
  179. package/dist/esm/{zonos-button_2.entry.js → zonos-button_3.entry.js} +42 -16
  180. package/dist/esm/zonos-card_2.entry.js +28 -14
  181. package/dist/esm/{zonos-cart-items_10.entry.js → zonos-cart-items_9.entry.js} +86 -86
  182. package/dist/esm/zonos-checkout.entry.js +11 -13
  183. package/dist/esm/zonos-component.entry.js +2 -2
  184. package/dist/esm/zonos-controller.entry.js +6 -7
  185. package/dist/esm/zonos-country-flag.entry.js +38 -0
  186. package/dist/esm/{zonos-country-flag_4.entry.js → zonos-country-select_3.entry.js} +31 -55
  187. package/dist/esm/zonos-elements.js +7 -5
  188. package/dist/esm/zonos-hello-dialog.entry.js +15 -8
  189. package/dist/esm/zonos-hello.entry.js +5 -3
  190. package/dist/esm/zonos-logo.entry.js +28 -0
  191. package/dist/esm/zonos-notification.entry.js +5 -6
  192. package/dist/esm/zonos-payment.entry.js +6 -7
  193. package/dist/esm/zonos-select-dialog-header_2.entry.js +40 -0
  194. package/dist/esm/zonos-shipping-rich-radio.entry.js +4 -4
  195. package/dist/esm/zonos-text.entry.js +4 -6
  196. package/dist/esm/{zonosStore-e59617f8.js → zonosStore-dec6bd7e.js} +5 -5
  197. package/dist/esm-es5/ILanguage-97790bee.js +1 -0
  198. package/dist/esm-es5/app-globals-0f993ce5.js +1 -0
  199. package/dist/esm-es5/cart-2a0a6871.js +1 -0
  200. package/dist/esm-es5/getBorderRadius-0c7dfcf0.js +1 -0
  201. package/dist/esm-es5/index.js +0 -1
  202. package/dist/esm-es5/{isDarkColor-8696cb70.js → isDarkColor-d0a57fd2.js} +1 -1
  203. package/dist/esm-es5/loader.js +1 -1
  204. package/dist/esm-es5/submitGtag-a38aed23.js +1 -0
  205. package/dist/esm-es5/zonos-address_4.entry.js +1 -0
  206. package/dist/esm-es5/zonos-badge_2.entry.js +1 -0
  207. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  208. package/dist/esm-es5/zonos-button_3.entry.js +1 -0
  209. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  210. package/dist/esm-es5/zonos-cart-items_9.entry.js +1 -0
  211. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  212. package/dist/esm-es5/zonos-component.entry.js +1 -1
  213. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  214. package/dist/esm-es5/zonos-country-flag.entry.js +1 -0
  215. package/dist/esm-es5/zonos-country-select_3.entry.js +1 -0
  216. package/dist/esm-es5/zonos-elements.js +1 -1
  217. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  218. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  219. package/dist/esm-es5/zonos-logo.entry.js +1 -0
  220. package/dist/esm-es5/zonos-notification.entry.js +1 -1
  221. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  222. package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -0
  223. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  224. package/dist/esm-es5/zonos-text.entry.js +1 -1
  225. package/dist/esm-es5/{zonosStore-e59617f8.js → zonosStore-dec6bd7e.js} +1 -1
  226. package/dist/scripts/insertTranslations.js +1 -0
  227. package/dist/scripts/loadZonos.js +1 -1
  228. package/dist/scripts/zonos.js +1 -1
  229. package/dist/scripts/zonosBase.js +1 -1
  230. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +2 -1
  231. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.d.ts +7 -0
  232. package/dist/types/components/common/zonos-badge/zonos-badge.d.ts +1 -5
  233. package/dist/types/components/common/zonos-banner/zonos-banner.d.ts +0 -4
  234. package/dist/types/components/common/zonos-button/zonos-button.d.ts +1 -5
  235. package/dist/types/components/common/zonos-card/zonos-card.d.ts +0 -4
  236. package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +42 -0
  237. package/dist/types/components/common/zonos-country-flag/zonos-country-flag.d.ts +0 -4
  238. package/dist/types/components/common/zonos-country-select/zonos-country-select.d.ts +1 -1
  239. package/dist/types/components/common/zonos-icon/zonos-icon.d.ts +1 -1
  240. package/dist/types/components/common/zonos-language-select/zonos-language-select.d.ts +9 -0
  241. package/dist/types/components/common/zonos-logo/zonos-logo.d.ts +0 -4
  242. package/dist/types/components/common/zonos-notification/zonos-notification.d.ts +0 -4
  243. package/dist/types/components/common/zonos-select-dialog-header/zonos-select-dialog-header.d.ts +12 -0
  244. package/dist/types/components/common/zonos-spinner/zonos-spinner.d.ts +1 -1
  245. package/dist/types/components/common/zonos-text/zonos-text.d.ts +1 -5
  246. package/dist/types/components/common/zonos-tooltip/zonos-tooltip.d.ts +12 -0
  247. package/dist/types/components/common/zonos-v-stack/zonos-v-stack.d.ts +0 -4
  248. package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.d.ts +5 -0
  249. package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +2 -0
  250. package/dist/types/components/store/checkout/stripe.d.ts +12 -0
  251. package/dist/types/components/store/hello/localization.d.ts +2 -1
  252. package/dist/types/components/store/translationStore/strings.arabic.d.ts +18 -0
  253. package/dist/types/components/store/translationStore/strings.base.d.ts +18 -0
  254. package/dist/types/components/store/translationStore/strings.chinese.d.ts +18 -0
  255. package/dist/types/components/store/translationStore/strings.danish.d.ts +18 -0
  256. package/dist/types/components/store/translationStore/strings.dutch.d.ts +18 -0
  257. package/dist/types/components/store/translationStore/strings.french.d.ts +18 -0
  258. package/dist/types/components/store/translationStore/strings.german.d.ts +18 -0
  259. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +18 -0
  260. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +18 -0
  261. package/dist/types/components/store/translationStore/strings.italian.d.ts +18 -0
  262. package/dist/types/components/store/translationStore/strings.japanese.d.ts +18 -0
  263. package/dist/types/components/store/translationStore/strings.korean.d.ts +18 -0
  264. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +18 -0
  265. package/dist/types/components/store/translationStore/strings.polish.d.ts +18 -0
  266. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +18 -0
  267. package/dist/types/components/store/translationStore/strings.russian.d.ts +18 -0
  268. package/dist/types/components/store/translationStore/strings.spanish.d.ts +18 -0
  269. package/dist/types/components/store/translationStore/strings.swedish.d.ts +18 -0
  270. package/dist/types/components/store/translationStore/strings.turkish.d.ts +18 -0
  271. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +18 -0
  272. package/dist/types/components/store/zonosStore.d.ts +1 -1
  273. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +3 -0
  274. package/dist/types/components/utils/api/triggerBuildLandedCost.d.ts +18 -2
  275. package/dist/types/components/utils/changeDeepProperty.d.ts +1 -1
  276. package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +1 -1
  277. package/dist/types/components/utils/getBorderRadius.d.ts +1 -1
  278. package/dist/types/components/utils/hello/currencyConversion/getLanguageCode.d.ts +1 -1
  279. package/dist/types/components.d.ts +242 -116
  280. package/dist/types/types/ICountryJson.d.ts +2 -1
  281. package/dist/types/types/ILanguage.d.ts +81 -0
  282. package/dist/types/types/checkout/CheckoutConfig.d.ts +3 -3
  283. package/dist/types/types/checkout/api/CalculateLandedCostRequest.d.ts +13 -0
  284. package/dist/types/types/generated/graphql.customer.types.d.ts +31 -4
  285. package/dist/types/types/generated/graphql.customer.types.ts +45 -4
  286. package/dist/types/types/generated/graphql.frontend.types.d.ts +5 -5
  287. package/dist/types/types/generated/graphql.frontend.types.ts +13 -3
  288. package/dist/types/types/index.d.ts +1 -1
  289. package/dist/types/types/styles/Color.d.ts +2 -0
  290. package/dist/zonos-elements/index.esm.js +0 -1
  291. package/dist/zonos-elements/p-0057e374.entry.js +1 -0
  292. package/dist/zonos-elements/{p-120df5be.system.entry.js → p-06652d87.system.entry.js} +1 -1
  293. package/dist/zonos-elements/p-066c5893.system.js +1 -0
  294. package/dist/zonos-elements/p-0c72fb79.system.entry.js +1 -0
  295. package/dist/zonos-elements/p-16ad90ca.js +1 -0
  296. package/dist/zonos-elements/p-1f85a98c.system.entry.js +1 -0
  297. package/dist/zonos-elements/p-290c3670.entry.js +1 -0
  298. package/dist/zonos-elements/p-2d2e1831.entry.js +1 -0
  299. package/dist/zonos-elements/p-2f1e1cbb.system.entry.js +1 -0
  300. package/dist/zonos-elements/p-33080cde.system.entry.js +1 -0
  301. package/dist/zonos-elements/{p-0024f8c2.js → p-34c03be2.js} +1 -1
  302. package/dist/zonos-elements/p-34efed1d.entry.js +1 -0
  303. package/dist/zonos-elements/p-375c472a.system.entry.js +1 -0
  304. package/dist/zonos-elements/p-50ea2036.system.js +1 -0
  305. package/dist/zonos-elements/p-549c181b.system.js +1 -0
  306. package/dist/zonos-elements/{p-be23cc91.system.entry.js → p-55970b10.system.entry.js} +1 -1
  307. package/dist/zonos-elements/p-561e44d6.entry.js +1 -0
  308. package/dist/zonos-elements/p-56ba5cbf.system.js +1 -0
  309. package/dist/zonos-elements/{p-dc09ca69.system.js → p-591eb6dd.system.js} +1 -1
  310. package/dist/zonos-elements/p-5b44abc8.system.js +1 -0
  311. package/dist/zonos-elements/p-5c4dc123.js +1 -0
  312. package/dist/zonos-elements/p-656c836b.entry.js +1 -0
  313. package/dist/zonos-elements/p-67737613.system.entry.js +1 -0
  314. package/dist/zonos-elements/p-79b910bf.system.entry.js +1 -0
  315. package/dist/zonos-elements/p-7d1d862f.system.entry.js +1 -0
  316. package/dist/zonos-elements/{p-5a0264e8.system.entry.js → p-88a55076.system.entry.js} +1 -1
  317. package/dist/zonos-elements/p-8aeb4679.system.entry.js +1 -0
  318. package/dist/zonos-elements/p-8d645a00.entry.js +1 -0
  319. package/dist/zonos-elements/p-9878a770.js +1 -0
  320. package/dist/zonos-elements/p-a219689f.entry.js +1 -0
  321. package/dist/zonos-elements/p-a3d72a33.entry.js +1 -0
  322. package/dist/zonos-elements/{p-aca66e4b.entry.js → p-a4de3fb2.entry.js} +1 -1
  323. package/dist/zonos-elements/p-a93c594f.entry.js +1 -0
  324. package/dist/zonos-elements/p-a95c034c.entry.js +1 -0
  325. package/dist/zonos-elements/p-abe7524f.system.js +1 -0
  326. package/dist/zonos-elements/p-afe40057.entry.js +1 -0
  327. package/dist/zonos-elements/p-b10ff468.entry.js +1 -0
  328. package/dist/zonos-elements/p-b6992dc2.system.entry.js +1 -0
  329. package/dist/zonos-elements/{p-af910392.js → p-bce46c41.js} +1 -1
  330. package/dist/zonos-elements/p-c56d4a44.entry.js +1 -0
  331. package/dist/zonos-elements/p-c7098c3b.entry.js +1 -0
  332. package/dist/zonos-elements/{p-ead79548.system.js → p-cbb1e700.system.js} +1 -1
  333. package/dist/zonos-elements/p-cc63a29f.system.entry.js +1 -0
  334. package/dist/zonos-elements/p-cd8bd5e9.system.entry.js +1 -0
  335. package/dist/zonos-elements/p-d36faf87.system.entry.js +1 -0
  336. package/dist/zonos-elements/p-dfd3edcf.entry.js +1 -0
  337. package/dist/zonos-elements/p-e1255160.js +1 -0
  338. package/dist/zonos-elements/p-e161a08c.entry.js +1 -0
  339. package/dist/zonos-elements/p-e2770968.system.entry.js +1 -0
  340. package/dist/zonos-elements/p-e2c6ad57.entry.js +1 -0
  341. package/dist/zonos-elements/{p-73174d0c.system.entry.js → p-e855966f.system.entry.js} +1 -1
  342. package/dist/zonos-elements/p-ea93943a.system.entry.js +1 -0
  343. package/dist/zonos-elements/{p-7f68c103.system.js → p-ec4d08b3.system.js} +1 -1
  344. package/dist/zonos-elements/{p-e8da4463.js → p-f455e08c.js} +1 -1
  345. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  346. package/dist/zonos-elements/zonos-elements.js +1 -1
  347. package/package.json +17 -18
  348. package/dist/cjs/cart-c1b0915c.js +0 -655
  349. package/dist/cjs/zonos-address_2.cjs.entry.js +0 -161
  350. package/dist/cjs/zonos-badge.cjs.entry.js +0 -38
  351. package/dist/cjs/zonos-icon.cjs.entry.js +0 -35
  352. package/dist/collection/components/common/zonos-country-select/assets/arrowLeftBlue.svg +0 -1
  353. package/dist/components/cart.js +0 -637
  354. package/dist/components/zonos-logo2.js +0 -48
  355. package/dist/esm/cart-7e7c7585.js +0 -637
  356. package/dist/esm/getBorderRadius-9e4cb3b1.js +0 -16
  357. package/dist/esm/zonos-address_2.entry.js +0 -156
  358. package/dist/esm/zonos-badge.entry.js +0 -34
  359. package/dist/esm/zonos-icon.entry.js +0 -31
  360. package/dist/esm-es5/cart-7e7c7585.js +0 -1
  361. package/dist/esm-es5/getBorderRadius-9e4cb3b1.js +0 -1
  362. package/dist/esm-es5/localization-5d83fde2.js +0 -1
  363. package/dist/esm-es5/submitGtag-776c5e10.js +0 -1
  364. package/dist/esm-es5/zonos-address_2.entry.js +0 -1
  365. package/dist/esm-es5/zonos-badge.entry.js +0 -1
  366. package/dist/esm-es5/zonos-button_2.entry.js +0 -1
  367. package/dist/esm-es5/zonos-cart-items_10.entry.js +0 -1
  368. package/dist/esm-es5/zonos-country-flag_4.entry.js +0 -1
  369. package/dist/esm-es5/zonos-icon.entry.js +0 -1
  370. package/dist/zonos-elements/p-027abb50.entry.js +0 -1
  371. package/dist/zonos-elements/p-09c5dc1b.system.entry.js +0 -1
  372. package/dist/zonos-elements/p-1156ae5d.system.entry.js +0 -1
  373. package/dist/zonos-elements/p-12ecf765.system.js +0 -1
  374. package/dist/zonos-elements/p-174239da.system.js +0 -1
  375. package/dist/zonos-elements/p-18e09138.system.entry.js +0 -1
  376. package/dist/zonos-elements/p-1c00ffea.system.entry.js +0 -1
  377. package/dist/zonos-elements/p-21793192.entry.js +0 -1
  378. package/dist/zonos-elements/p-2589a038.system.entry.js +0 -1
  379. package/dist/zonos-elements/p-28d7b75d.entry.js +0 -1
  380. package/dist/zonos-elements/p-31fa76da.entry.js +0 -1
  381. package/dist/zonos-elements/p-3319e4db.entry.js +0 -1
  382. package/dist/zonos-elements/p-357f0c61.entry.js +0 -1
  383. package/dist/zonos-elements/p-410045c5.system.entry.js +0 -1
  384. package/dist/zonos-elements/p-4d0861e9.system.js +0 -1
  385. package/dist/zonos-elements/p-54ef8ff3.entry.js +0 -1
  386. package/dist/zonos-elements/p-626b5a52.system.entry.js +0 -1
  387. package/dist/zonos-elements/p-6444a4b9.entry.js +0 -1
  388. package/dist/zonos-elements/p-65f4af1a.system.entry.js +0 -1
  389. package/dist/zonos-elements/p-661bc488.entry.js +0 -1
  390. package/dist/zonos-elements/p-6c47083f.entry.js +0 -1
  391. package/dist/zonos-elements/p-6d454281.entry.js +0 -1
  392. package/dist/zonos-elements/p-7748735d.entry.js +0 -1
  393. package/dist/zonos-elements/p-78886ed6.system.entry.js +0 -1
  394. package/dist/zonos-elements/p-8ebc0b64.js +0 -1
  395. package/dist/zonos-elements/p-a6f2e282.system.js +0 -1
  396. package/dist/zonos-elements/p-b035f9e5.system.js +0 -1
  397. package/dist/zonos-elements/p-b1ffb37b.entry.js +0 -1
  398. package/dist/zonos-elements/p-b58d2231.entry.js +0 -1
  399. package/dist/zonos-elements/p-bd02a65c.entry.js +0 -1
  400. package/dist/zonos-elements/p-bea31a7b.system.entry.js +0 -1
  401. package/dist/zonos-elements/p-cfe4a318.js +0 -1
  402. package/dist/zonos-elements/p-e4a2a1b0.system.entry.js +0 -1
  403. package/dist/zonos-elements/p-eb631432.system.entry.js +0 -1
  404. package/dist/zonos-elements/p-f2733cc7.js +0 -1
  405. package/dist/zonos-elements/p-f342e7c7.entry.js +0 -1
  406. package/dist/zonos-elements/p-f82e000f.system.entry.js +0 -1
  407. /package/dist/cjs/{index-3ead02fe.js → index-72767498.js} +0 -0
  408. /package/dist/esm/{index-81a199ef.js → index-b5be4dc3.js} +0 -0
  409. /package/dist/esm-es5/{index-81a199ef.js → index-b5be4dc3.js} +0 -0
  410. /package/dist/zonos-elements/{p-4d8545e1.js → p-58127116.js} +0 -0
  411. /package/dist/zonos-elements/{p-4d39efb6.system.js → p-d1ab0823.system.js} +0 -0
@@ -1,22 +1,25 @@
1
1
  import { h, Host } from "@stencil/core";
2
2
  import { localizationStore } from "../../../store/hello/localization";
3
3
  import { isDarkColor } from "../../../utils/isDarkColor";
4
+ import { languages } from "../../../../types/ILanguage";
4
5
  // eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
5
- import ChevronDownIcon from "./assets/chevronDownIcon.svg";
6
+ import Globe from "./assets/globe.svg";
6
7
  // eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
7
8
  import ZonosIcon from "./assets/zonosIcon.svg";
8
9
  export class ZonosHelloDialogFooter {
9
10
  constructor() {
10
11
  this.appearanceSettings = undefined;
11
12
  this.setShowCountrySelect = () => { };
13
+ this.setShowLanguageSelect = () => { };
12
14
  }
13
15
  render() {
14
- var _a, _b;
16
+ var _a, _b, _c;
15
17
  const primaryColor = (_a = this.appearanceSettings) === null || _a === void 0 ? void 0 : _a.colorPrimary;
16
18
  const footerTheme = primaryColor && isDarkColor(primaryColor) ? 'DARK' : 'LIGHT';
17
- return (h(Host, { key: '724259a8adaa1cb5c760f36b14be99c55d6c29e2', class: "zonos--elements" }, h("div", { key: 'cb27d219f7a0f948a939b221143c3f0f252b0eeb', class: "zonos--hello-dialog-footer", "data-theme": footerTheme, style: {
18
- '--primary-color': (_b = this.appearanceSettings) === null || _b === void 0 ? void 0 : _b.colorPrimary,
19
- } }, h("a", { key: 'd04f060e7db6e2c964dc2c4252dbbc7b69fba7db', href: "https://zonos.com", target: "_blank" }, h("zonos-icon", { key: 'ed138c417f139f84a5466a4228925e2aa908cd12', autoHeight: true, color: "gray-1200", content: ZonosIcon, size: 108 })), h("zonos-button", { key: '07b300a1950adfaf154c173a49cec722df74172c', icon: h("zonos-icon", { color: "gray-700", content: ChevronDownIcon }), iconRight: true, onClick: () => this.setShowCountrySelect(true), variant: "outline" }, localizationStore.selectedCountryCode))));
19
+ const language = (_b = languages.find(x => x.code === localizationStore.selectedLocale)) === null || _b === void 0 ? void 0 : _b.translatedLabel;
20
+ return (h(Host, { key: 'a3a6ab0e4af4981cc83802be1433c3c41da58c19', class: "zonos--elements" }, h("div", { key: 'fdea45d1b4d83055a3d17918a5ae78f43a7e0042', class: "zonos--hello-dialog-footer", "data-theme": footerTheme, style: {
21
+ '--primary-color': (_c = this.appearanceSettings) === null || _c === void 0 ? void 0 : _c.colorPrimary,
22
+ } }, h("a", { key: '4d4e995052049238d4c522ff8501dddbe25e29d5', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: '4ca16c024473660f74cfc7a3d506b8ba4ebf7362', "aria-label": "Zonos Logo", autoHeight: true, content: ZonosIcon, iconColor: "gray-1200", size: 108 })), h("div", { key: 'dd1da686f8345431c3805898f374e5fb22e27289', class: "zonos--hello-locale-wrapper" }, h("zonos-button", { key: 'd5c34c75c5006710ff6d0426d43f07a5ade41827', buttonColor: "gray-1200", icon: h("zonos-icon", { "aria-label": "Open language select", content: Globe, iconColor: "gray-1200" }), onClick: () => this.setShowLanguageSelect(true), variant: "subtle" }, language), h("zonos-button", { key: '43759ce87473b10e078f14dce529db502a5edd4d', buttonColor: "gray-1200", icon: h("zonos-country-flag", { "aria-label": "Open country select", class: "zonos--footer-country-flag", countryCode: localizationStore.selectedCountryCode }), onClick: () => this.setShowCountrySelect(true), variant: "subtle" }, localizationStore.selectedCountryCode)))));
20
23
  }
21
24
  static get is() { return "zonos-hello-dialog-footer"; }
22
25
  static get encapsulation() { return "shadow"; }
@@ -75,6 +78,25 @@ export class ZonosHelloDialogFooter {
75
78
  "text": "Whether or not the country select dialog is open"
76
79
  },
77
80
  "defaultValue": "() => {}"
81
+ },
82
+ "setShowLanguageSelect": {
83
+ "type": "unknown",
84
+ "mutable": false,
85
+ "complexType": {
86
+ "original": "(value: boolean) => void",
87
+ "resolved": "(value: boolean) => void",
88
+ "references": {}
89
+ },
90
+ "required": false,
91
+ "optional": false,
92
+ "docs": {
93
+ "tags": [{
94
+ "name": "default",
95
+ "text": "false"
96
+ }],
97
+ "text": "Whether or not the language select dialog is open"
98
+ },
99
+ "defaultValue": "() => {}"
78
100
  }
79
101
  };
80
102
  }
@@ -144,12 +144,17 @@
144
144
  bottom: 0;
145
145
  width: 100vw;
146
146
  max-width: 100vw;
147
- max-height: unset;
147
+ max-height: 500px;
148
148
  height: fit-content;
149
149
  transform: scaleY(0);
150
150
  border-radius: 0;
151
151
  transform-origin: bottom;
152
152
  }
153
+ @media (max-height: 600px) {
154
+ :host .zonos--hello-dialog.zonos--hello-dialog-mobile-override {
155
+ max-height: 80vh;
156
+ }
157
+ }
153
158
  :host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left {
154
159
  transform-origin: bottom;
155
160
  }
@@ -166,15 +171,24 @@
166
171
  bottom: 0;
167
172
  width: 100vw;
168
173
  max-width: 100vw;
169
- max-height: unset;
174
+ max-height: 500px;
170
175
  height: fit-content;
171
176
  transform: scaleY(0);
172
177
  border-radius: 0;
173
178
  transform-origin: bottom;
174
179
  }
180
+ }
181
+ @media (max-width: 768px) and (max-height: 600px) {
182
+ :host .zonos--hello-dialog {
183
+ max-height: 80vh;
184
+ }
185
+ }
186
+ @media (max-width: 768px) {
175
187
  :host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left {
176
188
  transform-origin: bottom;
177
189
  }
190
+ }
191
+ @media (max-width: 768px) {
178
192
  :host .zonos--hello-dialog.zonos--hello-dialog-open {
179
193
  opacity: 1;
180
194
  transform: scaleY(1);
@@ -38,6 +38,9 @@ export class ZonosHelloDialog {
38
38
  this.setShowCountrySelect = async (value) => {
39
39
  this.showCountrySelect = value;
40
40
  };
41
+ this.setShowLanguageSelect = async (value) => {
42
+ this.showLanguageSelect = value;
43
+ };
41
44
  this.isOpen = false;
42
45
  this.setIsOpen = () => { };
43
46
  this.mobileLocationOverride = undefined;
@@ -46,6 +49,7 @@ export class ZonosHelloDialog {
46
49
  this.restrictedItems = [];
47
50
  this.welcomeMessage = 'Welcome to our Demo App!';
48
51
  this.showCountrySelect = false;
52
+ this.showLanguageSelect = false;
49
53
  }
50
54
  globalClickHandler(e) {
51
55
  this.clickOutsideDialogHandler(e);
@@ -53,6 +57,7 @@ export class ZonosHelloDialog {
53
57
  isOpenHandler(isOpen) {
54
58
  if (!isOpen) {
55
59
  void this.setShowCountrySelect(false);
60
+ void this.setShowLanguageSelect(false);
56
61
  }
57
62
  }
58
63
  render() {
@@ -90,17 +95,17 @@ export class ZonosHelloDialog {
90
95
  translate('Know about duties and taxes before you buy. Shop with confidence!');
91
96
  const currentPage = this.getCurrentPageEnum();
92
97
  const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
93
- return (h(Host, { key: '56fcc25e2fabf8c2f1edf727a64d213f18729c00', class: "zonos--elements" }, h("div", { key: 'c83e357cd266c605015e136eb23906bd4385e7f5', "aria-hidden": "true", class: classes([
98
+ return (h(Host, { key: '303f914b4511500edcd8d041ccfd52f0c48a7a85', class: "zonos--elements" }, h("div", { key: 'f52025ee53c0cdbbf20ecbb874e5639194b6507b', "aria-hidden": "true", class: classes([
94
99
  'zonos--hello-dialog',
95
100
  animateLeft && 'zonos--hello-dialog-animate-from-left',
96
101
  animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
97
102
  !!this.mobileLocationOverride &&
98
103
  'zonos--hello-dialog-mobile-override',
99
104
  this.isOpen && 'zonos--hello-dialog-open',
100
- ]), ref: el => el && (this.dialogRef = el) }, h("div", { key: '8d5811f45f2cfe8bd1c0ca3131d99ebc69b7b00d', class: "zonos--hello-dialog-content" }, h("zonos-button", { key: '137ea59ae312bee3817292dde42e2e718e70001b', class: "zonos--close-button", icon: h("zonos-icon", { content: RemoveIcon }), noBackground: true, onClick: () => this.setIsOpen(false) }), this.showCountrySelect ? (h("div", null, h("zonos-country-select", { closeCountrySelect: () => this.setShowCountrySelect(false) }))) : (h("div", null, h("zonos-v-stack", { spacing: 24 }, h("zonos-country-flag", { class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { type: "boldSubheader" }, welcomeMessage), h("zonos-text", { color: "gray-800" }, defaultMessage)), h("zonos-v-stack", { spacing: 8 }, this.restrictedItems.map(item => {
105
+ ]), ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", null, h("div", { class: "zonos--hello-dialog-content" }, h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close Zonos Hello dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.setIsOpen(false) }), h("zonos-v-stack", { spacing: 24 }, h("zonos-country-flag", { class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { type: "boldSubheader" }, welcomeMessage), h("zonos-text", { textColor: "gray-800" }, defaultMessage)), h("zonos-v-stack", { spacing: 8 }, this.restrictedItems.map(item => {
101
106
  var _a;
102
- return item && (h("zonos-banner", { bannerTitle: item.name, intent: "error" }, (_a = item.itemRestrictions) === null || _a === void 0 ? void 0 : _a.map(x => (h("zonos-text", { color: "red-800" }, x === null || x === void 0 ? void 0 : x.note)))));
103
- }), h("zonos-card", { spacing: "12px" }, h("zonos-v-stack", { spacing: 12 }, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { content: BagIcon }), h("zonos-text", null, dutyDeMinimisMessage)), h("div", { class: "zonos--flex-message" }, h("zonos-icon", { content: MoneyIcon }), h("zonos-text", null, taxDeMinimisMessage)))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))))), !this.showCountrySelect && (h("zonos-hello-dialog-footer", { appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value) })))));
107
+ return item && (h("zonos-banner", { bannerTitle: item.name, intent: "error" }, (_a = item.itemRestrictions) === null || _a === void 0 ? void 0 : _a.map(x => (h("zonos-text", { textColor: "red-800" }, x === null || x === void 0 ? void 0 : x.note)))));
108
+ }), h("zonos-card", { spacing: "12px" }, h("zonos-v-stack", { spacing: 12 }, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: BagIcon }), h("zonos-text", null, dutyDeMinimisMessage)), h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Tax de minimis", content: MoneyIcon }), h("zonos-text", null, taxDeMinimisMessage)))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (h("div", null, h("zonos-country-select", { handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (h("div", null, h("zonos-language-select", { handleOnClose: () => this.setShowLanguageSelect(false) }))))));
104
109
  }
105
110
  static get is() { return "zonos-hello-dialog"; }
106
111
  static get encapsulation() { return "shadow"; }
@@ -255,7 +260,8 @@ export class ZonosHelloDialog {
255
260
  static get states() {
256
261
  return {
257
262
  "welcomeMessage": {},
258
- "showCountrySelect": {}
263
+ "showCountrySelect": {},
264
+ "showLanguageSelect": {}
259
265
  };
260
266
  }
261
267
  static get events() {
@@ -153,7 +153,7 @@ export class ZonosController {
153
153
  zonosStore.organizationName = organizationName;
154
154
  }
155
155
  render() {
156
- return h(Host, { key: 'ff6eb2466864a217c485484d381e6f2531631e49', class: "zonos--elements" });
156
+ return h(Host, { key: '5650218b8eef4246ff1b131fcd1a06319800c2e3', class: "zonos--elements" });
157
157
  }
158
158
  static get is() { return "zonos-controller"; }
159
159
  static get encapsulation() { return "shadow"; }
@@ -20,13 +20,17 @@ const { onChange, reset, state: stripeStore, } = createStore(() => ({
20
20
  stripeAddressEventData: null,
21
21
  stripeAddressUsedWhenFetchingLC: null,
22
22
  stripeBillingAddressElement: null,
23
+ stripeBillingAddressEventData: null,
24
+ stripeBillingAddressUsedWhenFetchingLC: null,
23
25
  stripeElements: null,
26
+ stripeElementsForBillingAddress: null,
24
27
  stripeElementsOptions: null,
25
28
  stripeLinkElement: null,
26
29
  stripeLinkEventData: null,
27
30
  stripeLinkUsedWhenFetchingLC: null,
28
31
  stripePaymentElement: null,
29
32
  stripePaymentEventData: null,
33
+ stripeShippingSameAsBilling: true,
30
34
  }));
31
35
  const getStripeOptions = ({ clientSecret, overrideBorderRaidus, overridePrimaryColor, overrideSecondaryColor, overrideTheme, }) => {
32
36
  const primaryColor = overridePrimaryColor || zonosStore.appearance.colorPrimary;
@@ -53,7 +57,7 @@ const getStripeOptions = ({ clientSecret, overrideBorderRaidus, overridePrimaryC
53
57
  };
54
58
  };
55
59
  const initStripeElements = async (props) => {
56
- var _a;
60
+ var _a, _b;
57
61
  const clientSecret = stripeStore.clientSecret;
58
62
  if (!stripeStore.stripe) {
59
63
  log('Skip. Stripe is not initialized');
@@ -70,17 +74,24 @@ const initStripeElements = async (props) => {
70
74
  // compare with the previous options to see if we need to update
71
75
  const isSameOptions = JSON.stringify(stripeOptions) ===
72
76
  JSON.stringify(stripeStore.stripeElementsOptions);
73
- if (!stripeStore.stripeElements) {
77
+ if (!stripeStore.stripeElements ||
78
+ !stripeStore.stripeElementsForBillingAddress) {
74
79
  // init stripe elements if it doesn't exist
75
80
  stripeStore.stripeElements = (_a = stripeStore.stripe) === null || _a === void 0 ? void 0 : _a.elements(stripeOptions);
76
81
  // save stripe elements options for later comparison
77
82
  stripeStore.stripeElementsOptions = stripeOptions;
78
83
  log('Stripe elements initialized');
84
+ // init stripe elements for billing address
85
+ stripeStore.stripeElementsForBillingAddress =
86
+ (_b = stripeStore.stripe) === null || _b === void 0 ? void 0 : _b.elements(stripeOptions);
87
+ log('Stripe elements for billing address initialized');
79
88
  return;
80
89
  }
81
90
  if (!isSameOptions) {
82
91
  // update elements with new option if it already exists
83
92
  stripeStore.stripeElements.update(stripeOptions);
93
+ // update elements for stripe billing address
94
+ stripeStore.stripeElementsForBillingAddress.update(stripeOptions);
84
95
  // save stripe elements options for later comparison
85
96
  stripeStore.stripeElementsOptions = stripeOptions;
86
97
  }
@@ -100,7 +111,7 @@ const stripeStoreReset = () => {
100
111
  * Purpose is to resend the request if the info used when fetching landed cost is different from the current info
101
112
  */
102
113
  const isPrefetchInfoOutdated = () => {
103
- var _a, _b, _c, _d;
114
+ var _a, _b, _c, _d, _e, _f;
104
115
  const hasAbortController = stripeStore.fetchingLandedCostAbordController;
105
116
  if (!hasAbortController) {
106
117
  // if there is no abort controller, this is a new request
@@ -110,26 +121,36 @@ const isPrefetchInfoOutdated = () => {
110
121
  JSON.stringify((_b = stripeStore.stripeLinkEventData) === null || _b === void 0 ? void 0 : _b.value);
111
122
  const isAddressDataDirty = JSON.stringify((_c = stripeStore.stripeAddressUsedWhenFetchingLC) === null || _c === void 0 ? void 0 : _c.value) !==
112
123
  JSON.stringify((_d = stripeStore.stripeAddressEventData) === null || _d === void 0 ? void 0 : _d.value);
113
- return isLinkDataDirty || isAddressDataDirty;
124
+ const isBillingAddressDataDirty = !stripeStore.stripeShippingSameAsBilling &&
125
+ JSON.stringify((_e = stripeStore.stripeBillingAddressEventData) === null || _e === void 0 ? void 0 : _e.value) !==
126
+ JSON.stringify((_f = stripeStore.stripeBillingAddressUsedWhenFetchingLC) === null || _f === void 0 ? void 0 : _f.value);
127
+ return isLinkDataDirty || isAddressDataDirty || isBillingAddressDataDirty;
114
128
  };
115
129
  const stripeStorePrefetchLandedCost = async () => {
116
- var _a, _b, _c, _d;
130
+ var _a, _b, _c, _d, _e, _f;
117
131
  const stripeAddressReady = !!((_a = stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.complete);
118
132
  const stripeLinkReady = !!((_b = stripeStore.stripeLinkEventData) === null || _b === void 0 ? void 0 : _b.complete);
133
+ const stripeBillingAddressReady = stripeStore.stripeShippingSameAsBilling
134
+ ? !!((_c = stripeStore.stripeLinkEventData) === null || _c === void 0 ? void 0 : _c.complete)
135
+ : !!((_d = stripeStore.stripeBillingAddressEventData) === null || _d === void 0 ? void 0 : _d.complete);
119
136
  const shouldRefetch = isPrefetchInfoOutdated();
120
137
  if (shouldRefetch) {
121
138
  // if the info used when fetching landed cost is different from the current info, abort the previous request
122
- (_c = stripeStore.fetchingLandedCostAbordController) === null || _c === void 0 ? void 0 : _c.abort();
139
+ (_e = stripeStore.fetchingLandedCostAbordController) === null || _e === void 0 ? void 0 : _e.abort();
123
140
  stripeStore.fetchingLandedCostAbordController = null;
124
141
  }
125
142
  // only fetch if we are not fetching or we need to refetch
126
143
  if (stripeAddressReady &&
127
144
  stripeLinkReady &&
145
+ stripeBillingAddressReady &&
128
146
  (shouldRefetch || !stripeStore.isFetchingLandedCost)) {
129
147
  stripeStore.isFetchingLandedCost = true;
130
148
  if (stripeStore.stripeAddressEventData) {
131
149
  stripeStore.stripeAddressUsedWhenFetchingLC = Object.assign({}, stripeStore.stripeAddressEventData);
132
150
  }
151
+ if (stripeStore.stripeBillingAddressEventData) {
152
+ stripeStore.stripeBillingAddressUsedWhenFetchingLC = Object.assign({}, stripeStore.stripeBillingAddressEventData);
153
+ }
133
154
  if (stripeStore.stripeLinkEventData) {
134
155
  stripeStore.stripeLinkUsedWhenFetchingLC = Object.assign({}, stripeStore.stripeLinkEventData);
135
156
  }
@@ -145,7 +166,7 @@ const stripeStorePrefetchLandedCost = async () => {
145
166
  cartStore.shippingData =
146
167
  (shipmentRatingCalculateWorkflow === null || shipmentRatingCalculateWorkflow === void 0 ? void 0 : shipmentRatingCalculateWorkflow.filter(Boolean)) || null;
147
168
  // apply new subtotal and total, this is mainly to show items in the presentment currency
148
- const firstLandedCostData = (_d = cartStore.landedCostData) === null || _d === void 0 ? void 0 : _d.find(Boolean);
169
+ const firstLandedCostData = (_f = cartStore.landedCostData) === null || _f === void 0 ? void 0 : _f.find(Boolean);
149
170
  const subtotals = !!firstLandedCostData
150
171
  ? firstLandedCostData.subtotals
151
172
  : null;
@@ -274,6 +295,9 @@ const stripeStoreInitCheckoutSession = async () => {
274
295
  body: {
275
296
  currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
276
297
  itemsAmount: total,
298
+ metadata: [
299
+ { key: 'language', value: localizationStore.selectedLocale },
300
+ ],
277
301
  presentmentCountryCode: localizationStore.selectedCountryCode || null,
278
302
  },
279
303
  method: 'POST',
@@ -1,4 +1,5 @@
1
1
  import { createStore } from "@stencil/store";
2
+ import { cartStore } from "../checkout/cart";
2
3
  import { translationStoreUpdateLanguage } from "../translationStore";
3
4
  import { zonosStore } from "../zonosStore";
4
5
  import { getCountries } from "../../utils/api/getCountries";
@@ -7,10 +8,12 @@ import { getExchangeRate, } from "../../utils/api/getExchangeRate";
7
8
  import { getLocaleMessages } from "../../utils/api/getLocaleMessages";
8
9
  import { getLocalization } from "../../utils/api/getLocalization";
9
10
  import { getShippingZones } from "../../utils/api/getShippingZones";
11
+ import { handleFetch } from "../../utils/handleFetch";
10
12
  import { currencyDisplay } from "../../utils/hello/currencyConversion/currencyDisplay";
11
13
  import { getCurrencyCode } from "../../utils/hello/currencyConversion/getCurrencyCode";
12
14
  import { setZCountryUrlParam } from "../../utils/hello/setZCountryUrlParam";
13
15
  import { log } from "../../utils/logging/log";
16
+ import { logError } from "../../utils/logging/logError";
14
17
  const { state: localizationStore } = createStore({
15
18
  countryLandedCost: null,
16
19
  customMessages: [],
@@ -119,7 +122,7 @@ const initLocalizationStore = async () => {
119
122
  // Filter countries to only include countries in the shipping zone
120
123
  const filteredCountries = shippingZoneCountries === null || shippingZoneCountries === void 0 ? void 0 : shippingZoneCountries.reduce((acc, countryCode) => {
121
124
  const countryInfo = allCountries === null || allCountries === void 0 ? void 0 : allCountries[countryCode];
122
- return countryInfo
125
+ return countryInfo && countryInfo.active
123
126
  ? Object.assign(Object.assign({}, acc), { [countryCode]: countryInfo }) : acc;
124
127
  }, {});
125
128
  localizationStore.shippingZoneCountries = filteredCountries || null;
@@ -140,4 +143,31 @@ const initLocalizationStore = async () => {
140
143
  localizationStore.localizationLoaded = true;
141
144
  void getCustomMessages();
142
145
  };
143
- export { initLocalizationStore, localizationStore, localizationStoreUpdateSelectedCountryCode, };
146
+ const updateCheckoutSessionLanguage = async () => {
147
+ if (!cartStore.checkoutSessionId) {
148
+ return null;
149
+ }
150
+ const { errors, json } = await handleFetch(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/update-checkout-session-metadata`, {
151
+ body: {
152
+ id: cartStore.checkoutSessionId,
153
+ metadata: [
154
+ {
155
+ key: 'language',
156
+ value: localizationStore.selectedLocale,
157
+ },
158
+ ],
159
+ },
160
+ method: 'POST',
161
+ });
162
+ if (errors.length || !json) {
163
+ logError('Error occurs when updating checkout session', JSON.stringify(errors, null, 2));
164
+ return { errors, json };
165
+ }
166
+ return { errors: [], json };
167
+ };
168
+ const localizationStoreUpdateSelectedLocale = (newSelectedLocale) => {
169
+ localizationStore.selectedLocale = newSelectedLocale;
170
+ translationStoreUpdateLanguage(newSelectedLocale);
171
+ void updateCheckoutSessionLanguage();
172
+ };
173
+ export { initLocalizationStore, localizationStore, localizationStoreUpdateSelectedCountryCode, localizationStoreUpdateSelectedLocale, };
@@ -8,6 +8,9 @@ export const stringsArabic = {
8
8
  Back: {
9
9
  value: 'رجوع',
10
10
  },
11
+ 'Billing address': {
12
+ value: 'عنوان الفوترة',
13
+ },
11
14
  'Cart subtotal': {
12
15
  value: 'المجموع الفرعي للسلة',
13
16
  },
@@ -56,6 +59,9 @@ export const stringsArabic = {
56
59
  'No shipping methods found - try editing your address or contacting support if the error persists': {
57
60
  value: 'لم يتم العثور على طرق شحن - جرب تحرير عنوانك أو الاتصال بالدعم إذا استمر الخطأ',
58
61
  },
62
+ 'Nothing due at the door': {
63
+ value: 'لا شيء مستحق عند الباب',
64
+ },
59
65
  'Order is over the de minimis threshold for both duty and tax': {
60
66
  value: 'الطلبية أعلى من الحد الأدنى لكل من الرسوم والضرائب',
61
67
  },
@@ -89,12 +95,24 @@ export const stringsArabic = {
89
95
  'Restricted items found': {
90
96
  value: 'تم العثور على عناصر مقيدة',
91
97
  },
98
+ 'Search countries': {
99
+ value: 'ابحث عن الدول',
100
+ },
92
101
  'See duty and tax thresholds': {
93
102
  value: 'انظر عتبات الرسوم والضرائب',
94
103
  },
104
+ 'Select a country': {
105
+ value: 'اختر دولة',
106
+ },
107
+ 'Select a language': {
108
+ value: 'اختر لغة',
109
+ },
95
110
  Shipping: {
96
111
  value: 'الشحن',
97
112
  },
113
+ 'Shipping address same as billing': {
114
+ value: 'عنوان الشحن مطابق لعنوان الفوترة',
115
+ },
98
116
  'Shipping information': {
99
117
  value: 'معلومات الشحن',
100
118
  },
@@ -8,6 +8,9 @@ export const stringsBase = {
8
8
  Back: {
9
9
  value: 'Back',
10
10
  },
11
+ 'Billing address': {
12
+ value: 'Billing address',
13
+ },
11
14
  'Cart subtotal': {
12
15
  value: 'Cart subtotal',
13
16
  },
@@ -56,6 +59,9 @@ export const stringsBase = {
56
59
  'No shipping methods found - try editing your address or contacting support if the error persists': {
57
60
  value: 'No shipping methods found - try editing your address or contacting support if the error persists',
58
61
  },
62
+ 'Nothing due at the door': {
63
+ value: 'Nothing due at the door',
64
+ },
59
65
  'Order is over the de minimis threshold for both duty and tax': {
60
66
  value: 'Order is over the de minimis threshold for both duty and tax',
61
67
  },
@@ -89,12 +95,24 @@ export const stringsBase = {
89
95
  'Restricted items found': {
90
96
  value: 'Restricted items found',
91
97
  },
98
+ 'Search countries': {
99
+ value: 'Search countries',
100
+ },
92
101
  'See duty and tax thresholds': {
93
102
  value: 'See duty and tax thresholds',
94
103
  },
104
+ 'Select a country': {
105
+ value: 'Select a country',
106
+ },
107
+ 'Select a language': {
108
+ value: 'Select a language',
109
+ },
95
110
  Shipping: {
96
111
  value: 'Shipping',
97
112
  },
113
+ 'Shipping address same as billing': {
114
+ value: 'Shipping address same as billing',
115
+ },
98
116
  'Shipping information': {
99
117
  value: 'Shipping information',
100
118
  },
@@ -8,6 +8,9 @@ export const stringsChinese = {
8
8
  Back: {
9
9
  value: '返回',
10
10
  },
11
+ 'Billing address': {
12
+ value: '账单地址',
13
+ },
11
14
  'Cart subtotal': {
12
15
  value: '购物车小计',
13
16
  },
@@ -56,6 +59,9 @@ export const stringsChinese = {
56
59
  'No shipping methods found - try editing your address or contacting support if the error persists': {
57
60
  value: '未找到运输方法 - 如果错误仍然存在,请尝试编辑您的地址或联系支持',
58
61
  },
62
+ 'Nothing due at the door': {
63
+ value: '门口无需付款',
64
+ },
59
65
  'Order is over the de minimis threshold for both duty and tax': {
60
66
  value: '订单超过关税和税款的最低征税门槛',
61
67
  },
@@ -89,12 +95,24 @@ export const stringsChinese = {
89
95
  'Restricted items found': {
90
96
  value: '发现受限制的商品',
91
97
  },
98
+ 'Search countries': {
99
+ value: '搜索国家',
100
+ },
92
101
  'See duty and tax thresholds': {
93
102
  value: '查看关税和税款门槛',
94
103
  },
104
+ 'Select a country': {
105
+ value: '选择一个国家',
106
+ },
107
+ 'Select a language': {
108
+ value: '选择一种语言',
109
+ },
95
110
  Shipping: {
96
111
  value: '运输',
97
112
  },
113
+ 'Shipping address same as billing': {
114
+ value: '送货地址与账单地址相同',
115
+ },
98
116
  'Shipping information': {
99
117
  value: '运输信息',
100
118
  },
@@ -8,6 +8,9 @@ export const stringsDanish = {
8
8
  Back: {
9
9
  value: 'Tilbage',
10
10
  },
11
+ 'Billing address': {
12
+ value: 'Fakturaadresse',
13
+ },
11
14
  'Cart subtotal': {
12
15
  value: 'Subtotal på kurv',
13
16
  },
@@ -56,6 +59,9 @@ export const stringsDanish = {
56
59
  'No shipping methods found - try editing your address or contacting support if the error persists': {
57
60
  value: 'Ingen forsendelsesmetoder fundet - prøv at redigere din adresse eller kontakte support, hvis fejlen fortsætter',
58
61
  },
62
+ 'Nothing due at the door': {
63
+ value: 'Intet at betale ved døren',
64
+ },
59
65
  'Order is over the de minimis threshold for both duty and tax': {
60
66
  value: 'Ordre er over de minimis-grænsen for både told og skat',
61
67
  },
@@ -89,12 +95,24 @@ export const stringsDanish = {
89
95
  'Restricted items found': {
90
96
  value: 'Begrænsede varer fundet',
91
97
  },
98
+ 'Search countries': {
99
+ value: 'Søg lande',
100
+ },
92
101
  'See duty and tax thresholds': {
93
102
  value: 'Se grænser for told og skatter',
94
103
  },
104
+ 'Select a country': {
105
+ value: 'Vælg et land',
106
+ },
107
+ 'Select a language': {
108
+ value: 'Vælg et sprog',
109
+ },
95
110
  Shipping: {
96
111
  value: 'Levering',
97
112
  },
113
+ 'Shipping address same as billing': {
114
+ value: 'Leveringsadresse samme som fakturaadresse',
115
+ },
98
116
  'Shipping information': {
99
117
  value: 'Leveringsinformation',
100
118
  },
@@ -8,6 +8,9 @@ export const stringsDutch = {
8
8
  Back: {
9
9
  value: 'Terug',
10
10
  },
11
+ 'Billing address': {
12
+ value: 'Factuuradres',
13
+ },
11
14
  'Cart subtotal': {
12
15
  value: 'Winkelwagen subtotaal',
13
16
  },
@@ -56,6 +59,9 @@ export const stringsDutch = {
56
59
  'No shipping methods found - try editing your address or contacting support if the error persists': {
57
60
  value: 'Geen verzendmethoden gevonden - probeer uw adres te bewerken of neem contact op met de ondersteuning als de fout aanhoudt',
58
61
  },
62
+ 'Nothing due at the door': {
63
+ value: 'Niets te betalen aan de deur',
64
+ },
59
65
  'Order is over the de minimis threshold for both duty and tax': {
60
66
  value: 'Bestelling overschrijdt de minimale drempel voor zowel heffing als belasting',
61
67
  },
@@ -89,12 +95,24 @@ export const stringsDutch = {
89
95
  'Restricted items found': {
90
96
  value: 'Beperkte items gevonden',
91
97
  },
98
+ 'Search countries': {
99
+ value: 'Zoek landen',
100
+ },
92
101
  'See duty and tax thresholds': {
93
102
  value: 'Bekijk heffings- en belastingdrempels',
94
103
  },
104
+ 'Select a country': {
105
+ value: 'Selecteer een land',
106
+ },
107
+ 'Select a language': {
108
+ value: 'Selecteer een taal',
109
+ },
95
110
  Shipping: {
96
111
  value: 'Verzending',
97
112
  },
113
+ 'Shipping address same as billing': {
114
+ value: 'Verzendadres gelijk aan factuuradres',
115
+ },
98
116
  'Shipping information': {
99
117
  value: 'Verzendinformatie',
100
118
  },
@@ -8,6 +8,9 @@ export const stringsFrench = {
8
8
  Back: {
9
9
  value: 'Retour',
10
10
  },
11
+ 'Billing address': {
12
+ value: 'Adresse de facturation',
13
+ },
11
14
  'Cart subtotal': {
12
15
  value: 'Sous-total du panier',
13
16
  },
@@ -56,6 +59,9 @@ export const stringsFrench = {
56
59
  'No shipping methods found - try editing your address or contacting support if the error persists': {
57
60
  value: "Aucune méthode d'expédition trouvée - essayez de modifier votre adresse ou de contacter le support si l'erreur persiste",
58
61
  },
62
+ 'Nothing due at the door': {
63
+ value: 'Rien à payer à la porte',
64
+ },
59
65
  'Order is over the de minimis threshold for both duty and tax': {
60
66
  value: 'La commande dépasse le seuil de minimis pour les droits et les taxes',
61
67
  },
@@ -89,12 +95,24 @@ export const stringsFrench = {
89
95
  'Restricted items found': {
90
96
  value: 'Articles restreints trouvés',
91
97
  },
98
+ 'Search countries': {
99
+ value: 'Rechercher des pays',
100
+ },
92
101
  'See duty and tax thresholds': {
93
102
  value: 'Voir les seuils pour les droits et taxes',
94
103
  },
104
+ 'Select a country': {
105
+ value: 'Sélectionner un pays',
106
+ },
107
+ 'Select a language': {
108
+ value: 'Sélectionner une langue',
109
+ },
95
110
  Shipping: {
96
111
  value: 'Livraison',
97
112
  },
113
+ 'Shipping address same as billing': {
114
+ value: "Adresse de livraison identique à l'adresse de facturation",
115
+ },
98
116
  'Shipping information': {
99
117
  value: 'Informations de livraison',
100
118
  },