@zonos/elements 1.1.1 → 1.1.2

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 (362) hide show
  1. package/dist/cjs/{cart-108bc407.js → cart-a969ee0b.js} +8 -8
  2. package/dist/cjs/{cart-108bc407.js.map → cart-a969ee0b.js.map} +1 -1
  3. package/dist/cjs/{getBorderRadius-2904800c.js → getBorderRadius-ae52cae1.js} +2 -2
  4. package/dist/cjs/{getBorderRadius-2904800c.js.map → getBorderRadius-ae52cae1.js.map} +1 -1
  5. package/dist/cjs/{isDarkColor-a86b8a05.js → isDarkColor-e1a7bf45.js} +2 -2
  6. package/dist/cjs/{isDarkColor-a86b8a05.js.map → isDarkColor-e1a7bf45.js.map} +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{localization-f6a1b679.js → localization-d510574c.js} +200 -12
  9. package/dist/cjs/localization-d510574c.js.map +1 -0
  10. package/dist/cjs/{submitGtag-b1b96579.js → submitGtag-4de4430f.js} +3 -3
  11. package/dist/cjs/{submitGtag-b1b96579.js.map → submitGtag-4de4430f.js.map} +1 -1
  12. package/dist/cjs/zonos-address_2.cjs.entry.js +5 -5
  13. package/dist/cjs/zonos-banner.cjs.entry.js +68 -0
  14. package/dist/cjs/zonos-banner.cjs.entry.js.map +1 -0
  15. package/dist/cjs/zonos-button_2.cjs.entry.js +3 -3
  16. package/dist/cjs/zonos-cart-items_10.cjs.entry.js +12 -12
  17. package/dist/cjs/zonos-checkout.cjs.entry.js +9 -9
  18. package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
  19. package/dist/cjs/zonos-controller.cjs.entry.js.map +1 -1
  20. package/dist/cjs/zonos-country-flag_4.cjs.entry.js +6 -6
  21. package/dist/cjs/zonos-elements.cjs.js +1 -1
  22. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +12 -8
  23. package/dist/cjs/zonos-hello-dialog.cjs.entry.js.map +1 -1
  24. package/dist/cjs/zonos-hello.cjs.entry.js +237 -22
  25. package/dist/cjs/zonos-hello.cjs.entry.js.map +1 -1
  26. package/dist/cjs/zonos-payment.cjs.entry.js +60 -0
  27. package/dist/cjs/zonos-payment.cjs.entry.js.map +1 -0
  28. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
  29. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js.map +1 -1
  30. package/dist/cjs/{zonosStore-960e5542.js → zonosStore-d9cdaec6.js} +6 -22
  31. package/dist/cjs/zonosStore-d9cdaec6.js.map +1 -0
  32. package/dist/collection/components/checkout/zonos-checkout/assets/LeftArrow.svg +1 -1
  33. package/dist/collection/components/checkout/zonos-checkout/assets/MessageIcon.svg +1 -1
  34. package/dist/collection/components/checkout/zonos-checkout/assets/RemoveIcon.svg +1 -1
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/assets/InfoIcon.svg +1 -1
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/assets/RemoveIcon.svg +1 -1
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/assets/SuccessIcon.svg +1 -1
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-review/assets/ChevronDownIcon.svg +1 -1
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-review/assets/ChevronUpIcon.svg +1 -1
  40. package/dist/collection/components/common/zonos-banner/zonos-banner.css +6 -1
  41. package/dist/collection/components/common/zonos-banner/zonos-banner.js +1 -1
  42. package/dist/collection/components/common/zonos-banner/zonos-banner.js.map +1 -1
  43. package/dist/collection/components/common/zonos-country-select/assets/arrowLeftBlue.svg +1 -1
  44. package/dist/collection/components/common/zonos-dialog/assets/removeIcon.svg +1 -1
  45. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +1 -1
  46. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js.map +1 -1
  47. package/dist/collection/components/hello/zonos-hello/zonos-hello.css +20 -2
  48. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +135 -20
  49. package/dist/collection/components/hello/zonos-hello/zonos-hello.js.map +1 -1
  50. package/dist/collection/components/hello/zonos-hello-dialog/assets/bagIcon.svg +1 -1
  51. package/dist/collection/components/hello/zonos-hello-dialog/assets/messageIcon.svg +1 -1
  52. package/dist/collection/components/hello/zonos-hello-dialog/assets/moneyIcon.svg +1 -1
  53. package/dist/collection/components/hello/zonos-hello-dialog/assets/removeIcon.svg +1 -1
  54. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/chevronDownIcon.svg +1 -1
  55. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/zonosIcon.svg +1 -1
  56. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.css +12 -4
  57. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +30 -1
  58. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js.map +1 -1
  59. package/dist/collection/components/store/hello/localization.js +2 -4
  60. package/dist/collection/components/store/hello/localization.js.map +1 -1
  61. package/dist/collection/components/store/translationStore/strings.arabic.js +9 -0
  62. package/dist/collection/components/store/translationStore/strings.arabic.js.map +1 -1
  63. package/dist/collection/components/store/translationStore/strings.base.js +9 -0
  64. package/dist/collection/components/store/translationStore/strings.base.js.map +1 -1
  65. package/dist/collection/components/store/translationStore/strings.chinese.js +9 -0
  66. package/dist/collection/components/store/translationStore/strings.chinese.js.map +1 -1
  67. package/dist/collection/components/store/translationStore/strings.danish.js +9 -0
  68. package/dist/collection/components/store/translationStore/strings.danish.js.map +1 -1
  69. package/dist/collection/components/store/translationStore/strings.dutch.js +9 -0
  70. package/dist/collection/components/store/translationStore/strings.dutch.js.map +1 -1
  71. package/dist/collection/components/store/translationStore/strings.french.js +9 -0
  72. package/dist/collection/components/store/translationStore/strings.french.js.map +1 -1
  73. package/dist/collection/components/store/translationStore/strings.german.js +9 -0
  74. package/dist/collection/components/store/translationStore/strings.german.js.map +1 -1
  75. package/dist/collection/components/store/translationStore/strings.hebrew.js +9 -0
  76. package/dist/collection/components/store/translationStore/strings.hebrew.js.map +1 -1
  77. package/dist/collection/components/store/translationStore/strings.indonesian.js +9 -0
  78. package/dist/collection/components/store/translationStore/strings.indonesian.js.map +1 -1
  79. package/dist/collection/components/store/translationStore/strings.italian.js +9 -0
  80. package/dist/collection/components/store/translationStore/strings.italian.js.map +1 -1
  81. package/dist/collection/components/store/translationStore/strings.japanese.js +9 -0
  82. package/dist/collection/components/store/translationStore/strings.japanese.js.map +1 -1
  83. package/dist/collection/components/store/translationStore/strings.korean.js +9 -0
  84. package/dist/collection/components/store/translationStore/strings.korean.js.map +1 -1
  85. package/dist/collection/components/store/translationStore/strings.norwegian.js +9 -0
  86. package/dist/collection/components/store/translationStore/strings.norwegian.js.map +1 -1
  87. package/dist/collection/components/store/translationStore/strings.polish.js +9 -0
  88. package/dist/collection/components/store/translationStore/strings.polish.js.map +1 -1
  89. package/dist/collection/components/store/translationStore/strings.portuguese.js +9 -0
  90. package/dist/collection/components/store/translationStore/strings.portuguese.js.map +1 -1
  91. package/dist/collection/components/store/translationStore/strings.russian.js +9 -0
  92. package/dist/collection/components/store/translationStore/strings.russian.js.map +1 -1
  93. package/dist/collection/components/store/translationStore/strings.spanish.js +9 -0
  94. package/dist/collection/components/store/translationStore/strings.spanish.js.map +1 -1
  95. package/dist/collection/components/store/translationStore/strings.swedish.js +9 -0
  96. package/dist/collection/components/store/translationStore/strings.swedish.js.map +1 -1
  97. package/dist/collection/components/store/translationStore/strings.turkish.js +9 -0
  98. package/dist/collection/components/store/translationStore/strings.turkish.js.map +1 -1
  99. package/dist/collection/components/store/translationStore/strings.vietnamese.js +9 -0
  100. package/dist/collection/components/store/translationStore/strings.vietnamese.js.map +1 -1
  101. package/dist/collection/components/store/zonosStore.js +5 -3
  102. package/dist/collection/components/store/zonosStore.js.map +1 -1
  103. package/dist/collection/components/utils/api/checkItemRestrictions.js +18 -0
  104. package/dist/collection/components/utils/api/checkItemRestrictions.js.map +1 -0
  105. package/dist/collection/components/utils/hello/detectItemRestrictions.js +29 -0
  106. package/dist/collection/components/utils/hello/detectItemRestrictions.js.map +1 -0
  107. package/dist/collection/components/utils/hello/getCurrentHelloLocalePage.js +8 -7
  108. package/dist/collection/components/utils/hello/getCurrentHelloLocalePage.js.map +1 -1
  109. package/dist/collection/components/utils/hello/getProductsOnPage.js +49 -0
  110. package/dist/collection/components/utils/hello/getProductsOnPage.js.map +1 -0
  111. package/dist/collection/components/utils/hello/setZonosCountryUrlParam.js +10 -0
  112. package/dist/collection/components/utils/hello/setZonosCountryUrlParam.js.map +1 -0
  113. package/dist/collection/environment.js +34 -7
  114. package/dist/collection/environment.js.map +1 -1
  115. package/dist/collection/scripts/loadStripe.js +3 -3
  116. package/dist/collection/scripts/loadStripe.js.map +1 -1
  117. package/dist/collection/scripts/stripe.js +3 -3
  118. package/dist/collection/scripts/stripe.js.map +1 -1
  119. package/dist/collection/scripts/zonos.js +83 -30
  120. package/dist/collection/scripts/zonos.js.map +1 -1
  121. package/dist/collection/types/generated/graphql.customer.types.js +34 -0
  122. package/dist/collection/types/generated/graphql.customer.types.js.map +1 -1
  123. package/dist/collection/types/hello/HelloConfig.js.map +1 -1
  124. package/dist/collection/types/hello/Product.js +2 -0
  125. package/dist/collection/types/hello/Product.js.map +1 -0
  126. package/dist/collection/types/hello/RestrictedItem.js +2 -0
  127. package/dist/collection/types/hello/RestrictedItem.js.map +1 -0
  128. package/dist/components/localization.js +198 -11
  129. package/dist/components/localization.js.map +1 -1
  130. package/dist/components/stripe.js +3 -3
  131. package/dist/components/stripe.js.map +1 -1
  132. package/dist/components/zonos-banner2.js +2 -2
  133. package/dist/components/zonos-banner2.js.map +1 -1
  134. package/dist/components/zonos-cart-subtotal2.js +1 -1
  135. package/dist/components/zonos-checkout-finish2.js +2 -2
  136. package/dist/components/zonos-checkout.js +3 -3
  137. package/dist/components/zonos-controller.js +1 -1
  138. package/dist/components/zonos-controller.js.map +1 -1
  139. package/dist/components/zonos-country-select2.js +1 -1
  140. package/dist/components/zonos-dialog2.js +1 -1
  141. package/dist/components/zonos-hello-dialog-footer2.js +2 -2
  142. package/dist/components/zonos-hello-dialog2.js +18 -7
  143. package/dist/components/zonos-hello-dialog2.js.map +1 -1
  144. package/dist/components/zonos-hello.js +247 -22
  145. package/dist/components/zonos-hello.js.map +1 -1
  146. package/dist/components/zonos-review2.js +2 -2
  147. package/dist/components/zonos-shipping-rich-radio2.js +1 -1
  148. package/dist/components/zonos-shipping-rich-radio2.js.map +1 -1
  149. package/dist/components/zonosStore.js +5 -21
  150. package/dist/components/zonosStore.js.map +1 -1
  151. package/dist/{zonos-elements/cart-2f83e048.js → esm/cart-d00e1acb.js} +8 -8
  152. package/dist/esm/{cart-2f83e048.js.map → cart-d00e1acb.js.map} +1 -1
  153. package/dist/{zonos-elements/getBorderRadius-82fbaf25.js → esm/getBorderRadius-e8ad5967.js} +2 -2
  154. package/dist/esm/{getBorderRadius-82fbaf25.js.map → getBorderRadius-e8ad5967.js.map} +1 -1
  155. package/dist/{zonos-elements/isDarkColor-b21326ae.js → esm/isDarkColor-3bb345f4.js} +2 -2
  156. package/dist/{zonos-elements/isDarkColor-b21326ae.js.map → esm/isDarkColor-3bb345f4.js.map} +1 -1
  157. package/dist/esm/loader.js +1 -1
  158. package/dist/{zonos-elements/localization-4a424f49.js → esm/localization-1d92a557.js} +200 -13
  159. package/dist/esm/localization-1d92a557.js.map +1 -0
  160. package/dist/{zonos-elements/submitGtag-fbdb454b.js → esm/submitGtag-85914088.js} +3 -3
  161. package/dist/esm/{submitGtag-fbdb454b.js.map → submitGtag-85914088.js.map} +1 -1
  162. package/dist/esm/zonos-address_2.entry.js +5 -5
  163. package/dist/esm/zonos-banner.entry.js +64 -0
  164. package/dist/esm/zonos-banner.entry.js.map +1 -0
  165. package/dist/esm/zonos-button_2.entry.js +3 -3
  166. package/dist/esm/zonos-cart-items_10.entry.js +12 -12
  167. package/dist/esm/zonos-checkout.entry.js +9 -9
  168. package/dist/esm/zonos-controller.entry.js +6 -6
  169. package/dist/esm/zonos-controller.entry.js.map +1 -1
  170. package/dist/esm/zonos-country-flag_4.entry.js +6 -6
  171. package/dist/esm/zonos-elements.js +1 -1
  172. package/dist/esm/zonos-hello-dialog.entry.js +12 -8
  173. package/dist/esm/zonos-hello-dialog.entry.js.map +1 -1
  174. package/dist/esm/zonos-hello.entry.js +237 -22
  175. package/dist/esm/zonos-hello.entry.js.map +1 -1
  176. package/dist/esm/zonos-payment.entry.js +56 -0
  177. package/dist/esm/zonos-payment.entry.js.map +1 -0
  178. package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
  179. package/dist/esm/zonos-shipping-rich-radio.entry.js.map +1 -1
  180. package/dist/{zonos-elements/zonosStore-13a7b534.js → esm/zonosStore-1c9c7d76.js} +6 -22
  181. package/dist/esm/zonosStore-1c9c7d76.js.map +1 -0
  182. package/dist/esm-es5/cart-d00e1acb.js +2 -0
  183. package/dist/esm-es5/{cart-2f83e048.js.map → cart-d00e1acb.js.map} +1 -1
  184. package/dist/esm-es5/{getBorderRadius-82fbaf25.js → getBorderRadius-e8ad5967.js} +2 -2
  185. package/dist/esm-es5/{isDarkColor-b21326ae.js → isDarkColor-3bb345f4.js} +2 -2
  186. package/dist/esm-es5/loader.js +1 -1
  187. package/dist/esm-es5/loader.js.map +1 -1
  188. package/dist/esm-es5/localization-1d92a557.js +2 -0
  189. package/dist/esm-es5/localization-1d92a557.js.map +1 -0
  190. package/dist/esm-es5/{submitGtag-fbdb454b.js → submitGtag-85914088.js} +2 -2
  191. package/dist/esm-es5/zonos-address_2.entry.js +1 -1
  192. package/dist/esm-es5/zonos-banner.entry.js +2 -0
  193. package/dist/esm-es5/zonos-banner.entry.js.map +1 -0
  194. package/dist/esm-es5/zonos-button_2.entry.js +1 -1
  195. package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
  196. package/dist/esm-es5/zonos-cart-items_10.entry.js.map +1 -1
  197. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  198. package/dist/esm-es5/zonos-checkout.entry.js.map +1 -1
  199. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  200. package/dist/esm-es5/zonos-controller.entry.js.map +1 -1
  201. package/dist/esm-es5/zonos-country-flag_4.entry.js +1 -1
  202. package/dist/esm-es5/zonos-country-flag_4.entry.js.map +1 -1
  203. package/dist/esm-es5/zonos-elements.js +1 -1
  204. package/dist/esm-es5/zonos-elements.js.map +1 -1
  205. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  206. package/dist/esm-es5/zonos-hello-dialog.entry.js.map +1 -1
  207. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  208. package/dist/esm-es5/zonos-hello.entry.js.map +1 -1
  209. package/dist/esm-es5/zonos-payment.entry.js +2 -0
  210. package/dist/esm-es5/zonos-payment.entry.js.map +1 -0
  211. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  212. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js.map +1 -1
  213. package/dist/esm-es5/zonosStore-1c9c7d76.js +2 -0
  214. package/dist/esm-es5/zonosStore-1c9c7d76.js.map +1 -0
  215. package/dist/scripts/loadStripe.js +6 -6
  216. package/dist/scripts/loadZonos.js +92 -35
  217. package/dist/scripts/stripe.js +5 -5
  218. package/dist/scripts/zonos.js +92 -35
  219. package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +24 -1
  220. package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +6 -0
  221. package/dist/types/components/store/translationStore/strings.arabic.d.ts +9 -0
  222. package/dist/types/components/store/translationStore/strings.base.d.ts +9 -0
  223. package/dist/types/components/store/translationStore/strings.chinese.d.ts +9 -0
  224. package/dist/types/components/store/translationStore/strings.danish.d.ts +9 -0
  225. package/dist/types/components/store/translationStore/strings.dutch.d.ts +9 -0
  226. package/dist/types/components/store/translationStore/strings.french.d.ts +9 -0
  227. package/dist/types/components/store/translationStore/strings.german.d.ts +9 -0
  228. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +9 -0
  229. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +9 -0
  230. package/dist/types/components/store/translationStore/strings.italian.d.ts +9 -0
  231. package/dist/types/components/store/translationStore/strings.japanese.d.ts +9 -0
  232. package/dist/types/components/store/translationStore/strings.korean.d.ts +9 -0
  233. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +9 -0
  234. package/dist/types/components/store/translationStore/strings.polish.d.ts +9 -0
  235. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +9 -0
  236. package/dist/types/components/store/translationStore/strings.russian.d.ts +9 -0
  237. package/dist/types/components/store/translationStore/strings.spanish.d.ts +9 -0
  238. package/dist/types/components/store/translationStore/strings.swedish.d.ts +9 -0
  239. package/dist/types/components/store/translationStore/strings.turkish.d.ts +9 -0
  240. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +9 -0
  241. package/dist/types/components/store/zonosStore.d.ts +1 -1
  242. package/dist/types/components/utils/api/checkItemRestrictions.d.ts +22 -0
  243. package/dist/types/components/utils/hello/detectItemRestrictions.d.ts +14 -0
  244. package/dist/types/components/utils/hello/getCurrentHelloLocalePage.d.ts +2 -1
  245. package/dist/types/components/utils/hello/getProductsOnPage.d.ts +2 -0
  246. package/dist/types/components/utils/hello/setZonosCountryUrlParam.d.ts +2 -0
  247. package/dist/types/components.d.ts +12 -0
  248. package/dist/types/environment.d.ts +9 -0
  249. package/dist/types/scripts/loadStripe.d.ts +1 -1
  250. package/dist/types/scripts/stripe.d.ts +2 -2
  251. package/dist/types/scripts/zonos.d.ts +2 -0
  252. package/dist/types/types/generated/graphql.customer.types.d.ts +75 -1
  253. package/dist/types/types/generated/graphql.customer.types.ts +113 -1
  254. package/dist/types/types/hello/HelloConfig.d.ts +4 -0
  255. package/dist/types/types/hello/Product.d.ts +5 -0
  256. package/dist/types/types/hello/RestrictedItem.d.ts +6 -0
  257. package/dist/zonos-elements/assets/ChevronDownIcon.svg +1 -1
  258. package/dist/zonos-elements/assets/ChevronUpIcon.svg +1 -1
  259. package/dist/zonos-elements/assets/InfoIcon.svg +1 -1
  260. package/dist/zonos-elements/assets/LeftArrow.svg +1 -1
  261. package/dist/zonos-elements/assets/MessageIcon.svg +1 -1
  262. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  263. package/dist/zonos-elements/assets/SuccessIcon.svg +1 -1
  264. package/dist/zonos-elements/assets/bagIcon.svg +1 -1
  265. package/dist/zonos-elements/assets/messageIcon.svg +1 -1
  266. package/dist/zonos-elements/assets/moneyIcon.svg +1 -1
  267. package/dist/zonos-elements/assets/removeIcon.svg +1 -1
  268. package/dist/zonos-elements/cart-c641ddaf.system.js +2 -0
  269. package/dist/zonos-elements/{cart-9780fa28.system.js.map → cart-c641ddaf.system.js.map} +1 -1
  270. package/dist/{esm/cart-2f83e048.js → zonos-elements/cart-d00e1acb.js} +8 -8
  271. package/dist/zonos-elements/{cart-2f83e048.js.map → cart-d00e1acb.js.map} +1 -1
  272. package/dist/zonos-elements/{getBorderRadius-4fbe49de.system.js → getBorderRadius-b59c3ada.system.js} +2 -2
  273. package/dist/{esm/getBorderRadius-82fbaf25.js → zonos-elements/getBorderRadius-e8ad5967.js} +2 -2
  274. package/dist/zonos-elements/{getBorderRadius-82fbaf25.js.map → getBorderRadius-e8ad5967.js.map} +1 -1
  275. package/dist/zonos-elements/{isDarkColor-dc2b7c8f.system.js → isDarkColor-231502d4.system.js} +2 -2
  276. package/dist/{esm/isDarkColor-b21326ae.js → zonos-elements/isDarkColor-3bb345f4.js} +2 -2
  277. package/dist/{esm/isDarkColor-b21326ae.js.map → zonos-elements/isDarkColor-3bb345f4.js.map} +1 -1
  278. package/dist/{esm/localization-4a424f49.js → zonos-elements/localization-1d92a557.js} +200 -13
  279. package/dist/zonos-elements/localization-1d92a557.js.map +1 -0
  280. package/dist/zonos-elements/localization-a6b6a5a5.system.js +2 -0
  281. package/dist/zonos-elements/localization-a6b6a5a5.system.js.map +1 -0
  282. package/dist/zonos-elements/submitGtag-764af8c4.system.js +2 -0
  283. package/dist/{esm/submitGtag-fbdb454b.js → zonos-elements/submitGtag-85914088.js} +3 -3
  284. package/dist/zonos-elements/{submitGtag-fbdb454b.js.map → submitGtag-85914088.js.map} +1 -1
  285. package/dist/zonos-elements/zonos-address_2.entry.js +5 -5
  286. package/dist/zonos-elements/zonos-address_2.system.entry.js +1 -1
  287. package/dist/zonos-elements/zonos-banner.entry.js +64 -0
  288. package/dist/zonos-elements/zonos-banner.entry.js.map +1 -0
  289. package/dist/zonos-elements/zonos-banner.system.entry.js +2 -0
  290. package/dist/zonos-elements/zonos-banner.system.entry.js.map +1 -0
  291. package/dist/zonos-elements/zonos-button_2.entry.js +3 -3
  292. package/dist/zonos-elements/zonos-button_2.system.entry.js +1 -1
  293. package/dist/zonos-elements/zonos-cart-items_10.entry.js +12 -12
  294. package/dist/zonos-elements/zonos-cart-items_10.system.entry.js +1 -1
  295. package/dist/zonos-elements/zonos-cart-items_10.system.entry.js.map +1 -1
  296. package/dist/zonos-elements/zonos-checkout.entry.js +9 -9
  297. package/dist/zonos-elements/zonos-checkout.system.entry.js +1 -1
  298. package/dist/zonos-elements/zonos-checkout.system.entry.js.map +1 -1
  299. package/dist/zonos-elements/zonos-controller.entry.js +6 -6
  300. package/dist/zonos-elements/zonos-controller.entry.js.map +1 -1
  301. package/dist/zonos-elements/zonos-controller.system.entry.js +1 -1
  302. package/dist/zonos-elements/zonos-controller.system.entry.js.map +1 -1
  303. package/dist/zonos-elements/zonos-country-flag_4.entry.js +6 -6
  304. package/dist/zonos-elements/zonos-country-flag_4.system.entry.js +1 -1
  305. package/dist/zonos-elements/zonos-country-flag_4.system.entry.js.map +1 -1
  306. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  307. package/dist/zonos-elements/zonos-elements.system.js +1 -1
  308. package/dist/zonos-elements/zonos-elements.system.js.map +1 -1
  309. package/dist/zonos-elements/zonos-hello-dialog.entry.js +12 -8
  310. package/dist/zonos-elements/zonos-hello-dialog.entry.js.map +1 -1
  311. package/dist/zonos-elements/zonos-hello-dialog.system.entry.js +1 -1
  312. package/dist/zonos-elements/zonos-hello-dialog.system.entry.js.map +1 -1
  313. package/dist/zonos-elements/zonos-hello.entry.js +237 -22
  314. package/dist/zonos-elements/zonos-hello.entry.js.map +1 -1
  315. package/dist/zonos-elements/zonos-hello.system.entry.js +1 -1
  316. package/dist/zonos-elements/zonos-hello.system.entry.js.map +1 -1
  317. package/dist/zonos-elements/zonos-payment.entry.js +56 -0
  318. package/dist/zonos-elements/zonos-payment.entry.js.map +1 -0
  319. package/dist/zonos-elements/zonos-payment.system.entry.js +2 -0
  320. package/dist/zonos-elements/zonos-payment.system.entry.js.map +1 -0
  321. package/dist/zonos-elements/zonos-shipping-rich-radio.entry.js +3 -3
  322. package/dist/zonos-elements/zonos-shipping-rich-radio.entry.js.map +1 -1
  323. package/dist/zonos-elements/zonos-shipping-rich-radio.system.entry.js +1 -1
  324. package/dist/zonos-elements/zonos-shipping-rich-radio.system.entry.js.map +1 -1
  325. package/dist/{esm/zonosStore-13a7b534.js → zonos-elements/zonosStore-1c9c7d76.js} +6 -22
  326. package/dist/zonos-elements/zonosStore-1c9c7d76.js.map +1 -0
  327. package/dist/zonos-elements/zonosStore-e5c545ea.system.js +2 -0
  328. package/dist/zonos-elements/zonosStore-e5c545ea.system.js.map +1 -0
  329. package/package.json +1 -1
  330. package/dist/cjs/localization-f6a1b679.js.map +0 -1
  331. package/dist/cjs/zonos-banner_2.cjs.entry.js +0 -120
  332. package/dist/cjs/zonos-banner_2.cjs.entry.js.map +0 -1
  333. package/dist/cjs/zonosStore-960e5542.js.map +0 -1
  334. package/dist/esm/localization-4a424f49.js.map +0 -1
  335. package/dist/esm/zonos-banner_2.entry.js +0 -115
  336. package/dist/esm/zonos-banner_2.entry.js.map +0 -1
  337. package/dist/esm/zonosStore-13a7b534.js.map +0 -1
  338. package/dist/esm-es5/cart-2f83e048.js +0 -2
  339. package/dist/esm-es5/localization-4a424f49.js +0 -2
  340. package/dist/esm-es5/localization-4a424f49.js.map +0 -1
  341. package/dist/esm-es5/zonos-banner_2.entry.js +0 -2
  342. package/dist/esm-es5/zonos-banner_2.entry.js.map +0 -1
  343. package/dist/esm-es5/zonosStore-13a7b534.js +0 -2
  344. package/dist/esm-es5/zonosStore-13a7b534.js.map +0 -1
  345. package/dist/zonos-elements/cart-9780fa28.system.js +0 -2
  346. package/dist/zonos-elements/localization-3c43290f.system.js +0 -2
  347. package/dist/zonos-elements/localization-3c43290f.system.js.map +0 -1
  348. package/dist/zonos-elements/localization-4a424f49.js.map +0 -1
  349. package/dist/zonos-elements/submitGtag-23ecdc20.system.js +0 -2
  350. package/dist/zonos-elements/zonos-banner_2.entry.js +0 -115
  351. package/dist/zonos-elements/zonos-banner_2.entry.js.map +0 -1
  352. package/dist/zonos-elements/zonos-banner_2.system.entry.js +0 -2
  353. package/dist/zonos-elements/zonos-banner_2.system.entry.js.map +0 -1
  354. package/dist/zonos-elements/zonosStore-13a7b534.js.map +0 -1
  355. package/dist/zonos-elements/zonosStore-77bcd7c0.system.js +0 -2
  356. package/dist/zonos-elements/zonosStore-77bcd7c0.system.js.map +0 -1
  357. /package/dist/esm-es5/{getBorderRadius-82fbaf25.js.map → getBorderRadius-e8ad5967.js.map} +0 -0
  358. /package/dist/esm-es5/{isDarkColor-b21326ae.js.map → isDarkColor-3bb345f4.js.map} +0 -0
  359. /package/dist/esm-es5/{submitGtag-fbdb454b.js.map → submitGtag-85914088.js.map} +0 -0
  360. /package/dist/zonos-elements/{getBorderRadius-4fbe49de.system.js.map → getBorderRadius-b59c3ada.system.js.map} +0 -0
  361. /package/dist/zonos-elements/{isDarkColor-dc2b7c8f.system.js.map → isDarkColor-231502d4.system.js.map} +0 -0
  362. /package/dist/zonos-elements/{submitGtag-23ecdc20.system.js.map → submitGtag-764af8c4.system.js.map} +0 -0
