@zonos/elements 1.3.5 → 1.3.7-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (411) hide show
  1. package/dist/cjs/ILanguage-d247b45b.js +26 -0
  2. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  3. package/dist/cjs/{localization-d43e1540.js → cart-ecc80eb0.js} +1086 -2
  4. package/dist/cjs/{getBorderRadius-cd7ef574.js → getBorderRadius-834c321d.js} +8 -4
  5. package/dist/cjs/index.cjs.js +0 -21
  6. package/dist/cjs/{isDarkColor-5eda1323.js → isDarkColor-924e6a7a.js} +1 -1
  7. package/dist/cjs/loader.cjs.js +5 -3
  8. package/dist/cjs/{submitGtag-bd6e9b42.js → submitGtag-907e71d3.js} +3 -3
  9. package/dist/cjs/zonos-address_4.cjs.entry.js +301 -0
  10. package/dist/cjs/zonos-badge_2.cjs.entry.js +57 -0
  11. package/dist/cjs/zonos-banner.cjs.entry.js +4 -9
  12. package/dist/cjs/{zonos-button_2.cjs.entry.js → zonos-button_3.cjs.entry.js} +42 -15
  13. package/dist/cjs/zonos-card_2.cjs.entry.js +28 -14
  14. package/dist/cjs/{zonos-cart-items_10.cjs.entry.js → zonos-cart-items_9.cjs.entry.js} +98 -99
  15. package/dist/cjs/zonos-checkout.cjs.entry.js +25 -27
  16. package/dist/cjs/zonos-component.cjs.entry.js +2 -2
  17. package/dist/cjs/zonos-controller.cjs.entry.js +29 -30
  18. package/dist/cjs/zonos-country-flag.cjs.entry.js +42 -0
  19. package/dist/cjs/{zonos-country-flag_4.cjs.entry.js → zonos-country-select_3.cjs.entry.js} +31 -56
  20. package/dist/cjs/zonos-elements.cjs.js +6 -4
  21. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +29 -22
  22. package/dist/cjs/zonos-hello.cjs.entry.js +35 -33
  23. package/dist/cjs/zonos-logo.cjs.entry.js +32 -0
  24. package/dist/cjs/zonos-notification.cjs.entry.js +5 -6
  25. package/dist/cjs/zonos-payment.cjs.entry.js +6 -7
  26. package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +45 -0
  27. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +4 -4
  28. package/dist/cjs/zonos-text.cjs.entry.js +4 -6
  29. package/dist/cjs/{zonosStore-b88b5671.js → zonosStore-49d4c92a.js} +5 -5
  30. package/dist/collection/collection-manifest.json +6 -1
  31. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +1 -1
  32. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +13 -8
  33. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/chevronDownIcon.svg +1 -0
  34. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/globe.svg +3 -0
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/zonosIcon.svg +5 -0
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.css +126 -0
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +60 -0
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +1 -1
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +12 -21
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +4 -5
  41. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +11 -1
  42. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +12 -4
  43. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +3 -3
  44. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +1 -1
  45. package/dist/collection/components/common/zonos-badge/zonos-badge.js +7 -26
  46. package/dist/collection/components/common/zonos-banner/zonos-banner.js +2 -25
  47. package/dist/collection/components/common/zonos-button/zonos-button.css +18 -0
  48. package/dist/collection/components/common/zonos-button/zonos-button.js +9 -28
  49. package/dist/collection/components/common/zonos-card/zonos-card.js +2 -20
  50. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.css +82 -0
  51. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +218 -0
  52. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +15 -2
  53. package/dist/collection/components/common/zonos-country-flag/zonos-country-flag.js +1 -20
  54. package/dist/collection/components/common/zonos-country-select/assets/greenCheckDuotone.svg +4 -0
  55. package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +11 -10
  56. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +7 -11
  57. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  58. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  59. package/dist/collection/components/common/zonos-icon/zonos-icon.js +4 -4
  60. package/dist/collection/components/common/zonos-language-select/assets/greenCheckDuotone.svg +4 -0
  61. package/dist/collection/components/common/zonos-language-select/zonos-language-select.css +61 -0
  62. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +58 -0
  63. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -21
  64. package/dist/collection/components/common/zonos-notification/zonos-notification.js +3 -26
  65. package/dist/collection/components/common/zonos-select-dialog-header/assets/removeIcon.svg +1 -0
  66. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.css +45 -0
  67. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +68 -0
  68. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +1 -1
  69. package/dist/collection/components/common/zonos-spinner/zonos-spinner.js +4 -4
  70. package/dist/collection/components/common/zonos-text/zonos-text.js +4 -24
  71. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.css +55 -0
  72. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +72 -0
  73. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -21
  74. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  75. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/globe.svg +3 -0
  76. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.css +10 -0
  77. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +27 -5
  78. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.css +16 -2
  79. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +11 -5
  80. package/dist/collection/components/main/zonos-controller.js +1 -1
  81. package/dist/collection/components/store/checkout/stripe.js +31 -7
  82. package/dist/collection/components/store/hello/localization.js +32 -2
  83. package/dist/collection/components/store/translationStore/strings.arabic.js +18 -0
  84. package/dist/collection/components/store/translationStore/strings.base.js +18 -0
  85. package/dist/collection/components/store/translationStore/strings.chinese.js +18 -0
  86. package/dist/collection/components/store/translationStore/strings.danish.js +18 -0
  87. package/dist/collection/components/store/translationStore/strings.dutch.js +18 -0
  88. package/dist/collection/components/store/translationStore/strings.french.js +18 -0
  89. package/dist/collection/components/store/translationStore/strings.german.js +18 -0
  90. package/dist/collection/components/store/translationStore/strings.hebrew.js +18 -0
  91. package/dist/collection/components/store/translationStore/strings.indonesian.js +18 -0
  92. package/dist/collection/components/store/translationStore/strings.italian.js +18 -0
  93. package/dist/collection/components/store/translationStore/strings.japanese.js +18 -0
  94. package/dist/collection/components/store/translationStore/strings.korean.js +18 -0
  95. package/dist/collection/components/store/translationStore/strings.norwegian.js +18 -0
  96. package/dist/collection/components/store/translationStore/strings.polish.js +18 -0
  97. package/dist/collection/components/store/translationStore/strings.portuguese.js +18 -0
  98. package/dist/collection/components/store/translationStore/strings.russian.js +18 -0
  99. package/dist/collection/components/store/translationStore/strings.spanish.js +18 -0
  100. package/dist/collection/components/store/translationStore/strings.swedish.js +18 -0
  101. package/dist/collection/components/store/translationStore/strings.turkish.js +18 -0
  102. package/dist/collection/components/store/translationStore/strings.vietnamese.js +18 -0
  103. package/dist/collection/components/store/zonosStore.js +4 -4
  104. package/dist/collection/components/stripe/zonos-address/zonos-address.js +63 -24
  105. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
  106. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  107. package/dist/collection/components/utils/api/prepCalculateLandedCost.js +19 -1
  108. package/dist/collection/components/utils/api/triggerBuildLandedCost.js +11 -5
  109. package/dist/collection/components/utils/getBorderRadius.js +7 -3
  110. package/dist/collection/types/ILanguage.js +22 -0
  111. package/dist/collection/types/generated/graphql.customer.types.js +19 -0
  112. package/dist/collection/types/index.js +0 -1
  113. package/dist/collection/types/styles/Color.js +9 -0
  114. package/dist/components/ILanguage.js +24 -0
  115. package/dist/components/getBorderRadius.js +7 -3
  116. package/dist/components/index.js +0 -1
  117. package/dist/components/isDarkColor.js +1 -1
  118. package/dist/components/{localization.js → stripe.js} +1070 -2
  119. package/dist/components/submitGtag.js +1 -1
  120. package/dist/components/zonos-address2.js +64 -26
  121. package/dist/components/zonos-badge2.js +8 -10
  122. package/dist/components/zonos-banner2.js +3 -9
  123. package/dist/components/zonos-button2.js +10 -12
  124. package/dist/components/zonos-card2.js +3 -5
  125. package/dist/components/zonos-cart-items2.js +1 -1
  126. package/dist/components/zonos-cart-subtotal2.js +14 -9
  127. package/dist/components/zonos-checkbox.d.ts +11 -0
  128. package/dist/components/zonos-checkbox.js +6 -0
  129. package/dist/components/zonos-checkbox2.js +87 -0
  130. package/dist/components/zonos-checkout-finish2.js +15 -7
  131. package/dist/components/zonos-checkout-footer.d.ts +11 -0
  132. package/dist/components/zonos-checkout-footer.js +6 -0
  133. package/dist/components/zonos-checkout-footer2.js +109 -0
  134. package/dist/components/zonos-checkout-payment2.js +2 -3
  135. package/dist/components/zonos-checkout.js +74 -52
  136. package/dist/components/zonos-collapse2.js +16 -3
  137. package/dist/components/zonos-component.js +1 -1
  138. package/dist/components/zonos-controller.js +3 -4
  139. package/dist/components/zonos-country-flag2.js +3 -5
  140. package/dist/components/zonos-country-select2.js +26 -19
  141. package/dist/components/zonos-custom-message2.js +3 -3
  142. package/dist/components/zonos-customer-info2.js +30 -11
  143. package/dist/components/zonos-dialog2.js +4 -4
  144. package/dist/components/zonos-hello-dialog-footer2.js +23 -10
  145. package/dist/components/zonos-hello-dialog2.js +41 -23
  146. package/dist/components/zonos-hello.js +31 -19
  147. package/dist/components/zonos-icon2.js +4 -4
  148. package/dist/components/zonos-language-select.d.ts +11 -0
  149. package/dist/components/zonos-language-select.js +6 -0
  150. package/dist/components/zonos-language-select2.js +87 -0
  151. package/dist/components/zonos-link-authentication2.js +2 -2
  152. package/dist/components/zonos-logo.js +44 -1
  153. package/dist/components/zonos-notification2.js +4 -6
  154. package/dist/components/zonos-payment2.js +2 -2
  155. package/dist/components/zonos-review2.js +4 -5
  156. package/dist/components/zonos-select-dialog-header.d.ts +11 -0
  157. package/dist/components/zonos-select-dialog-header.js +6 -0
  158. package/dist/components/zonos-select-dialog-header2.js +71 -0
  159. package/dist/components/zonos-shipping-rich-radio2.js +2 -2
  160. package/dist/components/zonos-shipping2.js +2 -3
  161. package/dist/components/zonos-spinner2.js +3 -3
  162. package/dist/components/zonos-text2.js +4 -7
  163. package/dist/components/zonos-tooltip.d.ts +11 -0
  164. package/dist/components/zonos-tooltip.js +6 -0
  165. package/dist/components/zonos-tooltip2.js +48 -0
  166. package/dist/components/zonos-v-stack2.js +4 -6
  167. package/dist/components/zonosStore.js +5 -5
  168. package/dist/esm/ILanguage-97790bee.js +24 -0
  169. package/dist/esm/app-globals-0f993ce5.js +3 -0
  170. package/dist/esm/{localization-5d83fde2.js → cart-2a0a6871.js} +1071 -3
  171. package/dist/esm/getBorderRadius-0c7dfcf0.js +20 -0
  172. package/dist/esm/index.js +1 -6
  173. package/dist/esm/{isDarkColor-8696cb70.js → isDarkColor-d0a57fd2.js} +1 -1
  174. package/dist/esm/loader.js +6 -4
  175. package/dist/esm/{submitGtag-776c5e10.js → submitGtag-a38aed23.js} +2 -2
  176. package/dist/esm/zonos-address_4.entry.js +294 -0
  177. package/dist/esm/zonos-badge_2.entry.js +52 -0
  178. package/dist/esm/zonos-banner.entry.js +4 -9
  179. package/dist/esm/{zonos-button_2.entry.js → zonos-button_3.entry.js} +42 -16
  180. package/dist/esm/zonos-card_2.entry.js +28 -14
  181. package/dist/esm/{zonos-cart-items_10.entry.js → zonos-cart-items_9.entry.js} +86 -86
  182. package/dist/esm/zonos-checkout.entry.js +11 -13
  183. package/dist/esm/zonos-component.entry.js +2 -2
  184. package/dist/esm/zonos-controller.entry.js +6 -7
  185. package/dist/esm/zonos-country-flag.entry.js +38 -0
  186. package/dist/esm/{zonos-country-flag_4.entry.js → zonos-country-select_3.entry.js} +31 -55
  187. package/dist/esm/zonos-elements.js +7 -5
  188. package/dist/esm/zonos-hello-dialog.entry.js +15 -8
  189. package/dist/esm/zonos-hello.entry.js +5 -3
  190. package/dist/esm/zonos-logo.entry.js +28 -0
  191. package/dist/esm/zonos-notification.entry.js +5 -6
  192. package/dist/esm/zonos-payment.entry.js +6 -7
  193. package/dist/esm/zonos-select-dialog-header_2.entry.js +40 -0
  194. package/dist/esm/zonos-shipping-rich-radio.entry.js +4 -4
  195. package/dist/esm/zonos-text.entry.js +4 -6
  196. package/dist/esm/{zonosStore-e59617f8.js → zonosStore-dec6bd7e.js} +5 -5
  197. package/dist/esm-es5/ILanguage-97790bee.js +1 -0
  198. package/dist/esm-es5/app-globals-0f993ce5.js +1 -0
  199. package/dist/esm-es5/cart-2a0a6871.js +1 -0
  200. package/dist/esm-es5/getBorderRadius-0c7dfcf0.js +1 -0
  201. package/dist/esm-es5/index.js +0 -1
  202. package/dist/esm-es5/{isDarkColor-8696cb70.js → isDarkColor-d0a57fd2.js} +1 -1
  203. package/dist/esm-es5/loader.js +1 -1
  204. package/dist/esm-es5/submitGtag-a38aed23.js +1 -0
  205. package/dist/esm-es5/zonos-address_4.entry.js +1 -0
  206. package/dist/esm-es5/zonos-badge_2.entry.js +1 -0
  207. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  208. package/dist/esm-es5/zonos-button_3.entry.js +1 -0
  209. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  210. package/dist/esm-es5/zonos-cart-items_9.entry.js +1 -0
  211. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  212. package/dist/esm-es5/zonos-component.entry.js +1 -1
  213. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  214. package/dist/esm-es5/zonos-country-flag.entry.js +1 -0
  215. package/dist/esm-es5/zonos-country-select_3.entry.js +1 -0
  216. package/dist/esm-es5/zonos-elements.js +1 -1
  217. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  218. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  219. package/dist/esm-es5/zonos-logo.entry.js +1 -0
  220. package/dist/esm-es5/zonos-notification.entry.js +1 -1
  221. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  222. package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -0
  223. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  224. package/dist/esm-es5/zonos-text.entry.js +1 -1
  225. package/dist/esm-es5/{zonosStore-e59617f8.js → zonosStore-dec6bd7e.js} +1 -1
  226. package/dist/scripts/insertTranslations.js +1 -0
  227. package/dist/scripts/loadZonos.js +1 -1
  228. package/dist/scripts/zonos.js +1 -1
  229. package/dist/scripts/zonosBase.js +1 -1
  230. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +2 -1
  231. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.d.ts +7 -0
  232. package/dist/types/components/common/zonos-badge/zonos-badge.d.ts +1 -5
  233. package/dist/types/components/common/zonos-banner/zonos-banner.d.ts +0 -4
  234. package/dist/types/components/common/zonos-button/zonos-button.d.ts +1 -5
  235. package/dist/types/components/common/zonos-card/zonos-card.d.ts +0 -4
  236. package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +42 -0
  237. package/dist/types/components/common/zonos-country-flag/zonos-country-flag.d.ts +0 -4
  238. package/dist/types/components/common/zonos-country-select/zonos-country-select.d.ts +1 -1
  239. package/dist/types/components/common/zonos-icon/zonos-icon.d.ts +1 -1
  240. package/dist/types/components/common/zonos-language-select/zonos-language-select.d.ts +9 -0
  241. package/dist/types/components/common/zonos-logo/zonos-logo.d.ts +0 -4
  242. package/dist/types/components/common/zonos-notification/zonos-notification.d.ts +0 -4
  243. package/dist/types/components/common/zonos-select-dialog-header/zonos-select-dialog-header.d.ts +12 -0
  244. package/dist/types/components/common/zonos-spinner/zonos-spinner.d.ts +1 -1
  245. package/dist/types/components/common/zonos-text/zonos-text.d.ts +1 -5
  246. package/dist/types/components/common/zonos-tooltip/zonos-tooltip.d.ts +12 -0
  247. package/dist/types/components/common/zonos-v-stack/zonos-v-stack.d.ts +0 -4
  248. package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.d.ts +5 -0
  249. package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +2 -0
  250. package/dist/types/components/store/checkout/stripe.d.ts +12 -0
  251. package/dist/types/components/store/hello/localization.d.ts +2 -1
  252. package/dist/types/components/store/translationStore/strings.arabic.d.ts +18 -0
  253. package/dist/types/components/store/translationStore/strings.base.d.ts +18 -0
  254. package/dist/types/components/store/translationStore/strings.chinese.d.ts +18 -0
  255. package/dist/types/components/store/translationStore/strings.danish.d.ts +18 -0
  256. package/dist/types/components/store/translationStore/strings.dutch.d.ts +18 -0
  257. package/dist/types/components/store/translationStore/strings.french.d.ts +18 -0
  258. package/dist/types/components/store/translationStore/strings.german.d.ts +18 -0
  259. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +18 -0
  260. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +18 -0
  261. package/dist/types/components/store/translationStore/strings.italian.d.ts +18 -0
  262. package/dist/types/components/store/translationStore/strings.japanese.d.ts +18 -0
  263. package/dist/types/components/store/translationStore/strings.korean.d.ts +18 -0
  264. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +18 -0
  265. package/dist/types/components/store/translationStore/strings.polish.d.ts +18 -0
  266. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +18 -0
  267. package/dist/types/components/store/translationStore/strings.russian.d.ts +18 -0
  268. package/dist/types/components/store/translationStore/strings.spanish.d.ts +18 -0
  269. package/dist/types/components/store/translationStore/strings.swedish.d.ts +18 -0
  270. package/dist/types/components/store/translationStore/strings.turkish.d.ts +18 -0
  271. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +18 -0
  272. package/dist/types/components/store/zonosStore.d.ts +1 -1
  273. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +3 -0
  274. package/dist/types/components/utils/api/triggerBuildLandedCost.d.ts +18 -2
  275. package/dist/types/components/utils/changeDeepProperty.d.ts +1 -1
  276. package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +1 -1
  277. package/dist/types/components/utils/getBorderRadius.d.ts +1 -1
  278. package/dist/types/components/utils/hello/currencyConversion/getLanguageCode.d.ts +1 -1
  279. package/dist/types/components.d.ts +242 -116
  280. package/dist/types/types/ICountryJson.d.ts +2 -1
  281. package/dist/types/types/ILanguage.d.ts +81 -0
  282. package/dist/types/types/checkout/CheckoutConfig.d.ts +3 -3
  283. package/dist/types/types/checkout/api/CalculateLandedCostRequest.d.ts +13 -0
  284. package/dist/types/types/generated/graphql.customer.types.d.ts +31 -4
  285. package/dist/types/types/generated/graphql.customer.types.ts +45 -4
  286. package/dist/types/types/generated/graphql.frontend.types.d.ts +5 -5
  287. package/dist/types/types/generated/graphql.frontend.types.ts +13 -3
  288. package/dist/types/types/index.d.ts +1 -1
  289. package/dist/types/types/styles/Color.d.ts +2 -0
  290. package/dist/zonos-elements/index.esm.js +0 -1
  291. package/dist/zonos-elements/p-0057e374.entry.js +1 -0
  292. package/dist/zonos-elements/{p-120df5be.system.entry.js → p-06652d87.system.entry.js} +1 -1
  293. package/dist/zonos-elements/p-066c5893.system.js +1 -0
  294. package/dist/zonos-elements/p-0c72fb79.system.entry.js +1 -0
  295. package/dist/zonos-elements/p-16ad90ca.js +1 -0
  296. package/dist/zonos-elements/p-1f85a98c.system.entry.js +1 -0
  297. package/dist/zonos-elements/p-290c3670.entry.js +1 -0
  298. package/dist/zonos-elements/p-2d2e1831.entry.js +1 -0
  299. package/dist/zonos-elements/p-2f1e1cbb.system.entry.js +1 -0
  300. package/dist/zonos-elements/p-33080cde.system.entry.js +1 -0
  301. package/dist/zonos-elements/{p-0024f8c2.js → p-34c03be2.js} +1 -1
  302. package/dist/zonos-elements/p-34efed1d.entry.js +1 -0
  303. package/dist/zonos-elements/p-375c472a.system.entry.js +1 -0
  304. package/dist/zonos-elements/p-50ea2036.system.js +1 -0
  305. package/dist/zonos-elements/p-549c181b.system.js +1 -0
  306. package/dist/zonos-elements/{p-be23cc91.system.entry.js → p-55970b10.system.entry.js} +1 -1
  307. package/dist/zonos-elements/p-561e44d6.entry.js +1 -0
  308. package/dist/zonos-elements/p-56ba5cbf.system.js +1 -0
  309. package/dist/zonos-elements/{p-dc09ca69.system.js → p-591eb6dd.system.js} +1 -1
  310. package/dist/zonos-elements/p-5b44abc8.system.js +1 -0
  311. package/dist/zonos-elements/p-5c4dc123.js +1 -0
  312. package/dist/zonos-elements/p-656c836b.entry.js +1 -0
  313. package/dist/zonos-elements/p-67737613.system.entry.js +1 -0
  314. package/dist/zonos-elements/p-79b910bf.system.entry.js +1 -0
  315. package/dist/zonos-elements/p-7d1d862f.system.entry.js +1 -0
  316. package/dist/zonos-elements/{p-5a0264e8.system.entry.js → p-88a55076.system.entry.js} +1 -1
  317. package/dist/zonos-elements/p-8aeb4679.system.entry.js +1 -0
  318. package/dist/zonos-elements/p-8d645a00.entry.js +1 -0
  319. package/dist/zonos-elements/p-9878a770.js +1 -0
  320. package/dist/zonos-elements/p-a219689f.entry.js +1 -0
  321. package/dist/zonos-elements/p-a3d72a33.entry.js +1 -0
  322. package/dist/zonos-elements/{p-aca66e4b.entry.js → p-a4de3fb2.entry.js} +1 -1
  323. package/dist/zonos-elements/p-a93c594f.entry.js +1 -0
  324. package/dist/zonos-elements/p-a95c034c.entry.js +1 -0
  325. package/dist/zonos-elements/p-abe7524f.system.js +1 -0
  326. package/dist/zonos-elements/p-afe40057.entry.js +1 -0
  327. package/dist/zonos-elements/p-b10ff468.entry.js +1 -0
  328. package/dist/zonos-elements/p-b6992dc2.system.entry.js +1 -0
  329. package/dist/zonos-elements/{p-af910392.js → p-bce46c41.js} +1 -1
  330. package/dist/zonos-elements/p-c56d4a44.entry.js +1 -0
  331. package/dist/zonos-elements/p-c7098c3b.entry.js +1 -0
  332. package/dist/zonos-elements/{p-ead79548.system.js → p-cbb1e700.system.js} +1 -1
  333. package/dist/zonos-elements/p-cc63a29f.system.entry.js +1 -0
  334. package/dist/zonos-elements/p-cd8bd5e9.system.entry.js +1 -0
  335. package/dist/zonos-elements/p-d36faf87.system.entry.js +1 -0
  336. package/dist/zonos-elements/p-dfd3edcf.entry.js +1 -0
  337. package/dist/zonos-elements/p-e1255160.js +1 -0
  338. package/dist/zonos-elements/p-e161a08c.entry.js +1 -0
  339. package/dist/zonos-elements/p-e2770968.system.entry.js +1 -0
  340. package/dist/zonos-elements/p-e2c6ad57.entry.js +1 -0
  341. package/dist/zonos-elements/{p-73174d0c.system.entry.js → p-e855966f.system.entry.js} +1 -1
  342. package/dist/zonos-elements/p-ea93943a.system.entry.js +1 -0
  343. package/dist/zonos-elements/{p-7f68c103.system.js → p-ec4d08b3.system.js} +1 -1
  344. package/dist/zonos-elements/{p-e8da4463.js → p-f455e08c.js} +1 -1
  345. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  346. package/dist/zonos-elements/zonos-elements.js +1 -1
  347. package/package.json +17 -18
  348. package/dist/cjs/cart-c1b0915c.js +0 -655
  349. package/dist/cjs/zonos-address_2.cjs.entry.js +0 -161
  350. package/dist/cjs/zonos-badge.cjs.entry.js +0 -38
  351. package/dist/cjs/zonos-icon.cjs.entry.js +0 -35
  352. package/dist/collection/components/common/zonos-country-select/assets/arrowLeftBlue.svg +0 -1
  353. package/dist/components/cart.js +0 -637
  354. package/dist/components/zonos-logo2.js +0 -48
  355. package/dist/esm/cart-7e7c7585.js +0 -637
  356. package/dist/esm/getBorderRadius-9e4cb3b1.js +0 -16
  357. package/dist/esm/zonos-address_2.entry.js +0 -156
  358. package/dist/esm/zonos-badge.entry.js +0 -34
  359. package/dist/esm/zonos-icon.entry.js +0 -31
  360. package/dist/esm-es5/cart-7e7c7585.js +0 -1
  361. package/dist/esm-es5/getBorderRadius-9e4cb3b1.js +0 -1
  362. package/dist/esm-es5/localization-5d83fde2.js +0 -1
  363. package/dist/esm-es5/submitGtag-776c5e10.js +0 -1
  364. package/dist/esm-es5/zonos-address_2.entry.js +0 -1
  365. package/dist/esm-es5/zonos-badge.entry.js +0 -1
  366. package/dist/esm-es5/zonos-button_2.entry.js +0 -1
  367. package/dist/esm-es5/zonos-cart-items_10.entry.js +0 -1
  368. package/dist/esm-es5/zonos-country-flag_4.entry.js +0 -1
  369. package/dist/esm-es5/zonos-icon.entry.js +0 -1
  370. package/dist/zonos-elements/p-027abb50.entry.js +0 -1
  371. package/dist/zonos-elements/p-09c5dc1b.system.entry.js +0 -1
  372. package/dist/zonos-elements/p-1156ae5d.system.entry.js +0 -1
  373. package/dist/zonos-elements/p-12ecf765.system.js +0 -1
  374. package/dist/zonos-elements/p-174239da.system.js +0 -1
  375. package/dist/zonos-elements/p-18e09138.system.entry.js +0 -1
  376. package/dist/zonos-elements/p-1c00ffea.system.entry.js +0 -1
  377. package/dist/zonos-elements/p-21793192.entry.js +0 -1
  378. package/dist/zonos-elements/p-2589a038.system.entry.js +0 -1
  379. package/dist/zonos-elements/p-28d7b75d.entry.js +0 -1
  380. package/dist/zonos-elements/p-31fa76da.entry.js +0 -1
  381. package/dist/zonos-elements/p-3319e4db.entry.js +0 -1
  382. package/dist/zonos-elements/p-357f0c61.entry.js +0 -1
  383. package/dist/zonos-elements/p-410045c5.system.entry.js +0 -1
  384. package/dist/zonos-elements/p-4d0861e9.system.js +0 -1
  385. package/dist/zonos-elements/p-54ef8ff3.entry.js +0 -1
  386. package/dist/zonos-elements/p-626b5a52.system.entry.js +0 -1
  387. package/dist/zonos-elements/p-6444a4b9.entry.js +0 -1
  388. package/dist/zonos-elements/p-65f4af1a.system.entry.js +0 -1
  389. package/dist/zonos-elements/p-661bc488.entry.js +0 -1
  390. package/dist/zonos-elements/p-6c47083f.entry.js +0 -1
  391. package/dist/zonos-elements/p-6d454281.entry.js +0 -1
  392. package/dist/zonos-elements/p-7748735d.entry.js +0 -1
  393. package/dist/zonos-elements/p-78886ed6.system.entry.js +0 -1
  394. package/dist/zonos-elements/p-8ebc0b64.js +0 -1
  395. package/dist/zonos-elements/p-a6f2e282.system.js +0 -1
  396. package/dist/zonos-elements/p-b035f9e5.system.js +0 -1
  397. package/dist/zonos-elements/p-b1ffb37b.entry.js +0 -1
  398. package/dist/zonos-elements/p-b58d2231.entry.js +0 -1
  399. package/dist/zonos-elements/p-bd02a65c.entry.js +0 -1
  400. package/dist/zonos-elements/p-bea31a7b.system.entry.js +0 -1
  401. package/dist/zonos-elements/p-cfe4a318.js +0 -1
  402. package/dist/zonos-elements/p-e4a2a1b0.system.entry.js +0 -1
  403. package/dist/zonos-elements/p-eb631432.system.entry.js +0 -1
  404. package/dist/zonos-elements/p-f2733cc7.js +0 -1
  405. package/dist/zonos-elements/p-f342e7c7.entry.js +0 -1
  406. package/dist/zonos-elements/p-f82e000f.system.entry.js +0 -1
  407. /package/dist/cjs/{index-3ead02fe.js → index-72767498.js} +0 -0
  408. /package/dist/esm/{index-81a199ef.js → index-b5be4dc3.js} +0 -0
  409. /package/dist/esm-es5/{index-81a199ef.js → index-b5be4dc3.js} +0 -0
  410. /package/dist/zonos-elements/{p-4d8545e1.js → p-58127116.js} +0 -0
  411. /package/dist/zonos-elements/{p-4d39efb6.system.js → p-d1ab0823.system.js} +0 -0
