@zonos/elements 1.3.50 → 1.3.52

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 (208) hide show
  1. package/dist/cjs/CheckoutConfig-65376e00.js +40 -0
  2. package/dist/cjs/{cart-688d674d.js → cart-61a8983d.js} +238 -370
  3. package/dist/cjs/{createCustomEvent-01bacaea.js → createCustomEvent-228027b5.js} +3 -2
  4. package/dist/cjs/handleFetch-842c95b0.js +322 -0
  5. package/dist/cjs/index.cjs.js +75 -35
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{paypal-ce1516ba.js → paypal-f1eb6621.js} +16 -16
  8. package/dist/cjs/zonos-address_8.cjs.entry.js +4 -4
  9. package/dist/cjs/{zonos-cart-items_12.cjs.entry.js → zonos-badge_13.cjs.entry.js} +41 -9
  10. package/dist/cjs/zonos-checkout.cjs.entry.js +75 -174
  11. package/dist/cjs/zonos-controller.cjs.entry.js +27 -25
  12. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
  14. package/dist/cjs/zonos-elements.cjs.js +1 -1
  15. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  16. package/dist/cjs/zonos-hello.cjs.entry.js +11 -11
  17. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  18. package/dist/cjs/zonos-notification_3.cjs.entry.js +9 -9
  19. package/dist/cjs/zonos-tooltip.cjs.entry.js +27 -0
  20. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +5 -2
  21. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +44 -20
  22. package/dist/collection/components/store/checkout/cart.js +14 -2
  23. package/dist/collection/components/store/checkout/stripe.js +9 -4
  24. package/dist/collection/components/store/translationStore/strings.arabic.js +3 -3
  25. package/dist/collection/components/store/translationStore/strings.base.js +3 -3
  26. package/dist/collection/components/store/translationStore/strings.chinese.js +3 -3
  27. package/dist/collection/components/store/translationStore/strings.danish.js +3 -3
  28. package/dist/collection/components/store/translationStore/strings.dutch.js +3 -3
  29. package/dist/collection/components/store/translationStore/strings.french.js +3 -3
  30. package/dist/collection/components/store/translationStore/strings.german.js +3 -3
  31. package/dist/collection/components/store/translationStore/strings.hebrew.js +3 -3
  32. package/dist/collection/components/store/translationStore/strings.indonesian.js +3 -3
  33. package/dist/collection/components/store/translationStore/strings.italian.js +3 -3
  34. package/dist/collection/components/store/translationStore/strings.japanese.js +3 -3
  35. package/dist/collection/components/store/translationStore/strings.korean.js +3 -3
  36. package/dist/collection/components/store/translationStore/strings.norwegian.js +3 -3
  37. package/dist/collection/components/store/translationStore/strings.polish.js +3 -3
  38. package/dist/collection/components/store/translationStore/strings.portuguese.js +3 -3
  39. package/dist/collection/components/store/translationStore/strings.russian.js +3 -3
  40. package/dist/collection/components/store/translationStore/strings.spanish.js +3 -3
  41. package/dist/collection/components/store/translationStore/strings.swedish.js +3 -3
  42. package/dist/collection/components/store/translationStore/strings.turkish.js +3 -3
  43. package/dist/collection/components/store/translationStore/strings.vietnamese.js +3 -3
  44. package/dist/collection/components/utils/api/buildCartItemsByTempCart.js +14 -14
  45. package/dist/collection/components/utils/api/calculateLandedCostNormalized.js +28 -0
  46. package/dist/collection/components/utils/api/cartCalculateLandedCost.js +19 -0
  47. package/dist/collection/components/utils/api/prepCalculateLandedCost.js +65 -0
  48. package/dist/collection/components/utils/api/triggerBuildLandedCost.js +2 -2
  49. package/dist/collection/components/utils/checkout/initCheckout.js +4 -2
  50. package/dist/collection/components/utils/handleFetch.js +6 -1
  51. package/dist/collection/environment.js +1 -1
  52. package/dist/collection/scripts/_getNextFallbackUrl.js +1 -0
  53. package/dist/collection/scripts/_getTempCartById.js +14 -0
  54. package/dist/collection/scripts/_zonosBase.js +39 -10
  55. package/dist/collection/scripts/cart/_getCartIdFromParam.js +9 -0
  56. package/dist/collection/scripts/cart/_setupCartData.js +18 -0
  57. package/dist/collection/types/checkout/CheckoutConfig.js +2 -1
  58. package/dist/collection/types/generated/graphql.customer.types.js +12 -0
  59. package/dist/collection/utils/formattedCloudflareApiUrl.js +8 -2
  60. package/dist/collection/utils/generateCloudflareDeployUrl.js +3 -0
  61. package/dist/esm/CheckoutConfig-57350b28.js +36 -0
  62. package/dist/esm/{cart-4f300fcb.js → cart-45d2861f.js} +194 -323
  63. package/dist/esm/{createCustomEvent-c5ed9070.js → createCustomEvent-3fcc948a.js} +2 -1
  64. package/dist/esm/handleFetch-37cea185.js +315 -0
  65. package/dist/esm/index.js +56 -17
  66. package/dist/esm/loader.js +1 -1
  67. package/dist/esm/{paypal-70caf283.js → paypal-ee310945.js} +2 -2
  68. package/dist/esm/zonos-address_8.entry.js +2 -2
  69. package/dist/esm/{zonos-cart-items_12.entry.js → zonos-badge_13.entry.js} +40 -9
  70. package/dist/esm/zonos-checkout.entry.js +61 -160
  71. package/dist/esm/zonos-controller.entry.js +6 -4
  72. package/dist/esm/zonos-country-flag.entry.js +2 -2
  73. package/dist/esm/zonos-country-select_4.entry.js +2 -2
  74. package/dist/esm/zonos-elements.js +1 -1
  75. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  76. package/dist/esm/zonos-hello.entry.js +2 -2
  77. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  78. package/dist/esm/zonos-notification_3.entry.js +3 -3
  79. package/dist/esm/zonos-tooltip.entry.js +23 -0
  80. package/dist/esm-es5/CheckoutConfig-57350b28.js +1 -0
  81. package/dist/esm-es5/cart-45d2861f.js +1 -0
  82. package/dist/esm-es5/{createCustomEvent-c5ed9070.js → createCustomEvent-3fcc948a.js} +1 -1
  83. package/dist/esm-es5/handleFetch-37cea185.js +1 -0
  84. package/dist/esm-es5/index.js +1 -1
  85. package/dist/esm-es5/loader.js +1 -1
  86. package/dist/esm-es5/{paypal-70caf283.js → paypal-ee310945.js} +1 -1
  87. package/dist/esm-es5/zonos-address_8.entry.js +1 -1
  88. package/dist/esm-es5/zonos-badge_13.entry.js +1 -0
  89. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  90. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  91. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  92. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  93. package/dist/esm-es5/zonos-elements.js +1 -1
  94. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  95. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  96. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  97. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  98. package/dist/esm-es5/zonos-tooltip.entry.js +1 -0
  99. package/dist/scripts/index.d.ts +74 -87
  100. package/dist/scripts/index.js +1 -1
  101. package/dist/scripts/loadZonos.js +1 -1
  102. package/dist/scripts/zonos.js +1 -1
  103. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +0 -2
  104. package/dist/types/components/store/checkout/cart.d.ts +13 -3
  105. package/dist/types/components/store/checkout/stripe.d.ts +3 -1
  106. package/dist/types/components/store/translationStore/strings.arabic.d.ts +3 -3
  107. package/dist/types/components/store/translationStore/strings.base.d.ts +3 -3
  108. package/dist/types/components/store/translationStore/strings.chinese.d.ts +3 -3
  109. package/dist/types/components/store/translationStore/strings.danish.d.ts +3 -3
  110. package/dist/types/components/store/translationStore/strings.dutch.d.ts +3 -3
  111. package/dist/types/components/store/translationStore/strings.french.d.ts +3 -3
  112. package/dist/types/components/store/translationStore/strings.german.d.ts +3 -3
  113. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +3 -3
  114. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +3 -3
  115. package/dist/types/components/store/translationStore/strings.italian.d.ts +3 -3
  116. package/dist/types/components/store/translationStore/strings.japanese.d.ts +3 -3
  117. package/dist/types/components/store/translationStore/strings.korean.d.ts +3 -3
  118. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +3 -3
  119. package/dist/types/components/store/translationStore/strings.polish.d.ts +3 -3
  120. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +3 -3
  121. package/dist/types/components/store/translationStore/strings.russian.d.ts +3 -3
  122. package/dist/types/components/store/translationStore/strings.spanish.d.ts +3 -3
  123. package/dist/types/components/store/translationStore/strings.swedish.d.ts +3 -3
  124. package/dist/types/components/store/translationStore/strings.turkish.d.ts +3 -3
  125. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +3 -3
  126. package/dist/types/components/store/translationStore.d.ts +1 -1
  127. package/dist/types/components/utils/api/buildCartItemsByTempCart.d.ts +8 -3
  128. package/dist/types/components/utils/api/calculateLandedCostNormalized.d.ts +2 -0
  129. package/dist/types/components/utils/api/cartCalculateLandedCost.d.ts +5 -0
  130. package/dist/types/components/utils/api/prepCalculateLandedCost.d.ts +5 -1
  131. package/dist/types/components/utils/checkout/getIsTestMode.d.ts +1 -1
  132. package/dist/types/scripts/_getNextFallbackUrl.d.ts +1 -0
  133. package/dist/types/scripts/_getTempCartById.d.ts +8 -0
  134. package/dist/types/scripts/_zonosBase.d.ts +15 -12
  135. package/dist/types/scripts/cart/_getCartIdFromParam.d.ts +4 -0
  136. package/dist/types/scripts/cart/_setupCartData.d.ts +7 -0
  137. package/dist/types/types/checkout/CheckoutConfig.d.ts +18 -3
  138. package/dist/types/types/checkout/api/CalculateLandedCostRequest.d.ts +42 -1
  139. package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +37 -0
  140. package/dist/types/types/generated/graphql.customer.types.d.ts +249 -2
  141. package/dist/types/types/generated/graphql.customer.types.ts +251 -3
  142. package/dist/types/utils/formattedCloudflareApiUrl.d.ts +2 -2
  143. package/dist/zonos-elements/index.esm.js +1 -1
  144. package/dist/zonos-elements/p-042c466d.system.entry.js +1 -0
  145. package/dist/zonos-elements/p-10cb0064.entry.js +1 -0
  146. package/dist/zonos-elements/{p-fe198a6c.entry.js → p-259ccf8d.entry.js} +1 -1
  147. package/dist/zonos-elements/p-2a47d2cc.system.entry.js +1 -0
  148. package/dist/zonos-elements/{p-89b1f4a5.entry.js → p-31eb835c.entry.js} +1 -1
  149. package/dist/zonos-elements/{p-4849604d.entry.js → p-36360905.entry.js} +1 -1
  150. package/dist/zonos-elements/{p-322600aa.system.entry.js → p-3703b814.system.entry.js} +1 -1
  151. package/dist/zonos-elements/p-4146feec.js +1 -0
  152. package/dist/zonos-elements/p-446c8f02.system.entry.js +1 -0
  153. package/dist/zonos-elements/{p-31905b60.system.js → p-5590f90c.system.js} +1 -1
  154. package/dist/zonos-elements/p-588396df.js +1 -0
  155. package/dist/zonos-elements/{p-124e3426.js → p-6e59c6e4.js} +2 -2
  156. package/dist/zonos-elements/p-6eedc3f8.entry.js +1 -0
  157. package/dist/zonos-elements/p-747eed39.entry.js +1 -0
  158. package/dist/zonos-elements/{p-d1cd0a5f.system.entry.js → p-8228e87c.system.entry.js} +1 -1
  159. package/dist/zonos-elements/p-827868e6.entry.js +1 -0
  160. package/dist/zonos-elements/{p-a67578ae.entry.js → p-88005b94.entry.js} +1 -1
  161. package/dist/zonos-elements/p-895fdefb.js +1 -0
  162. package/dist/zonos-elements/p-8f7773b0.system.js +1 -0
  163. package/dist/zonos-elements/{p-480a6094.entry.js → p-8fa49d94.entry.js} +1 -1
  164. package/dist/zonos-elements/p-a74a7afa.system.js +1 -0
  165. package/dist/zonos-elements/p-b1861e64.system.js +1 -0
  166. package/dist/zonos-elements/{p-ec31cd17.system.entry.js → p-b842b96a.system.entry.js} +1 -1
  167. package/dist/zonos-elements/{p-1719bedd.entry.js → p-bb186075.entry.js} +1 -1
  168. package/dist/zonos-elements/{p-8af4a9e7.system.entry.js → p-c008648a.system.entry.js} +1 -1
  169. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  170. package/dist/zonos-elements/{p-22e8d4ad.system.entry.js → p-cd4ad1be.system.entry.js} +1 -1
  171. package/dist/zonos-elements/{p-e7e73693.system.entry.js → p-d62e6bb0.system.entry.js} +1 -1
  172. package/dist/zonos-elements/{p-40d52dd6.system.entry.js → p-dc12f30a.system.entry.js} +1 -1
  173. package/dist/zonos-elements/p-eb2aedd0.js +1 -0
  174. package/dist/zonos-elements/{p-ceb8b836.system.js → p-f124e459.system.js} +2 -2
  175. package/dist/zonos-elements/p-f527cd5b.entry.js +1 -0
  176. package/dist/zonos-elements/p-f826b979.system.entry.js +1 -0
  177. package/dist/zonos-elements/p-f87a635b.system.js +1 -0
  178. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  179. package/package.json +2 -1
  180. package/dist/cjs/logError-4e2f2020.js +0 -58
  181. package/dist/cjs/zonos-badge_2.cjs.entry.js +0 -57
  182. package/dist/collection/components/utils/api/tempCartItem/getAttributes.js +0 -66
  183. package/dist/collection/components/utils/api/tempCartItem/getMeasurements.js +0 -58
  184. package/dist/esm/logError-c456c092.js +0 -55
  185. package/dist/esm/zonos-badge_2.entry.js +0 -52
  186. package/dist/esm-es5/cart-4f300fcb.js +0 -1
  187. package/dist/esm-es5/logError-c456c092.js +0 -1
  188. package/dist/esm-es5/zonos-badge_2.entry.js +0 -1
  189. package/dist/esm-es5/zonos-cart-items_12.entry.js +0 -1
  190. package/dist/types/components/utils/api/tempCartItem/getAttributes.d.ts +0 -11
  191. package/dist/types/components/utils/api/tempCartItem/getMeasurements.d.ts +0 -7
  192. package/dist/types/types/checkout/api/TempCart.d.ts +0 -80
  193. package/dist/zonos-elements/p-00f219bd.entry.js +0 -1
  194. package/dist/zonos-elements/p-05dff37f.js +0 -1
  195. package/dist/zonos-elements/p-1f2db2ff.entry.js +0 -1
  196. package/dist/zonos-elements/p-2018969a.js +0 -1
  197. package/dist/zonos-elements/p-27f2e8af.system.entry.js +0 -1
  198. package/dist/zonos-elements/p-4452dddc.entry.js +0 -1
  199. package/dist/zonos-elements/p-47c72c50.system.entry.js +0 -1
  200. package/dist/zonos-elements/p-595d406e.entry.js +0 -1
  201. package/dist/zonos-elements/p-5beccdce.system.entry.js +0 -1
  202. package/dist/zonos-elements/p-6013e370.entry.js +0 -1
  203. package/dist/zonos-elements/p-63db40b9.system.js +0 -1
  204. package/dist/zonos-elements/p-6ab615e6.system.js +0 -1
  205. package/dist/zonos-elements/p-81540fd6.system.js +0 -1
  206. package/dist/zonos-elements/p-d709ad28.system.entry.js +0 -1
  207. package/dist/zonos-elements/p-eaa335e1.js +0 -1
  208. /package/dist/collection/types/checkout/api/{TempCart.js → NormalizedTempCart.js} +0 -0
