@zonos/elements 1.3.81 → 1.3.82

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 (227) hide show
  1. package/dist/cjs/{cart-97e693e4.js → cart-ba540c8e.js} +349 -64
  2. package/dist/cjs/{createCustomEvent-777b3fa7.js → createCustomEvent-1fd24ad8.js} +1 -3
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/{paypal-16029169.js → paypal-6bbe55a7.js} +1 -1
  6. package/dist/cjs/zonos-address_8.cjs.entry.js +11 -11
  7. package/dist/cjs/zonos-badge.cjs.entry.js +44 -0
  8. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  9. package/dist/cjs/zonos-card.cjs.entry.js +4 -4
  10. package/dist/cjs/{zonos-badge_13.cjs.entry.js → zonos-cart-items_12.cjs.entry.js} +54 -69
  11. package/dist/cjs/zonos-checkout.cjs.entry.js +4 -4
  12. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  13. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  14. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  15. package/dist/cjs/zonos-country-select_4.cjs.entry.js +9 -9
  16. package/dist/cjs/zonos-elements.cjs.js +1 -1
  17. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
  18. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  19. package/dist/cjs/zonos-input.cjs.entry.js +4 -4
  20. package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -5
  21. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  22. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  23. package/dist/cjs/zonos-notification_3.cjs.entry.js +4 -4
  24. package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
  25. package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
  26. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +1 -1
  27. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.css +10 -1
  28. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +73 -1
  29. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +5 -3
  30. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -1
  31. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +8 -9
  32. package/dist/collection/components/common/zonos-badge/assets/RemoveLineIcon.svg +3 -0
  33. package/dist/collection/components/common/zonos-badge/zonos-badge.css +3 -0
  34. package/dist/collection/components/common/zonos-badge/zonos-badge.js +43 -3
  35. package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
  36. package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
  37. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
  38. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +8 -7
  39. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  40. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
  41. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +2 -2
  42. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  43. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  44. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  45. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  46. package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
  47. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  48. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
  49. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  50. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  51. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  52. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
  53. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  54. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  55. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  56. package/dist/collection/components/main/zonos-controller.js +1 -1
  57. package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
  58. package/dist/collection/components/store/checkout/cart.js +17 -1
  59. package/dist/collection/components/store/checkout/stripe.js +119 -65
  60. package/dist/collection/components/store/translationStore/strings.arabic.js +9 -0
  61. package/dist/collection/components/store/translationStore/strings.base.js +9 -0
  62. package/dist/collection/components/store/translationStore/strings.chinese.js +9 -0
  63. package/dist/collection/components/store/translationStore/strings.danish.js +9 -0
  64. package/dist/collection/components/store/translationStore/strings.dutch.js +9 -0
  65. package/dist/collection/components/store/translationStore/strings.french.js +9 -0
  66. package/dist/collection/components/store/translationStore/strings.german.js +9 -0
  67. package/dist/collection/components/store/translationStore/strings.hebrew.js +9 -0
  68. package/dist/collection/components/store/translationStore/strings.indonesian.js +9 -0
  69. package/dist/collection/components/store/translationStore/strings.italian.js +9 -0
  70. package/dist/collection/components/store/translationStore/strings.japanese.js +9 -0
  71. package/dist/collection/components/store/translationStore/strings.korean.js +9 -0
  72. package/dist/collection/components/store/translationStore/strings.norwegian.js +9 -0
  73. package/dist/collection/components/store/translationStore/strings.polish.js +9 -0
  74. package/dist/collection/components/store/translationStore/strings.portuguese.js +9 -0
  75. package/dist/collection/components/store/translationStore/strings.russian.js +9 -0
  76. package/dist/collection/components/store/translationStore/strings.spanish.js +9 -0
  77. package/dist/collection/components/store/translationStore/strings.swedish.js +9 -0
  78. package/dist/collection/components/store/translationStore/strings.turkish.js +9 -0
  79. package/dist/collection/components/store/translationStore/strings.vietnamese.js +9 -0
  80. package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
  81. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
  82. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  83. package/dist/collection/components/utils/api/prepCalculateLandedCost.js +22 -0
  84. package/dist/collection/components/utils/api/trackConversionEvent.js +0 -2
  85. package/dist/collection/components/utils/api/triggerBuildLandedCost.js +1 -0
  86. package/dist/collection/components/utils/hello/currencyConversion/currencyFormat.js +1 -1
  87. package/dist/esm/{cart-9bf6dece.js → cart-7df78f9f.js} +347 -65
  88. package/dist/esm/{createCustomEvent-a18e45a2.js → createCustomEvent-fcec608e.js} +1 -3
  89. package/dist/esm/index.js +7 -7
  90. package/dist/esm/loader.js +1 -1
  91. package/dist/esm/{paypal-edab4cee.js → paypal-a27aad03.js} +1 -1
  92. package/dist/esm/zonos-address_8.entry.js +11 -11
  93. package/dist/esm/zonos-badge.entry.js +40 -0
  94. package/dist/esm/zonos-button_3.entry.js +3 -3
  95. package/dist/esm/zonos-card.entry.js +4 -4
  96. package/dist/esm/{zonos-badge_13.entry.js → zonos-cart-items_12.entry.js} +56 -70
  97. package/dist/esm/zonos-checkout.entry.js +4 -4
  98. package/dist/esm/zonos-component.entry.js +1 -1
  99. package/dist/esm/zonos-controller.entry.js +2 -2
  100. package/dist/esm/zonos-country-flag.entry.js +1 -1
  101. package/dist/esm/zonos-country-select_4.entry.js +9 -9
  102. package/dist/esm/zonos-elements.js +1 -1
  103. package/dist/esm/zonos-hello-dialog.entry.js +5 -5
  104. package/dist/esm/zonos-hello.entry.js +1 -1
  105. package/dist/esm/zonos-input.entry.js +4 -4
  106. package/dist/esm/zonos-language-select_2.entry.js +5 -5
  107. package/dist/esm/zonos-link.entry.js +1 -1
  108. package/dist/esm/zonos-logo.entry.js +2 -2
  109. package/dist/esm/zonos-notification_3.entry.js +4 -4
  110. package/dist/esm/zonos-tooltip.entry.js +2 -2
  111. package/dist/esm/zonos-v-stack.entry.js +2 -2
  112. package/dist/esm-es5/cart-7df78f9f.js +1 -0
  113. package/dist/esm-es5/{createCustomEvent-a18e45a2.js → createCustomEvent-fcec608e.js} +1 -1
  114. package/dist/esm-es5/index.js +1 -1
  115. package/dist/esm-es5/loader.js +1 -1
  116. package/dist/esm-es5/{paypal-edab4cee.js → paypal-a27aad03.js} +1 -1
  117. package/dist/esm-es5/zonos-address_8.entry.js +1 -1
  118. package/dist/esm-es5/zonos-badge.entry.js +1 -0
  119. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  120. package/dist/esm-es5/zonos-card.entry.js +1 -1
  121. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -0
  122. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  123. package/dist/esm-es5/zonos-component.entry.js +1 -1
  124. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  125. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  126. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  127. package/dist/esm-es5/zonos-elements.js +1 -1
  128. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  129. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  130. package/dist/esm-es5/zonos-input.entry.js +1 -1
  131. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  132. package/dist/esm-es5/zonos-link.entry.js +1 -1
  133. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  134. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  135. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  136. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  137. package/dist/scripts/index.d.ts +45 -0
  138. package/dist/scripts/index.js +1 -1
  139. package/dist/scripts/loadZonos.js +1 -1
  140. package/dist/scripts/zonos.js +1 -1
  141. package/dist/types/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.d.ts +12 -0
  142. package/dist/types/components/common/zonos-badge/zonos-badge.d.ts +9 -0
  143. package/dist/types/components/store/checkout/cart.d.ts +8 -1
  144. package/dist/types/components/store/checkout/stripe.d.ts +12 -2
  145. package/dist/types/components/store/translationStore/strings.arabic.d.ts +9 -0
  146. package/dist/types/components/store/translationStore/strings.base.d.ts +9 -0
  147. package/dist/types/components/store/translationStore/strings.chinese.d.ts +9 -0
  148. package/dist/types/components/store/translationStore/strings.danish.d.ts +9 -0
  149. package/dist/types/components/store/translationStore/strings.dutch.d.ts +9 -0
  150. package/dist/types/components/store/translationStore/strings.french.d.ts +9 -0
  151. package/dist/types/components/store/translationStore/strings.german.d.ts +9 -0
  152. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +9 -0
  153. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +9 -0
  154. package/dist/types/components/store/translationStore/strings.italian.d.ts +9 -0
  155. package/dist/types/components/store/translationStore/strings.japanese.d.ts +9 -0
  156. package/dist/types/components/store/translationStore/strings.korean.d.ts +9 -0
  157. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +9 -0
  158. package/dist/types/components/store/translationStore/strings.polish.d.ts +9 -0
  159. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +9 -0
  160. package/dist/types/components/store/translationStore/strings.russian.d.ts +9 -0
  161. package/dist/types/components/store/translationStore/strings.spanish.d.ts +9 -0
  162. package/dist/types/components/store/translationStore/strings.swedish.d.ts +9 -0
  163. package/dist/types/components/store/translationStore/strings.turkish.d.ts +9 -0
  164. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +9 -0
  165. package/dist/types/components/store/translationStore.d.ts +1 -1
  166. package/dist/types/components/utils/api/triggerBuildLandedCost.d.ts +1 -0
  167. package/dist/types/components/utils/checkout/sortServiceLevelOptions.d.ts +3 -2
  168. package/dist/types/components.d.ts +34 -0
  169. package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +2 -0
  170. package/dist/types/types/generated/graphql.internal.types.d.ts +12 -0
  171. package/dist/types/types/generated/graphql.internal.types.ts +9 -0
  172. package/dist/zonos-elements/index.esm.js +1 -1
  173. package/dist/zonos-elements/{p-264fbd27.entry.js → p-112a969c.entry.js} +1 -1
  174. package/dist/zonos-elements/{p-e3cb74fd.system.js → p-15651b06.system.js} +1 -1
  175. package/dist/zonos-elements/p-1a92ff9a.system.entry.js +1 -0
  176. package/dist/zonos-elements/p-2024313c.js +1 -0
  177. package/dist/zonos-elements/{p-1e4f7997.system.entry.js → p-22e81fee.system.entry.js} +1 -1
  178. package/dist/zonos-elements/{p-8cbbdd53.system.entry.js → p-270cc182.system.entry.js} +1 -1
  179. package/dist/zonos-elements/{p-d775bd42.entry.js → p-2c5e2163.entry.js} +1 -1
  180. package/dist/zonos-elements/{p-1b8c8e0c.system.entry.js → p-2d2edb5a.system.entry.js} +1 -1
  181. package/dist/zonos-elements/p-2d2ff962.entry.js +1 -0
  182. package/dist/zonos-elements/{p-2a47d2cc.system.entry.js → p-38886017.system.entry.js} +1 -1
  183. package/dist/zonos-elements/{p-811ed9bf.system.entry.js → p-4097a25b.system.entry.js} +1 -1
  184. package/dist/zonos-elements/{p-41f42a5c.entry.js → p-42636c5a.entry.js} +1 -1
  185. package/dist/zonos-elements/{p-92ba4082.system.entry.js → p-43e2de45.system.entry.js} +1 -1
  186. package/dist/zonos-elements/{p-d26d827d.system.js → p-4683797b.system.js} +1 -1
  187. package/dist/zonos-elements/{p-8dae668f.system.entry.js → p-4e06a2bb.system.entry.js} +1 -1
  188. package/dist/zonos-elements/{p-25633055.entry.js → p-58832515.entry.js} +1 -1
  189. package/dist/zonos-elements/{p-95f0ffd1.system.entry.js → p-59806a8e.system.entry.js} +1 -1
  190. package/dist/zonos-elements/{p-19fc5e11.system.entry.js → p-5d186fc7.system.entry.js} +1 -1
  191. package/dist/zonos-elements/{p-51f8c3d5.system.entry.js → p-5d4bde9c.system.entry.js} +1 -1
  192. package/dist/zonos-elements/{p-f3fc05a8.entry.js → p-6a5d714a.entry.js} +1 -1
  193. package/dist/zonos-elements/{p-fca6f444.entry.js → p-6a83b682.entry.js} +1 -1
  194. package/dist/zonos-elements/p-85600e22.system.entry.js +1 -0
  195. package/dist/zonos-elements/{p-bc4a147d.entry.js → p-8dd38974.entry.js} +1 -1
  196. package/dist/zonos-elements/p-8fd6ae63.js +1 -0
  197. package/dist/zonos-elements/{p-49478dba.system.js → p-957b1c1b.system.js} +1 -1
  198. package/dist/zonos-elements/{p-7be7bd28.entry.js → p-997c8f07.entry.js} +1 -1
  199. package/dist/zonos-elements/{p-97f0d9d2.entry.js → p-a4cdd4f2.entry.js} +1 -1
  200. package/dist/zonos-elements/p-aa899bf7.entry.js +1 -0
  201. package/dist/zonos-elements/{p-7ca0622f.js → p-acabfc47.js} +1 -1
  202. package/dist/zonos-elements/{p-a3e2592b.system.entry.js → p-ae7526a2.system.entry.js} +1 -1
  203. package/dist/zonos-elements/{p-6de38759.entry.js → p-afad2fae.entry.js} +1 -1
  204. package/dist/zonos-elements/{p-e468f85e.entry.js → p-b09c3702.entry.js} +1 -1
  205. package/dist/zonos-elements/{p-a2fedd1c.entry.js → p-bf84416a.entry.js} +1 -1
  206. package/dist/zonos-elements/{p-a033685e.system.entry.js → p-c2b7b670.system.entry.js} +1 -1
  207. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  208. package/dist/zonos-elements/{p-fac38f60.entry.js → p-cd17565d.entry.js} +1 -1
  209. package/dist/zonos-elements/{p-a3200d5c.entry.js → p-cfd53396.entry.js} +1 -1
  210. package/dist/zonos-elements/{p-214724f8.system.entry.js → p-cffe7cc8.system.entry.js} +1 -1
  211. package/dist/zonos-elements/{p-f7b5ae86.system.entry.js → p-d48f3bd3.system.entry.js} +1 -1
  212. package/dist/zonos-elements/{p-ba05f1d6.system.entry.js → p-d621f462.system.entry.js} +1 -1
  213. package/dist/zonos-elements/{p-df4deb97.entry.js → p-df83e30b.entry.js} +1 -1
  214. package/dist/zonos-elements/p-e7eb0a92.system.js +1 -0
  215. package/dist/zonos-elements/{p-f4765417.entry.js → p-e93b511f.entry.js} +1 -1
  216. package/dist/zonos-elements/{p-747eed39.entry.js → p-ea68ee1f.entry.js} +1 -1
  217. package/dist/zonos-elements/{p-de93cc65.system.entry.js → p-f68c38d8.system.entry.js} +1 -1
  218. package/dist/zonos-elements/{p-d56f87ab.system.entry.js → p-f7bbdd0c.system.entry.js} +1 -1
  219. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  220. package/package.json +1 -1
  221. package/dist/esm-es5/cart-9bf6dece.js +0 -1
  222. package/dist/esm-es5/zonos-badge_13.entry.js +0 -1
  223. package/dist/zonos-elements/p-23358611.js +0 -1
  224. package/dist/zonos-elements/p-62044821.system.js +0 -1
  225. package/dist/zonos-elements/p-6b4fec5a.js +0 -1
  226. package/dist/zonos-elements/p-6f821997.entry.js +0 -1
  227. package/dist/zonos-elements/p-d08ed3ea.system.entry.js +0 -1
