@zonos/elements 1.3.15-alpha.3 → 1.3.15

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 (373) hide show
  1. package/dist/cjs/RemoveIcon-6c79a2a1.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/{isDarkColor-f5473002.js → isDarkColor-01f45d3f.js} +1 -1
  8. package/dist/cjs/loader.cjs.js +2 -2
  9. package/dist/cjs/{submitGtag-ab287a34.js → submitGtag-fd8acad5.js} +21 -2
  10. package/dist/cjs/zonos-address_8.cjs.entry.js +642 -0
  11. package/dist/cjs/zonos-badge_2.cjs.entry.js +7 -7
  12. package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
  13. package/dist/cjs/{zonos-button_2.cjs.entry.js → zonos-button_3.cjs.entry.js} +53 -13
  14. package/dist/cjs/zonos-card_2.cjs.entry.js +10 -10
  15. package/dist/cjs/{zonos-cart-items_10.cjs.entry.js → zonos-cart-items_9.cjs.entry.js} +135 -109
  16. package/dist/cjs/zonos-checkout.cjs.entry.js +18 -17
  17. package/dist/cjs/zonos-component.cjs.entry.js +2 -2
  18. package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
  19. package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
  20. package/dist/cjs/zonos-country-select_3.cjs.entry.js +12 -12
  21. package/dist/cjs/zonos-elements.cjs.js +10 -10
  22. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +8 -8
  23. package/dist/cjs/zonos-hello.cjs.entry.js +5 -5
  24. package/dist/cjs/zonos-input.cjs.entry.js +57 -0
  25. package/dist/cjs/zonos-link.cjs.entry.js +2 -2
  26. package/dist/cjs/zonos-logo.cjs.entry.js +4 -4
  27. package/dist/cjs/zonos-notification.cjs.entry.js +4 -4
  28. package/dist/cjs/zonos-payment.cjs.entry.js +6 -6
  29. package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +6 -6
  30. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +7 -5
  31. package/dist/cjs/zonos-text.cjs.entry.js +3 -2
  32. package/dist/cjs/{zonosStore-aee974e0.js → zonosStore-d8bb0bda.js} +1 -1
  33. package/dist/collection/collection-manifest.json +5 -1
  34. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.css +62 -0
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.js +80 -0
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.css +59 -0
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +148 -0
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.css +115 -0
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +429 -0
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +1 -1
  41. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +5 -3
  42. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
  43. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +6 -4
  44. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +135 -20
  45. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +1 -1
  46. package/dist/collection/components/common/component-template/zonos-link/zonos-link.js +1 -1
  47. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  48. package/dist/collection/components/common/zonos-button/zonos-button.css +1 -0
  49. package/dist/collection/components/common/zonos-button/zonos-button.js +17 -8
  50. package/dist/collection/components/common/zonos-card/zonos-card.js +3 -3
  51. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.css +1 -0
  52. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +22 -4
  53. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
  54. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  55. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +2 -2
  56. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  57. package/dist/collection/components/common/zonos-dialog/zonos-dialog.css +3 -3
  58. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +6 -4
  59. package/dist/collection/components/common/zonos-input/zonos-input.css +176 -0
  60. package/dist/collection/components/common/zonos-input/zonos-input.js +193 -0
  61. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  62. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  63. package/dist/collection/components/common/zonos-notification/zonos-notification.js +2 -2
  64. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  65. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +4 -2
  66. package/dist/collection/components/common/zonos-text/zonos-text.js +1 -0
  67. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  68. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  69. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  70. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.css +7 -8
  71. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  72. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +3 -3
  73. package/dist/collection/components/main/zonos-controller.js +2 -2
  74. package/dist/collection/components/store/checkout/stripe.js +153 -14
  75. package/dist/collection/components/store/translationStore/strings.arabic.js +36 -6
  76. package/dist/collection/components/store/translationStore/strings.base.js +36 -6
  77. package/dist/collection/components/store/translationStore/strings.chinese.js +36 -6
  78. package/dist/collection/components/store/translationStore/strings.danish.js +36 -6
  79. package/dist/collection/components/store/translationStore/strings.dutch.js +36 -6
  80. package/dist/collection/components/store/translationStore/strings.french.js +36 -6
  81. package/dist/collection/components/store/translationStore/strings.german.js +36 -6
  82. package/dist/collection/components/store/translationStore/strings.hebrew.js +36 -6
  83. package/dist/collection/components/store/translationStore/strings.indonesian.js +36 -6
  84. package/dist/collection/components/store/translationStore/strings.italian.js +36 -6
  85. package/dist/collection/components/store/translationStore/strings.japanese.js +36 -6
  86. package/dist/collection/components/store/translationStore/strings.korean.js +36 -6
  87. package/dist/collection/components/store/translationStore/strings.norwegian.js +36 -6
  88. package/dist/collection/components/store/translationStore/strings.polish.js +36 -6
  89. package/dist/collection/components/store/translationStore/strings.portuguese.js +36 -6
  90. package/dist/collection/components/store/translationStore/strings.russian.js +36 -6
  91. package/dist/collection/components/store/translationStore/strings.spanish.js +36 -6
  92. package/dist/collection/components/store/translationStore/strings.swedish.js +36 -6
  93. package/dist/collection/components/store/translationStore/strings.turkish.js +36 -6
  94. package/dist/collection/components/store/translationStore/strings.vietnamese.js +36 -6
  95. package/dist/collection/components/stripe/zonos-address/zonos-address.js +3 -71
  96. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +29 -5
  97. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  98. package/dist/collection/components/utils/checkout/buildTranslateRequestBody.js +98 -0
  99. package/dist/collection/components/utils/containsNonLatinChars.js +10 -8
  100. package/dist/collection/components/utils/getBorderRadius.js +3 -5
  101. package/dist/collection/styles/stripe/defaultVariable.js +2 -2
  102. package/dist/collection/types/checkout/TranslatedText.js +1 -0
  103. package/dist/collection/types/checkout/api/ValidateAddressRequest.js +1 -0
  104. package/dist/components/containsNonLatinChars.js +21 -0
  105. package/dist/components/getBorderRadius.js +3 -5
  106. package/dist/components/stripe.js +255 -4545
  107. package/dist/components/trackConversionEvent.js +1 -1
  108. package/dist/components/translationStore.js +5131 -0
  109. package/dist/components/zonos-address-display.d.ts +11 -0
  110. package/dist/components/zonos-address-display.js +6 -0
  111. package/dist/components/zonos-address-display2.js +64 -0
  112. package/dist/components/zonos-address-form.d.ts +11 -0
  113. package/dist/components/zonos-address-form.js +6 -0
  114. package/dist/components/zonos-address-form2.js +84 -0
  115. package/dist/components/zonos-address-update-dialog.d.ts +11 -0
  116. package/dist/components/zonos-address-update-dialog.js +6 -0
  117. package/dist/components/zonos-address-update-dialog2.js +264 -0
  118. package/dist/components/zonos-address2.js +3 -93
  119. package/dist/components/zonos-badge2.js +3 -3
  120. package/dist/components/zonos-button2.js +18 -9
  121. package/dist/components/zonos-card2.js +3 -3
  122. package/dist/components/zonos-cart-items2.js +1 -1
  123. package/dist/components/zonos-cart-subtotal2.js +2 -1
  124. package/dist/components/zonos-checkbox2.js +15 -6
  125. package/dist/components/zonos-checkout-finish2.js +26 -6
  126. package/dist/components/zonos-checkout-footer2.js +2 -2
  127. package/dist/components/zonos-checkout-payment2.js +2 -1
  128. package/dist/components/zonos-checkout-progress-tabs2.js +5 -4
  129. package/dist/components/zonos-checkout.js +71 -41
  130. package/dist/components/zonos-collapse2.js +2 -2
  131. package/dist/components/zonos-component.js +1 -1
  132. package/dist/components/zonos-controller.js +2 -2
  133. package/dist/components/zonos-country-select2.js +2 -2
  134. package/dist/components/zonos-custom-message2.js +2 -2
  135. package/dist/components/zonos-customer-info2.js +170 -29
  136. package/dist/components/zonos-dialog2.js +7 -5
  137. package/dist/components/zonos-hello-dialog-footer2.js +3 -3
  138. package/dist/components/zonos-hello-dialog2.js +5 -4
  139. package/dist/components/zonos-hello.js +2 -1
  140. package/dist/components/zonos-input.d.ts +11 -0
  141. package/dist/components/zonos-input.js +6 -0
  142. package/dist/components/zonos-input2.js +78 -0
  143. package/dist/components/zonos-language-select2.js +4 -3
  144. package/dist/components/zonos-link-authentication2.js +12 -5
  145. package/dist/components/zonos-link.js +1 -1
  146. package/dist/components/zonos-logo.js +2 -2
  147. package/dist/components/zonos-notification2.js +2 -2
  148. package/dist/components/zonos-payment2.js +1 -1
  149. package/dist/components/zonos-review2.js +2 -1
  150. package/dist/components/zonos-select-dialog-header2.js +2 -2
  151. package/dist/components/zonos-shipping-rich-radio2.js +4 -2
  152. package/dist/components/zonos-shipping2.js +3 -2
  153. package/dist/components/zonos-text2.js +1 -0
  154. package/dist/components/zonos-tooltip2.js +2 -2
  155. package/dist/components/zonos-v-stack2.js +2 -2
  156. package/dist/esm/RemoveIcon-f6715b36.js +3 -0
  157. package/dist/esm/{cart-10bcd2e0.js → cart-462e89a6.js} +976 -139
  158. package/dist/esm/containsNonLatinChars-2d8810c3.js +21 -0
  159. package/dist/esm/{getBorderRadius-8129b0cb.js → getBorderRadius-567f1786.js} +4 -6
  160. package/dist/esm/index-e063389c.js +1328 -0
  161. package/dist/esm/isCheckoutMobile-8846dccb.js +6 -0
  162. package/dist/esm/{isDarkColor-7a6d2d14.js → isDarkColor-7f62035a.js} +1 -1
  163. package/dist/esm/loader.js +3 -3
  164. package/dist/esm/{submitGtag-84886899.js → submitGtag-ac7c3c89.js} +21 -3
  165. package/dist/esm/zonos-address_8.entry.js +631 -0
  166. package/dist/esm/zonos-badge_2.entry.js +7 -7
  167. package/dist/esm/zonos-banner.entry.js +2 -2
  168. package/dist/esm/{zonos-button_2.entry.js → zonos-button_3.entry.js} +53 -14
  169. package/dist/esm/zonos-card_2.entry.js +10 -10
  170. package/dist/esm/{zonos-cart-items_10.entry.js → zonos-cart-items_9.entry.js} +131 -104
  171. package/dist/esm/zonos-checkout.entry.js +13 -12
  172. package/dist/esm/zonos-component.entry.js +2 -2
  173. package/dist/esm/zonos-controller.entry.js +6 -6
  174. package/dist/esm/zonos-country-flag.entry.js +5 -5
  175. package/dist/esm/zonos-country-select_3.entry.js +12 -12
  176. package/dist/esm/zonos-elements.js +11 -11
  177. package/dist/esm/zonos-hello-dialog.entry.js +8 -8
  178. package/dist/esm/zonos-hello.entry.js +5 -5
  179. package/dist/esm/zonos-input.entry.js +53 -0
  180. package/dist/esm/zonos-link.entry.js +2 -2
  181. package/dist/esm/zonos-logo.entry.js +4 -4
  182. package/dist/esm/zonos-notification.entry.js +4 -4
  183. package/dist/esm/zonos-payment.entry.js +6 -6
  184. package/dist/esm/zonos-select-dialog-header_2.entry.js +6 -6
  185. package/dist/esm/zonos-shipping-rich-radio.entry.js +7 -5
  186. package/dist/esm/zonos-text.entry.js +3 -2
  187. package/dist/esm/{zonosStore-f3eef64b.js → zonosStore-33ff08ff.js} +1 -1
  188. package/dist/esm-es5/RemoveIcon-f6715b36.js +1 -0
  189. package/dist/esm-es5/cart-462e89a6.js +1 -0
  190. package/dist/esm-es5/containsNonLatinChars-2d8810c3.js +1 -0
  191. package/dist/esm-es5/getBorderRadius-567f1786.js +1 -0
  192. package/dist/esm-es5/index-e063389c.js +2 -0
  193. package/dist/esm-es5/isCheckoutMobile-8846dccb.js +1 -0
  194. package/dist/esm-es5/{isDarkColor-7a6d2d14.js → isDarkColor-7f62035a.js} +1 -1
  195. package/dist/esm-es5/loader.js +1 -1
  196. package/dist/esm-es5/submitGtag-ac7c3c89.js +1 -0
  197. package/dist/esm-es5/zonos-address_8.entry.js +1 -0
  198. package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
  199. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  200. package/dist/esm-es5/zonos-button_3.entry.js +1 -0
  201. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  202. package/dist/esm-es5/zonos-cart-items_9.entry.js +1 -0
  203. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  204. package/dist/esm-es5/zonos-component.entry.js +1 -1
  205. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  206. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  207. package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
  208. package/dist/esm-es5/zonos-elements.js +1 -1
  209. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  210. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  211. package/dist/esm-es5/zonos-input.entry.js +1 -0
  212. package/dist/esm-es5/zonos-link.entry.js +1 -1
  213. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  214. package/dist/esm-es5/zonos-notification.entry.js +1 -1
  215. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  216. package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
  217. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  218. package/dist/esm-es5/zonos-text.entry.js +1 -1
  219. package/dist/esm-es5/{zonosStore-f3eef64b.js → zonosStore-33ff08ff.js} +1 -1
  220. package/dist/scripts/loadStripe.js +1 -1
  221. package/dist/scripts/loadZonos.js +1 -1
  222. package/dist/scripts/stripe.js +1 -1
  223. package/dist/scripts/zonos.js +1 -1
  224. package/dist/scripts/zonosBase.js +1 -1
  225. package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.d.ts +12 -0
  226. package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.d.ts +28 -0
  227. package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.d.ts +96 -0
  228. package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +22 -2
  229. package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +1 -0
  230. package/dist/types/components/common/zonos-dialog/zonos-dialog.d.ts +0 -3
  231. package/dist/types/components/common/zonos-input/zonos-input.d.ts +35 -0
  232. package/dist/types/components/store/checkout/stripe.d.ts +25 -1
  233. package/dist/types/components/store/translationStore/strings.arabic.d.ts +35 -5
  234. package/dist/types/components/store/translationStore/strings.base.d.ts +35 -5
  235. package/dist/types/components/store/translationStore/strings.chinese.d.ts +35 -5
  236. package/dist/types/components/store/translationStore/strings.danish.d.ts +35 -5
  237. package/dist/types/components/store/translationStore/strings.dutch.d.ts +35 -5
  238. package/dist/types/components/store/translationStore/strings.french.d.ts +35 -5
  239. package/dist/types/components/store/translationStore/strings.german.d.ts +35 -5
  240. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +35 -5
  241. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +35 -5
  242. package/dist/types/components/store/translationStore/strings.italian.d.ts +35 -5
  243. package/dist/types/components/store/translationStore/strings.japanese.d.ts +35 -5
  244. package/dist/types/components/store/translationStore/strings.korean.d.ts +35 -5
  245. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +35 -5
  246. package/dist/types/components/store/translationStore/strings.polish.d.ts +35 -5
  247. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +35 -5
  248. package/dist/types/components/store/translationStore/strings.russian.d.ts +35 -5
  249. package/dist/types/components/store/translationStore/strings.spanish.d.ts +35 -5
  250. package/dist/types/components/store/translationStore/strings.swedish.d.ts +35 -5
  251. package/dist/types/components/store/translationStore/strings.turkish.d.ts +35 -5
  252. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +35 -5
  253. package/dist/types/components/store/translationStore.d.ts +1 -1
  254. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +2 -10
  255. package/dist/types/components/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +4 -0
  256. package/dist/types/components/utils/changeDeepProperty.d.ts +1 -1
  257. package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +1 -1
  258. package/dist/types/components/utils/checkout/buildTranslateRequestBody.d.ts +26 -0
  259. package/dist/types/components/utils/containsNonLatinChars.d.ts +1 -0
  260. package/dist/types/components/utils/getBorderRadius.d.ts +7 -1
  261. package/dist/types/components.d.ts +308 -6
  262. package/dist/types/types/checkout/TranslatedText.d.ts +23 -0
  263. package/dist/types/types/checkout/api/ValidateAddressRequest.d.ts +20 -0
  264. package/dist/types/types/generated/graphql.customer.types.d.ts +2 -0
  265. package/dist/types/types/generated/graphql.customer.types.ts +2 -0
  266. package/dist/zonos-elements/{p-593948b5.system.entry.js → p-029f11dd.system.entry.js} +1 -1
  267. package/dist/zonos-elements/{p-af8391bb.entry.js → p-094c0ee8.entry.js} +1 -1
  268. package/dist/zonos-elements/p-0c64dbbb.js +1 -0
  269. package/dist/zonos-elements/p-11504442.entry.js +1 -0
  270. package/dist/zonos-elements/p-11bef836.system.entry.js +1 -0
  271. package/dist/zonos-elements/{p-bc3a0f7c.entry.js → p-11f1b78c.entry.js} +1 -1
  272. package/dist/zonos-elements/p-13ddaf31.js +2 -0
  273. package/dist/zonos-elements/p-154aaf95.system.js +1 -0
  274. package/dist/zonos-elements/p-163ff5b5.system.js +2 -0
  275. package/dist/zonos-elements/{p-5ee8a685.entry.js → p-1e934274.entry.js} +1 -1
  276. package/dist/zonos-elements/p-20582e58.system.entry.js +1 -0
  277. package/dist/zonos-elements/{p-bfa8d9a4.system.entry.js → p-2439c82f.system.entry.js} +1 -1
  278. package/dist/zonos-elements/p-2670438c.system.js +1 -0
  279. package/dist/zonos-elements/p-321226b0.entry.js +1 -0
  280. package/dist/zonos-elements/{p-d149bc5d.system.entry.js → p-3221530d.system.entry.js} +1 -1
  281. package/dist/zonos-elements/{p-e9fafda6.entry.js → p-32d27535.entry.js} +1 -1
  282. package/dist/zonos-elements/p-3d10866d.entry.js +1 -0
  283. package/dist/zonos-elements/{p-1a5f8df7.entry.js → p-3d8667a7.entry.js} +1 -1
  284. package/dist/zonos-elements/p-3f05d130.system.entry.js +1 -0
  285. package/dist/zonos-elements/p-430eefd4.entry.js +1 -0
  286. package/dist/zonos-elements/{p-fc35d717.system.entry.js → p-49825866.system.entry.js} +1 -1
  287. package/dist/zonos-elements/p-5525b740.entry.js +1 -0
  288. package/dist/zonos-elements/p-578f0aad.system.js +1 -0
  289. package/dist/zonos-elements/{p-3e417d7c.entry.js → p-58a8ef6c.entry.js} +1 -1
  290. package/dist/zonos-elements/p-5d993965.js +1 -0
  291. package/dist/zonos-elements/{p-262b8e1e.system.entry.js → p-5f9c066d.system.entry.js} +1 -1
  292. package/dist/zonos-elements/{p-49120f0e.system.entry.js → p-60e262f0.system.entry.js} +1 -1
  293. package/dist/zonos-elements/p-64b594f4.js +1 -0
  294. package/dist/zonos-elements/{p-7891f8d2.entry.js → p-66471df6.entry.js} +1 -1
  295. package/dist/zonos-elements/{p-95c864ca.system.entry.js → p-679877b1.system.entry.js} +1 -1
  296. package/dist/zonos-elements/{p-fc4da55c.system.js → p-771fbeb3.system.js} +1 -1
  297. package/dist/zonos-elements/p-79f3c4f5.system.js +1 -0
  298. package/dist/zonos-elements/{p-e1ac5b2a.system.entry.js → p-80d78980.system.entry.js} +1 -1
  299. package/dist/zonos-elements/p-81a54668.js +1 -0
  300. package/dist/zonos-elements/p-83cc2936.js +1 -0
  301. package/dist/zonos-elements/{p-520e8e63.system.js → p-87badea9.system.js} +1 -1
  302. package/dist/zonos-elements/p-8a61a04f.system.entry.js +1 -0
  303. package/dist/zonos-elements/p-8b32f560.system.entry.js +1 -0
  304. package/dist/zonos-elements/{p-d01576d7.js → p-909a331c.js} +1 -1
  305. package/dist/zonos-elements/{p-031086ba.system.entry.js → p-94b15a5e.system.entry.js} +1 -1
  306. package/dist/zonos-elements/{p-9768840a.system.entry.js → p-9a45fae5.system.entry.js} +1 -1
  307. package/dist/zonos-elements/{p-24fee841.entry.js → p-9ec93319.entry.js} +1 -1
  308. package/dist/zonos-elements/p-a6d7ac46.js +1 -0
  309. package/dist/zonos-elements/{p-2a99c8b5.system.entry.js → p-a6eeb4bd.system.entry.js} +1 -1
  310. package/dist/zonos-elements/{p-1950dda7.entry.js → p-a93f2e84.entry.js} +1 -1
  311. package/dist/zonos-elements/p-aed0098c.system.js +1 -0
  312. package/dist/zonos-elements/{p-92446677.entry.js → p-b19d51e0.entry.js} +1 -1
  313. package/dist/zonos-elements/{p-46f9c93e.system.entry.js → p-b9652402.system.entry.js} +1 -1
  314. package/dist/zonos-elements/{p-d3772fd3.entry.js → p-baee62a4.entry.js} +1 -1
  315. package/dist/zonos-elements/{p-eff12c31.system.entry.js → p-bf32179a.system.entry.js} +1 -1
  316. package/dist/zonos-elements/p-cd1cc224.entry.js +1 -0
  317. package/dist/zonos-elements/{p-ae4a4634.system.entry.js → p-d1b63cec.system.entry.js} +1 -1
  318. package/dist/zonos-elements/p-d6b103d5.system.js +1 -0
  319. package/dist/zonos-elements/{p-376bdf70.entry.js → p-da6767d8.entry.js} +1 -1
  320. package/dist/zonos-elements/p-dde1383b.entry.js +1 -0
  321. package/dist/zonos-elements/p-df192668.system.js +1 -0
  322. package/dist/zonos-elements/{p-70ede197.system.entry.js → p-df24d548.system.entry.js} +1 -1
  323. package/dist/zonos-elements/{p-6743734f.entry.js → p-e7b4b756.entry.js} +1 -1
  324. package/dist/zonos-elements/{p-d41b5762.js → p-f1962041.js} +1 -1
  325. package/dist/zonos-elements/{p-a0abc499.system.entry.js → p-f3d3c754.system.entry.js} +1 -1
  326. package/dist/zonos-elements/p-f79682b5.entry.js +1 -0
  327. package/dist/zonos-elements/zonos-elements.css +3 -3
  328. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  329. package/dist/zonos-elements/zonos-elements.js +1 -1
  330. package/package.json +3 -2
  331. package/dist/cjs/index-3b4816ef.js +0 -2088
  332. package/dist/cjs/sendErrorLog-29e50f7e.js +0 -29
  333. package/dist/cjs/zonos-address_4.cjs.entry.js +0 -388
  334. package/dist/cjs/zonos-icon.cjs.entry.js +0 -39
  335. package/dist/components/sendErrorLog.js +0 -21
  336. package/dist/esm/index-0e31d804.js +0 -2055
  337. package/dist/esm/sendErrorLog-8642e94a.js +0 -26
  338. package/dist/esm/zonos-address_4.entry.js +0 -381
  339. package/dist/esm/zonos-icon.entry.js +0 -35
  340. package/dist/esm-es5/cart-10bcd2e0.js +0 -1
  341. package/dist/esm-es5/getBorderRadius-8129b0cb.js +0 -1
  342. package/dist/esm-es5/index-0e31d804.js +0 -2
  343. package/dist/esm-es5/sendErrorLog-8642e94a.js +0 -1
  344. package/dist/esm-es5/submitGtag-84886899.js +0 -1
  345. package/dist/esm-es5/zonos-address_4.entry.js +0 -1
  346. package/dist/esm-es5/zonos-button_2.entry.js +0 -1
  347. package/dist/esm-es5/zonos-cart-items_10.entry.js +0 -1
  348. package/dist/esm-es5/zonos-icon.entry.js +0 -1
  349. package/dist/scripts/insertTranslations.js +0 -1
  350. package/dist/zonos-elements/p-0253aeae.entry.js +0 -1
  351. package/dist/zonos-elements/p-1264b362.entry.js +0 -1
  352. package/dist/zonos-elements/p-2244534c.js +0 -2
  353. package/dist/zonos-elements/p-2825570c.system.js +0 -2
  354. package/dist/zonos-elements/p-33abdb30.js +0 -1
  355. package/dist/zonos-elements/p-450942a3.system.js +0 -1
  356. package/dist/zonos-elements/p-48a2b8b0.entry.js +0 -1
  357. package/dist/zonos-elements/p-5ca09163.entry.js +0 -1
  358. package/dist/zonos-elements/p-5ff27485.js +0 -1
  359. package/dist/zonos-elements/p-6d9dbecb.system.entry.js +0 -1
  360. package/dist/zonos-elements/p-6e8d43de.entry.js +0 -1
  361. package/dist/zonos-elements/p-6f5761e8.js +0 -1
  362. package/dist/zonos-elements/p-78d22069.system.entry.js +0 -1
  363. package/dist/zonos-elements/p-8b44e558.system.js +0 -1
  364. package/dist/zonos-elements/p-8bc0e56a.system.entry.js +0 -1
  365. package/dist/zonos-elements/p-9350d19f.entry.js +0 -1
  366. package/dist/zonos-elements/p-9e8f1065.system.entry.js +0 -1
  367. package/dist/zonos-elements/p-a6bbf6de.system.entry.js +0 -1
  368. package/dist/zonos-elements/p-b8e8330b.system.js +0 -1
  369. package/dist/zonos-elements/p-be022d8e.entry.js +0 -1
  370. package/dist/zonos-elements/p-c6170bec.system.js +0 -1
  371. package/dist/zonos-elements/p-e705c44c.entry.js +0 -1
  372. package/dist/zonos-elements/p-ed2e94d2.js +0 -1
  373. package/dist/zonos-elements/p-f4c38bfc.system.js +0 -1
