@zonos/elements 1.3.21 → 1.3.23

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 (248) hide show
  1. package/dist/cjs/{ILanguage-d247b45b.js → ILanguage-98b04442.js} +2 -2
  2. package/dist/cjs/{cart-921f0a47.js → cart-c734e909.js} +284 -246
  3. package/dist/cjs/{getBorderRadius-9ad763e1.js → getBorderRadius-ea0984bb.js} +1 -1
  4. package/dist/cjs/index.cjs.js +5 -4
  5. package/dist/cjs/{isDarkColor-3d021ecc.js → isDarkColor-b14d5752.js} +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{submitGtag-71790233.js → submitGtag-336b437c.js} +2 -2
  8. package/dist/cjs/zonos-address_8.cjs.entry.js +4 -4
  9. package/dist/cjs/zonos-badge_2.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-button_3.cjs.entry.js +82 -43
  12. package/dist/cjs/zonos-card_2.cjs.entry.js +5 -5
  13. package/dist/cjs/zonos-cart-items_11.cjs.entry.js +20 -30
  14. package/dist/cjs/zonos-checkout.cjs.entry.js +11 -7
  15. package/dist/cjs/zonos-controller.cjs.entry.js +8 -6
  16. package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -4
  17. package/dist/cjs/zonos-country-select_3.cjs.entry.js +12 -10
  18. package/dist/cjs/zonos-elements.cjs.js +1 -1
  19. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +18 -16
  20. package/dist/cjs/zonos-hello.cjs.entry.js +13 -7
  21. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  22. package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
  24. package/dist/cjs/zonos-payment.cjs.entry.js +4 -4
  25. package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +1 -1
  26. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
  27. package/dist/cjs/zonos-text.cjs.entry.js +1 -2
  28. package/dist/cjs/{zonosStore-1063de5e.js → zonosStore-3958bbeb.js} +2 -3
  29. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.css +7 -0
  30. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +4 -4
  31. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-restricted-items/zonos-cart-restricted-items.js +2 -2
  32. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.css +7 -0
  33. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +5 -5
  34. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +2 -2
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +6 -2
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +2 -2
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +3 -3
  38. package/dist/collection/components/common/zonos-button/zonos-button.css +7 -2
  39. package/dist/collection/components/common/zonos-button/zonos-button.js +74 -39
  40. package/dist/collection/components/common/zonos-text/zonos-text.js +0 -18
  41. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +9 -4
  42. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +7 -5
  43. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +14 -12
  44. package/dist/collection/components/main/zonos-controller.js +2 -2
  45. package/dist/collection/components/store/hello/localization.js +3 -3
  46. package/dist/collection/components/store/translationStore/strings.arabic.js +10 -10
  47. package/dist/collection/components/store/translationStore/strings.base.js +10 -10
  48. package/dist/collection/components/store/translationStore/strings.chinese.js +10 -10
  49. package/dist/collection/components/store/translationStore/strings.danish.js +10 -10
  50. package/dist/collection/components/store/translationStore/strings.dutch.js +10 -10
  51. package/dist/collection/components/store/translationStore/strings.french.js +10 -10
  52. package/dist/collection/components/store/translationStore/strings.german.js +10 -10
  53. package/dist/collection/components/store/translationStore/strings.hebrew.js +10 -10
  54. package/dist/collection/components/store/translationStore/strings.indonesian.js +10 -10
  55. package/dist/collection/components/store/translationStore/strings.italian.js +10 -10
  56. package/dist/collection/components/store/translationStore/strings.japanese.js +10 -10
  57. package/dist/collection/components/store/translationStore/strings.korean.js +10 -10
  58. package/dist/collection/components/store/translationStore/strings.norwegian.js +10 -10
  59. package/dist/collection/components/store/translationStore/strings.polish.js +10 -10
  60. package/dist/collection/components/store/translationStore/strings.portuguese.js +10 -10
  61. package/dist/collection/components/store/translationStore/strings.russian.js +10 -10
  62. package/dist/collection/components/store/translationStore/strings.spanish.js +10 -10
  63. package/dist/collection/components/store/translationStore/strings.swedish.js +10 -10
  64. package/dist/collection/components/store/translationStore/strings.turkish.js +10 -10
  65. package/dist/collection/components/store/translationStore/strings.vietnamese.js +10 -10
  66. package/dist/collection/components/store/translationStore.js +2 -2
  67. package/dist/collection/components/store/zonosStore.js +3 -4
  68. package/dist/collection/components/utils/api/getExchangeRate.js +20 -5
  69. package/dist/collection/components/utils/hello/currencyConversion/currencyConvertAndFormat.js +1 -1
  70. package/dist/collection/components/utils/hello/currencyConversion/currencyDisplay.js +1 -15
  71. package/dist/collection/components/utils/hello/currencyConversion/currencyFormat.js +32 -17
  72. package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +26 -4
  73. package/dist/collection/components/utils/hello/initHello.js +4 -2
  74. package/dist/collection/components/utils/isElementUsingDarkTheme.js +5 -0
  75. package/dist/collection/scripts/_zonosBase.js +2 -1
  76. package/dist/collection/types/ILanguage.js +2 -2
  77. package/dist/esm/{ILanguage-97790bee.js → ILanguage-cd6acb72.js} +2 -2
  78. package/dist/esm/{cart-d3c98a81.js → cart-67471b37.js} +284 -246
  79. package/dist/esm/{getBorderRadius-393bf797.js → getBorderRadius-5e5a5800.js} +1 -1
  80. package/dist/esm/index.js +5 -4
  81. package/dist/esm/{isDarkColor-454ec221.js → isDarkColor-5185b62c.js} +1 -1
  82. package/dist/esm/loader.js +1 -1
  83. package/dist/esm/{submitGtag-acdb8bd7.js → submitGtag-1f42c748.js} +2 -2
  84. package/dist/esm/zonos-address_8.entry.js +4 -4
  85. package/dist/esm/zonos-badge_2.entry.js +1 -1
  86. package/dist/esm/zonos-banner.entry.js +1 -1
  87. package/dist/esm/zonos-button_3.entry.js +82 -43
  88. package/dist/esm/zonos-card_2.entry.js +5 -5
  89. package/dist/esm/zonos-cart-items_11.entry.js +20 -30
  90. package/dist/esm/zonos-checkout.entry.js +11 -7
  91. package/dist/esm/zonos-controller.entry.js +8 -6
  92. package/dist/esm/zonos-country-flag.entry.js +4 -4
  93. package/dist/esm/zonos-country-select_3.entry.js +12 -10
  94. package/dist/esm/zonos-elements.js +1 -1
  95. package/dist/esm/zonos-hello-dialog.entry.js +18 -16
  96. package/dist/esm/zonos-hello.entry.js +13 -7
  97. package/dist/esm/zonos-input.entry.js +2 -2
  98. package/dist/esm/zonos-logo.entry.js +1 -1
  99. package/dist/esm/zonos-notification.entry.js +1 -1
  100. package/dist/esm/zonos-payment.entry.js +4 -4
  101. package/dist/esm/zonos-select-dialog-header_2.entry.js +1 -1
  102. package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
  103. package/dist/esm/zonos-text.entry.js +1 -2
  104. package/dist/esm/{zonosStore-0ce57f37.js → zonosStore-8b9ea19c.js} +2 -3
  105. package/dist/esm-es5/ILanguage-cd6acb72.js +1 -0
  106. package/dist/esm-es5/cart-67471b37.js +1 -0
  107. package/dist/esm-es5/{getBorderRadius-393bf797.js → getBorderRadius-5e5a5800.js} +1 -1
  108. package/dist/esm-es5/index.js +1 -1
  109. package/dist/esm-es5/{isDarkColor-454ec221.js → isDarkColor-5185b62c.js} +1 -1
  110. package/dist/esm-es5/loader.js +1 -1
  111. package/dist/esm-es5/{submitGtag-acdb8bd7.js → submitGtag-1f42c748.js} +1 -1
  112. package/dist/esm-es5/zonos-address_8.entry.js +1 -1
  113. package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
  114. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  115. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  116. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  117. package/dist/esm-es5/zonos-cart-items_11.entry.js +1 -1
  118. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  119. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  120. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  121. package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
  122. package/dist/esm-es5/zonos-elements.js +1 -1
  123. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  124. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  125. package/dist/esm-es5/zonos-input.entry.js +1 -1
  126. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  127. package/dist/esm-es5/zonos-notification.entry.js +1 -1
  128. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  129. package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
  130. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  131. package/dist/esm-es5/zonos-text.entry.js +1 -1
  132. package/dist/esm-es5/{zonosStore-0ce57f37.js → zonosStore-8b9ea19c.js} +1 -1
  133. package/dist/scripts/index.d.ts +47 -19
  134. package/dist/scripts/index.js +1 -1
  135. package/dist/scripts/loadZonos.js +1 -1
  136. package/dist/scripts/zonos.js +1 -1
  137. package/dist/types/components/common/zonos-button/zonos-button.d.ts +1 -0
  138. package/dist/types/components/common/zonos-text/zonos-text.d.ts +0 -4
  139. package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.d.ts +1 -0
  140. package/dist/types/components/store/hello/localization.d.ts +2 -2
  141. package/dist/types/components/store/translationStore/strings.arabic.d.ts +8 -8
  142. package/dist/types/components/store/translationStore/strings.base.d.ts +8 -8
  143. package/dist/types/components/store/translationStore/strings.chinese.d.ts +8 -8
  144. package/dist/types/components/store/translationStore/strings.danish.d.ts +8 -8
  145. package/dist/types/components/store/translationStore/strings.dutch.d.ts +8 -8
  146. package/dist/types/components/store/translationStore/strings.french.d.ts +8 -8
  147. package/dist/types/components/store/translationStore/strings.german.d.ts +8 -8
  148. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +8 -8
  149. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +8 -8
  150. package/dist/types/components/store/translationStore/strings.italian.d.ts +8 -8
  151. package/dist/types/components/store/translationStore/strings.japanese.d.ts +8 -8
  152. package/dist/types/components/store/translationStore/strings.korean.d.ts +8 -8
  153. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +8 -8
  154. package/dist/types/components/store/translationStore/strings.polish.d.ts +8 -8
  155. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +8 -8
  156. package/dist/types/components/store/translationStore/strings.russian.d.ts +8 -8
  157. package/dist/types/components/store/translationStore/strings.spanish.d.ts +8 -8
  158. package/dist/types/components/store/translationStore/strings.swedish.d.ts +8 -8
  159. package/dist/types/components/store/translationStore/strings.turkish.d.ts +8 -8
  160. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +8 -8
  161. package/dist/types/components/store/translationStore.d.ts +7 -7
  162. package/dist/types/components/store/zonosStore.d.ts +6 -2
  163. package/dist/types/components/utils/api/getExchangeRate.d.ts +9 -10
  164. package/dist/types/components/utils/hello/currencyConversion/currencyFormat.d.ts +5 -1
  165. package/dist/types/components/utils/hello/currencyConversion/getCurrencyElements.d.ts +1 -1
  166. package/dist/types/components/utils/isElementUsingDarkTheme.d.ts +1 -0
  167. package/dist/types/components.d.ts +0 -8
  168. package/dist/types/scripts/_zonosBase.d.ts +42 -3
  169. package/dist/types/types/ILanguage.d.ts +2 -2
  170. package/dist/types/types/checkout/CheckoutConfig.d.ts +6 -2
  171. package/dist/types/types/hello/HelloConfig.d.ts +1 -3
  172. package/dist/zonos-elements/index.esm.js +1 -1
  173. package/dist/zonos-elements/{p-72191005.system.entry.js → p-02a01106.system.entry.js} +1 -1
  174. package/dist/zonos-elements/p-065ada8a.system.js +1 -0
  175. package/dist/zonos-elements/{p-15c903ff.js → p-083850d3.js} +1 -1
  176. package/dist/zonos-elements/{p-c15b36c1.system.entry.js → p-088d6460.system.entry.js} +1 -1
  177. package/dist/zonos-elements/p-08d1cfc4.entry.js +1 -0
  178. package/dist/zonos-elements/{p-d03e101b.system.entry.js → p-0d30f36e.system.entry.js} +1 -1
  179. package/dist/zonos-elements/{p-3668f365.entry.js → p-0ea19a4d.entry.js} +1 -1
  180. package/dist/zonos-elements/{p-67373528.entry.js → p-1752853e.entry.js} +1 -1
  181. package/dist/zonos-elements/{p-d18990b0.entry.js → p-18464027.entry.js} +1 -1
  182. package/dist/zonos-elements/{p-d1b8dcd8.system.entry.js → p-1e2fbb1d.system.entry.js} +1 -1
  183. package/dist/zonos-elements/p-234f8729.system.js +1 -0
  184. package/dist/zonos-elements/p-33b054d9.system.js +1 -0
  185. package/dist/zonos-elements/p-440ac320.js +1 -0
  186. package/dist/zonos-elements/{p-0a4f341b.entry.js → p-44250644.entry.js} +1 -1
  187. package/dist/zonos-elements/p-4a3b5fc8.entry.js +1 -0
  188. package/dist/zonos-elements/p-52900b33.entry.js +1 -0
  189. package/dist/zonos-elements/{p-42a7a726.system.entry.js → p-5437dd24.system.entry.js} +1 -1
  190. package/dist/zonos-elements/{p-f03b33ec.system.entry.js → p-5992c6fb.system.entry.js} +1 -1
  191. package/dist/zonos-elements/{p-474cb030.entry.js → p-607b5560.entry.js} +1 -1
  192. package/dist/zonos-elements/{p-b925e897.system.entry.js → p-65671a64.system.entry.js} +1 -1
  193. package/dist/zonos-elements/{p-0e6fe6c8.system.entry.js → p-6f132cee.system.entry.js} +1 -1
  194. package/dist/zonos-elements/{p-9da3b3b3.system.entry.js → p-713bb92e.system.entry.js} +1 -1
  195. package/dist/zonos-elements/p-7d61e6e5.entry.js +1 -0
  196. package/dist/zonos-elements/{p-ce4c48f6.entry.js → p-7fa5a6ea.entry.js} +1 -1
  197. package/dist/zonos-elements/p-8473827d.system.entry.js +1 -0
  198. package/dist/zonos-elements/{p-3115e7a7.system.js → p-8853e051.system.js} +1 -1
  199. package/dist/zonos-elements/p-8ed0769e.entry.js +1 -0
  200. package/dist/zonos-elements/{p-fc2f3e2a.system.entry.js → p-92c64a9c.system.entry.js} +1 -1
  201. package/dist/zonos-elements/p-97aceb11.js +1 -0
  202. package/dist/zonos-elements/p-9c0859b5.entry.js +1 -0
  203. package/dist/zonos-elements/p-9c3a036e.system.js +1 -0
  204. package/dist/zonos-elements/{p-dd02f2eb.entry.js → p-9c8705ac.entry.js} +1 -1
  205. package/dist/zonos-elements/{p-f4c921f8.entry.js → p-a18555c8.entry.js} +1 -1
  206. package/dist/zonos-elements/{p-2d3e3735.js → p-a5e9d372.js} +1 -1
  207. package/dist/zonos-elements/{p-75d52d98.system.entry.js → p-af3ee45d.system.entry.js} +1 -1
  208. package/dist/zonos-elements/p-b1ee97d8.entry.js +1 -0
  209. package/dist/zonos-elements/{p-b9ed8a66.system.entry.js → p-b79753bb.system.entry.js} +1 -1
  210. package/dist/zonos-elements/{p-1406d696.system.entry.js → p-b9195764.system.entry.js} +1 -1
  211. package/dist/zonos-elements/{p-f0afca6c.system.js → p-be14323b.system.js} +1 -1
  212. package/dist/zonos-elements/{p-d5feef4c.js → p-bf9dca26.js} +1 -1
  213. package/dist/zonos-elements/p-bfc30599.entry.js +1 -0
  214. package/dist/zonos-elements/{p-2c57097c.entry.js → p-c0ddef11.entry.js} +1 -1
  215. package/dist/zonos-elements/{p-14bea5e6.system.entry.js → p-c1879326.system.entry.js} +1 -1
  216. package/dist/zonos-elements/{p-eb6ddb2f.js → p-c53cef11.js} +1 -1
  217. package/dist/zonos-elements/p-c9e433c0.system.js +1 -0
  218. package/dist/zonos-elements/{p-3c97c44d.entry.js → p-cbf13745.entry.js} +1 -1
  219. package/dist/zonos-elements/p-d6796b73.system.entry.js +1 -0
  220. package/dist/zonos-elements/{p-971e73c3.system.entry.js → p-d7e6cad0.system.entry.js} +1 -1
  221. package/dist/zonos-elements/{p-b202a015.entry.js → p-db9e87ec.entry.js} +1 -1
  222. package/dist/zonos-elements/p-e0bf9666.system.js +1 -1
  223. package/dist/zonos-elements/p-f7468131.system.entry.js +1 -0
  224. package/dist/zonos-elements/{p-23393abc.system.entry.js → p-fedafdd2.system.entry.js} +1 -1
  225. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  226. package/package.json +4 -1
  227. package/dist/collection/components/utils/formatCurrency.js +0 -9
  228. package/dist/esm-es5/ILanguage-97790bee.js +0 -1
  229. package/dist/esm-es5/cart-d3c98a81.js +0 -1
  230. package/dist/types/components/utils/formatCurrency.d.ts +0 -5
  231. package/dist/zonos-elements/p-14da9ed0.entry.js +0 -1
  232. package/dist/zonos-elements/p-16ad90ca.js +0 -1
  233. package/dist/zonos-elements/p-3edcbb56.entry.js +0 -1
  234. package/dist/zonos-elements/p-5968c6ad.entry.js +0 -1
  235. package/dist/zonos-elements/p-59913049.entry.js +0 -1
  236. package/dist/zonos-elements/p-824e1e83.system.js +0 -1
  237. package/dist/zonos-elements/p-8f3f1a1b.system.js +0 -1
  238. package/dist/zonos-elements/p-957301d0.system.entry.js +0 -1
  239. package/dist/zonos-elements/p-9e4b35d4.system.entry.js +0 -1
  240. package/dist/zonos-elements/p-abe7524f.system.js +0 -1
  241. package/dist/zonos-elements/p-b13e630b.js +0 -1
  242. package/dist/zonos-elements/p-bfe6f84f.system.entry.js +0 -1
  243. package/dist/zonos-elements/p-d79e83bd.entry.js +0 -1
  244. package/dist/zonos-elements/p-eb765228.entry.js +0 -1
  245. package/dist/zonos-elements/p-ebb36e4d.entry.js +0 -1
  246. package/dist/zonos-elements/p-f16b80a3.system.js +0 -1
  247. package/dist/zonos-elements/p-f3a6de62.entry.js +0 -1
  248. package/dist/zonos-elements/p-fc5df354.system.js +0 -1