@@ -15,6 +15,9 @@ const stringsArabic = {
15
15
  'Above de minimis threshold for': {
16
16
  value: 'أعلى من الحد الأدنى لـ',
17
17
  },
18
+ 'Add promotional code': {
19
+ value: 'أضف رمز ترويجي',
20
+ },
18
21
  Address: {
19
22
  value: 'العنوان',
20
23
  },
@@ -27,6 +30,9 @@ const stringsArabic = {
27
30
  'An unexpected error occurred when processing PayPal order.': {
28
31
  value: 'حدث خطأ غير متوقع عند معالجة طلب PayPal.',
29
32
  },
33
+ Apply: {
34
+ value: 'تطبيق',
35
+ },
30
36
  'Are you sure?': {
31
37
  value: 'هل أنت متأكد؟',
32
38
  },
@@ -129,6 +135,9 @@ const stringsArabic = {
129
135
  Hide: {
130
136
  value: 'اخفِ',
131
137
  },
138
+ 'Invalid promo code': {
139
+ value: 'رمز ترويجي غير صالح',
140
+ },
132
141
  'Keep shopping': {
133
142
  value: 'متابعة التسوق',
134
143
  },
@@ -384,6 +393,9 @@ const stringsBase = {
384
393
  'Above de minimis threshold for': {
385
394
  value: 'Above de minimis threshold for',
386
395
  },
396
+ 'Add promotional code': {
397
+ value: 'Add promotional code',
398
+ },
387
399
  Address: {
388
400
  value: 'Address',
389
401
  },
@@ -396,6 +408,9 @@ const stringsBase = {
396
408
  'An unexpected error occurred when processing PayPal order.': {
397
409
  value: 'An unexpected error occurred when processing PayPal order.',
398
410
  },
411
+ Apply: {
412
+ value: 'Apply',
413
+ },
399
414
  'Are you sure?': {
400
415
  value: 'Are you sure?',
401
416
  },
@@ -498,6 +513,9 @@ const stringsBase = {
498
513
  Hide: {
499
514
  value: 'Hide',
500
515
  },
516
+ 'Invalid promo code': {
517
+ value: 'Invalid promo code',
518
+ },
501
519
  'Keep shopping': {
502
520
  value: 'Keep shopping',
503
521
  },
@@ -753,6 +771,9 @@ const stringsChinese = {
753
771
  'Above de minimis threshold for': {
754
772
  value: '超过最低征税门槛',
755
773
  },
774
+ 'Add promotional code': {
775
+ value: '添加促销代码',
776
+ },
756
777
  Address: {
757
778
  value: '地址',
758
779
  },
@@ -765,6 +786,9 @@ const stringsChinese = {
765
786
  'An unexpected error occurred when processing PayPal order.': {
766
787
  value: '处理PayPal订单时发生意外错误。',
767
788
  },
789
+ Apply: {
790
+ value: '应用',
791
+ },
768
792
  'Are you sure?': {
769
793
  value: '你确定吗?',
770
794
  },
@@ -867,6 +891,9 @@ const stringsChinese = {
867
891
  Hide: {
868
892
  value: '隐藏',
869
893
  },
894
+ 'Invalid promo code': {
895
+ value: '无效的促销代码',
896
+ },
870
897
  'Keep shopping': {
871
898
  value: '继续购物',
872
899
  },
@@ -1122,6 +1149,9 @@ const stringsDanish = {
1122
1149
  'Above de minimis threshold for': {
1123
1150
  value: 'Over de minimis-grænsen for',
1124
1151
  },
1152
+ 'Add promotional code': {
1153
+ value: 'Tilføj kampagnekode',
1154
+ },
1125
1155
  Address: {
1126
1156
  value: 'Adresse',
1127
1157
  },
@@ -1134,6 +1164,9 @@ const stringsDanish = {
1134
1164
  'An unexpected error occurred when processing PayPal order.': {
1135
1165
  value: 'Der opstod en uventet fejl ved behandling af PayPal-ordren.',
1136
1166
  },
1167
+ Apply: {
1168
+ value: 'Anvend',
1169
+ },
1137
1170
  'Are you sure?': {
1138
1171
  value: 'Er du sikker?',
1139
1172
  },
@@ -1236,6 +1269,9 @@ const stringsDanish = {
1236
1269
  Hide: {
1237
1270
  value: 'Skjul',
1238
1271
  },
1272
+ 'Invalid promo code': {
1273
+ value: 'Ugyldig kampagnekode',
1274
+ },
1239
1275
  'Keep shopping': {
1240
1276
  value: 'Fortsæt med at handle',
1241
1277
  },
@@ -1491,6 +1527,9 @@ const stringsDutch = {
1491
1527
  'Above de minimis threshold for': {
1492
1528
  value: 'Boven de minimale drempel voor',
1493
1529
  },
1530
+ 'Add promotional code': {
1531
+ value: 'Promotiecode toevoegen',
1532
+ },
1494
1533
  Address: {
1495
1534
  value: 'Adres',
1496
1535
  },
@@ -1503,6 +1542,9 @@ const stringsDutch = {
1503
1542
  'An unexpected error occurred when processing PayPal order.': {
1504
1543
  value: 'Er is een onverwachte fout opgetreden bij het verwerken van de PayPal-bestelling.',
1505
1544
  },
1545
+ Apply: {
1546
+ value: 'Toepassen',
1547
+ },
1506
1548
  'Are you sure?': {
1507
1549
  value: 'Weet je het zeker?',
1508
1550
  },
@@ -1605,6 +1647,9 @@ const stringsDutch = {
1605
1647
  Hide: {
1606
1648
  value: 'Verbergen',
1607
1649
  },
1650
+ 'Invalid promo code': {
1651
+ value: 'Ongeldige promotiecode',
1652
+ },
1608
1653
  'Keep shopping': {
1609
1654
  value: 'Blijf winkelen',
1610
1655
  },
@@ -1860,6 +1905,9 @@ const stringsFrench = {
1860
1905
  'Above de minimis threshold for': {
1861
1906
  value: 'Au-dessus du seuil de minimis pour',
1862
1907
  },
1908
+ 'Add promotional code': {
1909
+ value: 'Ajouter un code promotionnel',
1910
+ },
1863
1911
  Address: {
1864
1912
  value: 'Adresse',
1865
1913
  },
@@ -1872,6 +1920,9 @@ const stringsFrench = {
1872
1920
  'An unexpected error occurred when processing PayPal order.': {
1873
1921
  value: "Une erreur inattendue s'est produite lors du traitement de la commande PayPal.",
1874
1922
  },
1923
+ Apply: {
1924
+ value: 'Appliquer',
1925
+ },
1875
1926
  'Are you sure?': {
1876
1927
  value: 'Es-tu sûr?',
1877
1928
  },
@@ -1974,6 +2025,9 @@ const stringsFrench = {
1974
2025
  Hide: {
1975
2026
  value: 'Cacher',
1976
2027
  },
2028
+ 'Invalid promo code': {
2029
+ value: 'Code promotionnel invalide',
2030
+ },
1977
2031
  'Keep shopping': {
1978
2032
  value: 'Continuer à faire du shopping',
1979
2033
  },
@@ -2229,6 +2283,9 @@ const stringsGerman = {
2229
2283
  'Above de minimis threshold for': {
2230
2284
  value: 'Über der Mindestgrenze für',
2231
2285
  },
2286
+ 'Add promotional code': {
2287
+ value: 'Promo-Code hinzufügen',
2288
+ },
2232
2289
  Address: {
2233
2290
  value: 'Adresse',
2234
2291
  },
@@ -2241,6 +2298,9 @@ const stringsGerman = {
2241
2298
  'An unexpected error occurred when processing PayPal order.': {
2242
2299
  value: 'Beim Verarbeiten der PayPal-Bestellung ist ein unerwarteter Fehler aufgetreten.',
2243
2300
  },
2301
+ Apply: {
2302
+ value: 'Anwenden',
2303
+ },
2244
2304
  'Are you sure?': {
2245
2305
  value: 'Bist du sicher?',
2246
2306
  },
@@ -2343,6 +2403,9 @@ const stringsGerman = {
2343
2403
  Hide: {
2344
2404
  value: 'Verstecken',
2345
2405
  },
2406
+ 'Invalid promo code': {
2407
+ value: 'Ungültiger Promo-Code',
2408
+ },
2346
2409
  'Keep shopping': {
2347
2410
  value: 'Einkauf fortsetzen',
2348
2411
  },
@@ -2598,6 +2661,9 @@ const stringsHebrew = {
2598
2661
  'Above de minimis threshold for': {
2599
2662
  value: 'מעל סף המינימום עבור',
2600
2663
  },
2664
+ 'Add promotional code': {
2665
+ value: 'הוסף קוד מבצע',
2666
+ },
2601
2667
  Address: {
2602
2668
  value: 'כתובת',
2603
2669
  },
@@ -2610,6 +2676,9 @@ const stringsHebrew = {
2610
2676
  'An unexpected error occurred when processing PayPal order.': {
2611
2677
  value: 'אירעה שגיאה בלתי צפויה בעת עיבוד הזמנת PayPal.',
2612
2678
  },
2679
+ Apply: {
2680
+ value: 'החל',
2681
+ },
2613
2682
  'Are you sure?': {
2614
2683
  value: 'אתה בטוח?',
2615
2684
  },
@@ -2712,6 +2781,9 @@ const stringsHebrew = {
2712
2781
  Hide: {
2713
2782
  value: 'הסתר',
2714
2783
  },
2784
+ 'Invalid promo code': {
2785
+ value: 'קוד מבצע לא תקף',
2786
+ },
2715
2787
  'Keep shopping': {
2716
2788
  value: 'המשך בקנייה',
2717
2789
  },
@@ -2967,6 +3039,9 @@ const stringsIndonesian = {
2967
3039
  'Above de minimis threshold for': {
2968
3040
  value: 'Di atas ambang batas de minimis untuk',
2969
3041
  },
3042
+ 'Add promotional code': {
3043
+ value: 'Tambahkan kode promosi',
3044
+ },
2970
3045
  Address: {
2971
3046
  value: 'Alamat',
2972
3047
  },
@@ -2979,6 +3054,9 @@ const stringsIndonesian = {
2979
3054
  'An unexpected error occurred when processing PayPal order.': {
2980
3055
  value: 'Terjadi kesalahan tak terduga saat memproses pesanan PayPal.',
2981
3056
  },
3057
+ Apply: {
3058
+ value: 'Terapkan',
3059
+ },
2982
3060
  'Are you sure?': {
2983
3061
  value: 'Apakah Anda yakin?',
2984
3062
  },
@@ -3081,6 +3159,9 @@ const stringsIndonesian = {
3081
3159
  Hide: {
3082
3160
  value: 'Sembunyikan',
3083
3161
  },
3162
+ 'Invalid promo code': {
3163
+ value: 'Kode promo tidak valid',
3164
+ },
3084
3165
  'Keep shopping': {
3085
3166
  value: 'Lanjut belanja',
3086
3167
  },
@@ -3336,6 +3417,9 @@ const stringsItalian = {
3336
3417
  'Above de minimis threshold for': {
3337
3418
  value: 'Sopra la soglia di minimis per',
3338
3419
  },
3420
+ 'Add promotional code': {
3421
+ value: 'Aggiungi codice promozionale',
3422
+ },
3339
3423
  Address: {
3340
3424
  value: 'Indirizzo',
3341
3425
  },
@@ -3348,6 +3432,9 @@ const stringsItalian = {
3348
3432
  'An unexpected error occurred when processing PayPal order.': {
3349
3433
  value: "Si è verificato un errore imprevisto durante l'elaborazione dell'ordine PayPal.",
3350
3434
  },
3435
+ Apply: {
3436
+ value: 'Applica',
3437
+ },
3351
3438
  'Are you sure?': {
3352
3439
  value: 'Sei sicuro?',
3353
3440
  },
@@ -3450,6 +3537,9 @@ const stringsItalian = {
3450
3537
  Hide: {
3451
3538
  value: 'Nascondi',
3452
3539
  },
3540
+ 'Invalid promo code': {
3541
+ value: 'Codice promozionale non valido',
3542
+ },
3453
3543
  'Keep shopping': {
3454
3544
  value: 'Continua gli acquisti',
3455
3545
  },
@@ -3705,6 +3795,9 @@ const stringsJapanese = {
3705
3795
  'Above de minimis threshold for': {
3706
3796
  value: 'デミニマスの閾値を超える',
3707
3797
  },
3798
+ 'Add promotional code': {
3799
+ value: 'プロモーションコードを追加',
3800
+ },
3708
3801
  Address: {
3709
3802
  value: '住所',
3710
3803
  },
@@ -3717,6 +3810,9 @@ const stringsJapanese = {
3717
3810
  'An unexpected error occurred when processing PayPal order.': {
3718
3811
  value: 'PayPal注文の処理中に予期しないエラーが発生しました。',
3719
3812
  },
3813
+ Apply: {
3814
+ value: '適用',
3815
+ },
3720
3816
  'Are you sure?': {
3721
3817
  value: '本気ですか?',
3722
3818
  },
@@ -3819,6 +3915,9 @@ const stringsJapanese = {
3819
3915
  Hide: {
3820
3916
  value: '隠す',
3821
3917
  },
3918
+ 'Invalid promo code': {
3919
+ value: '無効なプロモーションコード',
3920
+ },
3822
3921
  'Keep shopping': {
3823
3922
  value: '買い物を続ける',
3824
3923
  },
@@ -4074,6 +4173,9 @@ const stringsKorean = {
4074
4173
  'Above de minimis threshold for': {
4075
4174
  value: '최소 임계값을 초과하여',
4076
4175
  },
4176
+ 'Add promotional code': {
4177
+ value: '프로모션 코드 추가',
4178
+ },
4077
4179
  Address: {
4078
4180
  value: '주소',
4079
4181
  },
@@ -4086,6 +4188,9 @@ const stringsKorean = {
4086
4188
  'An unexpected error occurred when processing PayPal order.': {
4087
4189
  value: 'PayPal 주문을 처리하는 중에 예기치 않은 오류가 발생했습니다.',
4088
4190
  },
4191
+ Apply: {
4192
+ value: '적용',
4193
+ },
4089
4194
  'Are you sure?': {
4090
4195
  value: '확실합니까?',
4091
4196
  },
@@ -4188,6 +4293,9 @@ const stringsKorean = {
4188
4293
  Hide: {
4189
4294
  value: '숨기다',
4190
4295
  },
4296
+ 'Invalid promo code': {
4297
+ value: '유효하지 않은 프로모션 코드',
4298
+ },
4191
4299
  'Keep shopping': {
4192
4300
  value: '쇼핑 계속하기',
4193
4301
  },
@@ -4443,6 +4551,9 @@ const stringsNorwegian = {
4443
4551
  'Above de minimis threshold for': {
4444
4552
  value: 'Over minstegrensen for',
4445
4553
  },
4554
+ 'Add promotional code': {
4555
+ value: 'Legg til kampanjekode',
4556
+ },
4446
4557
  Address: {
4447
4558
  value: 'Adresse',
4448
4559
  },
@@ -4455,6 +4566,9 @@ const stringsNorwegian = {
4455
4566
  'An unexpected error occurred when processing PayPal order.': {
4456
4567
  value: 'En uventet feil oppstod ved behandling av PayPal-bestillingen.',
4457
4568
  },
4569
+ Apply: {
4570
+ value: 'Bruk',
4571
+ },
4458
4572
  'Are you sure?': {
4459
4573
  value: 'Er du sikker?',
4460
4574
  },
@@ -4557,6 +4671,9 @@ const stringsNorwegian = {
4557
4671
  Hide: {
4558
4672
  value: 'Gjem',
4559
4673
  },
4674
+ 'Invalid promo code': {
4675
+ value: 'Ugyldig kampanjekode',
4676
+ },
4560
4677
  'Keep shopping': {
4561
4678
  value: 'Fortsett å handle',
4562
4679
  },
@@ -4812,6 +4929,9 @@ const stringsPolish = {
4812
4929
  'Above de minimis threshold for': {
4813
4930
  value: 'Powyżej progu minimis dla',
4814
4931
  },
4932
+ 'Add promotional code': {
4933
+ value: 'Dodaj kod promocyjny',
4934
+ },
4815
4935
  Address: {
4816
4936
  value: 'Adres',
4817
4937
  },
@@ -4824,6 +4944,9 @@ const stringsPolish = {
4824
4944
  'An unexpected error occurred when processing PayPal order.': {
4825
4945
  value: 'Wystąpił nieoczekiwany błąd podczas przetwarzania zamówienia PayPal.',
4826
4946
  },
4947
+ Apply: {
4948
+ value: 'Zastosuj',
4949
+ },
4827
4950
  'Are you sure?': {
4828
4951
  value: 'Jesteś pewien?',
4829
4952
  },
@@ -4926,6 +5049,9 @@ const stringsPolish = {
4926
5049
  Hide: {
4927
5050
  value: 'Ukryj',
4928
5051
  },
5052
+ 'Invalid promo code': {
5053
+ value: 'Nieprawidłowy kod promocyjny',
5054
+ },
4929
5055
  'Keep shopping': {
4930
5056
  value: 'Kontynuuj zakupy',
4931
5057
  },
@@ -5181,6 +5307,9 @@ const stringsPortuguese = {
5181
5307
  'Above de minimis threshold for': {
5182
5308
  value: 'Acima do limite de isenção para',
5183
5309
  },
5310
+ 'Add promotional code': {
5311
+ value: 'Adicionar código promocional',
5312
+ },
5184
5313
  Address: {
5185
5314
  value: 'Endereço',
5186
5315
  },
@@ -5193,6 +5322,9 @@ const stringsPortuguese = {
5193
5322
  'An unexpected error occurred when processing PayPal order.': {
5194
5323
  value: 'Ocorreu um erro inesperado ao processar o pedido do PayPal.',
5195
5324
  },
5325
+ Apply: {
5326
+ value: 'Aplicar',
5327
+ },
5196
5328
  'Are you sure?': {
5197
5329
  value: 'Você tem certeza?',
5198
5330
  },
@@ -5295,6 +5427,9 @@ const stringsPortuguese = {
5295
5427
  Hide: {
5296
5428
  value: 'Esconder',
5297
5429
  },
5430
+ 'Invalid promo code': {
5431
+ value: 'Código promocional inválido',
5432
+ },
5298
5433
  'Keep shopping': {
5299
5434
  value: 'Continuar comprando',
5300
5435
  },
@@ -5550,6 +5685,9 @@ const stringsRussian = {
5550
5685
  'Above de minimis threshold for': {
5551
5686
  value: 'Выше минимального порога для',
5552
5687
  },
5688
+ 'Add promotional code': {
5689
+ value: 'Добавить промокод',
5690
+ },
5553
5691
  Address: {
5554
5692
  value: 'Адрес',
5555
5693
  },
@@ -5562,6 +5700,9 @@ const stringsRussian = {
5562
5700
  'An unexpected error occurred when processing PayPal order.': {
5563
5701
  value: 'Произошла непредвиденная ошибка при обработке заказа PayPal.',
5564
5702
  },
5703
+ Apply: {
5704
+ value: 'Применить',
5705
+ },
5565
5706
  'Are you sure?': {
5566
5707
  value: 'Вы уверены?',
5567
5708
  },
@@ -5664,6 +5805,9 @@ const stringsRussian = {
5664
5805
  Hide: {
5665
5806
  value: 'Скрыть',
5666
5807
  },
5808
+ 'Invalid promo code': {
5809
+ value: 'Недействительный промокод',
5810
+ },
5667
5811
  'Keep shopping': {
5668
5812
  value: 'Продолжить покупки',
5669
5813
  },
@@ -5919,6 +6063,9 @@ const stringsSpanish = {
5919
6063
  'Above de minimis threshold for': {
5920
6064
  value: 'Por encima del umbral mínimo para',
5921
6065
  },
6066
+ 'Add promotional code': {
6067
+ value: 'Agregar código promocional',
6068
+ },
5922
6069
  Address: {
5923
6070
  value: 'Dirección',
5924
6071
  },
@@ -5931,6 +6078,9 @@ const stringsSpanish = {
5931
6078
  'An unexpected error occurred when processing PayPal order.': {
5932
6079
  value: 'Se produjo un error inesperado al procesar el pedido de PayPal.',
5933
6080
  },
6081
+ Apply: {
6082
+ value: 'Aplicar',
6083
+ },
5934
6084
  'Are you sure?': {
5935
6085
  value: '¿Estás seguro?',
5936
6086
  },
@@ -6033,6 +6183,9 @@ const stringsSpanish = {
6033
6183
  Hide: {
6034
6184
  value: 'Ocultar',
6035
6185
  },
6186
+ 'Invalid promo code': {
6187
+ value: 'Código promocional no válido',
6188
+ },
6036
6189
  'Keep shopping': {
6037
6190
  value: 'Seguir comprando',
6038
6191
  },
@@ -6288,6 +6441,9 @@ const stringsSwedish = {
6288
6441
  'Above de minimis threshold for': {
6289
6442
  value: 'Över minimibeloppet för',
6290
6443
  },
6444
+ 'Add promotional code': {
6445
+ value: 'Lägg till kampanjkod',
6446
+ },
6291
6447
  Address: {
6292
6448
  value: 'Adress',
6293
6449
  },
@@ -6300,6 +6456,9 @@ const stringsSwedish = {
6300
6456
  'An unexpected error occurred when processing PayPal order.': {
6301
6457
  value: 'Ett oväntat fel inträffade vid bearbetning av PayPal-beställningen.',
6302
6458
  },
6459
+ Apply: {
6460
+ value: 'Tillämpa',
6461
+ },
6303
6462
  'Are you sure?': {
6304
6463
  value: 'Är du säker?',
6305
6464
  },
@@ -6402,6 +6561,9 @@ const stringsSwedish = {
6402
6561
  Hide: {
6403
6562
  value: 'Dölj',
6404
6563
  },
6564
+ 'Invalid promo code': {
6565
+ value: 'Ogiltig kampanjkod',
6566
+ },
6405
6567
  'Keep shopping': {
6406
6568
  value: 'Fortsätt handla',
6407
6569
  },
@@ -6657,6 +6819,9 @@ const stringsTurkish = {
6657
6819
  'Above de minimis threshold for': {
6658
6820
  value: 'Minimum sınırın üzerinde',
6659
6821
  },
6822
+ 'Add promotional code': {
6823
+ value: 'Promosyon kodu ekle',
6824
+ },
6660
6825
  Address: {
6661
6826
  value: 'Adres',
6662
6827
  },
@@ -6669,6 +6834,9 @@ const stringsTurkish = {
6669
6834
  'An unexpected error occurred when processing PayPal order.': {
6670
6835
  value: 'PayPal siparişi işlenirken beklenmedik bir hata oluştu.',
6671
6836
  },
6837
+ Apply: {
6838
+ value: 'Uygula',
6839
+ },
6672
6840
  'Are you sure?': {
6673
6841
  value: 'Emin misiniz?',
6674
6842
  },
@@ -6771,6 +6939,9 @@ const stringsTurkish = {
6771
6939
  Hide: {
6772
6940
  value: 'Sakla',
6773
6941
  },
6942
+ 'Invalid promo code': {
6943
+ value: 'Geçersiz promosyon kodu',
6944
+ },
6774
6945
  'Keep shopping': {
6775
6946
  value: 'Alışverişe devam et',
6776
6947
  },
@@ -7026,6 +7197,9 @@ const stringsVietnamese = {
7026
7197
  'Above de minimis threshold for': {
7027
7198
  value: 'Vượt ngưỡng miễn thuế đối với',
7028
7199
  },
7200
+ 'Add promotional code': {
7201
+ value: 'Thêm mã khuyến mãi',
7202
+ },
7029
7203
  Address: {
7030
7204
  value: 'Địa chỉ',
7031
7205
  },
@@ -7038,6 +7212,9 @@ const stringsVietnamese = {
7038
7212
  'An unexpected error occurred when processing PayPal order.': {
7039
7213
  value: 'Đã xảy ra lỗi bất ngờ khi xử lý đơn hàng PayPal.',
7040
7214
  },
7215
+ Apply: {
7216
+ value: 'Áp dụng',
7217
+ },
7041
7218
  'Are you sure?': {
7042
7219
  value: 'Bạn có chắc không?',
7043
7220
  },
@@ -7140,6 +7317,9 @@ const stringsVietnamese = {
7140
7317
  Hide: {
7141
7318
  value: 'Ẩn',
7142
7319
  },
7320
+ 'Invalid promo code': {
7321
+ value: 'Mã khuyến mãi không hợp lệ',
7322
+ },
7143
7323
  'Keep shopping': {
7144
7324
  value: 'Tiếp tục mua sắm',
7145
7325
  },
@@ -7675,7 +7855,7 @@ const currencyFormat = ({ amount, currency, }) => {
7675
7855
  const { targetFormat } = exchangeRate || {};
7676
7856
  if (!targetFormat || !exchangeRate) {
7677
7857
  // Return the amount as a string if no exchange rate is available
7678
- return `${amount.toString()} ${targetCurrency}`;
7858
+ return `${amount.toFixed(2)} ${targetCurrency}`;
7679
7859
  }
7680
7860
  const minimumFractionDigits = targetFormat.scale || 2;
7681
7861
  const isIE = window.navigator.userAgent.indexOf('MSIE ') !== -1;
@@ -8156,6 +8336,17 @@ const prepCartCalculateLandedCost = (cartId) => {
8156
8336
  lastName: shippingLastName,
8157
8337
  phone: translatedShippingAddress.phone,
8158
8338
  },
8339
+ landedCostAdjustments: cartStore.promoCode
8340
+ ? [
8341
+ {
8342
+ amount: 0,
8343
+ productId: null,
8344
+ promoCode: cartStore.promoCode,
8345
+ sku: null,
8346
+ type: 'PROMO_CODE',
8347
+ },
8348
+ ]
8349
+ : [],
8159
8350
  shippingAddress: {
8160
8351
  addressLine1: translatedShippingAddress.line1,
8161
8352
  addressLine2: translatedShippingAddress.line2,
@@ -8215,6 +8406,17 @@ const prepCalculateLandedCost = () => {
8215
8406
  phone: translatedShippingAddress.phone,
8216
8407
  },
8217
8408
  items: cartStore.items,
8409
+ landedCostAdjustments: cartStore.promoCode
8410
+ ? [
8411
+ {
8412
+ amount: 0,
8413
+ productId: null,
8414
+ promoCode: cartStore.promoCode,
8415
+ sku: null,
8416
+ type: 'PROMO_CODE',
8417
+ },
8418
+ ]
8419
+ : [],
8218
8420
  shippingAddress: {
8219
8421
  addressLine1: translatedShippingAddress.line1,
8220
8422
  addressLine2: translatedShippingAddress.line2,
@@ -8234,6 +8436,7 @@ const triggerBuildLandedCost = async (buildLandedCost) => {
8234
8436
  billingContact: data.billingContact,
8235
8437
  checkoutSessionId: data.checkoutSessionId,
8236
8438
  contact: data.contact,
8439
+ landedCostAdjustments: data.landedCostAdjustments,
8237
8440
  shippingAddress: data.shippingAddress,
8238
8441
  zonosApiRoute: handleFetch.fallbackApiList['vercel'],
8239
8442
  });
@@ -8429,6 +8632,16 @@ const buildTranslateRequest = ({ addressInvalidCharactersList, billingAddressInv
8429
8632
  };
8430
8633
  };
8431
8634
 
8635
+ /**
8636
+ * Sorts service levels with lower cost first
8637
+ */
8638
+ const sortServiceLevelOptions = (serviceLevels) => {
8639
+ const sortedServiceLevels = serviceLevels.sort((a, b) => {
8640
+ return a.amount - b.amount;
8641
+ });
8642
+ return sortedServiceLevels;
8643
+ };
8644
+
8432
8645
  const addressRuleStyle = ({ theme, }) => {
8433
8646
  const defaultStyle = {
8434
8647
  '.AccordionItem': {
@@ -8637,8 +8850,42 @@ const isPrefetchInfoOutdated = () => {
8637
8850
  // if landed cost data is not available, we need to fetch it
8638
8851
  !cartStore.landedCostData || isAddressOutdated || isTotalAmountChanged);
8639
8852
  };
8640
- const stripeStorePrefetchLandedCost = async () => {
8641
- var _a, _b, _c, _d, _e, _f;
8853
+ const stripeCalculateLandedCost = async () => {
8854
+ const abortController = new AbortController();
8855
+ stripeStore.fetchingLandedCostAbortController = abortController;
8856
+ // Reset cart items to non-restricted state and restricted item list
8857
+ cartStoreResetCartItems();
8858
+ const { checkoutSessionWorkflow, itemCreateWorkflow, landedCostCalculateWorkflow, shipmentRatingCalculateWorkflow, } = await calculateLandedCostNormalized(abortController);
8859
+ cartStore.shippingData = sortServiceLevelOptions((shipmentRatingCalculateWorkflow === null || shipmentRatingCalculateWorkflow === void 0 ? void 0 : shipmentRatingCalculateWorkflow.filter(Boolean)) || []);
8860
+ // check and update cart items with restrictions
8861
+ cartStoreCheckItemRestrictions(itemCreateWorkflow);
8862
+ // reset abort controller after we are done
8863
+ stripeStore.fetchingLandedCostAbortController = null;
8864
+ // update cart store with landed cost info
8865
+ cartStore.landedCostData =
8866
+ (checkoutSessionWorkflow === null || checkoutSessionWorkflow === void 0 ? void 0 : checkoutSessionWorkflow.map(checkoutSession => {
8867
+ const foundLandedCost = landedCostCalculateWorkflow === null || landedCostCalculateWorkflow === void 0 ? void 0 : landedCostCalculateWorkflow.find(item => (item === null || item === void 0 ? void 0 : item.id) === checkoutSession.landedCostId);
8868
+ if (!foundLandedCost) {
8869
+ return null;
8870
+ }
8871
+ return Object.assign(Object.assign({}, checkoutSession), { landedCost: foundLandedCost });
8872
+ }).filter(Boolean)) || [];
8873
+ // update adjustmentTotal
8874
+ // highlight promocode input error if promocode is applied but no adjustment applied in landed cost
8875
+ const isInvalidPromoCode = cartStore.promoCodeApplied &&
8876
+ !cartStore.landedCostData.find(item => {
8877
+ var _a;
8878
+ return (_a = item.landedCost.appliedAdjustments) === null || _a === void 0 ? void 0 : _a.find(_item => _item.type === 'PROMO_CODE');
8879
+ });
8880
+ cartStore.promoCodeError = isInvalidPromoCode;
8881
+ // When promocode is valid, set promoCode to session storage so if user close the modal, we can still reapply for them
8882
+ if (!isInvalidPromoCode) {
8883
+ sessionStorage.setItem('promoCode', cartStore.promoCode);
8884
+ }
8885
+ };
8886
+ const stripeStorePrefetchLandedCost = async (params) => {
8887
+ var _a, _b, _c, _d, _e, _f, _g;
8888
+ const applyingPromocode = !!(params === null || params === void 0 ? void 0 : params.applyingPromocode);
8642
8889
  const stripeAddressReady = !!((_a = stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.complete);
8643
8890
  const stripeLinkReady = !!((_b = stripeStore.stripeLinkEventData) === null || _b === void 0 ? void 0 : _b.complete);
8644
8891
  const stripeBillingAddressReady = stripeStore.stripeShippingSameAsBilling
@@ -8650,68 +8897,87 @@ const stripeStorePrefetchLandedCost = async () => {
8650
8897
  (_e = stripeStore.fetchingLandedCostAbortController) === null || _e === void 0 ? void 0 : _e.abort();
8651
8898
  stripeStore.fetchingLandedCostAbortController = null;
8652
8899
  }
8653
- // only fetch if we are not fetching or we need to refetch
8654
- if (stripeAddressReady &&
8655
- stripeLinkReady &&
8656
- stripeBillingAddressReady &&
8657
- shouldRefetch) {
8658
- stripeStore.isFetchingLandedCost = true;
8659
- if (stripeStore.stripeAddressEventData) {
8660
- stripeStore.stripeAddressUsedWhenFetchingLC = Object.assign({}, stripeStore.stripeAddressEventData);
8661
- }
8662
- if (stripeStore.stripeBillingAddressEventData) {
8663
- stripeStore.stripeBillingAddressUsedWhenFetchingLC = Object.assign({}, stripeStore.stripeBillingAddressEventData);
8664
- }
8665
- if (stripeStore.stripeLinkEventData) {
8666
- stripeStore.stripeLinkUsedWhenFetchingLC = Object.assign({}, stripeStore.stripeLinkEventData);
8667
- }
8668
- try {
8669
- const abortController = new AbortController();
8670
- stripeStore.fetchingLandedCostAbortController = abortController;
8671
- // Reset cart items to non-restricted state and restricted item list
8672
- cartStoreResetCartItems();
8673
- const { checkoutSessionWorkflow, itemCreateWorkflow, landedCostCalculateWorkflow, shipmentRatingCalculateWorkflow, } = await calculateLandedCostNormalized(abortController);
8674
- // reset abort controller after we are done
8675
- stripeStore.fetchingLandedCostAbortController = null;
8676
- // update cart store with landed cost info
8677
- cartStore.landedCostData =
8678
- (checkoutSessionWorkflow === null || checkoutSessionWorkflow === void 0 ? void 0 : checkoutSessionWorkflow.map(checkoutSession => {
8679
- const foundLandedCost = landedCostCalculateWorkflow === null || landedCostCalculateWorkflow === void 0 ? void 0 : landedCostCalculateWorkflow.find(item => (item === null || item === void 0 ? void 0 : item.id) === checkoutSession.landedCostId);
8680
- if (!foundLandedCost) {
8681
- return null;
8682
- }
8683
- return Object.assign(Object.assign({}, checkoutSession), { landedCost: foundLandedCost });
8684
- }).filter(Boolean)) || [];
8685
- cartStore.shippingData =
8686
- (shipmentRatingCalculateWorkflow === null || shipmentRatingCalculateWorkflow === void 0 ? void 0 : shipmentRatingCalculateWorkflow.filter(Boolean)) || [];
8687
- // apply new subtotal and total, this is mainly to show items in the presentment currency
8688
- const firstLandedCostData = (_f = cartStore.landedCostData) === null || _f === void 0 ? void 0 : _f.find(Boolean);
8689
- const subtotals = !!firstLandedCostData
8690
- ? firstLandedCostData.subtotals
8691
- : null;
8692
- // check and update cart items with restrictions
8693
- cartStoreCheckItemRestrictions(itemCreateWorkflow);
8694
- if (subtotals) {
8695
- // prefetch landed cost will not update shipping and taxes since we haven't selected shipping method yet
8696
- cartStoreApplySubtotals({
8697
- adjustments: subtotals.adjustments,
8698
- exchangeRate: subtotals.exchangeRate,
8699
- items: subtotals.items,
8700
- landedCostTotal: 0,
8701
- presentmentCurrencyCode: subtotals.presentmentCurrencyCode,
8702
- shipping: 0,
8703
- total: subtotals.items,
8704
- });
8705
- }
8706
- }
8707
- catch (err) {
8708
- // default to empty array if we failed to fetch landed cost, so we can show the error message
8709
- cartStore.landedCostData = [];
8710
- cartStore.shippingData = [];
8711
- handleFetch.logError(err);
8900
+ // Do not fetch if we are not ready or data is not outdated
8901
+ if ((!shouldRefetch && !applyingPromocode) ||
8902
+ !stripeAddressReady ||
8903
+ !stripeLinkReady ||
8904
+ !stripeBillingAddressReady) {
8905
+ return;
8906
+ }
8907
+ stripeStore.isFetchingLandedCost = true;
8908
+ if (stripeStore.stripeAddressEventData) {
8909
+ stripeStore.stripeAddressUsedWhenFetchingLC = Object.assign({}, stripeStore.stripeAddressEventData);
8910
+ }
8911
+ if (stripeStore.stripeBillingAddressEventData) {
8912
+ stripeStore.stripeBillingAddressUsedWhenFetchingLC = Object.assign({}, stripeStore.stripeBillingAddressEventData);
8913
+ }
8914
+ if (stripeStore.stripeLinkEventData) {
8915
+ stripeStore.stripeLinkUsedWhenFetchingLC = Object.assign({}, stripeStore.stripeLinkEventData);
8916
+ }
8917
+ try {
8918
+ // Reset cart items to non-restricted state and restricted item list
8919
+ cartStoreResetCartItems();
8920
+ // fetch and apply landed cost
8921
+ await stripeCalculateLandedCost();
8922
+ // This is the cheapest service level since we already sorted them after fetching landed cost
8923
+ const cheapestServiceLevel = (_f = cartStore.shippingData) === null || _f === void 0 ? void 0 : _f.find(Boolean);
8924
+ // Landed cost that matches with service level
8925
+ const matchLandedCost = (_g = cartStore.landedCostData) === null || _g === void 0 ? void 0 : _g.find(x => x.landedCost.shipmentRating.id === (cheapestServiceLevel === null || cheapestServiceLevel === void 0 ? void 0 : cheapestServiceLevel.id));
8926
+ // apply new subtotal and total, this is mainly to show items in the presentment currency
8927
+ const subtotals = !!matchLandedCost ? matchLandedCost.subtotals : null;
8928
+ if (subtotals) {
8929
+ // prefetch landed cost will not update shipping and taxes since we haven't selected shipping method yet
8930
+ cartStoreApplySubtotals({
8931
+ adjustments: subtotals.adjustments,
8932
+ exchangeRate: subtotals.exchangeRate,
8933
+ items: subtotals.items,
8934
+ landedCostTotal: subtotals.landedCostTotal,
8935
+ presentmentCurrencyCode: subtotals.presentmentCurrencyCode,
8936
+ shipping: subtotals.shipping,
8937
+ total: subtotals.total,
8938
+ });
8712
8939
  }
8713
- stripeStore.isFetchingLandedCost = false;
8714
8940
  }
8941
+ catch (err) {
8942
+ // default to empty array if we failed to fetch landed cost, so we can show the error message
8943
+ cartStore.landedCostData = [];
8944
+ cartStore.shippingData = [];
8945
+ handleFetch.logError(err);
8946
+ }
8947
+ stripeStore.isFetchingLandedCost = false;
8948
+ };
8949
+ const stripeStoreApplyPromoCode = async () => {
8950
+ var _a, _b;
8951
+ await stripeStorePrefetchLandedCost({
8952
+ applyingPromocode: true,
8953
+ });
8954
+ // Go back to shipping step if we are in payment step so user can reselect shipping method
8955
+ if (cartStore.step === 'payment') {
8956
+ cartStorePreviousStep();
8957
+ }
8958
+ // This is the cheapest service level since we already sorted them after fetching landed cost
8959
+ const cheapestServiceLevel = (_a = cartStore.shippingData) === null || _a === void 0 ? void 0 : _a.find(Boolean);
8960
+ // Landed cost that matches with service level
8961
+ const matchLandedCost = (_b = cartStore.landedCostData) === null || _b === void 0 ? void 0 : _b.find(x => x.landedCost.id === (cheapestServiceLevel === null || cheapestServiceLevel === void 0 ? void 0 : cheapestServiceLevel.id));
8962
+ if (!cheapestServiceLevel || !matchLandedCost) {
8963
+ return;
8964
+ }
8965
+ await cartStoreUpdateSelectedShippingOption(cheapestServiceLevel, matchLandedCost.landedCostId);
8966
+ };
8967
+ const stripeStoreResetPromoCode = () => {
8968
+ cartStore.promoCode = '';
8969
+ sessionStorage.removeItem('promoCode');
8970
+ // reset promocode error state
8971
+ cartStore.promoCodeError = false;
8972
+ cartStore.promoCodeApplied = false;
8973
+ };
8974
+ const stripeStoreRemovePromoCode = async () => {
8975
+ // Go back to shipping step if we are in payment step so user can reselect shipping method
8976
+ if (cartStore.step === 'payment') {
8977
+ cartStorePreviousStep();
8978
+ }
8979
+ stripeStoreResetPromoCode();
8980
+ await stripeStoreApplyPromoCode();
8715
8981
  };
8716
8982
  const stripeStoreMessageBasedOnStatus = (status) => {
8717
8983
  let messages = [];
@@ -8995,7 +9261,7 @@ const stripeStoreTranslateAddressToLatin = async ({ addressInvalidCharactersList
8995
9261
  : {},
8996
9262
  billingAddress: !stripeStore.stripeShippingSameAsBilling
8997
9263
  ? buildTranslatedAddress({
8998
- currentAddress: Object.assign(Object.assign({}, billingAddress), { name: (_d = stripeStore.stripeBillingAddressEventData) === null || _d === void 0 ? void 0 : _d.value.name }) || {},
9264
+ currentAddress: Object.assign(Object.assign({}, billingAddress), { name: (_d = stripeStore.stripeBillingAddressEventData) === null || _d === void 0 ? void 0 : _d.value.name }),
8999
9265
  translatedAddressResult: json.billingAddress || null,
9000
9266
  })
9001
9267
  : {},
@@ -9029,6 +9295,10 @@ const { onChange, reset, state: cartStore, } = zonosStore.createStore(() => ({
9029
9295
  isSelectedShippingGuarantee: false,
9030
9296
  items: [],
9031
9297
  landedCostData: null,
9298
+ promoCode: sessionStorage.getItem('promoCode') || '',
9299
+ // When user clicked applied button, save promocode into session storage for later use. So if session has promocode, applied button is clicked
9300
+ promoCodeApplied: !!sessionStorage.getItem('promoCode'),
9301
+ promoCodeError: false,
9032
9302
  restrictedItems: [],
9033
9303
  selectedLandedCost: null,
9034
9304
  selectedShippingOption: null,
@@ -9312,6 +9582,18 @@ const cartStoreResetSelectedShippingOption = () => {
9312
9582
  // reset total to subtotal
9313
9583
  cartStore.total = cartStore.subtotal;
9314
9584
  };
9585
+ const cartStorePreviousStep = () => {
9586
+ if (cartStore.step === 'shipping') {
9587
+ cartStore.step = 'customer-info';
9588
+ // set shipping step to done
9589
+ cartStore.tabItems = Object.assign(Object.assign({}, cartStore.tabItems), { 'customer-info': Object.assign(Object.assign({}, cartStore.tabItems.shipping), { isDone: false }) });
9590
+ }
9591
+ else if (cartStore.step === 'payment') {
9592
+ cartStore.step = 'shipping';
9593
+ // set shipping step to done
9594
+ cartStore.tabItems = Object.assign(Object.assign({}, cartStore.tabItems), { shipping: Object.assign(Object.assign({}, cartStore.tabItems.shipping), { isDone: false }) });
9595
+ }
9596
+ };
9315
9597
  const cartStoreNextStep = () => {
9316
9598
  if (cartStore.step === 'customer-info') {
9317
9599
  cartStore.step = 'shipping';
@@ -9359,6 +9641,7 @@ exports.localizationStoreUpdateSelectedCountryCode = localizationStoreUpdateSele
9359
9641
  exports.localizationStoreUpdateSelectedLocale = localizationStoreUpdateSelectedLocale;
9360
9642
  exports.setZCountryUrlParam = setZCountryUrlParam;
9361
9643
  exports.stripeStore = stripeStore;
9644
+ exports.stripeStoreApplyPromoCode = stripeStoreApplyPromoCode;
9362
9645
  exports.stripeStoreCleanupDomesticShippingSession = stripeStoreCleanupDomesticShippingSession;
9363
9646
  exports.stripeStoreConfirmPayment = stripeStoreConfirmPayment;
9364
9647
  exports.stripeStoreGetDomesticShippingSession = stripeStoreGetDomesticShippingSession;
@@ -9366,7 +9649,9 @@ exports.stripeStoreHandleInventoryCheck = stripeStoreHandleInventoryCheck;
9366
9649
  exports.stripeStoreInitCheckoutSession = stripeStoreInitCheckoutSession;
9367
9650
  exports.stripeStoreMessageBasedOnStatus = stripeStoreMessageBasedOnStatus;
9368
9651
  exports.stripeStorePrefetchLandedCost = stripeStorePrefetchLandedCost;
9652
+ exports.stripeStoreRemovePromoCode = stripeStoreRemovePromoCode;
9369
9653
  exports.stripeStoreReset = stripeStoreReset;
9654
+ exports.stripeStoreResetPromoCode = stripeStoreResetPromoCode;
9370
9655
  exports.stripeStoreRetrievePayment = stripeStoreRetrievePayment;
9371
9656
  exports.stripeStoreSaveDomesticShippingSession = stripeStoreSaveDomesticShippingSession;
9372
9657
  exports.stripeStoreTranslateAddressToLatin = stripeStoreTranslateAddressToLatin;