@zonos/elements 1.3.286 → 1.3.288

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 (657) hide show
  1. package/README.md +9 -1
  2. package/dist/cjs/RemoveIcon-CuM1YmjP.js +5 -0
  3. package/dist/cjs/{cart-0cf8897b.js → cart-CV4buPlT.js} +17 -27
  4. package/dist/cjs/{collect-79131e52.js → collect-jzWKzrV7.js} +17 -113
  5. package/dist/cjs/debounce-5sZmmlCI.js +9 -0
  6. package/dist/cjs/debounce-Nu2lJW4A.js +405 -0
  7. package/dist/cjs/{formatStringWithLinks-c25b4018.js → formatStringWithLinks-vOVkAjlu.js} +1 -1
  8. package/dist/cjs/{getBorderRadius-97fd5e02.js → getBorderRadius-DGZiQu09.js} +1 -1
  9. package/dist/cjs/{getContrastColor-956dfaf7.js → getContrastColor-B2Kn8XHA.js} +2 -2
  10. package/dist/cjs/{getMissingRequiredShippingFields-a8f04267.js → getMissingRequiredShippingFields-r5vYIqoX.js} +1 -1
  11. package/dist/cjs/{handleFetch-954f30e1.js → handleFetch-DQLhurnE.js} +4 -3
  12. package/dist/cjs/{hasInclusivePrice-d0cd2007.js → hasInclusivePrice-BZMQohG9.js} +1 -1
  13. package/dist/cjs/{helpers-5bdbb68c.js → helpers-ClOZ11A9.js} +0 -3
  14. package/dist/cjs/{index-b1f95d96.js → index-DAAr465v.js} +1252 -580
  15. package/dist/cjs/index.cjs.js +17 -21
  16. package/dist/cjs/{invoice-254ae23b.js → invoice-CHw-mJdS.js} +6 -6
  17. package/dist/cjs/{isContrastColor-30f84a91.js → isContrastColor-B9ldIdpa.js} +1 -1
  18. package/dist/cjs/isDarkColor-f-fD9c2l.js +1187 -0
  19. package/dist/cjs/loader.cjs.js +3 -5
  20. package/dist/cjs/{localization-fb2ece37.js → localization-CxXsmxs5.js} +4 -4
  21. package/dist/cjs/{paypal-8ca67278.js → paypal-BLuHeOJH.js} +10 -9
  22. package/dist/cjs/{placeTestOrder-12b63822.js → placeTestOrder-VK_CMeq0.js} +3 -3
  23. package/dist/cjs/{renderCheckoutCurrency-a1f71587.js → renderCheckoutCurrency-CC4CAy-a.js} +2 -2
  24. package/dist/cjs/{renderFallback-bc20ee20.js → renderFallback-Bme86uk8.js} +1 -1
  25. package/dist/cjs/{shouldRenderTaxIdInput-7d19556c.js → shouldRenderTaxIdInput-TxekHCp7.js} +2 -2
  26. package/dist/cjs/{shouldShowLanguageSelect-82985128.js → shouldShowLanguageSelect-Bj_jKWPK.js} +1 -1
  27. package/dist/cjs/{submitGtag-8a25f001.js → submitGtag-CcEL-w5D.js} +3 -3
  28. package/dist/cjs/throttle-BcxGntLr.js +87 -0
  29. package/dist/cjs/{updateCheckoutSessionAttributes-de7b1466.js → updateCheckoutSessionAttributes-Dltl5RBx.js} +3 -3
  30. package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +644 -692
  31. package/dist/cjs/zonos-address-display_2.cjs.entry.js +13 -17
  32. package/dist/cjs/zonos-address_4.cjs.entry.js +50 -40
  33. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +15 -16
  34. package/dist/cjs/zonos-badge.cjs.entry.js +7 -10
  35. package/dist/cjs/zonos-banner.cjs.entry.js +6 -9
  36. package/dist/cjs/zonos-button_3.cjs.entry.js +18 -21
  37. package/dist/cjs/zonos-card_5.cjs.entry.js +34 -35
  38. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +85 -83
  39. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +10 -14
  40. package/dist/cjs/zonos-checkout.cjs.entry.js +50 -34
  41. package/dist/cjs/zonos-collapse.cjs.entry.js +5 -8
  42. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +18 -23
  43. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +59 -55
  44. package/dist/cjs/zonos-collect.cjs.entry.js +20 -23
  45. package/dist/cjs/zonos-component.cjs.entry.js +3 -6
  46. package/dist/cjs/zonos-controller.cjs.entry.js +13 -16
  47. package/dist/cjs/zonos-country-flag.cjs.entry.js +8 -11
  48. package/dist/cjs/zonos-country-select_4.cjs.entry.js +68 -57
  49. package/dist/cjs/zonos-elements.cjs.js +7 -7
  50. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +22 -23
  51. package/dist/cjs/zonos-hello.cjs.entry.js +19 -17
  52. package/dist/cjs/zonos-input.cjs.entry.js +10 -11
  53. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +17 -21
  54. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +57 -52
  55. package/dist/cjs/zonos-invoice.cjs.entry.js +19 -22
  56. package/dist/cjs/zonos-language-select_2.cjs.entry.js +11 -15
  57. package/dist/cjs/zonos-link.cjs.entry.js +3 -6
  58. package/dist/cjs/zonos-logo.cjs.entry.js +6 -9
  59. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +15 -19
  60. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +11 -14
  61. package/dist/cjs/zonos-stripe-input.cjs.entry.js +15 -14
  62. package/dist/cjs/zonos-text.cjs.entry.js +8 -11
  63. package/dist/cjs/zonos-tooltip.cjs.entry.js +4 -7
  64. package/dist/cjs/zonos-v-stack.cjs.entry.js +6 -9
  65. package/dist/cjs/zonosStore-BCNYr6Tk.js +3808 -0
  66. package/dist/collection/__tests__/jsxWithChildren.types.js +13 -0
  67. package/dist/collection/collection-manifest.json +3 -2
  68. package/dist/collection/components/checkout/zonos-checkout/zonos-address-completion-dialog/zonos-address-completion-dialog.js +13 -10
  69. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.js +4 -3
  70. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +8 -5
  71. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +17 -13
  72. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-restricted-items/zonos-cart-restricted-items.js +1 -1
  73. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +4 -4
  74. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +7 -5
  75. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +5 -4
  76. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +8 -8
  77. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-empty-state-payment/zonos-empty-state-payment.js +5 -4
  78. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.js +1 -1
  79. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +18 -14
  80. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +13 -10
  81. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +2 -2
  82. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +7 -7
  83. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +8 -6
  84. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.js +6 -5
  85. package/dist/collection/components/checkout/zonos-collect/zonos-collect-order-details/zonos-collect-order-details.js +4 -4
  86. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +7 -7
  87. package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.js +3 -3
  88. package/dist/collection/components/checkout/zonos-collect/zonos-collect.css +7 -4
  89. package/dist/collection/components/checkout/zonos-collect/zonos-collect.js +2 -2
  90. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.js +1 -1
  91. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +8 -6
  92. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.js +6 -5
  93. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-order-details/zonos-invoice-order-details.js +4 -4
  94. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +7 -7
  95. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.js +3 -3
  96. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.js +1 -1
  97. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice.js +2 -2
  98. package/dist/collection/components/common/zonos-badge/zonos-badge.js +8 -7
  99. package/dist/collection/components/common/zonos-banner/zonos-banner.js +4 -4
  100. package/dist/collection/components/common/zonos-button/zonos-button.js +29 -25
  101. package/dist/collection/components/common/zonos-card/zonos-card.js +9 -8
  102. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +15 -12
  103. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +9 -6
  104. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  105. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +15 -15
  106. package/dist/collection/components/common/zonos-country-flag/zonos-country-flag.js +6 -5
  107. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  108. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +22 -21
  109. package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.js +3 -2
  110. package/dist/collection/components/common/zonos-icon/zonos-icon.js +8 -7
  111. package/dist/collection/components/common/zonos-input/zonos-input.js +7 -7
  112. package/dist/collection/components/common/zonos-link/zonos-link.js +7 -7
  113. package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +4 -4
  114. package/dist/collection/components/common/zonos-logo/zonos-logo.js +4 -3
  115. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +8 -7
  116. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +1 -1
  117. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +15 -12
  118. package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.js +2 -2
  119. package/dist/collection/components/common/zonos-spinner/zonos-spinner.js +3 -3
  120. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +17 -17
  121. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +23 -20
  122. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +19 -19
  123. package/dist/collection/components/common/zonos-text/zonos-text.js +15 -11
  124. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +4 -3
  125. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  126. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +3 -2
  127. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +7 -6
  128. package/dist/collection/components/component-template/zonos-component/zonos-component.js +3 -3
  129. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +16 -12
  130. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +3 -2
  131. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +14 -11
  132. package/dist/collection/components/main/zonos-controller.js +18 -10
  133. package/dist/collection/components/store/checkout/stripe.js +1 -1
  134. package/dist/collection/components/stripe/zonos-address/zonos-address.js +9 -8
  135. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +6 -4
  136. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +13 -10
  137. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +4 -4
  138. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +2 -2
  139. package/dist/collection/components/utils/checkout/isEuDapRemittance.js +1 -1
  140. package/dist/collection/components/utils/checkout/shouldRenderTaxIdInput.js +1 -1
  141. package/dist/collection/scripts/cart/_setupCartData.js +2 -2
  142. package/dist/collection/scripts/cart/_setupCartDataWithSettings.js +2 -2
  143. package/dist/collection/types/generated/graphql.internal.types.js +5 -0
  144. package/dist/esm/RemoveIcon-C2QMVeWW.js +3 -0
  145. package/dist/esm/{cart-d04742f5.js → cart-ekBk_gxV.js} +18 -28
  146. package/dist/esm/{collect-4c310a16.js → collect-33rMINDo.js} +17 -113
  147. package/dist/esm/debounce-D4ko2kvZ.js +403 -0
  148. package/dist/esm/debounce-DWPsxJsW.js +7 -0
  149. package/dist/esm/{formatStringWithLinks-0d48f183.js → formatStringWithLinks-BcMPqGl0.js} +1 -1
  150. package/dist/esm/{getBorderRadius-1f7be586.js → getBorderRadius-HwG64EKM.js} +1 -1
  151. package/dist/esm/{getContrastColor-4c0ae8c1.js → getContrastColor-CfCPlW9U.js} +2 -2
  152. package/dist/esm/{getMissingRequiredShippingFields-f0878e32.js → getMissingRequiredShippingFields-u1nhQzJ1.js} +1 -1
  153. package/dist/esm/{handleFetch-a844cac1.js → handleFetch-D5GYDF-O.js} +4 -3
  154. package/dist/esm/{hasInclusivePrice-d801be22.js → hasInclusivePrice-CAVXi310.js} +1 -1
  155. package/dist/esm/{helpers-2f6955b1.js → helpers-DJIdCwJ5.js} +0 -3
  156. package/dist/esm/{index-cfd394c8.js → index-_lt63o7c.js} +1253 -561
  157. package/dist/esm/index.js +20 -22
  158. package/dist/esm/{invoice-86487dac.js → invoice-BNDWuVsD.js} +6 -6
  159. package/dist/esm/{isContrastColor-9fa0d013.js → isContrastColor-CWLU13s9.js} +1 -1
  160. package/dist/esm/isDarkColor-YdrG78th.js +1184 -0
  161. package/dist/esm/loader.js +4 -4
  162. package/dist/esm/{localization-36a4dc22.js → localization-AOqYXGdP.js} +5 -5
  163. package/dist/esm/{paypal-997935ab.js → paypal-CW1D2XqZ.js} +10 -9
  164. package/dist/esm/{placeTestOrder-a53f2056.js → placeTestOrder-nhmsLLOA.js} +3 -3
  165. package/dist/esm/{renderCheckoutCurrency-e0e16eb7.js → renderCheckoutCurrency-BQANmZyM.js} +2 -2
  166. package/dist/esm/{renderFallback-b250f4e9.js → renderFallback-Cy03ZcWE.js} +1 -1
  167. package/dist/esm/{shouldRenderTaxIdInput-ef7b5860.js → shouldRenderTaxIdInput-CKyZ6Zni.js} +2 -2
  168. package/dist/esm/{shouldShowLanguageSelect-328f50e2.js → shouldShowLanguageSelect-BQFCXouB.js} +1 -1
  169. package/dist/esm/{submitGtag-71c450b6.js → submitGtag-CCGQS060.js} +4 -4
  170. package/dist/esm/throttle-D5GyA3yr.js +85 -0
  171. package/dist/esm/{updateCheckoutSessionAttributes-23b222de.js → updateCheckoutSessionAttributes-eRSqdC74.js} +3 -3
  172. package/dist/esm/zonos-address-completion-dialog_7.entry.js +644 -690
  173. package/dist/esm/zonos-address-display_2.entry.js +13 -15
  174. package/dist/esm/zonos-address_4.entry.js +50 -38
  175. package/dist/esm/zonos-airwallex-payment.entry.js +15 -14
  176. package/dist/esm/zonos-badge.entry.js +7 -8
  177. package/dist/esm/zonos-banner.entry.js +6 -7
  178. package/dist/esm/zonos-button_3.entry.js +18 -19
  179. package/dist/esm/zonos-card_5.entry.js +34 -33
  180. package/dist/esm/zonos-cart-items_12.entry.js +85 -81
  181. package/dist/esm/zonos-checkbox_2.entry.js +10 -12
  182. package/dist/esm/zonos-checkout.entry.js +50 -32
  183. package/dist/esm/zonos-collapse.entry.js +5 -6
  184. package/dist/esm/zonos-collect-cart-items_3.entry.js +18 -21
  185. package/dist/esm/zonos-collect-finish_6.entry.js +59 -53
  186. package/dist/esm/zonos-collect.entry.js +20 -21
  187. package/dist/esm/zonos-component.entry.js +3 -4
  188. package/dist/esm/zonos-controller.entry.js +13 -14
  189. package/dist/esm/zonos-country-flag.entry.js +8 -9
  190. package/dist/esm/zonos-country-select_4.entry.js +68 -55
  191. package/dist/esm/zonos-elements.js +6 -5
  192. package/dist/esm/zonos-hello-dialog.entry.js +22 -21
  193. package/dist/esm/zonos-hello.entry.js +19 -15
  194. package/dist/esm/zonos-input.entry.js +10 -9
  195. package/dist/esm/zonos-invoice-cart-items_2.entry.js +17 -19
  196. package/dist/esm/zonos-invoice-finish_5.entry.js +57 -50
  197. package/dist/esm/zonos-invoice.entry.js +19 -20
  198. package/dist/esm/zonos-language-select_2.entry.js +11 -13
  199. package/dist/esm/zonos-link.entry.js +3 -4
  200. package/dist/esm/zonos-logo.entry.js +6 -7
  201. package/dist/esm/zonos-policy-consent_2.entry.js +15 -17
  202. package/dist/esm/zonos-shipping-rich-radio.entry.js +11 -12
  203. package/dist/esm/zonos-stripe-input.entry.js +15 -12
  204. package/dist/esm/zonos-text.entry.js +8 -9
  205. package/dist/esm/zonos-tooltip.entry.js +4 -5
  206. package/dist/esm/zonos-v-stack.entry.js +6 -7
  207. package/dist/esm/zonosStore-DrIOAz4M.js +3795 -0
  208. package/dist/esm-es5/{CheckoutConfig-724d7bae.js → CheckoutConfig-D5SpFsQJ.js} +5 -1
  209. package/dist/esm-es5/VarianceTest-BJmZPrZl.js +9 -0
  210. package/dist/esm-es5/{buildCartItemsByTempCart-a117f75d.js → buildCartItemsByTempCart-BycjkdlE.js} +4 -0
  211. package/dist/esm-es5/cart-ekBk_gxV.js +517 -0
  212. package/dist/esm-es5/classes-BJHSB96f.js +10 -0
  213. package/dist/esm-es5/cleanHtmlMarkdown-ByGDytaN.js +191 -0
  214. package/dist/esm-es5/collect-33rMINDo.js +241 -0
  215. package/dist/esm-es5/containsNonLatinChars-C04AWRC2.js +11 -0
  216. package/dist/esm-es5/createCustomEvent-XQfWgQLB.js +6 -0
  217. package/dist/esm-es5/debounce-D4ko2kvZ.js +153 -0
  218. package/dist/esm-es5/debounce-DWPsxJsW.js +1 -0
  219. package/dist/esm-es5/formatStringWithLinks-BcMPqGl0.js +8 -0
  220. package/dist/esm-es5/getBorderRadius-HwG64EKM.js +8 -0
  221. package/dist/esm-es5/getContrastColor-CfCPlW9U.js +14 -0
  222. package/dist/esm-es5/getGenericSettingsOverride-HeAZDwVW.js +4 -0
  223. package/dist/esm-es5/getMissingRequiredShippingFields-u1nhQzJ1.js +20 -0
  224. package/dist/esm-es5/handleFetch-D5GYDF-O.js +60 -0
  225. package/dist/esm-es5/hasInclusivePrice-CAVXi310.js +6 -0
  226. package/dist/esm-es5/helpers-DJIdCwJ5.js +23 -0
  227. package/dist/esm-es5/index-_lt63o7c.js +162 -0
  228. package/dist/esm-es5/index.js +227 -1
  229. package/dist/esm-es5/invoice-BNDWuVsD.js +13 -0
  230. package/dist/esm-es5/isColorVariable-DXXUq2Lv.js +11 -0
  231. package/dist/esm-es5/isContrastColor-CWLU13s9.js +5 -0
  232. package/dist/esm-es5/isDarkColor-YdrG78th.js +204 -0
  233. package/dist/esm-es5/isSameHostCheckoutLink-BxAHnL5J.js +16 -0
  234. package/dist/esm-es5/loader.js +1 -1
  235. package/dist/esm-es5/localization-AOqYXGdP.js +332 -0
  236. package/dist/esm-es5/paypal-CW1D2XqZ.js +192 -0
  237. package/dist/esm-es5/placeTestOrder-nhmsLLOA.js +1 -0
  238. package/dist/esm-es5/renderCheckoutCurrency-BQANmZyM.js +13 -0
  239. package/dist/esm-es5/{renderFallback-b250f4e9.js → renderFallback-Cy03ZcWE.js} +1 -1
  240. package/dist/esm-es5/shouldRenderTaxIdInput-CKyZ6Zni.js +17 -0
  241. package/dist/esm-es5/shouldShowLanguageSelect-BQFCXouB.js +7 -0
  242. package/dist/esm-es5/styles-BTIeCf3T.js +6 -0
  243. package/dist/esm-es5/submitGtag-CCGQS060.js +45 -0
  244. package/dist/esm-es5/throttle-D5GyA3yr.js +46 -0
  245. package/dist/esm-es5/updateCheckoutSessionAttributes-eRSqdC74.js +8 -0
  246. package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +2966 -1
  247. package/dist/esm-es5/zonos-address-display_2.entry.js +46 -1
  248. package/dist/esm-es5/zonos-address_4.entry.js +179 -1
  249. package/dist/esm-es5/zonos-airwallex-payment.entry.js +49 -1
  250. package/dist/esm-es5/zonos-badge.entry.js +25 -1
  251. package/dist/esm-es5/zonos-banner.entry.js +7 -1
  252. package/dist/esm-es5/zonos-button_3.entry.js +116 -1
  253. package/dist/esm-es5/zonos-card_5.entry.js +33 -1
  254. package/dist/esm-es5/zonos-cart-items_12.entry.js +666 -1
  255. package/dist/esm-es5/zonos-checkbox_2.entry.js +21 -1
  256. package/dist/esm-es5/zonos-checkout.entry.js +1043 -1
  257. package/dist/esm-es5/zonos-collapse.entry.js +15 -1
  258. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +13 -1
  259. package/dist/esm-es5/zonos-collect-finish_6.entry.js +157 -1
  260. package/dist/esm-es5/zonos-collect.entry.js +171 -1
  261. package/dist/esm-es5/zonos-component.entry.js +10 -1
  262. package/dist/esm-es5/zonos-controller.entry.js +198 -1
  263. package/dist/esm-es5/zonos-country-flag.entry.js +6 -1
  264. package/dist/esm-es5/zonos-country-select_4.entry.js +152 -1
  265. package/dist/esm-es5/zonos-elements.js +4 -1
  266. package/dist/esm-es5/zonos-hello-dialog.entry.js +63 -1
  267. package/dist/esm-es5/zonos-hello.entry.js +121 -1
  268. package/dist/esm-es5/zonos-input.entry.js +16 -1
  269. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +7 -1
  270. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +133 -1
  271. package/dist/esm-es5/zonos-invoice.entry.js +115 -1
  272. package/dist/esm-es5/zonos-language-select_2.entry.js +14 -1
  273. package/dist/esm-es5/zonos-link.entry.js +4 -1
  274. package/dist/esm-es5/zonos-logo.entry.js +7 -1
  275. package/dist/esm-es5/zonos-policy-consent_2.entry.js +31 -1
  276. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +5 -1
  277. package/dist/esm-es5/zonos-stripe-input.entry.js +27 -1
  278. package/dist/esm-es5/zonos-text.entry.js +24 -1
  279. package/dist/esm-es5/zonos-tooltip.entry.js +7 -1
  280. package/dist/esm-es5/zonos-v-stack.entry.js +5 -1
  281. package/dist/esm-es5/zonosStore-DrIOAz4M.js +1153 -0
  282. package/dist/scripts/index.d.ts +1171 -521
  283. package/dist/scripts/index.js +1 -1
  284. package/dist/scripts/loadZonos.js +1 -1
  285. package/dist/scripts/zonos.js +1 -1
  286. package/dist/types/__tests__/jsxWithChildren.types.d.ts +14 -0
  287. package/dist/types/__tests__/vitest-globals.d.ts +1 -0
  288. package/dist/types/components/store/checkout/cart.d.ts +9 -9
  289. package/dist/types/components/utils/api/checkItemRestrictions.d.ts +2 -2
  290. package/dist/types/components/utils/api/getLocaleMessages.d.ts +5 -5
  291. package/dist/types/components/utils/checkout/isShippableCountry.d.ts +5 -1
  292. package/dist/types/components/utils/hello/detectItemRestrictions.d.ts +2 -2
  293. package/dist/types/components.d.ts +797 -147
  294. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +127 -127
  295. package/dist/types/stencil-public-runtime.d.ts +205 -12
  296. package/dist/types/types/generated/graphql.frontend.types.d.ts +60 -60
  297. package/dist/types/types/generated/graphql.frontend.types.ts +55 -55
  298. package/dist/types/types/generated/graphql.internal.types.d.ts +1290 -1285
  299. package/dist/types/types/generated/graphql.internal.types.ts +1113 -1108
  300. package/dist/zonos-elements/index.esm.js +1 -1
  301. package/dist/zonos-elements/p-02ef0f99.system.entry.js +6 -0
  302. package/dist/zonos-elements/{p-1be53c82.entry.js → p-0466650f.entry.js} +1 -1
  303. package/dist/zonos-elements/p-04bfcd72.system.entry.js +152 -0
  304. package/dist/zonos-elements/p-04cc0dac.system.entry.js +198 -0
  305. package/dist/zonos-elements/p-058f07aa.system.entry.js +7 -0
  306. package/dist/zonos-elements/p-0f603278.system.entry.js +5 -0
  307. package/dist/zonos-elements/{p-bb09ee50.entry.js → p-128485dc.entry.js} +1 -1
  308. package/dist/zonos-elements/p-1568ab06.system.entry.js +117 -0
  309. package/dist/zonos-elements/p-2ba738ec.entry.js +1 -0
  310. package/dist/zonos-elements/{p-6afd5fab.entry.js → p-31ac495f.entry.js} +1 -1
  311. package/dist/zonos-elements/p-34d1545a.entry.js +1 -0
  312. package/dist/zonos-elements/p-39c8a898.entry.js +1 -0
  313. package/dist/zonos-elements/p-3ERbuo5a.js +1 -0
  314. package/dist/zonos-elements/p-450ed170.system.entry.js +46 -0
  315. package/dist/zonos-elements/p-4973f8d8.system.entry.js +180 -0
  316. package/dist/zonos-elements/p-49e7bb1e.system.entry.js +7 -0
  317. package/dist/zonos-elements/p-4a54f664.entry.js +1 -0
  318. package/dist/zonos-elements/p-4ab1c533.system.entry.js +4 -0
  319. package/dist/zonos-elements/p-5024df2d.system.entry.js +666 -0
  320. package/dist/zonos-elements/p-5562a955.system.entry.js +7 -0
  321. package/dist/zonos-elements/p-5836d426.system.entry.js +49 -0
  322. package/dist/zonos-elements/p-5a631080.system.entry.js +13 -0
  323. package/dist/zonos-elements/{p-2ce039e5.entry.js → p-5c08d36b.entry.js} +1 -1
  324. package/dist/zonos-elements/{p-aed4ffb2.entry.js → p-5d3079e8.entry.js} +1 -1
  325. package/dist/zonos-elements/p-64e7bc5b.entry.js +1 -0
  326. package/dist/zonos-elements/p-6b0afaa7.entry.js +1 -0
  327. package/dist/zonos-elements/p-6f742021.entry.js +1 -0
  328. package/dist/zonos-elements/p-7681798d.entry.js +1 -0
  329. package/dist/zonos-elements/p-7a5d2211.system.entry.js +115 -0
  330. package/dist/zonos-elements/{p-6de2f9c9.entry.js → p-7ae48e31.entry.js} +1 -1
  331. package/dist/zonos-elements/{p-f37150e8.entry.js → p-8328f44d.entry.js} +1 -1
  332. package/dist/zonos-elements/{p-171a7e1e.entry.js → p-844a743a.entry.js} +1 -1
  333. package/dist/zonos-elements/p-891b47d7.entry.js +1 -0
  334. package/dist/zonos-elements/p-89ddab88.entry.js +1 -0
  335. package/dist/zonos-elements/p-8cd3f1e2.entry.js +1 -0
  336. package/dist/zonos-elements/p-9818f823.entry.js +1 -0
  337. package/dist/zonos-elements/p-9b399685.system.entry.js +10 -0
  338. package/dist/zonos-elements/p-9b6482ef.entry.js +1 -0
  339. package/dist/zonos-elements/{p-2c44e013.entry.js → p-9ebe9a36.entry.js} +1 -1
  340. package/dist/zonos-elements/p-B2EZRfoq.system.js +193 -0
  341. package/dist/zonos-elements/p-B3GRrRtL.system.js +5 -0
  342. package/dist/zonos-elements/p-BANhKkF2.system.js +1 -0
  343. package/dist/zonos-elements/p-BDopxBpR.system.js +6 -0
  344. package/dist/zonos-elements/p-BJufDgh3.js +1 -0
  345. package/dist/zonos-elements/p-BLQFeIez.system.js +191 -0
  346. package/dist/zonos-elements/p-BNtWsPPP.system.js +7 -0
  347. package/dist/zonos-elements/p-BSgVcCxT.system.js +9 -0
  348. package/dist/zonos-elements/p-BXjdMMUy.js +1 -0
  349. package/dist/zonos-elements/p-BbgqQIHv.system.js +9 -0
  350. package/dist/zonos-elements/p-BgSx82zO.system.js +11 -0
  351. package/dist/zonos-elements/p-Bi-s0fp_.system.js +17 -0
  352. package/dist/zonos-elements/p-BtMauqj_.system.js +227 -0
  353. package/dist/zonos-elements/p-Bu9WCfUC.system.js +5 -0
  354. package/dist/zonos-elements/p-C19J2XSh.js +1 -0
  355. package/dist/zonos-elements/p-C2QMVeWW.js +1 -0
  356. package/dist/zonos-elements/p-C2j7R11h.system.js +11 -0
  357. package/dist/zonos-elements/p-CEl4pzNq.js +1 -0
  358. package/dist/zonos-elements/p-CICjAi70.js +1 -0
  359. package/dist/zonos-elements/p-CIevpRv_.system.js +162 -0
  360. package/dist/zonos-elements/{p-344a6278.js → p-CJCoACvU.js} +2 -2
  361. package/dist/zonos-elements/p-CKBbIU4b.system.js +14 -0
  362. package/dist/zonos-elements/p-CKTIJ2Gr.js +1 -0
  363. package/dist/zonos-elements/p-CKhl__Kc.system.js +4 -0
  364. package/dist/zonos-elements/p-CPnR_T0a.system.js +1153 -0
  365. package/dist/zonos-elements/p-CQqNJo0D.system.js +13 -0
  366. package/dist/zonos-elements/p-CYdt69j5.system.js +241 -0
  367. package/dist/zonos-elements/p-CZl1nwqv.system.js +46 -0
  368. package/dist/zonos-elements/p-CaAod213.system.js +8 -0
  369. package/dist/zonos-elements/p-CaUXHglQ.system.js +153 -0
  370. package/dist/zonos-elements/{p-45bd8072.system.js → p-CeLaK0Ff.system.js} +1 -1
  371. package/dist/zonos-elements/p-CtEsvWI6.js +1 -0
  372. package/dist/zonos-elements/p-D-DawUYF.system.js +1 -0
  373. package/dist/zonos-elements/p-D0erXw7p.js +1 -0
  374. package/dist/zonos-elements/p-D31lQiWo.system.js +21 -0
  375. package/dist/zonos-elements/p-D5AtAlJx.system.js +13 -0
  376. package/dist/zonos-elements/p-DBOI98r5.system.js +7 -0
  377. package/dist/zonos-elements/{p-41dd1cb8.js → p-DE4a-QD5.js} +1 -1
  378. package/dist/zonos-elements/p-DGsEWFDU.system.js +8 -0
  379. package/dist/zonos-elements/{p-a4c7ee17.js → p-DHwpNxG9.js} +1 -1
  380. package/dist/zonos-elements/p-DIJaXkiE.system.js +332 -0
  381. package/dist/zonos-elements/{p-eef5b0cc.js → p-DJIdCwJ5.js} +1 -1
  382. package/dist/zonos-elements/p-DPW1yXt9.system.js +517 -0
  383. package/dist/zonos-elements/{p-6bdc5c96.js → p-DTgv0QpG.js} +1 -1
  384. package/dist/zonos-elements/p-DW-fW8yR.system.js +205 -0
  385. package/dist/zonos-elements/p-Dj-O6VfM.system.js +7 -0
  386. package/dist/zonos-elements/p-DjuFsKLG.js +1 -0
  387. package/dist/zonos-elements/p-DkpYo2Fs.js +1 -0
  388. package/dist/zonos-elements/p-DnjGkbEy.js +1 -0
  389. package/dist/zonos-elements/p-LypTHRUC.js +1 -0
  390. package/dist/zonos-elements/p-MfsSJh_D.system.js +8 -0
  391. package/dist/zonos-elements/p-YdrG78th.js +1 -0
  392. package/dist/zonos-elements/p-_lt63o7c.js +3 -0
  393. package/dist/zonos-elements/p-a38e62cc.entry.js +1 -0
  394. package/dist/zonos-elements/p-a6faab6a.entry.js +1 -0
  395. package/dist/zonos-elements/p-adfee3a3.entry.js +1 -0
  396. package/dist/zonos-elements/p-b14819ab.system.entry.js +14 -0
  397. package/dist/zonos-elements/{p-0c972ddf.entry.js → p-b68ca96f.entry.js} +1 -1
  398. package/dist/zonos-elements/p-b6deae2b.system.entry.js +5 -0
  399. package/dist/zonos-elements/p-bdba7d9e.system.entry.js +25 -0
  400. package/dist/zonos-elements/p-be64d823.system.entry.js +16 -0
  401. package/dist/zonos-elements/p-beeb9d36.system.entry.js +21 -0
  402. package/dist/zonos-elements/p-cadf6b63.system.entry.js +33 -0
  403. package/dist/zonos-elements/p-cc5306fe.system.entry.js +24 -0
  404. package/dist/zonos-elements/p-cc949df1.system.entry.js +7 -0
  405. package/dist/zonos-elements/p-cf5688f7.entry.js +1 -0
  406. package/dist/zonos-elements/p-d05Ku7gM.system.js +24 -0
  407. package/dist/zonos-elements/p-d33dfc78.system.entry.js +2966 -0
  408. package/dist/zonos-elements/{p-5d110c2b.entry.js → p-d4c4a00e.entry.js} +1 -1
  409. package/dist/zonos-elements/p-d55b9664.system.entry.js +157 -0
  410. package/dist/zonos-elements/p-daf9fa07.system.entry.js +133 -0
  411. package/dist/zonos-elements/p-dcdbc610.system.entry.js +27 -0
  412. package/dist/zonos-elements/p-e101d722.system.entry.js +63 -0
  413. package/dist/zonos-elements/{p-9639a8ed.entry.js → p-e284d329.entry.js} +1 -1
  414. package/dist/zonos-elements/{p-5227aa69.entry.js → p-e9320825.entry.js} +1 -1
  415. package/dist/zonos-elements/p-ea8790aa.entry.js +1 -0
  416. package/dist/zonos-elements/{p-6ee4e027.entry.js → p-eadaefdc.entry.js} +1 -1
  417. package/dist/zonos-elements/p-f27317d3.system.entry.js +31 -0
  418. package/dist/zonos-elements/p-f2cedbcd.system.entry.js +121 -0
  419. package/dist/zonos-elements/p-f57495dc.entry.js +1 -0
  420. package/dist/zonos-elements/p-f6ba59f6.system.entry.js +171 -0
  421. package/dist/zonos-elements/p-f6e0aeba.system.entry.js +1043 -0
  422. package/dist/zonos-elements/p-f8fd756a.system.entry.js +15 -0
  423. package/dist/zonos-elements/{p-7ada039e.entry.js → p-fe778437.entry.js} +1 -1
  424. package/dist/zonos-elements/{p-adfbf57b.js → p-i1iCWKdv.js} +1 -1
  425. package/dist/zonos-elements/p-lGLcGvEA.js +1 -0
  426. package/dist/zonos-elements/p-nOb4xPLF.system.js +17 -0
  427. package/dist/zonos-elements/p-nU86HJ5w.js +1 -0
  428. package/dist/zonos-elements/p-pfIceXbY.js +1 -0
  429. package/dist/zonos-elements/p-smUku7Ku.system.js +5 -0
  430. package/dist/zonos-elements/p-t_ClFAJR.js +1 -0
  431. package/dist/zonos-elements/p-uV7m6KrY.system.js +46 -0
  432. package/dist/zonos-elements/p-vN6p_rO1.system.js +11 -0
  433. package/dist/zonos-elements/p-zRjRcLMp.js +1 -0
  434. package/dist/zonos-elements/p-zVLAvre1.system.js +60 -0
  435. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  436. package/dist/zonos-elements/zonos-elements.js +1 -1
  437. package/loader/index.d.ts +1 -1
  438. package/package.json +28 -32
  439. package/dist/cjs/RemoveIcon-081ac073.js +0 -5
  440. package/dist/cjs/debounce-7ca3c878.js +0 -357
  441. package/dist/cjs/isDarkColor-a6e6fd5e.js +0 -1202
  442. package/dist/cjs/throttle-366c204b.js +0 -76
  443. package/dist/cjs/zonosStore-0af0b937.js +0 -3030
  444. package/dist/esm/RemoveIcon-9dc5dd1a.js +0 -3
  445. package/dist/esm/debounce-84ade9c2.js +0 -355
  446. package/dist/esm/isDarkColor-939d8e9c.js +0 -1199
  447. package/dist/esm/throttle-c4c24e86.js +0 -74
  448. package/dist/esm/zonosStore-eca1e364.js +0 -3017
  449. package/dist/esm-es5/VarianceTest-572cecf5.js +0 -1
  450. package/dist/esm-es5/cart-d04742f5.js +0 -1
  451. package/dist/esm-es5/classes-0d95c529.js +0 -1
  452. package/dist/esm-es5/cleanHtmlMarkdown-87d195f6.js +0 -1
  453. package/dist/esm-es5/collect-4c310a16.js +0 -1
  454. package/dist/esm-es5/containsNonLatinChars-2d8810c3.js +0 -1
  455. package/dist/esm-es5/createCustomEvent-58159025.js +0 -1
  456. package/dist/esm-es5/debounce-84ade9c2.js +0 -1
  457. package/dist/esm-es5/formatStringWithLinks-0d48f183.js +0 -1
  458. package/dist/esm-es5/getBorderRadius-1f7be586.js +0 -1
  459. package/dist/esm-es5/getContrastColor-4c0ae8c1.js +0 -1
  460. package/dist/esm-es5/getGenericSettingsOverride-0bc3e118.js +0 -1
  461. package/dist/esm-es5/getMissingRequiredShippingFields-f0878e32.js +0 -1
  462. package/dist/esm-es5/handleFetch-a844cac1.js +0 -1
  463. package/dist/esm-es5/hasInclusivePrice-d801be22.js +0 -1
  464. package/dist/esm-es5/helpers-2f6955b1.js +0 -1
  465. package/dist/esm-es5/index-cfd394c8.js +0 -13
  466. package/dist/esm-es5/invoice-86487dac.js +0 -1
  467. package/dist/esm-es5/isColorVariable-0a94004f.js +0 -1
  468. package/dist/esm-es5/isContrastColor-9fa0d013.js +0 -1
  469. package/dist/esm-es5/isDarkColor-939d8e9c.js +0 -1
  470. package/dist/esm-es5/isSameHostCheckoutLink-c1b88ab7.js +0 -1
  471. package/dist/esm-es5/localization-36a4dc22.js +0 -1
  472. package/dist/esm-es5/paypal-997935ab.js +0 -17
  473. package/dist/esm-es5/placeTestOrder-a53f2056.js +0 -1
  474. package/dist/esm-es5/renderCheckoutCurrency-e0e16eb7.js +0 -1
  475. package/dist/esm-es5/shouldRenderTaxIdInput-ef7b5860.js +0 -1
  476. package/dist/esm-es5/shouldShowLanguageSelect-328f50e2.js +0 -1
  477. package/dist/esm-es5/styles-6fc2fad9.js +0 -1
  478. package/dist/esm-es5/submitGtag-71c450b6.js +0 -1
  479. package/dist/esm-es5/throttle-c4c24e86.js +0 -1
  480. package/dist/esm-es5/updateCheckoutSessionAttributes-23b222de.js +0 -1
  481. package/dist/esm-es5/zonosStore-eca1e364.js +0 -1
  482. package/dist/zonos-elements/p-01174496.system.js +0 -1
  483. package/dist/zonos-elements/p-06f798ee.system.js +0 -1
  484. package/dist/zonos-elements/p-083a11cd.system.entry.js +0 -1
  485. package/dist/zonos-elements/p-08e7107d.js +0 -1
  486. package/dist/zonos-elements/p-0b29169b.js +0 -1
  487. package/dist/zonos-elements/p-0c327a57.system.entry.js +0 -1
  488. package/dist/zonos-elements/p-0d2f81ce.system.js +0 -1
  489. package/dist/zonos-elements/p-0e199a6c.system.entry.js +0 -1
  490. package/dist/zonos-elements/p-0ff845ec.js +0 -1
  491. package/dist/zonos-elements/p-117953db.system.entry.js +0 -1
  492. package/dist/zonos-elements/p-14afffa8.system.js +0 -1
  493. package/dist/zonos-elements/p-1834f486.js +0 -1
  494. package/dist/zonos-elements/p-1aa93d1e.system.js +0 -1
  495. package/dist/zonos-elements/p-1ac0c631.system.js +0 -1
  496. package/dist/zonos-elements/p-1b8771bb.js +0 -1
  497. package/dist/zonos-elements/p-1cdd27ec.js +0 -1
  498. package/dist/zonos-elements/p-1cfb5c2a.system.entry.js +0 -1
  499. package/dist/zonos-elements/p-1f8648c8.system.entry.js +0 -1
  500. package/dist/zonos-elements/p-23e7c655.system.js +0 -1
  501. package/dist/zonos-elements/p-2670438c.system.js +0 -1
  502. package/dist/zonos-elements/p-27660512.js +0 -1
  503. package/dist/zonos-elements/p-277b77e3.js +0 -1
  504. package/dist/zonos-elements/p-278abdcf.entry.js +0 -1
  505. package/dist/zonos-elements/p-29b60bf3.system.js +0 -1
  506. package/dist/zonos-elements/p-2b97f7ed.js +0 -1
  507. package/dist/zonos-elements/p-2bbe9d91.js +0 -1
  508. package/dist/zonos-elements/p-2c7a425d.entry.js +0 -1
  509. package/dist/zonos-elements/p-2cab1746.system.entry.js +0 -1
  510. package/dist/zonos-elements/p-3490b6d0.entry.js +0 -1
  511. package/dist/zonos-elements/p-398d9022.system.js +0 -1
  512. package/dist/zonos-elements/p-3a26e5e7.system.entry.js +0 -1
  513. package/dist/zonos-elements/p-40a4c8a2.system.js +0 -1
  514. package/dist/zonos-elements/p-40af92a1.system.entry.js +0 -1
  515. package/dist/zonos-elements/p-4160bbc2.system.js +0 -1
  516. package/dist/zonos-elements/p-41f1697a.system.entry.js +0 -1
  517. package/dist/zonos-elements/p-4671fde7.entry.js +0 -1
  518. package/dist/zonos-elements/p-490d7fec.system.entry.js +0 -1
  519. package/dist/zonos-elements/p-4941c096.system.entry.js +0 -1
  520. package/dist/zonos-elements/p-4b159ff3.system.js +0 -1
  521. package/dist/zonos-elements/p-502d6eeb.js +0 -1
  522. package/dist/zonos-elements/p-50d088f7.system.entry.js +0 -1
  523. package/dist/zonos-elements/p-51e4e61a.system.entry.js +0 -1
  524. package/dist/zonos-elements/p-551fa762.system.js +0 -1
  525. package/dist/zonos-elements/p-5b990c91.entry.js +0 -1
  526. package/dist/zonos-elements/p-60832726.system.js +0 -1
  527. package/dist/zonos-elements/p-67426156.system.js +0 -1
  528. package/dist/zonos-elements/p-6890e060.system.js +0 -1
  529. package/dist/zonos-elements/p-6eaf7c9e.system.entry.js +0 -1
  530. package/dist/zonos-elements/p-7176f582.entry.js +0 -1
  531. package/dist/zonos-elements/p-7261e245.system.js +0 -13
  532. package/dist/zonos-elements/p-7352abe9.js +0 -1
  533. package/dist/zonos-elements/p-74230da8.system.js +0 -1
  534. package/dist/zonos-elements/p-76834a0a.system.entry.js +0 -1
  535. package/dist/zonos-elements/p-77993ba1.entry.js +0 -1
  536. package/dist/zonos-elements/p-78f8e594.entry.js +0 -1
  537. package/dist/zonos-elements/p-7ac8846c.system.js +0 -1
  538. package/dist/zonos-elements/p-7b525c75.system.js +0 -1
  539. package/dist/zonos-elements/p-7f688485.system.entry.js +0 -1
  540. package/dist/zonos-elements/p-7fbbdb0f.system.js +0 -1
  541. package/dist/zonos-elements/p-8861d47e.js +0 -1
  542. package/dist/zonos-elements/p-8a0b8175.system.entry.js +0 -1
  543. package/dist/zonos-elements/p-8a6c4017.js +0 -1
  544. package/dist/zonos-elements/p-8be02f3a.system.js +0 -1
  545. package/dist/zonos-elements/p-8d14cb66.entry.js +0 -1
  546. package/dist/zonos-elements/p-8e6338b9.entry.js +0 -1
  547. package/dist/zonos-elements/p-916228fb.system.js +0 -1
  548. package/dist/zonos-elements/p-944c1fb3.entry.js +0 -1
  549. package/dist/zonos-elements/p-947e4402.system.entry.js +0 -1
  550. package/dist/zonos-elements/p-96ab529e.entry.js +0 -1
  551. package/dist/zonos-elements/p-998975a3.system.js +0 -18
  552. package/dist/zonos-elements/p-9ad640b2.system.entry.js +0 -1
  553. package/dist/zonos-elements/p-9ecb9afc.system.entry.js +0 -1
  554. package/dist/zonos-elements/p-a04e2750.system.entry.js +0 -1
  555. package/dist/zonos-elements/p-a1bd3a53.system.js +0 -1
  556. package/dist/zonos-elements/p-a553e132.js +0 -1
  557. package/dist/zonos-elements/p-acb7dee1.system.entry.js +0 -1
  558. package/dist/zonos-elements/p-af19722c.system.js +0 -1
  559. package/dist/zonos-elements/p-b4ae66cb.system.entry.js +0 -1
  560. package/dist/zonos-elements/p-bcaffb85.system.entry.js +0 -1
  561. package/dist/zonos-elements/p-be6cd28c.system.entry.js +0 -1
  562. package/dist/zonos-elements/p-bf37ccc7.system.js +0 -1
  563. package/dist/zonos-elements/p-c0af11fe.system.js +0 -1
  564. package/dist/zonos-elements/p-c112fa12.system.entry.js +0 -1
  565. package/dist/zonos-elements/p-c4321a1a.system.js +0 -1
  566. package/dist/zonos-elements/p-c5d1217f.system.js +0 -1
  567. package/dist/zonos-elements/p-c7329333.entry.js +0 -1
  568. package/dist/zonos-elements/p-c756a59d.system.js +0 -1
  569. package/dist/zonos-elements/p-c77b049c.entry.js +0 -1
  570. package/dist/zonos-elements/p-ca87ada5.system.entry.js +0 -1
  571. package/dist/zonos-elements/p-ce75b047.js +0 -2
  572. package/dist/zonos-elements/p-d1a51fac.js +0 -1
  573. package/dist/zonos-elements/p-d6a73125.system.entry.js +0 -1
  574. package/dist/zonos-elements/p-d75726e5.system.entry.js +0 -1
  575. package/dist/zonos-elements/p-d938f42f.system.js +0 -1
  576. package/dist/zonos-elements/p-dd866ca3.system.entry.js +0 -1
  577. package/dist/zonos-elements/p-dd8a7bf4.entry.js +0 -1
  578. package/dist/zonos-elements/p-de58684b.system.js +0 -1
  579. package/dist/zonos-elements/p-e160b75f.js +0 -1
  580. package/dist/zonos-elements/p-e1ef3984.system.entry.js +0 -1
  581. package/dist/zonos-elements/p-e27b8e18.entry.js +0 -1
  582. package/dist/zonos-elements/p-e4b07f7d.system.entry.js +0 -1
  583. package/dist/zonos-elements/p-e4dc24e1.system.js +0 -1
  584. package/dist/zonos-elements/p-e5865ad9.system.js +0 -1
  585. package/dist/zonos-elements/p-e7d7afda.entry.js +0 -1
  586. package/dist/zonos-elements/p-ebbda085.system.js +0 -1
  587. package/dist/zonos-elements/p-f4720b0a.js +0 -1
  588. package/dist/zonos-elements/p-f8356934.system.entry.js +0 -1
  589. package/dist/zonos-elements/p-f9346f1c.entry.js +0 -1
  590. package/dist/zonos-elements/p-fc5f6113.js +0 -1
  591. package/dist/zonos-elements/p-fe28dbe6.entry.js +0 -1
  592. package/loader/package.json +0 -11
  593. /package/dist/cjs/{CheckoutConfig-27c82f94.js → CheckoutConfig-B7JRM7yr.js} +0 -0
  594. /package/dist/cjs/{ShortAddressCode-bec338b0.js → ShortAddressCode-C5l520-F.js} +0 -0
  595. /package/dist/cjs/{TaxId-cd9d490e.js → TaxId-Q6aDqqWv.js} +0 -0
  596. /package/dist/cjs/{VarianceTest-bec00ea8.js → VarianceTest-C98whVgO.js} +0 -0
  597. /package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -0
  598. /package/dist/cjs/{buildCartItemsByTempCart-edddbf4b.js → buildCartItemsByTempCart-ILzonEjb.js} +0 -0
  599. /package/dist/cjs/{classes-b7918f56.js → classes-D_DL168u.js} +0 -0
  600. /package/dist/cjs/{cleanHtmlMarkdown-57147de7.js → cleanHtmlMarkdown-DpT-nZLH.js} +0 -0
  601. /package/dist/cjs/{containsNonLatinChars-2be5129b.js → containsNonLatinChars-D_OggJN6.js} +0 -0
  602. /package/dist/cjs/{createCustomEvent-7b6fad95.js → createCustomEvent-Cs5zGImL.js} +0 -0
  603. /package/dist/cjs/{getGenericSettingsOverride-c0ca32b9.js → getGenericSettingsOverride-CL6l6wvX.js} +0 -0
  604. /package/dist/cjs/{getHasMoreSpaceOnRight-4c94667f.js → getHasMoreSpaceOnRight-Cl50u1mb.js} +0 -0
  605. /package/dist/cjs/{isCollectMobileTablet-884d4280.js → isCollectMobileTablet-Cx2nZ15_.js} +0 -0
  606. /package/dist/cjs/{isColorVariable-525dbfa7.js → isColorVariable-CKoJdu9G.js} +0 -0
  607. /package/dist/cjs/{isInvoiceMobileTablet-dde41e4e.js → isInvoiceMobileTablet-CCqFYV6m.js} +0 -0
  608. /package/dist/cjs/{isSameHostCheckoutLink-6148cabb.js → isSameHostCheckoutLink-DbmQ7Ha4.js} +0 -0
  609. /package/dist/cjs/{styles-d1e64fb9.js → styles-nowYls3K.js} +0 -0
  610. /package/dist/esm/{CheckoutConfig-724d7bae.js → CheckoutConfig-D5SpFsQJ.js} +0 -0
  611. /package/dist/esm/{ShortAddressCode-7620e622.js → ShortAddressCode-nJ6oI8-n.js} +0 -0
  612. /package/dist/esm/{TaxId-63a14057.js → TaxId-Cye-evFK.js} +0 -0
  613. /package/dist/esm/{VarianceTest-572cecf5.js → VarianceTest-BJmZPrZl.js} +0 -0
  614. /package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
  615. /package/dist/esm/{buildCartItemsByTempCart-a117f75d.js → buildCartItemsByTempCart-BycjkdlE.js} +0 -0
  616. /package/dist/esm/{classes-0d95c529.js → classes-BJHSB96f.js} +0 -0
  617. /package/dist/esm/{cleanHtmlMarkdown-87d195f6.js → cleanHtmlMarkdown-ByGDytaN.js} +0 -0
  618. /package/dist/esm/{containsNonLatinChars-2d8810c3.js → containsNonLatinChars-C04AWRC2.js} +0 -0
  619. /package/dist/esm/{createCustomEvent-58159025.js → createCustomEvent-XQfWgQLB.js} +0 -0
  620. /package/dist/esm/{getGenericSettingsOverride-0bc3e118.js → getGenericSettingsOverride-HeAZDwVW.js} +0 -0
  621. /package/dist/esm/{getHasMoreSpaceOnRight-70eb913a.js → getHasMoreSpaceOnRight-DAscqB23.js} +0 -0
  622. /package/dist/esm/{isCollectMobileTablet-111b0dd7.js → isCollectMobileTablet-DGlnuxEX.js} +0 -0
  623. /package/dist/esm/{isColorVariable-0a94004f.js → isColorVariable-DXXUq2Lv.js} +0 -0
  624. /package/dist/esm/{isInvoiceMobileTablet-1f7b614e.js → isInvoiceMobileTablet-Clej0Ffe.js} +0 -0
  625. /package/dist/esm/{isSameHostCheckoutLink-c1b88ab7.js → isSameHostCheckoutLink-BxAHnL5J.js} +0 -0
  626. /package/dist/esm/{styles-6fc2fad9.js → styles-BTIeCf3T.js} +0 -0
  627. /package/dist/esm-es5/{RemoveIcon-9dc5dd1a.js → RemoveIcon-C2QMVeWW.js} +0 -0
  628. /package/dist/esm-es5/{ShortAddressCode-7620e622.js → ShortAddressCode-nJ6oI8-n.js} +0 -0
  629. /package/dist/esm-es5/{TaxId-63a14057.js → TaxId-Cye-evFK.js} +0 -0
  630. /package/dist/esm-es5/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
  631. /package/dist/esm-es5/{getHasMoreSpaceOnRight-70eb913a.js → getHasMoreSpaceOnRight-DAscqB23.js} +0 -0
  632. /package/dist/esm-es5/{isCollectMobileTablet-111b0dd7.js → isCollectMobileTablet-DGlnuxEX.js} +0 -0
  633. /package/dist/esm-es5/{isInvoiceMobileTablet-1f7b614e.js → isInvoiceMobileTablet-Clej0Ffe.js} +0 -0
  634. /package/dist/zonos-elements/{p-2770ba48.system.js → p-0D0aCMu6.system.js} +0 -0
  635. /package/dist/zonos-elements/{p-b4b7f705.js → p-BJHSB96f.js} +0 -0
  636. /package/dist/zonos-elements/{p-0a377722.js → p-BJmZPrZl.js} +0 -0
  637. /package/dist/zonos-elements/{p-96d77739.js → p-BTIeCf3T.js} +0 -0
  638. /package/dist/zonos-elements/{p-56ba5cbf.system.js → p-BbPAtVJG.system.js} +0 -0
  639. /package/dist/zonos-elements/{p-11206fe2.js → p-BxAHnL5J.js} +0 -0
  640. /package/dist/zonos-elements/{p-cc6ad18a.js → p-ByGDytaN.js} +0 -0
  641. /package/dist/zonos-elements/{p-83666056.js → p-BycjkdlE.js} +0 -0
  642. /package/dist/zonos-elements/{p-0c64dbbb.js → p-C04AWRC2.js} +0 -0
  643. /package/dist/zonos-elements/{p-655ec440.system.js → p-C29tlYn0.system.js} +0 -0
  644. /package/dist/zonos-elements/{p-2adbbce7.system.js → p-CLDnjFm5.system.js} +0 -0
  645. /package/dist/zonos-elements/{p-989cb22b.system.js → p-Cby4EkFu.system.js} +0 -0
  646. /package/dist/zonos-elements/{p-1f3549c6.js → p-Clej0Ffe.js} +0 -0
  647. /package/dist/zonos-elements/{p-bcf5cffb.js → p-Cye-evFK.js} +0 -0
  648. /package/dist/zonos-elements/{p-b2d81c98.js → p-D5SpFsQJ.js} +0 -0
  649. /package/dist/zonos-elements/{p-5883217a.js → p-DAscqB23.js} +0 -0
  650. /package/dist/zonos-elements/{p-579932a7.js → p-DGlnuxEX.js} +0 -0
  651. /package/dist/zonos-elements/{p-e1255160.js → p-DQuL1Twl.js} +0 -0
  652. /package/dist/zonos-elements/{p-ae393255.js → p-DXXUq2Lv.js} +0 -0
  653. /package/dist/zonos-elements/{p-e7b0c156.js → p-HeAZDwVW.js} +0 -0
  654. /package/dist/zonos-elements/{p-595f5dd2.js → p-XQfWgQLB.js} +0 -0
  655. /package/dist/zonos-elements/{p-bc7bf53e.system.js → p-Z99tSPFR.system.js} +0 -0
  656. /package/dist/zonos-elements/{p-6f23a26a.system.js → p-_GDmY2H7.system.js} +0 -0
  657. /package/dist/zonos-elements/{p-1d42cd20.js → p-nJ6oI8-n.js} +0 -0