@@ -1,10 +1,4 @@
1
1
  export const stringsPortuguese = {
2
- '${percentage} GST due on any order above ${threshold} along with an import entry transaction fee and MPI levy.': {
3
- value: '${percentage} de GST devido em qualquer pedido acima de ${threshold}, juntamente com uma taxa de transação de entrada de importação e cobrança de MPI.',
4
- },
5
- '${percentage} GST due on any order above ${threshold}.': {
6
- value: '${percentage} de GST devido em qualquer pedido acima de ${threshold}.',
7
- },
8
2
  'Above de minimis threshold for': {
9
3
  value: 'Acima do limite de isenção para',
10
4
  },
@@ -131,8 +125,8 @@ export const stringsPortuguese = {
131
125
  'Order total': {
132
126
  value: 'Total do pedido',
133
127
  },
134
- 'Orders to ${countryName} must be over ${threshold} to ship.': {
135
- value: 'Pedidos para ${countryName} devem ser acima de ${threshold} para serem enviados.',
128
+ 'Orders to [countryName] must be over [threshold] to ship.': {
129
+ value: 'Pedidos para [countryName] devem ser acima de [threshold] para serem enviados.',
136
130
  },
137
131
  Pay: {
138
132
  value: 'Pagar',
@@ -239,8 +233,8 @@ export const stringsPortuguese = {
239
233
  "We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time.": {
240
234
  value: 'Enviamos um e-mail de confirmação com os detalhes do pedido para sua revisão. E nossa equipe está preparando cuidadosamente seu pedido para que ele chegue no prazo.',
241
235
  },
242
- 'Welcome to': {
243
- value: 'Bem-vindo a',
236
+ 'Welcome to [storeName]!': {
237
+ value: 'Bem-vindo ao [storeName]!',
244
238
  },
245
239
  'Welcome!': {
246
240
  value: 'Bem-vindo!',
@@ -257,6 +251,12 @@ export const stringsPortuguese = {
257
251
  'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
258
252
  value: 'Seu pagamento foi processado com sucesso! Obrigado por comprar conosco! Esperamos que tenha tido uma experiência agradável e seu apoio significa muito para nós.',
259
253
  },
254
+ '[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.': {
255
+ value: '[percentage] de GST devido em qualquer pedido acima de [threshold], juntamente com uma taxa de transação de entrada de importação e cobrança de MPI.',
256
+ },
257
+ '[percentage] GST due on any order above [threshold].': {
258
+ value: '[percentage] de GST devido em qualquer pedido acima de [threshold].',
259
+ },
260
260
  'business days': {
261
261
  value: 'dias úteis',
262
262
  },
@@ -1,10 +1,4 @@
1
1
  export const stringsRussian = {
2
- '${percentage} GST due on any order above ${threshold} along with an import entry transaction fee and MPI levy.': {
3
- value: '${percentage} НДС за любой заказ свыше ${threshold}, включая комиссию за ввозную транзакцию и сбор MPI.',
4
- },
5
- '${percentage} GST due on any order above ${threshold}.': {
6
- value: '${percentage} НДС за любой заказ свыше ${threshold}.',
7
- },
8
2
  'Above de minimis threshold for': {
9
3
  value: 'Выше минимального порога для',
10
4
  },
@@ -131,8 +125,8 @@ export const stringsRussian = {
131
125
  'Order total': {
132
126
  value: 'Итого',
133
127
  },
134
- 'Orders to ${countryName} must be over ${threshold} to ship.': {
135
- value: 'Заказы в ${countryName} должны превышать ${threshold} для отправки.',
128
+ 'Orders to [countryName] must be over [threshold] to ship.': {
129
+ value: 'Заказы в [countryName] должны превышать [threshold] для отправки.',
136
130
  },
137
131
  Pay: {
138
132
  value: 'Оплатить',
@@ -239,8 +233,8 @@ export const stringsRussian = {
239
233
  "We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time.": {
240
234
  value: 'Мы отправили вам письмо с подтверждением заказа для проверки. Наша команда тщательно готовит ваш заказ к отправке в срок.',
241
235
  },
242
- 'Welcome to': {
243
- value: 'Добро пожаловать в',
236
+ 'Welcome to [storeName]!': {
237
+ value: 'Добро пожаловать в [storeName]!',
244
238
  },
245
239
  'Welcome!': {
246
240
  value: 'Добро пожаловать!',
@@ -257,6 +251,12 @@ export const stringsRussian = {
257
251
  'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
258
252
  value: 'Оплата прошла успешно! Благодарим вас за покупку! Надеемся, вам понравилось, и ваша поддержка очень важна для нас.',
259
253
  },
254
+ '[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.': {
255
+ value: '[percentage] НДС за любой заказ свыше [threshold], включая комиссию за ввозную транзакцию и сбор MPI.',
256
+ },
257
+ '[percentage] GST due on any order above [threshold].': {
258
+ value: '[percentage] НДС за любой заказ свыше [threshold].',
259
+ },
260
260
  'business days': {
261
261
  value: 'рабочих дней',
262
262
  },
@@ -1,10 +1,4 @@
1
1
  export const stringsSpanish = {
2
- '${percentage} GST due on any order above ${threshold} along with an import entry transaction fee and MPI levy.': {
3
- value: '${percentage} del IVA debido en cualquier pedido superior a ${threshold}, junto con una tarifa de transacción de entrada de importación y un gravamen MPI.',
4
- },
5
- '${percentage} GST due on any order above ${threshold}.': {
6
- value: 'El ${percentage} del IVA se debe en cualquier pedido superior a ${threshold}.',
7
- },
8
2
  'Above de minimis threshold for': {
9
3
  value: 'Por encima del umbral mínimo para',
10
4
  },
@@ -131,8 +125,8 @@ export const stringsSpanish = {
131
125
  'Order total': {
132
126
  value: 'Total del pedido',
133
127
  },
134
- 'Orders to ${countryName} must be over ${threshold} to ship.': {
135
- value: 'Los pedidos a ${countryName} deben superar los ${threshold} para ser enviados.',
128
+ 'Orders to [countryName] must be over [threshold] to ship.': {
129
+ value: 'Los pedidos a [countryName] deben superar los [threshold] para ser enviados.',
136
130
  },
137
131
  Pay: {
138
132
  value: 'Pagar',
@@ -239,8 +233,8 @@ export const stringsSpanish = {
239
233
  "We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time.": {
240
234
  value: 'Le hemos enviado un correo electrónico de confirmación con los detalles del pedido para su revisión. Y nuestro equipo está preparando cuidadosamente su pedido para que llegue a tiempo.',
241
235
  },
242
- 'Welcome to': {
243
- value: 'Bienvenido a',
236
+ 'Welcome to [storeName]!': {
237
+ value: '¡Bienvenido a [storeName]!',
244
238
  },
245
239
  'Welcome!': {
246
240
  value: '¡Bienvenido!',
@@ -257,6 +251,12 @@ export const stringsSpanish = {
257
251
  'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
258
252
  value: '¡Su pago se realizó exitosamente! Gracias por comprar con nosotros. Esperamos que haya tenido una experiencia agradable y su apoyo significa mucho para nosotros.',
259
253
  },
254
+ '[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.': {
255
+ value: '[percentage] del IVA debido en cualquier pedido superior a [threshold], junto con una tarifa de transacción de entrada de importación y un gravamen MPI.',
256
+ },
257
+ '[percentage] GST due on any order above [threshold].': {
258
+ value: 'El [percentage] del IVA se debe en cualquier pedido superior a [threshold].',
259
+ },
260
260
  'business days': {
261
261
  value: 'días hábiles',
262
262
  },
@@ -1,10 +1,4 @@
1
1
  export const stringsSwedish = {
2
- '${percentage} GST due on any order above ${threshold} along with an import entry transaction fee and MPI levy.': {
3
- value: '${percentage} moms på varje beställning över ${threshold}, inklusive en importtransaktionsavgift och MPI-avgift.',
4
- },
5
- '${percentage} GST due on any order above ${threshold}.': {
6
- value: '${percentage} moms på varje beställning över ${threshold}.',
7
- },
8
2
  'Above de minimis threshold for': {
9
3
  value: 'Över minimibeloppet för',
10
4
  },
@@ -131,8 +125,8 @@ export const stringsSwedish = {
131
125
  'Order total': {
132
126
  value: 'Totalt belopp för beställningen',
133
127
  },
134
- 'Orders to ${countryName} must be over ${threshold} to ship.': {
135
- value: 'Beställningar till ${countryName} måste överstiga ${threshold} för att skickas.',
128
+ 'Orders to [countryName] must be over [threshold] to ship.': {
129
+ value: 'Beställningar till [countryName] måste överstiga [threshold] för att skickas.',
136
130
  },
137
131
  Pay: {
138
132
  value: 'Betala',
@@ -239,8 +233,8 @@ export const stringsSwedish = {
239
233
  "We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time.": {
240
234
  value: 'Vi har skickat en e-postbekräftelse av beställningsuppgifterna för din granskning. Och vårt team förbereder noggrant din order så att den kommer i tid.',
241
235
  },
242
- 'Welcome to': {
243
- value: 'Välkommen till',
236
+ 'Welcome to [storeName]!': {
237
+ value: 'Välkommen till [storeName]!',
244
238
  },
245
239
  'Welcome!': {
246
240
  value: 'Välkommen!',
@@ -257,6 +251,12 @@ export const stringsSwedish = {
257
251
  'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
258
252
  value: 'Din betalning gick igenom framgångsrikt! Tack för att du handlar med oss! Vi hoppas att du har haft en trevlig upplevelse och ditt stöd betyder mycket för oss.',
259
253
  },
254
+ '[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.': {
255
+ value: '[percentage] moms på varje beställning över [threshold], inklusive en importtransaktionsavgift och MPI-avgift.',
256
+ },
257
+ '[percentage] GST due on any order above [threshold].': {
258
+ value: '[percentage] moms på varje beställning över [threshold].',
259
+ },
260
260
  'business days': {
261
261
  value: 'arbetsdagar',
262
262
  },
@@ -1,10 +1,4 @@
1
1
  export const stringsTurkish = {
2
- '${percentage} GST due on any order above ${threshold} along with an import entry transaction fee and MPI levy.': {
3
- value: '${threshold} üzerindeki her sipariş için ${percentage} KDV, ithalat giriş işlem ücreti ve MPI vergisi ile birlikte ödenir.',
4
- },
5
- '${percentage} GST due on any order above ${threshold}.': {
6
- value: '${threshold} üzerindeki her sipariş için ${percentage} KDV ödenir.',
7
- },
8
2
  'Above de minimis threshold for': {
9
3
  value: 'Minimum sınırın üzerinde',
10
4
  },
@@ -131,8 +125,8 @@ export const stringsTurkish = {
131
125
  'Order total': {
132
126
  value: 'Sipariş toplamı',
133
127
  },
134
- 'Orders to ${countryName} must be over ${threshold} to ship.': {
135
- value: '${countryName} ülkesine yapılacak siparişlerin ${threshold} üzerinde olması gerekir.',
128
+ 'Orders to [countryName] must be over [threshold] to ship.': {
129
+ value: '[countryName] ülkesine yapılacak siparişlerin [threshold] üzerinde olması gerekir.',
136
130
  },
137
131
  Pay: {
138
132
  value: 'Öde',
@@ -239,8 +233,8 @@ export const stringsTurkish = {
239
233
  "We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time.": {
240
234
  value: 'Sipariş detaylarınızın onay e-postasını gönderdik. Ekibimiz siparişinizi özenle hazırlıyor, zamanında ulaşması için elimizden geleni yapıyoruz.',
241
235
  },
242
- 'Welcome to': {
243
- value: 'Hoş geldiniz',
236
+ 'Welcome to [storeName]!': {
237
+ value: "[storeName]'e hoş geldiniz!",
244
238
  },
245
239
  'Welcome!': {
246
240
  value: 'Hoş geldiniz!',
@@ -257,6 +251,12 @@ export const stringsTurkish = {
257
251
  'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
258
252
  value: 'Ödemeniz başarıyla tamamlandı! Bizimle alışveriş yaptığınız için teşekkür ederiz! Keyifli bir deneyim yaşadığınızı umuyoruz ve desteğiniz bizim için çok değerli.',
259
253
  },
254
+ '[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.': {
255
+ value: '[threshold] üzerindeki her sipariş için [percentage] KDV, ithalat giriş işlem ücreti ve MPI vergisi ile birlikte ödenir.',
256
+ },
257
+ '[percentage] GST due on any order above [threshold].': {
258
+ value: '[threshold] üzerindeki her sipariş için [percentage] KDV ödenir.',
259
+ },
260
260
  'business days': {
261
261
  value: 'iş günü',
262
262
  },
@@ -1,10 +1,4 @@
1
1
  export const stringsVietnamese = {
2
- '${percentage} GST due on any order above ${threshold} along with an import entry transaction fee and MPI levy.': {
3
- value: '${percentage} GST phải trả cho bất kỳ đơn hàng nào trên ${threshold}, cùng với phí giao dịch nhập khẩu và thuế MPI.',
4
- },
5
- '${percentage} GST due on any order above ${threshold}.': {
6
- value: '${percentage} GST phải trả cho bất kỳ đơn hàng nào trên ${threshold}.',
7
- },
8
2
  'Above de minimis threshold for': {
9
3
  value: 'Vượt ngưỡng miễn thuế đối với',
10
4
  },
@@ -131,8 +125,8 @@ export const stringsVietnamese = {
131
125
  'Order total': {
132
126
  value: 'Tổng đơn hàng',
133
127
  },
134
- 'Orders to ${countryName} must be over ${threshold} to ship.': {
135
- value: 'Đơn hàng đến ${countryName} phải trên ${threshold} mới được gửi.',
128
+ 'Orders to [countryName] must be over [threshold] to ship.': {
129
+ value: 'Đơn hàng đến [countryName] phải trên [threshold] mới được gửi.',
136
130
  },
137
131
  Pay: {
138
132
  value: 'Thanh toán',
@@ -239,8 +233,8 @@ export const stringsVietnamese = {
239
233
  "We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time.": {
240
234
  value: 'Chúng tôi đã gửi email xác nhận chi tiết đơn hàng để bạn xem lại. Và đội ngũ của chúng tôi đang cẩn thận chuẩn bị đơn hàng của bạn để đảm bảo giao đúng hạn.',
241
235
  },
242
- 'Welcome to': {
243
- value: 'Chào mừng đến với',
236
+ 'Welcome to [storeName]!': {
237
+ value: 'Chào mừng đến với [storeName]!',
244
238
  },
245
239
  'Welcome!': {
246
240
  value: 'Chào mừng!',
@@ -257,6 +251,12 @@ export const stringsVietnamese = {
257
251
  'Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us.': {
258
252
  value: 'Thanh toán của bạn thành công! Cảm ơn bạn đã mua sắm với chúng tôi! Chúng tôi hy vọng bạn có trải nghiệm thú vị và sự ủng hộ của bạn thật sự ý nghĩa với chúng tôi.',
259
253
  },
254
+ '[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.': {
255
+ value: '[percentage] GST phải trả cho bất kỳ đơn hàng nào trên [threshold], cùng với phí giao dịch nhập khẩu và thuế MPI.',
256
+ },
257
+ '[percentage] GST due on any order above [threshold].': {
258
+ value: '[percentage] GST phải trả cho bất kỳ đơn hàng nào trên [threshold].',
259
+ },
260
260
  'business days': {
261
261
  value: 'ngày làm việc',
262
262
  },
@@ -90,7 +90,7 @@ const translationStoreUpdateLanguage = (language) => {
90
90
  * Translate a string with variables if variable pattern is present in the string
91
91
  * @example
92
92
  * // Require variables:
93
- * translate('${percentage} GST due on any order above ${threshold}.', { percentage: '5%', threshold: '$100' })
93
+ * translate('[percentage] GST due on any order above [threshold].', { percentage: '5%', threshold: '$100' })
94
94
  * // No variables:
95
95
  * translate('Above de minimis threshold for')
96
96
  */
@@ -100,7 +100,7 @@ const translate = (...[key, replacement]) => {
100
100
  // replace all variables in the string
101
101
  let translatedString = ((_a = translationStore.translatedChunks[key]) === null || _a === void 0 ? void 0 : _a.value) || key;
102
102
  Object.entries(replacement).forEach(([replacementKey, replaceValue]) => {
103
- translatedString = translatedString.replace(new RegExp(`\\$\\{${replacementKey}\\}`, 'g'), replaceValue);
103
+ translatedString = translatedString.replace(new RegExp(`\\[${replacementKey}\\]`, 'g'), replaceValue);
104
104
  });
105
105
  return translatedString;
106
106
  }
@@ -1,6 +1,6 @@
1
1
  import { createStore } from "@stencil/store";
2
2
  import { mergeConfig } from "../utils/mergeConfig";
3
- const { reset, state: zonosStore } = createStore(() => ({
3
+ const { dispose: zonosStoreDispose, reset, state: zonosStore, } = createStore(() => ({
4
4
  appearance: {
5
5
  colorPrimary: 'white',
6
6
  fontFamily: 'Inter',
@@ -52,7 +52,6 @@ const { reset, state: zonosStore } = createStore(() => ({
52
52
  countryOverrideBehavior: 'URL_PARAM',
53
53
  currencyBehavior: 'ENABLED',
54
54
  currencyElementSelector: '.money',
55
- dutyTaxEstimationBehavior: 'ENABLED',
56
55
  excludedUrlPatterns: [],
57
56
  homepageUrlPattern: '',
58
57
  mobileLocation: 'BOTTOM_RIGHT',
@@ -64,7 +63,6 @@ const { reset, state: zonosStore } = createStore(() => ({
64
63
  productDescriptionElementSelector: '',
65
64
  productDetailUrlPattern: '',
66
65
  productListUrlPattern: '',
67
- productPriceElementSelector: '',
68
66
  productTitleElementSelector: '',
69
67
  restrictionBehavior: 'DISABLED',
70
68
  },
@@ -119,9 +117,10 @@ const zonosStoreInitSetting = ({ overrideSettings, zonosSettings, }) => {
119
117
  zonosStore.storeId = ((_d = (_c = zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.organization) === null || _c === void 0 ? void 0 : _c.references) === null || _d === void 0 ? void 0 : _d.storeId) || null;
120
118
  zonosStore.currencyConverter = overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.currencyConverter;
121
119
  zonosStore.onCountryChange = overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.onCountryChange;
120
+ zonosStore.overrideCurrencyFormat = overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.overrideCurrencyFormat;
122
121
  };
123
122
  const zonosStoreFontFamily = () => {
124
123
  const fontFamily = zonosStore.appearance.fontFamily || 'Inter';
125
124
  return fontFamily;
126
125
  };
127
- export { getZonosStoreTheme, zonosStore, zonosStoreFontFamily, zonosStoreInitSetting, };
126
+ export { getZonosStoreTheme, zonosStore, zonosStoreDispose, zonosStoreFontFamily, zonosStoreInitSetting, };
@@ -1,22 +1,37 @@
1
1
  import { handleFetch } from "../handleFetch";
2
2
  import { logError } from "../logging/logError";
3
+ const defaultUsExchangeRate = {
4
+ exchangeRate: {
5
+ rate: 1,
6
+ targetFormat: {
7
+ currencyCode: 'USD',
8
+ decimalDelimiter: '.',
9
+ scale: 2,
10
+ symbol: '$',
11
+ symbolLocation: 'before',
12
+ thousandsDelimiter: ',',
13
+ },
14
+ },
15
+ maxAge: null,
16
+ };
3
17
  export const getExchangeRate = async ({ country, isGuaranteed, sourceCurrency, targetCurrency, }) => {
4
18
  var _a;
5
- // If source currency matches target currency (US -> US) and is not a guaranteed rate, return null
19
+ // If source currency matches target currency (US -> US) and is not a guaranteed rate, return default exchange rate so we still format properly.
6
20
  if (sourceCurrency === targetCurrency && !isGuaranteed) {
7
- return { exchangeRate: null, maxAge: null };
21
+ return defaultUsExchangeRate;
8
22
  }
9
23
  const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/exchange-rates?sourceCurrency=${sourceCurrency}&targetCurrency=${targetCurrency}&isGuaranteed=${isGuaranteed}&country=${country}`;
10
24
  const { errors, json } = await handleFetch(url);
11
25
  if (errors.length || !json) {
12
26
  logError(`Error fetching country landed cost: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
13
- return { exchangeRate: null, maxAge: null };
27
+ return defaultUsExchangeRate;
14
28
  }
15
- const { maxAge, rate, targetFormat } = json.exchangeRateCreate;
29
+ const { rate, targetFormat } = json.exchangeRateCreate;
30
+ const maxAge = json.maxAge;
16
31
  if (rate) {
17
32
  sessionStorage.setItem(country + '_rate', JSON.stringify(rate));
18
33
  const exchangeRate = { rate, targetFormat };
19
34
  return { exchangeRate, maxAge };
20
35
  }
21
- return { exchangeRate: null, maxAge: null };
36
+ return defaultUsExchangeRate;
22
37
  };
@@ -2,6 +2,6 @@ import { currencyConvert } from "./currencyConvert";
2
2
  import { currencyFormat } from "./currencyFormat";
3
3
  export const currencyConvertAndFormat = (value) => {
4
4
  const convertedValue = currencyConvert(value);
5
- const formattedValue = currencyFormat(convertedValue);
5
+ const formattedValue = currencyFormat({ amount: convertedValue });
6
6
  return formattedValue;
7
7
  };
@@ -1,22 +1,8 @@
1
1
  import { zonosStore } from "../../../store/zonosStore";
2
- import { currencyConvert } from "./currencyConvert";
3
- import { currencyConvertAndFormat } from "./currencyConvertAndFormat";
4
- import { currencyFormat } from "./currencyFormat";
5
2
  import { defaultCurrencyConverter } from "./defaultCurrencyConverter";
6
3
  export const currencyDisplay = () => {
7
4
  if (zonosStore.helloSettings.currencyBehavior === 'DISABLED') {
8
5
  return;
9
6
  }
10
- const { currencyElementSelector } = zonosStore.helloSettings;
11
- if (zonosStore.currencyConverter) {
12
- zonosStore.currencyConverter({
13
- convert: currencyConvert,
14
- convertAndFormat: currencyConvertAndFormat,
15
- format: currencyFormat,
16
- selector: currencyElementSelector,
17
- });
18
- }
19
- else {
20
- defaultCurrencyConverter();
21
- }
7
+ defaultCurrencyConverter();
22
8
  };
@@ -1,32 +1,47 @@
1
1
  import { localizationStore } from "../../../store/hello/localization";
2
- export const currencyFormat = (value) => {
3
- if (!value || isNaN(value)) {
2
+ import { zonosStore } from "../../../store/zonosStore";
3
+ export const currencyFormat = ({ amount, currency, }) => {
4
+ if (isNaN(amount) || (amount !== 0 && !amount)) {
4
5
  return '';
5
6
  }
7
+ const overrideCurrencyFormat = zonosStore.overrideCurrencyFormat;
6
8
  const { exchangeRate } = localizationStore;
9
+ const targetCurrency = currency || localizationStore.targetCurrency;
10
+ // Use user-defined currency format
11
+ if (typeof overrideCurrencyFormat === 'function') {
12
+ return overrideCurrencyFormat({
13
+ amount: amount,
14
+ countryCode: targetCurrency,
15
+ });
16
+ }
7
17
  const { targetFormat } = exchangeRate || {};
8
- if (!targetFormat) {
9
- return value.toString();
18
+ if (!targetFormat || !exchangeRate) {
19
+ // Return the amount as a string if no exchange rate is available
20
+ return `${amount.toString()} ${targetCurrency}`;
10
21
  }
11
- const minimumFractionDigits = (exchangeRate === null || exchangeRate === void 0 ? void 0 : exchangeRate.targetFormat.scale) || 2;
12
- // browsers can autoformat the currency based on the users language setting
13
- // unless the browser is Internet Explorer, because Internet Explorer is stupid
22
+ const minimumFractionDigits = targetFormat.scale || 2;
14
23
  const isIE = window.navigator.userAgent.indexOf('MSIE ') !== -1;
15
24
  const numberFormatExists = typeof Intl === 'object' && Intl && typeof Intl.NumberFormat === 'function';
16
- if (!isIE && numberFormatExists) {
17
- return new Intl.NumberFormat(window.navigator.language, {
18
- currency: targetFormat.currencyCode,
19
- minimumFractionDigits: minimumFractionDigits,
20
- style: 'currency',
21
- }).format(value);
22
- }
23
- else {
24
- let formattedNumber = Number(value)
25
+ if (isIE || !numberFormatExists) {
26
+ // use native number formatting if it's IE.
27
+ const formattedNumber = Number(amount)
25
28
  .toFixed(minimumFractionDigits)
26
29
  .replace('.', '|dec|')
27
30
  .replace(',', targetFormat.thousandsDelimiter || '')
28
31
  .replace('|dec|', targetFormat.decimalDelimiter || '');
29
- const result = `${targetFormat.symbol}${formattedNumber}${targetFormat.currencyCode !== 'USD' ? ` ${targetFormat.currencyCode}` : ''}`;
32
+ const result = `${formattedNumber}${targetFormat.currencyCode !== 'USD' ? ` ${targetFormat.currencyCode}` : ''}`;
30
33
  return result;
31
34
  }
35
+ const currencyDisplay = (overrideCurrencyFormat === null || overrideCurrencyFormat === void 0 ? void 0 : overrideCurrencyFormat.currencyDisplay) || 'symbol';
36
+ const formatedNumber = new Intl.NumberFormat(window.navigator.language, {
37
+ currency: targetCurrency,
38
+ currencyDisplay,
39
+ minimumFractionDigits: minimumFractionDigits,
40
+ style: 'currency',
41
+ }).format(amount);
42
+ // Move currency code to the end of the string if currencyDisplay is 'code'
43
+ const result = currencyDisplay === 'code'
44
+ ? `${formatedNumber.replace(new RegExp(`${targetCurrency}\\s+`), '')} ${targetCurrency}`
45
+ : formatedNumber;
46
+ return result;
32
47
  };
@@ -1,6 +1,8 @@
1
1
  import { localizationStore } from "../../../store/hello/localization";
2
2
  import { zonosStore } from "../../../store/zonosStore";
3
+ import { currencyConvert } from "./currencyConvert";
3
4
  import { currencyConvertAndFormat } from "./currencyConvertAndFormat";
5
+ import { currencyFormat } from "./currencyFormat";
4
6
  import { getCurrencyElements } from "./getCurrencyElements";
5
7
  import { getInitialElementAmount } from "./getInitialElementAmount";
6
8
  import { logError } from "../../logging/logError";
@@ -11,16 +13,36 @@ const convertCurrency = (element) => {
11
13
  return;
12
14
  }
13
15
  const currentIntlValue = element.getAttribute('data-zintl');
16
+ // get rate
17
+ const currentIntlRateValue = parseFloat(element.getAttribute('data-zrate') || '1');
14
18
  const currentCountryValue = element.getAttribute('data-zcountry-code');
15
19
  // do nothing if the target currency is the same
16
- const isExchangeRateReady = localizationStore.targetCurrency ===
17
- ((_a = localizationStore.exchangeRate) === null || _a === void 0 ? void 0 : _a.targetFormat.currencyCode);
20
+ const isExchangeRateReady = localizationStore.exchangeRate &&
21
+ localizationStore.targetCurrency ===
22
+ localizationStore.exchangeRate.targetFormat.currencyCode;
23
+ const rate = ((_a = localizationStore.exchangeRate) === null || _a === void 0 ? void 0 : _a.rate) || 1;
18
24
  // if the current value on the element is different from the current intl value, update the data-zintl attribute
19
25
  if (isExchangeRateReady &&
26
+ // Update currency if the value is not yet formatted
20
27
  (element.textContent !== currentIntlValue ||
28
+ // Update rate when new rate is available
29
+ rate !== currentIntlRateValue ||
30
+ // Update currency when the country code changes
21
31
  currentCountryValue !== localizationStore.selectedCountryCode)) {
22
- const observedFormattedValue = currencyConvertAndFormat(amount);
32
+ const customizedCurrencyFormat = typeof zonosStore.currencyConverter === 'function' &&
33
+ zonosStore.currencyConverter({
34
+ convert: currencyConvert,
35
+ convertAndFormat: currencyConvertAndFormat,
36
+ currencyCode: localizationStore.targetCurrency,
37
+ format: (value) => currencyFormat({ amount: value }),
38
+ originalAmount: amount,
39
+ selector: element,
40
+ });
41
+ // default to the currencyConvertAndFormat if the currencyConverter function does not return a value, or invalid value. This is to make sure we don't break the merchant's price.
42
+ const observedFormattedValue = customizedCurrencyFormat || currencyConvertAndFormat(amount);
23
43
  element.textContent = observedFormattedValue;
44
+ // save the new rate to the data-zrate attribute
45
+ element.setAttribute('data-zrate', rate.toString());
24
46
  // save the new value to the data-zintl attribute
25
47
  element.setAttribute('data-zintl', observedFormattedValue);
26
48
  element.setAttribute('data-zcountry-code', localizationStore.selectedCountryCode || '');
@@ -37,7 +59,7 @@ export const defaultCurrencyConverter = () => {
37
59
  logError('Could not display currency. Exchange rate and format data is not available.');
38
60
  return;
39
61
  }
40
- currencyElements.forEach((element) => {
62
+ currencyElements.forEach(element => {
41
63
  // convert the currency and save the formatted value to the data-zintl attribute
42
64
  convertCurrency(element);
43
65
  });
@@ -72,9 +72,11 @@ export const initHello = async (helloSettings) => {
72
72
  childList: true,
73
73
  subtree: true,
74
74
  });
75
- // kill observer after 5 seconds if the hello still not injected, if the hello still not injected after 10 seconds, it's likely that the selector the user doesn't want to use hello
75
+ // kill observer after 1 second if the hello still not injected, if the hello still not injected after 1 second, it's likely that the selector the user doesn't want to use hello
76
76
  setTimeout(() => {
77
77
  observer.disconnect();
78
- }, 5000);
78
+ // inject hello to mobile anchor if hello is still not found
79
+ injectHelloComponent(mobileHelloAnchor);
80
+ }, 1000);
79
81
  }
80
82
  };
@@ -0,0 +1,5 @@
1
+ import { isDarkColor } from "./isDarkColor";
2
+ // This is to determine if variable of the element is using dark theme, so we can invert the color if needed
3
+ export const isElementUsingDarkTheme = (element) => isDarkColor(window
4
+ .getComputedStyle(element)
5
+ .getPropertyValue('--zonos-elements-gray-0'));
@@ -46,7 +46,7 @@ Zonos.modeAlerted = false;
46
46
  Zonos.tempCartData = null;
47
47
  Zonos.getCurrentTimestamp = () => new Date().getTime();
48
48
  Zonos.zonosController = null;
49
- Zonos.init = async ({ appearance, checkoutSettings, currencyConverter, helloSettings, onCountryChange, storeId, zonosApiKey, }) => {
49
+ Zonos.init = async ({ appearance, checkoutSettings, currencyConverter, helloSettings, onCountryChange, overrideCurrencyFormat, storeId, zonosApiKey, }) => {
50
50
  if (_a.doneInit) {
51
51
  // do nothing if zonos is already initializeds
52
52
  return;
@@ -75,6 +75,7 @@ Zonos.init = async ({ appearance, checkoutSettings, currencyConverter, helloSett
75
75
  currencyConverter,
76
76
  helloSettings,
77
77
  onCountryChange,
78
+ overrideCurrencyFormat,
78
79
  },
79
80
  zonosApiKey,
80
81
  });
@@ -7,11 +7,11 @@ export const languages = [
7
7
  { code: 'it', label: 'Italian', translatedLabel: 'Italiano' },
8
8
  { code: 'pl', label: 'Polish', translatedLabel: 'Polskie' },
9
9
  { code: 'ar', label: 'Arabic', translatedLabel: 'عربى' },
10
- { code: 'de', label: 'German', translatedLabel: 'Deutsche' },
10
+ { code: 'de', label: 'German', translatedLabel: 'Deutsch' },
11
11
  { code: 'ja', label: 'Japanese', translatedLabel: '日本語' },
12
12
  { code: 'no', label: 'Norwegian', translatedLabel: 'norsk' },
13
13
  { code: 'vi', label: 'Vietnamese', translatedLabel: 'Tiếng Việt' },
14
- { code: 'tr', label: 'Turkish', translatedLabel: 'Türk' },
14
+ { code: 'tr', label: 'Turkish', translatedLabel: 'Türkçe' },
15
15
  { code: 'he', label: 'Hebrew', translatedLabel: 'עִברִית' },
16
16
  { code: 'fr', label: 'French', translatedLabel: 'Français' },
17
17
  { code: 'nl', label: 'Dutch', translatedLabel: 'Nederlands' },
@@ -7,11 +7,11 @@ const languages = [
7
7
  { code: 'it', label: 'Italian', translatedLabel: 'Italiano' },
8
8
  { code: 'pl', label: 'Polish', translatedLabel: 'Polskie' },
9
9
  { code: 'ar', label: 'Arabic', translatedLabel: 'عربى' },
10
- { code: 'de', label: 'German', translatedLabel: 'Deutsche' },
10
+ { code: 'de', label: 'German', translatedLabel: 'Deutsch' },
11
11
  { code: 'ja', label: 'Japanese', translatedLabel: '日本語' },
12
12
  { code: 'no', label: 'Norwegian', translatedLabel: 'norsk' },
13
13
  { code: 'vi', label: 'Vietnamese', translatedLabel: 'Tiếng Việt' },
14
- { code: 'tr', label: 'Turkish', translatedLabel: 'Türk' },
14
+ { code: 'tr', label: 'Turkish', translatedLabel: 'Türkçe' },
15
15
  { code: 'he', label: 'Hebrew', translatedLabel: 'עִברִית' },
16
16
  { code: 'fr', label: 'French', translatedLabel: 'Français' },
17
17
  { code: 'nl', label: 'Dutch', translatedLabel: 'Nederlands' },