@zonos/elements 1.3.15-alpha.3 → 1.3.16-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 (452) hide show
  1. package/dist/cjs/RemoveIcon-081ac073.js +5 -0
  2. package/dist/cjs/{cart-1b1d39af.js → cart-db549f04.js} +976 -138
  3. package/dist/cjs/containsNonLatinChars-2be5129b.js +24 -0
  4. package/dist/cjs/{getBorderRadius-c8cc2bb3.js → getBorderRadius-44b3eca1.js} +4 -6
  5. package/dist/cjs/index-654a6001.js +1361 -0
  6. package/dist/cjs/isCheckoutMobile-f491ca7c.js +8 -0
  7. package/dist/cjs/{isColorVariable-fff5e469.js → isColorVariable-6f5a9608.js} +2 -2
  8. package/dist/cjs/{isDarkColor-f5473002.js → isDarkColor-01f45d3f.js} +1 -1
  9. package/dist/cjs/loader.cjs.js +2 -2
  10. package/dist/cjs/{submitGtag-ab287a34.js → submitGtag-fd8acad5.js} +21 -2
  11. package/dist/cjs/zonos-address_8.cjs.entry.js +642 -0
  12. package/dist/cjs/zonos-badge_2.cjs.entry.js +9 -9
  13. package/dist/cjs/zonos-banner.cjs.entry.js +5 -5
  14. package/dist/cjs/zonos-button_3.cjs.entry.js +192 -0
  15. package/dist/cjs/zonos-card_2.cjs.entry.js +12 -12
  16. package/dist/cjs/{zonos-cart-items_10.cjs.entry.js → zonos-cart-items_9.cjs.entry.js} +150 -124
  17. package/dist/cjs/zonos-checkout.cjs.entry.js +20 -19
  18. package/dist/cjs/zonos-component.cjs.entry.js +2 -2
  19. package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
  20. package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
  21. package/dist/cjs/zonos-country-select_3.cjs.entry.js +16 -16
  22. package/dist/cjs/zonos-elements.cjs.js +10 -10
  23. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +9 -9
  24. package/dist/cjs/zonos-hello.cjs.entry.js +6 -6
  25. package/dist/cjs/zonos-input.cjs.entry.js +57 -0
  26. package/dist/cjs/zonos-link.cjs.entry.js +3 -3
  27. package/dist/cjs/zonos-logo.cjs.entry.js +4 -4
  28. package/dist/cjs/zonos-notification.cjs.entry.js +5 -5
  29. package/dist/cjs/zonos-payment.cjs.entry.js +6 -6
  30. package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +7 -7
  31. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +10 -8
  32. package/dist/cjs/zonos-text.cjs.entry.js +6 -5
  33. package/dist/cjs/{zonosStore-aee974e0.js → zonosStore-d8bb0bda.js} +1 -1
  34. package/dist/collection/__mocks__/vercel-app/zonos-hello.entry.js +1 -1
  35. package/dist/collection/__mocks__/zonos-url/zonos-hello.entry.js +1 -1
  36. package/dist/collection/collection-manifest.json +5 -1
  37. package/dist/collection/components/checkout/zonos-checkout/assets/LeftArrow.svg +1 -1
  38. package/dist/collection/components/checkout/zonos-checkout/assets/RemoveIcon.svg +1 -1
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.css +62 -0
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.js +80 -0
  41. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.css +59 -0
  42. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +148 -0
  43. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.css +115 -0
  44. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +429 -0
  45. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.css +2 -2
  46. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +1 -1
  47. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.css +2 -2
  48. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/assets/RemoveIcon.svg +1 -1
  49. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/assets/SuccessIcon.svg +1 -1
  50. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.css +1 -1
  51. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +5 -3
  52. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/chevronDownIcon.svg +1 -1
  53. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/globe.svg +1 -1
  54. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/zonosIcon.svg +1 -1
  55. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.css +8 -8
  56. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
  57. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +3 -3
  58. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +10 -10
  59. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +7 -5
  60. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +3 -3
  61. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +135 -20
  62. package/dist/collection/components/checkout/zonos-checkout/zonos-review/assets/ChevronDownIcon.svg +1 -1
  63. package/dist/collection/components/checkout/zonos-checkout/zonos-review/assets/ChevronUpIcon.svg +1 -1
  64. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.css +1 -1
  65. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +3 -3
  66. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +1 -1
  67. package/dist/collection/components/common/component-template/zonos-link/zonos-link.css +4 -4
  68. package/dist/collection/components/common/component-template/zonos-link/zonos-link.js +1 -1
  69. package/dist/collection/components/common/zonos-badge/zonos-badge.css +30 -30
  70. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  71. package/dist/collection/components/common/zonos-banner/zonos-banner.css +10 -10
  72. package/dist/collection/components/common/zonos-banner/zonos-banner.js +2 -2
  73. package/dist/collection/components/common/zonos-button/zonos-button.css +63 -62
  74. package/dist/collection/components/common/zonos-button/zonos-button.js +17 -8
  75. package/dist/collection/components/common/zonos-card/zonos-card.css +7 -7
  76. package/dist/collection/components/common/zonos-card/zonos-card.js +3 -3
  77. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.css +4 -3
  78. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +26 -8
  79. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +4 -4
  80. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  81. package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +8 -8
  82. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +2 -2
  83. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.css +2 -2
  84. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  85. package/dist/collection/components/common/zonos-dialog/zonos-dialog.css +14 -14
  86. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +6 -4
  87. package/dist/collection/components/common/zonos-icon/zonos-icon.js +1 -1
  88. package/dist/collection/components/common/zonos-input/zonos-input.css +176 -0
  89. package/dist/collection/components/common/zonos-input/zonos-input.js +193 -0
  90. package/dist/collection/components/common/zonos-language-select/zonos-language-select.css +2 -2
  91. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  92. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  93. package/dist/collection/components/common/zonos-notification/zonos-notification.css +4 -4
  94. package/dist/collection/components/common/zonos-notification/zonos-notification.js +2 -2
  95. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.css +1 -1
  96. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  97. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.css +7 -7
  98. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +5 -3
  99. package/dist/collection/components/common/zonos-spinner/zonos-spinner.css +14 -14
  100. package/dist/collection/components/common/zonos-text/zonos-text.css +7 -7
  101. package/dist/collection/components/common/zonos-text/zonos-text.js +2 -1
  102. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.css +3 -3
  103. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  104. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  105. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  106. package/dist/collection/components/hello/zonos-hello/zonos-hello.css +30 -30
  107. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/chevronDownIcon.svg +1 -1
  108. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/globe.svg +1 -1
  109. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/zonosIcon.svg +1 -1
  110. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.css +385 -378
  111. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  112. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.css +11 -11
  113. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +3 -3
  114. package/dist/collection/components/main/zonos-controller.js +2 -2
  115. package/dist/collection/components/store/checkout/stripe.js +153 -14
  116. package/dist/collection/components/store/translationStore/strings.arabic.js +36 -6
  117. package/dist/collection/components/store/translationStore/strings.base.js +36 -6
  118. package/dist/collection/components/store/translationStore/strings.chinese.js +36 -6
  119. package/dist/collection/components/store/translationStore/strings.danish.js +36 -6
  120. package/dist/collection/components/store/translationStore/strings.dutch.js +36 -6
  121. package/dist/collection/components/store/translationStore/strings.french.js +36 -6
  122. package/dist/collection/components/store/translationStore/strings.german.js +36 -6
  123. package/dist/collection/components/store/translationStore/strings.hebrew.js +36 -6
  124. package/dist/collection/components/store/translationStore/strings.indonesian.js +36 -6
  125. package/dist/collection/components/store/translationStore/strings.italian.js +36 -6
  126. package/dist/collection/components/store/translationStore/strings.japanese.js +36 -6
  127. package/dist/collection/components/store/translationStore/strings.korean.js +36 -6
  128. package/dist/collection/components/store/translationStore/strings.norwegian.js +36 -6
  129. package/dist/collection/components/store/translationStore/strings.polish.js +36 -6
  130. package/dist/collection/components/store/translationStore/strings.portuguese.js +36 -6
  131. package/dist/collection/components/store/translationStore/strings.russian.js +36 -6
  132. package/dist/collection/components/store/translationStore/strings.spanish.js +36 -6
  133. package/dist/collection/components/store/translationStore/strings.swedish.js +36 -6
  134. package/dist/collection/components/store/translationStore/strings.turkish.js +36 -6
  135. package/dist/collection/components/store/translationStore/strings.vietnamese.js +36 -6
  136. package/dist/collection/components/stripe/zonos-address/zonos-address.js +3 -71
  137. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +29 -5
  138. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  139. package/dist/collection/components/utils/checkout/buildTranslateRequestBody.js +98 -0
  140. package/dist/collection/components/utils/containsNonLatinChars.js +10 -8
  141. package/dist/collection/components/utils/getBorderRadius.js +3 -5
  142. package/dist/collection/components/utils/getButtonTheme.js +1 -1
  143. package/dist/collection/components/utils/isColorVariable.js +2 -2
  144. package/dist/collection/styles/stripe/defaultVariable.js +2 -2
  145. package/dist/collection/types/checkout/TranslatedText.js +1 -0
  146. package/dist/collection/types/checkout/api/ValidateAddressRequest.js +1 -0
  147. package/dist/components/containsNonLatinChars.js +21 -0
  148. package/dist/components/getBorderRadius.js +3 -5
  149. package/dist/components/isColorVariable.js +2 -2
  150. package/dist/components/stripe.js +255 -4545
  151. package/dist/components/trackConversionEvent.js +1 -1
  152. package/dist/components/translationStore.js +5131 -0
  153. package/dist/components/zonos-address-display.d.ts +11 -0
  154. package/dist/components/zonos-address-display.js +6 -0
  155. package/dist/components/zonos-address-display2.js +64 -0
  156. package/dist/components/zonos-address-form.d.ts +11 -0
  157. package/dist/components/zonos-address-form.js +6 -0
  158. package/dist/components/zonos-address-form2.js +84 -0
  159. package/dist/components/zonos-address-update-dialog.d.ts +11 -0
  160. package/dist/components/zonos-address-update-dialog.js +6 -0
  161. package/dist/components/zonos-address-update-dialog2.js +264 -0
  162. package/dist/components/zonos-address2.js +3 -93
  163. package/dist/components/zonos-badge2.js +4 -4
  164. package/dist/components/zonos-banner2.js +3 -3
  165. package/dist/components/zonos-button2.js +19 -10
  166. package/dist/components/zonos-card2.js +4 -4
  167. package/dist/components/zonos-cart-items2.js +2 -2
  168. package/dist/components/zonos-cart-subtotal2.js +3 -2
  169. package/dist/components/zonos-checkbox2.js +19 -10
  170. package/dist/components/zonos-checkout-finish2.js +29 -9
  171. package/dist/components/zonos-checkout-footer2.js +5 -5
  172. package/dist/components/zonos-checkout-payment2.js +3 -2
  173. package/dist/components/zonos-checkout-progress-tabs2.js +6 -5
  174. package/dist/components/zonos-checkout.js +73 -43
  175. package/dist/components/zonos-collapse2.js +2 -2
  176. package/dist/components/zonos-component.js +1 -1
  177. package/dist/components/zonos-controller.js +2 -2
  178. package/dist/components/zonos-country-select2.js +3 -3
  179. package/dist/components/zonos-custom-message2.js +3 -3
  180. package/dist/components/zonos-customer-info2.js +171 -30
  181. package/dist/components/zonos-dialog2.js +7 -5
  182. package/dist/components/zonos-hello-dialog-footer2.js +5 -5
  183. package/dist/components/zonos-hello-dialog2.js +6 -5
  184. package/dist/components/zonos-hello.js +3 -2
  185. package/dist/components/zonos-icon2.js +1 -1
  186. package/dist/components/zonos-input.d.ts +11 -0
  187. package/dist/components/zonos-input.js +6 -0
  188. package/dist/components/zonos-input2.js +78 -0
  189. package/dist/components/zonos-language-select2.js +5 -4
  190. package/dist/components/zonos-link-authentication2.js +12 -5
  191. package/dist/components/zonos-link.js +2 -2
  192. package/dist/components/zonos-logo.js +2 -2
  193. package/dist/components/zonos-notification2.js +3 -3
  194. package/dist/components/zonos-payment2.js +1 -1
  195. package/dist/components/zonos-review2.js +5 -4
  196. package/dist/components/zonos-select-dialog-header2.js +3 -3
  197. package/dist/components/zonos-shipping-rich-radio2.js +6 -4
  198. package/dist/components/zonos-shipping2.js +4 -3
  199. package/dist/components/zonos-spinner2.js +1 -1
  200. package/dist/components/zonos-text2.js +3 -2
  201. package/dist/components/zonos-tooltip2.js +3 -3
  202. package/dist/components/zonos-v-stack2.js +2 -2
  203. package/dist/esm/RemoveIcon-9dc5dd1a.js +3 -0
  204. package/dist/esm/{cart-10bcd2e0.js → cart-462e89a6.js} +976 -139
  205. package/dist/esm/containsNonLatinChars-2d8810c3.js +21 -0
  206. package/dist/esm/{getBorderRadius-8129b0cb.js → getBorderRadius-567f1786.js} +4 -6
  207. package/dist/esm/index-e063389c.js +1328 -0
  208. package/dist/esm/isCheckoutMobile-8846dccb.js +6 -0
  209. package/dist/esm/{isColorVariable-fbf2d80d.js → isColorVariable-82457bef.js} +2 -2
  210. package/dist/esm/{isDarkColor-7a6d2d14.js → isDarkColor-7f62035a.js} +1 -1
  211. package/dist/esm/loader.js +3 -3
  212. package/dist/esm/{submitGtag-84886899.js → submitGtag-ac7c3c89.js} +21 -3
  213. package/dist/esm/zonos-address_8.entry.js +631 -0
  214. package/dist/esm/zonos-badge_2.entry.js +9 -9
  215. package/dist/esm/zonos-banner.entry.js +5 -5
  216. package/dist/esm/zonos-button_3.entry.js +186 -0
  217. package/dist/esm/zonos-card_2.entry.js +12 -12
  218. package/dist/esm/{zonos-cart-items_10.entry.js → zonos-cart-items_9.entry.js} +146 -119
  219. package/dist/esm/zonos-checkout.entry.js +15 -14
  220. package/dist/esm/zonos-component.entry.js +2 -2
  221. package/dist/esm/zonos-controller.entry.js +6 -6
  222. package/dist/esm/zonos-country-flag.entry.js +5 -5
  223. package/dist/esm/zonos-country-select_3.entry.js +16 -16
  224. package/dist/esm/zonos-elements.js +11 -11
  225. package/dist/esm/zonos-hello-dialog.entry.js +9 -9
  226. package/dist/esm/zonos-hello.entry.js +6 -6
  227. package/dist/esm/zonos-input.entry.js +53 -0
  228. package/dist/esm/zonos-link.entry.js +3 -3
  229. package/dist/esm/zonos-logo.entry.js +4 -4
  230. package/dist/esm/zonos-notification.entry.js +5 -5
  231. package/dist/esm/zonos-payment.entry.js +6 -6
  232. package/dist/esm/zonos-select-dialog-header_2.entry.js +7 -7
  233. package/dist/esm/zonos-shipping-rich-radio.entry.js +10 -8
  234. package/dist/esm/zonos-text.entry.js +6 -5
  235. package/dist/esm/{zonosStore-f3eef64b.js → zonosStore-33ff08ff.js} +1 -1
  236. package/dist/esm-es5/RemoveIcon-9dc5dd1a.js +1 -0
  237. package/dist/esm-es5/cart-462e89a6.js +1 -0
  238. package/dist/esm-es5/containsNonLatinChars-2d8810c3.js +1 -0
  239. package/dist/esm-es5/getBorderRadius-567f1786.js +1 -0
  240. package/dist/esm-es5/index-e063389c.js +2 -0
  241. package/dist/esm-es5/isCheckoutMobile-8846dccb.js +1 -0
  242. package/dist/esm-es5/isColorVariable-82457bef.js +1 -0
  243. package/dist/esm-es5/{isDarkColor-7a6d2d14.js → isDarkColor-7f62035a.js} +1 -1
  244. package/dist/esm-es5/loader.js +1 -1
  245. package/dist/esm-es5/submitGtag-ac7c3c89.js +1 -0
  246. package/dist/esm-es5/zonos-address_8.entry.js +1 -0
  247. package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
  248. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  249. package/dist/esm-es5/zonos-button_3.entry.js +1 -0
  250. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  251. package/dist/esm-es5/zonos-cart-items_9.entry.js +1 -0
  252. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  253. package/dist/esm-es5/zonos-component.entry.js +1 -1
  254. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  255. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  256. package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
  257. package/dist/esm-es5/zonos-elements.js +1 -1
  258. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  259. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  260. package/dist/esm-es5/zonos-input.entry.js +1 -0
  261. package/dist/esm-es5/zonos-link.entry.js +1 -1
  262. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  263. package/dist/esm-es5/zonos-notification.entry.js +1 -1
  264. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  265. package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
  266. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  267. package/dist/esm-es5/zonos-text.entry.js +1 -1
  268. package/dist/esm-es5/{zonosStore-f3eef64b.js → zonosStore-33ff08ff.js} +1 -1
  269. package/dist/scripts/loadStripe.js +1 -1
  270. package/dist/scripts/loadZonos.js +1 -1
  271. package/dist/scripts/stripe.js +1 -1
  272. package/dist/scripts/zonos.js +1 -1
  273. package/dist/scripts/zonosBase.js +1 -1
  274. package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.d.ts +12 -0
  275. package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.d.ts +28 -0
  276. package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.d.ts +96 -0
  277. package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +22 -2
  278. package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +1 -0
  279. package/dist/types/components/common/zonos-dialog/zonos-dialog.d.ts +0 -3
  280. package/dist/types/components/common/zonos-input/zonos-input.d.ts +35 -0
  281. package/dist/types/components/store/checkout/stripe.d.ts +25 -1
  282. package/dist/types/components/store/translationStore/strings.arabic.d.ts +35 -5
  283. package/dist/types/components/store/translationStore/strings.base.d.ts +35 -5
  284. package/dist/types/components/store/translationStore/strings.chinese.d.ts +35 -5
  285. package/dist/types/components/store/translationStore/strings.danish.d.ts +35 -5
  286. package/dist/types/components/store/translationStore/strings.dutch.d.ts +35 -5
  287. package/dist/types/components/store/translationStore/strings.french.d.ts +35 -5
  288. package/dist/types/components/store/translationStore/strings.german.d.ts +35 -5
  289. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +35 -5
  290. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +35 -5
  291. package/dist/types/components/store/translationStore/strings.italian.d.ts +35 -5
  292. package/dist/types/components/store/translationStore/strings.japanese.d.ts +35 -5
  293. package/dist/types/components/store/translationStore/strings.korean.d.ts +35 -5
  294. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +35 -5
  295. package/dist/types/components/store/translationStore/strings.polish.d.ts +35 -5
  296. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +35 -5
  297. package/dist/types/components/store/translationStore/strings.russian.d.ts +35 -5
  298. package/dist/types/components/store/translationStore/strings.spanish.d.ts +35 -5
  299. package/dist/types/components/store/translationStore/strings.swedish.d.ts +35 -5
  300. package/dist/types/components/store/translationStore/strings.turkish.d.ts +35 -5
  301. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +35 -5
  302. package/dist/types/components/store/translationStore.d.ts +1 -1
  303. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +2 -10
  304. package/dist/types/components/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +4 -0
  305. package/dist/types/components/utils/changeDeepProperty.d.ts +1 -1
  306. package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +1 -1
  307. package/dist/types/components/utils/checkout/buildTranslateRequestBody.d.ts +26 -0
  308. package/dist/types/components/utils/containsNonLatinChars.d.ts +1 -0
  309. package/dist/types/components/utils/getBorderRadius.d.ts +7 -1
  310. package/dist/types/components.d.ts +308 -6
  311. package/dist/types/types/checkout/TranslatedText.d.ts +23 -0
  312. package/dist/types/types/checkout/api/ValidateAddressRequest.d.ts +20 -0
  313. package/dist/types/types/generated/graphql.customer.types.d.ts +2 -0
  314. package/dist/types/types/generated/graphql.customer.types.ts +2 -0
  315. package/dist/zonos-elements/assets/ChevronDownIcon.svg +1 -1
  316. package/dist/zonos-elements/assets/ChevronUpIcon.svg +1 -1
  317. package/dist/zonos-elements/assets/LeftArrow.svg +1 -1
  318. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  319. package/dist/zonos-elements/assets/SuccessIcon.svg +1 -1
  320. package/dist/zonos-elements/p-04df7975.entry.js +1 -0
  321. package/dist/zonos-elements/p-08e7107d.js +1 -0
  322. package/dist/zonos-elements/p-0c64dbbb.js +1 -0
  323. package/dist/zonos-elements/{p-bc3a0f7c.entry.js → p-11f1b78c.entry.js} +1 -1
  324. package/dist/zonos-elements/p-13ddaf31.js +2 -0
  325. package/dist/zonos-elements/p-154aaf95.system.js +1 -0
  326. package/dist/zonos-elements/p-163ff5b5.system.js +2 -0
  327. package/dist/zonos-elements/p-17e265c3.system.entry.js +1 -0
  328. package/dist/zonos-elements/p-2670438c.system.js +1 -0
  329. package/dist/zonos-elements/p-2770ba48.system.js +1 -0
  330. package/dist/zonos-elements/p-305f27c7.entry.js +1 -0
  331. package/dist/zonos-elements/p-34d0ef7a.system.entry.js +1 -0
  332. package/dist/zonos-elements/p-3638e2ed.entry.js +1 -0
  333. package/dist/zonos-elements/p-36a461a6.system.entry.js +1 -0
  334. package/dist/zonos-elements/{p-1a5f8df7.entry.js → p-3d8667a7.entry.js} +1 -1
  335. package/dist/zonos-elements/p-4a107b6f.system.js +1 -0
  336. package/dist/zonos-elements/p-4dca5484.system.entry.js +1 -0
  337. package/dist/zonos-elements/p-5120a57c.entry.js +1 -0
  338. package/dist/zonos-elements/p-54004793.system.entry.js +1 -0
  339. package/dist/zonos-elements/p-578f0aad.system.js +1 -0
  340. package/dist/zonos-elements/p-582d8b27.entry.js +1 -0
  341. package/dist/zonos-elements/p-5d993965.js +1 -0
  342. package/dist/zonos-elements/{p-262b8e1e.system.entry.js → p-5f9c066d.system.entry.js} +1 -1
  343. package/dist/zonos-elements/p-66eb66d1.js +1 -0
  344. package/dist/zonos-elements/{p-95c864ca.system.entry.js → p-679877b1.system.entry.js} +1 -1
  345. package/dist/zonos-elements/p-6e9b72e4.entry.js +1 -0
  346. package/dist/zonos-elements/p-726e2268.system.entry.js +1 -0
  347. package/dist/zonos-elements/{p-fc4da55c.system.js → p-771fbeb3.system.js} +1 -1
  348. package/dist/zonos-elements/p-79f3c4f5.system.js +1 -0
  349. package/dist/zonos-elements/p-81a54668.js +1 -0
  350. package/dist/zonos-elements/p-835c8928.entry.js +1 -0
  351. package/dist/zonos-elements/p-83cc2936.js +1 -0
  352. package/dist/zonos-elements/p-83fecb2a.entry.js +1 -0
  353. package/dist/zonos-elements/{p-520e8e63.system.js → p-87badea9.system.js} +1 -1
  354. package/dist/zonos-elements/{p-d01576d7.js → p-909a331c.js} +1 -1
  355. package/dist/zonos-elements/p-94d6af4b.system.entry.js +1 -0
  356. package/dist/zonos-elements/{p-5ee8a685.entry.js → p-9b8ae241.entry.js} +1 -1
  357. package/dist/zonos-elements/p-9ea84657.system.entry.js +1 -0
  358. package/dist/zonos-elements/{p-24fee841.entry.js → p-9ec93319.entry.js} +1 -1
  359. package/dist/zonos-elements/p-a6d7ac46.js +1 -0
  360. package/dist/zonos-elements/{p-2a99c8b5.system.entry.js → p-a6eeb4bd.system.entry.js} +1 -1
  361. package/dist/zonos-elements/p-a889c1bc.entry.js +1 -0
  362. package/dist/zonos-elements/p-ab7ac0db.system.entry.js +1 -0
  363. package/dist/zonos-elements/p-ad088d46.system.entry.js +1 -0
  364. package/dist/zonos-elements/p-aed0098c.system.js +1 -0
  365. package/dist/zonos-elements/p-b98bdbcc.system.entry.js +1 -0
  366. package/dist/zonos-elements/{p-d3772fd3.entry.js → p-baee62a4.entry.js} +1 -1
  367. package/dist/zonos-elements/{p-eff12c31.system.entry.js → p-bf32179a.system.entry.js} +1 -1
  368. package/dist/zonos-elements/p-ca71b681.system.entry.js +1 -0
  369. package/dist/zonos-elements/p-d7acc81c.entry.js +1 -0
  370. package/dist/zonos-elements/p-dbdebdae.entry.js +1 -0
  371. package/dist/zonos-elements/p-df192668.system.js +1 -0
  372. package/dist/zonos-elements/{p-70ede197.system.entry.js → p-df24d548.system.entry.js} +1 -1
  373. package/dist/zonos-elements/p-df64afdd.entry.js +1 -0
  374. package/dist/zonos-elements/p-e108e5ed.system.entry.js +1 -0
  375. package/dist/zonos-elements/p-e1b2b610.entry.js +1 -0
  376. package/dist/zonos-elements/{p-6743734f.entry.js → p-e7b4b756.entry.js} +1 -1
  377. package/dist/zonos-elements/{p-d41b5762.js → p-f1962041.js} +1 -1
  378. package/dist/zonos-elements/p-f71489e5.system.entry.js +1 -0
  379. package/dist/zonos-elements/p-fd49d864.entry.js +1 -0
  380. package/dist/zonos-elements/p-fd5d2fc3.system.entry.js +1 -0
  381. package/dist/zonos-elements/p-fe246229.system.entry.js +1 -0
  382. package/dist/zonos-elements/p-ff403840.entry.js +1 -0
  383. package/dist/zonos-elements/zonos-elements.css +17 -9
  384. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  385. package/dist/zonos-elements/zonos-elements.js +1 -1
  386. package/package.json +3 -2
  387. package/dist/cjs/index-3b4816ef.js +0 -2088
  388. package/dist/cjs/sendErrorLog-29e50f7e.js +0 -29
  389. package/dist/cjs/zonos-address_4.cjs.entry.js +0 -388
  390. package/dist/cjs/zonos-button_2.cjs.entry.js +0 -152
  391. package/dist/cjs/zonos-icon.cjs.entry.js +0 -39
  392. package/dist/components/sendErrorLog.js +0 -21
  393. package/dist/esm/index-0e31d804.js +0 -2055
  394. package/dist/esm/sendErrorLog-8642e94a.js +0 -26
  395. package/dist/esm/zonos-address_4.entry.js +0 -381
  396. package/dist/esm/zonos-button_2.entry.js +0 -147
  397. package/dist/esm/zonos-icon.entry.js +0 -35
  398. package/dist/esm-es5/cart-10bcd2e0.js +0 -1
  399. package/dist/esm-es5/getBorderRadius-8129b0cb.js +0 -1
  400. package/dist/esm-es5/index-0e31d804.js +0 -2
  401. package/dist/esm-es5/isColorVariable-fbf2d80d.js +0 -1
  402. package/dist/esm-es5/sendErrorLog-8642e94a.js +0 -1
  403. package/dist/esm-es5/submitGtag-84886899.js +0 -1
  404. package/dist/esm-es5/zonos-address_4.entry.js +0 -1
  405. package/dist/esm-es5/zonos-button_2.entry.js +0 -1
  406. package/dist/esm-es5/zonos-cart-items_10.entry.js +0 -1
  407. package/dist/esm-es5/zonos-icon.entry.js +0 -1
  408. package/dist/scripts/insertTranslations.js +0 -1
  409. package/dist/zonos-elements/p-0253aeae.entry.js +0 -1
  410. package/dist/zonos-elements/p-031086ba.system.entry.js +0 -1
  411. package/dist/zonos-elements/p-1264b362.entry.js +0 -1
  412. package/dist/zonos-elements/p-1950dda7.entry.js +0 -1
  413. package/dist/zonos-elements/p-2244534c.js +0 -2
  414. package/dist/zonos-elements/p-2825570c.system.js +0 -2
  415. package/dist/zonos-elements/p-33abdb30.js +0 -1
  416. package/dist/zonos-elements/p-376bdf70.entry.js +0 -1
  417. package/dist/zonos-elements/p-3e417d7c.entry.js +0 -1
  418. package/dist/zonos-elements/p-450942a3.system.js +0 -1
  419. package/dist/zonos-elements/p-46f9c93e.system.entry.js +0 -1
  420. package/dist/zonos-elements/p-48a2b8b0.entry.js +0 -1
  421. package/dist/zonos-elements/p-49120f0e.system.entry.js +0 -1
  422. package/dist/zonos-elements/p-593948b5.system.entry.js +0 -1
  423. package/dist/zonos-elements/p-5ca09163.entry.js +0 -1
  424. package/dist/zonos-elements/p-5ff27485.js +0 -1
  425. package/dist/zonos-elements/p-6d9dbecb.system.entry.js +0 -1
  426. package/dist/zonos-elements/p-6e8d43de.entry.js +0 -1
  427. package/dist/zonos-elements/p-6f5761e8.js +0 -1
  428. package/dist/zonos-elements/p-7891f8d2.entry.js +0 -1
  429. package/dist/zonos-elements/p-78d22069.system.entry.js +0 -1
  430. package/dist/zonos-elements/p-8b44e558.system.js +0 -1
  431. package/dist/zonos-elements/p-8bc0e56a.system.entry.js +0 -1
  432. package/dist/zonos-elements/p-92446677.entry.js +0 -1
  433. package/dist/zonos-elements/p-9350d19f.entry.js +0 -1
  434. package/dist/zonos-elements/p-9768840a.system.entry.js +0 -1
  435. package/dist/zonos-elements/p-9db2f9d1.system.js +0 -1
  436. package/dist/zonos-elements/p-9e8f1065.system.entry.js +0 -1
  437. package/dist/zonos-elements/p-a0abc499.system.entry.js +0 -1
  438. package/dist/zonos-elements/p-a6bbf6de.system.entry.js +0 -1
  439. package/dist/zonos-elements/p-ae4a4634.system.entry.js +0 -1
  440. package/dist/zonos-elements/p-af8391bb.entry.js +0 -1
  441. package/dist/zonos-elements/p-b8e8330b.system.js +0 -1
  442. package/dist/zonos-elements/p-be022d8e.entry.js +0 -1
  443. package/dist/zonos-elements/p-bfa8d9a4.system.entry.js +0 -1
  444. package/dist/zonos-elements/p-c6170bec.system.js +0 -1
  445. package/dist/zonos-elements/p-d149bc5d.system.entry.js +0 -1
  446. package/dist/zonos-elements/p-e1ac5b2a.system.entry.js +0 -1
  447. package/dist/zonos-elements/p-e28ed57c.js +0 -1
  448. package/dist/zonos-elements/p-e705c44c.entry.js +0 -1
  449. package/dist/zonos-elements/p-e9fafda6.entry.js +0 -1
  450. package/dist/zonos-elements/p-ed2e94d2.js +0 -1
  451. package/dist/zonos-elements/p-f4c38bfc.system.js +0 -1
  452. package/dist/zonos-elements/p-fc35d717.system.entry.js +0 -1
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface ZonosAddressDisplay extends Components.ZonosAddressDisplay, HTMLElement {}
4
+ export const ZonosAddressDisplay: {
5
+ prototype: ZonosAddressDisplay;
6
+ new (): ZonosAddressDisplay;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { Z as ZonosAddressDisplay$1, d as defineCustomElement$1 } from './zonos-address-display2.js';
2
+
3
+ const ZonosAddressDisplay = ZonosAddressDisplay$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { ZonosAddressDisplay, defineCustomElement };
@@ -0,0 +1,64 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+ import { a as localizationStore } from './stripe.js';
3
+ import { a as translate } from './translationStore.js';
4
+ import { i as isTextContainsNonLatinChars } from './containsNonLatinChars.js';
5
+ import { d as defineCustomElement$2 } from './zonos-country-flag2.js';
6
+ import { d as defineCustomElement$1 } from './zonos-text2.js';
7
+
8
+ const zonosAddressDisplayCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:\", \";color:var(--zonos-elements-gray-1200);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}";
9
+ const ZonosAddressDisplayStyle0 = zonosAddressDisplayCss;
10
+
11
+ const ZonosAddressDisplay = /*@__PURE__*/ proxyCustomElement(class ZonosAddressDisplay extends HTMLElement {
12
+ constructor() {
13
+ super();
14
+ this.__registerHost();
15
+ this.__attachShadow();
16
+ this.currentAddress = undefined;
17
+ this.addressType = undefined;
18
+ }
19
+ render() {
20
+ var _a;
21
+ const { city, country, email, line1, line2, name, phone, postal_code, state, } = this.currentAddress;
22
+ const shippingZoneCountry = (_a = localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[country];
23
+ const renderEnteredInfoText = ({ bold, content, }) => {
24
+ const textColor = isTextContainsNonLatinChars(content)
25
+ ? 'red-600'
26
+ : 'gray-1200';
27
+ return (h("zonos-text", { textColor: textColor, type: bold ? 'boldLabel' : 'body' }, content));
28
+ };
29
+ return (h(Host, { class: "zonos--address-form zonos--elements" }, h("div", { class: "zonos--title" }, h("zonos-text", { textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
30
+ ? translate('Shipping')
31
+ : translate('Billing'))), h("div", { class: "zonos--address-group" }, name && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ bold: true, content: name }))), email && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: email }))), phone && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: phone }))), line1 && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: line1 }))), line2 && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: line2 }))), h("div", { class: "zonos--address-line" }, city && renderEnteredInfoText({ content: city }), state && renderEnteredInfoText({ content: state }), postal_code && renderEnteredInfoText({ content: postal_code })), shippingZoneCountry && (h("div", { class: "zonos--address-line" }, h("zonos-country-flag", { class: "zonos--country-flag", countryCode: shippingZoneCountry.code }), ' ', renderEnteredInfoText({
32
+ content: shippingZoneCountry.displayName,
33
+ }))))));
34
+ }
35
+ static get style() { return ZonosAddressDisplayStyle0; }
36
+ }, [1, "zonos-address-display", {
37
+ "currentAddress": [16],
38
+ "addressType": [1, "address-type"]
39
+ }]);
40
+ function defineCustomElement() {
41
+ if (typeof customElements === "undefined") {
42
+ return;
43
+ }
44
+ const components = ["zonos-address-display", "zonos-country-flag", "zonos-text"];
45
+ components.forEach(tagName => { switch (tagName) {
46
+ case "zonos-address-display":
47
+ if (!customElements.get(tagName)) {
48
+ customElements.define(tagName, ZonosAddressDisplay);
49
+ }
50
+ break;
51
+ case "zonos-country-flag":
52
+ if (!customElements.get(tagName)) {
53
+ defineCustomElement$2();
54
+ }
55
+ break;
56
+ case "zonos-text":
57
+ if (!customElements.get(tagName)) {
58
+ defineCustomElement$1();
59
+ }
60
+ break;
61
+ } });
62
+ }
63
+
64
+ export { ZonosAddressDisplay as Z, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface ZonosAddressForm extends Components.ZonosAddressForm, HTMLElement {}
4
+ export const ZonosAddressForm: {
5
+ prototype: ZonosAddressForm;
6
+ new (): ZonosAddressForm;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { Z as ZonosAddressForm$1, d as defineCustomElement$1 } from './zonos-address-form2.js';
2
+
3
+ const ZonosAddressForm = ZonosAddressForm$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { ZonosAddressForm, defineCustomElement };
@@ -0,0 +1,84 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { a as translate } from './translationStore.js';
3
+ import { i as isTextContainsNonLatinChars } from './containsNonLatinChars.js';
4
+ import { d as defineCustomElement$2 } from './zonos-input2.js';
5
+ import { d as defineCustomElement$1 } from './zonos-text2.js';
6
+
7
+ const zonosAddressFormCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";
8
+ const ZonosAddressFormStyle0 = zonosAddressFormCss;
9
+
10
+ const ZonosAddressForm = /*@__PURE__*/ proxyCustomElement(class ZonosAddressForm extends HTMLElement {
11
+ constructor() {
12
+ super();
13
+ this.__registerHost();
14
+ this.__attachShadow();
15
+ this.addressChange = createEvent(this, "addressChange", 7);
16
+ this.onInputChange = ({ key, value, }) => {
17
+ this.addressChange.emit(Object.assign(Object.assign({}, this.localAddress), { [key]: value }));
18
+ };
19
+ this.currentAddress = undefined;
20
+ this.translatedAddress = undefined;
21
+ this.addressType = undefined;
22
+ this.localAddress = this.currentAddress;
23
+ }
24
+ watchCurrentAddress() {
25
+ var _a, _b, _c, _d, _e, _f;
26
+ const { city, line1, line2, name, postal_code, state } = this.currentAddress;
27
+ // Update the local address when the current address changes
28
+ // If translated address is available, use that instead
29
+ this.localAddress = Object.assign(Object.assign({}, this.currentAddress), { city: ((_a = this.translatedAddress.city) === null || _a === void 0 ? void 0 : _a[city]) || city, line1: ((_b = this.translatedAddress.line1) === null || _b === void 0 ? void 0 : _b[line1]) || line1, line2: ((_c = this.translatedAddress.line2) === null || _c === void 0 ? void 0 : _c[line2]) || line2, name: ((_d = this.translatedAddress.name) === null || _d === void 0 ? void 0 : _d[name]) || name, postal_code: ((_e = this.translatedAddress.postal_code) === null || _e === void 0 ? void 0 : _e[postal_code]) || postal_code, state: ((_f = this.translatedAddress.state) === null || _f === void 0 ? void 0 : _f[state]) || state });
30
+ }
31
+ componentWillLoad() {
32
+ this.watchCurrentAddress();
33
+ }
34
+ render() {
35
+ const { city, country, line1, line2, name, phone, postal_code, state } = this.localAddress;
36
+ const firstName = name.split(' ')[0] || '';
37
+ const lastName = name.split(' ')[1] || '';
38
+ return (h(Host, { key: '9c1ee87200d1f90e9dfac58c49aabba1777373a9', class: "zonos--address-form zonos--elements" }, h("div", { key: 'eec3416268ff2324fd751408552705086905423d', class: "zonos--title" }, h("zonos-text", { key: 'a4c254f78420dcfc712e1a83b20dd3ac9e64c460', textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
39
+ ? translate('Shipping')
40
+ : translate('Billing'))), h("div", { key: 'b8109545d282fb8c06a2e791c30088018d6ffec0', class: "zonos--address-group" }, h("div", { key: '833a395984cd75242e5d97697fd6566f11932d1b', class: "zonos--contact" }, h("zonos-text", { key: 'e60f574e95162aabf6465b878fc9b16c708e8029', type: "label" }, translate('Contact')), h("zonos-input", { key: '24cd24a362a1bbc76d0c91718c48ae32baa20ae6', class: "zonos--form-email", inputLabel: translate('Email'), inputValue: this.currentAddress.email, isDisabled: true }), h("div", { key: '84e64ef44eb3b39ac7ab542e07d7a52a95377cae', class: "zonos--name zonos--address-row" }, h("zonos-input", { key: '26621aca0d57a7fee743874b8d11af5f58c91b69', class: "zonos--form-first-name", inputLabel: translate('First name'), inputValue: firstName, isError: isTextContainsNonLatinChars(firstName), onInputChange: e => this.onInputChange({
41
+ key: 'name',
42
+ value: `${e.detail} ${lastName}`,
43
+ }) }), h("zonos-input", { key: '01e3e5038b4a4311dd5874a1213f936451dc300d', class: "zonos--form-last-name", inputLabel: translate('Last name'), inputValue: lastName, isError: isTextContainsNonLatinChars(lastName), onInputChange: e => this.onInputChange({
44
+ key: 'name',
45
+ value: `${firstName} ${e.detail}`,
46
+ }) }))), h("div", { key: 'eb42dece28082ff16a453110b3208de5b44b9fdb', class: "zonos--address" }, h("zonos-text", { key: '3557122c716533be7b36a8bd395ea616a7061665', type: "label" }, translate('Address')), h("zonos-input", { key: 'bcc7d84d530f2f3a10537117eb6ef143df7cc8e2', class: "zonos--form-country", inputLabel: translate('Country'), inputValue: country, isDisabled: true }), h("zonos-input", { key: '6ce78e25151a129b69b501cf768604134a395e85', class: "zonos--form-line1", inputLabel: translate('Address line 1'), inputValue: line1, isError: isTextContainsNonLatinChars(line1), onInputChange: e => this.onInputChange({ key: 'line1', value: e.detail }) }), h("zonos-input", { key: '6f7a18010e2d8131327154a31ba58544df56768c', class: "zonos--form-line2", inputLabel: translate('Address line 2'), inputValue: line2, isError: isTextContainsNonLatinChars(line2), onInputChange: e => this.onInputChange({ key: 'line2', value: e.detail }) }), h("div", { key: '48afbf7a3cbd26fddfea4f2799005a51b1c3d3c6', class: "zonos--address-row" }, h("zonos-input", { key: '6decf8c430d8d25b2c555b110009da74e0ac9e5f', class: "zonos--form-city", inputLabel: translate('City'), inputValue: city, isError: isTextContainsNonLatinChars(city), onInputChange: e => this.onInputChange({ key: 'city', value: e.detail }) }), h("zonos-input", { key: '065e1be213d3cfec7749ab32890f96b0b484a25a', class: "zonos--form-state", inputLabel: translate('State/Province'), inputValue: state, isError: isTextContainsNonLatinChars(state), onInputChange: e => this.onInputChange({ key: 'state', value: e.detail }) })), h("zonos-input", { key: 'a69244bf84c9fd007c9ad4aad2b6cc6d44420775', class: "zonos--form-postal-code", inputLabel: translate('Postal code'), inputValue: postal_code, isError: isTextContainsNonLatinChars(postal_code), onInputChange: e => this.onInputChange({ key: 'postal_code', value: e.detail }) }), h("zonos-input", { key: '0bcc89de1ecc4aae8a69d74eff42dfd117ada40b', class: "zonos--form-phone", inputLabel: translate('Phone number'), inputValue: phone, onInputChange: e => this.onInputChange({ key: 'phone', value: e.detail }) })))));
47
+ }
48
+ static get watchers() { return {
49
+ "translatedAddress": ["watchCurrentAddress"]
50
+ }; }
51
+ static get style() { return ZonosAddressFormStyle0; }
52
+ }, [1, "zonos-address-form", {
53
+ "currentAddress": [16],
54
+ "translatedAddress": [16],
55
+ "addressType": [1, "address-type"],
56
+ "localAddress": [32]
57
+ }, undefined, {
58
+ "translatedAddress": ["watchCurrentAddress"]
59
+ }]);
60
+ function defineCustomElement() {
61
+ if (typeof customElements === "undefined") {
62
+ return;
63
+ }
64
+ const components = ["zonos-address-form", "zonos-input", "zonos-text"];
65
+ components.forEach(tagName => { switch (tagName) {
66
+ case "zonos-address-form":
67
+ if (!customElements.get(tagName)) {
68
+ customElements.define(tagName, ZonosAddressForm);
69
+ }
70
+ break;
71
+ case "zonos-input":
72
+ if (!customElements.get(tagName)) {
73
+ defineCustomElement$2();
74
+ }
75
+ break;
76
+ case "zonos-text":
77
+ if (!customElements.get(tagName)) {
78
+ defineCustomElement$1();
79
+ }
80
+ break;
81
+ } });
82
+ }
83
+
84
+ export { ZonosAddressForm as Z, defineCustomElement as d };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface ZonosAddressUpdateDialog extends Components.ZonosAddressUpdateDialog, HTMLElement {}
4
+ export const ZonosAddressUpdateDialog: {
5
+ prototype: ZonosAddressUpdateDialog;
6
+ new (): ZonosAddressUpdateDialog;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { Z as ZonosAddressUpdateDialog$1, d as defineCustomElement$1 } from './zonos-address-update-dialog2.js';
2
+
3
+ const ZonosAddressUpdateDialog = ZonosAddressUpdateDialog$1;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { ZonosAddressUpdateDialog, defineCustomElement };
@@ -0,0 +1,264 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { a as translate } from './translationStore.js';
3
+ import { z as zonosStore } from './zonosStore.js';
4
+ import { c as classes } from './classes.js';
5
+ import { c as containsNonLatinChars } from './containsNonLatinChars.js';
6
+ import { d as defineCustomElement$9 } from './zonos-address-display2.js';
7
+ import { d as defineCustomElement$8 } from './zonos-address-form2.js';
8
+ import { d as defineCustomElement$7 } from './zonos-button2.js';
9
+ import { d as defineCustomElement$6 } from './zonos-country-flag2.js';
10
+ import { d as defineCustomElement$5 } from './zonos-dialog2.js';
11
+ import { d as defineCustomElement$4 } from './zonos-icon2.js';
12
+ import { d as defineCustomElement$3 } from './zonos-input2.js';
13
+ import { d as defineCustomElement$2 } from './zonos-spinner2.js';
14
+ import { d as defineCustomElement$1 } from './zonos-text2.js';
15
+
16
+ const RemoveIcon = `<svg color="var(--zonos-elements-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--zonos-elements-gray-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
17
+
18
+ const zonosAddressUpdateDialogCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";
19
+ const ZonosAddressUpdateDialogStyle0 = zonosAddressUpdateDialogCss;
20
+
21
+ const ZonosAddressUpdateDialog = /*@__PURE__*/ proxyCustomElement(class ZonosAddressUpdateDialog extends HTMLElement {
22
+ constructor() {
23
+ super();
24
+ this.__registerHost();
25
+ this.__attachShadow();
26
+ this.closeDialog = createEvent(this, "closeDialog", 7);
27
+ this.continueClicked = createEvent(this, "continueClicked", 7);
28
+ /**
29
+ * handler for close button click
30
+ */
31
+ this.closeDialogHandler = () => {
32
+ this.closeDialog.emit();
33
+ };
34
+ /**
35
+ * Extract value from translated object
36
+ */
37
+ this.getTranslatedAddress = ({ currentAddress, translatedAddress, }) => {
38
+ var _a, _b, _c, _d, _e, _f;
39
+ const { city, line1, line2, name, postal_code, state } = currentAddress;
40
+ return {
41
+ city: ((_a = translatedAddress.city) === null || _a === void 0 ? void 0 : _a[city]) || city,
42
+ line1: ((_b = translatedAddress.line1) === null || _b === void 0 ? void 0 : _b[line1]) || line1,
43
+ line2: ((_c = translatedAddress.line2) === null || _c === void 0 ? void 0 : _c[line2]) || line2,
44
+ name: ((_d = translatedAddress.name) === null || _d === void 0 ? void 0 : _d[name]) || name,
45
+ postal_code: ((_e = translatedAddress.postal_code) === null || _e === void 0 ? void 0 : _e[postal_code]) || postal_code,
46
+ state: ((_f = translatedAddress.state) === null || _f === void 0 ? void 0 : _f[state]) || state,
47
+ };
48
+ };
49
+ /**
50
+ * handler for continue button click
51
+ */
52
+ this.continueClickHandler = async () => {
53
+ var _a, _b, _c;
54
+ // set spinner for the continue button
55
+ this.continueLoading = true;
56
+ const translatedBillingAddress = this.billingAddress
57
+ ? this.getTranslatedAddress({
58
+ currentAddress: this.billingAddress,
59
+ translatedAddress: this.translatedBillingAddressState,
60
+ })
61
+ : null;
62
+ const translatedShippingAddress = this.getTranslatedAddress({
63
+ currentAddress: this.shippingAddress,
64
+ translatedAddress: this.translatedShippingAddressState,
65
+ });
66
+ // check to see if there are still non-latin characters in the translated address
67
+ const shippingNonlatinChars = containsNonLatinChars(Object.assign(Object.assign({}, translatedShippingAddress), { country: this.shippingAddress.country }));
68
+ // get list of non-latin characters field in the billing address
69
+ const billingNonLatinChars = translatedBillingAddress &&
70
+ this.billingAddress &&
71
+ containsNonLatinChars(Object.assign(Object.assign({}, translatedBillingAddress), { country: this.billingAddress.country }));
72
+ const shippingHasNonLatinChars = !!Object.keys(shippingNonlatinChars)
73
+ .length;
74
+ const billingHasNonLatinChars = !!billingNonLatinChars && !!Object.keys(billingNonLatinChars).length;
75
+ // if there are non-latin characters in the translated address, scroll to the error input so user can see and fix it
76
+ if (shippingHasNonLatinChars || billingHasNonLatinChars) {
77
+ // get scroll top of the first input has "has-error" class
78
+ const addressForms = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('zonos-address-form');
79
+ const shippingAddressForm = addressForms === null || addressForms === void 0 ? void 0 : addressForms[0];
80
+ const billingAddressForm = addressForms === null || addressForms === void 0 ? void 0 : addressForms[1];
81
+ const errorInput = ((_b = shippingAddressForm === null || shippingAddressForm === void 0 ? void 0 : shippingAddressForm.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.has-error')) ||
82
+ ((_c = billingAddressForm === null || billingAddressForm === void 0 ? void 0 : billingAddressForm.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('.has-error'));
83
+ // scroll to the first error input
84
+ if (errorInput) {
85
+ errorInput.scrollIntoView({ behavior: 'smooth', block: 'center' });
86
+ }
87
+ this.continueLoading = false;
88
+ return;
89
+ }
90
+ // Submit the translated address to the parent component
91
+ this.continueClicked.emit({
92
+ billingAddress: translatedBillingAddress,
93
+ shippingAddress: translatedShippingAddress,
94
+ });
95
+ };
96
+ /**
97
+ * This function builds a state object for a translated address.
98
+ * It takes the current and translated address as input and returns an object where each field is an object itself.
99
+ * The key of each field's object is the current address's field value and the value is the corresponding translated address's field value.
100
+ *
101
+ * @param {Object} params - The parameters for the function.
102
+ * @param {EnteredInfo} params.currentAddress - The current address information.
103
+ * @param {EnteredInfo} params.translatedAddress - The translated address information.
104
+ *
105
+ */
106
+ this.buildTranslateAddressState = ({ currentAddress, translatedAddress, }) => {
107
+ const { city, line1, line2, name, postal_code, state } = currentAddress;
108
+ return {
109
+ city: {
110
+ [city]: translatedAddress.city,
111
+ },
112
+ line1: {
113
+ [line1]: translatedAddress.line1,
114
+ },
115
+ line2: {
116
+ [line2]: translatedAddress.line2,
117
+ },
118
+ name: {
119
+ [name]: translatedAddress.name,
120
+ },
121
+ postal_code: {
122
+ [postal_code]: translatedAddress.postal_code,
123
+ },
124
+ state: {
125
+ [state]: translatedAddress.state,
126
+ },
127
+ };
128
+ };
129
+ this.continueLoading = false;
130
+ this.dialogLoading = undefined;
131
+ this.dialogOpen = false;
132
+ this.submitBtnType = undefined;
133
+ this.submitBtnColor = undefined;
134
+ this.isMobile = false;
135
+ this.shippingAddress = undefined;
136
+ this.billingAddress = undefined;
137
+ this.translatedShippingAddress = undefined;
138
+ this.translatedBillingAddress = undefined;
139
+ this.showErrorBanner = false;
140
+ this.translatedShippingAddressState = {};
141
+ this.translatedBillingAddressState = {};
142
+ }
143
+ watchTranslatedShippingAddress() {
144
+ this.translatedShippingAddressState = this.translatedShippingAddress;
145
+ }
146
+ watchTranslatedBillingAddress() {
147
+ this.translatedBillingAddressState = this.translatedBillingAddress;
148
+ }
149
+ componentWillLoad() {
150
+ // update the state with the initial props
151
+ this.watchTranslatedBillingAddress();
152
+ this.watchTranslatedShippingAddress();
153
+ }
154
+ render() {
155
+ // dialog background white, so when the button background is also white, we need to change the button type to outline so it's visible
156
+ const submitBtnColor = this.submitBtnColor || zonosStore.appearance.colorSecondary;
157
+ const submitBtnType = submitBtnColor === '#ffffff'
158
+ ? 'outline'
159
+ : this.submitBtnType || 'standard';
160
+ const billing = this.billingAddress;
161
+ const shipping = this.shippingAddress;
162
+ return (h(Host, { key: '03535edacb348258592641baa349e9dcf14bf78c', class: classes([
163
+ 'zonos--address-update-dialog zonos--elements',
164
+ this.isMobile && 'mobile',
165
+ ]) }, h("zonos-dialog", { key: 'c16871425dffe955d422ffa5b9aee1ece0da2890', isLoading: this.dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialog.emit(), open: this.dialogOpen, width: "568px" }, h("div", { key: 'e4fad501f7cfedc5783774d8b1bf785d6947d3c8', class: "zonos--body" }, h("div", { key: '973e7a8097b8c8f60e47e6ad9d8311a64a5a6ff0', class: "zonos--dialog-header" }, h("div", { key: '89c82b6ff3723056d161560da22bd16a992afee7', class: "zonos--dialog-title" }, h("zonos-text", { key: 'bf92ef0b40ea67a492164fedb95dd68b7d023e85', type: "title" }, translate('Update your address')), h("zonos-button", { key: '4e7a1905c976cec396db5c34f633b383bba0d55a', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() })), h("zonos-text", { key: '47b42d8cc14c4757e3fc9f2f43eafbd8d9e9df38' }, translate('To ensure delivery all address details must be in Latin characters.'))), h("div", { key: '28d9804f0a18f143ce541c2c511cbfa21a2a416f', class: "zonos--group" }, h("zonos-text", { key: '43ec5a9fc8594d065b256952ca8e9392fba03839', class: "zonos--what-you-entered", type: "semiBoldLabel" }, translate('What you entered')), h("div", { key: 'b7eb7781ce6aefe20f89b4d5fba190f0102eb5d1', class: "zonos--address-display-group" }, h("zonos-address-display", { key: '152c53176a46575677723ca47386e484c659927a', addressType: "shipping", currentAddress: shipping }), billing && (h("zonos-address-display", { key: '6c7ac2b49d121c26ce45f09a1eac9ef456d45910', addressType: "billing", currentAddress: billing }))), h("div", { key: '2bda98bb0ac9bafcb009ff36fb97a9fc62ce7e2d', class: "zonos--address-form-section" }, h("zonos-text", { key: '87d3380072a049ccde71ba1b752aedd36830348b', type: "semiBoldLabel" }, translate('Translated address')), h("zonos-address-form", { key: '2cb36251c6549da05e272183b2c37478b4166fea', addressType: "shipping", class: "zonos--shipping-address-form", currentAddress: shipping, onAddressChange: e => {
166
+ const address = e.detail;
167
+ this.translatedShippingAddressState =
168
+ this.buildTranslateAddressState({
169
+ currentAddress: shipping,
170
+ translatedAddress: address,
171
+ });
172
+ }, translatedAddress: this.translatedShippingAddressState }), billing && (h("zonos-address-form", { key: '9bf5ebd6fb08851716a72c855451bfeb3ee0ed68', addressType: "billing", class: "zonos--billing-address-form", currentAddress: billing, onAddressChange: e => {
173
+ const address = e.detail;
174
+ this.translatedBillingAddressState =
175
+ this.buildTranslateAddressState({
176
+ currentAddress: billing,
177
+ translatedAddress: address,
178
+ });
179
+ }, translatedAddress: this.translatedBillingAddressState })))), h("div", { key: '621df9c8919973b37c62aca5727bde3635086a6b', class: "zonos--group-btn" }, h("div", { key: '95e9fd31418abc8e89ceef24af7cc251ee45ac93', class: "zonos--button-wrapper" }, h("zonos-button", { key: 'bef31fc81e7cc0f2b3f7ab875a29978b07865b6a', class: "zonos--cancel-btn", onClick: () => this.closeDialogHandler(), variant: "subtle" }, translate('Cancel')), h("zonos-button", { key: '9d183153541766b421c3420681c1159ffa599682', backgroundColor: this.submitBtnColor, class: "zonos--update-btn", loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "sm", variant: submitBtnType }, translate('Update address'))))))));
180
+ }
181
+ get el() { return this; }
182
+ static get watchers() { return {
183
+ "translatedShippingAddress": ["watchTranslatedShippingAddress"],
184
+ "translatedBillingAddress": ["watchTranslatedBillingAddress"]
185
+ }; }
186
+ static get style() { return ZonosAddressUpdateDialogStyle0; }
187
+ }, [1, "zonos-address-update-dialog", {
188
+ "continueLoading": [4, "continue-loading"],
189
+ "dialogLoading": [4, "dialog-loading"],
190
+ "dialogOpen": [4, "dialog-open"],
191
+ "submitBtnType": [1, "submit-btn-type"],
192
+ "submitBtnColor": [1, "submit-btn-color"],
193
+ "isMobile": [4, "is-mobile"],
194
+ "shippingAddress": [16],
195
+ "billingAddress": [16],
196
+ "translatedShippingAddress": [16],
197
+ "translatedBillingAddress": [16],
198
+ "showErrorBanner": [32],
199
+ "translatedShippingAddressState": [32],
200
+ "translatedBillingAddressState": [32]
201
+ }, undefined, {
202
+ "translatedShippingAddress": ["watchTranslatedShippingAddress"],
203
+ "translatedBillingAddress": ["watchTranslatedBillingAddress"]
204
+ }]);
205
+ function defineCustomElement() {
206
+ if (typeof customElements === "undefined") {
207
+ return;
208
+ }
209
+ const components = ["zonos-address-update-dialog", "zonos-address-display", "zonos-address-form", "zonos-button", "zonos-country-flag", "zonos-dialog", "zonos-icon", "zonos-input", "zonos-spinner", "zonos-text"];
210
+ components.forEach(tagName => { switch (tagName) {
211
+ case "zonos-address-update-dialog":
212
+ if (!customElements.get(tagName)) {
213
+ customElements.define(tagName, ZonosAddressUpdateDialog);
214
+ }
215
+ break;
216
+ case "zonos-address-display":
217
+ if (!customElements.get(tagName)) {
218
+ defineCustomElement$9();
219
+ }
220
+ break;
221
+ case "zonos-address-form":
222
+ if (!customElements.get(tagName)) {
223
+ defineCustomElement$8();
224
+ }
225
+ break;
226
+ case "zonos-button":
227
+ if (!customElements.get(tagName)) {
228
+ defineCustomElement$7();
229
+ }
230
+ break;
231
+ case "zonos-country-flag":
232
+ if (!customElements.get(tagName)) {
233
+ defineCustomElement$6();
234
+ }
235
+ break;
236
+ case "zonos-dialog":
237
+ if (!customElements.get(tagName)) {
238
+ defineCustomElement$5();
239
+ }
240
+ break;
241
+ case "zonos-icon":
242
+ if (!customElements.get(tagName)) {
243
+ defineCustomElement$4();
244
+ }
245
+ break;
246
+ case "zonos-input":
247
+ if (!customElements.get(tagName)) {
248
+ defineCustomElement$3();
249
+ }
250
+ break;
251
+ case "zonos-spinner":
252
+ if (!customElements.get(tagName)) {
253
+ defineCustomElement$2();
254
+ }
255
+ break;
256
+ case "zonos-text":
257
+ if (!customElements.get(tagName)) {
258
+ defineCustomElement$1();
259
+ }
260
+ break;
261
+ } });
262
+ }
263
+
264
+ export { RemoveIcon as R, ZonosAddressUpdateDialog as Z, defineCustomElement as d };
@@ -1,41 +1,11 @@
1
1
  import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
- import { s as stripeStore, l as logError, a as localizationStore, t as translate } from './stripe.js';
3
- import { z as zonosStore } from './zonosStore.js';
2
+ import { s as stripeStore, l as logError, a as localizationStore } from './stripe.js';
4
3
  import { i as isCheckoutMobile } from './isCheckoutMobile.js';
5
- import { s as sendErrorLog } from './sendErrorLog.js';
6
- import { d as defineCustomElement$2 } from './zonos-banner2.js';
7
4
  import { d as defineCustomElement$1 } from './zonos-text2.js';
8
5
 
9
- /**
10
- * Check if the given address object contains non-latin characters
11
- * @returns an object with the same keys as the input object, and a boolean value indicating if the value contains non-latin characters
12
- */
13
- const containsNonLatinChars = (params) => {
14
- const specialCharacters = /[ʼˮ՚ߴߵ']{1}/u;
15
- /**
16
- * This regex matches any character that is not a latin character, punctuation, symbol, number, separator, control, or mark
17
- * I limited the character found to 1 in the regex, so that we can return early if we find any non-latin character
18
- **/
19
- const nonLatinRegex = /[^\p{Script=Latin}\p{P}\p{S}\p{N}\p{Z}\p{C}\p{M}]{1}/u;
20
- const nonLatinValueList = Object.entries(params).reduce((prev, [key, value]) => nonLatinRegex.test(value) &&
21
- // allow special characters like web apostrophe and quotation mark
22
- !specialCharacters.test(value)
23
- ? Object.assign(Object.assign({}, prev), { [key]: true }) : prev, {});
24
- return nonLatinValueList;
25
- };
26
-
27
6
  const zonosAddressCss = ".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";
28
7
  const ZonosAddressStyle0 = zonosAddressCss;
29
8
 
30
- const mappedFields = {
31
- city: 'City',
32
- country: 'Country',
33
- line1: 'Address line 1',
34
- line2: 'Address line 2',
35
- name: 'Name',
36
- postal_code: 'Postal code',
37
- state: 'State',
38
- };
39
9
  const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends HTMLElement {
40
10
  constructor() {
41
11
  super();
@@ -45,8 +15,6 @@ const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends
45
15
  this.titleText = undefined;
46
16
  this.defaultAddress = null;
47
17
  this.stripe = window.Zonos.stripe;
48
- this.reportedInvalidCharacters = false;
49
- this.invalidCharacterList = null;
50
18
  this.isDirtyAddress = false;
51
19
  }
52
20
  getStripeAddressInstance() {
@@ -72,9 +40,6 @@ const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends
72
40
  stripeStore.stripeAddressEventData = event;
73
41
  break;
74
42
  }
75
- const invalidCharacterList = this.checkInvalidCharacters(event);
76
- this.invalidCharacterList = invalidCharacterList;
77
- this.invalidCharacters.emit(!!invalidCharacterList);
78
43
  }
79
44
  updateAddressElement({ stripeAddressElement, type, }) {
80
45
  if (type === 'shipping') {
@@ -83,47 +48,6 @@ const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends
83
48
  }
84
49
  stripeStore.stripeBillingAddressElement = stripeAddressElement;
85
50
  }
86
- checkInvalidCharacters(address) {
87
- // Do nothing if the allowed character sets is ALL or the address is incomplete
88
- if (!address.complete ||
89
- zonosStore.checkoutSettings.allowedCharacterSets === 'ALL') {
90
- return null;
91
- }
92
- const { address: addressValue, firstName, lastName, name } = address.value;
93
- const { city, country, line1, line2, postal_code, state } = addressValue;
94
- const invalidList = containsNonLatinChars({
95
- city,
96
- country,
97
- line1,
98
- line2: line2 || '',
99
- name: name || `${firstName} ${lastName}`,
100
- postal_code,
101
- state,
102
- });
103
- if (!Object.keys(invalidList).length) {
104
- return null;
105
- }
106
- // send error event only once so we know what value is invalid
107
- if (!this.reportedInvalidCharacters) {
108
- this.reportedInvalidCharacters = true;
109
- void sendErrorLog({
110
- endpoint: 'NonLatinInput',
111
- errors: Object.keys(invalidList).map(fieldName => {
112
- var _a;
113
- if (fieldName !== 'name') {
114
- // trim all number so we don't send sensitive information
115
- const trimmedAddress = (_a = addressValue[fieldName]) === null || _a === void 0 ? void 0 : _a.replace(/[\d\w]+/g, '');
116
- return `Invalid character found ${fieldName}: "${trimmedAddress}"`;
117
- }
118
- const customerName = name || `${firstName} ${lastName}`;
119
- const trimmedName = customerName.replace(/[\d\w]+/g, '');
120
- return `Invalid character found ${fieldName}: "${trimmedName}"`;
121
- }),
122
- metadata: {},
123
- });
124
- }
125
- return invalidList;
126
- }
127
51
  async watchInitStripe() {
128
52
  var _a, _b;
129
53
  this.stripe = window.Zonos.stripe;
@@ -211,17 +135,10 @@ const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends
211
135
  stripeAddressEventData.value.address.line1.length > 0;
212
136
  // @Watch doesn't get trigger on initial load
213
137
  void this.watchInitStripe();
214
- setTimeout(() => {
215
- // check if the address contains invalid characters after address is loaded
216
- const newStripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
217
- if (newStripeAddressEventData) {
218
- this.checkInvalidCharacters(newStripeAddressEventData);
219
- }
220
- }, 500);
221
138
  }
222
139
  render() {
223
140
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
224
- return (h(Host, { key: 'd5100d824d84c5e5b238f4877d489ca1b3f7b886', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '0fd51ddf9b08b4f62aa75a5f2e919d40e52f6fc3', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '3a53ec2a36e96639ec5437b928d4be4b84fb3aff', class: "zonos--address-component" }), this.invalidCharacterList && (h("zonos-banner", { key: '1141be407cff5b6741a40a06712a71e881d3a082', bannerTitle: translate('Please resolve the following errors:'), intent: "error" }, Object.keys(this.invalidCharacterList).map(fieldName => (h("zonos-text", null, `- ${translate(mappedFields[fieldName])}: ${translate('only supports Latin characters (A-Z, a-z)')}`)))))));
141
+ return (h(Host, { key: 'f45a7bbe9d6b5ffac15671a862b3ad4f2eb4a87b', class: "zonos--address zonos--elements" }, h("zonos-text", { key: 'a9119e6e0c4e5c81a7d17ebe4d6bec925404a3dd', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: '7dc12043c6e75ebabd646490c390bafdc2cd4a1d', class: "zonos--address-component" })));
225
142
  }
226
143
  get el() { return this; }
227
144
  static get watchers() { return {
@@ -233,8 +150,6 @@ const ZonosAddress = /*@__PURE__*/ proxyCustomElement(class ZonosAddress extends
233
150
  "titleText": [1, "title-text"],
234
151
  "defaultAddress": [16],
235
152
  "stripe": [32],
236
- "reportedInvalidCharacters": [32],
237
- "invalidCharacterList": [32],
238
153
  "isDirtyAddress": [32]
239
154
  }, undefined, {
240
155
  "stripe": ["watchInitStripe"]
@@ -243,18 +158,13 @@ function defineCustomElement() {
243
158
  if (typeof customElements === "undefined") {
244
159
  return;
245
160
  }
246
- const components = ["zonos-address", "zonos-banner", "zonos-text"];
161
+ const components = ["zonos-address", "zonos-text"];
247
162
  components.forEach(tagName => { switch (tagName) {
248
163
  case "zonos-address":
249
164
  if (!customElements.get(tagName)) {
250
165
  customElements.define(tagName, ZonosAddress);
251
166
  }
252
167
  break;
253
- case "zonos-banner":
254
- if (!customElements.get(tagName)) {
255
- defineCustomElement$2();
256
- }
257
- break;
258
168
  case "zonos-text":
259
169
  if (!customElements.get(tagName)) {
260
170
  defineCustomElement$1();