@@ -1,4 +1,6 @@
1
- import { c as createStore, z as zonosStore } from './zonosStore-e59617f8.js';
1
+ import { c as createStore, z as zonosStore } from './zonosStore-dec6bd7e.js';
2
+ import { i as isDarkColor } from './isDarkColor-d0a57fd2.js';
3
+ import { g as getBorderRadius } from './getBorderRadius-0c7dfcf0.js';
2
4
 
3
5
  const stringsArabic = {
4
6
  'Above de minimis threshold for': {
@@ -10,6 +12,9 @@ const stringsArabic = {
10
12
  Back: {
11
13
  value: 'رجوع',
12
14
  },
15
+ 'Billing address': {
16
+ value: 'عنوان الفوترة',
17
+ },
13
18
  'Cart subtotal': {
14
19
  value: 'المجموع الفرعي للسلة',
15
20
  },
@@ -58,6 +63,9 @@ const stringsArabic = {
58
63
  'No shipping methods found - try editing your address or contacting support if the error persists': {
59
64
  value: 'لم يتم العثور على طرق شحن - جرب تحرير عنوانك أو الاتصال بالدعم إذا استمر الخطأ',
60
65
  },
66
+ 'Nothing due at the door': {
67
+ value: 'لا شيء مستحق عند الباب',
68
+ },
61
69
  'Order is over the de minimis threshold for both duty and tax': {
62
70
  value: 'الطلبية أعلى من الحد الأدنى لكل من الرسوم والضرائب',
63
71
  },
@@ -91,12 +99,24 @@ const stringsArabic = {
91
99
  'Restricted items found': {
92
100
  value: 'تم العثور على عناصر مقيدة',
93
101
  },
102
+ 'Search countries': {
103
+ value: 'ابحث عن الدول',
104
+ },
94
105
  'See duty and tax thresholds': {
95
106
  value: 'انظر عتبات الرسوم والضرائب',
96
107
  },
108
+ 'Select a country': {
109
+ value: 'اختر دولة',
110
+ },
111
+ 'Select a language': {
112
+ value: 'اختر لغة',
113
+ },
97
114
  Shipping: {
98
115
  value: 'الشحن',
99
116
  },
117
+ 'Shipping address same as billing': {
118
+ value: 'عنوان الشحن مطابق لعنوان الفوترة',
119
+ },
100
120
  'Shipping information': {
101
121
  value: 'معلومات الشحن',
102
122
  },
@@ -160,6 +180,9 @@ const stringsBase = {
160
180
  Back: {
161
181
  value: 'Back',
162
182
  },
183
+ 'Billing address': {
184
+ value: 'Billing address',
185
+ },
163
186
  'Cart subtotal': {
164
187
  value: 'Cart subtotal',
165
188
  },
@@ -208,6 +231,9 @@ const stringsBase = {
208
231
  'No shipping methods found - try editing your address or contacting support if the error persists': {
209
232
  value: 'No shipping methods found - try editing your address or contacting support if the error persists',
210
233
  },
234
+ 'Nothing due at the door': {
235
+ value: 'Nothing due at the door',
236
+ },
211
237
  'Order is over the de minimis threshold for both duty and tax': {
212
238
  value: 'Order is over the de minimis threshold for both duty and tax',
213
239
  },
@@ -241,12 +267,24 @@ const stringsBase = {
241
267
  'Restricted items found': {
242
268
  value: 'Restricted items found',
243
269
  },
270
+ 'Search countries': {
271
+ value: 'Search countries',
272
+ },
244
273
  'See duty and tax thresholds': {
245
274
  value: 'See duty and tax thresholds',
246
275
  },
276
+ 'Select a country': {
277
+ value: 'Select a country',
278
+ },
279
+ 'Select a language': {
280
+ value: 'Select a language',
281
+ },
247
282
  Shipping: {
248
283
  value: 'Shipping',
249
284
  },
285
+ 'Shipping address same as billing': {
286
+ value: 'Shipping address same as billing',
287
+ },
250
288
  'Shipping information': {
251
289
  value: 'Shipping information',
252
290
  },
@@ -310,6 +348,9 @@ const stringsChinese = {
310
348
  Back: {
311
349
  value: '返回',
312
350
  },
351
+ 'Billing address': {
352
+ value: '账单地址',
353
+ },
313
354
  'Cart subtotal': {
314
355
  value: '购物车小计',
315
356
  },
@@ -358,6 +399,9 @@ const stringsChinese = {
358
399
  'No shipping methods found - try editing your address or contacting support if the error persists': {
359
400
  value: '未找到运输方法 - 如果错误仍然存在,请尝试编辑您的地址或联系支持',
360
401
  },
402
+ 'Nothing due at the door': {
403
+ value: '门口无需付款',
404
+ },
361
405
  'Order is over the de minimis threshold for both duty and tax': {
362
406
  value: '订单超过关税和税款的最低征税门槛',
363
407
  },
@@ -391,12 +435,24 @@ const stringsChinese = {
391
435
  'Restricted items found': {
392
436
  value: '发现受限制的商品',
393
437
  },
438
+ 'Search countries': {
439
+ value: '搜索国家',
440
+ },
394
441
  'See duty and tax thresholds': {
395
442
  value: '查看关税和税款门槛',
396
443
  },
444
+ 'Select a country': {
445
+ value: '选择一个国家',
446
+ },
447
+ 'Select a language': {
448
+ value: '选择一种语言',
449
+ },
397
450
  Shipping: {
398
451
  value: '运输',
399
452
  },
453
+ 'Shipping address same as billing': {
454
+ value: '送货地址与账单地址相同',
455
+ },
400
456
  'Shipping information': {
401
457
  value: '运输信息',
402
458
  },
@@ -460,6 +516,9 @@ const stringsDanish = {
460
516
  Back: {
461
517
  value: 'Tilbage',
462
518
  },
519
+ 'Billing address': {
520
+ value: 'Fakturaadresse',
521
+ },
463
522
  'Cart subtotal': {
464
523
  value: 'Subtotal på kurv',
465
524
  },
@@ -508,6 +567,9 @@ const stringsDanish = {
508
567
  'No shipping methods found - try editing your address or contacting support if the error persists': {
509
568
  value: 'Ingen forsendelsesmetoder fundet - prøv at redigere din adresse eller kontakte support, hvis fejlen fortsætter',
510
569
  },
570
+ 'Nothing due at the door': {
571
+ value: 'Intet at betale ved døren',
572
+ },
511
573
  'Order is over the de minimis threshold for both duty and tax': {
512
574
  value: 'Ordre er over de minimis-grænsen for både told og skat',
513
575
  },
@@ -541,12 +603,24 @@ const stringsDanish = {
541
603
  'Restricted items found': {
542
604
  value: 'Begrænsede varer fundet',
543
605
  },
606
+ 'Search countries': {
607
+ value: 'Søg lande',
608
+ },
544
609
  'See duty and tax thresholds': {
545
610
  value: 'Se grænser for told og skatter',
546
611
  },
612
+ 'Select a country': {
613
+ value: 'Vælg et land',
614
+ },
615
+ 'Select a language': {
616
+ value: 'Vælg et sprog',
617
+ },
547
618
  Shipping: {
548
619
  value: 'Levering',
549
620
  },
621
+ 'Shipping address same as billing': {
622
+ value: 'Leveringsadresse samme som fakturaadresse',
623
+ },
550
624
  'Shipping information': {
551
625
  value: 'Leveringsinformation',
552
626
  },
@@ -610,6 +684,9 @@ const stringsDutch = {
610
684
  Back: {
611
685
  value: 'Terug',
612
686
  },
687
+ 'Billing address': {
688
+ value: 'Factuuradres',
689
+ },
613
690
  'Cart subtotal': {
614
691
  value: 'Winkelwagen subtotaal',
615
692
  },
@@ -658,6 +735,9 @@ const stringsDutch = {
658
735
  'No shipping methods found - try editing your address or contacting support if the error persists': {
659
736
  value: 'Geen verzendmethoden gevonden - probeer uw adres te bewerken of neem contact op met de ondersteuning als de fout aanhoudt',
660
737
  },
738
+ 'Nothing due at the door': {
739
+ value: 'Niets te betalen aan de deur',
740
+ },
661
741
  'Order is over the de minimis threshold for both duty and tax': {
662
742
  value: 'Bestelling overschrijdt de minimale drempel voor zowel heffing als belasting',
663
743
  },
@@ -691,12 +771,24 @@ const stringsDutch = {
691
771
  'Restricted items found': {
692
772
  value: 'Beperkte items gevonden',
693
773
  },
774
+ 'Search countries': {
775
+ value: 'Zoek landen',
776
+ },
694
777
  'See duty and tax thresholds': {
695
778
  value: 'Bekijk heffings- en belastingdrempels',
696
779
  },
780
+ 'Select a country': {
781
+ value: 'Selecteer een land',
782
+ },
783
+ 'Select a language': {
784
+ value: 'Selecteer een taal',
785
+ },
697
786
  Shipping: {
698
787
  value: 'Verzending',
699
788
  },
789
+ 'Shipping address same as billing': {
790
+ value: 'Verzendadres gelijk aan factuuradres',
791
+ },
700
792
  'Shipping information': {
701
793
  value: 'Verzendinformatie',
702
794
  },
@@ -760,6 +852,9 @@ const stringsFrench = {
760
852
  Back: {
761
853
  value: 'Retour',
762
854
  },
855
+ 'Billing address': {
856
+ value: 'Adresse de facturation',
857
+ },
763
858
  'Cart subtotal': {
764
859
  value: 'Sous-total du panier',
765
860
  },
@@ -808,6 +903,9 @@ const stringsFrench = {
808
903
  'No shipping methods found - try editing your address or contacting support if the error persists': {
809
904
  value: "Aucune méthode d'expédition trouvée - essayez de modifier votre adresse ou de contacter le support si l'erreur persiste",
810
905
  },
906
+ 'Nothing due at the door': {
907
+ value: 'Rien à payer à la porte',
908
+ },
811
909
  'Order is over the de minimis threshold for both duty and tax': {
812
910
  value: 'La commande dépasse le seuil de minimis pour les droits et les taxes',
813
911
  },
@@ -841,12 +939,24 @@ const stringsFrench = {
841
939
  'Restricted items found': {
842
940
  value: 'Articles restreints trouvés',
843
941
  },
942
+ 'Search countries': {
943
+ value: 'Rechercher des pays',
944
+ },
844
945
  'See duty and tax thresholds': {
845
946
  value: 'Voir les seuils pour les droits et taxes',
846
947
  },
948
+ 'Select a country': {
949
+ value: 'Sélectionner un pays',
950
+ },
951
+ 'Select a language': {
952
+ value: 'Sélectionner une langue',
953
+ },
847
954
  Shipping: {
848
955
  value: 'Livraison',
849
956
  },
957
+ 'Shipping address same as billing': {
958
+ value: "Adresse de livraison identique à l'adresse de facturation",
959
+ },
850
960
  'Shipping information': {
851
961
  value: 'Informations de livraison',
852
962
  },
@@ -910,6 +1020,9 @@ const stringsGerman = {
910
1020
  Back: {
911
1021
  value: 'Zurück',
912
1022
  },
1023
+ 'Billing address': {
1024
+ value: 'Rechnungsadresse',
1025
+ },
913
1026
  'Cart subtotal': {
914
1027
  value: 'Warenkorbzwischensumme',
915
1028
  },
@@ -958,6 +1071,9 @@ const stringsGerman = {
958
1071
  'No shipping methods found - try editing your address or contacting support if the error persists': {
959
1072
  value: 'Keine Versandmethoden gefunden - versuchen Sie, Ihre Adresse zu bearbeiten, oder kontaktieren Sie den Support, wenn der Fehler weiterhin besteht',
960
1073
  },
1074
+ 'Nothing due at the door': {
1075
+ value: 'An der Tür nichts zu bezahlen',
1076
+ },
961
1077
  'Order is over the de minimis threshold for both duty and tax': {
962
1078
  value: 'Bestellung überschreitet Mindestgrenze sowohl für Zoll als auch Steuer',
963
1079
  },
@@ -991,12 +1107,24 @@ const stringsGerman = {
991
1107
  'Restricted items found': {
992
1108
  value: 'Eingeschränkte Artikel gefunden',
993
1109
  },
1110
+ 'Search countries': {
1111
+ value: 'Länder durchsuchen',
1112
+ },
994
1113
  'See duty and tax thresholds': {
995
1114
  value: 'Zoll- und Steuerschwellen ansehen',
996
1115
  },
1116
+ 'Select a country': {
1117
+ value: 'Wählen Sie ein Land aus',
1118
+ },
1119
+ 'Select a language': {
1120
+ value: 'Wähle eine Sprache',
1121
+ },
997
1122
  Shipping: {
998
1123
  value: 'Versand',
999
1124
  },
1125
+ 'Shipping address same as billing': {
1126
+ value: 'Lieferadresse wie Rechnungsadresse',
1127
+ },
1000
1128
  'Shipping information': {
1001
1129
  value: 'Versandinformationen',
1002
1130
  },
@@ -1060,6 +1188,9 @@ const stringsHebrew = {
1060
1188
  Back: {
1061
1189
  value: 'חזור',
1062
1190
  },
1191
+ 'Billing address': {
1192
+ value: 'כתובת לחיוב',
1193
+ },
1063
1194
  'Cart subtotal': {
1064
1195
  value: 'סיכום ביניים של העגלה',
1065
1196
  },
@@ -1108,6 +1239,9 @@ const stringsHebrew = {
1108
1239
  'No shipping methods found - try editing your address or contacting support if the error persists': {
1109
1240
  value: 'לא נמצאו שיטות משלוח - נסו לערוך את הכתובת שלך או ליצור קשר עם התמיכה אם השגיאה ממשיכה',
1110
1241
  },
1242
+ 'Nothing due at the door': {
1243
+ value: 'אין כלום לשלם בדלת',
1244
+ },
1111
1245
  'Order is over the de minimis threshold for both duty and tax': {
1112
1246
  value: 'ההזמנה חורגת מסף המינימום גם למכס וגם למס',
1113
1247
  },
@@ -1141,12 +1275,24 @@ const stringsHebrew = {
1141
1275
  'Restricted items found': {
1142
1276
  value: 'נמצאו פריטים מוגבלים',
1143
1277
  },
1278
+ 'Search countries': {
1279
+ value: 'חיפוש מדינות',
1280
+ },
1144
1281
  'See duty and tax thresholds': {
1145
1282
  value: 'צפה בספים של מכסים ומסים',
1146
1283
  },
1284
+ 'Select a country': {
1285
+ value: 'בחר מדינה',
1286
+ },
1287
+ 'Select a language': {
1288
+ value: 'בחר שפה',
1289
+ },
1147
1290
  Shipping: {
1148
1291
  value: 'משלוח',
1149
1292
  },
1293
+ 'Shipping address same as billing': {
1294
+ value: 'כתובת המשלוח זהה לכתובת החיוב',
1295
+ },
1150
1296
  'Shipping information': {
1151
1297
  value: 'פרטי משלוח',
1152
1298
  },
@@ -1210,6 +1356,9 @@ const stringsIndonesian = {
1210
1356
  Back: {
1211
1357
  value: 'Kembali',
1212
1358
  },
1359
+ 'Billing address': {
1360
+ value: 'Alamat Penagihan',
1361
+ },
1213
1362
  'Cart subtotal': {
1214
1363
  value: 'Subtotal keranjang',
1215
1364
  },
@@ -1258,6 +1407,9 @@ const stringsIndonesian = {
1258
1407
  'No shipping methods found - try editing your address or contacting support if the error persists': {
1259
1408
  value: 'Tidak ditemukan metode pengiriman - coba edit alamat Anda atau hubungi dukungan jika kesalahan masih berlanjut',
1260
1409
  },
1410
+ 'Nothing due at the door': {
1411
+ value: 'Tidak ada yang harus dibayar di pintu',
1412
+ },
1261
1413
  'Order is over the de minimis threshold for both duty and tax': {
1262
1414
  value: 'Pesanan melebihi ambang batas de minimis untuk bea masuk dan pajak',
1263
1415
  },
@@ -1291,12 +1443,24 @@ const stringsIndonesian = {
1291
1443
  'Restricted items found': {
1292
1444
  value: 'Item terbatas ditemukan',
1293
1445
  },
1446
+ 'Search countries': {
1447
+ value: 'Cari negara',
1448
+ },
1294
1449
  'See duty and tax thresholds': {
1295
1450
  value: 'Lihat ambang batas bea masuk dan pajak',
1296
1451
  },
1452
+ 'Select a country': {
1453
+ value: 'Pilih sebuah negara',
1454
+ },
1455
+ 'Select a language': {
1456
+ value: 'Pilih bahasa',
1457
+ },
1297
1458
  Shipping: {
1298
1459
  value: 'Pengiriman',
1299
1460
  },
1461
+ 'Shipping address same as billing': {
1462
+ value: 'Alamat pengiriman sama dengan alamat penagihan',
1463
+ },
1300
1464
  'Shipping information': {
1301
1465
  value: 'Informasi pengiriman',
1302
1466
  },
@@ -1360,6 +1524,9 @@ const stringsItalian = {
1360
1524
  Back: {
1361
1525
  value: 'Indietro',
1362
1526
  },
1527
+ 'Billing address': {
1528
+ value: 'Indirizzo di fatturazione',
1529
+ },
1363
1530
  'Cart subtotal': {
1364
1531
  value: 'Subtotale carrello',
1365
1532
  },
@@ -1408,6 +1575,9 @@ const stringsItalian = {
1408
1575
  'No shipping methods found - try editing your address or contacting support if the error persists': {
1409
1576
  value: "Nessun metodo di spedizione trovato - prova a modificare il tuo indirizzo o contatta il supporto se l'errore persiste",
1410
1577
  },
1578
+ 'Nothing due at the door': {
1579
+ value: 'Nulla da pagare alla porta',
1580
+ },
1411
1581
  'Order is over the de minimis threshold for both duty and tax': {
1412
1582
  value: "L'ordine supera la soglia di minimis sia per i dazi che per le tasse",
1413
1583
  },
@@ -1441,12 +1611,24 @@ const stringsItalian = {
1441
1611
  'Restricted items found': {
1442
1612
  value: 'Articoli limitati trovati',
1443
1613
  },
1614
+ 'Search countries': {
1615
+ value: 'Cerca paesi',
1616
+ },
1444
1617
  'See duty and tax thresholds': {
1445
1618
  value: 'Visualizza le soglie di dazi e tasse',
1446
1619
  },
1620
+ 'Select a country': {
1621
+ value: 'Seleziona un paese',
1622
+ },
1623
+ 'Select a language': {
1624
+ value: 'Seleziona una lingua',
1625
+ },
1447
1626
  Shipping: {
1448
1627
  value: 'Spedizione',
1449
1628
  },
1629
+ 'Shipping address same as billing': {
1630
+ value: 'Indirizzo di spedizione uguale a quello di fatturazione',
1631
+ },
1450
1632
  'Shipping information': {
1451
1633
  value: 'Informazioni di spedizione',
1452
1634
  },
@@ -1510,6 +1692,9 @@ const stringsJapanese = {
1510
1692
  Back: {
1511
1693
  value: '戻る',
1512
1694
  },
1695
+ 'Billing address': {
1696
+ value: '請求先住所',
1697
+ },
1513
1698
  'Cart subtotal': {
1514
1699
  value: 'カートの小計',
1515
1700
  },
@@ -1558,6 +1743,9 @@ const stringsJapanese = {
1558
1743
  'No shipping methods found - try editing your address or contacting support if the error persists': {
1559
1744
  value: '配送方法が見つかりません - 住所を編集するか、エラーが続く場合はサポートにお問い合わせください',
1560
1745
  },
1746
+ 'Nothing due at the door': {
1747
+ value: 'ドアでの支払いはありません',
1748
+ },
1561
1749
  'Order is over the de minimis threshold for both duty and tax': {
1562
1750
  value: '注文が関税と税金のデミニマス閾値を超えています',
1563
1751
  },
@@ -1591,12 +1779,24 @@ const stringsJapanese = {
1591
1779
  'Restricted items found': {
1592
1780
  value: '制限付き商品が見つかりました',
1593
1781
  },
1782
+ 'Search countries': {
1783
+ value: '国を検索',
1784
+ },
1594
1785
  'See duty and tax thresholds': {
1595
1786
  value: '関税と税金の閾値を見る',
1596
1787
  },
1788
+ 'Select a country': {
1789
+ value: '国を選択',
1790
+ },
1791
+ 'Select a language': {
1792
+ value: '言語を選択',
1793
+ },
1597
1794
  Shipping: {
1598
1795
  value: '配送',
1599
1796
  },
1797
+ 'Shipping address same as billing': {
1798
+ value: '送付先住所は請求先住所と同じ',
1799
+ },
1600
1800
  'Shipping information': {
1601
1801
  value: '配送情報',
1602
1802
  },
@@ -1660,6 +1860,9 @@ const stringsKorean = {
1660
1860
  Back: {
1661
1861
  value: '뒤로',
1662
1862
  },
1863
+ 'Billing address': {
1864
+ value: '청구지 주소',
1865
+ },
1663
1866
  'Cart subtotal': {
1664
1867
  value: '장바구니 합계',
1665
1868
  },
@@ -1708,6 +1911,9 @@ const stringsKorean = {
1708
1911
  'No shipping methods found - try editing your address or contacting support if the error persists': {
1709
1912
  value: '배송 방법을 찾을 수 없습니다 - 주소를 편집하거나 오류가 계속되는 경우 지원팀에 문의하세요',
1710
1913
  },
1914
+ 'Nothing due at the door': {
1915
+ value: '문 앞에 납부할 것이 없습니다',
1916
+ },
1711
1917
  'Order is over the de minimis threshold for both duty and tax': {
1712
1918
  value: '주문 금액이 관세와 세금의 최저 임계값을 초과합니다',
1713
1919
  },
@@ -1741,12 +1947,24 @@ const stringsKorean = {
1741
1947
  'Restricted items found': {
1742
1948
  value: '제한 물품 발견',
1743
1949
  },
1950
+ 'Search countries': {
1951
+ value: '국가 검색',
1952
+ },
1744
1953
  'See duty and tax thresholds': {
1745
1954
  value: '관세 및 세금 임계값 보기',
1746
1955
  },
1956
+ 'Select a country': {
1957
+ value: '국가 선택',
1958
+ },
1959
+ 'Select a language': {
1960
+ value: '언어 선택',
1961
+ },
1747
1962
  Shipping: {
1748
1963
  value: '배송',
1749
1964
  },
1965
+ 'Shipping address same as billing': {
1966
+ value: '배송 주소와 청구 주소가 동일',
1967
+ },
1750
1968
  'Shipping information': {
1751
1969
  value: '배송 정보',
1752
1970
  },
@@ -1810,6 +2028,9 @@ const stringsNorwegian = {
1810
2028
  Back: {
1811
2029
  value: 'Tilbake',
1812
2030
  },
2031
+ 'Billing address': {
2032
+ value: 'Fakturaadresse',
2033
+ },
1813
2034
  'Cart subtotal': {
1814
2035
  value: 'Delsum handlevogn',
1815
2036
  },
@@ -1858,6 +2079,9 @@ const stringsNorwegian = {
1858
2079
  'No shipping methods found - try editing your address or contacting support if the error persists': {
1859
2080
  value: 'Ingen fraktmetoder funnet - prøv å redigere adressen din eller kontakte støtte hvis feilen fortsetter',
1860
2081
  },
2082
+ 'Nothing due at the door': {
2083
+ value: 'Ingenting å betale ved døren',
2084
+ },
1861
2085
  'Order is over the de minimis threshold for both duty and tax': {
1862
2086
  value: 'Bestillingen er over minstegrensen for både avgift og skatt',
1863
2087
  },
@@ -1891,12 +2115,24 @@ const stringsNorwegian = {
1891
2115
  'Restricted items found': {
1892
2116
  value: 'Begrensede varer funnet',
1893
2117
  },
2118
+ 'Search countries': {
2119
+ value: 'Søk land',
2120
+ },
1894
2121
  'See duty and tax thresholds': {
1895
2122
  value: 'Se minstegrenser for avgifter og skatt',
1896
2123
  },
2124
+ 'Select a country': {
2125
+ value: 'Velg et land',
2126
+ },
2127
+ 'Select a language': {
2128
+ value: 'Velg et språk',
2129
+ },
1897
2130
  Shipping: {
1898
2131
  value: 'Frakt',
1899
2132
  },
2133
+ 'Shipping address same as billing': {
2134
+ value: 'Leveringsadresse samme som fakturaadresse',
2135
+ },
1900
2136
  'Shipping information': {
1901
2137
  value: 'Fraktinformasjon',
1902
2138
  },
@@ -1960,6 +2196,9 @@ const stringsPolish = {
1960
2196
  Back: {
1961
2197
  value: 'Wstecz',
1962
2198
  },
2199
+ 'Billing address': {
2200
+ value: 'Adres rozliczeniowy',
2201
+ },
1963
2202
  'Cart subtotal': {
1964
2203
  value: 'Suma częściowa koszyka',
1965
2204
  },
@@ -2008,6 +2247,9 @@ const stringsPolish = {
2008
2247
  'No shipping methods found - try editing your address or contacting support if the error persists': {
2009
2248
  value: 'Nie znaleziono metod dostawy - spróbuj edytować swój adres lub skontaktować się z obsługą, jeśli błąd będzie się utrzymywać',
2010
2249
  },
2250
+ 'Nothing due at the door': {
2251
+ value: 'Nic do zapłacenia przy drzwiach',
2252
+ },
2011
2253
  'Order is over the de minimis threshold for both duty and tax': {
2012
2254
  value: 'Zamówienie przekracza próg minimalny zarówno dla cła, jak i podatku',
2013
2255
  },
@@ -2041,12 +2283,24 @@ const stringsPolish = {
2041
2283
  'Restricted items found': {
2042
2284
  value: 'Znaleziono ograniczone przedmioty',
2043
2285
  },
2286
+ 'Search countries': {
2287
+ value: 'Szukaj krajów',
2288
+ },
2044
2289
  'See duty and tax thresholds': {
2045
2290
  value: 'Zobacz progi cła i podatków',
2046
2291
  },
2292
+ 'Select a country': {
2293
+ value: 'Wybierz kraj',
2294
+ },
2295
+ 'Select a language': {
2296
+ value: 'Wybierz język',
2297
+ },
2047
2298
  Shipping: {
2048
2299
  value: 'Wysyłka',
2049
2300
  },
2301
+ 'Shipping address same as billing': {
2302
+ value: 'Adres wysyłki taki sam jak adres rozliczeniowy',
2303
+ },
2050
2304
  'Shipping information': {
2051
2305
  value: 'Informacje o wysyłce',
2052
2306
  },
@@ -2110,6 +2364,9 @@ const stringsPortuguese = {
2110
2364
  Back: {
2111
2365
  value: 'Voltar',
2112
2366
  },
2367
+ 'Billing address': {
2368
+ value: 'Endereço de faturação',
2369
+ },
2113
2370
  'Cart subtotal': {
2114
2371
  value: 'Subtotal do carrinho',
2115
2372
  },
@@ -2158,6 +2415,9 @@ const stringsPortuguese = {
2158
2415
  'No shipping methods found - try editing your address or contacting support if the error persists': {
2159
2416
  value: 'Nenhum método de envio encontrado - tente editar seu endereço ou entrar em contato com o suporte se o erro persistir',
2160
2417
  },
2418
+ 'Nothing due at the door': {
2419
+ value: 'Nada a pagar na porta',
2420
+ },
2161
2421
  'Order is over the de minimis threshold for both duty and tax': {
2162
2422
  value: 'O pedido ultrapassa o limite de isenção tanto para impostos quanto para taxas',
2163
2423
  },
@@ -2191,12 +2451,24 @@ const stringsPortuguese = {
2191
2451
  'Restricted items found': {
2192
2452
  value: 'Itens restritos encontrados',
2193
2453
  },
2454
+ 'Search countries': {
2455
+ value: 'Buscar países',
2456
+ },
2194
2457
  'See duty and tax thresholds': {
2195
2458
  value: 'Veja os limites de isenção de impostos e taxas',
2196
2459
  },
2460
+ 'Select a country': {
2461
+ value: 'Selecionar um país',
2462
+ },
2463
+ 'Select a language': {
2464
+ value: 'Selecionar um idioma',
2465
+ },
2197
2466
  Shipping: {
2198
2467
  value: 'Frete',
2199
2468
  },
2469
+ 'Shipping address same as billing': {
2470
+ value: 'Endereço de entrega igual ao de faturação',
2471
+ },
2200
2472
  'Shipping information': {
2201
2473
  value: 'Informações de envio',
2202
2474
  },
@@ -2260,6 +2532,9 @@ const stringsRussian = {
2260
2532
  Back: {
2261
2533
  value: 'Назад',
2262
2534
  },
2535
+ 'Billing address': {
2536
+ value: 'Платежный адрес',
2537
+ },
2263
2538
  'Cart subtotal': {
2264
2539
  value: 'Промежуточный итог',
2265
2540
  },
@@ -2308,6 +2583,9 @@ const stringsRussian = {
2308
2583
  'No shipping methods found - try editing your address or contacting support if the error persists': {
2309
2584
  value: 'Не найдено методов доставки - попробуйте отредактировать ваш адрес или свяжитесь с поддержкой, если ошибка сохраняется',
2310
2585
  },
2586
+ 'Nothing due at the door': {
2587
+ value: 'На двери ничего не должно',
2588
+ },
2311
2589
  'Order is over the de minimis threshold for both duty and tax': {
2312
2590
  value: 'Заказ превышает минимальный порог как для пошлины, так и для налога',
2313
2591
  },
@@ -2341,12 +2619,24 @@ const stringsRussian = {
2341
2619
  'Restricted items found': {
2342
2620
  value: 'Найдены ограниченные товары',
2343
2621
  },
2622
+ 'Search countries': {
2623
+ value: 'Поиск стран',
2624
+ },
2344
2625
  'See duty and tax thresholds': {
2345
2626
  value: 'Смотреть пороги пошлин и налогов',
2346
2627
  },
2628
+ 'Select a country': {
2629
+ value: 'Выберите страну',
2630
+ },
2631
+ 'Select a language': {
2632
+ value: 'Выберите язык',
2633
+ },
2347
2634
  Shipping: {
2348
2635
  value: 'Доставка',
2349
2636
  },
2637
+ 'Shipping address same as billing': {
2638
+ value: 'Адрес доставки совпадает с платежным адресом',
2639
+ },
2350
2640
  'Shipping information': {
2351
2641
  value: 'Информация о доставке',
2352
2642
  },
@@ -2410,6 +2700,9 @@ const stringsSpanish = {
2410
2700
  Back: {
2411
2701
  value: 'Regresar',
2412
2702
  },
2703
+ 'Billing address': {
2704
+ value: 'Dirección de facturación',
2705
+ },
2413
2706
  'Cart subtotal': {
2414
2707
  value: 'Subtotal del carrito',
2415
2708
  },
@@ -2458,6 +2751,9 @@ const stringsSpanish = {
2458
2751
  'No shipping methods found - try editing your address or contacting support if the error persists': {
2459
2752
  value: 'No se encontraron métodos de envío: intenta editar tu dirección o contactar al soporte si el error persiste',
2460
2753
  },
2754
+ 'Nothing due at the door': {
2755
+ value: 'Nada debido en la puerta',
2756
+ },
2461
2757
  'Order is over the de minimis threshold for both duty and tax': {
2462
2758
  value: 'El pedido supera el umbral mínimo tanto para impuestos como para aranceles',
2463
2759
  },
@@ -2491,12 +2787,24 @@ const stringsSpanish = {
2491
2787
  'Restricted items found': {
2492
2788
  value: 'Se encontraron artículos restringidos',
2493
2789
  },
2790
+ 'Search countries': {
2791
+ value: 'Buscar países',
2792
+ },
2494
2793
  'See duty and tax thresholds': {
2495
2794
  value: 'Ver umbrales de aranceles e impuestos',
2496
2795
  },
2796
+ 'Select a country': {
2797
+ value: 'Seleccionar un país',
2798
+ },
2799
+ 'Select a language': {
2800
+ value: 'Seleccionar un idioma',
2801
+ },
2497
2802
  Shipping: {
2498
2803
  value: 'Envío',
2499
2804
  },
2805
+ 'Shipping address same as billing': {
2806
+ value: 'La dirección de envío es la misma que la de facturación',
2807
+ },
2500
2808
  'Shipping information': {
2501
2809
  value: 'Información de envío',
2502
2810
  },
@@ -2560,6 +2868,9 @@ const stringsSwedish = {
2560
2868
  Back: {
2561
2869
  value: 'Tillbaka',
2562
2870
  },
2871
+ 'Billing address': {
2872
+ value: 'Fakturaadress',
2873
+ },
2563
2874
  'Cart subtotal': {
2564
2875
  value: 'Varukorgens delsumma',
2565
2876
  },
@@ -2608,6 +2919,9 @@ const stringsSwedish = {
2608
2919
  'No shipping methods found - try editing your address or contacting support if the error persists': {
2609
2920
  value: 'Inga leveransmetoder hittades - försök redigera din adress eller kontakta supporten om felet kvarstår',
2610
2921
  },
2922
+ 'Nothing due at the door': {
2923
+ value: 'Ingenting att betala vid dörren',
2924
+ },
2611
2925
  'Order is over the de minimis threshold for both duty and tax': {
2612
2926
  value: 'Beställningen överstiger minimibeloppet för både tull och skatt',
2613
2927
  },
@@ -2641,12 +2955,24 @@ const stringsSwedish = {
2641
2955
  'Restricted items found': {
2642
2956
  value: 'Begränsade artiklar hittades',
2643
2957
  },
2958
+ 'Search countries': {
2959
+ value: 'Sök länder',
2960
+ },
2644
2961
  'See duty and tax thresholds': {
2645
2962
  value: 'Se tull- och skattetrösklar',
2646
2963
  },
2964
+ 'Select a country': {
2965
+ value: 'Välj ett land',
2966
+ },
2967
+ 'Select a language': {
2968
+ value: 'Välj ett språk',
2969
+ },
2647
2970
  Shipping: {
2648
2971
  value: 'Frakt',
2649
2972
  },
2973
+ 'Shipping address same as billing': {
2974
+ value: 'Leveransadressen är densamma som fakturaadressen',
2975
+ },
2650
2976
  'Shipping information': {
2651
2977
  value: 'Fraktinformation',
2652
2978
  },
@@ -2710,6 +3036,9 @@ const stringsTurkish = {
2710
3036
  Back: {
2711
3037
  value: 'Geri',
2712
3038
  },
3039
+ 'Billing address': {
3040
+ value: 'Fatura Adresi',
3041
+ },
2713
3042
  'Cart subtotal': {
2714
3043
  value: 'Sepet ara toplam',
2715
3044
  },
@@ -2758,6 +3087,9 @@ const stringsTurkish = {
2758
3087
  'No shipping methods found - try editing your address or contacting support if the error persists': {
2759
3088
  value: 'Hiçbir gönderi yöntemi bulunamadı - eğer hata devam ediyorsa adresinizi düzenlemeyi deneyin veya destekle iletişime geçin',
2760
3089
  },
3090
+ 'Nothing due at the door': {
3091
+ value: 'Kapıda ödenecek bir şey yok',
3092
+ },
2761
3093
  'Order is over the de minimis threshold for both duty and tax': {
2762
3094
  value: 'Sipariş hem gümrük hem vergi için minimum sınırın üzerinde',
2763
3095
  },
@@ -2791,12 +3123,24 @@ const stringsTurkish = {
2791
3123
  'Restricted items found': {
2792
3124
  value: 'Kısıtlı ürün bulundu',
2793
3125
  },
3126
+ 'Search countries': {
3127
+ value: 'Ülkeleri ara',
3128
+ },
2794
3129
  'See duty and tax thresholds': {
2795
3130
  value: 'Vergi ve gümrük vergisi limitlerini gör',
2796
3131
  },
3132
+ 'Select a country': {
3133
+ value: 'Bir ülke seç',
3134
+ },
3135
+ 'Select a language': {
3136
+ value: 'Bir dil seçin',
3137
+ },
2797
3138
  Shipping: {
2798
3139
  value: 'Kargo',
2799
3140
  },
3141
+ 'Shipping address same as billing': {
3142
+ value: 'Teslimat adresi fatura adresi ile aynı',
3143
+ },
2800
3144
  'Shipping information': {
2801
3145
  value: 'Kargo bilgileri',
2802
3146
  },
@@ -2860,6 +3204,9 @@ const stringsVietnamese = {
2860
3204
  Back: {
2861
3205
  value: 'Quay lại',
2862
3206
  },
3207
+ 'Billing address': {
3208
+ value: 'Địa chỉ thanh toán',
3209
+ },
2863
3210
  'Cart subtotal': {
2864
3211
  value: 'Tổng giỏ hàng',
2865
3212
  },
@@ -2908,6 +3255,9 @@ const stringsVietnamese = {
2908
3255
  'No shipping methods found - try editing your address or contacting support if the error persists': {
2909
3256
  value: 'Không tìm thấy phương thức vận chuyển - hãy thử chỉnh sửa địa chỉ của bạn hoặc liên hệ hỗ trợ nếu lỗi vẫn tiếp tục',
2910
3257
  },
3258
+ 'Nothing due at the door': {
3259
+ value: 'Không có gì phải trả tại cửa',
3260
+ },
2911
3261
  'Order is over the de minimis threshold for both duty and tax': {
2912
3262
  value: 'Đơn hàng vượt ngưỡng miễn thuế cho cả thuế nhập khẩu và thuế',
2913
3263
  },
@@ -2941,12 +3291,24 @@ const stringsVietnamese = {
2941
3291
  'Restricted items found': {
2942
3292
  value: 'Tìm thấy hàng hóa bị hạn chế',
2943
3293
  },
3294
+ 'Search countries': {
3295
+ value: 'Tìm kiếm quốc gia',
3296
+ },
2944
3297
  'See duty and tax thresholds': {
2945
3298
  value: 'Xem ngưỡng thuế nhập khẩu và thuế',
2946
3299
  },
3300
+ 'Select a country': {
3301
+ value: 'Chọn một quốc gia',
3302
+ },
3303
+ 'Select a language': {
3304
+ value: 'Chọn một ngôn ngữ',
3305
+ },
2947
3306
  Shipping: {
2948
3307
  value: 'Vận chuyển',
2949
3308
  },
3309
+ 'Shipping address same as billing': {
3310
+ value: 'Địa chỉ giao hàng giống hệt địa chỉ thanh toán',
3311
+ },
2950
3312
  'Shipping information': {
2951
3313
  value: 'Thông tin vận chuyển',
2952
3314
  },
@@ -3627,7 +3989,7 @@ const initLocalizationStore = async () => {
3627
3989
  // Filter countries to only include countries in the shipping zone
3628
3990
  const filteredCountries = shippingZoneCountries === null || shippingZoneCountries === void 0 ? void 0 : shippingZoneCountries.reduce((acc, countryCode) => {
3629
3991
  const countryInfo = allCountries === null || allCountries === void 0 ? void 0 : allCountries[countryCode];
3630
- return countryInfo
3992
+ return countryInfo && countryInfo.active
3631
3993
  ? Object.assign(Object.assign({}, acc), { [countryCode]: countryInfo }) : acc;
3632
3994
  }, {});
3633
3995
  localizationStore.shippingZoneCountries = filteredCountries || null;
@@ -3648,5 +4010,711 @@ const initLocalizationStore = async () => {
3648
4010
  localizationStore.localizationLoaded = true;
3649
4011
  void getCustomMessages();
3650
4012
  };
4013
+ const updateCheckoutSessionLanguage = async () => {
4014
+ if (!cartStore.checkoutSessionId) {
4015
+ return null;
4016
+ }
4017
+ const { errors, json } = await handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/update-checkout-session-metadata`, {
4018
+ body: {
4019
+ id: cartStore.checkoutSessionId,
4020
+ metadata: [
4021
+ {
4022
+ key: 'language',
4023
+ value: localizationStore.selectedLocale,
4024
+ },
4025
+ ],
4026
+ },
4027
+ method: 'POST',
4028
+ });
4029
+ if (errors.length || !json) {
4030
+ logError('Error occurs when updating checkout session', JSON.stringify(errors, null, 2));
4031
+ return { errors, json };
4032
+ }
4033
+ return { errors: [], json };
4034
+ };
4035
+ const localizationStoreUpdateSelectedLocale = (newSelectedLocale) => {
4036
+ localizationStore.selectedLocale = newSelectedLocale;
4037
+ translationStoreUpdateLanguage(newSelectedLocale);
4038
+ void updateCheckoutSessionLanguage();
4039
+ };
4040
+
4041
+ const prepCalculateLandedCost = () => {
4042
+ // maybe we don't need email now for prefetch the landed cost
4043
+ const stripeLinkData = stripeStore.stripeLinkEventData;
4044
+ const stripeAddressData = stripeStore.stripeAddressEventData;
4045
+ const stripeBillingAddressData = stripeStore.stripeShippingSameAsBilling
4046
+ ? stripeStore.stripeAddressEventData
4047
+ : stripeStore.stripeBillingAddressEventData;
4048
+ if (!(stripeAddressData === null || stripeAddressData === void 0 ? void 0 : stripeAddressData.complete) || !(stripeBillingAddressData === null || stripeBillingAddressData === void 0 ? void 0 : stripeBillingAddressData.complete)) {
4049
+ throw new Error('Missing stripe address data');
4050
+ }
4051
+ return {
4052
+ billingAddress: {
4053
+ addressLine1: stripeBillingAddressData.value.address.line1,
4054
+ addressLine2: stripeBillingAddressData.value.address.line2 || '',
4055
+ city: stripeBillingAddressData.value.address.city,
4056
+ country: stripeBillingAddressData.value.address.country,
4057
+ postalCode: stripeBillingAddressData.value.address.postal_code,
4058
+ state: stripeBillingAddressData.value.address.state,
4059
+ },
4060
+ billingContact: {
4061
+ // firstName and lastName should be valid now since stripe only mark
4062
+ // the address as complete when both fields are filled.
4063
+ firstName: stripeBillingAddressData.value.firstName || '',
4064
+ lastName: stripeBillingAddressData.value.lastName || '',
4065
+ phone: stripeBillingAddressData.value.phone || '',
4066
+ },
4067
+ checkoutSessionId: cartStore.checkoutSessionId || '',
4068
+ contact: {
4069
+ email: (stripeLinkData === null || stripeLinkData === void 0 ? void 0 : stripeLinkData.value.email) || '',
4070
+ // firstName and lastName should be valid now since stripe only mark
4071
+ // the address as complete when both fields are filled.
4072
+ firstName: stripeAddressData.value.firstName || '',
4073
+ lastName: stripeAddressData.value.lastName || '',
4074
+ phone: stripeAddressData.value.phone || '',
4075
+ },
4076
+ items: cartStore.items.map(item => item),
4077
+ shippingAddress: {
4078
+ addressLine1: stripeAddressData.value.address.line1,
4079
+ addressLine2: stripeAddressData.value.address.line2 || '',
4080
+ city: stripeAddressData.value.address.city,
4081
+ country: stripeAddressData.value.address.country,
4082
+ postalCode: stripeAddressData.value.address.postal_code,
4083
+ state: stripeAddressData.value.address.state,
4084
+ },
4085
+ };
4086
+ };
4087
+
4088
+ const triggerBuildLandedCost = async (buildLandedCost) => {
4089
+ var _a, _b, _c, _d;
4090
+ const data = prepCalculateLandedCost();
4091
+ const landedCost = await buildLandedCost({
4092
+ billingAddress: data.billingAddress,
4093
+ billingContact: data.billingContact,
4094
+ checkoutSessionId: data.checkoutSessionId,
4095
+ contact: data.contact,
4096
+ shippingAddress: data.shippingAddress,
4097
+ });
4098
+ if (!landedCost || ((_a = landedCost.errors) === null || _a === void 0 ? void 0 : _a.length)) {
4099
+ throw new Error(`Failed to build landed cost: ${((_c = (_b = landedCost === null || landedCost === void 0 ? void 0 : landedCost.errors) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.message) || 'Unknown error'}`);
4100
+ }
4101
+ // Validate the landed cost object to make sure the returned value from buildLandedCost has a valid schema
4102
+ const { errors, json } = await handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/validate-landed-cost`, {
4103
+ body: landedCost,
4104
+ headers: {
4105
+ 'Content-Type': 'application/json',
4106
+ },
4107
+ method: 'POST',
4108
+ });
4109
+ if (!json || errors.length) {
4110
+ throw new Error(`Invalid landed cost object: ${((_d = errors.find(Boolean)) === null || _d === void 0 ? void 0 : _d.message) || 'Unknown error'}`);
4111
+ }
4112
+ return landedCost;
4113
+ };
4114
+
4115
+ const calculateLandedCost = async (abortController) => {
4116
+ var _a;
4117
+ // If buildLandedCost callback is supplied, use that instead of our regular request to '/calculate-landed-cost'
4118
+ const buildLandedCost = zonosStore.checkoutSettings.buildLandedCost;
4119
+ if (buildLandedCost) {
4120
+ const json = await triggerBuildLandedCost(buildLandedCost);
4121
+ return json;
4122
+ }
4123
+ // request to get landed cost info
4124
+ const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/calculate-landed-cost`;
4125
+ const { errors, json } = await handleFetch(url, {
4126
+ body: prepCalculateLandedCost(),
4127
+ method: 'POST',
4128
+ signal: abortController === null || abortController === void 0 ? void 0 : abortController.signal,
4129
+ });
4130
+ if (errors.length || !json) {
4131
+ const isAbortedRequest = ((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.message) === 'The user aborted a request.';
4132
+ const errorMessage = isAbortedRequest
4133
+ ? 'The landed cost calculation request was aborted to initiate a new one.'
4134
+ : 'Failed to calculate landed cost';
4135
+ throw new Error(errorMessage);
4136
+ }
4137
+ return json;
4138
+ };
4139
+
4140
+ const addressRuleStyle = ({ theme, }) => {
4141
+ switch (theme) {
4142
+ default:
4143
+ return {
4144
+ '.Input': {
4145
+ // need to reset everything and the paddingTop to default, otherwise the paddingTop will not be updated.
4146
+ padding: '0',
4147
+ paddingBottom: '8px',
4148
+ paddingLeft: '16px',
4149
+ paddingRight: '8px',
4150
+ // any value here will be add up to the default paddingTop (20px).
4151
+ paddingTop: '6px',
4152
+ },
4153
+ };
4154
+ }
4155
+ };
4156
+
4157
+ const defaultVariable = ({ borderStyle, theme, }) => {
4158
+ switch (theme) {
4159
+ case 'DARK':
4160
+ return {
4161
+ borderRadius: getBorderRadius(borderStyle),
4162
+ colorBackground: '#101117',
4163
+ colorBackgroundText: '#C5C6CA',
4164
+ colorText: '#C5C6CA',
4165
+ colorTextPlaceholder: '#C5C6CA',
4166
+ };
4167
+ default:
4168
+ return {
4169
+ borderRadius: getBorderRadius(borderStyle),
4170
+ };
4171
+ }
4172
+ };
4173
+
4174
+ const { onChange: onChange$1, reset: reset$1, state: stripeStore, } = createStore(() => ({
4175
+ clientSecret: sessionStorage.getItem('zonos--client-secret') || null,
4176
+ fetchingLandedCostAbordController: null,
4177
+ isFetchingLandedCost: false,
4178
+ isFetchingSession: false,
4179
+ stripe: null,
4180
+ stripeAddressElement: null,
4181
+ stripeAddressEventData: null,
4182
+ stripeAddressUsedWhenFetchingLC: null,
4183
+ stripeBillingAddressElement: null,
4184
+ stripeBillingAddressEventData: null,
4185
+ stripeBillingAddressUsedWhenFetchingLC: null,
4186
+ stripeElements: null,
4187
+ stripeElementsForBillingAddress: null,
4188
+ stripeElementsOptions: null,
4189
+ stripeLinkElement: null,
4190
+ stripeLinkEventData: null,
4191
+ stripeLinkUsedWhenFetchingLC: null,
4192
+ stripePaymentElement: null,
4193
+ stripePaymentEventData: null,
4194
+ stripeShippingSameAsBilling: true,
4195
+ }));
4196
+ const getStripeOptions = ({ clientSecret, overrideBorderRaidus, overridePrimaryColor, overrideSecondaryColor, overrideTheme, }) => {
4197
+ const primaryColor = overridePrimaryColor || zonosStore.appearance.colorPrimary;
4198
+ const secondaryColor = overrideSecondaryColor || zonosStore.appearance.colorSecondary;
4199
+ const themeBasedColor = primaryColor && isDarkColor(primaryColor) ? 'night' : 'flat';
4200
+ // if overrideTheme is provided, use it. Otherwise, use theme based on primary color
4201
+ const theme = overrideTheme === 'DARK' ? 'night' : 'flat';
4202
+ return {
4203
+ appearance: {
4204
+ labels: 'floating',
4205
+ rules: Object.assign({}, addressRuleStyle({ theme: 'LIGHT' })),
4206
+ // get contrast theme color base on primary color
4207
+ theme: overrideTheme ? theme : themeBasedColor,
4208
+ variables: Object.assign(Object.assign({}, defaultVariable({
4209
+ borderStyle: overrideBorderRaidus,
4210
+ theme: 'LIGHT',
4211
+ })), {
4212
+ // use the button background color for input glow color
4213
+ colorPrimary: secondaryColor }),
4214
+ },
4215
+ clientSecret,
4216
+ locale: localizationStore.selectedLocale,
4217
+ };
4218
+ };
4219
+ const initStripeElements = async (props) => {
4220
+ var _a, _b;
4221
+ const clientSecret = stripeStore.clientSecret;
4222
+ if (!stripeStore.stripe) {
4223
+ log('Skip. Stripe is not initialized');
4224
+ return;
4225
+ }
4226
+ if (clientSecret) {
4227
+ const stripeOptions = getStripeOptions({
4228
+ clientSecret,
4229
+ overrideBorderRaidus: props === null || props === void 0 ? void 0 : props.overrideBorderRaidus,
4230
+ overridePrimaryColor: props === null || props === void 0 ? void 0 : props.overridePrimaryColor,
4231
+ overrideSecondaryColor: props === null || props === void 0 ? void 0 : props.overrideSecondaryColor,
4232
+ overrideTheme: props === null || props === void 0 ? void 0 : props.overrideTheme,
4233
+ });
4234
+ // compare with the previous options to see if we need to update
4235
+ const isSameOptions = JSON.stringify(stripeOptions) ===
4236
+ JSON.stringify(stripeStore.stripeElementsOptions);
4237
+ if (!stripeStore.stripeElements ||
4238
+ !stripeStore.stripeElementsForBillingAddress) {
4239
+ // init stripe elements if it doesn't exist
4240
+ stripeStore.stripeElements = (_a = stripeStore.stripe) === null || _a === void 0 ? void 0 : _a.elements(stripeOptions);
4241
+ // save stripe elements options for later comparison
4242
+ stripeStore.stripeElementsOptions = stripeOptions;
4243
+ log('Stripe elements initialized');
4244
+ // init stripe elements for billing address
4245
+ stripeStore.stripeElementsForBillingAddress =
4246
+ (_b = stripeStore.stripe) === null || _b === void 0 ? void 0 : _b.elements(stripeOptions);
4247
+ log('Stripe elements for billing address initialized');
4248
+ return;
4249
+ }
4250
+ if (!isSameOptions) {
4251
+ // update elements with new option if it already exists
4252
+ stripeStore.stripeElements.update(stripeOptions);
4253
+ // update elements for stripe billing address
4254
+ stripeStore.stripeElementsForBillingAddress.update(stripeOptions);
4255
+ // save stripe elements options for later comparison
4256
+ stripeStore.stripeElementsOptions = stripeOptions;
4257
+ }
4258
+ log('Stripe elements initialized');
4259
+ }
4260
+ };
4261
+ const stripeStoreReset = () => {
4262
+ // clean clientSecret so that we can start the new one.
4263
+ sessionStorage.removeItem('zonos--client-secret');
4264
+ // cleanup stripe elements
4265
+ reset$1();
4266
+ // set stripe back to window.Zonos.stripe
4267
+ stripeStore.stripe = window.Zonos.stripe;
4268
+ };
4269
+ /**
4270
+ * Check if the address and email info used when fetching landed cost with the current email and address info are different
4271
+ * Purpose is to resend the request if the info used when fetching landed cost is different from the current info
4272
+ */
4273
+ const isPrefetchInfoOutdated = () => {
4274
+ var _a, _b, _c, _d, _e, _f;
4275
+ const hasAbortController = stripeStore.fetchingLandedCostAbordController;
4276
+ if (!hasAbortController) {
4277
+ // if there is no abort controller, this is a new request
4278
+ return false;
4279
+ }
4280
+ const isLinkDataDirty = JSON.stringify((_a = stripeStore.stripeLinkUsedWhenFetchingLC) === null || _a === void 0 ? void 0 : _a.value) !==
4281
+ JSON.stringify((_b = stripeStore.stripeLinkEventData) === null || _b === void 0 ? void 0 : _b.value);
4282
+ const isAddressDataDirty = JSON.stringify((_c = stripeStore.stripeAddressUsedWhenFetchingLC) === null || _c === void 0 ? void 0 : _c.value) !==
4283
+ JSON.stringify((_d = stripeStore.stripeAddressEventData) === null || _d === void 0 ? void 0 : _d.value);
4284
+ const isBillingAddressDataDirty = !stripeStore.stripeShippingSameAsBilling &&
4285
+ JSON.stringify((_e = stripeStore.stripeBillingAddressEventData) === null || _e === void 0 ? void 0 : _e.value) !==
4286
+ JSON.stringify((_f = stripeStore.stripeBillingAddressUsedWhenFetchingLC) === null || _f === void 0 ? void 0 : _f.value);
4287
+ return isLinkDataDirty || isAddressDataDirty || isBillingAddressDataDirty;
4288
+ };
4289
+ const stripeStorePrefetchLandedCost = async () => {
4290
+ var _a, _b, _c, _d, _e, _f;
4291
+ const stripeAddressReady = !!((_a = stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.complete);
4292
+ const stripeLinkReady = !!((_b = stripeStore.stripeLinkEventData) === null || _b === void 0 ? void 0 : _b.complete);
4293
+ const stripeBillingAddressReady = stripeStore.stripeShippingSameAsBilling
4294
+ ? !!((_c = stripeStore.stripeLinkEventData) === null || _c === void 0 ? void 0 : _c.complete)
4295
+ : !!((_d = stripeStore.stripeBillingAddressEventData) === null || _d === void 0 ? void 0 : _d.complete);
4296
+ const shouldRefetch = isPrefetchInfoOutdated();
4297
+ if (shouldRefetch) {
4298
+ // if the info used when fetching landed cost is different from the current info, abort the previous request
4299
+ (_e = stripeStore.fetchingLandedCostAbordController) === null || _e === void 0 ? void 0 : _e.abort();
4300
+ stripeStore.fetchingLandedCostAbordController = null;
4301
+ }
4302
+ // only fetch if we are not fetching or we need to refetch
4303
+ if (stripeAddressReady &&
4304
+ stripeLinkReady &&
4305
+ stripeBillingAddressReady &&
4306
+ (shouldRefetch || !stripeStore.isFetchingLandedCost)) {
4307
+ stripeStore.isFetchingLandedCost = true;
4308
+ if (stripeStore.stripeAddressEventData) {
4309
+ stripeStore.stripeAddressUsedWhenFetchingLC = Object.assign({}, stripeStore.stripeAddressEventData);
4310
+ }
4311
+ if (stripeStore.stripeBillingAddressEventData) {
4312
+ stripeStore.stripeBillingAddressUsedWhenFetchingLC = Object.assign({}, stripeStore.stripeBillingAddressEventData);
4313
+ }
4314
+ if (stripeStore.stripeLinkEventData) {
4315
+ stripeStore.stripeLinkUsedWhenFetchingLC = Object.assign({}, stripeStore.stripeLinkEventData);
4316
+ }
4317
+ try {
4318
+ const abortController = new AbortController();
4319
+ stripeStore.fetchingLandedCostAbordController = abortController;
4320
+ const { checkoutSessionWorkflow, shipmentRatingCalculateWorkflow } = await calculateLandedCost(abortController);
4321
+ // reset abort controller after we are done
4322
+ stripeStore.fetchingLandedCostAbordController = null;
4323
+ // update cart store with landed cost info
4324
+ cartStore.landedCostData =
4325
+ (checkoutSessionWorkflow === null || checkoutSessionWorkflow === void 0 ? void 0 : checkoutSessionWorkflow.filter(Boolean)) || null;
4326
+ cartStore.shippingData =
4327
+ (shipmentRatingCalculateWorkflow === null || shipmentRatingCalculateWorkflow === void 0 ? void 0 : shipmentRatingCalculateWorkflow.filter(Boolean)) || null;
4328
+ // apply new subtotal and total, this is mainly to show items in the presentment currency
4329
+ const firstLandedCostData = (_f = cartStore.landedCostData) === null || _f === void 0 ? void 0 : _f.find(Boolean);
4330
+ const subtotals = !!firstLandedCostData
4331
+ ? firstLandedCostData.subtotals
4332
+ : null;
4333
+ if (subtotals) {
4334
+ // prefetch landed cost will not update shipping and taxes since we haven't selected shipping method yet
4335
+ cartStoreApplySubtotals({
4336
+ exchangeRate: subtotals.exchangeRate,
4337
+ items: subtotals.items,
4338
+ landedCostTotal: 0,
4339
+ presentmentCurrencyCode: subtotals.presentmentCurrencyCode,
4340
+ shipping: 0,
4341
+ total: subtotals.items,
4342
+ });
4343
+ }
4344
+ }
4345
+ catch (err) {
4346
+ logError(err);
4347
+ }
4348
+ stripeStore.isFetchingLandedCost = false;
4349
+ }
4350
+ };
4351
+ const getStripeMessageBasedOnStatus = (status) => {
4352
+ let messages = [];
4353
+ let isError = true;
4354
+ // Inspect the PaymentIntent `status` to indicate the status of the payment
4355
+ // to your customer.
4356
+ //
4357
+ // Some payment methods will [immediately succeed or fail][0] upon
4358
+ // confirmation, while others will first enter a `processing` state.
4359
+ //
4360
+ // [0]: https://stripe.com/docs/payments/payment-methods#payment-notification
4361
+ switch (status) {
4362
+ case 'succeeded': {
4363
+ messages = [
4364
+ translate('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.'),
4365
+ '',
4366
+ '',
4367
+ translate("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."),
4368
+ ];
4369
+ isError = false;
4370
+ break;
4371
+ }
4372
+ case 'requires_capture':
4373
+ case 'processing': {
4374
+ messages = [
4375
+ translate("Payment processing. We'll update you when payment is received."),
4376
+ ];
4377
+ isError = false;
4378
+ break;
4379
+ }
4380
+ case 'requires_payment_method': {
4381
+ messages = [
4382
+ translate('Payment failed. Please try another payment method.'),
4383
+ ];
4384
+ break;
4385
+ }
4386
+ default: {
4387
+ messages = [translate('Something went wrong.')];
4388
+ break;
4389
+ }
4390
+ }
4391
+ return {
4392
+ isError,
4393
+ messages,
4394
+ };
4395
+ };
4396
+ const stripeStoreRetrievePayment = async ({ clientSecret: _clientSecret, storybookForceStatus, }) => {
4397
+ if (storybookForceStatus) {
4398
+ // return status right away if we are in storybook mode
4399
+ const { isError, messages } = getStripeMessageBasedOnStatus(storybookForceStatus);
4400
+ return { error: isError, messages };
4401
+ }
4402
+ const clientSecret = _clientSecret || stripeStore.clientSecret;
4403
+ if (!stripeStore.stripe || !clientSecret) {
4404
+ logError('Failed to retrieve payment intent. Stripe is not initialized');
4405
+ return { error: true, message: [translate('Something went wrong.')] };
4406
+ }
4407
+ const { paymentIntent } = await stripeStore.stripe.retrievePaymentIntent(clientSecret);
4408
+ const status = paymentIntent === null || paymentIntent === void 0 ? void 0 : paymentIntent.status;
4409
+ const { isError, messages } = getStripeMessageBasedOnStatus(status);
4410
+ return { error: isError, messages };
4411
+ };
4412
+ const stripeStoreConfirmPayment = async () => {
4413
+ var _a, _b, _c;
4414
+ const stripePaymentReady = !!((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.complete);
4415
+ const stripeElements = stripeStore.stripeElements;
4416
+ const stripe = stripeStore.stripe;
4417
+ const stripeClientSecret = stripeStore.clientSecret;
4418
+ if (stripe && stripeElements && stripePaymentReady && stripeClientSecret) {
4419
+ const { error } = await stripe.confirmPayment({
4420
+ confirmParams: {
4421
+ receipt_email: (_c = (_b = stripeStore.stripeLinkEventData) === null || _b === void 0 ? void 0 : _b.value) === null || _c === void 0 ? void 0 : _c.email,
4422
+ return_url: window.location.href,
4423
+ },
4424
+ elements: stripeElements,
4425
+ redirect: 'if_required',
4426
+ });
4427
+ if (error) {
4428
+ if (error.type === 'card_error' || error.type === 'validation_error') {
4429
+ throw new Error(error.message);
4430
+ }
4431
+ if (error.type === 'invalid_request_error') {
4432
+ if (error.code === 'payment_intent_unexpected_state') {
4433
+ // PaymentIntent was canceled or expired, or status is `require_capture`.
4434
+ // don't throw error here because we will reset the checkout session last step
4435
+ return;
4436
+ }
4437
+ }
4438
+ throw new Error('An unexpected error occurred.');
4439
+ }
4440
+ }
4441
+ };
4442
+ /**
4443
+ * Init checkout session
4444
+ * @returns {boolean} whether or not the checkout session is successfully created
4445
+ */
4446
+ const stripeStoreInitCheckoutSession = async () => {
4447
+ var _a;
4448
+ const total = cartStore.items.reduce((amount, item) => amount + item.amount * item.quantity, 0);
4449
+ if (!total || !localizationStore.targetCurrency) {
4450
+ logError('Fail to create checkout session - invalid total or currency');
4451
+ return false;
4452
+ }
4453
+ stripeStore.isFetchingSession = true;
4454
+ const { errors, json } = await handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/create-checkout-session`, {
4455
+ body: {
4456
+ currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
4457
+ itemsAmount: total,
4458
+ metadata: [
4459
+ { key: 'language', value: localizationStore.selectedLocale },
4460
+ ],
4461
+ presentmentCountryCode: localizationStore.selectedCountryCode || null,
4462
+ },
4463
+ method: 'POST',
4464
+ });
4465
+ stripeStore.isFetchingSession = false;
4466
+ if (errors.length || !json) {
4467
+ logError('Error occurs when creating checkout session', JSON.stringify(errors, null, 2));
4468
+ return false;
4469
+ }
4470
+ const result = json.checkoutSessionCreate;
4471
+ stripeStore.clientSecret = result.clientSecret;
4472
+ // update cart store with updated informations
4473
+ cartStore.checkoutSessionId = result.id;
4474
+ cartStoreApplySubtotals(Object.assign(Object.assign({}, result.subtotals), { landedCostTotal: 0, shipping: 0, total: result.subtotals.items }));
4475
+ log('Exchange rate updated for cart items (checkout session create)', 'info', cartStore.exchangeRate);
4476
+ log('done-init-checkout-session');
4477
+ return true;
4478
+ };
4479
+ /**
4480
+ * Update checkout session. Use for updating amount with landed cost id, or update session when cart items change
4481
+ */
4482
+ const stripeStoreUpdateCheckoutSession = async ({ currency, id, itemsAmount, landedCostId, presentmentCountryCode, }) => {
4483
+ // No need to set loading state here because this function will be called under the hood to update
4484
+ // landed cost id for the section.
4485
+ const { errors, json } = await handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/update-checkout-session`, {
4486
+ body: {
4487
+ currency,
4488
+ id,
4489
+ itemsAmount,
4490
+ landedCostId,
4491
+ presentmentCountryCode,
4492
+ },
4493
+ method: 'POST',
4494
+ });
4495
+ if (errors.length || !json) {
4496
+ logError('Error occurs when updating checkout session', JSON.stringify(errors, null, 2));
4497
+ return { errors, json };
4498
+ }
4499
+ return { errors: [], json };
4500
+ };
4501
+ onChange$1('clientSecret', clientSecret => {
4502
+ // update stripe elements when client secret changes
4503
+ if (clientSecret && stripeStore.stripe) {
4504
+ sessionStorage.setItem('zonos--client-secret', clientSecret);
4505
+ }
4506
+ if (!clientSecret) {
4507
+ sessionStorage.removeItem('zonos--client-secret');
4508
+ }
4509
+ });
4510
+
4511
+ const formatDate = ({ date, formatOptions = { day: 'numeric', weekday: 'long', year: 'numeric' }, }) => {
4512
+ // format date to Thursday 3, 2023
4513
+ return new Intl.DateTimeFormat('en-US', formatOptions).format(date);
4514
+ };
4515
+
4516
+ const getDaysDifference = (targetDate) => {
4517
+ const currentDate = new Date();
4518
+ const timeDifference = targetDate.getTime() - currentDate.getTime();
4519
+ const daysDifference = Math.floor(timeDifference / (1000 * 60 * 60 * 24)); // Convert milliseconds to days
4520
+ return daysDifference;
4521
+ };
4522
+
4523
+ const { onChange, reset, state: cartStore, } = createStore(() => ({
4524
+ checkoutSessionId: sessionStorage.getItem('zonos--checkout-session-id') || null,
4525
+ currency: 'USD',
4526
+ dutiesTaxFees: 0,
4527
+ error: null,
4528
+ exchangeRate: null,
4529
+ isSelectedShippingAboveDeminimis: false,
4530
+ isSelectedShippingGuarantee: false,
4531
+ items: [],
4532
+ landedCostData: null,
4533
+ selectedLandedCost: null,
4534
+ selectedShippingOption: null,
4535
+ selectedShippingOptionExpectedDate: '',
4536
+ selectedShippingOptionTransitTime: '',
4537
+ shipping: 0,
4538
+ shippingData: null,
4539
+ step: 'customer-info',
4540
+ subtotal: 0,
4541
+ total: 0,
4542
+ }));
4543
+ /**
4544
+ * Format shipping transit info to be displayed on UI
4545
+ * @returns
4546
+ * - expectedDate: Thursday, Aug 12
4547
+ * - maxTransit: 5
4548
+ * - minTransit: 3
4549
+ */
4550
+ const cartStoreGetShippingTransitInfo = (item) => {
4551
+ const minTransit = item.minTransitAt
4552
+ ? getDaysDifference(new Date(item.minTransitAt))
4553
+ : '';
4554
+ const maxTransit = item.maxTransitAt
4555
+ ? getDaysDifference(new Date(item.maxTransitAt))
4556
+ : '';
4557
+ const expectedDate = item.minTransitAt
4558
+ ? formatDate({
4559
+ date: new Date(item.minTransitAt),
4560
+ })
4561
+ : '';
4562
+ return {
4563
+ expectedDate,
4564
+ maxTransit,
4565
+ minTransit,
4566
+ };
4567
+ };
4568
+ const cartStoreReset = () => {
4569
+ sessionStorage.removeItem('zonos--checkout-session-id');
4570
+ // reset cart store
4571
+ reset();
4572
+ };
4573
+ const cartStoreUpdateToErrorState = ({ messages, title, }) => {
4574
+ cartStoreReset();
4575
+ stripeStoreReset();
4576
+ cartStore.step = 'error';
4577
+ cartStore.error = {
4578
+ messages,
4579
+ title,
4580
+ };
4581
+ };
4582
+ const cartStoreApplySubtotals = (subtotals) => {
4583
+ // update exchange rate so we can use it to display cart items
4584
+ cartStore.exchangeRate = subtotals.exchangeRate;
4585
+ cartStore.dutiesTaxFees = subtotals.landedCostTotal;
4586
+ cartStore.subtotal = subtotals.items;
4587
+ cartStore.total = subtotals.total;
4588
+ cartStore.currency = subtotals.presentmentCurrencyCode;
4589
+ };
4590
+ const cartStoreReCalculateTotal = async ({ currency, itemsAmount, landedCostId, }) => {
4591
+ if (landedCostId && cartStore.selectedLandedCost) {
4592
+ // update cart total right away if we have landed cost id to avoid order total flickering
4593
+ const subtotals = cartStore.selectedLandedCost.subtotals;
4594
+ cartStoreApplySubtotals(subtotals);
4595
+ log('Exchange rate updated for cart items (landed cost subtotal)', 'info', cartStore.exchangeRate);
4596
+ }
4597
+ // update checkout session
4598
+ if (!cartStore.checkoutSessionId) {
4599
+ logError('Could not update cart total without checkout session id');
4600
+ return false;
4601
+ }
4602
+ const { json } = await stripeStoreUpdateCheckoutSession({
4603
+ currency,
4604
+ id: cartStore.checkoutSessionId,
4605
+ itemsAmount,
4606
+ landedCostId,
4607
+ presentmentCountryCode: localizationStore.selectedCountryCode,
4608
+ });
4609
+ if (!json) {
4610
+ // do nothing if we can't get checkout session
4611
+ logError('Error occurs when updating checkout session');
4612
+ cartStoreUpdateToErrorState({
4613
+ messages: [
4614
+ translate("There's been an error updating your checkout session. Please reload and try again or contact support if the error persists"),
4615
+ ],
4616
+ title: translate('Error updating Checkout'),
4617
+ });
4618
+ return false;
4619
+ }
4620
+ if (!landedCostId) {
4621
+ // This is when first open the checkout modal and we just want to get info from the old cart session.
4622
+ // use subtotals from checkout session to update cart total
4623
+ cartStoreApplySubtotals(json.checkoutSessionUpdate.subtotals);
4624
+ log('Exchange rate updated for cart items (checkout session update)', 'info', cartStore.exchangeRate);
4625
+ }
4626
+ return true;
4627
+ };
4628
+ const cartStoreUpdateSelectedShippingOption = async (selectedShippingOption) => {
4629
+ var _a, _b, _c, _d, _e;
4630
+ cartStore.selectedShippingOption = selectedShippingOption;
4631
+ // update shipping transit info
4632
+ const { expectedDate, maxTransit, minTransit } = cartStoreGetShippingTransitInfo(cartStore.selectedShippingOption);
4633
+ cartStore.selectedShippingOptionExpectedDate = expectedDate;
4634
+ cartStore.selectedShippingOptionTransitTime =
4635
+ minTransit && maxTransit
4636
+ ? `${minTransit}-${maxTransit}`
4637
+ : `${minTransit || maxTransit}`;
4638
+ const selectedLandedCost = (_a = cartStore.landedCostData) === null || _a === void 0 ? void 0 : _a.find(checkoutSessionPresentment => {
4639
+ var _a, _b, _c;
4640
+ return ((_b = (_a = checkoutSessionPresentment.landedCost) === null || _a === void 0 ? void 0 : _a.shipmentRating) === null || _b === void 0 ? void 0 : _b.id) ===
4641
+ ((_c = cartStore.selectedShippingOption) === null || _c === void 0 ? void 0 : _c.id);
4642
+ });
4643
+ // save selected landed cost for later use
4644
+ cartStore.selectedLandedCost = selectedLandedCost || null;
4645
+ if (!selectedLandedCost) {
4646
+ // do nothing if we can't find landed cost for selected shipping option
4647
+ return false;
4648
+ }
4649
+ // update shipping value and dutiesTaxFees on selectedShippingOption change
4650
+ cartStore.shipping = selectedLandedCost.subtotals.shipping;
4651
+ // update deminimis status
4652
+ const isGuarantee = ((_b = selectedLandedCost === null || selectedLandedCost === void 0 ? void 0 : selectedLandedCost.landedCost) === null || _b === void 0 ? void 0 : _b.landedCostGuaranteeCode) === 'ZONOS';
4653
+ // one item in deminimis with type of duty and tax has threshold value is "ABOVE"
4654
+ const isAboveDeminimis = !!((_d = (_c = selectedLandedCost === null || selectedLandedCost === void 0 ? void 0 : selectedLandedCost.landedCost) === null || _c === void 0 ? void 0 : _c.deMinimis) === null || _d === void 0 ? void 0 : _d.find(item => ['DUTY', 'TAX'].includes(item.type) && item.threshold === 'ABOVE'));
4655
+ cartStore.isSelectedShippingAboveDeminimis = isAboveDeminimis;
4656
+ cartStore.isSelectedShippingGuarantee = isGuarantee;
4657
+ // update session with selected landed cost
4658
+ const updateCalulateStatus = await cartStoreReCalculateTotal({
4659
+ landedCostId: (_e = selectedLandedCost.landedCost) === null || _e === void 0 ? void 0 : _e.id,
4660
+ });
4661
+ return updateCalulateStatus;
4662
+ };
4663
+ onChange('checkoutSessionId', () => {
4664
+ if (!cartStore.checkoutSessionId) {
4665
+ sessionStorage.removeItem('zonos--checkout-session-id');
4666
+ return;
4667
+ }
4668
+ sessionStorage.setItem('zonos--checkout-session-id', cartStore.checkoutSessionId);
4669
+ });
4670
+ const cartStoreUpdateItems = async (items) => {
4671
+ var _a;
4672
+ cartStore.items = items;
4673
+ const currency = (_a = items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode;
4674
+ const total = items.reduce((amt, item) => {
4675
+ return amt + item.amount * item.quantity;
4676
+ }, 0);
4677
+ if (!currency || !total) {
4678
+ // do nothing if we can't get currency or total
4679
+ return;
4680
+ }
4681
+ cartStore.currency = currency;
4682
+ // set loading state here because this is first load checkout session when we already have checkout session id stored
4683
+ stripeStore.isFetchingSession = true;
4684
+ await cartStoreReCalculateTotal({
4685
+ currency: currency,
4686
+ itemsAmount: total,
4687
+ });
4688
+ stripeStore.isFetchingSession = false;
4689
+ };
4690
+ const cartStoreResetSelectedShippingOption = () => {
4691
+ cartStore.selectedShippingOption = null;
4692
+ cartStore.isSelectedShippingAboveDeminimis = false;
4693
+ cartStore.isSelectedShippingGuarantee = false;
4694
+ cartStore.selectedShippingOptionExpectedDate = '';
4695
+ cartStore.selectedShippingOptionTransitTime = '';
4696
+ cartStore.shipping = 0;
4697
+ };
4698
+ const cartStoreNextStep = () => {
4699
+ if (cartStore.step === 'customer-info') {
4700
+ cartStore.step = 'shipping';
4701
+ }
4702
+ else if (cartStore.step === 'shipping') {
4703
+ cartStore.step = 'payment';
4704
+ }
4705
+ else if (cartStore.step === 'payment') {
4706
+ cartStore.step = 'finish';
4707
+ }
4708
+ };
4709
+ const cartStorePreviousStep = () => {
4710
+ if (cartStore.step === 'payment') {
4711
+ cartStore.step = 'shipping';
4712
+ }
4713
+ else if (cartStore.step === 'shipping') {
4714
+ cartStore.step = 'customer-info';
4715
+ // reset selected shipping option
4716
+ cartStoreResetSelectedShippingOption();
4717
+ }
4718
+ };
3651
4719
 
3652
- export { localizationStore as a, logError as b, initLocalizationStore as c, localizationStoreUpdateSelectedCountryCode as d, currencyDisplay as e, currencyConvertAndFormat as f, getZCountryUrlParam as g, handleFetch as h, isValidSelector as i, currencyConvert as j, currencyFormat as k, log as l, setZCountryUrlParam as s, translate as t };
4720
+ export { stripeStoreRetrievePayment as A, cartStoreUpdateSelectedShippingOption as B, cartStoreGetShippingTransitInfo as C, localizationStoreUpdateSelectedLocale as D, log as a, cartStoreUpdateItems as b, cartStore as c, cartStoreReset as d, stripeStoreInitCheckoutSession as e, cartStoreUpdateToErrorState as f, stripeStorePrefetchLandedCost as g, cartStoreNextStep as h, initStripeElements as i, stripeStoreConfirmPayment as j, stripeStoreReset as k, localizationStore as l, cartStorePreviousStep as m, handleFetch as n, logError as o, isValidSelector as p, initLocalizationStore as q, localizationStoreUpdateSelectedCountryCode as r, stripeStore as s, translate as t, getZCountryUrlParam as u, setZCountryUrlParam as v, currencyDisplay as w, currencyConvertAndFormat as x, currencyConvert as y, currencyFormat as z };