@@ -68,6 +68,9 @@ export const stringsChinese = {
68
68
  'Delivery options': {
69
69
  value: '送货选项',
70
70
  },
71
+ Discounts: {
72
+ value: '折扣',
73
+ },
71
74
  "Don't close": {
72
75
  value: '不要关',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsChinese = {
146
149
  'Nothing due at the door': {
147
150
  value: '门口无需付款',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: '订单超过关税和税款的最低征税门槛',
151
- },
152
152
  'Order total': {
153
153
  value: '订单总计',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsDanish = {
68
68
  'Delivery options': {
69
69
  value: 'Leveringsmuligheder',
70
70
  },
71
+ Discounts: {
72
+ value: 'Rabat',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'Luk ikke',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsDanish = {
146
149
  'Nothing due at the door': {
147
150
  value: 'Intet at betale ved døren',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: 'Ordre er over de minimis-grænsen for både told og skat',
151
- },
152
152
  'Order total': {
153
153
  value: 'Ordresum',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsDutch = {
68
68
  'Delivery options': {
69
69
  value: 'Bezorgopties',
70
70
  },
71
+ Discounts: {
72
+ value: 'Kortingen',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'Niet sluiten',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsDutch = {
146
149
  'Nothing due at the door': {
147
150
  value: 'Niets te betalen aan de deur',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: 'Bestelling overschrijdt de minimale drempel voor zowel heffing als belasting',
151
- },
152
152
  'Order total': {
153
153
  value: 'Totaal bestelling',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsFrench = {
68
68
  'Delivery options': {
69
69
  value: 'Options de livraison',
70
70
  },
71
+ Discounts: {
72
+ value: 'Réductions',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'Ne pas fermer',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsFrench = {
146
149
  'Nothing due at the door': {
147
150
  value: 'Rien à payer à la porte',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: 'La commande dépasse le seuil de minimis pour les droits et les taxes',
151
- },
152
152
  'Order total': {
153
153
  value: 'Total de la commande',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsGerman = {
68
68
  'Delivery options': {
69
69
  value: 'Lieferoptionen',
70
70
  },
71
+ Discounts: {
72
+ value: 'Rabatte',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'Nicht schließen',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsGerman = {
146
149
  'Nothing due at the door': {
147
150
  value: 'An der Tür nichts zu bezahlen',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: 'Bestellung überschreitet Mindestgrenze sowohl für Zoll als auch Steuer',
151
- },
152
152
  'Order total': {
153
153
  value: 'Bestellsumme',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsHebrew = {
68
68
  'Delivery options': {
69
69
  value: 'אפשרויות משלוח',
70
70
  },
71
+ Discounts: {
72
+ value: 'הנחות',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'אל תסגור',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsHebrew = {
146
149
  'Nothing due at the door': {
147
150
  value: 'אין כלום לשלם בדלת',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: 'ההזמנה חורגת מסף המינימום גם למכס וגם למס',
151
- },
152
152
  'Order total': {
153
153
  value: 'סה"כ ההזמנה',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsIndonesian = {
68
68
  'Delivery options': {
69
69
  value: 'Opsi pengiriman',
70
70
  },
71
+ Discounts: {
72
+ value: 'Diskon',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'Jangan tutup',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsIndonesian = {
146
149
  'Nothing due at the door': {
147
150
  value: 'Tidak ada yang harus dibayar di pintu',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: 'Pesanan melebihi ambang batas de minimis untuk bea masuk dan pajak',
151
- },
152
152
  'Order total': {
153
153
  value: 'Total pesanan',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsItalian = {
68
68
  'Delivery options': {
69
69
  value: 'Opzioni di consegna',
70
70
  },
71
+ Discounts: {
72
+ value: 'Sconti',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'Non chiudere',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsItalian = {
146
149
  'Nothing due at the door': {
147
150
  value: 'Nulla da pagare alla porta',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: "L'ordine supera la soglia di minimis sia per i dazi che per le tasse",
151
- },
152
152
  'Order total': {
153
153
  value: 'Totale ordine',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsJapanese = {
68
68
  'Delivery options': {
69
69
  value: '配送オプション',
70
70
  },
71
+ Discounts: {
72
+ value: '割引',
73
+ },
71
74
  "Don't close": {
72
75
  value: '閉めないでください',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsJapanese = {
146
149
  'Nothing due at the door': {
147
150
  value: 'ドアでの支払いはありません',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: '注文が関税と税金のデミニマス閾値を超えています',
151
- },
152
152
  'Order total': {
153
153
  value: 'ご注文合計',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsKorean = {
68
68
  'Delivery options': {
69
69
  value: '배송 옵션',
70
70
  },
71
+ Discounts: {
72
+ value: '할인',
73
+ },
71
74
  "Don't close": {
72
75
  value: '닫지 마세요',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsKorean = {
146
149
  'Nothing due at the door': {
147
150
  value: '문 앞에 납부할 것이 없습니다',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: '주문 금액이 관세와 세금의 최저 임계값을 초과합니다',
151
- },
152
152
  'Order total': {
153
153
  value: '주문 총액',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsNorwegian = {
68
68
  'Delivery options': {
69
69
  value: 'Leveringsalternativer',
70
70
  },
71
+ Discounts: {
72
+ value: 'Rabatter',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'Ikke lukk',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsNorwegian = {
146
149
  'Nothing due at the door': {
147
150
  value: 'Ingenting å betale ved døren',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: 'Bestillingen er over minstegrensen for både avgift og skatt',
151
- },
152
152
  'Order total': {
153
153
  value: 'Totalt beløp',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsPolish = {
68
68
  'Delivery options': {
69
69
  value: 'Opcje dostawy',
70
70
  },
71
+ Discounts: {
72
+ value: 'Zniżki',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'Nie zamykaj',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsPolish = {
146
149
  'Nothing due at the door': {
147
150
  value: 'Nic do zapłacenia przy drzwiach',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: 'Zamówienie przekracza próg minimalny zarówno dla cła, jak i podatku',
151
- },
152
152
  'Order total': {
153
153
  value: 'Łączna kwota zamówienia',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsPortuguese = {
68
68
  'Delivery options': {
69
69
  value: 'Opções de entrega',
70
70
  },
71
+ Discounts: {
72
+ value: 'Descontos',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'Não fechar',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsPortuguese = {
146
149
  'Nothing due at the door': {
147
150
  value: 'Nada a pagar na porta',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: 'O pedido ultrapassa o limite de isenção tanto para impostos quanto para taxas',
151
- },
152
152
  'Order total': {
153
153
  value: 'Total do pedido',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsRussian = {
68
68
  'Delivery options': {
69
69
  value: 'Варианты доставки',
70
70
  },
71
+ Discounts: {
72
+ value: 'Скидки',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'Не закрывайте',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsRussian = {
146
149
  'Nothing due at the door': {
147
150
  value: 'На двери ничего не должно',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: 'Заказ превышает минимальный порог как для пошлины, так и для налога',
151
- },
152
152
  'Order total': {
153
153
  value: 'Итого',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsSpanish = {
68
68
  'Delivery options': {
69
69
  value: 'Opciones de entrega',
70
70
  },
71
+ Discounts: {
72
+ value: 'Descuentos',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'No cerrar',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsSpanish = {
146
149
  'Nothing due at the door': {
147
150
  value: 'Nada debido en la puerta',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: 'El pedido supera el umbral mínimo tanto para impuestos como para aranceles',
151
- },
152
152
  'Order total': {
153
153
  value: 'Total del pedido',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsSwedish = {
68
68
  'Delivery options': {
69
69
  value: 'Leveransalternativ',
70
70
  },
71
+ Discounts: {
72
+ value: 'Rabatter',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'Stäng inte',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsSwedish = {
146
149
  'Nothing due at the door': {
147
150
  value: 'Ingenting att betala vid dörren',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: 'Beställningen överstiger minimibeloppet för både tull och skatt',
151
- },
152
152
  'Order total': {
153
153
  value: 'Totalt belopp för beställningen',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsTurkish = {
68
68
  'Delivery options': {
69
69
  value: 'Teslimat seçenekleri',
70
70
  },
71
+ Discounts: {
72
+ value: 'İndirimler',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'Kapatma',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsTurkish = {
146
149
  'Nothing due at the door': {
147
150
  value: 'Kapıda ödenecek bir şey yok',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: 'Sipariş hem gümrük hem vergi için minimum sınırın üzerinde',
151
- },
152
152
  'Order total': {
153
153
  value: 'Sipariş toplamı',
154
154
  },
@@ -68,6 +68,9 @@ export const stringsVietnamese = {
68
68
  'Delivery options': {
69
69
  value: 'Tùy chọn giao hàng',
70
70
  },
71
+ Discounts: {
72
+ value: 'Giảm giá',
73
+ },
71
74
  "Don't close": {
72
75
  value: 'Đừng đóng',
73
76
  },
@@ -146,9 +149,6 @@ export const stringsVietnamese = {
146
149
  'Nothing due at the door': {
147
150
  value: 'Không có gì phải trả tại cửa',
148
151
  },
149
- 'Order is over the de minimis threshold for both duty and tax': {
150
- value: 'Đơn hàng vượt ngưỡng miễn thuế cho cả thuế nhập khẩu và thuế',
151
- },
152
152
  'Order total': {
153
153
  value: 'Tổng đơn hàng',
154
154
  },
@@ -1,24 +1,24 @@
1
- import { getAttributes } from "./tempCartItem/getAttributes";
2
- import { getMeasurements } from "./tempCartItem/getMeasurements";
3
1
  /**
4
2
  * Map the items from tempCart like how we do it in dgs
5
3
  * @ref https://github.com/Zonos/ShippingQuoteService/blob/f8bd4f1ff41cb34b49b9f3f435576ec28dedf906/src/main/java/com/iglobal/services/shippingquote/dto/ShippingQuoteRequestDto.java#L393
6
4
  */
7
5
  export const buildCartItemsByTempCart = (tempCartData) => {
8
- var _a;
9
- const tempCartItems = ((_a = tempCartData === null || tempCartData === void 0 ? void 0 : tempCartData.items) === null || _a === void 0 ? void 0 : _a.map(item => ({
10
- amount: item.unitPrice || 0,
11
- attributes: getAttributes(item),
6
+ const tempCartItems = tempCartData.items.map(item => ({
7
+ amount: item.amount,
8
+ attributes: item.attributes || [],
12
9
  countryOfOrigin: item.countryOfOrigin || undefined,
13
- currencyCode: 'USD',
14
- description: item.itemDescriptionLong || '',
15
- imageUrl: item.imageURL || '',
16
- itemType: 'PHYSICAL_GOOD',
17
- measurements: getMeasurements(item),
18
- name: item.description || '',
10
+ currencyCode: item.currencyCode,
11
+ description: item.description || '',
12
+ imageUrl: item.imageUrl || '',
13
+ itemType: item.itemType || 'PHYSICAL_GOOD',
14
+ measurements: item.measurements || [],
15
+ name: item.name || item.description || '',
19
16
  productId: item.productId || '',
20
17
  quantity: item.quantity || 0,
21
18
  sku: item.sku || '',
22
- }))) || [];
23
- return tempCartItems;
19
+ })) || [];
20
+ return {
21
+ adjustments: tempCartData.adjustments,
22
+ cartItems: tempCartItems,
23
+ };
24
24
  };
@@ -0,0 +1,28 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s)
4
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { calculateLandedCost } from "./calculateLandedCost";
14
+ import { cartCalculateLandedCost } from "./cartCalculateLandedCost";
15
+ export const calculateLandedCostNormalized = async (abortController) => {
16
+ const cartId = window.Zonos.cartId;
17
+ // Calculate landed cost as usual if no cartId is available
18
+ if (!cartId) {
19
+ const landedCostResult = await calculateLandedCost(abortController);
20
+ return landedCostResult;
21
+ }
22
+ // Calculate landed cost using cartId
23
+ const _a = await cartCalculateLandedCost({
24
+ abortController,
25
+ cartId,
26
+ }), { cartWorkflow } = _a, rest = __rest(_a, ["cartWorkflow"]);
27
+ return Object.assign(Object.assign({}, rest), { itemCreateWorkflow: cartWorkflow.items });
28
+ };
@@ -0,0 +1,19 @@
1
+ import { prepCartCalculateLandedCost } from "./prepCalculateLandedCost";
2
+ import { handleFetch } from "../handleFetch";
3
+ export const cartCalculateLandedCost = async ({ abortController, cartId, }) => {
4
+ var _a;
5
+ // request to get landed cost info
6
+ const { errors, json } = await handleFetch('/api/zonos-elements/cart-calculate-landed-cost', {
7
+ body: prepCartCalculateLandedCost(cartId),
8
+ method: 'POST',
9
+ signal: abortController === null || abortController === void 0 ? void 0 : abortController.signal,
10
+ });
11
+ if (errors.length || !json) {
12
+ const isAbortedRequest = ((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.message) === 'The user aborted a request.';
13
+ const errorMessage = isAbortedRequest
14
+ ? 'The landed cost calculation request was aborted to initiate a new one.'
15
+ : 'Failed to calculate landed cost';
16
+ throw new Error(errorMessage);
17
+ }
18
+ return json;
19
+ };
@@ -19,6 +19,71 @@ const getTranslatedAddress = ({ currentAddress, translatedAddress, }) => {
19
19
  state: ((_f = translatedAddress.state) === null || _f === void 0 ? void 0 : _f[state]) || state,
20
20
  };
21
21
  };
22
+ /**
23
+ * Similar to prepCalculateLandedCost except it only uses
24
+ */
25
+ export const prepCartCalculateLandedCost = (cartId) => {
26
+ var _a;
27
+ // maybe we don't need email now for prefetch the landed cost
28
+ const stripeLinkData = stripeStore.stripeLinkEventData;
29
+ const stripeAddressData = stripeStore.stripeAddressEventData;
30
+ const stripeBillingAddressData = stripeStore.stripeShippingSameAsBilling
31
+ ? stripeStore.stripeAddressEventData
32
+ : stripeStore.stripeBillingAddressEventData;
33
+ if (!(stripeAddressData === null || stripeAddressData === void 0 ? void 0 : stripeAddressData.complete) || !(stripeBillingAddressData === null || stripeBillingAddressData === void 0 ? void 0 : stripeBillingAddressData.complete)) {
34
+ throw new Error('Missing stripe address data');
35
+ }
36
+ // Attempt to get translated address if available
37
+ const translatedShippingAddress = getTranslatedAddress({
38
+ currentAddress: stripeAddressData,
39
+ translatedAddress: stripeStore.translatedAddress.address,
40
+ });
41
+ const shippingFirstName = translatedShippingAddress.name.split(' ')[0] || '';
42
+ const shippingLastName = translatedShippingAddress.name.split(' ').splice(1).join(' ') || '';
43
+ const translatedBillingAddress = getTranslatedAddress({
44
+ currentAddress: stripeBillingAddressData,
45
+ translatedAddress: stripeStore.translatedAddress.address,
46
+ });
47
+ const billingFirstName = translatedBillingAddress.name.split(' ')[0] || '';
48
+ const billingLastName = translatedBillingAddress.name.split(' ').splice(1).join(' ') || '';
49
+ return {
50
+ billingAddress: {
51
+ addressLine1: translatedBillingAddress.line1,
52
+ addressLine2: translatedBillingAddress.line2 || '',
53
+ city: translatedBillingAddress.city,
54
+ country: translatedBillingAddress.country,
55
+ postalCode: translatedBillingAddress.postal_code,
56
+ state: translatedBillingAddress.state,
57
+ },
58
+ billingContact: {
59
+ // firstName and lastName should be valid now since stripe only mark
60
+ // the address as complete when both fields are filled.
61
+ firstName: billingFirstName,
62
+ lastName: billingLastName,
63
+ phone: translatedBillingAddress.phone,
64
+ },
65
+ // Use the first item's currency code
66
+ cartCurrencyCode: (_a = cartStore.items[0]) === null || _a === void 0 ? void 0 : _a.currencyCode,
67
+ cartId,
68
+ checkoutSessionId: cartStore.checkoutSessionId || '',
69
+ contact: {
70
+ email: stripeLinkData === null || stripeLinkData === void 0 ? void 0 : stripeLinkData.value.email,
71
+ // firstName and lastName should be valid now since stripe only mark
72
+ // the address as complete when both fields are filled.
73
+ firstName: shippingFirstName,
74
+ lastName: shippingLastName,
75
+ phone: translatedShippingAddress.phone,
76
+ },
77
+ shippingAddress: {
78
+ addressLine1: translatedShippingAddress.line1,
79
+ addressLine2: translatedShippingAddress.line2,
80
+ city: translatedShippingAddress.city,
81
+ country: translatedShippingAddress.country,
82
+ postalCode: translatedShippingAddress.postal_code,
83
+ state: translatedShippingAddress.state,
84
+ },
85
+ };
86
+ };
22
87
  export const prepCalculateLandedCost = () => {
23
88
  // maybe we don't need email now for prefetch the landed cost
24
89
  const stripeLinkData = stripeStore.stripeLinkEventData;
@@ -1,5 +1,5 @@
1
1
  import { prepCalculateLandedCost } from "./prepCalculateLandedCost";
2
- import { MAIN_BASE_API } from "../getNextFallbackApi";
2
+ import { fallbackApiList } from "../getNextFallbackApi";
3
3
  import { handleFetch } from "../handleFetch";
4
4
  export const triggerBuildLandedCost = async (buildLandedCost) => {
5
5
  var _a, _b, _c, _d;
@@ -10,7 +10,7 @@ export const triggerBuildLandedCost = async (buildLandedCost) => {
10
10
  checkoutSessionId: data.checkoutSessionId,
11
11
  contact: data.contact,
12
12
  shippingAddress: data.shippingAddress,
13
- zonosApiRoute: MAIN_BASE_API,
13
+ zonosApiRoute: fallbackApiList['vercel'],
14
14
  });
15
15
  if (!landedCost || ((_a = landedCost.errors) === null || _a === void 0 ? void 0 : _a.length)) {
16
16
  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'}`);
@@ -9,12 +9,14 @@ const injectCheckoutElement = () => {
9
9
  }
10
10
  };
11
11
  export const initCheckout = (config) => {
12
- if (!config.placeOrderButtonSelector) {
12
+ // allow to load checkout if cartData is ready (Checkout can be loaded right awaiy if tempCartUUID is in the URL)
13
+ if (!config.placeOrderButtonSelector && !window.Zonos.cartData) {
13
14
  // do nothing if checkout button anchor is not set
14
15
  return;
15
16
  }
16
17
  // check if checkout button anchor selector user pass in is valid
17
- if (!isValidSelector(config.placeOrderButtonSelector)) {
18
+ if (config.placeOrderButtonSelector &&
19
+ !isValidSelector(config.placeOrderButtonSelector)) {
18
20
  logError(`Selector checkoutButtonAnchor "${config.placeOrderButtonSelector}" is not a valid selector`);
19
21
  return;
20
22
  }
@@ -117,8 +117,13 @@ const handleRequest = async ({ basePathType, options, path, }) => {
117
117
  };
118
118
  }
119
119
  };
120
- const handleRequestWithFallback = async ({ basePathType, options, path, }) => {
120
+ const handleRequestWithFallback = async ({ basePathType: _basePathType, options, path, }) => {
121
121
  var _a, _b;
122
+ // use vercel API if the path is `/api/bigcommerce`
123
+ const isBigcommerceEndpoint = path.startsWith('/api/bigcommerce');
124
+ const basePathType = isBigcommerceEndpoint
125
+ ? 'vercel'
126
+ : _basePathType;
122
127
  const _c = await handleRequest({
123
128
  basePathType,
124
129
  options,
@@ -100,9 +100,9 @@ export const env = createEnv({
100
100
  NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL: formattedCloudflareApiUrl({
101
101
  branchName: currentBranch,
102
102
  inCI,
103
+ inGithubAction: inGithubActions,
103
104
  inVercel,
104
105
  isVercelPreview,
105
- projectName: 'zonos-elements',
106
106
  url: process.env.NEXT_PUBLIC_ZONOS_CLOUDFLARE_URL,
107
107
  }),
108
108
  NEXT_PUBLIC_ZONOS_JS_DELIVR_CDN_URL: JS_DELIVR_ZONOS_URL,
@@ -1,4 +1,5 @@
1
1
  export const fallbackList = ['jsdelivr', 'cdnjs', 'unpkg', 'vercel'];
2
+ export const MAIN_LOAD_CDN_TYPE = 'jsdelivr';
2
3
  /**
3
4
  * Get the next cdn type in the fallback list
4
5
  * @param currentCdnType The current cdn type that want to get the next fallback url
@@ -0,0 +1,14 @@
1
+ import { handleFetch } from "../components/utils/handleFetch";
2
+ export const getTempCartById = async (cartId) => {
3
+ const { errors, json } = await handleFetch('/api/zonos-elements/get-temp-cart', {
4
+ body: { tempCartUUID: cartId },
5
+ headers: {
6
+ 'Content-Type': 'application/json',
7
+ },
8
+ method: 'POST',
9
+ });
10
+ if (!json || errors.length) {
11
+ return null;
12
+ }
13
+ return json;
14
+ };