@@ -0,0 +1,642 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-654a6001.js');
6
+ const cart = require('./cart-db549f04.js');
7
+ const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
8
+ const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
9
+ const zonosStore = require('./zonosStore-d8bb0bda.js');
10
+ const classes = require('./classes-b7918f56.js');
11
+ const RemoveIcon$1 = require('./RemoveIcon-6c79a2a1.js');
12
+ const getBorderRadius = require('./getBorderRadius-44b3eca1.js');
13
+ const isDarkColor = require('./isDarkColor-01f45d3f.js');
14
+
15
+ 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}";
16
+ const ZonosAddressStyle0 = zonosAddressCss;
17
+
18
+ const ZonosAddress = class {
19
+ constructor(hostRef) {
20
+ index.registerInstance(this, hostRef);
21
+ this.invalidCharacters = index.createEvent(this, "invalidCharacters", 7);
22
+ this.type = undefined;
23
+ this.titleText = undefined;
24
+ this.defaultAddress = null;
25
+ this.stripe = window.Zonos.stripe;
26
+ this.isDirtyAddress = false;
27
+ }
28
+ getStripeAddressInstance() {
29
+ if (this.type === 'billing') {
30
+ return {
31
+ stripeAddressElement: cart.stripeStore.stripeBillingAddressElement,
32
+ stripeAddressEventData: cart.stripeStore.stripeBillingAddressEventData,
33
+ stripeElements: cart.stripeStore.stripeElementsForBillingAddress,
34
+ };
35
+ }
36
+ return {
37
+ stripeAddressElement: cart.stripeStore.stripeAddressElement,
38
+ stripeAddressEventData: cart.stripeStore.stripeAddressEventData,
39
+ stripeElements: cart.stripeStore.stripeElements,
40
+ };
41
+ }
42
+ updateAddressEventData({ event, type, }) {
43
+ switch (type) {
44
+ case 'billing':
45
+ cart.stripeStore.stripeBillingAddressEventData = event;
46
+ break;
47
+ default:
48
+ cart.stripeStore.stripeAddressEventData = event;
49
+ break;
50
+ }
51
+ }
52
+ updateAddressElement({ stripeAddressElement, type, }) {
53
+ if (type === 'shipping') {
54
+ cart.stripeStore.stripeAddressElement = stripeAddressElement;
55
+ return;
56
+ }
57
+ cart.stripeStore.stripeBillingAddressElement = stripeAddressElement;
58
+ }
59
+ async watchInitStripe() {
60
+ var _a, _b;
61
+ this.stripe = window.Zonos.stripe;
62
+ const { stripeAddressEventData, stripeElements } = this.getStripeAddressInstance();
63
+ if (!this.stripe || !stripeElements) {
64
+ cart.logError("Stripe is not initialized. Couldn't load stripe element.");
65
+ return;
66
+ }
67
+ const phone = (_a = this.defaultAddress) === null || _a === void 0 ? void 0 : _a.phone;
68
+ if (!phone) {
69
+ // remove phone from default address if it's not provided, stripe
70
+ // will throw error if key phone exist and its value is empty or 'undefined'.
71
+ (_b = this.defaultAddress) === null || _b === void 0 ? true : delete _b.phone;
72
+ }
73
+ const shippableCountries = cart.localizationStore.shippingZoneCountries;
74
+ const shippingZone = shippableCountries
75
+ ? Object.values(shippableCountries).map(country => country.code)
76
+ : [];
77
+ const addressElement = stripeElements.create('address', {
78
+ allowedCountries: this.type === 'shipping' ? shippingZone : [],
79
+ // only show the default address if stripeAddressEventData is not provided
80
+ contacts: this.defaultAddress && !stripeAddressEventData
81
+ ? [this.defaultAddress]
82
+ : [],
83
+ defaultValues: {
84
+ address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
85
+ cart.localizationStore.selectedCountryCode ||
86
+ 'AL' }),
87
+ firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
88
+ lastName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName,
89
+ phone: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone,
90
+ },
91
+ display: {
92
+ name: 'split',
93
+ },
94
+ fields: {
95
+ phone: 'always',
96
+ },
97
+ mode: this.type,
98
+ validation: {
99
+ phone: {
100
+ required: 'always',
101
+ },
102
+ },
103
+ });
104
+ addressElement.mount(this.el.querySelector('.zonos--address-component'));
105
+ addressElement.on('change', event => {
106
+ const eventValue = event.value;
107
+ if (!this.isDirtyAddress && eventValue.address.line1.length >= 3) {
108
+ this.isDirtyAddress = true;
109
+ // stripe element started with just address line 1, so scroll bar is not yet available. Wait for a moment before scrolling
110
+ setTimeout(() => {
111
+ // scroll directly into view if it's mobile
112
+ if (isCheckoutMobile.isCheckoutMobile()) {
113
+ this.el.scrollIntoView({ behavior: 'smooth', block: 'end' });
114
+ }
115
+ else {
116
+ // scroll into the end of the page so the address placeholder won't be hidden
117
+ const yOffset = this.type === 'shipping' ? 100 : 600;
118
+ const parentWrapper = this.el.closest('.zonos--group');
119
+ const y = this.el.getBoundingClientRect().top + yOffset;
120
+ parentWrapper === null || parentWrapper === void 0 ? void 0 : parentWrapper.scrollTo({ behavior: 'smooth', top: y });
121
+ }
122
+ }, 600);
123
+ }
124
+ this.updateAddressEventData({
125
+ event: Object.assign(Object.assign({}, event), { elementMode: this.type, elementType: 'address', value: Object.assign(Object.assign({}, eventValue), { firstName: eventValue.firstName || eventValue.name.split(' ')[0], lastName: eventValue.lastName || eventValue.name.split(' ')[1] }) }),
126
+ type: this.type,
127
+ });
128
+ });
129
+ this.updateAddressElement({
130
+ stripeAddressElement: addressElement,
131
+ type: this.type,
132
+ });
133
+ }
134
+ disconnectedCallback() {
135
+ // destroy the stripe element when this component is removed from the DOM, so that we can re-create the new one with previous value
136
+ const stripeElement = this.getStripeAddressInstance().stripeAddressElement;
137
+ stripeElement === null || stripeElement === void 0 ? void 0 : stripeElement.destroy();
138
+ }
139
+ componentDidLoad() {
140
+ const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
141
+ this.isDirtyAddress =
142
+ !!stripeAddressEventData &&
143
+ stripeAddressEventData.value.address.line1.length > 0;
144
+ // @Watch doesn't get trigger on initial load
145
+ void this.watchInitStripe();
146
+ }
147
+ render() {
148
+ // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
149
+ return (index.h(index.Host, { key: 'f45a7bbe9d6b5ffac15671a862b3ad4f2eb4a87b', class: "zonos--address zonos--elements" }, index.h("zonos-text", { key: 'a9119e6e0c4e5c81a7d17ebe4d6bec925404a3dd', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), index.h("div", { key: '7dc12043c6e75ebabd646490c390bafdc2cd4a1d', class: "zonos--address-component" })));
150
+ }
151
+ get el() { return index.getElement(this); }
152
+ static get watchers() { return {
153
+ "stripe": ["watchInitStripe"]
154
+ }; }
155
+ };
156
+ ZonosAddress.style = ZonosAddressStyle0;
157
+
158
+ 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(--amino-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(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}";
159
+ const ZonosAddressDisplayStyle0 = zonosAddressDisplayCss;
160
+
161
+ const ZonosAddressDisplay = class {
162
+ constructor(hostRef) {
163
+ index.registerInstance(this, hostRef);
164
+ this.currentAddress = undefined;
165
+ this.addressType = undefined;
166
+ }
167
+ render() {
168
+ var _a;
169
+ const { city, country, email, line1, line2, name, phone, postal_code, state, } = this.currentAddress;
170
+ const shippingZoneCountry = (_a = cart.localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[country];
171
+ const renderEnteredInfoText = ({ bold, content, }) => {
172
+ const textColor = containsNonLatinChars.isTextContainsNonLatinChars(content)
173
+ ? 'red-600'
174
+ : 'gray-1200';
175
+ return (index.h("zonos-text", { textColor: textColor, type: bold ? 'boldLabel' : 'body' }, content));
176
+ };
177
+ return (index.h(index.Host, { class: "zonos--address-form zonos--elements" }, index.h("div", { class: "zonos--title" }, index.h("zonos-text", { textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
178
+ ? cart.translate('Shipping')
179
+ : cart.translate('Billing'))), index.h("div", { class: "zonos--address-group" }, name && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ bold: true, content: name }))), email && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: email }))), phone && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: phone }))), line1 && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: line1 }))), line2 && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: line2 }))), index.h("div", { class: "zonos--address-line" }, city && renderEnteredInfoText({ content: city }), state && renderEnteredInfoText({ content: state }), postal_code && renderEnteredInfoText({ content: postal_code })), shippingZoneCountry && (index.h("div", { class: "zonos--address-line" }, index.h("zonos-country-flag", { class: "zonos--country-flag", countryCode: shippingZoneCountry.code }), ' ', renderEnteredInfoText({
180
+ content: shippingZoneCountry.displayName,
181
+ }))))));
182
+ }
183
+ };
184
+ ZonosAddressDisplay.style = ZonosAddressDisplayStyle0;
185
+
186
+ 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}";
187
+ const ZonosAddressFormStyle0 = zonosAddressFormCss;
188
+
189
+ const ZonosAddressForm = class {
190
+ constructor(hostRef) {
191
+ index.registerInstance(this, hostRef);
192
+ this.addressChange = index.createEvent(this, "addressChange", 7);
193
+ this.onInputChange = ({ key, value, }) => {
194
+ this.addressChange.emit(Object.assign(Object.assign({}, this.localAddress), { [key]: value }));
195
+ };
196
+ this.currentAddress = undefined;
197
+ this.translatedAddress = undefined;
198
+ this.addressType = undefined;
199
+ this.localAddress = this.currentAddress;
200
+ }
201
+ watchCurrentAddress() {
202
+ var _a, _b, _c, _d, _e, _f;
203
+ const { city, line1, line2, name, postal_code, state } = this.currentAddress;
204
+ // Update the local address when the current address changes
205
+ // If translated address is available, use that instead
206
+ 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 });
207
+ }
208
+ componentWillLoad() {
209
+ this.watchCurrentAddress();
210
+ }
211
+ render() {
212
+ const { city, country, line1, line2, name, phone, postal_code, state } = this.localAddress;
213
+ const firstName = name.split(' ')[0] || '';
214
+ const lastName = name.split(' ')[1] || '';
215
+ return (index.h(index.Host, { key: '9c1ee87200d1f90e9dfac58c49aabba1777373a9', class: "zonos--address-form zonos--elements" }, index.h("div", { key: 'eec3416268ff2324fd751408552705086905423d', class: "zonos--title" }, index.h("zonos-text", { key: 'a4c254f78420dcfc712e1a83b20dd3ac9e64c460', textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
216
+ ? cart.translate('Shipping')
217
+ : cart.translate('Billing'))), index.h("div", { key: 'b8109545d282fb8c06a2e791c30088018d6ffec0', class: "zonos--address-group" }, index.h("div", { key: '833a395984cd75242e5d97697fd6566f11932d1b', class: "zonos--contact" }, index.h("zonos-text", { key: 'e60f574e95162aabf6465b878fc9b16c708e8029', type: "label" }, cart.translate('Contact')), index.h("zonos-input", { key: '24cd24a362a1bbc76d0c91718c48ae32baa20ae6', class: "zonos--form-email", inputLabel: cart.translate('Email'), inputValue: this.currentAddress.email, isDisabled: true }), index.h("div", { key: '84e64ef44eb3b39ac7ab542e07d7a52a95377cae', class: "zonos--name zonos--address-row" }, index.h("zonos-input", { key: '26621aca0d57a7fee743874b8d11af5f58c91b69', class: "zonos--form-first-name", inputLabel: cart.translate('First name'), inputValue: firstName, isError: containsNonLatinChars.isTextContainsNonLatinChars(firstName), onInputChange: e => this.onInputChange({
218
+ key: 'name',
219
+ value: `${e.detail} ${lastName}`,
220
+ }) }), index.h("zonos-input", { key: '01e3e5038b4a4311dd5874a1213f936451dc300d', class: "zonos--form-last-name", inputLabel: cart.translate('Last name'), inputValue: lastName, isError: containsNonLatinChars.isTextContainsNonLatinChars(lastName), onInputChange: e => this.onInputChange({
221
+ key: 'name',
222
+ value: `${firstName} ${e.detail}`,
223
+ }) }))), index.h("div", { key: 'eb42dece28082ff16a453110b3208de5b44b9fdb', class: "zonos--address" }, index.h("zonos-text", { key: '3557122c716533be7b36a8bd395ea616a7061665', type: "label" }, cart.translate('Address')), index.h("zonos-input", { key: 'bcc7d84d530f2f3a10537117eb6ef143df7cc8e2', class: "zonos--form-country", inputLabel: cart.translate('Country'), inputValue: country, isDisabled: true }), index.h("zonos-input", { key: '6ce78e25151a129b69b501cf768604134a395e85', class: "zonos--form-line1", inputLabel: cart.translate('Address line 1'), inputValue: line1, isError: containsNonLatinChars.isTextContainsNonLatinChars(line1), onInputChange: e => this.onInputChange({ key: 'line1', value: e.detail }) }), index.h("zonos-input", { key: '6f7a18010e2d8131327154a31ba58544df56768c', class: "zonos--form-line2", inputLabel: cart.translate('Address line 2'), inputValue: line2, isError: containsNonLatinChars.isTextContainsNonLatinChars(line2), onInputChange: e => this.onInputChange({ key: 'line2', value: e.detail }) }), index.h("div", { key: '48afbf7a3cbd26fddfea4f2799005a51b1c3d3c6', class: "zonos--address-row" }, index.h("zonos-input", { key: '6decf8c430d8d25b2c555b110009da74e0ac9e5f', class: "zonos--form-city", inputLabel: cart.translate('City'), inputValue: city, isError: containsNonLatinChars.isTextContainsNonLatinChars(city), onInputChange: e => this.onInputChange({ key: 'city', value: e.detail }) }), index.h("zonos-input", { key: '065e1be213d3cfec7749ab32890f96b0b484a25a', class: "zonos--form-state", inputLabel: cart.translate('State/Province'), inputValue: state, isError: containsNonLatinChars.isTextContainsNonLatinChars(state), onInputChange: e => this.onInputChange({ key: 'state', value: e.detail }) })), index.h("zonos-input", { key: 'a69244bf84c9fd007c9ad4aad2b6cc6d44420775', class: "zonos--form-postal-code", inputLabel: cart.translate('Postal code'), inputValue: postal_code, isError: containsNonLatinChars.isTextContainsNonLatinChars(postal_code), onInputChange: e => this.onInputChange({ key: 'postal_code', value: e.detail }) }), index.h("zonos-input", { key: '0bcc89de1ecc4aae8a69d74eff42dfd117ada40b', class: "zonos--form-phone", inputLabel: cart.translate('Phone number'), inputValue: phone, onInputChange: e => this.onInputChange({ key: 'phone', value: e.detail }) })))));
224
+ }
225
+ static get watchers() { return {
226
+ "translatedAddress": ["watchCurrentAddress"]
227
+ }; }
228
+ };
229
+ ZonosAddressForm.style = ZonosAddressFormStyle0;
230
+
231
+ 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(--amino-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(--amino-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(--amino-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}";
232
+ const ZonosAddressUpdateDialogStyle0 = zonosAddressUpdateDialogCss;
233
+
234
+ const ZonosAddressUpdateDialog = class {
235
+ constructor(hostRef) {
236
+ index.registerInstance(this, hostRef);
237
+ this.closeDialog = index.createEvent(this, "closeDialog", 7);
238
+ this.continueClicked = index.createEvent(this, "continueClicked", 7);
239
+ /**
240
+ * handler for close button click
241
+ */
242
+ this.closeDialogHandler = () => {
243
+ this.closeDialog.emit();
244
+ };
245
+ /**
246
+ * Extract value from translated object
247
+ */
248
+ this.getTranslatedAddress = ({ currentAddress, translatedAddress, }) => {
249
+ var _a, _b, _c, _d, _e, _f;
250
+ const { city, line1, line2, name, postal_code, state } = currentAddress;
251
+ return {
252
+ city: ((_a = translatedAddress.city) === null || _a === void 0 ? void 0 : _a[city]) || city,
253
+ line1: ((_b = translatedAddress.line1) === null || _b === void 0 ? void 0 : _b[line1]) || line1,
254
+ line2: ((_c = translatedAddress.line2) === null || _c === void 0 ? void 0 : _c[line2]) || line2,
255
+ name: ((_d = translatedAddress.name) === null || _d === void 0 ? void 0 : _d[name]) || name,
256
+ postal_code: ((_e = translatedAddress.postal_code) === null || _e === void 0 ? void 0 : _e[postal_code]) || postal_code,
257
+ state: ((_f = translatedAddress.state) === null || _f === void 0 ? void 0 : _f[state]) || state,
258
+ };
259
+ };
260
+ /**
261
+ * handler for continue button click
262
+ */
263
+ this.continueClickHandler = async () => {
264
+ var _a, _b, _c;
265
+ // set spinner for the continue button
266
+ this.continueLoading = true;
267
+ const translatedBillingAddress = this.billingAddress
268
+ ? this.getTranslatedAddress({
269
+ currentAddress: this.billingAddress,
270
+ translatedAddress: this.translatedBillingAddressState,
271
+ })
272
+ : null;
273
+ const translatedShippingAddress = this.getTranslatedAddress({
274
+ currentAddress: this.shippingAddress,
275
+ translatedAddress: this.translatedShippingAddressState,
276
+ });
277
+ // check to see if there are still non-latin characters in the translated address
278
+ const shippingNonlatinChars = containsNonLatinChars.containsNonLatinChars(Object.assign(Object.assign({}, translatedShippingAddress), { country: this.shippingAddress.country }));
279
+ // get list of non-latin characters field in the billing address
280
+ const billingNonLatinChars = translatedBillingAddress &&
281
+ this.billingAddress &&
282
+ containsNonLatinChars.containsNonLatinChars(Object.assign(Object.assign({}, translatedBillingAddress), { country: this.billingAddress.country }));
283
+ const shippingHasNonLatinChars = !!Object.keys(shippingNonlatinChars)
284
+ .length;
285
+ const billingHasNonLatinChars = !!billingNonLatinChars && !!Object.keys(billingNonLatinChars).length;
286
+ // if there are non-latin characters in the translated address, scroll to the error input so user can see and fix it
287
+ if (shippingHasNonLatinChars || billingHasNonLatinChars) {
288
+ // get scroll top of the first input has "has-error" class
289
+ const addressForms = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('zonos-address-form');
290
+ const shippingAddressForm = addressForms === null || addressForms === void 0 ? void 0 : addressForms[0];
291
+ const billingAddressForm = addressForms === null || addressForms === void 0 ? void 0 : addressForms[1];
292
+ const errorInput = ((_b = shippingAddressForm === null || shippingAddressForm === void 0 ? void 0 : shippingAddressForm.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('.has-error')) ||
293
+ ((_c = billingAddressForm === null || billingAddressForm === void 0 ? void 0 : billingAddressForm.shadowRoot) === null || _c === void 0 ? void 0 : _c.querySelector('.has-error'));
294
+ // scroll to the first error input
295
+ if (errorInput) {
296
+ errorInput.scrollIntoView({ behavior: 'smooth', block: 'center' });
297
+ }
298
+ this.continueLoading = false;
299
+ return;
300
+ }
301
+ // Submit the translated address to the parent component
302
+ this.continueClicked.emit({
303
+ billingAddress: translatedBillingAddress,
304
+ shippingAddress: translatedShippingAddress,
305
+ });
306
+ };
307
+ /**
308
+ * This function builds a state object for a translated address.
309
+ * It takes the current and translated address as input and returns an object where each field is an object itself.
310
+ * 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.
311
+ *
312
+ * @param {Object} params - The parameters for the function.
313
+ * @param {EnteredInfo} params.currentAddress - The current address information.
314
+ * @param {EnteredInfo} params.translatedAddress - The translated address information.
315
+ *
316
+ */
317
+ this.buildTranslateAddressState = ({ currentAddress, translatedAddress, }) => {
318
+ const { city, line1, line2, name, postal_code, state } = currentAddress;
319
+ return {
320
+ city: {
321
+ [city]: translatedAddress.city,
322
+ },
323
+ line1: {
324
+ [line1]: translatedAddress.line1,
325
+ },
326
+ line2: {
327
+ [line2]: translatedAddress.line2,
328
+ },
329
+ name: {
330
+ [name]: translatedAddress.name,
331
+ },
332
+ postal_code: {
333
+ [postal_code]: translatedAddress.postal_code,
334
+ },
335
+ state: {
336
+ [state]: translatedAddress.state,
337
+ },
338
+ };
339
+ };
340
+ this.continueLoading = false;
341
+ this.dialogLoading = undefined;
342
+ this.dialogOpen = false;
343
+ this.submitBtnType = undefined;
344
+ this.submitBtnColor = undefined;
345
+ this.isMobile = false;
346
+ this.shippingAddress = undefined;
347
+ this.billingAddress = undefined;
348
+ this.translatedShippingAddress = undefined;
349
+ this.translatedBillingAddress = undefined;
350
+ this.showErrorBanner = false;
351
+ this.translatedShippingAddressState = {};
352
+ this.translatedBillingAddressState = {};
353
+ }
354
+ watchTranslatedShippingAddress() {
355
+ this.translatedShippingAddressState = this.translatedShippingAddress;
356
+ }
357
+ watchTranslatedBillingAddress() {
358
+ this.translatedBillingAddressState = this.translatedBillingAddress;
359
+ }
360
+ componentWillLoad() {
361
+ // update the state with the initial props
362
+ this.watchTranslatedBillingAddress();
363
+ this.watchTranslatedShippingAddress();
364
+ }
365
+ render() {
366
+ // dialog background white, so when the button background is also white, we need to change the button type to outline so it's visible
367
+ const submitBtnColor = this.submitBtnColor || zonosStore.zonosStore.appearance.colorSecondary;
368
+ const submitBtnType = submitBtnColor === '#ffffff'
369
+ ? 'outline'
370
+ : this.submitBtnType || 'standard';
371
+ const billing = this.billingAddress;
372
+ const shipping = this.shippingAddress;
373
+ return (index.h(index.Host, { key: '03535edacb348258592641baa349e9dcf14bf78c', class: classes.classes([
374
+ 'zonos--address-update-dialog zonos--elements',
375
+ this.isMobile && 'mobile',
376
+ ]) }, index.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" }, index.h("div", { key: 'e4fad501f7cfedc5783774d8b1bf785d6947d3c8', class: "zonos--body" }, index.h("div", { key: '973e7a8097b8c8f60e47e6ad9d8311a64a5a6ff0', class: "zonos--dialog-header" }, index.h("div", { key: '89c82b6ff3723056d161560da22bd16a992afee7', class: "zonos--dialog-title" }, index.h("zonos-text", { key: 'bf92ef0b40ea67a492164fedb95dd68b7d023e85', type: "title" }, cart.translate('Update your address')), index.h("zonos-button", { key: '4e7a1905c976cec396db5c34f633b383bba0d55a', class: "zonos--close-button", icon: index.h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon$1.RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() })), index.h("zonos-text", { key: '47b42d8cc14c4757e3fc9f2f43eafbd8d9e9df38' }, cart.translate('To ensure delivery all address details must be in Latin characters.'))), index.h("div", { key: '28d9804f0a18f143ce541c2c511cbfa21a2a416f', class: "zonos--group" }, index.h("zonos-text", { key: '43ec5a9fc8594d065b256952ca8e9392fba03839', class: "zonos--what-you-entered", type: "semiBoldLabel" }, cart.translate('What you entered')), index.h("div", { key: 'b7eb7781ce6aefe20f89b4d5fba190f0102eb5d1', class: "zonos--address-display-group" }, index.h("zonos-address-display", { key: '152c53176a46575677723ca47386e484c659927a', addressType: "shipping", currentAddress: shipping }), billing && (index.h("zonos-address-display", { key: '6c7ac2b49d121c26ce45f09a1eac9ef456d45910', addressType: "billing", currentAddress: billing }))), index.h("div", { key: '2bda98bb0ac9bafcb009ff36fb97a9fc62ce7e2d', class: "zonos--address-form-section" }, index.h("zonos-text", { key: '87d3380072a049ccde71ba1b752aedd36830348b', type: "semiBoldLabel" }, cart.translate('Translated address')), index.h("zonos-address-form", { key: '2cb36251c6549da05e272183b2c37478b4166fea', addressType: "shipping", class: "zonos--shipping-address-form", currentAddress: shipping, onAddressChange: e => {
377
+ const address = e.detail;
378
+ this.translatedShippingAddressState =
379
+ this.buildTranslateAddressState({
380
+ currentAddress: shipping,
381
+ translatedAddress: address,
382
+ });
383
+ }, translatedAddress: this.translatedShippingAddressState }), billing && (index.h("zonos-address-form", { key: '9bf5ebd6fb08851716a72c855451bfeb3ee0ed68', addressType: "billing", class: "zonos--billing-address-form", currentAddress: billing, onAddressChange: e => {
384
+ const address = e.detail;
385
+ this.translatedBillingAddressState =
386
+ this.buildTranslateAddressState({
387
+ currentAddress: billing,
388
+ translatedAddress: address,
389
+ });
390
+ }, translatedAddress: this.translatedBillingAddressState })))), index.h("div", { key: '621df9c8919973b37c62aca5727bde3635086a6b', class: "zonos--group-btn" }, index.h("div", { key: '95e9fd31418abc8e89ceef24af7cc251ee45ac93', class: "zonos--button-wrapper" }, index.h("zonos-button", { key: 'bef31fc81e7cc0f2b3f7ab875a29978b07865b6a', class: "zonos--cancel-btn", onClick: () => this.closeDialogHandler(), variant: "subtle" }, cart.translate('Cancel')), index.h("zonos-button", { key: '9d183153541766b421c3420681c1159ffa599682', backgroundColor: this.submitBtnColor, class: "zonos--update-btn", loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "sm", variant: submitBtnType }, cart.translate('Update address'))))))));
391
+ }
392
+ get el() { return index.getElement(this); }
393
+ static get watchers() { return {
394
+ "translatedShippingAddress": ["watchTranslatedShippingAddress"],
395
+ "translatedBillingAddress": ["watchTranslatedBillingAddress"]
396
+ }; }
397
+ };
398
+ ZonosAddressUpdateDialog.style = ZonosAddressUpdateDialogStyle0;
399
+
400
+ const colorPrefixes = [
401
+ 'blue',
402
+ 'cyan',
403
+ 'green',
404
+ 'orange',
405
+ 'purple',
406
+ 'red',
407
+ 'gray',
408
+ 'glass',
409
+ ];
410
+
411
+ const zonosCheckboxCss = ":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{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--size);width:var(--size);background-color:transparent;border:1.5px solid var(--amino-gray-400);position:relative;border-radius:var(--border-radius, var(--amino-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--background-color);border-radius:var(--border-radius, var(--amino-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";
412
+ const ZonosCheckboxStyle0 = zonosCheckboxCss;
413
+
414
+ const ZonosCheckbox = class {
415
+ constructor(hostRef) {
416
+ index.registerInstance(this, hostRef);
417
+ this.checkboxSelected = index.createEvent(this, "checkboxSelected", 7);
418
+ this.backgroundColor = 'blue';
419
+ this.label = undefined;
420
+ this.isChecked = false;
421
+ this.isDisabled = false;
422
+ this.size = 12;
423
+ this.fontSize = 'base';
424
+ this.borderStyle = undefined;
425
+ }
426
+ onClick() {
427
+ if (this.isDisabled) {
428
+ return;
429
+ }
430
+ this.checkboxSelected.emit(!this.isChecked);
431
+ }
432
+ render() {
433
+ const isBackgroundVariable = colorPrefixes.includes(this.backgroundColor);
434
+ const backgroundColor = isBackgroundVariable
435
+ ? `var(--amino-${this.backgroundColor}-600)`
436
+ : this.backgroundColor;
437
+ const checkmarkColor = isBackgroundVariable
438
+ ? // use lighter color if the color is amino variable
439
+ `var(--amino-${this.backgroundColor}-200)`
440
+ : // if it's not an amino variable, use white if the background is dark, and dark if the background is light
441
+ !isDarkColor.isDarkColor(backgroundColor)
442
+ ? 'var(--amino-gray-800)'
443
+ : 'var(--amino-gray-0)';
444
+ const borderStyle = getBorderRadius.getBorderRadius({
445
+ customRoundRadius: '4px',
446
+ overrideBorderStyle: this.borderStyle,
447
+ });
448
+ return (index.h(index.Host, { key: '8a3d5f66a7fb956dcb063f1b375bfb80856a80c4', class: classes.classes(['zonos--elements zonos--checkbox']), style: {
449
+ '--background-color': backgroundColor,
450
+ '--border-radius': borderStyle,
451
+ '--font-family': zonosStore.zonosStoreFontFamily(),
452
+ '--size': `${this.size}px`,
453
+ } }, index.h("label", { key: '95dc70a3821652e588706b570b40272a5f124b7f', class: classes.classes([this.isDisabled && 'disabled']) }, index.h("input", { key: 'ef61adbd2246fbb934a17b31ea62cd5ce4ff88f7', checked: this.isChecked, disabled: this.isDisabled, hidden: true, onChange: e => {
454
+ this.checkboxSelected.emit(e.target.checked);
455
+ }, type: "checkbox" }), index.h("span", { key: '0587bf8dc5ee1477d91360e20d521efd9853c554', class: "checkmark-container" }, index.h("svg", { key: '3b7abf05f170aa2c4a31f76763c79ce975a543bc', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '7d16a3850fbdca9fd3af7fa1f64a1715497b9c7b', "clip-rule": "evenodd", d: "M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z", fill: "currentColor", "fill-rule": "evenodd" }))), this.label && (index.h("zonos-text", { key: '305600e6860aeba8dfa0f3019d51d1bf91498310', size: this.fontSize }, this.label)))));
456
+ }
457
+ };
458
+ ZonosCheckbox.style = ZonosCheckboxStyle0;
459
+
460
+ const zonosCollapseCss = ":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{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";
461
+ const ZonosCollapseStyle0 = zonosCollapseCss;
462
+
463
+ const ZonosCollapse = class {
464
+ constructor(hostRef) {
465
+ index.registerInstance(this, hostRef);
466
+ this.collapsed = false;
467
+ this.collapseSize = 0;
468
+ this.height = this.el.scrollHeight;
469
+ this.iframe = null;
470
+ }
471
+ getElementHeight() {
472
+ const fullHeight = `${this.height}px`;
473
+ const collapsedHeight = `${this.collapseSize}px`;
474
+ return this.collapsed ? collapsedHeight : fullHeight;
475
+ }
476
+ componentDidLoad() {
477
+ this.height = this.el.scrollHeight;
478
+ }
479
+ componentDidRender() {
480
+ var _a, _b, _c;
481
+ this.iframe =
482
+ ((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('iframe')) || null;
483
+ (_c = (_b = this.iframe) === null || _b === void 0 ? void 0 : _b.contentWindow) === null || _c === void 0 ? void 0 : _c.addEventListener('resize', () => {
484
+ if (!this.iframe) {
485
+ // this should never happen since it's inside of resize callback
486
+ return;
487
+ }
488
+ this.height = parseFloat(getComputedStyle(this.iframe).height);
489
+ });
490
+ }
491
+ render() {
492
+ if (!this.collapsed) {
493
+ // wait for the collapse animation to finish, then set overflow to visible
494
+ setTimeout(() => {
495
+ // if the element collapsed state is still not changed, set overflow to visible
496
+ if (!this.collapsed) {
497
+ this.el.style.overflow = 'visible';
498
+ }
499
+ }, 300);
500
+ }
501
+ else {
502
+ // set overflow to hidden to prevent content from showing when collapsed
503
+ this.el.style.overflow = 'hidden';
504
+ }
505
+ return (index.h(index.Host, { key: '514e75d41d29d70b4ca60230288ae183200b1e12', class: 'zonos--elements zonos--collapse', style: {
506
+ '--font-family': zonosStore.zonosStoreFontFamily(),
507
+ height: this.getElementHeight(),
508
+ } }, index.h("div", { key: '068aee1d13bde4c83ea8582b34844da7452c907c' }, index.h("iframe", { key: 'b22fd8ad898a098c244cb817dc6951854505efca', class: "height-change-listener", tabindex: "-1", title: "collapse-height-change-listener" }), index.h("slot", { key: 'b54783376005085e379c7b8d43218ead1bf8e8ac' }))));
509
+ }
510
+ get el() { return index.getElement(this); }
511
+ };
512
+ ZonosCollapse.style = ZonosCollapseStyle0;
513
+
514
+ const RemoveIcon = `<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-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" clip-rule="evenodd"/><path fill="#4D505A" fill-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" clip-rule="evenodd"/></svg>`;
515
+
516
+ const zonosDialogCss = ":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--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--amino-backdrop-color);z-index:-999;opacity:0;visibility:hidden;position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;z-index:10002;background:var(--amino-gray-0);border-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--amino-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:10001;background:var(--amino-gray-0);max-width:90vw;max-height:90vh;min-height:500px;height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--amino-radius-10));outline:none;-webkit-box-shadow:var(--amino-v3-shadow-xxl);box-shadow:var(--amino-v3-shadow-xxl);border:var(--amino-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--amino-size-md);height:var(--amino-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--amino-radius-10)}:host .zonos--header .zonos--close-button:hover{background:var(--amino-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:10001;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:10002;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";
517
+ const ZonosDialogStyle0 = zonosDialogCss;
518
+
519
+ const ZonosDialog = class {
520
+ constructor(hostRef) {
521
+ index.registerInstance(this, hostRef);
522
+ this.closeDialog = index.createEvent(this, "closeDialog", 7);
523
+ this.isMobileMode = () => {
524
+ return this.mobile || window.innerWidth <= 768;
525
+ };
526
+ this.closeButtonHandler = () => {
527
+ this.closeDialog.emit();
528
+ };
529
+ this.clickOutsideDialogHandler = (event) => {
530
+ if (event.target === event.currentTarget && !this.noClickOutside) {
531
+ this.closeDialog.emit();
532
+ }
533
+ };
534
+ this.open = false;
535
+ this.headerText = '';
536
+ this.width = '460px';
537
+ this.height = undefined;
538
+ this.noHeader = false;
539
+ this.noBodyPadding = false;
540
+ this.noBorder = false;
541
+ this.borderStyle = undefined;
542
+ this.noCloseButton = false;
543
+ this.noClickOutside = false;
544
+ this.mobile = false;
545
+ this.isLoading = true;
546
+ this.isMobile = false;
547
+ }
548
+ handleWindowResize() {
549
+ this.isMobile = this.isMobileMode();
550
+ }
551
+ componentDidLoad() {
552
+ this.isMobile = this.isMobileMode();
553
+ }
554
+ render() {
555
+ // disable scroll on the body when dialog is open
556
+ if (this.open) {
557
+ document.body.style.overflow = 'hidden';
558
+ }
559
+ else {
560
+ document.body.style.overflow = 'auto';
561
+ }
562
+ const borderStyle = getBorderRadius.getBorderRadius({
563
+ overrideBorderStyle: this.borderStyle,
564
+ });
565
+ return (index.h(index.Host, { key: '48eb2701a74a7973d3502fd1fdc65ce85a6d71ed', class: classes.classes([
566
+ 'zonos--elements',
567
+ this.open && 'open',
568
+ this.isLoading && 'is-loading',
569
+ this.noBorder && 'no-border',
570
+ this.isMobile && 'mobile',
571
+ ]), style: {
572
+ '--border-radius': borderStyle,
573
+ '--font-family': zonosStore.zonosStoreFontFamily(),
574
+ '--height': this.height || 'initial',
575
+ '--width': this.width,
576
+ } }, index.h("div", { key: 'b408d792740d8854bab8ea60bd50ce894a75a836', class: "zonos--backdrop" }), index.h("div", { key: '04affcf48e0b209fa8dacc74039dad536ed9cd9b', "aria-hidden": "true", class: "zonos--dialog-layout", onClick: this.clickOutsideDialogHandler }, index.h("div", { key: 'c615792a60b2fa51a74af265b7c944a64e9ff18d', class: "zonos--dialog" }, this.isLoading && (index.h("div", { key: '78d3b571f75c6037fdd694b4621fb9eae48d8ce0', class: "zonos--loading" }, index.h("zonos-spinner", { key: 'bd96037d5fe1717ebeae5b1ba27b96aa9ec9253d', size: 30 }))), (this.headerText || !this.noCloseButton) && (index.h("div", { key: 'cc057cbed99107d7d234d08d38e67cbf0140dc66', class: "zonos--header" }, this.headerText && (index.h("h3", { key: '587fff6b04981f1c24b44736b3b40044480f68ba', class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (index.h("zonos-button", { key: '9a1944508996cd8ccb87f68ae175564528af3c4c', class: "zonos--close-button", icon: index.h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler })))), index.h("div", { key: 'b563c1939c32489b63516cd4dd14df58a32a08cf', class: classes.classes([
577
+ 'zonos--body',
578
+ this.noBodyPadding && 'zonos--no-body-padding',
579
+ ]) }, index.h("slot", { key: '39d66d136f630afbac7ced146d3a8ac60d3c9672' })), index.h("slot", { key: '5bace66c84150024d0203f89fbf8f5c263cb7472', name: "dialog-footer" })))));
580
+ }
581
+ static get assetsDirs() { return ["assets"]; }
582
+ };
583
+ ZonosDialog.style = ZonosDialogStyle0;
584
+
585
+ const zonosLinkAuthenticationCss = ".sc-zonos-link-authentication-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}";
586
+ const ZonosLinkAuthenticationStyle0 = zonosLinkAuthenticationCss;
587
+
588
+ const ZonosLinkAuthentication = class {
589
+ constructor(hostRef) {
590
+ index.registerInstance(this, hostRef);
591
+ this.titleText = undefined;
592
+ this.defaultEmail = null;
593
+ this.stripe = cart.stripeStore.stripe;
594
+ }
595
+ watchInitStripe() {
596
+ if (!this.stripe || !cart.stripeStore.stripeElements) {
597
+ return;
598
+ }
599
+ const defaultValues = this.defaultEmail
600
+ ? {
601
+ email: this.defaultEmail,
602
+ }
603
+ : undefined;
604
+ // Create and mount the Authentication Element in ${type} mode
605
+ const linkAuthenticationElement = cart.stripeStore.stripeLinkElement ||
606
+ cart.stripeStore.stripeElements.create('linkAuthentication', {
607
+ defaultValues: defaultValues || undefined,
608
+ });
609
+ const linkAuthenticationElementContainer = this.el.querySelector('.zonos--link-authentication-component');
610
+ if (!linkAuthenticationElementContainer) {
611
+ cart.logError('Cannot find container element for linkAuthenticationElement');
612
+ return;
613
+ }
614
+ linkAuthenticationElement.mount(linkAuthenticationElementContainer);
615
+ linkAuthenticationElement.on('change', event => {
616
+ cart.stripeStore.stripeLinkEventData = event;
617
+ });
618
+ cart.stripeStore.stripeLinkElement = linkAuthenticationElement;
619
+ }
620
+ componentDidLoad() {
621
+ // @Watch doesn't get trigger on initial load
622
+ this.watchInitStripe();
623
+ }
624
+ render() {
625
+ // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
626
+ return (index.h(index.Host, { key: '4a7b9eb534e938f791f70e04756aa9fb1c39f2c7', class: "zonos--link-authentication zonos--elements" }, index.h("zonos-text", { key: 'cc4fe49ed6d4bd7cec502ef739b9e835e9e26584', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), index.h("div", { key: 'f04a438d04e6ccd608d7ff61ac300fb09da4f0ce', class: "zonos--link-authentication-component" })));
627
+ }
628
+ get el() { return index.getElement(this); }
629
+ static get watchers() { return {
630
+ "stripe": ["watchInitStripe"]
631
+ }; }
632
+ };
633
+ ZonosLinkAuthentication.style = ZonosLinkAuthenticationStyle0;
634
+
635
+ exports.zonos_address = ZonosAddress;
636
+ exports.zonos_address_display = ZonosAddressDisplay;
637
+ exports.zonos_address_form = ZonosAddressForm;
638
+ exports.zonos_address_update_dialog = ZonosAddressUpdateDialog;
639
+ exports.zonos_checkbox = ZonosCheckbox;
640
+ exports.zonos_collapse = ZonosCollapse;
641
+ exports.zonos_dialog = ZonosDialog;
642
+ exports.zonos_link_authentication = ZonosLinkAuthentication;