@@ -1 +1,46 @@
1
- import{r as registerInstance,h,a as Host,d as createEvent}from"./index-cfd394c8.js";import{t as translate,l as localizationStore}from"./localization-36a4dc22.js";import{i as isTextContainsNonLatinChars}from"./containsNonLatinChars-2d8810c3.js";import{f as zonosStoreFontFamily}from"./zonosStore-eca1e364.js";import{c as classes}from"./classes-0d95c529.js";import{g as getBorderRadius}from"./getBorderRadius-1f7be586.js";import"./handleFetch-a844cac1.js";import"./VarianceTest-572cecf5.js";var zonosAddressDisplayCss=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .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-1000);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}';var ZonosAddressDisplayStyle0=zonosAddressDisplayCss;var ZonosAddressDisplay=function(){function o(o){registerInstance(this,o)}o.prototype.render=function(){var o,s;var e=this.currentAddress,t=e.city,n=e.country,i=e.email,a=e.line1,l=e.line2,r=e.name,d=e.phone,c=e.postal_code,f=e.state;var m=((o=localizationStore.allCountries)===null||o===void 0?void 0:o[n])||((s=localizationStore.shippingZoneCountries)===null||s===void 0?void 0:s[n]);var z=function(o){var s=o.bold,e=o.content;var t=isTextContainsNonLatinChars(e)?"red-600":"gray-1000";return h("zonos-text",{textColor:t,type:s?"boldLabel":"body"},e)};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"?translate("Shipping"):translate("Billing"))),h("div",{class:"zonos--address-group"},r&&h("div",{class:"zonos--address-line"},z({bold:true,content:r})),i&&h("div",{class:"zonos--address-line"},z({content:i})),d&&h("div",{class:"zonos--address-line"},z({content:d})),a&&h("div",{class:"zonos--address-line"},z({content:a})),l&&h("div",{class:"zonos--address-line"},z({content:l})),h("div",{class:"zonos--address-line"},t&&z({content:t}),f&&z({content:f}),c&&z({content:c})),m&&h("div",{class:"zonos--address-line"},h("zonos-country-flag",{class:"zonos--country-flag",countryCode:m.code})," ",z({content:m.displayName}))))};return o}();ZonosAddressDisplay.style=ZonosAddressDisplayStyle0;var 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>';var zonosDialogCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .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(--zonos-elements-backdrop-color);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;-ms-flex-direction:column;flex-direction:column;gap:4px;z-index:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--loading-text,:host .zonos--loading-title{max-width:100%;padding:0 32px;text-align:center}: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(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--zonos--min-height, auto);height:var(--zonos--height, auto);width:var(--zonos--width, auto);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-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(--zonos-elements-size-md);height:var(--zonos-elements-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(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-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:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-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}";var ZonosDialogStyle0=zonosDialogCss;var ZonosDialog=function(){function o(o){var s=this;registerInstance(this,o);this.closeDialog=createEvent(this,"closeDialog",3);this.open=false;this.headerText="";this.width="460px";this.noHeader=false;this.noBodyPadding=false;this.noBorder=false;this.noCloseButton=false;this.noClickOutside=false;this.mobile=false;this.isLoading=true;this.isMobile=false;this.isMobileMode=function(){return s.mobile||window.innerWidth<=768};this.closeButtonHandler=function(){if(!s.open){return}s.closeDialog.emit()};this.clickOutsideDialogHandler=function(o){if(o.target===o.currentTarget&&!s.noClickOutside){s.closeDialog.emit()}}}o.prototype.handleWindowResize=function(){this.isMobile=this.isMobileMode()};o.prototype.handleKeyDown=function(o){if(o.key==="Escape"){this.closeButtonHandler()}};o.prototype.componentDidLoad=function(){this.isMobile=this.isMobileMode()};o.prototype.render=function(){var o=getBorderRadius({overrideBorderStyle:this.borderStyle});return h(Host,{key:"73740b7d8c127367bbc2c621d036288920b3801d",class:classes(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--zonos--border-radius":o,"--zonos--font-family":zonosStoreFontFamily(),"--zonos--height":this.height||"initial","--zonos--min-height":this.minHeight||"500px","--zonos--width":this.width}},h("div",{key:"441c6b5c503a431909f52699ee60992609dea232",class:"zonos--backdrop"}),h("div",{key:"94fb4689581ae2d781cae264740bbf9dbd42deac",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},h("div",{key:"ba788097f52ca80229d16ce910071b56647061f9",class:"zonos--dialog"},this.isLoading&&h("div",{key:"47bfe052272192a74aeed3a5ddbed802ae27bc16",class:"zonos--loading"},h("zonos-spinner",{key:"49168e9057d08233654abfa0ca36138d205ca283",size:30}),this.loadingTitle&&h("zonos-text",{key:"ed89b9b21e30b0e670b296306ed9b797f2baa75e",class:"zonos--loading-title",size:"l",weight:700},this.loadingTitle),this.loadingText&&h("zonos-text",{key:"7770dbdcf4e1fb630e0ed6c08dc4830edf00d1f0",class:"zonos--loading-text"},this.loadingText)),(this.headerText||!this.noCloseButton)&&h("div",{key:"c171e207af502ef02de35803c480d927edea3ce4",class:"zonos--header"},this.headerText&&h("h3",{key:"03999b1441d3a0dc983fed2e64680211f4a59793",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&h("zonos-button",{key:"e2954d9326195df3029c0771481881e6485fae05",class:"zonos--close-button",icon:h("zonos-icon",{"aria-label":"Close dialog",content:RemoveIcon}),noBackground:true,onClick:this.closeButtonHandler,title:"Close dialog",variant:"subtle"})),h("div",{key:"ba456d3747bd51ada021ed909a41e5768ceed4ab",class:classes(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},h("slot",{key:"81e4de1e59970996607f7d0f2f2aef7937f82c43"})),h("slot",{key:"3fcd369711a347b9e2d2840fc708e928e17d5da1",name:"dialog-footer"}))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosDialog.style=ZonosDialogStyle0;export{ZonosAddressDisplay as zonos_address_display,ZonosDialog as zonos_dialog};
1
+ import{r as registerInstance,h,a as Host,d as createEvent}from"./index-_lt63o7c.js";import{t as translate,l as localizationStore}from"./localization-AOqYXGdP.js";import{i as isTextContainsNonLatinChars}from"./containsNonLatinChars-C04AWRC2.js";import{a as zonosStoreFontFamily}from"./zonosStore-DrIOAz4M.js";import{c as classes}from"./classes-BJHSB96f.js";import{g as getBorderRadius}from"./getBorderRadius-HwG64EKM.js";import"./handleFetch-D5GYDF-O.js";import"./VarianceTest-BJmZPrZl.js";var zonosAddressDisplayCss=function(){return':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .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-1000);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}'};var ZonosAddressDisplay=/** @class */function(){function o(o){registerInstance(this,o)}o.prototype.render=function(){var o,s;var e=this.currentAddress,t=e.city,n=e.country,i=e.email,a=e.line1,l=e.line2,r=e.name,d=e.phone,c=e.postal_code,f=e.state;
2
+ /**
3
+ * Look the country up in the full country list first, since a billing
4
+ * address can be in a country the merchant does not ship to and would
5
+ * otherwise render without a country line (05CHECK-915). The shipping zone
6
+ * is a subset of all countries, so this is also correct for shipping.
7
+ */var m=((o=localizationStore.allCountries)===null||o===void 0?void 0:o[n])||((s=localizationStore.shippingZoneCountries)===null||s===void 0?void 0:s[n]);var z=function(o){var s=o.bold,e=o.content;var t=isTextContainsNonLatinChars(e)?"red-600":"gray-1000";return h("zonos-text",{textColor:t,type:s?"boldLabel":"body"},e)};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"?translate("Shipping"):translate("Billing"))),h("div",{class:"zonos--address-group"},r&&h("div",{class:"zonos--address-line"},z({bold:true,content:r})),i&&h("div",{class:"zonos--address-line"},z({content:i})),d&&h("div",{class:"zonos--address-line"},z({content:d})),a&&h("div",{class:"zonos--address-line"},z({content:a})),l&&h("div",{class:"zonos--address-line"},z({content:l})),h("div",{class:"zonos--address-line"},t&&z({content:t}),f&&z({content:f}),c&&z({content:c})),m&&h("div",{class:"zonos--address-line"},h("zonos-country-flag",{class:"zonos--country-flag",countryCode:m.code})," ",z({content:m.displayName}))))};return o}();ZonosAddressDisplay.style=zonosAddressDisplayCss();var 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>';var zonosDialogCss=function(){return":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .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(--zonos-elements-backdrop-color);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;-ms-flex-direction:column;flex-direction:column;gap:4px;z-index:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--loading-text,:host .zonos--loading-title{max-width:100%;padding:0 32px;text-align:center}: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(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--zonos--min-height, auto);height:var(--zonos--height, auto);width:var(--zonos--width, auto);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-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(--zonos-elements-size-md);height:var(--zonos-elements-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(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-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:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-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}"};var ZonosDialog=/** @class */function(){function o(o){var s=this;registerInstance(this,o);this.closeDialog=createEvent(this,"closeDialog",3);
8
+ /**
9
+ * Whether or not the dialog is open
10
+ * @default false
11
+ */this.open=false;
12
+ /**
13
+ * The header text for the dialog
14
+ */this.headerText="";
15
+ /**
16
+ * The width of the dialog
17
+ * @default 460px
18
+ */this.width="460px";
19
+ /**
20
+ * Whether or not to show the header
21
+ * @default false
22
+ */this.noHeader=false;
23
+ /**
24
+ * Whether or not to have body padding
25
+ * @default false
26
+ */this.noBodyPadding=false;
27
+ /**
28
+ * Whether or not to have body padding
29
+ * @default false
30
+ */this.noBorder=false;
31
+ /**
32
+ * Whether or not to show the close button
33
+ * @default false
34
+ */this.noCloseButton=false;
35
+ /**
36
+ * Whether or not to close the dialog when clicking outside of it
37
+ * @default false
38
+ */this.noClickOutside=false;
39
+ /**
40
+ * Flag to determine if the checkout is on mobile
41
+ */this.mobile=false;
42
+ /**
43
+ * Load loading spinner for the dialog or not
44
+ */this.isLoading=true;this.isMobile=false;this.isMobileMode=function(){return s.mobile||window.innerWidth<=768};this.closeButtonHandler=function(){
45
+ // Only do the action if the dialog is open
46
+ if(!s.open){return}s.closeDialog.emit()};this.clickOutsideDialogHandler=function(o){if(o.target===o.currentTarget&&!s.noClickOutside){s.closeDialog.emit()}}}o.prototype.handleWindowResize=function(){this.isMobile=this.isMobileMode()};o.prototype.handleKeyDown=function(o){if(o.key==="Escape"){this.closeButtonHandler()}};o.prototype.componentDidLoad=function(){this.isMobile=this.isMobileMode()};o.prototype.render=function(){var o=getBorderRadius({overrideBorderStyle:this.borderStyle});return h(Host,{key:"73740b7d8c127367bbc2c621d036288920b3801d",class:classes(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--zonos--border-radius":o,"--zonos--font-family":zonosStoreFontFamily(),"--zonos--height":this.height||"initial","--zonos--min-height":this.minHeight||"500px","--zonos--width":this.width}},h("div",{key:"441c6b5c503a431909f52699ee60992609dea232",class:"zonos--backdrop"}),h("div",{key:"94fb4689581ae2d781cae264740bbf9dbd42deac",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},h("div",{key:"ba788097f52ca80229d16ce910071b56647061f9",class:"zonos--dialog"},this.isLoading&&h("div",{key:"47bfe052272192a74aeed3a5ddbed802ae27bc16",class:"zonos--loading"},h("zonos-spinner",{key:"49168e9057d08233654abfa0ca36138d205ca283",size:30}),this.loadingTitle&&h("zonos-text",{key:"ed89b9b21e30b0e670b296306ed9b797f2baa75e",class:"zonos--loading-title",size:"l",weight:700},this.loadingTitle),this.loadingText&&h("zonos-text",{key:"7770dbdcf4e1fb630e0ed6c08dc4830edf00d1f0",class:"zonos--loading-text"},this.loadingText)),(this.headerText||!this.noCloseButton)&&h("div",{key:"c171e207af502ef02de35803c480d927edea3ce4",class:"zonos--header"},this.headerText&&h("h3",{key:"03999b1441d3a0dc983fed2e64680211f4a59793",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&h("zonos-button",{key:"e2954d9326195df3029c0771481881e6485fae05",class:"zonos--close-button",icon:h("zonos-icon",{"aria-label":"Close dialog",content:RemoveIcon}),noBackground:true,onClick:this.closeButtonHandler,title:"Close dialog",variant:"subtle"})),h("div",{key:"ba456d3747bd51ada021ed909a41e5768ceed4ab",class:classes(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},h("slot",{key:"81e4de1e59970996607f7d0f2f2aef7937f82c43"})),h("slot",{key:"3fcd369711a347b9e2d2840fc708e928e17d5da1",name:"dialog-footer"}))))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosDialog.style=zonosDialogCss();export{ZonosAddressDisplay as zonos_address_display,ZonosDialog as zonos_dialog};
@@ -1 +1,179 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,o,n){function s(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,i){function r(t){try{l(n.next(t))}catch(t){i(t)}}function a(t){try{l(n["throw"](t))}catch(t){i(t)}}function l(t){t.done?o(t.value):s(t.value).then(r,a)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,r;return r={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(t){return function(e){return l([t,e])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(o=0)),o)try{if(n=1,s&&(i=a[0]&2?s["return"]:a[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,a[1])).done)return i;if(s=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;s=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(a[0]===6&&o.label<i[1]){o.label=i[1];i=a;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(a);break}if(i[2])o.ops.pop();o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t];s=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,o){if(o||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++){if(i||!(n in e)){if(!i)i=Array.prototype.slice.call(e,0,n);i[n]=e[n]}}return t.concat(i||Array.prototype.slice.call(e))};import{r as registerInstance,d as createEvent,h,a as Host,g as getElement}from"./index-cfd394c8.js";import{t as throttle_1}from"./throttle-c4c24e86.js";import{W as extractName,b as stripeStore,t as trackConversionEvent,J as stripeStoreOnChange,w as stripeStorePrefetchLandedCost,d as cartStore}from"./cart-d04742f5.js";import{s as storageStore,B as getFallbackDefaultCountryCode,t as translate,A as storageStoreOnChange,l as localizationStore}from"./localization-36a4dc22.js";import{z as zonosStore,g as getZonosStoreTheme,f as zonosStoreFontFamily}from"./zonosStore-eca1e364.js";import{l as logError,i as isCheckoutMobile,s as sendErrorLog}from"./handleFetch-a844cac1.js";import{a as shouldRenderTaxIdInput,s as shouldRenderShortAddressCodeInput}from"./shouldRenderTaxIdInput-ef7b5860.js";import{c as classes}from"./classes-0d95c529.js";import{l as log}from"./VarianceTest-572cecf5.js";import{c as countryRequireTaxId,s as shipToTaxIdLabels}from"./TaxId-63a14057.js";import{g as getBorderRadius}from"./getBorderRadius-1f7be586.js";import"./debounce-84ade9c2.js";import"./isDarkColor-939d8e9c.js";import"./ShortAddressCode-7620e622.js";var mapAddressEventToContact=function(t){var e=extractName({firstName:t.firstName,lastName:t.lastName,name:t.name}),o=e.firstName,n=e.lastName;return{address:{city:t.address.city,country:t.address.country,line1:t.address.line1,line2:t.address.line2||undefined,postal_code:t.address.postal_code,state:t.address.state},name:(t.name||"".concat(o," ").concat(n)).trim(),phone:t.phone||undefined}};var getContactDedupKey=function(t){var e,o,n;return[t.name,(e=t.address)===null||e===void 0?void 0:e.line1,(o=t.address)===null||o===void 0?void 0:o.postal_code,(n=t.address)===null||n===void 0?void 0:n.country].map((function(t){return(t||"").trim().toLowerCase()})).join("|")};var buildAddressContacts=function(t){var e=t.currentEvent,o=t.defaultAddress;if(!e){return o}var n=mapAddressEventToContact(e.value);var s=getContactDedupKey(n);var i=o.some((function(t){return getContactDedupKey(t)===s}));if(i){return o}return __spreadArray([n],o,true)};var zonosAddressCss=".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--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--company-name-input.sc-zonos-address,.sc-zonos-address-h .zonos--tax-id-input.sc-zonos-address,.sc-zonos-address-h .zonos--short-address-code-input.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";var ZonosAddressStyle0=zonosAddressCss;var ZonosAddress=function(){function t(t){registerInstance(this,t);this.invalidCharacters=createEvent(this,"invalidCharacters",7);this.taxIdChanged=createEvent(this,"taxIdChanged",7);this.storeUnsubscribeList=[];this.isAutoCompleteAdjusted=false;this.defaultAddress=[];this.taxIdErrorMessage="";this.shortAddressCodeErrorMessage="";this.stripe=window.Zonos.stripe;this.isDirtyAddress=false;this.isAddressFilled=false;this.checkoutSessionId=storageStore.checkoutSessionId;this.prevCountry=null;this.prevPostalCode=null;this.trackingSent=false;this.prefetchLandedCost=throttle_1(stripeStorePrefetchLandedCost,1e3)}t.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:stripeStore.stripeBillingAddressElement,stripeAddressEventData:stripeStore.stripeBillingAddressEventData,stripeElements:stripeStore.stripeElementsForBillingAddress}}return{stripeAddressElement:stripeStore.stripeAddressElement,stripeAddressEventData:stripeStore.stripeAddressEventData,stripeElements:stripeStore.stripeElements}};t.prototype.updateAddressEventData=function(t){var e=t.event,o=t.type;switch(o){case"billing":stripeStore.stripeBillingAddressEventData=e;break;default:{stripeStore.stripeAddressEventData=e;break}}if(o==="shipping"){if(e.value.address.line1.length){void this.prefetchLandedCost()}}};t.prototype.isAddressFilledChanged=function(){if(!storageStore.checkoutSessionId){return}if(this.isAddressFilled&&!this.trackingSent&&this.type==="shipping"){this.trackingSent=true;var t=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:t,eventName:"checkout_customerInfoFilled"})}};t.prototype.updateAddressElement=function(t){var e=t.stripeAddressElement,o=t.type;if(o==="shipping"){stripeStore.stripeAddressElement=e;return}stripeStore.stripeBillingAddressElement=e};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,o,n,s,i,r,a,l,c;var d=this;return __generator(this,(function(h){this.stripe=window.Zonos.stripe;t=this.getStripeAddressInstance(),e=t.stripeAddressEventData,o=t.stripeElements;if(!this.stripe||!o){logError("Stripe is not initialized. Couldn't load stripe element.");return[2]}n=this.defaultAddress.map((function(t){return Object.assign(Object.assign({},t),{name:t.name,phone:t.phone||undefined})}));s=localizationStore.shippingZoneCountries;i=s?Object.values(s).map((function(t){return t.code})):[];r=new URLSearchParams(window.location.search).has("zonosCheckoutAllCountries");a=this.type==="shipping"?i:[];l=(e===null||e===void 0?void 0:e.value.address.country)||getFallbackDefaultCountryCode(a);log("Stripe country code: ".concat(l),"info");c=o.create("address",{allowedCountries:r?[]:a,contacts:buildAddressContacts({currentEvent:e,defaultAddress:n}),defaultValues:{address:Object.assign(Object.assign({},e===null||e===void 0?void 0:e.value.address),{country:l}),firstName:e===null||e===void 0?void 0:e.value.firstName,lastName:e===null||e===void 0?void 0:e.value.lastName,phone:e===null||e===void 0?void 0:e.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});c.mount(this.el.querySelector(".zonos--address-component"));if(e===null||e===void 0?void 0:e.value.address){this.prevCountry=e.value.address.country;this.prevPostalCode=e.value.address.postal_code}c.on("change",(function(t){var e=t.value;if(!d.isDirtyAddress&&e.address.line1.length>=3){d.isDirtyAddress=true;if(!d.isAutoCompleteAdjusted){var o=d.el.querySelector('iframe[src*="autocomplete-suggestions"]');if(o){o.style.zIndex="3"}d.isAutoCompleteAdjusted=true}setTimeout((function(){if(isCheckoutMobile()){d.el.scrollIntoView({behavior:"smooth",block:"end"})}else{var t=d.type==="shipping"?100:600;var e=d.el.closest(".zonos--group");var o=d.el.getBoundingClientRect().top+t;e===null||e===void 0?void 0:e.scrollTo({behavior:"smooth",top:o})}}),600)}var n=extractName({firstName:e.firstName,lastName:e.lastName,name:e.name}),s=n.firstName,i=n.lastName;d.updateAddressEventData({event:Object.assign(Object.assign({},t),{elementMode:d.type,elementType:"address",value:Object.assign(Object.assign({},e),{firstName:s,lastName:i})}),type:d.type})}));this.updateAddressElement({stripeAddressElement:c,type:this.type});return[2]}))}))};t.prototype.defaultAddressChanged=function(t,e){var o=JSON.stringify(e);var n=JSON.stringify(t);if(o===n){return}log("Reset address element when default address property is changed","info",{defaultAddress:this.defaultAddress});var s=this.getStripeAddressInstance().stripeAddressElement;s===null||s===void 0?void 0:s.clear();s===null||s===void 0?void 0:s.destroy();if(this.type==="shipping"){stripeStore.stripeAddressEventData=null}else{stripeStore.stripeBillingAddressEventData=null}void this.watchInitStripe()};t.prototype.isInTaxIdCountry=function(t){return countryRequireTaxId.includes(t)};t.prototype.renderTaxIdInput=function(){var t=this;var e;if(this.type==="billing"){return null}var o=(e=stripeStore.stripeAddressEventData)===null||e===void 0?void 0:e.value.address.country;if(!o){return null}if(!this.isInTaxIdCountry(o)){return null}var n=shouldRenderTaxIdInput({companyName:stripeStore.companyName,countryCode:o});if(!n){return null}var s=shipToTaxIdLabels[o];return h("div",{class:"zonos--tax-id-input"},h("zonos-stripe-input",{inputLabel:translate(s.friendlyName),inputPlaceholder:s.placeholder,inputValue:stripeStore.taxId||"",isError:!!this.taxIdErrorMessage,onInputChange:function(e){stripeStore.taxId=e.detail;t.taxIdChanged.emit(e.detail)}}),this.taxIdErrorMessage&&h("zonos-text",{textColor:"red-600",type:"caption"},this.taxIdErrorMessage))};t.prototype.renderShortAddressCodeInput=function(){var t;if(this.type==="billing"){return null}var e=(t=stripeStore.stripeAddressEventData)===null||t===void 0?void 0:t.value.address.country;if(!e){return null}var o=shouldRenderShortAddressCodeInput({countryCode:e});if(!o){return null}return h("div",{class:"zonos--short-address-code-input"},h("zonos-stripe-input",{inputLabel:translate("Short address code"),inputPlaceholder:"RRRD2929",inputValue:stripeStore.shortAddressCode||"",isError:!!this.shortAddressCodeErrorMessage,onInputChange:function(t){stripeStore.shortAddressCode=t.detail}}),this.shortAddressCodeErrorMessage&&h("zonos-text",{textColor:"red-600",type:"caption"},this.shortAddressCodeErrorMessage))};t.prototype.renderCompanyNameInput=function(){if(this.type==="billing"&&!window.Zonos.isCollect&&!window.Zonos.isInvoice){return null}var t=zonosStore.checkoutSettings.companyFieldsStatus==="ENABLED"||!!window.Zonos.isCollect||!!window.Zonos.isInvoice;if(!t){return null}return h("zonos-stripe-input",{class:"zonos--company-name-input",inputLabel:translate("Company name (optional)"),inputValue:stripeStore.companyName,onInputChange:function(t){stripeStore.companyName=t.detail}})};t.prototype.disconnectedCallback=function(){var t=this.getStripeAddressInstance().stripeAddressElement;t===null||t===void 0?void 0:t.destroy();try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;var e=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!e&&e.value.address.line1.length>0;void this.watchInitStripe();this.checkoutSessionId=storageStore.checkoutSessionId;this.storeUnsubscribeList=[storageStoreOnChange("checkoutSessionId",(function(){t.checkoutSessionId=storageStore.checkoutSessionId})),stripeStoreOnChange("stripeElements",(function(){if(t.type==="shipping"){void t.watchInitStripe()}})),stripeStoreOnChange("stripeElementsForBillingAddress",(function(){if(t.type==="billing"){void t.watchInitStripe()}}))]};t.prototype.render=function(){var t;this.checkoutSessionId=storageStore.checkoutSessionId;if((t=stripeStore.stripeAddressEventData)===null||t===void 0?void 0:t.complete){this.isAddressFilled=true}return h(Host,{key:"9b7a5340b839d63c64da03639bdfda5a11a5c25e",class:classes(["zonos--address","zonos--elements","zonos--".concat(this.type,"-address")])},this.titleText&&h("zonos-text",{key:"23739f6a48e5698372df2d53098dea6ad1c0559a",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("slot",{key:"dea4b437eedaad2af2f6bbe3a1e2ae4f0706aa13",name:"below-title"}),this.renderCompanyNameInput(),this.renderTaxIdInput(),this.renderShortAddressCodeInput(),h("div",{key:"b4be684977a632371b9b6ff4587ccdd7bacc8c67",class:"zonos--address-component"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{checkoutSessionId:["isAddressFilledChanged"],isAddressFilled:["isAddressFilledChanged"],stripe:["watchInitStripe"],defaultAddress:["defaultAddressChanged"]}},enumerable:false,configurable:true});return t}();ZonosAddress.style=ZonosAddressStyle0;var ExclamationMarkDuotoneIcon='<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-400)"></path>\n <path d="M12.75 9a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V9Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var HelpDuotoneIcon='<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-400)"></path>\n <path d="M10.25 10.25a1.75 1.75 0 1 1 2.431 1.613c-.616.26-1.431.885-1.431 1.887a.75.75 0 0 0 1.5 0c0-.053.02-.128.108-.228.092-.104.236-.205.408-.278A3.25 3.25 0 1 0 8.75 10.25a.75.75 0 0 0 1.5 0Zm2.5 5.75a.75.75 0 0 0-1.5 0v.25a.75.75 0 0 0 1.5 0V16Z" fill="currentColor"></path>\n</svg>';var WarningDuotoneIcon='<svg color="var(--zonos-elements-orange-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M14.46 5.492c-1.014-2.027-3.906-2.027-4.92 0L4.276 16.02c-.914 1.83.416 3.98 2.46 3.98h10.528c2.044 0 3.374-2.151 2.46-3.98L14.46 5.492Z" data-is-secondary-color="true" fill="var(--zonos-elements-orange-400)"></path>\n <path d="M12.75 10a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V10Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var zonosConfirmDialogCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--confirm-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:opacity 0.3s, visibility 0.3s;transition:opacity 0.3s, visibility 0.3s}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--confirm-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(--zonos-elements-text-color)}:host .zonos--confirm-dialog{position:relative;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;width:var(--zonos--dialog-width);border-radius:var(--zonos--border-radius, 10px);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;gap:24px}:host .icon-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:40px;width:40px;border-radius:50%;background:var(--zonos-elements-blue-100)}:host .warn .icon-wrapper{background:var(--zonos-elements-orange-100)}:host .danger .icon-wrapper{background:var(--zonos-elements-red-100)}:host .footer{display:-ms-flexbox;display:flex;width:100%;gap:8px}:host .footer zonos-button{-ms-flex:1;flex:1}:host .content{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .content zonos-text{text-align:center}:host(.open) .zonos--confirm-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483009;opacity:0.65}:host(.open) .zonos--confirm-layout{opacity:1;z-index:2147483010;-webkit-transform:scale(1);transform:scale(1)}";var ZonosConfirmDialogStyle0=zonosConfirmDialogCss;var ZonosConfirmDialog=function(){function t(t){var e=this;registerInstance(this,t);this.confirmClicked=createEvent(this,"confirmClicked",7);this.cancelClicked=createEvent(this,"cancelClicked",7);this.dialogTitle=translate("Are you sure?");this.dialogIntent="info";this.dialogSubtitle=null;this.dialogWidth=350;this.dialogType="confirm";this.isMobile=false;this.noClickOutside=false;this.clickOutsideDialogHandler=function(t){if(t.target===t.currentTarget&&!e.noClickOutside){e.closeDialogHandler()}}}t.prototype.handleKeyDown=function(t){if(t.key==="Escape"){this.closeDialogHandler()}};t.prototype.focusDialog=function(){var t=this;if(this.dialogOpen){setTimeout((function(){var e,o;(o=(e=t.el.shadowRoot)===null||e===void 0?void 0:e.querySelector(".zonos--backdrop"))===null||o===void 0?void 0:o.focus()}),100)}};t.prototype.confirmDialogHandler=function(){if(!this.dialogOpen){return}this.confirmClicked.emit()};t.prototype.closeDialogHandler=function(){if(!this.dialogOpen){return}this.cancelClicked.emit()};t.prototype.renderIcon=function(){switch(this.dialogIntent){case"info":return h("zonos-icon",{content:HelpDuotoneIcon,iconColor:"blue-800"});case"danger":return h("zonos-icon",{content:ExclamationMarkDuotoneIcon,iconColor:"red-800"});case"warn":return h("zonos-icon",{content:WarningDuotoneIcon,iconColor:"orange-800"})}};t.prototype.getButtonConfirmVariant=function(){switch(this.dialogIntent){case"warn":return"warning";case"danger":return"danger";default:return"primary"}};t.prototype.render=function(){var t=this;this.focusDialog();var e=getBorderRadius();var o=getZonosStoreTheme(zonosStore.appearance.theme);return h(Host,{key:"9ad8aff8631692fa53ef172869d98e9fbfbdc059",class:classes([this.dialogOpen&&"open","zonos--elements"]),"data-dialog-type":this.dialogType,"data-theme":o,style:{"--zonos--border-radius":e,"--zonos--dialog-width":"".concat(this.dialogWidth,"px"),"--zonos--font-family":zonosStoreFontFamily()}},h("div",{key:"6d7c55b90bfb05890d876a0243558eb9a2e7a772",class:"zonos--backdrop",tabIndex:-1}),h("div",{key:"abf306ddd70cefd64aa6804aeccf700506c175d7",class:classes(["zonos--confirm-layout",this.dialogIntent]),onClick:function(e){return t.clickOutsideDialogHandler(e)}},h("div",{key:"dc7e9e6d501872597928603ded57d82c15c26710",class:"zonos--confirm-dialog",onBlur:function(){t.focusDialog()}},h("div",{key:"5c1fa9ec8b59cba68ccbc5dc36e66e2fdefdeae5",class:"wrapper"},h("div",{key:"0ce48c41c78e393a181fd5e9beeac90622b5c620",class:"icon-wrapper"},this.renderIcon()),h("div",{key:"b42157f8e76de8a60190e384d7d53a36d8051c67",class:"content"},h("div",{key:"bd8eb897f15a6d095df8fbd1803f62a11b9d5d7b",class:"title"},h("zonos-text",{key:"d1c06b89d4917b2366f881dda7da9e1369722126",type:"subheader"},this.dialogTitle)),this.dialogSubtitle&&h("div",{key:"4f1269aaab5ad3965d6ddfc0949341d4f202f296",class:"subtitle"},h("zonos-text",{key:"f784b5dd86ff684e790f27a586e3eeb4ac683884",textColor:"gray-800"},this.dialogSubtitle))),h("div",{key:"e0403a968aee6ff878c9e916e9ff216e2052ab0c",class:"footer"},this.dialogType==="confirm"&&h("zonos-button",{key:"66e34a9d61f677786bfe286f377854c9ebc780ed",backgroundColor:"gray-0",class:"cancel-button",onClick:function(){return t.closeDialogHandler()},size:"lg",withBoxShadow:true},this.dialogCancelBtnText||translate("Cancel")),h("zonos-button",{key:"3652507591e3055856a044e191525ea36b6042ca",class:"confirm-button",onClick:function(){return t.confirmDialogHandler()},size:"lg",variant:this.getButtonConfirmVariant()},this.dialogConfirmBtnText))))))};Object.defineProperty(t,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ZonosConfirmDialog.style=ZonosConfirmDialogStyle0;var validateEmailValue=function(t){var e=/^[a-zA-Z0-9.%_+-]*@[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z0-9]{2,}$/;return e.test(t)};var zonosLinkAuthenticationCss=".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--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}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}";var ZonosLinkAuthenticationStyle0=zonosLinkAuthenticationCss;var MAX_RETRIES_INITIALIZE_LINK=51;var ZonosLinkAuthentication=function(){function t(t){var e=this;registerInstance(this,t);this.linkAuthenticationChange=createEvent(this,"linkAuthenticationChange",7);this.storeUnsubscribeList=[];this.defaultEmail=null;this.isEmailError=false;this.stripe=stripeStore.stripe;this.isStagingMode=cartStore.isStagingMode;this.clientSecret=stripeStore.clientSecret;this.retriesInitializeLink=0;this.setCustomEmailInputToLinkEvent=function(t){var e=validateEmailValue(t);var o={complete:!!e,elementType:"linkAuthentication",empty:!t,value:{email:t}};stripeStore.stripeLinkEventData=o};this.handleNormalEmailInput=function(t){var o;var n=t.detail;e.setCustomEmailInputToLinkEvent(n);(o=e.linkAuthenticationChange)===null||o===void 0?void 0:o.emit()}}t.prototype.watchIsStagingMode=function(){var t=this;setTimeout((function(){void t.watchInitStripe()}),0)};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,o,n;var s=this;return __generator(this,(function(i){switch(i.label){case 0:if(!this.stripe||!stripeStore.stripeElements){return[2]}if(cartStore.isStagingMode||!this.clientSecret){return[2]}t=this.defaultEmail?{email:this.defaultEmail}:undefined;i.label=1;case 1:i.trys.push([1,2,,6]);e=stripeStore.stripeLinkElement||stripeStore.stripeElements.create("linkAuthentication",{defaultValues:t});o=this.el.querySelector(".zonos--link-authentication-component");if(!o){logError("Cannot find container element for linkAuthenticationElement");return[2]}e.mount(o);e.on("change",(function(t){var e;stripeStore.stripeLinkEventData=t;(e=s.linkAuthenticationChange)===null||e===void 0?void 0:e.emit()}));stripeStore.stripeLinkElement=e;this.retriesInitializeLink=0;if(this.retriesInitializeLink>11){log("Stripe link element initialized","info",{retriesInitializeLink:this.retriesInitializeLink,stripe:this.stripe});void sendErrorLog({endpoint:"stripe-link-authentication-init-long-running",errors:["Stripe link element initialized after 20 retries - 10 seconds"],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}return[3,6];case 2:n=i.sent();if(!(n instanceof Error))return[3,5];this.retriesInitializeLink++;if(!(this.retriesInitializeLink<MAX_RETRIES_INITIALIZE_LINK))return[3,4];return[4,new Promise((function(t){return setTimeout(t,500)}))];case 3:i.sent();void this.watchInitStripe();i.label=4;case 4:if(this.retriesInitializeLink===MAX_RETRIES_INITIALIZE_LINK){void sendErrorLog({endpoint:"stripe-link-authentication-init-error",errors:[n.message],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}i.label=5;case 5:return[3,6];case 6:return[2]}}))}))};t.prototype.watchDefaultEmail=function(t,e){var o,n;log("Default email is changed","info",{newDefaultEmail:t,oldDefaultEmail:e});if(e===t){return}if(!t){stripeStore.stripeLinkEventData=null}if(cartStore.isStagingMode){this.setCustomEmailInputToLinkEvent(t||"");return}(o=stripeStore.stripeLinkElement)===null||o===void 0?void 0:o.clear();(n=stripeStore.stripeLinkElement)===null||n===void 0?void 0:n.destroy();stripeStore.stripeLinkElement=null;stripeStore.stripeLinkEventData=null;log("Reset stripe link element when default email is changed","info",{defaultEmail:t});void this.watchInitStripe()};t.prototype.disconnectedCallback=function(){try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;this.storeUnsubscribeList=[stripeStoreOnChange("stripeElements",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){void this.watchInitStripe();return[2]}))}))})),stripeStoreOnChange("clientSecret",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.clientSecret=stripeStore.clientSecret;return[2]}))}))})),stripeStoreOnChange("stripe",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.stripe=stripeStore.stripe;return[2]}))}))}))];void this.watchInitStripe();if(!this.defaultEmail){return}this.setCustomEmailInputToLinkEvent(this.defaultEmail)};t.prototype.render=function(){var t=this;this.isStagingMode=cartStore.isStagingMode;this.clientSecret=stripeStore.clientSecret;var e=function(){var e;if(cartStore.isStagingMode){return h("zonos-stripe-input",{inputLabel:translate("Email"),inputValue:t.defaultEmail||((e=stripeStore.stripeLinkEventData)===null||e===void 0?void 0:e.value.email)||"",isError:t.isEmailError,onBlur:function(){var e;var o=((e=stripeStore.stripeLinkEventData)===null||e===void 0?void 0:e.value.email)||"";if(!o){return}var n=validateEmailValue(o);t.isEmailError=!n},onInputChange:t.handleNormalEmailInput})}return h("div",{class:"zonos--link-authentication-component ".concat(t.isEmailError&&"zonos--input-invalid")})};return h(Host,{class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":getBorderRadius()}},this.titleText&&h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),e(),this.isEmailError&&h("zonos-text",{textColor:"red-600"},translate("Please enter a valid email address.")))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isStagingMode:["watchIsStagingMode"],stripe:["watchInitStripe"],clientSecret:["watchInitStripe"],defaultEmail:["watchDefaultEmail"]}},enumerable:false,configurable:true});return t}();ZonosLinkAuthentication.style=ZonosLinkAuthenticationStyle0;var zonosLoadingOverlayCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:fixed;inset:0;z-index:2147483010;pointer-events:none;display:block}:host .zonos--loading-overlay{position:fixed;inset:0;width:100vw;height:100vh;background:var(--zonos-elements-backdrop-color);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;opacity:0;visibility:hidden;-webkit-transition:opacity 0.3s ease, visibility 0.3s ease;transition:opacity 0.3s ease, visibility 0.3s ease;z-index:2147483010}:host(.zonos--open){pointer-events:auto}:host(.zonos--open) .zonos--loading-overlay{opacity:0.65;visibility:visible}";var ZonosLoadingOverlayStyle0=zonosLoadingOverlayCss;var ZonosLoadingOverlay=function(){function t(t){registerInstance(this,t);this.open=false;this.size=40}t.prototype.render=function(){return h(Host,{key:"8cafd99b309b04da5cf1b26b0f0804f4699c06b2",class:classes(["zonos--elements",this.open&&"zonos--open"])},h("div",{key:"9ce7ac9b7e6956a5f76fc2105fa7f5d05299fd36",class:"zonos--loading-overlay"},h("zonos-spinner",{key:"4be3a8d471e3aead2e4194c4ecbf66878a7a3f17",size:this.size,spinnerColor:this.spinnerColor})))};return t}();ZonosLoadingOverlay.style=ZonosLoadingOverlayStyle0;export{ZonosAddress as zonos_address,ZonosConfirmDialog as zonos_confirm_dialog,ZonosLinkAuthentication as zonos_link_authentication,ZonosLoadingOverlay as zonos_loading_overlay};
1
+ var __awaiter=this&&this.__awaiter||function(t,e,o,n){function s(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,i){function r(t){try{l(n.next(t))}catch(t){i(t)}}function a(t){try{l(n["throw"](t))}catch(t){i(t)}}function l(t){t.done?o(t.value):s(t.value).then(r,a)}l((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,s,i,r=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return r.next=a(0),r["throw"]=a(1),r["return"]=a(2),typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function a(t){return function(e){return l([t,e])}}function l(a){if(n)throw new TypeError("Generator is already executing.");while(r&&(r=0,a[0]&&(o=0)),o)try{if(n=1,s&&(i=a[0]&2?s["return"]:a[0]?s["throw"]||((i=s["return"])&&i.call(s),0):s.next)&&!(i=i.call(s,a[1])).done)return i;if(s=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:o.label++;return{value:a[1],done:false};case 5:o.label++;s=a[1];a=[0];continue;case 7:a=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){o=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(a[0]===6&&o.label<i[1]){o.label=i[1];i=a;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(a);break}if(i[2])o.ops.pop();o.trys.pop();continue}a=e.call(t,o)}catch(t){a=[6,t];s=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,o){if(o||arguments.length===2)for(var n=0,s=e.length,i;n<s;n++){if(i||!(n in e)){if(!i)i=Array.prototype.slice.call(e,0,n);i[n]=e[n]}}return t.concat(i||Array.prototype.slice.call(e))};import{r as registerInstance,d as createEvent,h,a as Host,g as getElement}from"./index-_lt63o7c.js";import{t as throttle}from"./throttle-D5GyA3yr.js";import{U as extractName,w as stripeStorePrefetchLandedCost,b as stripeStore,t as trackConversionEvent,J as stripeStoreOnChange,d as cartStore}from"./cart-ekBk_gxV.js";import{s as storageStore,l as localizationStore,B as getFallbackDefaultCountryCode,t as translate,y as storageStoreOnChange}from"./localization-AOqYXGdP.js";import{z as zonosStore,g as getZonosStoreTheme,a as zonosStoreFontFamily}from"./zonosStore-DrIOAz4M.js";import{l as logError,i as isCheckoutMobile,s as sendErrorLog}from"./handleFetch-D5GYDF-O.js";import{a as shouldRenderTaxIdInput,s as shouldRenderShortAddressCodeInput}from"./shouldRenderTaxIdInput-CKyZ6Zni.js";import{c as classes}from"./classes-BJHSB96f.js";import{l as log}from"./VarianceTest-BJmZPrZl.js";import{c as countryRequireTaxId,s as shipToTaxIdLabels}from"./TaxId-Cye-evFK.js";import{g as getBorderRadius}from"./getBorderRadius-HwG64EKM.js";import"./debounce-D4ko2kvZ.js";import"./isDarkColor-YdrG78th.js";import"./ShortAddressCode-nJ6oI8-n.js";
2
+ /**
3
+ * Map a Stripe address change event value into a Stripe `ContactOption`, used to
4
+ * pre-seed the address element's saved-address (contacts) list on remount.
5
+ */var mapAddressEventToContact=function(t){var e=extractName({firstName:t.firstName,lastName:t.lastName,name:t.name}),o=e.firstName,n=e.lastName;return{address:{city:t.address.city,country:t.address.country,line1:t.address.line1,line2:t.address.line2||undefined,postal_code:t.address.postal_code,state:t.address.state},name:(t.name||"".concat(o," ").concat(n)).trim(),phone:t.phone||undefined}};
6
+ /**
7
+ * Build a dedupe key for a contact so we don't add a duplicate saved address. Compared
8
+ * case- and whitespace-insensitively on the distinguishing fields.
9
+ */var getContactDedupKey=function(t){var e,o,n;return[t.name,(e=t.address)===null||e===void 0?void 0:e.line1,(o=t.address)===null||o===void 0?void 0:o.postal_code,(n=t.address)===null||n===void 0?void 0:n.country].map((function(t){return(t||"").trim().toLowerCase()})).join("|")};
10
+ /**
11
+ * Prepend the currently selected address (from the latest Stripe address event) to the
12
+ * list of default saved addresses so it stays selected when the address element is
13
+ * remounted (e.g. navigating between the customer and shipping steps). Avoids adding a
14
+ * duplicate contact when the current address already exists in the list.
15
+ */var buildAddressContacts=function(t){var e=t.currentEvent,o=t.defaultAddress;if(!e){return o}var n=mapAddressEventToContact(e.value);var s=getContactDedupKey(n);var i=o.some((function(t){return getContactDedupKey(t)===s}));if(i){return o}return __spreadArray([n],o,true)};var zonosAddressCss=function(){return".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--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--company-name-input.sc-zonos-address,.sc-zonos-address-h .zonos--tax-id-input.sc-zonos-address,.sc-zonos-address-h .zonos--short-address-code-input.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}"};var ZonosAddress=/** @class */function(){function t(t){registerInstance(this,t);this.invalidCharacters=createEvent(this,"invalidCharacters",7);this.taxIdChanged=createEvent(this,"taxIdChanged",7);this.storeUnsubscribeList=[];
16
+ /**
17
+ * Google autocomplete overlay is conflict with our button, this is to adjust z index of the autocomplete
18
+ */this.isAutoCompleteAdjusted=false;
19
+ /**
20
+ * Default address for stripe
21
+ */this.defaultAddress=[];
22
+ /**
23
+ * Error message for tax id input
24
+ */this.taxIdErrorMessage="";
25
+ /**
26
+ * Error message for short address code input
27
+ */this.shortAddressCodeErrorMessage="";this.stripe=window.Zonos.stripe;
28
+ /**
29
+ * Check if the address is dirty or not to scroll into view. When the component is mounted, if the data is filled with address line 1, it's considered dirty
30
+ */this.isDirtyAddress=false;
31
+ /**
32
+ * Local address event for stripe address element
33
+ */this.isAddressFilled=false;
34
+ /**
35
+ * Local checkout session id to check if the address is filled after checkout is loaded
36
+ */this.checkoutSessionId=storageStore.checkoutSessionId;
37
+ /**
38
+ * Track previous country and postal code to detect changes
39
+ */this.prevCountry=null;this.prevPostalCode=null;
40
+ /**
41
+ * Check if the tracking event is sent
42
+ */this.trackingSent=false;this.prefetchLandedCost=throttle(stripeStorePrefetchLandedCost,1e3)}t.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:stripeStore.stripeBillingAddressElement,stripeAddressEventData:stripeStore.stripeBillingAddressEventData,stripeElements:stripeStore.stripeElementsForBillingAddress}}return{stripeAddressElement:stripeStore.stripeAddressElement,stripeAddressEventData:stripeStore.stripeAddressEventData,stripeElements:stripeStore.stripeElements}};t.prototype.updateAddressEventData=function(t){var e=t.event,o=t.type;switch(o){case"billing":stripeStore.stripeBillingAddressEventData=e;break;default:{stripeStore.stripeAddressEventData=e;break}}
43
+ // Only trigger landed cost prefetch for shipping address
44
+ if(o==="shipping"){
45
+ // if line 1 has something, trigger prefetch
46
+ if(e.value.address.line1.length){void this.prefetchLandedCost()}}};t.prototype.isAddressFilledChanged=function(){
47
+ // Sometimes address elements is loaded with prefilled data before checkout is loaded, need to not send the event if checkout session id is not available, and send the event after checkout is loaded
48
+ if(!storageStore.checkoutSessionId){return}
49
+ // Only need to track the event if the shipping address is filled
50
+ if(this.isAddressFilled&&!this.trackingSent&&this.type==="shipping"){this.trackingSent=true;var t=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:t,eventName:"checkout_customerInfoFilled"})}};t.prototype.updateAddressElement=function(t){var e=t.stripeAddressElement,o=t.type;if(o==="shipping"){stripeStore.stripeAddressElement=e;return}stripeStore.stripeBillingAddressElement=e};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,o,n,s,i,r,a,l,c;var d=this;return __generator(this,(function(h){this.stripe=window.Zonos.stripe;t=this.getStripeAddressInstance(),e=t.stripeAddressEventData,o=t.stripeElements;if(!this.stripe||!o){logError("Stripe is not initialized. Couldn't load stripe element.");return[2/*return*/]}n=this.defaultAddress.map((function(t){return Object.assign(Object.assign({},t),{name:t.name,phone:t.phone||undefined})}));s=localizationStore.shippingZoneCountries;i=s?Object.values(s).map((function(t){return t.code})):[];r=new URLSearchParams(window.location.search).has("zonosCheckoutAllCountries");a=this.type==="shipping"?i:[];l=(e===null||e===void 0?void 0:e.value.address.country)||getFallbackDefaultCountryCode(a);log("Stripe country code: ".concat(l),"info");c=o.create("address",{allowedCountries:r?[]:a,
51
+ // Prepend the currently selected address so it stays selected across remounts
52
+ // (customer <-> shipping step navigation), de-duped against the default addresses.
53
+ // Contacts are computed once here at create() time and never mutated afterwards—
54
+ // mutating the contacts value after a remount breaks the element's onChange events.
55
+ contacts:buildAddressContacts({currentEvent:e,defaultAddress:n}),defaultValues:{address:Object.assign(Object.assign({},e===null||e===void 0?void 0:e.value.address),{country:l}),firstName:e===null||e===void 0?void 0:e.value.firstName,lastName:e===null||e===void 0?void 0:e.value.lastName,phone:e===null||e===void 0?void 0:e.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});c.mount(this.el.querySelector(".zonos--address-component"));
56
+ // Initialize previous values if address data exists
57
+ if(e===null||e===void 0?void 0:e.value.address){this.prevCountry=e.value.address.country;this.prevPostalCode=e.value.address.postal_code}c.on("change",(function(t){var e=t.value;if(!d.isDirtyAddress&&e.address.line1.length>=3){d.isDirtyAddress=true;if(!d.isAutoCompleteAdjusted){var o=d.el.querySelector('iframe[src*="autocomplete-suggestions"]');if(o){o.style.zIndex="3"}d.isAutoCompleteAdjusted=true}
58
+ // stripe element started with just address line 1, so scroll bar is not yet available. Wait for a moment before scrolling
59
+ setTimeout((function(){
60
+ // scroll directly into view if it's mobile
61
+ if(isCheckoutMobile()){d.el.scrollIntoView({behavior:"smooth",block:"end"})}else{
62
+ // scroll into the end of the page so the address placeholder won't be hidden
63
+ var t=d.type==="shipping"?100:600;var e=d.el.closest(".zonos--group");var o=d.el.getBoundingClientRect().top+t;e===null||e===void 0?void 0:e.scrollTo({behavior:"smooth",top:o})}}),600)}var n=extractName({firstName:e.firstName,lastName:e.lastName,name:e.name}),s=n.firstName,i=n.lastName;d.updateAddressEventData({event:Object.assign(Object.assign({},t),{elementMode:d.type,elementType:"address",value:Object.assign(Object.assign({},e),{firstName:s,lastName:i})}),type:d.type})}));this.updateAddressElement({stripeAddressElement:c,type:this.type});return[2/*return*/]}))}))};t.prototype.defaultAddressChanged=function(t,e){
64
+ // check if stringified json of oldAddress is different from newAddress
65
+ var o=JSON.stringify(e);var n=JSON.stringify(t);
66
+ // No need to reset address element if the default address is the same
67
+ if(o===n){return}log("Reset address element when default address property is changed","info",{defaultAddress:this.defaultAddress});var s=this.getStripeAddressInstance().stripeAddressElement;s===null||s===void 0?void 0:s.clear();s===null||s===void 0?void 0:s.destroy();
68
+ // Reset stripe address event data
69
+ if(this.type==="shipping"){stripeStore.stripeAddressEventData=null}else{stripeStore.stripeBillingAddressEventData=null}void this.watchInitStripe()};t.prototype.isInTaxIdCountry=function(t){return countryRequireTaxId.includes(t)};
70
+ /**
71
+ * Render tax id input based on ship to country code
72
+ */t.prototype.renderTaxIdInput=function(){var t=this;var e;
73
+ // No need to render tax id input for billing address
74
+ if(this.type==="billing"){return null}var o=(e=stripeStore.stripeAddressEventData)===null||e===void 0?void 0:e.value.address.country;
75
+ // Don't render tax id input if the country is not provided
76
+ if(!o){return null}
77
+ // This just to type guard the countryCode, if it's able to get to this point it should already be in country that has tax id input
78
+ if(!this.isInTaxIdCountry(o)){return null}var n=shouldRenderTaxIdInput({companyName:stripeStore.companyName,countryCode:o});
79
+ // Don't render tax id input if the country doesn't require tax id
80
+ if(!n){return null}var s=shipToTaxIdLabels[o];return h("div",{class:"zonos--tax-id-input"},h("zonos-stripe-input",{inputLabel:translate(s.friendlyName),inputPlaceholder:s.placeholder,inputValue:stripeStore.taxId||"",isError:!!this.taxIdErrorMessage,onInputChange:function(e){stripeStore.taxId=e.detail;t.taxIdChanged.emit(e.detail)}}),this.taxIdErrorMessage&&h("zonos-text",{textColor:"red-600",type:"caption"},this.taxIdErrorMessage))};
81
+ /**
82
+ * Render short address code input based on ship to country code
83
+ */t.prototype.renderShortAddressCodeInput=function(){var t;
84
+ // No need to render short address code input for billing address
85
+ if(this.type==="billing"){return null}var e=(t=stripeStore.stripeAddressEventData)===null||t===void 0?void 0:t.value.address.country;
86
+ // Don't render short address code input if the country is not provided
87
+ if(!e){return null}var o=shouldRenderShortAddressCodeInput({countryCode:e});
88
+ // Don't render short address code input if the country doesn't require short address code
89
+ if(!o){return null}return h("div",{class:"zonos--short-address-code-input"},h("zonos-stripe-input",{inputLabel:translate("Short address code"),inputPlaceholder:"RRRD2929",inputValue:stripeStore.shortAddressCode||"",isError:!!this.shortAddressCodeErrorMessage,onInputChange:function(t){stripeStore.shortAddressCode=t.detail}}),this.shortAddressCodeErrorMessage&&h("zonos-text",{textColor:"red-600",type:"caption"},this.shortAddressCodeErrorMessage))};t.prototype.renderCompanyNameInput=function(){
90
+ // No need to render company name for billing address (only allow for Collect and Invoice)
91
+ if(this.type==="billing"&&!window.Zonos.isCollect&&!window.Zonos.isInvoice){return null}
92
+ // only render the company input if the setting is enabled or the cart is collect
93
+ var t=zonosStore.checkoutSettings.companyFieldsStatus==="ENABLED"||!!window.Zonos.isCollect||!!window.Zonos.isInvoice;
94
+ // No need to render company name for billing address (only allow for Collect)
95
+ if(!t){return null}return h("zonos-stripe-input",{class:"zonos--company-name-input",inputLabel:translate("Company name (optional)"),inputValue:stripeStore.companyName,onInputChange:function(t){stripeStore.companyName=t.detail}})};t.prototype.disconnectedCallback=function(){
96
+ // destroy the stripe element when this component is removed from the DOM, so that we can re-create the new one with previous value
97
+ var t=this.getStripeAddressInstance().stripeAddressElement;t===null||t===void 0?void 0:t.destroy();
98
+ // unsubscribe from store subscriptions
99
+ try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;var e=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!e&&e.value.address.line1.length>0;
100
+ // @Watch doesn't get trigger on initial load
101
+ void this.watchInitStripe();this.checkoutSessionId=storageStore.checkoutSessionId;this.storeUnsubscribeList=[storageStoreOnChange("checkoutSessionId",(function(){t.checkoutSessionId=storageStore.checkoutSessionId})),stripeStoreOnChange("stripeElements",(function(){if(t.type==="shipping"){void t.watchInitStripe()}})),stripeStoreOnChange("stripeElementsForBillingAddress",(function(){if(t.type==="billing"){void t.watchInitStripe()}}))]};t.prototype.render=function(){var t;this.checkoutSessionId=storageStore.checkoutSessionId;if((t=stripeStore.stripeAddressEventData)===null||t===void 0?void 0:t.complete){this.isAddressFilled=true}
102
+ // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
103
+ return h(Host,{key:"9b7a5340b839d63c64da03639bdfda5a11a5c25e",class:classes(["zonos--address","zonos--elements","zonos--".concat(this.type,"-address")])},this.titleText&&h("zonos-text",{key:"23739f6a48e5698372df2d53098dea6ad1c0559a",class:"zonos--title",type:"semiBoldLabel"},this.titleText),h("slot",{key:"dea4b437eedaad2af2f6bbe3a1e2ae4f0706aa13",name:"below-title"}),this.renderCompanyNameInput(),this.renderTaxIdInput(),this.renderShortAddressCodeInput(),h("div",{key:"b4be684977a632371b9b6ff4587ccdd7bacc8c67",class:"zonos--address-component"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{checkoutSessionId:[{isAddressFilledChanged:0}],isAddressFilled:[{isAddressFilledChanged:0}],stripe:[{watchInitStripe:0}],defaultAddress:[{defaultAddressChanged:0}]}},enumerable:false,configurable:true});return t}();ZonosAddress.style=zonosAddressCss();var ExclamationMarkDuotoneIcon='<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-400)"></path>\n <path d="M12.75 9a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V9Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var HelpDuotoneIcon='<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-400)"></path>\n <path d="M10.25 10.25a1.75 1.75 0 1 1 2.431 1.613c-.616.26-1.431.885-1.431 1.887a.75.75 0 0 0 1.5 0c0-.053.02-.128.108-.228.092-.104.236-.205.408-.278A3.25 3.25 0 1 0 8.75 10.25a.75.75 0 0 0 1.5 0Zm2.5 5.75a.75.75 0 0 0-1.5 0v.25a.75.75 0 0 0 1.5 0V16Z" fill="currentColor"></path>\n</svg>';var WarningDuotoneIcon='<svg color="var(--zonos-elements-orange-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M14.46 5.492c-1.014-2.027-3.906-2.027-4.92 0L4.276 16.02c-.914 1.83.416 3.98 2.46 3.98h10.528c2.044 0 3.374-2.151 2.46-3.98L14.46 5.492Z" data-is-secondary-color="true" fill="var(--zonos-elements-orange-400)"></path>\n <path d="M12.75 10a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V10Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var zonosConfirmDialogCss=function(){return":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--confirm-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:opacity 0.3s, visibility 0.3s;transition:opacity 0.3s, visibility 0.3s}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--confirm-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(--zonos-elements-text-color)}:host .zonos--confirm-dialog{position:relative;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;width:var(--zonos--dialog-width);border-radius:var(--zonos--border-radius, 10px);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;gap:24px}:host .icon-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:40px;width:40px;border-radius:50%;background:var(--zonos-elements-blue-100)}:host .warn .icon-wrapper{background:var(--zonos-elements-orange-100)}:host .danger .icon-wrapper{background:var(--zonos-elements-red-100)}:host .footer{display:-ms-flexbox;display:flex;width:100%;gap:8px}:host .footer zonos-button{-ms-flex:1;flex:1}:host .content{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .content zonos-text{text-align:center}:host(.open) .zonos--confirm-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483009;opacity:0.65}:host(.open) .zonos--confirm-layout{opacity:1;z-index:2147483010;-webkit-transform:scale(1);transform:scale(1)}"};var ZonosConfirmDialog=/** @class */function(){function t(t){var e=this;registerInstance(this,t);this.confirmClicked=createEvent(this,"confirmClicked",7);this.cancelClicked=createEvent(this,"cancelClicked",7);
104
+ /**
105
+ * Dialog title text
106
+ * @default "Are you sure?"
107
+ */this.dialogTitle=translate("Are you sure?");
108
+ /**
109
+ * Dialog intent (for icon and button color)
110
+ * @default "info"
111
+ */this.dialogIntent="info";
112
+ /**
113
+ * Dialog subtitle text
114
+ * @default null No subtitle
115
+ */this.dialogSubtitle=null;
116
+ /**
117
+ * Dialog width
118
+ * @default 350 px
119
+ */this.dialogWidth=350;
120
+ /**
121
+ * Type of dialog
122
+ * - "alert" - Only confirm button
123
+ * - "confirm" - Both Confirm and cancel buttons
124
+ * @default "confirm"
125
+ */this.dialogType="confirm";
126
+ /**
127
+ * Whether or not the dialog is open
128
+ */this.isMobile=false;
129
+ /**
130
+ * Whether or not to close the dialog when clicking outside of it
131
+ * @default false
132
+ */this.noClickOutside=false;this.clickOutsideDialogHandler=function(t){if(t.target===t.currentTarget&&!e.noClickOutside){e.closeDialogHandler()}}}t.prototype.handleKeyDown=function(t){if(t.key==="Escape"){this.closeDialogHandler()}};t.prototype.focusDialog=function(){var t=this;if(this.dialogOpen){setTimeout((function(){var e,o;
133
+ // Focus on a non tabable element (tabIndex=-1), so we will be able to tab to other tabable elements
134
+ (o=(e=t.el.shadowRoot)===null||e===void 0?void 0:e.querySelector(".zonos--backdrop"))===null||o===void 0?void 0:o.focus()}),100)}};t.prototype.confirmDialogHandler=function(){
135
+ // Only do the action if the dialog is open
136
+ if(!this.dialogOpen){return}
137
+ // Emit confirm event
138
+ this.confirmClicked.emit()};t.prototype.closeDialogHandler=function(){
139
+ // Only do the action if the dialog is open
140
+ if(!this.dialogOpen){return}
141
+ // Emit cancel event
142
+ this.cancelClicked.emit()};t.prototype.renderIcon=function(){switch(this.dialogIntent){case"info":return h("zonos-icon",{content:HelpDuotoneIcon,iconColor:"blue-800"});case"danger":return h("zonos-icon",{content:ExclamationMarkDuotoneIcon,iconColor:"red-800"});case"warn":return h("zonos-icon",{content:WarningDuotoneIcon,iconColor:"orange-800"})}};t.prototype.getButtonConfirmVariant=function(){switch(this.dialogIntent){case"warn":return"warning";case"danger":return"danger";default:return"primary"}};t.prototype.render=function(){var t=this;this.focusDialog();var e=getBorderRadius();
143
+ // Get theme for the update dialog, inherit from the theme, no from this component theme
144
+ var o=getZonosStoreTheme(zonosStore.appearance.theme);return h(Host,{key:"9ad8aff8631692fa53ef172869d98e9fbfbdc059",class:classes([this.dialogOpen&&"open","zonos--elements"]),"data-dialog-type":this.dialogType,"data-theme":o,style:{"--zonos--border-radius":e,"--zonos--dialog-width":"".concat(this.dialogWidth,"px"),"--zonos--font-family":zonosStoreFontFamily()}},h("div",{key:"6d7c55b90bfb05890d876a0243558eb9a2e7a772",class:"zonos--backdrop",tabIndex:-1}),h("div",{key:"abf306ddd70cefd64aa6804aeccf700506c175d7",class:classes(["zonos--confirm-layout",this.dialogIntent]),onClick:function(e){return t.clickOutsideDialogHandler(e)}},h("div",{key:"dc7e9e6d501872597928603ded57d82c15c26710",class:"zonos--confirm-dialog",onBlur:function(){t.focusDialog()}},h("div",{key:"5c1fa9ec8b59cba68ccbc5dc36e66e2fdefdeae5",class:"wrapper"},h("div",{key:"0ce48c41c78e393a181fd5e9beeac90622b5c620",class:"icon-wrapper"},this.renderIcon()),h("div",{key:"b42157f8e76de8a60190e384d7d53a36d8051c67",class:"content"},h("div",{key:"bd8eb897f15a6d095df8fbd1803f62a11b9d5d7b",class:"title"},h("zonos-text",{key:"d1c06b89d4917b2366f881dda7da9e1369722126",type:"subheader"},this.dialogTitle)),this.dialogSubtitle&&h("div",{key:"4f1269aaab5ad3965d6ddfc0949341d4f202f296",class:"subtitle"},h("zonos-text",{key:"f784b5dd86ff684e790f27a586e3eeb4ac683884",textColor:"gray-800"},this.dialogSubtitle))),h("div",{key:"e0403a968aee6ff878c9e916e9ff216e2052ab0c",class:"footer"},this.dialogType==="confirm"&&h("zonos-button",{key:"66e34a9d61f677786bfe286f377854c9ebc780ed",backgroundColor:"gray-0",class:"cancel-button",onClick:function(){return t.closeDialogHandler()},size:"lg",withBoxShadow:true},this.dialogCancelBtnText||translate("Cancel")),h("zonos-button",{key:"3652507591e3055856a044e191525ea36b6042ca",class:"confirm-button",onClick:function(){return t.confirmDialogHandler()},size:"lg",variant:this.getButtonConfirmVariant()},this.dialogConfirmBtnText))))))};Object.defineProperty(t,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return t}();ZonosConfirmDialog.style=zonosConfirmDialogCss();var validateEmailValue=function(t){var e=/^[a-zA-Z0-9.%_+-]*@[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z0-9]{2,}$/;return e.test(t)};var zonosLinkAuthenticationCss=function(){return".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--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}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}"};var MAX_RETRIES_INITIALIZE_LINK=51;var ZonosLinkAuthentication=/** @class */function(){function t(t){var e=this;registerInstance(this,t);this.linkAuthenticationChange=createEvent(this,"linkAuthenticationChange",7);this.storeUnsubscribeList=[];
145
+ /**
146
+ * Default email for stripe
147
+ */this.defaultEmail=null;
148
+ /**
149
+ * Email error text to dispaly
150
+ */this.isEmailError=false;this.stripe=stripeStore.stripe;this.isStagingMode=cartStore.isStagingMode;this.clientSecret=stripeStore.clientSecret;this.retriesInitializeLink=0;this.setCustomEmailInputToLinkEvent=function(t){
151
+ // check if the email is valid
152
+ var e=validateEmailValue(t);var o={complete:!!e,elementType:"linkAuthentication",empty:!t,value:{email:t}};stripeStore.stripeLinkEventData=o};this.handleNormalEmailInput=function(t){var o;var n=t.detail;e.setCustomEmailInputToLinkEvent(n);(o=e.linkAuthenticationChange)===null||o===void 0?void 0:o.emit()}}t.prototype.watchIsStagingMode=function(){var t=this;
153
+ // Wait for the DOM to be ready before re-initializing Link element
154
+ setTimeout((function(){void t.watchInitStripe()}),0)};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,e,o,n;var s=this;return __generator(this,(function(i){switch(i.label){case 0:if(!this.stripe||!stripeStore.stripeElements){return[2/*return*/]}
155
+ // No need to initialize link if this is staging mode since we will render the email input field
156
+ if(cartStore.isStagingMode||!this.clientSecret){return[2/*return*/]}t=this.defaultEmail?{email:this.defaultEmail}:undefined;i.label=1;case 1:i.trys.push([1,2,,6]);e=stripeStore.stripeLinkElement||stripeStore.stripeElements.create("linkAuthentication",{defaultValues:t});o=this.el.querySelector(".zonos--link-authentication-component");if(!o){logError("Cannot find container element for linkAuthenticationElement");return[2/*return*/]}e.mount(o);e.on("change",(function(t){var e;stripeStore.stripeLinkEventData=t;(e=s.linkAuthenticationChange)===null||e===void 0?void 0:e.emit()}));stripeStore.stripeLinkElement=e;this.retriesInitializeLink=0;
157
+ // 10 seconds
158
+ if(this.retriesInitializeLink>11){log("Stripe link element initialized","info",{retriesInitializeLink:this.retriesInitializeLink,stripe:this.stripe});void sendErrorLog({endpoint:"stripe-link-authentication-init-long-running",errors:["Stripe link element initialized after 20 retries - 10 seconds"],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}return[3/*break*/,6];case 2:n=i.sent();if(!(n instanceof Error))return[3/*break*/,5];
159
+ // Wait for the stripe elements to be ready with the new client secret
160
+ this.retriesInitializeLink++;if(!(this.retriesInitializeLink<MAX_RETRIES_INITIALIZE_LINK))return[3/*break*/,4];return[4/*yield*/,new Promise((function(t){return setTimeout(t,500)}))];case 3:i.sent();void this.watchInitStripe();i.label=4;case 4:if(this.retriesInitializeLink===MAX_RETRIES_INITIALIZE_LINK){void sendErrorLog({endpoint:"stripe-link-authentication-init-error",errors:[n.message],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}i.label=5;case 5:return[3/*break*/,6];case 6:return[2/*return*/]}}))}))};t.prototype.watchDefaultEmail=function(t,e){var o,n;log("Default email is changed","info",{newDefaultEmail:t,oldDefaultEmail:e});if(e===t){return}if(!t){stripeStore.stripeLinkEventData=null}
161
+ // Only set value for Stripe input input to stripeLinkEventData when checkout is in staging mode
162
+ if(cartStore.isStagingMode){this.setCustomEmailInputToLinkEvent(t||"");return}(o=stripeStore.stripeLinkElement)===null||o===void 0?void 0:o.clear();(n=stripeStore.stripeLinkElement)===null||n===void 0?void 0:n.destroy();stripeStore.stripeLinkElement=null;stripeStore.stripeLinkEventData=null;log("Reset stripe link element when default email is changed","info",{defaultEmail:t});void this.watchInitStripe()};t.prototype.disconnectedCallback=function(){
163
+ // unsubscribe from store subscriptions
164
+ try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;this.storeUnsubscribeList=[stripeStoreOnChange("stripeElements",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){void this.watchInitStripe();return[2/*return*/]}))}))})),stripeStoreOnChange("clientSecret",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.clientSecret=stripeStore.clientSecret;return[2/*return*/]}))}))})),stripeStoreOnChange("stripe",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.stripe=stripeStore.stripe;return[2/*return*/]}))}))}))];
165
+ // @Watch doesn't get trigger on initial load
166
+ void this.watchInitStripe();if(!this.defaultEmail){return}
167
+ // set default email value to stripeLinkEventData if default email is provided
168
+ this.setCustomEmailInputToLinkEvent(this.defaultEmail)};t.prototype.render=function(){var t=this;this.isStagingMode=cartStore.isStagingMode;this.clientSecret=stripeStore.clientSecret;var e=function(){var e;if(cartStore.isStagingMode){return h("zonos-stripe-input",{inputLabel:translate("Email"),inputValue:t.defaultEmail||((e=stripeStore.stripeLinkEventData)===null||e===void 0?void 0:e.value.email)||"",isError:t.isEmailError,onBlur:function(){var e;var o=((e=stripeStore.stripeLinkEventData)===null||e===void 0?void 0:e.value.email)||"";if(!o){return}
169
+ // check if the email is valid
170
+ var n=validateEmailValue(o);t.isEmailError=!n},onInputChange:t.handleNormalEmailInput})}return h("div",{class:"zonos--link-authentication-component ".concat(t.isEmailError&&"zonos--input-invalid")})};
171
+ // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
172
+ return h(Host,{class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":getBorderRadius()}},this.titleText&&h("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),e(),this.isEmailError&&h("zonos-text",{textColor:"red-600"},translate("Please enter a valid email address.")))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isStagingMode:[{watchIsStagingMode:0}],stripe:[{watchInitStripe:0}],clientSecret:[{watchInitStripe:0}],defaultEmail:[{watchDefaultEmail:0}]}},enumerable:false,configurable:true});return t}();ZonosLinkAuthentication.style=zonosLinkAuthenticationCss();var zonosLoadingOverlayCss=function(){return":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:fixed;inset:0;z-index:2147483010;pointer-events:none;display:block}:host .zonos--loading-overlay{position:fixed;inset:0;width:100vw;height:100vh;background:var(--zonos-elements-backdrop-color);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;opacity:0;visibility:hidden;-webkit-transition:opacity 0.3s ease, visibility 0.3s ease;transition:opacity 0.3s ease, visibility 0.3s ease;z-index:2147483010}:host(.zonos--open){pointer-events:auto}:host(.zonos--open) .zonos--loading-overlay{opacity:0.65;visibility:visible}"};var ZonosLoadingOverlay=/** @class */function(){function t(t){registerInstance(this,t);
173
+ /**
174
+ * Whether or not the overlay is open
175
+ * @default false
176
+ */this.open=false;
177
+ /**
178
+ * Spinner size (optional, default 40)
179
+ */this.size=40}t.prototype.render=function(){return h(Host,{key:"8cafd99b309b04da5cf1b26b0f0804f4699c06b2",class:classes(["zonos--elements",this.open&&"zonos--open"])},h("div",{key:"9ce7ac9b7e6956a5f76fc2105fa7f5d05299fd36",class:"zonos--loading-overlay"},h("zonos-spinner",{key:"4be3a8d471e3aead2e4194c4ecbf66878a7a3f17",size:this.size,spinnerColor:this.spinnerColor})))};return t}();ZonosLoadingOverlay.style=zonosLoadingOverlayCss();export{ZonosAddress as zonos_address,ZonosConfirmDialog as zonos_confirm_dialog,ZonosLinkAuthentication as zonos_link_authentication,ZonosLoadingOverlay as zonos_loading_overlay};
@@ -1 +1,49 @@
1
- var __awaiter=this&&this.__awaiter||function(e,a,t,n){function r(e){return e instanceof t?e:new t((function(a){a(e)}))}return new(t||(t=Promise))((function(t,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n["throw"](e))}catch(e){o(e)}}function s(e){e.done?t(e.value):r(e.value).then(i,l)}s((n=n.apply(e,a||[])).next())}))};var __generator=this&&this.__generator||function(e,a){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,i;return i={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function l(e){return function(a){return s([e,a])}}function s(l){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,l[0]&&(t=0)),t)try{if(n=1,r&&(o=l[0]&2?r["return"]:l[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;if(r=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:t.label++;return{value:l[1],done:false};case 5:t.label++;r=l[1];l=[0];continue;case 7:l=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){t.label=l[1];break}if(l[0]===6&&t.label<o[1]){t.label=o[1];o=l;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(l);break}if(o[2])t.ops.pop();t.trys.pop();continue}l=a.call(e,t)}catch(e){l=[6,e];r=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{r as registerInstance,d as createEvent,h,a as Host,g as getElement}from"./index-cfd394c8.js";import{b as airwallexStore,c as collectStore,f as airwallexStoreInitSdk,l as createElement,m as airwallexStoreGetLocale,n as airwallexStoreOnChange}from"./collect-4c310a16.js";import{d as cartStore}from"./cart-d04742f5.js";import{e as localizationStoreOnChange,t as translate,l as localizationStore}from"./localization-36a4dc22.js";import{z as zonosStore}from"./zonosStore-eca1e364.js";import{l as log}from"./VarianceTest-572cecf5.js";import{l as logError}from"./handleFetch-a844cac1.js";import"./isDarkColor-939d8e9c.js";import"./getBorderRadius-1f7be586.js";import"./TaxId-63a14057.js";var zonosAirwallexPaymentCss=".sc-zonos-airwallex-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-airwallex-payment-h *.sc-zonos-airwallex-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-airwallex-payment-h img.sc-zonos-airwallex-payment{max-width:100%}.sc-zonos-airwallex-payment-h dl.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h dd.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h1.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h2.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h3.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h4.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h5.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h6.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h hr.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h figure.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h p.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h pre.sc-zonos-airwallex-payment{margin:0}.sc-zonos-airwallex-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-airwallex-payment-h{display:block}.sc-zonos-airwallex-payment-h .zonos--payment-error-banner.sc-zonos-airwallex-payment{margin-bottom:16px}.sc-zonos-airwallex-payment-h .zonos--airwallex-payment-component.sc-zonos-airwallex-payment{margin-bottom:4px;min-height:40px}";var ZonosAirwallexPaymentStyle0=zonosAirwallexPaymentCss;var ZonosAirwallexPayment=function(){function e(e){var a=this;registerInstance(this,e);this.airwallexPaymentSuccess=createEvent(this,"airwallexPaymentSuccess",7);this.airwallexPaymentError=createEvent(this,"airwallexPaymentError",7);this.element=null;this.storeUnsubscribeList=[];this.mountingClientSecret=null;this.hasError=false;this.clientSecret=airwallexStore.clientSecret;this.getDropInOptions=function(e){var a;var t=zonosStore.checkoutSettings.captureDelay&&zonosStore.checkoutSettings.captureDelay>0;return{autoCapture:!t,client_secret:e,country_code:((a=collectStore.shippingAddress)===null||a===void 0?void 0:a.location.countryCode)||undefined,currency:airwallexStore.currency||cartStore.currency,intent_id:airwallexStore.paymentIntentId||undefined}};this.mountPaymentElement=function(){return __awaiter(a,void 0,void 0,(function(){var e,a,t,n,r,o;var i=this;return __generator(this,(function(l){switch(l.label){case 0:a=this.clientSecret;if(!a){return[2]}if(this.mountingClientSecret===a){return[2]}this.mountingClientSecret=a;return[4,airwallexStoreInitSdk()];case 1:t=l.sent();if(!t){this.hasError=true;this.mountingClientSecret=null;return[2]}n=this.el.querySelector(".zonos--airwallex-payment-component");if(!n){logError("Cannot find container element for Airwallex payment element");this.hasError=true;this.mountingClientSecret=null;return[2]}l.label=2;case 2:l.trys.push([2,4,,5]);(e=this.element)===null||e===void 0?void 0:e.destroy();this.element=null;return[4,createElement("dropIn",this.getDropInOptions(a))];case 3:r=l.sent();if(!r){logError("Failed to create Airwallex payment element");this.hasError=true;this.mountingClientSecret=null;return[2]}r.mount(n);r.on("success",(function(){log("Airwallex payment succeeded");airwallexStore.hasPaymentError=false;airwallexStore.paymentConfirmed=true;i.airwallexPaymentSuccess.emit()}));r.on("error",(function(e){logError(e);airwallexStore.hasPaymentError=true;i.airwallexPaymentError.emit()}));this.element=r;this.hasError=false;return[3,5];case 4:o=l.sent();logError(o);this.hasError=true;this.mountingClientSecret=null;return[3,5];case 5:return[2]}}))}))};this.localeChangeHandler=function(){if(!a.element||!a.clientSecret){return}a.element.update(a.getDropInOptions(a.clientSecret),{locale:airwallexStoreGetLocale(localizationStore.selectedLocale)})}}e.prototype.clientSecretWatcher=function(){void this.mountPaymentElement()};e.prototype.componentWillLoad=function(){var e=this;this.storeUnsubscribeList=[airwallexStoreOnChange("clientSecret",(function(a){e.clientSecret=a})),localizationStoreOnChange("selectedLocale",this.localeChangeHandler)]};e.prototype.componentDidLoad=function(){void this.mountPaymentElement()};e.prototype.disconnectedCallback=function(){var e;this.storeUnsubscribeList.forEach((function(e){return e()}));(e=this.element)===null||e===void 0?void 0:e.destroy();this.element=null};e.prototype.render=function(){return h(Host,{key:"3d5f4aaea91533348ae6273757b8af6f17a7ab59",class:"zonos--airwallex-payment zonos--elements"},this.hasError&&h("zonos-banner",{key:"27fe7775145b9ff4f9b572ee592eb0cdc5f2ef13",class:"zonos--payment-error-banner",intent:"error"},translate("We couldn't complete your payment. Please verify the payment details and try again.")),h("div",{key:"48a50ebcc6ad1e3b3cbf807ef5d466030995a171",class:"zonos--airwallex-payment-component"}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{clientSecret:["clientSecretWatcher"]}},enumerable:false,configurable:true});return e}();ZonosAirwallexPayment.style=ZonosAirwallexPaymentStyle0;export{ZonosAirwallexPayment as zonos_airwallex_payment};
1
+ var __awaiter=this&&this.__awaiter||function(e,t,a,n){function r(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,o){function i(e){try{s(n.next(e))}catch(e){o(e)}}function l(e){try{s(n["throw"](e))}catch(e){o(e)}}function s(e){e.done?a(e.value):r(e.value).then(i,l)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,r,o,i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=l(0),i["throw"]=l(1),i["return"]=l(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function l(e){return function(t){return s([e,t])}}function s(l){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,l[0]&&(a=0)),a)try{if(n=1,r&&(o=l[0]&2?r["return"]:l[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;if(r=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:a.label++;return{value:l[1],done:false};case 5:a.label++;r=l[1];l=[0];continue;case 7:l=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){a=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(l[0]===6&&a.label<o[1]){a.label=o[1];o=l;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(l);break}if(o[2])a.ops.pop();a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e];r=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};import{r as registerInstance,d as createEvent,h,a as Host,g as getElement}from"./index-_lt63o7c.js";import{b as airwallexStore,c as collectStore,f as airwallexStoreInitSdk,l as createElement,m as airwallexStoreGetLocale,n as airwallexStoreOnChange}from"./collect-33rMINDo.js";import{d as cartStore}from"./cart-ekBk_gxV.js";import{e as localizationStoreOnChange,t as translate,l as localizationStore}from"./localization-AOqYXGdP.js";import{z as zonosStore}from"./zonosStore-DrIOAz4M.js";import{l as log}from"./VarianceTest-BJmZPrZl.js";import{l as logError}from"./handleFetch-D5GYDF-O.js";import"./isDarkColor-YdrG78th.js";import"./getBorderRadius-HwG64EKM.js";import"./TaxId-Cye-evFK.js";var zonosAirwallexPaymentCss=function(){return".sc-zonos-airwallex-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-airwallex-payment-h *.sc-zonos-airwallex-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-airwallex-payment-h img.sc-zonos-airwallex-payment{max-width:100%}.sc-zonos-airwallex-payment-h dl.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h dd.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h1.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h2.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h3.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h4.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h5.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h h6.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h hr.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h figure.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h p.sc-zonos-airwallex-payment,.sc-zonos-airwallex-payment-h pre.sc-zonos-airwallex-payment{margin:0}.sc-zonos-airwallex-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-airwallex-payment-h{display:block}.sc-zonos-airwallex-payment-h .zonos--payment-error-banner.sc-zonos-airwallex-payment{margin-bottom:16px}.sc-zonos-airwallex-payment-h .zonos--airwallex-payment-component.sc-zonos-airwallex-payment{margin-bottom:4px;min-height:40px}"};var ZonosAirwallexPayment=/** @class */function(){function e(e){var t=this;registerInstance(this,e);this.airwallexPaymentSuccess=createEvent(this,"airwallexPaymentSuccess",7);this.airwallexPaymentError=createEvent(this,"airwallexPaymentError",7);this.element=null;this.storeUnsubscribeList=[];
2
+ /** Client secret currently being mounted, to avoid overlapping mounts. */this.mountingClientSecret=null;
3
+ /**
4
+ * Whether the SDK failed to load or the element failed to mount.
5
+ */this.hasError=false;
6
+ /**
7
+ * Mirror of the store client secret so the element (re)mounts once it becomes
8
+ * available. The client secret is fetched asynchronously and is usually not yet
9
+ * set when this component first mounts.
10
+ */this.clientSecret=airwallexStore.clientSecret;
11
+ /**
12
+ * Build the full set of drop-in options. The SDK's `element.update` requires the
13
+ * first argument to contain the most up-to-date version of everything that was
14
+ * originally passed to `createElement`, so both calls share this.
15
+ */this.getDropInOptions=function(e){var t;
16
+ // Authorize (hold) when a capture delay is configured, otherwise capture
17
+ // immediately — mirrors the PayPal intent logic in paypalInitScript.
18
+ var a=zonosStore.checkoutSettings.captureDelay&&zonosStore.checkoutSettings.captureDelay>0;return{autoCapture:!a,client_secret:e,
19
+ // The shopper's ship-to country (from the collect shipping info).
20
+ country_code:((t=collectStore.shippingAddress)===null||t===void 0?void 0:t.location.countryCode)||undefined,currency:airwallexStore.currency||cartStore.currency,intent_id:airwallexStore.paymentIntentId||undefined}};this.mountPaymentElement=function(){return __awaiter(t,void 0,void 0,(function(){var e,t,a,n,r,o;var i=this;return __generator(this,(function(l){switch(l.label){case 0:t=this.clientSecret;
21
+ // The client secret arrives asynchronously — wait for it instead of erroring.
22
+ if(!t){return[2/*return*/]}
23
+ // Skip if we are already mounting (or have mounted) this exact client secret.
24
+ if(this.mountingClientSecret===t){return[2/*return*/]}this.mountingClientSecret=t;return[4/*yield*/,airwallexStoreInitSdk()];case 1:a=l.sent();if(!a){this.hasError=true;this.mountingClientSecret=null;return[2/*return*/]}n=this.el.querySelector(".zonos--airwallex-payment-component");if(!n){logError("Cannot find container element for Airwallex payment element");this.hasError=true;this.mountingClientSecret=null;return[2/*return*/]}l.label=2;case 2:l.trys.push([2,4,,5]);
25
+ // Tear down any previously mounted element before remounting.
26
+ (e=this.element)===null||e===void 0?void 0:e.destroy();this.element=null;return[4/*yield*/,createElement("dropIn",this.getDropInOptions(t))];case 3:r=l.sent();if(!r){logError("Failed to create Airwallex payment element");this.hasError=true;this.mountingClientSecret=null;return[2/*return*/]}r.mount(n);r.on("success",(function(){log("Airwallex payment succeeded");airwallexStore.hasPaymentError=false;
27
+ // The drop-in confirmed the payment — the finish step trusts this over a
28
+ // possibly-lagging payment intent status lookup.
29
+ airwallexStore.paymentConfirmed=true;i.airwallexPaymentSuccess.emit()}));r.on("error",(function(e){logError(e);airwallexStore.hasPaymentError=true;i.airwallexPaymentError.emit()}));this.element=r;this.hasError=false;return[3/*break*/,5];case 4:o=l.sent();logError(o);this.hasError=true;this.mountingClientSecret=null;return[3/*break*/,5];case 5:return[2/*return*/]}}))}))};
30
+ /**
31
+ * Update the mounted element's locale whenever the shopper changes language.
32
+ */this.localeChangeHandler=function(){if(!t.element||!t.clientSecret){return}
33
+ // `update`'s first argument must carry the most up-to-date version of all the
34
+ // options originally passed to `createElement`.
35
+ t.element.update(t.getDropInOptions(t.clientSecret),{locale:airwallexStoreGetLocale(localizationStore.selectedLocale)})}}
36
+ /**
37
+ * (Re)mount the payment element whenever the client secret becomes available
38
+ * or changes.
39
+ */e.prototype.clientSecretWatcher=function(){void this.mountPaymentElement()};e.prototype.componentWillLoad=function(){var e=this;this.storeUnsubscribeList=[
40
+ // Keep the local state in sync with the store so the @Watch above fires
41
+ // once the asynchronously-fetched client secret becomes available.
42
+ airwallexStoreOnChange("clientSecret",(function(t){e.clientSecret=t})),
43
+ // Keep the Airwallex element locale in sync with the selected language.
44
+ localizationStoreOnChange("selectedLocale",this.localeChangeHandler)]};e.prototype.componentDidLoad=function(){
45
+ // If the client secret is already available on first render, mount now —
46
+ // @Watch does not fire for the initial value.
47
+ void this.mountPaymentElement()};e.prototype.disconnectedCallback=function(){var e;
48
+ // unsubscribe from store subscriptions
49
+ this.storeUnsubscribeList.forEach((function(e){return e()}));(e=this.element)===null||e===void 0?void 0:e.destroy();this.element=null};e.prototype.render=function(){return h(Host,{key:"3d5f4aaea91533348ae6273757b8af6f17a7ab59",class:"zonos--airwallex-payment zonos--elements"},this.hasError&&h("zonos-banner",{key:"27fe7775145b9ff4f9b572ee592eb0cdc5f2ef13",class:"zonos--payment-error-banner",intent:"error"},translate("We couldn't complete your payment. Please verify the payment details and try again.")),h("div",{key:"48a50ebcc6ad1e3b3cbf807ef5d466030995a171",class:"zonos--airwallex-payment-component"}))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{clientSecret:[{clientSecretWatcher:0}]}},enumerable:false,configurable:true});return e}();ZonosAirwallexPayment.style=zonosAirwallexPaymentCss();export{ZonosAirwallexPayment as zonos_airwallex_payment};
@@ -1 +1,25 @@
1
- import{r as registerInstance,h,a as Host}from"./index-cfd394c8.js";import{f as zonosStoreFontFamily}from"./zonosStore-eca1e364.js";import{c as classes}from"./classes-0d95c529.js";import"./VarianceTest-572cecf5.js";var RemoveLineIcon='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.8282 5.17184C11.0235 5.3671 11.0235 5.68368 10.8282 5.87894L8.70688 8.00026L10.8282 10.1216C11.0235 10.3168 11.0235 10.6334 10.8282 10.8287C10.6329 11.024 10.3164 11.024 10.1211 10.8287L7.99978 8.70737L5.87846 10.8287C5.68319 11.024 5.36661 11.024 5.17135 10.8287C4.97609 10.6334 4.97609 10.3168 5.17135 10.1216L7.29267 8.00026L5.17135 5.87894C4.97609 5.68368 4.97609 5.3671 5.17135 5.17184C5.36661 4.97658 5.68319 4.97658 5.87846 5.17184L7.99978 7.29316L10.1211 5.17184C10.3164 4.97658 10.6329 4.97658 10.8282 5.17184Z" fill="var(--zonos-elements-gray-800)"/>\n</svg>\n';var zonosBadgeCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .zonos--badge-content{display:-ms-flexbox;display:flex;gap:8px;font-size:var(--zonos-elements-font-size-s);padding:4px 8px;text-align:center;border-radius:var(--zonos-elements-radius-6);background-color:var(--zonos-elements-gray-100);color:var(--zonos-elements-gray-800);-ms-flex-align:center;align-items:center}:host p{font-weight:600;line-height:16px}:host .icon-right svg{-ms-flex-order:2;order:2}:host .small{padding:2px 8px}:host .rounded{border-radius:20px}:host .bold{background-color:var(--zonos-elements-gray-600);color:var(--zonos-elements-gray-100)}:host .blue{background-color:var(--zonos-elements-blue-100);color:var(--zonos-elements-blue-800)}:host .blue.bold{background-color:var(--zonos-elements-blue-600);color:var(--zonos-elements-blue-100)}:host .green{background-color:var(--zonos-elements-green-100);color:var(--zonos-elements-green-800)}:host .green.bold{background-color:var(--zonos-elements-green-600);color:var(--zonos-elements-green-100)}:host .red{background-color:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800)}:host .red.bold{background-color:var(--zonos-elements-red-600);color:var(--zonos-elements-red-100)}:host .orange{background-color:var(--zonos-elements-orange-100);color:var(--zonos-elements-orange-800);border:1px solid var(--zonos-elements-orange-200)}:host .orange.bold{background-color:var(--zonos-elements-orange-600);color:var(--zonos-elements-orange-100)}:host .purple{background-color:var(--zonos-elements-purple-100);color:var(--zonos-elements-purple-800)}:host .purple.bold{background-color:var(--zonos-elements-purple-600);color:var(--zonos-elements-purple-100)}:host .cyan{background-color:var(--zonos-elements-cyan-100);color:var(--zonos-elements-cyan-800)}:host .cyan.bold{background-color:var(--zonos-elements-cyan-600);color:var(--zonos-elements-cyan-100)}:host .transparent{background-color:transparent;border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800)}:host .transparent.bold{background-color:var(--zonos-elements-glass-600);color:var(--zonos-elements-gray-100)}:host .zonos--badge-dismiss{cursor:pointer}";var ZonosBadgeStyle0=zonosBadgeCss;var ZonosBadge=function(){function o(o){registerInstance(this,o);this.bold=false;this.badgeColor="gray";this.iconRight=false;this.size="default";this.rounded=false;this.loading=false}o.prototype.render=function(){var o=this;return h(Host,{key:"95c8a620e803b4ea84d7789ff746d1edc1252389",class:classes(["zonos--elements zonos--badge"]),style:{"--zonos--font-family":zonosStoreFontFamily()}},h("div",{key:"000fb2efaa9cffa4635e89e700013bcc1f9fd63c",class:classes(["zonos--badge-content",this.badgeColor,this.rounded&&"rounded",this.iconRight&&"icon-right",this.size,this.bold&&"bold"])},this.icon,h("zonos-text",{key:"8c84abeb697dd20f6c1acbd2f512a5bac2c45883",textColor:"".concat(this.badgeColor,"-800")},h("slot",{key:"b5bc9ed235747f2986fd7a1c94cbede4b8ffc715"})),this.dismissHandler&&h("zonos-icon",{key:"629b306370ba2fab2e43b625fce19e44be2a91a7","aria-label":"Remove action",class:"zonos--badge-dismiss",content:RemoveLineIcon,onClick:function(){var e;return(e=o.dismissHandler)===null||e===void 0?void 0:e.call(o)}})))};return o}();ZonosBadge.style=ZonosBadgeStyle0;export{ZonosBadge as zonos_badge};
1
+ import{r as registerInstance,h,a as Host}from"./index-_lt63o7c.js";import{a as zonosStoreFontFamily}from"./zonosStore-DrIOAz4M.js";import{c as classes}from"./classes-BJHSB96f.js";import"./VarianceTest-BJmZPrZl.js";var RemoveLineIcon='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.8282 5.17184C11.0235 5.3671 11.0235 5.68368 10.8282 5.87894L8.70688 8.00026L10.8282 10.1216C11.0235 10.3168 11.0235 10.6334 10.8282 10.8287C10.6329 11.024 10.3164 11.024 10.1211 10.8287L7.99978 8.70737L5.87846 10.8287C5.68319 11.024 5.36661 11.024 5.17135 10.8287C4.97609 10.6334 4.97609 10.3168 5.17135 10.1216L7.29267 8.00026L5.17135 5.87894C4.97609 5.68368 4.97609 5.3671 5.17135 5.17184C5.36661 4.97658 5.68319 4.97658 5.87846 5.17184L7.99978 7.29316L10.1211 5.17184C10.3164 4.97658 10.6329 4.97658 10.8282 5.17184Z" fill="var(--zonos-elements-gray-800)"/>\n</svg>\n';var zonosBadgeCss=function(){return":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .zonos--badge-content{display:-ms-flexbox;display:flex;gap:8px;font-size:var(--zonos-elements-font-size-s);padding:4px 8px;text-align:center;border-radius:var(--zonos-elements-radius-6);background-color:var(--zonos-elements-gray-100);color:var(--zonos-elements-gray-800);-ms-flex-align:center;align-items:center}:host p{font-weight:600;line-height:16px}:host .icon-right svg{-ms-flex-order:2;order:2}:host .small{padding:2px 8px}:host .rounded{border-radius:20px}:host .bold{background-color:var(--zonos-elements-gray-600);color:var(--zonos-elements-gray-100)}:host .blue{background-color:var(--zonos-elements-blue-100);color:var(--zonos-elements-blue-800)}:host .blue.bold{background-color:var(--zonos-elements-blue-600);color:var(--zonos-elements-blue-100)}:host .green{background-color:var(--zonos-elements-green-100);color:var(--zonos-elements-green-800)}:host .green.bold{background-color:var(--zonos-elements-green-600);color:var(--zonos-elements-green-100)}:host .red{background-color:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800)}:host .red.bold{background-color:var(--zonos-elements-red-600);color:var(--zonos-elements-red-100)}:host .orange{background-color:var(--zonos-elements-orange-100);color:var(--zonos-elements-orange-800);border:1px solid var(--zonos-elements-orange-200)}:host .orange.bold{background-color:var(--zonos-elements-orange-600);color:var(--zonos-elements-orange-100)}:host .purple{background-color:var(--zonos-elements-purple-100);color:var(--zonos-elements-purple-800)}:host .purple.bold{background-color:var(--zonos-elements-purple-600);color:var(--zonos-elements-purple-100)}:host .cyan{background-color:var(--zonos-elements-cyan-100);color:var(--zonos-elements-cyan-800)}:host .cyan.bold{background-color:var(--zonos-elements-cyan-600);color:var(--zonos-elements-cyan-100)}:host .transparent{background-color:transparent;border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800)}:host .transparent.bold{background-color:var(--zonos-elements-glass-600);color:var(--zonos-elements-gray-100)}:host .zonos--badge-dismiss{cursor:pointer}"};var ZonosBadge=/** @class */function(){function o(o){registerInstance(this,o);
2
+ /**
3
+ * Whether or not the badge is bold
4
+ * @default false
5
+ */this.bold=false;
6
+ /**
7
+ * The color of the badge
8
+ * @default 24
9
+ */this.badgeColor="gray";
10
+ /**
11
+ * Position the icon to the right when icon is specified
12
+ * @default false
13
+ */this.iconRight=false;
14
+ /**
15
+ * The size of the badge
16
+ * @default 'default'
17
+ */this.size="default";
18
+ /**
19
+ * Whether or not the badge is rounded
20
+ * @default false
21
+ */this.rounded=false;
22
+ /**
23
+ * Whether or not the badge is loading
24
+ * @default false
25
+ */this.loading=false}o.prototype.render=function(){var o=this;return h(Host,{key:"95c8a620e803b4ea84d7789ff746d1edc1252389",class:classes(["zonos--elements zonos--badge"]),style:{"--zonos--font-family":zonosStoreFontFamily()}},h("div",{key:"000fb2efaa9cffa4635e89e700013bcc1f9fd63c",class:classes(["zonos--badge-content",this.badgeColor,this.rounded&&"rounded",this.iconRight&&"icon-right",this.size,this.bold&&"bold"])},this.icon,h("zonos-text",{key:"8c84abeb697dd20f6c1acbd2f512a5bac2c45883",textColor:"".concat(this.badgeColor,"-800")},h("slot",{key:"b5bc9ed235747f2986fd7a1c94cbede4b8ffc715"})),this.dismissHandler&&h("zonos-icon",{key:"629b306370ba2fab2e43b625fce19e44be2a91a7","aria-label":"Remove action",class:"zonos--badge-dismiss",content:RemoveLineIcon,onClick:function(){var e;return(e=o.dismissHandler)===null||e===void 0?void 0:e.call(o)}})))};return o}();ZonosBadge.style=zonosBadgeCss();export{ZonosBadge as zonos_badge};
@@ -1 +1,7 @@
1
- import{r as registerInstance,h,a as Host}from"./index-cfd394c8.js";import{f as zonosStoreFontFamily}from"./zonosStore-eca1e364.js";import{c as classes}from"./classes-0d95c529.js";import"./VarianceTest-572cecf5.js";var zonosBannerCss=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{border-radius:var(--zonos-elements-radius-10);padding:16px;background:var(--zonos-elements-gray-100)}:host .zonos--container{display:grid;-ms-flex-align:center;align-items:center;grid-template-areas:"icon header" ". content";grid-template-columns:32px auto 0}:host .zonos--icon-wrapper{grid-area:icon;display:-ms-flexbox;display:flex;justify-self:start}:host .zonos--header-wrapper{margin-top:0px;grid-area:header}:host .zonos--content-wrapper{grid-area:content;margin-top:4px}:host(.info){background-color:var(--zonos-elements-blue-100);border:1px solid var(--zonos-elements-blue-200)}:host(.success){background-color:var(--zonos-elements-green-100);border:1px solid var(--zonos-elements-green-200)}:host(.error){background-color:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host(.warning){background-color:var(--zonos-elements-orange-100);border:1px solid var(--zonos-elements-orange-200)}';var ZonosBannerStyle0=zonosBannerCss;var ZonosBanner=function(){function o(o){var s=this;registerInstance(this,o);this.hasContent=false;this.handleSlotChange=function(){s.hasContent=true}}o.prototype.render=function(){var o=this;var s=function(s){var e=s.color;var r="var(--zonos-elements-".concat(e,"-800)");var n="var(--zonos-elements-".concat(e,"-300)");var t=[o.bannerTitle,h("slot",{onSlotchange:o.handleSlotChange})].filter(Boolean),a=t[0],l=t[1];var i=e==="gray"?"gray-1000":"".concat(e,"-800");return h("div",{class:classes(["zonos--container"])},h("div",{class:"zonos--icon-wrapper"},h("svg",{color:r,fill:"none",height:"20",viewBox:"0 0 24 24",width:"20",xmlns:"https://www.w3.org/2000/svg"},h("path",{"clip-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z","data-is-secondary-color":"true",fill:n,"fill-rule":"evenodd"}),h("path",{"clip-rule":"evenodd",d:"M12 6.99a1 1 0 0 1 1 1V8a1 1 0 1 1-2 0v-.01a1 1 0 0 1 1-1ZM12 11a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1Z",fill:"currentColor","fill-rule":"evenodd"}))),h("div",{class:"zonos--header-wrapper"},h("zonos-text",{textColor:i,type:"label",weight:600},a)),l&&h("div",{class:"zonos--content-wrapper"},h("zonos-text",{textColor:i},l)))};var e=classes(["zonos--elements zonos--banner",this.intent]);var r=zonosStoreFontFamily();switch(this.intent){case"error":return h(Host,{class:e,style:{"--zonos--font-family":r}},s({color:"red"}));case"info":return h(Host,{class:e,style:{"--zonos--font-family":r}},s({color:"blue"}));case"success":return h(Host,{class:e,style:{"--zonos--font-family":r}},s({color:"green"}));case"warning":return h(Host,{class:e,style:{"--zonos--font-family":r}},s({color:"orange"}));default:return h(Host,{class:e,style:{"--zonos--font-family":r}},s({color:"gray"}))}};return o}();ZonosBanner.style=ZonosBannerStyle0;export{ZonosBanner as zonos_banner};
1
+ import{r as registerInstance,h,a as Host}from"./index-_lt63o7c.js";import{a as zonosStoreFontFamily}from"./zonosStore-DrIOAz4M.js";import{c as classes}from"./classes-BJHSB96f.js";import"./VarianceTest-BJmZPrZl.js";var zonosBannerCss=function(){return':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{border-radius:var(--zonos-elements-radius-10);padding:16px;background:var(--zonos-elements-gray-100)}:host .zonos--container{display:grid;-ms-flex-align:center;align-items:center;grid-template-areas:"icon header" ". content";grid-template-columns:32px auto 0}:host .zonos--icon-wrapper{grid-area:icon;display:-ms-flexbox;display:flex;justify-self:start}:host .zonos--header-wrapper{margin-top:0px;grid-area:header}:host .zonos--content-wrapper{grid-area:content;margin-top:4px}:host(.info){background-color:var(--zonos-elements-blue-100);border:1px solid var(--zonos-elements-blue-200)}:host(.success){background-color:var(--zonos-elements-green-100);border:1px solid var(--zonos-elements-green-200)}:host(.error){background-color:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host(.warning){background-color:var(--zonos-elements-orange-100);border:1px solid var(--zonos-elements-orange-200)}'};var ZonosBanner=/** @class */function(){function o(o){var s=this;registerInstance(this,o);
2
+ /**
3
+ * Whether or not the button has content
4
+ */this.hasContent=false;
5
+ /**
6
+ * Detect if the button has an content
7
+ */this.handleSlotChange=function(){s.hasContent=true}}o.prototype.render=function(){var o=this;var s=function(s){var e=s.color;var r="var(--zonos-elements-".concat(e,"-800)");var n="var(--zonos-elements-".concat(e,"-300)");var t=[o.bannerTitle,h("slot",{onSlotchange:o.handleSlotChange})].filter(Boolean),a=t[0],l=t[1];var i=e==="gray"?"gray-1000":"".concat(e,"-800");return h("div",{class:classes(["zonos--container"])},h("div",{class:"zonos--icon-wrapper"},h("svg",{color:r,fill:"none",height:"20",viewBox:"0 0 24 24",width:"20",xmlns:"https://www.w3.org/2000/svg"},h("path",{"clip-rule":"evenodd",d:"M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z","data-is-secondary-color":"true",fill:n,"fill-rule":"evenodd"}),h("path",{"clip-rule":"evenodd",d:"M12 6.99a1 1 0 0 1 1 1V8a1 1 0 1 1-2 0v-.01a1 1 0 0 1 1-1ZM12 11a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1Z",fill:"currentColor","fill-rule":"evenodd"}))),h("div",{class:"zonos--header-wrapper"},h("zonos-text",{textColor:i,type:"label",weight:600},a)),l&&h("div",{class:"zonos--content-wrapper"},h("zonos-text",{textColor:i},l)))};var e=classes(["zonos--elements zonos--banner",this.intent]);var r=zonosStoreFontFamily();switch(this.intent){case"error":return h(Host,{class:e,style:{"--zonos--font-family":r}},s({color:"red"}));case"info":return h(Host,{class:e,style:{"--zonos--font-family":r}},s({color:"blue"}));case"success":return h(Host,{class:e,style:{"--zonos--font-family":r}},s({color:"green"}));case"warning":return h(Host,{class:e,style:{"--zonos--font-family":r}},s({color:"orange"}));default:return h(Host,{class:e,style:{"--zonos--font-family":r}},s({color:"gray"}))}};return o}();ZonosBanner.style=zonosBannerCss();export{ZonosBanner as zonos_banner};