@@ -1 +1 @@
1
- {"file":"zonos-hello-dialog.entry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AAkB,EAAE,IAAI,CAAC,kBAAkB,EAC3C,oBAAoB,EAAE,KAAK,IAAI,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,GACpC,CAC9B,CACG,CACD,EACP;GACH;;;;;;;;;;","names":["zonosStore","localizationStore","currencyConvertAndFormat","translate","getHasMoreSpaceOnRight","h","Host","classes"],"sources":["src/components/hello/zonos-hello-dialog/zonos-hello-dialog.scss?tag=zonos-hello-dialog&encapsulation=shadow","src/components/hello/zonos-hello-dialog/zonos-hello-dialog.tsx"],"sourcesContent":[":host {\n .zonos--hello-country-flag {\n @include zonos--hello-country-flag;\n }\n\n .zonos--hello-dialog {\n position: absolute;\n background: $amino-surface-color;\n width: 100vw;\n max-width: 430px;\n height: fit-content;\n max-height: 600px;\n border-radius: $amino-radius-12;\n outline: none;\n box-shadow: $amino-v3-shadow-xxl;\n overflow-y: auto;\n top: -2px;\n right: -2px;\n opacity: 0;\n transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;\n transform: scale(0);\n transform-origin: top right;\n text-align: center;\n z-index: 1001;\n\n &.zonos--hello-dialog-animate-from-left {\n transform-origin: top left;\n right: unset;\n left: -2px;\n }\n\n &::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n &::-webkit-scrollbar-track {\n background: #f5f5f5;\n border-top-right-radius: $amino-radius-12;\n border-bottom-right-radius: $amino-radius-12;\n }\n\n &::-webkit-scrollbar-thumb {\n border-radius: 10px;\n background: #ccc;\n border: 4px solid transparent;\n background-clip: content-box;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: #999;\n }\n\n .zonos--animate-content {\n opacity: 0;\n height: 0;\n transition: all 0.3s ease-in-out;\n }\n .zonos--show-animate-content {\n opacity: 1;\n height: 100%;\n }\n\n &.zonos--hello-dialog-open {\n opacity: 1;\n transform: scale(1);\n }\n\n .zonos--close-button {\n position: absolute;\n right: $amino-space-8;\n top: $amino-space-8;\n width: $amino-size-md;\n height: $amino-size-md;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n z-index: 10;\n &:hover {\n background: $amino-hover-color;\n border-radius: $amino-radius-6;\n }\n }\n\n .zonos--hello-dialog-content {\n padding: $amino-space-16;\n\n .zonos--hello-country-flag {\n border-radius: $amino-radius-4;\n width: 32px;\n height: 24px;\n }\n }\n\n .zonos--flex-message {\n display: flex;\n align-items: center;\n gap: $amino-space-8;\n }\n\n &.zonos--hello-dialog-mobile-override {\n @include zonos--hello-dialog-mobile;\n }\n @media (max-width: 768px) {\n @include zonos--hello-dialog-mobile;\n }\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport { localizationStore } from 'src/components/store/hello/localization';\nimport { translate } from 'src/components/store/translationStore';\nimport { zonosStore } from 'src/components/store/zonosStore';\nimport { classes } from 'src/components/utils/classes';\nimport { currencyConvertAndFormat } from 'src/components/utils/hello/currencyConversion/currencyConvertAndFormat';\nimport { getHasMoreSpaceOnRight } from 'src/components/utils/hello/getHasMoreSpaceOnRight';\nimport type { AppearanceConfig, HelloMobileLocation } from 'src/types';\nimport type { Locale_PageName_Enum } from 'src/types/generated/graphql.frontend.types';\n\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport BagIcon from './assets/bagIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport MessageIcon from './assets/messageIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport MoneyIcon from './assets/moneyIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport RemoveIcon from './assets/removeIcon.svg';\n\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-hello-dialog.scss',\n tag: 'zonos-hello-dialog',\n})\nexport class ZonosHelloDialog {\n /**\n * Whether or not the dialog is open\n */\n @Prop() isOpen: boolean = false;\n\n /**\n * The function to set the open state\n * @default () => {}\n */\n @Prop() setIsOpen: (isOpen: boolean) => void = () => {};\n\n /**\n * Force mobile styling instead of media query and use the passed location value\n * @default false\n */\n @Prop() mobileLocationOverride?: HelloMobileLocation;\n /**\n * Force left animation instead of detecting which side has more space\n * @default false\n */\n @Prop() animateFromLeftOverride?: boolean;\n /**\n * Override the appearance settings\n */\n @Prop() appearanceSettings?: Partial<AppearanceConfig>;\n\n @State() welcomeMessage: string = 'Welcome to our Demo App!';\n @State() showCountrySelect: boolean = false;\n\n /**\n * Close dialog button click\n */\n @Event() closeDialog!: EventEmitter<void>;\n\n private dialogRef!: HTMLDivElement;\n\n private clickOutsideDialogHandler = (e: MouseEvent) => {\n if (!e.composedPath().includes(this.dialogRef) && this.isOpen) {\n this.setIsOpen(false);\n }\n };\n\n private getCurrentPageEnum = (): Locale_PageName_Enum | null => {\n switch (zonosStore.currentHelloPage) {\n case 'home':\n return 'hello_homepage';\n case 'cart':\n return 'hello_cart';\n case 'productList':\n return 'hello_item_list';\n case 'productDetail':\n return 'hello_item_details';\n\n default:\n return null;\n }\n };\n\n private setShowCountrySelect = async (value: boolean) => {\n this.showCountrySelect = value;\n };\n\n @Listen('click', { target: 'document' })\n globalClickHandler(e: MouseEvent) {\n this.clickOutsideDialogHandler(e);\n }\n\n @Watch('isOpen')\n isOpenHandler(isOpen: boolean) {\n if (!isOpen) {\n void this.setShowCountrySelect(false);\n }\n }\n\n render() {\n const { countryLandedCost, selectedCountryCode } = localizationStore;\n\n // Our Robby API spells deminimis wrong here\n const dutyDeminimis = countryLandedCost?.dutyDeminimus\n ? currencyConvertAndFormat(countryLandedCost.dutyDeminimus)\n : null;\n // If deminimis is undefined or null, assume it's $0\n const dutyDeMinimisMessage = dutyDeminimis\n ? `${translate('Spend')} ${dutyDeminimis} ${translate('duty free')}`\n : translate('Duties will apply to all orders');\n\n // Our Robby API spells deminimis wrong here\n const taxDeminimis = countryLandedCost?.vatTaxDeminimus\n ? currencyConvertAndFormat(countryLandedCost.vatTaxDeminimus)\n : null;\n const taxDeMinimisMessage = taxDeminimis\n ? `${translate('Spend')} ${taxDeminimis} ${translate('tax free')}`\n : translate('Taxes will apply to all orders');\n\n const animateLeft =\n this.animateFromLeftOverride ||\n (this.dialogRef && getHasMoreSpaceOnRight(this.dialogRef));\n\n const { customMessages } = localizationStore;\n const welcomeMessage = `${translate('Welcome to')} ${\n zonosStore.organizationName\n }!`;\n const defaultMessage =\n customMessages.find(x => x.pageName === 'hello_default')?.message ||\n translate(\n 'Know about duties and taxes before you buy. Shop with confidence!',\n );\n\n const currentPage = this.getCurrentPageEnum();\n const filteredMessages = customMessages.filter(\n x => x.pageName === currentPage,\n );\n\n return (\n <Host class=\"zonos--elements\">\n <div\n aria-hidden=\"true\"\n class={classes([\n 'zonos--hello-dialog',\n animateLeft && 'zonos--hello-dialog-animate-from-left',\n !!this.mobileLocationOverride &&\n 'zonos--hello-dialog-mobile-override',\n this.isOpen && 'zonos--hello-dialog-open',\n ])}\n ref={el => el && (this.dialogRef = el)}\n >\n <div class=\"zonos--hello-dialog-content\">\n <zonos-button\n class=\"zonos--close-button\"\n icon={<zonos-icon content={RemoveIcon}></zonos-icon>}\n noBackground\n onClick={() => this.setIsOpen(false)}\n ></zonos-button>\n\n {this.showCountrySelect ? (\n <div>\n <zonos-country-select\n closeCountrySelect={() => this.setShowCountrySelect(false)}\n ></zonos-country-select>\n </div>\n ) : (\n <div>\n <zonos-v-stack spacing={24}>\n <zonos-country-flag\n class=\"zonos--hello-country-flag\"\n countryCode={selectedCountryCode}\n ></zonos-country-flag>\n\n <zonos-v-stack spacing={4}>\n <zonos-text type=\"boldSubheader\">\n {welcomeMessage}\n </zonos-text>\n <zonos-text color=\"gray-800\">{defaultMessage}</zonos-text>\n </zonos-v-stack>\n\n <zonos-v-stack spacing={8}>\n <zonos-card spacing=\"12px\">\n <zonos-v-stack spacing={8}>\n <div class=\"zonos--flex-message\">\n <zonos-icon content={BagIcon}></zonos-icon>\n <zonos-text>{dutyDeMinimisMessage}</zonos-text>\n </div>\n\n <div class=\"zonos--flex-message\">\n <zonos-icon content={MoneyIcon}></zonos-icon>\n <zonos-text>{taxDeMinimisMessage}</zonos-text>\n </div>\n </zonos-v-stack>\n </zonos-card>\n\n {filteredMessages.map(x => (\n <zonos-custom-message\n icon={MessageIcon}\n message={x.message}\n ></zonos-custom-message>\n ))}\n </zonos-v-stack>\n </zonos-v-stack>\n </div>\n )}\n </div>\n\n {!this.showCountrySelect && (\n <zonos-hello-dialog-footer\n appearanceSettings={this.appearanceSettings}\n setShowCountrySelect={value => this.setShowCountrySelect(value)}\n ></zonos-hello-dialog-footer>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
1
+ {"file":"zonos-hello-dialog.entry.cjs.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAM,mBAAmB,GAAG,6zIAA6zI;;MCqC50I,gBAAgB;;;;IA2CnB,8BAAyB,GAAG,CAAC,CAAa;MAChD,IAAI,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE;QAC7D,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;OACvB;KACF,CAAC;IAEM,uBAAkB,GAAG;MAC3B,QAAQA,qBAAU,CAAC,gBAAgB;QACjC,KAAK,MAAM;UACT,OAAO,gBAAgB,CAAC;QAC1B,KAAK,MAAM;UACT,OAAO,YAAY,CAAC;QACtB,KAAK,aAAa;UAChB,OAAO,iBAAiB,CAAC;QAC3B,KAAK,eAAe;UAClB,OAAO,oBAAoB,CAAC;QAE9B;UACE,OAAO,IAAI,CAAC;OACf;KACF,CAAC;IAEM,yBAAoB,GAAG,OAAO,KAAc;MAClD,IAAI,CAAC,iBAAiB,GAAG,KAAK,CAAC;KAChC,CAAC;kBA/DwB,KAAK;qBAMgB,SAAQ;;;;2BAqBX,EAAE;0BAEZ,0BAA0B;6BACtB,KAAK;;EAoC3C,kBAAkB,CAAC,CAAa;IAC9B,IA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,GAAG,CACvB,IAAI;;MACF,OAAA,IAAI,KACFA,0BAAc,WAAW,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAC,OAAO,IACjD,MAAA,IAAI,CAAC,gBAAgB,0CAAE,GAAG,CAAC,CAAC,KAC3BA,wBAAY,KAAK,EAAC,SAAS,IAAE,CAAC,aAAD,CAAC,uBAAD,CAAC,CAAE,IAAI,CAAc,CACnD,CAAC,CACW,CAChB,CAAA;KAAA,CACJ,EAEDA,wBAAY,OAAO,EAAC,MAAM,IACxBA,2BAAe,OAAO,EAAE,EAAE,IACxBA,iBAAK,KAAK,EAAC,qBAAqB,IAC9BA,wBAAY,OAAO,EAAE,OAAO,GAAe,EAC3CA,4BAAa,oBAAoB,CAAc,CAC3C,EAENA,iBAAK,KAAK,EAAC,qBAAqB,IAC9BA,wBAAY,OAAO,EAAE,SAAS,GAAe,EAC7CA,4BAAa,mBAAmB,CAAc,CAC1C,CACQ,CACL,EAEZ,gBAAgB,CAAC,GAAG,CAAC,CAAC,KACrBA,kCACE,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,CAAC,CAAC,OAAO,GACI,CACzB,CAAC,CACY,CACF,CACZ,CACP,CACG,EAEL,CAAC,IAAI,CAAC,iBAAiB,KACtBA,uCACE,kBAAkB,EAAE,IAAI,CAAC,kBAAkB,EAC3C,oBAAoB,EAAE,KAAK,IAAI,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,GACpC,CAC9B,CACG,CACD,EACP;GACH;;;;;;;;;;","names":["zonosStore","localizationStore","currencyConvertAndFormat","translate","getHasMoreSpaceOnRight","h","Host","classes"],"sources":["src/components/hello/zonos-hello-dialog/zonos-hello-dialog.scss?tag=zonos-hello-dialog&encapsulation=shadow","src/components/hello/zonos-hello-dialog/zonos-hello-dialog.tsx"],"sourcesContent":[":host {\n .zonos--hello-country-flag {\n @include zonos--hello-country-flag;\n }\n\n .zonos--hello-dialog {\n position: absolute;\n background: $amino-surface-color;\n width: 100vw;\n max-width: 430px;\n height: fit-content;\n max-height: 600px;\n border-radius: $amino-radius-12;\n outline: none;\n box-shadow: $amino-v3-shadow-xxl;\n overflow-y: auto;\n top: -2px;\n right: -2px;\n opacity: 0;\n transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;\n transform: scale(0);\n transform-origin: top right;\n z-index: 1001;\n\n .zonos--hello-dialog-header {\n text-align: center;\n }\n\n &.zonos--hello-dialog-animate-from-left {\n transform-origin: top left;\n right: unset;\n left: -2px;\n }\n\n &::-webkit-scrollbar {\n width: 12px;\n height: 12px;\n }\n\n &::-webkit-scrollbar-track {\n background: #f5f5f5;\n border-top-right-radius: $amino-radius-12;\n border-bottom-right-radius: $amino-radius-12;\n }\n\n &::-webkit-scrollbar-thumb {\n border-radius: 10px;\n background: #ccc;\n border: 4px solid transparent;\n background-clip: content-box;\n }\n\n &::-webkit-scrollbar-thumb:hover {\n background: #999;\n }\n\n .zonos--animate-content {\n opacity: 0;\n height: 0;\n transition: all 0.3s ease-in-out;\n }\n .zonos--show-animate-content {\n opacity: 1;\n height: 100%;\n }\n\n &.zonos--hello-dialog-open {\n opacity: 1;\n transform: scale(1);\n }\n\n .zonos--close-button {\n position: absolute;\n right: $amino-space-8;\n top: $amino-space-8;\n width: $amino-size-md;\n height: $amino-size-md;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n z-index: 10;\n &:hover {\n background: $amino-hover-color;\n border-radius: $amino-radius-6;\n }\n }\n\n .zonos--hello-dialog-content {\n padding: $amino-space-16;\n\n .zonos--hello-country-flag {\n border-radius: $amino-radius-4;\n width: 32px;\n height: 24px;\n }\n }\n\n .zonos--flex-message {\n display: flex;\n align-items: center;\n gap: $amino-space-12;\n }\n\n &.zonos--hello-dialog-mobile-override {\n @include zonos--hello-dialog-mobile;\n }\n @media (max-width: 768px) {\n @include zonos--hello-dialog-mobile;\n }\n }\n}\n","import {\n type EventEmitter,\n Component,\n Event,\n h,\n Host,\n Listen,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\n\nimport { localizationStore } from 'src/components/store/hello/localization';\nimport { translate } from 'src/components/store/translationStore';\nimport { zonosStore } from 'src/components/store/zonosStore';\nimport { classes } from 'src/components/utils/classes';\nimport { currencyConvertAndFormat } from 'src/components/utils/hello/currencyConversion/currencyConvertAndFormat';\nimport { getHasMoreSpaceOnRight } from 'src/components/utils/hello/getHasMoreSpaceOnRight';\nimport type { AppearanceConfig, HelloMobileLocation } from 'src/types';\nimport type { Locale_PageName_Enum } from 'src/types/generated/graphql.frontend.types';\nimport type { RestrictedItem } from 'src/types/hello/RestrictedItem';\n\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport BagIcon from './assets/bagIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport MessageIcon from './assets/messageIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport MoneyIcon from './assets/moneyIcon.svg';\n// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths\nimport RemoveIcon from './assets/removeIcon.svg';\n\n@Component({\n assetsDirs: ['assets'],\n shadow: true,\n styleUrl: 'zonos-hello-dialog.scss',\n tag: 'zonos-hello-dialog',\n})\nexport class ZonosHelloDialog {\n /**\n * Whether or not the dialog is open\n */\n @Prop() isOpen: boolean = false;\n\n /**\n * The function to set the open state\n * @default () => {}\n */\n @Prop() setIsOpen: (isOpen: boolean) => void = () => {};\n\n /**\n * Force mobile styling instead of media query and use the passed location value\n * @default false\n */\n @Prop() mobileLocationOverride?: HelloMobileLocation;\n /**\n * Force left animation instead of detecting which side has more space\n * @default false\n */\n @Prop() animateFromLeftOverride?: boolean;\n /**\n * Override the appearance settings\n */\n @Prop() appearanceSettings?: Partial<AppearanceConfig>;\n\n /**\n * Item restrictions array if any\n * @default []\n */\n @Prop() restrictedItems: RestrictedItem[] = [];\n\n @State() welcomeMessage: string = 'Welcome to our Demo App!';\n @State() showCountrySelect: boolean = false;\n\n /**\n * Close dialog button click\n */\n @Event() closeDialog!: EventEmitter<void>;\n\n private dialogRef!: HTMLDivElement;\n\n private clickOutsideDialogHandler = (e: MouseEvent) => {\n if (!e.composedPath().includes(this.dialogRef) && this.isOpen) {\n this.setIsOpen(false);\n }\n };\n\n private getCurrentPageEnum = (): Locale_PageName_Enum | null => {\n switch (zonosStore.currentHelloPage) {\n case 'home':\n return 'hello_homepage';\n case 'cart':\n return 'hello_cart';\n case 'productList':\n return 'hello_item_list';\n case 'productDetail':\n return 'hello_item_details';\n\n default:\n return null;\n }\n };\n\n private setShowCountrySelect = async (value: boolean) => {\n this.showCountrySelect = value;\n };\n\n @Listen('click', { target: 'document' })\n globalClickHandler(e: MouseEvent) {\n this.clickOutsideDialogHandler(e);\n }\n\n @Watch('isOpen')\n isOpenHandler(isOpen: boolean) {\n if (!isOpen) {\n void this.setShowCountrySelect(false);\n }\n }\n\n render() {\n const { countryLandedCost, selectedCountryCode } = localizationStore;\n\n // Our Robby API spells deminimis wrong here\n const dutyDeminimis = countryLandedCost?.dutyDeminimus\n ? currencyConvertAndFormat(countryLandedCost.dutyDeminimus)\n : null;\n // If deminimis is undefined or null, assume it's $0\n const dutyDeMinimisMessage = dutyDeminimis\n ? `${translate('Spend')} ${dutyDeminimis} ${translate('duty free')}`\n : translate('Duties will apply to all orders');\n\n // Our Robby API spells deminimis wrong here\n const taxDeminimis = countryLandedCost?.vatTaxDeminimus\n ? currencyConvertAndFormat(countryLandedCost.vatTaxDeminimus)\n : null;\n const taxDeMinimisMessage = taxDeminimis\n ? `${translate('Spend')} ${taxDeminimis} ${translate('tax free')}`\n : translate('Taxes will apply to all orders');\n\n const animateLeft =\n this.animateFromLeftOverride ||\n (this.dialogRef && getHasMoreSpaceOnRight(this.dialogRef));\n\n const { customMessages } = localizationStore;\n const welcomeMessage = `${translate('Welcome to')} ${\n zonosStore.organizationName\n }!`;\n const defaultMessage =\n customMessages.find(x => x.pageName === 'hello_default')?.message ||\n translate(\n 'Know about duties and taxes before you buy. Shop with confidence!',\n );\n\n const currentPage = this.getCurrentPageEnum();\n const filteredMessages = customMessages.filter(\n x => x.pageName === currentPage,\n );\n\n return (\n <Host class=\"zonos--elements\">\n <div\n aria-hidden=\"true\"\n class={classes([\n 'zonos--hello-dialog',\n animateLeft && 'zonos--hello-dialog-animate-from-left',\n !!this.mobileLocationOverride &&\n 'zonos--hello-dialog-mobile-override',\n this.isOpen && 'zonos--hello-dialog-open',\n ])}\n ref={el => el && (this.dialogRef = el)}\n >\n <div class=\"zonos--hello-dialog-content\">\n <zonos-button\n class=\"zonos--close-button\"\n icon={<zonos-icon content={RemoveIcon}></zonos-icon>}\n noBackground\n onClick={() => this.setIsOpen(false)}\n ></zonos-button>\n\n {this.showCountrySelect ? (\n <div>\n <zonos-country-select\n closeCountrySelect={() => this.setShowCountrySelect(false)}\n ></zonos-country-select>\n </div>\n ) : (\n <div>\n <zonos-v-stack spacing={24}>\n <zonos-country-flag\n class=\"zonos--hello-country-flag\"\n countryCode={selectedCountryCode}\n ></zonos-country-flag>\n\n <zonos-v-stack class=\"zonos--hello-dialog-header\" spacing={4}>\n <zonos-text type=\"boldSubheader\">\n {welcomeMessage}\n </zonos-text>\n <zonos-text color=\"gray-800\">{defaultMessage}</zonos-text>\n </zonos-v-stack>\n\n <zonos-v-stack spacing={8}>\n {this.restrictedItems.map(\n item =>\n item && (\n <zonos-banner bannerTitle={item.name} intent=\"error\">\n {item.itemRestrictions?.map(x => (\n <zonos-text color=\"red-800\">{x?.note}</zonos-text>\n ))}\n </zonos-banner>\n ),\n )}\n\n <zonos-card spacing=\"12px\">\n <zonos-v-stack spacing={12}>\n <div class=\"zonos--flex-message\">\n <zonos-icon content={BagIcon}></zonos-icon>\n <zonos-text>{dutyDeMinimisMessage}</zonos-text>\n </div>\n\n <div class=\"zonos--flex-message\">\n <zonos-icon content={MoneyIcon}></zonos-icon>\n <zonos-text>{taxDeMinimisMessage}</zonos-text>\n </div>\n </zonos-v-stack>\n </zonos-card>\n\n {filteredMessages.map(x => (\n <zonos-custom-message\n icon={MessageIcon}\n message={x.message}\n ></zonos-custom-message>\n ))}\n </zonos-v-stack>\n </zonos-v-stack>\n </div>\n )}\n </div>\n\n {!this.showCountrySelect && (\n <zonos-hello-dialog-footer\n appearanceSettings={this.appearanceSettings}\n setShowCountrySelect={value => this.setShowCountrySelect(value)}\n ></zonos-hello-dialog-footer>\n )}\n </div>\n </Host>\n );\n }\n}\n"],"version":3}
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-9542d2e7.js');
6
- const zonosStore = require('./zonosStore-960e5542.js');
7
- const localization = require('./localization-f6a1b679.js');
6
+ const zonosStore = require('./zonosStore-d9cdaec6.js');
7
+ const localization = require('./localization-d510574c.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-2855491b.js');
10
10
 
@@ -344,12 +344,131 @@ function debounce(func, wait, options) {
344
344
 
345
345
  var debounce_1 = debounce;
346
346
 
347
- const zonosHelloCss = ":host{font-family:Inter;display:block}: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:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:0}@media (max-width: 768px){:host .zonos--hello-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:0}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--amino-page-background);font-size:var(--amino-font-size-s);border:var(--amino-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;width:100%;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--amino-text-color);position:absolute;background:var(--amino-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + var(--amino-space-16)));transform:translateX(calc(-100% + var(--amino-space-16)));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--amino-border);border-bottom:var(--amino-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:var(--amino-space-16);border:var(--amino-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:0;border-bottom-left-radius:0}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:0;border-bottom-right-radius:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-16);padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - var(--amino-space-16)));transform:translateX(calc(100% - var(--amino-space-16)));right:0;left:auto;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);z-index:10;justify-self:center}@media (max-width: 768px){:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:24px}}@media (max-width: 768px){:host .zonos--hello-widget{position:fixed;bottom:var(--amino-space-32);right:var(--amino-space-32);border-radius:var(--amino-radius-4);padding:var(--amino-space-4);border:1px solid transparent}:host .zonos--hello-widget.zonos--hello-widget-left{left:var(--amino-space-32);right:auto}:host .zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:var(--amino-space-32)}:host .zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--amino-radius-4);border-bottom-left-radius:var(--amino-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--amino-radius-4);border-bottom-right-radius:var(--amino-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-8);padding-right:var(--amino-space-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--amino-radius-4);padding-right:6px;border:none}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--amino-radius-4)}}:host .zonos--hello-mobile-override.zonos--hello-widget{position:fixed;bottom:var(--amino-space-32);right:var(--amino-space-32);border-radius:var(--amino-radius-4);padding:var(--amino-space-4);border:1px solid transparent}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-left{left:var(--amino-space-32);right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:var(--amino-space-32)}:host .zonos--hello-mobile-override.zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--amino-radius-4);border-bottom-left-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--amino-radius-4);border-bottom-right-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-8);padding-right:var(--amino-space-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--amino-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:24px}";
347
+ const checkItemRestrictions = async ({ items, shipFrom, shipTo, }) => {
348
+ var _a;
349
+ const url = `${"https://v1.route.js.zonos.com"}/api/check-item-restrictions`;
350
+ const body = {
351
+ items,
352
+ shipFrom,
353
+ shipTo,
354
+ };
355
+ const { errors, json } = await localization.handleFetch(url, { body, method: 'POST' });
356
+ if (errors.length || !json) {
357
+ localization.logError(`Error fetching item restrictions: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
358
+ return [];
359
+ }
360
+ return json.filter(Boolean);
361
+ };
362
+
363
+ const detectItemRestrictions = async (newProducts) => {
364
+ if (!newProducts.length) {
365
+ return [];
366
+ }
367
+ const { selectedCountryCode } = localization.localizationStore;
368
+ if (!selectedCountryCode) {
369
+ localization.logError('Hello Could not check item restrictions - No country code selected');
370
+ return [];
371
+ }
372
+ const items = newProducts.map(product => ({
373
+ description: product.description,
374
+ name: product.title,
375
+ }));
376
+ const restrictedItems = await checkItemRestrictions({
377
+ items: items,
378
+ shipFrom: 'AD',
379
+ shipTo: selectedCountryCode,
380
+ });
381
+ const restrictedItemsWithName = restrictedItems.map(item => {
382
+ var _a;
383
+ const name = ((_a = items.filter(x => x.description === item.itemDescription).find(Boolean)) === null || _a === void 0 ? void 0 : _a.name) || '';
384
+ return Object.assign(Object.assign({}, item), { name });
385
+ });
386
+ return restrictedItemsWithName;
387
+ };
388
+
389
+ const getCurrentHelloLocalePage = () => {
390
+ const { href } = window.location;
391
+ const { cartUrlPattern, homepageUrlPattern, productDetailUrlPattern, productListUrlPattern, } = zonosStore.zonosStore.helloSettings;
392
+ // The 'if' statements are sorted by most specific to least specific to help with regex matching
393
+ if (cartUrlPattern && new RegExp(cartUrlPattern).test(href)) {
394
+ return 'cart';
395
+ }
396
+ if (productDetailUrlPattern &&
397
+ new RegExp(productDetailUrlPattern).test(href)) {
398
+ return 'productDetail';
399
+ }
400
+ if (productListUrlPattern && new RegExp(productListUrlPattern).test(href)) {
401
+ return 'productList';
402
+ }
403
+ if (homepageUrlPattern && new RegExp(homepageUrlPattern).test(href)) {
404
+ return 'home';
405
+ }
406
+ return '';
407
+ };
408
+
409
+ const getProductsOnPage = () => {
410
+ var _a, _b;
411
+ const { productAddToCartElementSelector, productDescriptionElementSelector, productTitleElementSelector, restrictionBehavior, } = zonosStore.zonosStore.helloSettings;
412
+ if (!productTitleElementSelector || !productDescriptionElementSelector) {
413
+ localization.logError(`Hello Could not check item restrictions - must provide title and description selectors.`);
414
+ }
415
+ const titleNodes = (productTitleElementSelector &&
416
+ localization.isValidSelector(productTitleElementSelector) &&
417
+ document.querySelectorAll(productTitleElementSelector)) ||
418
+ [];
419
+ const descriptionNodes = (productDescriptionElementSelector &&
420
+ localization.isValidSelector(productDescriptionElementSelector) &&
421
+ document.querySelectorAll(productDescriptionElementSelector)) ||
422
+ [];
423
+ if (titleNodes.length !== descriptionNodes.length) {
424
+ // If the title and description selectors don't match, kill item restrictions altogether
425
+ localization.logError('Hello Could not check item restrictions - Title and description selectors do not match');
426
+ return [];
427
+ }
428
+ const shouldDisableCart = restrictionBehavior === 'RESTRICT_AND_BLOCK';
429
+ const cartButtonNodes = (shouldDisableCart &&
430
+ productAddToCartElementSelector &&
431
+ localization.isValidSelector(productAddToCartElementSelector) &&
432
+ document.querySelectorAll(productAddToCartElementSelector)) ||
433
+ [];
434
+ if (shouldDisableCart && cartButtonNodes.length !== descriptionNodes.length) {
435
+ // If the "add to cart" selectors don't match, log the error and continue
436
+ localization.logError('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match');
437
+ }
438
+ const mergedElements = [];
439
+ for (let i = 0; i < titleNodes.length; i++) {
440
+ const titleNode = titleNodes[i];
441
+ const descriptionNode = descriptionNodes[i];
442
+ const cartButtonNode = cartButtonNodes[i];
443
+ if (titleNode && descriptionNode) {
444
+ const element = {
445
+ cartButtonNode: cartButtonNode || null,
446
+ description: ((_a = descriptionNode.textContent) === null || _a === void 0 ? void 0 : _a.trim()) || '',
447
+ title: ((_b = titleNode.textContent) === null || _b === void 0 ? void 0 : _b.trim()) || '',
448
+ };
449
+ mergedElements.push(element);
450
+ }
451
+ }
452
+ return mergedElements;
453
+ };
348
454
 
455
+ const zonosHelloCss = ":host{font-family:Inter;display:block}: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:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--amino-page-background);font-size:var(--amino-font-size-s);border:var(--amino-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;width:100%;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--amino-text-color);position:absolute;background:var(--amino-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + var(--amino-space-16)));transform:translateX(calc(-100% + var(--amino-space-16)));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--amino-border);border-bottom:var(--amino-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--amino-red-100);border:1px solid var(--amino-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--amino-red-100);color:var(--amino-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--amino-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:var(--amino-space-16);border:var(--amino-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:0;border-bottom-left-radius:0}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:0;border-bottom-right-radius:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-16);padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - var(--amino-space-16)));transform:translateX(calc(100% - var(--amino-space-16)));right:0;left:auto;border-top-left-radius:0;border-bottom-left-radius:0;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);z-index:10;justify-self:center}@media (max-width: 768px){:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:24px}}@media (max-width: 768px){:host .zonos--hello-widget{position:fixed;bottom:var(--amino-space-32);right:var(--amino-space-32);border-radius:var(--amino-radius-4);padding:var(--amino-space-4);border:1px solid transparent}:host .zonos--hello-widget.zonos--hello-widget-left{left:var(--amino-space-32);right:auto}:host .zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:var(--amino-space-32)}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--amino-radius-4);border-bottom-left-radius:var(--amino-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--amino-radius-4);border-bottom-right-radius:var(--amino-radius-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-8);padding-right:var(--amino-space-4)}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--amino-radius-4);padding-right:6px;border:none}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--amino-radius-4)}}:host .zonos--hello-mobile-override.zonos--hello-widget{position:fixed;bottom:var(--amino-space-32);right:var(--amino-space-32);border-radius:var(--amino-radius-4);padding:var(--amino-space-4);border:1px solid transparent}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-left{left:var(--amino-space-32);right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-top{bottom:auto;top:var(--amino-space-32)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left){border-top-left-radius:var(--amino-radius-4);border-bottom-left-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left{border-top-right-radius:var(--amino-radius-4);border-bottom-right-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:var(--amino-space-8);padding-right:var(--amino-space-4)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--amino-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag-wrapper{border-radius:var(--amino-radius-4)}:host .zonos--hello-mobile-override.zonos--hello-widget .zonos--hello-country-flag{border-radius:var(--amino-radius-4);width:24px}";
456
+
457
+ const PEEK_MESSAGE_DELAY_MS = 3000;
458
+ const RESIZE_DEBOUNCE_DELAY_MS = 500;
349
459
  const ZonosHello = class {
350
460
  constructor(hostRef) {
351
461
  index.registerInstance(this, hostRef);
352
462
  this.getHelloPeekMessage = () => {
463
+ const isRestrictionPage = zonosStore.zonosStore.currentHelloPage === 'productDetail' ||
464
+ zonosStore.zonosStore.currentHelloPage === 'productList';
465
+ if (isRestrictionPage && this.allRestrictedItems.length) {
466
+ const clickMessage = localization.translate('click to learn more');
467
+ const restrictMessage = zonosStore.zonosStore.currentHelloPage === 'productDetail'
468
+ ? localization.translate('Restricted item')
469
+ : localization.translate('Restricted items found');
470
+ return `${restrictMessage} - ${clickMessage}`;
471
+ }
353
472
  switch (zonosStore.zonosStore.currentHelloPage) {
354
473
  case 'cart':
355
474
  return localization.translate(`Prepay duties and taxes at checkout`);
@@ -365,16 +484,116 @@ const ZonosHello = class {
365
484
  this.showPeekMessage = true;
366
485
  }
367
486
  };
487
+ this.getNewItemRestrictions = async (newProducts) => {
488
+ const isRestrictionPage = zonosStore.zonosStore.currentHelloPage === 'productDetail' ||
489
+ zonosStore.zonosStore.currentHelloPage === 'productList';
490
+ // Only run detectItemRestrictions on product pages if the restrictionBehavior is not DISABLED
491
+ if (!isRestrictionPage ||
492
+ zonosStore.zonosStore.helloSettings.restrictionBehavior === 'DISABLED') {
493
+ return [];
494
+ }
495
+ const newRestrictions = await detectItemRestrictions(newProducts);
496
+ return newRestrictions;
497
+ };
498
+ this.triggerShowPeekMessage = () => {
499
+ this.peekMessage = this.getHelloPeekMessage();
500
+ const { peekMessageBehavior, peekMessageDelay } = zonosStore.zonosStore.helloSettings;
501
+ // peek message delay is passed in seconds, but setTimeout expects milliseconds
502
+ const peekMessageDelayToUse = peekMessageDelay * 1000;
503
+ if (peekMessageBehavior === 'ENABLED') {
504
+ setTimeout(() => {
505
+ this.enableShowPeekMessage();
506
+ setTimeout(() => {
507
+ this.showPeekMessage = false;
508
+ }, PEEK_MESSAGE_DELAY_MS);
509
+ }, peekMessageDelayToUse);
510
+ }
511
+ };
512
+ this.disableAddToCartButtons = () => {
513
+ // Remove disabled attribute from all "add to cart" buttons
514
+ if (this.productsOnPage.length) {
515
+ this.productsOnPage.forEach(product => {
516
+ var _a, _b;
517
+ const isRestricted = this.allRestrictedItems.some(item => item.itemDescription === product.description);
518
+ // if a product description matches a restrictedItems itemDescription, then disable the add to cart button. Otherwise, enable it.
519
+ if (isRestricted) {
520
+ (_a = product.cartButtonNode) === null || _a === void 0 ? void 0 : _a.setAttribute('disabled', 'disabled');
521
+ }
522
+ else {
523
+ (_b = product.cartButtonNode) === null || _b === void 0 ? void 0 : _b.removeAttribute('disabled');
524
+ }
525
+ });
526
+ }
527
+ };
528
+ this.handleItemRestrictions = async () => {
529
+ this.productsOnPage = getProductsOnPage();
530
+ const newProducts = this.productsOnPage.filter(product => !this.allFoundProducts.some(foundProduct => foundProduct.title === product.title));
531
+ const newRestrictions = await this.getNewItemRestrictions(newProducts);
532
+ this.allRestrictedItems.push(...newRestrictions);
533
+ this.allFoundProducts.push(...newProducts);
534
+ this.disableAddToCartButtons();
535
+ };
536
+ this.reloadHelloData = async () => {
537
+ await this.handleItemRestrictions();
538
+ this.triggerShowPeekMessage();
539
+ void this.displayCurrency();
540
+ };
541
+ this.handleProductCountChange = debounce_1(() => {
542
+ const { productTitleElementSelector } = zonosStore.zonosStore.helloSettings;
543
+ if (productTitleElementSelector) {
544
+ const allProductsOnPage = getProductsOnPage();
545
+ if (this.allFoundProducts.length !== allProductsOnPage.length &&
546
+ window.location.href === this.initialUrl) {
547
+ // if allFoundProducts length is 0 (first render or no products), kill item restriction process as initial restrictions are handled in updateHelloOnPageChange
548
+ if (!this.allFoundProducts.length) {
549
+ return;
550
+ }
551
+ void this.reloadHelloData();
552
+ }
553
+ }
554
+ }, 1000);
555
+ this.watchProductCountChange = () => {
556
+ const observer = new MutationObserver(this.handleProductCountChange);
557
+ observer.observe(document.body, {
558
+ childList: true,
559
+ subtree: true,
560
+ });
561
+ };
562
+ this.updateHelloOnPageChange = () => {
563
+ // If the product count changes on the same url (loading more products), update the peek message and item restrictions
564
+ this.watchProductCountChange();
565
+ // Check url change on interval. If changed, update the peek message and item restrictions
566
+ setInterval(() => {
567
+ if (window.location.href !== this.initialUrl) {
568
+ const prevUrl = this.initialUrl && new URL(this.initialUrl);
569
+ const initialZonosCountry = prevUrl && prevUrl.searchParams.get('zonosCountry');
570
+ // If the zonosCountry url param changes, reset current item restriction tracking
571
+ if (initialZonosCountry !== localization.localizationStore.selectedCountryCode) {
572
+ this.allFoundProducts = [];
573
+ this.allRestrictedItems = [];
574
+ this.productsOnPage = [];
575
+ }
576
+ this.initialUrl = window.location.href;
577
+ zonosStore.zonosStore.currentHelloPage = getCurrentHelloLocalePage();
578
+ const currentUrl = new URL(window.location.href);
579
+ const zonosCountry = currentUrl.searchParams.get('zonosCountry');
580
+ if (!zonosCountry) {
581
+ localization.setZonosCountryUrlParam(localization.localizationStore.selectedCountryCode);
582
+ return;
583
+ }
584
+ void this.reloadHelloData();
585
+ }
586
+ }, 1000);
587
+ };
368
588
  this.changeShowDialog = (value) => {
369
589
  this.showDialog = value;
370
590
  };
371
591
  this.shouldAnimateLeftDesktop = () => {
372
- // Get element position (relative = desktop, fixed = mobile)
592
+ // Get Hello position (relative = desktop, fixed = mobile)
373
593
  const elPosition = this.helloRef && getComputedStyle(this.helloRef).position;
374
594
  // If relative position, determine if peek message should animate left or right. Mobile is pre-determined.
375
595
  if (this.helloRef && elPosition === 'relative') {
376
596
  const hasMoreSpaceOnRight = getHasMoreSpaceOnRight.getHasMoreSpaceOnRight(this.helloRef);
377
- // Determine peek message direction
378
597
  return hasMoreSpaceOnRight;
379
598
  }
380
599
  };
@@ -385,26 +604,19 @@ const ZonosHello = class {
385
604
  this.zonosStoreHelloSettings = zonosStore.zonosStore.helloSettings;
386
605
  this.showDialog = false;
387
606
  this.peekMessage = '';
607
+ this.initialUrl = '';
608
+ this.allRestrictedItems = [];
609
+ this.allFoundProducts = [];
610
+ this.productsOnPage = [];
388
611
  }
389
- componentDidLoad() {
390
- const initInterval = setInterval(() => {
612
+ componentWillLoad() {
613
+ const initInterval = setInterval(async () => {
391
614
  if (!this.helloRef) {
392
615
  return;
393
616
  }
394
617
  if (zonosStore.zonosStore.loadedConfig) {
395
618
  this.helloRef.setAttribute('data-zonos-hello-loaded', '');
396
- this.peekMessage = this.getHelloPeekMessage();
397
- const { peekMessageBehavior, peekMessageDelay } = zonosStore.zonosStore.helloSettings;
398
- // peek message delay is passed in seconds, but setTimeout expects milliseconds
399
- const peekMessageDelayToUse = peekMessageDelay * 1000;
400
- if (peekMessageBehavior === 'ENABLED') {
401
- setTimeout(() => {
402
- this.enableShowPeekMessage();
403
- setTimeout(() => {
404
- this.showPeekMessage = false;
405
- }, 3000);
406
- }, peekMessageDelayToUse);
407
- }
619
+ this.updateHelloOnPageChange();
408
620
  clearInterval(initInterval);
409
621
  }
410
622
  }, 100);
@@ -443,10 +655,10 @@ const ZonosHello = class {
443
655
  localization.currencyFormat(value);
444
656
  }
445
657
  handleResize() {
446
- debounce_1(this.render.bind(this), 500);
658
+ debounce_1(this.render.bind(this), RESIZE_DEBOUNCE_DELAY_MS);
447
659
  }
448
660
  render() {
449
- var _a;
661
+ var _a, _b;
450
662
  const isExcludedUrl = (_a = zonosStore.zonosStore.helloSettings.excludedUrlPatterns) === null || _a === void 0 ? void 0 : _a.some(pattern => new RegExp(pattern).test(window.location.href));
451
663
  if (isExcludedUrl) {
452
664
  localization.log('Hello is excluded on this url', 'warn');
@@ -462,6 +674,7 @@ const ZonosHello = class {
462
674
  const isOnTop = mobileLocation.includes('TOP');
463
675
  const appearanceSettings = zonosStore.mergeConfig(zonosStore.zonosStore.appearance, this.appearanceSettingsOverride);
464
676
  const { theme } = appearanceSettings;
677
+ const restrictedItemsOnPage = (_b = this.allRestrictedItems) === null || _b === void 0 ? void 0 : _b.filter(product => this.productsOnPage.some(restriction => restriction.description === product.itemDescription));
465
678
  return (index.h(index.Host, { class: "zonos--hello zonos--elements", "data-theme": theme }, selectedCountryCode && (index.h("div", { class: "zonos--hello-wrapper" }, index.h("button", { class: classes.classes([
466
679
  'zonos--hello-widget',
467
680
  this.showPeekMessage && 'zonos--hello-show-peek-message',
@@ -469,13 +682,15 @@ const ZonosHello = class {
469
682
  isOnLeft &&
470
683
  'zonos--hello-widget-left zonos--hello-widget-animate-from-left',
471
684
  isOnTop && 'zonos--hello-widget-top',
685
+ !!this.allRestrictedItems.length &&
686
+ 'zonos--hello-has-restrictions',
472
687
  ]), onClick: () => {
473
688
  this.changeShowDialog(!this.showDialog);
474
689
  }, onMouseEnter: () => this.enableShowPeekMessage(), onMouseLeave: () => (this.showPeekMessage = false), ref: el => el && (this.helloRef = el) }, index.h("span", { class: "zonos--hello-message" }, this.peekMessage), selectedCountryCode && (index.h("div", { class: "zonos--hello-country-flag-wrapper" }, index.h("zonos-country-flag", { class: "zonos--hello-country-flag", countryCode: selectedCountryCode })))), index.h("div", { class: classes.classes([
475
690
  'zonos--hello-dialog-wrapper',
476
691
  this.mobileLocationOverride &&
477
692
  'zonos--hello-dialog-wrapper-mobile-override',
478
- ]), style: { height: this.showDialog ? 'fit-content' : '0px' } }, index.h("zonos-hello-dialog", { animateFromLeftOverride: this.animateFromLeftOverride, appearanceSettings: appearanceSettings, isOpen: this.showDialog, mobileLocationOverride: this.mobileLocationOverride, setIsOpen: this.changeShowDialog }))))));
693
+ ]), style: { height: this.showDialog ? 'fit-content' : '0px' } }, index.h("zonos-hello-dialog", { animateFromLeftOverride: this.animateFromLeftOverride, appearanceSettings: appearanceSettings, isOpen: this.showDialog, mobileLocationOverride: this.mobileLocationOverride, restrictedItems: restrictedItemsOnPage, setIsOpen: this.changeShowDialog }))))));
479
694
  }
480
695
  };
481
696
  ZonosHello.style = zonosHelloCss;