@zonos/elements 1.3.248 → 1.3.250

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 (404) hide show
  1. package/dist/cjs/{cart-28310848.js → cart-fcd1359c.js} +321 -22
  2. package/dist/cjs/{cleanHtmlMarkdown-577d0a77.js → cleanHtmlMarkdown-31da84b7.js} +9 -7
  3. package/dist/cjs/{debounce-815d1517.js → debounce-0c75ba33.js} +1 -1
  4. package/dist/cjs/{getBorderRadius-2ef1170d.js → getBorderRadius-27a74844.js} +1 -1
  5. package/dist/cjs/{getContrastColor-30848800.js → getContrastColor-cc087c53.js} +2 -2
  6. package/dist/cjs/{hasInclusivePrice-134b0250.js → hasInclusivePrice-745a8f29.js} +1 -1
  7. package/dist/cjs/index-b1f95d96.js +4065 -0
  8. package/dist/cjs/index.cjs.js +7 -7
  9. package/dist/cjs/{invoice-2e8e5879.js → invoice-f040e147.js} +3 -3
  10. package/dist/cjs/{isCollectMobileTablet-bd0f4556.js → isCollectMobileTablet-cf92852e.js} +3 -3
  11. package/dist/cjs/{isContrastColor-09f5924a.js → isContrastColor-d1936a5c.js} +1 -1
  12. package/dist/cjs/{isDarkColor-878e600e.js → isDarkColor-a68abf7a.js} +1 -1
  13. package/dist/cjs/loader.cjs.js +2 -2
  14. package/dist/cjs/{localization-00e73920.js → localization-523b793a.js} +661 -1
  15. package/dist/cjs/{paypal-3019ae94.js → paypal-8c98c0a1.js} +79 -21
  16. package/dist/cjs/{placeTestOrder-b0369cfd.js → placeTestOrder-9b1e09f0.js} +2 -2
  17. package/dist/cjs/{renderCheckoutCurrency-9e919b9f.js → renderCheckoutCurrency-94b6e51d.js} +2 -2
  18. package/dist/cjs/{renderFallback-78b54537.js → renderFallback-bc20ee20.js} +1 -1
  19. package/dist/cjs/{submitGtag-a50ab32e.js → submitGtag-cb4fb332.js} +1 -1
  20. package/dist/cjs/{throttle-7dd64984.js → throttle-ff483793.js} +2 -2
  21. package/dist/cjs/{updateCheckoutSessionAttributes-3a1db9de.js → updateCheckoutSessionAttributes-8be63b63.js} +1 -1
  22. package/dist/cjs/{zonos-address-display_9.cjs.entry.js → zonos-address-display_8.cjs.entry.js} +1294 -1664
  23. package/dist/cjs/zonos-address_4.cjs.entry.js +8 -8
  24. package/dist/cjs/zonos-badge.cjs.entry.js +2 -2
  25. package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
  26. package/dist/cjs/zonos-button_3.cjs.entry.js +5 -5
  27. package/dist/cjs/zonos-card_5.cjs.entry.js +9 -9
  28. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +84 -30
  29. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +113 -0
  30. package/dist/cjs/zonos-checkout.cjs.entry.js +60 -11
  31. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
  32. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +7 -7
  33. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +13 -13
  34. package/dist/cjs/zonos-collect.cjs.entry.js +11 -11
  35. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  36. package/dist/cjs/zonos-controller.cjs.entry.js +7 -7
  37. package/dist/cjs/zonos-country-flag.cjs.entry.js +3 -3
  38. package/dist/cjs/zonos-country-select_4.cjs.entry.js +4 -4
  39. package/dist/cjs/zonos-elements.cjs.js +30 -3
  40. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +4 -4
  41. package/dist/cjs/zonos-hello.cjs.entry.js +4 -4
  42. package/dist/cjs/zonos-input.cjs.entry.js +4 -4
  43. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +9 -9
  44. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +13 -13
  45. package/dist/cjs/zonos-invoice.cjs.entry.js +10 -10
  46. package/dist/cjs/zonos-language-select_2.cjs.entry.js +3 -3
  47. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  48. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  49. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +6 -6
  50. package/dist/cjs/zonos-store-credit.cjs.entry.js +113 -0
  51. package/dist/cjs/zonos-stripe-input.cjs.entry.js +4 -4
  52. package/dist/cjs/zonos-text.cjs.entry.js +2 -2
  53. package/dist/cjs/zonos-tooltip.cjs.entry.js +1 -1
  54. package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
  55. package/dist/cjs/{zonosStore-37a4b4f4.js → zonosStore-f5a61112.js} +110 -25
  56. package/dist/collection/collection-manifest.json +1 -0
  57. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +3 -0
  58. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +49 -4
  59. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +18 -10
  60. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/assets/StoreCreditIcon.svg +3 -0
  61. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.css +139 -0
  62. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.js +137 -0
  63. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +52 -1
  64. package/dist/collection/components/common/zonos-button/zonos-button.css +3 -1
  65. package/dist/collection/components/common/zonos-input/zonos-input.css +3 -1
  66. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.css +3 -1
  67. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +1 -1
  68. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.css +3 -1
  69. package/dist/collection/components/main/zonos-controller.js +1 -1
  70. package/dist/collection/components/store/checkout/cart.js +62 -4
  71. package/dist/collection/components/store/checkout/paypal.js +28 -0
  72. package/dist/collection/components/store/checkout/storeCredit.js +237 -0
  73. package/dist/collection/components/store/checkout/stripe.js +2 -1
  74. package/dist/collection/components/store/translationStore/strings.arabic.js +33 -0
  75. package/dist/collection/components/store/translationStore/strings.base.js +33 -0
  76. package/dist/collection/components/store/translationStore/strings.chinese.js +33 -0
  77. package/dist/collection/components/store/translationStore/strings.danish.js +33 -0
  78. package/dist/collection/components/store/translationStore/strings.dutch.js +33 -0
  79. package/dist/collection/components/store/translationStore/strings.french.js +33 -0
  80. package/dist/collection/components/store/translationStore/strings.german.js +33 -0
  81. package/dist/collection/components/store/translationStore/strings.hebrew.js +33 -0
  82. package/dist/collection/components/store/translationStore/strings.indonesian.js +33 -0
  83. package/dist/collection/components/store/translationStore/strings.italian.js +33 -0
  84. package/dist/collection/components/store/translationStore/strings.japanese.js +33 -0
  85. package/dist/collection/components/store/translationStore/strings.korean.js +33 -0
  86. package/dist/collection/components/store/translationStore/strings.norwegian.js +33 -0
  87. package/dist/collection/components/store/translationStore/strings.polish.js +33 -0
  88. package/dist/collection/components/store/translationStore/strings.portuguese.js +33 -0
  89. package/dist/collection/components/store/translationStore/strings.russian.js +33 -0
  90. package/dist/collection/components/store/translationStore/strings.spanish.js +33 -0
  91. package/dist/collection/components/store/translationStore/strings.swedish.js +33 -0
  92. package/dist/collection/components/store/translationStore/strings.turkish.js +33 -0
  93. package/dist/collection/components/store/translationStore/strings.vietnamese.js +33 -0
  94. package/dist/collection/types/generated/graphql.internal.types.js +589 -0
  95. package/dist/esm/{cart-ba8f3890.js → cart-6e465f7b.js} +311 -23
  96. package/dist/esm/{cleanHtmlMarkdown-b5b18743.js → cleanHtmlMarkdown-5f7856f2.js} +9 -7
  97. package/dist/esm/{debounce-c4785346.js → debounce-efc0e473.js} +1 -1
  98. package/dist/esm/{getBorderRadius-877f6389.js → getBorderRadius-c21a42e5.js} +1 -1
  99. package/dist/esm/{getContrastColor-28c18704.js → getContrastColor-98f0d1d5.js} +2 -2
  100. package/dist/esm/{hasInclusivePrice-6fcc712f.js → hasInclusivePrice-c49d384d.js} +1 -1
  101. package/dist/esm/index-cfd394c8.js +4028 -0
  102. package/dist/esm/index.js +7 -7
  103. package/dist/esm/{invoice-055bb6e5.js → invoice-d416ba65.js} +3 -3
  104. package/dist/esm/{isCollectMobileTablet-797cea8b.js → isCollectMobileTablet-48040572.js} +3 -3
  105. package/dist/esm/{isContrastColor-69778cea.js → isContrastColor-c17e83c9.js} +1 -1
  106. package/dist/esm/{isDarkColor-9ddd90cc.js → isDarkColor-3537021b.js} +1 -1
  107. package/dist/esm/loader.js +3 -3
  108. package/dist/esm/{localization-853b48a9.js → localization-f4a7fb5a.js} +661 -1
  109. package/dist/esm/{paypal-8d8518c0.js → paypal-6af6b978.js} +79 -21
  110. package/dist/esm/{placeTestOrder-0a74923e.js → placeTestOrder-d19ac166.js} +2 -2
  111. package/dist/esm/{renderCheckoutCurrency-bd059ecf.js → renderCheckoutCurrency-c8aa8e7e.js} +2 -2
  112. package/dist/esm/{renderFallback-3f010b48.js → renderFallback-b250f4e9.js} +1 -1
  113. package/dist/esm/{submitGtag-89d6e9cb.js → submitGtag-13de9f1f.js} +1 -1
  114. package/dist/esm/{throttle-ce2432ab.js → throttle-0504ba2c.js} +2 -2
  115. package/dist/esm/{updateCheckoutSessionAttributes-047a6cd4.js → updateCheckoutSessionAttributes-b9f7e982.js} +1 -1
  116. package/dist/esm/{zonos-address-display_9.entry.js → zonos-address-display_8.entry.js} +1295 -1664
  117. package/dist/esm/zonos-address_4.entry.js +8 -8
  118. package/dist/esm/zonos-badge.entry.js +2 -2
  119. package/dist/esm/zonos-banner.entry.js +2 -2
  120. package/dist/esm/zonos-button_3.entry.js +5 -5
  121. package/dist/esm/zonos-card_5.entry.js +9 -9
  122. package/dist/esm/zonos-cart-items_12.entry.js +84 -30
  123. package/dist/esm/zonos-checkbox_2.entry.js +108 -0
  124. package/dist/esm/zonos-checkout.entry.js +60 -11
  125. package/dist/esm/zonos-collapse.entry.js +2 -2
  126. package/dist/esm/zonos-collect-cart-items_3.entry.js +7 -7
  127. package/dist/esm/zonos-collect-finish_6.entry.js +13 -13
  128. package/dist/esm/zonos-collect.entry.js +11 -11
  129. package/dist/esm/zonos-component.entry.js +1 -1
  130. package/dist/esm/zonos-controller.entry.js +7 -7
  131. package/dist/esm/zonos-country-flag.entry.js +3 -3
  132. package/dist/esm/zonos-country-select_4.entry.js +4 -4
  133. package/dist/esm/zonos-elements.js +31 -4
  134. package/dist/esm/zonos-hello-dialog.entry.js +4 -4
  135. package/dist/esm/zonos-hello.entry.js +4 -4
  136. package/dist/esm/zonos-input.entry.js +4 -4
  137. package/dist/esm/zonos-invoice-cart-items_2.entry.js +9 -9
  138. package/dist/esm/zonos-invoice-finish_5.entry.js +13 -13
  139. package/dist/esm/zonos-invoice.entry.js +10 -10
  140. package/dist/esm/zonos-language-select_2.entry.js +3 -3
  141. package/dist/esm/zonos-link.entry.js +1 -1
  142. package/dist/esm/zonos-logo.entry.js +2 -2
  143. package/dist/esm/zonos-shipping-rich-radio.entry.js +6 -6
  144. package/dist/esm/zonos-store-credit.entry.js +109 -0
  145. package/dist/esm/zonos-stripe-input.entry.js +4 -4
  146. package/dist/esm/zonos-text.entry.js +2 -2
  147. package/dist/esm/zonos-tooltip.entry.js +1 -1
  148. package/dist/esm/zonos-v-stack.entry.js +2 -2
  149. package/dist/esm/{zonosStore-b434e436.js → zonosStore-5242a58d.js} +110 -25
  150. package/dist/esm-es5/cart-6e465f7b.js +1 -0
  151. package/dist/esm-es5/cleanHtmlMarkdown-5f7856f2.js +1 -0
  152. package/dist/esm-es5/{debounce-c4785346.js → debounce-efc0e473.js} +1 -1
  153. package/dist/esm-es5/{getBorderRadius-877f6389.js → getBorderRadius-c21a42e5.js} +1 -1
  154. package/dist/esm-es5/{getContrastColor-28c18704.js → getContrastColor-98f0d1d5.js} +1 -1
  155. package/dist/esm-es5/hasInclusivePrice-c49d384d.js +1 -0
  156. package/dist/esm-es5/index-cfd394c8.js +13 -0
  157. package/dist/esm-es5/index.js +1 -1
  158. package/dist/esm-es5/{invoice-055bb6e5.js → invoice-d416ba65.js} +1 -1
  159. package/dist/esm-es5/{isCollectMobileTablet-797cea8b.js → isCollectMobileTablet-48040572.js} +1 -1
  160. package/dist/esm-es5/{isContrastColor-69778cea.js → isContrastColor-c17e83c9.js} +1 -1
  161. package/dist/esm-es5/{isDarkColor-9ddd90cc.js → isDarkColor-3537021b.js} +1 -1
  162. package/dist/esm-es5/loader.js +1 -1
  163. package/dist/esm-es5/localization-f4a7fb5a.js +1 -0
  164. package/dist/esm-es5/paypal-6af6b978.js +17 -0
  165. package/dist/esm-es5/{placeTestOrder-0a74923e.js → placeTestOrder-d19ac166.js} +1 -1
  166. package/dist/esm-es5/{renderCheckoutCurrency-bd059ecf.js → renderCheckoutCurrency-c8aa8e7e.js} +1 -1
  167. package/dist/esm-es5/{renderFallback-3f010b48.js → renderFallback-b250f4e9.js} +1 -1
  168. package/dist/esm-es5/{submitGtag-89d6e9cb.js → submitGtag-13de9f1f.js} +1 -1
  169. package/dist/esm-es5/{throttle-ce2432ab.js → throttle-0504ba2c.js} +1 -1
  170. package/dist/esm-es5/{updateCheckoutSessionAttributes-047a6cd4.js → updateCheckoutSessionAttributes-b9f7e982.js} +1 -1
  171. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -0
  172. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  173. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  174. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  175. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  176. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  177. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  178. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -0
  179. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  180. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  181. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  182. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  183. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  184. package/dist/esm-es5/zonos-component.entry.js +1 -1
  185. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  186. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  187. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  188. package/dist/esm-es5/zonos-elements.js +1 -1
  189. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  190. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  191. package/dist/esm-es5/zonos-input.entry.js +1 -1
  192. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  193. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  194. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  195. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  196. package/dist/esm-es5/zonos-link.entry.js +1 -1
  197. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  198. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  199. package/dist/esm-es5/zonos-store-credit.entry.js +1 -0
  200. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  201. package/dist/esm-es5/zonos-text.entry.js +1 -1
  202. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  203. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  204. package/dist/esm-es5/zonosStore-5242a58d.js +1 -0
  205. package/dist/scripts/index.d.ts +60 -3
  206. package/dist/scripts/index.js +1 -1
  207. package/dist/scripts/loadZonos.js +1 -1
  208. package/dist/scripts/zonos.js +1 -1
  209. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +1 -0
  210. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.d.ts +17 -0
  211. package/dist/types/components/store/checkout/cart.d.ts +8 -1
  212. package/dist/types/components/store/checkout/storeCredit.d.ts +111 -0
  213. package/dist/types/components/store/checkout/stripe.d.ts +1 -1
  214. package/dist/types/components/store/translationStore/strings.arabic.d.ts +33 -0
  215. package/dist/types/components/store/translationStore/strings.base.d.ts +33 -0
  216. package/dist/types/components/store/translationStore/strings.chinese.d.ts +33 -0
  217. package/dist/types/components/store/translationStore/strings.danish.d.ts +33 -0
  218. package/dist/types/components/store/translationStore/strings.dutch.d.ts +33 -0
  219. package/dist/types/components/store/translationStore/strings.french.d.ts +33 -0
  220. package/dist/types/components/store/translationStore/strings.german.d.ts +33 -0
  221. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +33 -0
  222. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +33 -0
  223. package/dist/types/components/store/translationStore/strings.italian.d.ts +33 -0
  224. package/dist/types/components/store/translationStore/strings.japanese.d.ts +33 -0
  225. package/dist/types/components/store/translationStore/strings.korean.d.ts +33 -0
  226. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +33 -0
  227. package/dist/types/components/store/translationStore/strings.polish.d.ts +33 -0
  228. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +33 -0
  229. package/dist/types/components/store/translationStore/strings.russian.d.ts +33 -0
  230. package/dist/types/components/store/translationStore/strings.spanish.d.ts +33 -0
  231. package/dist/types/components/store/translationStore/strings.swedish.d.ts +33 -0
  232. package/dist/types/components/store/translationStore/strings.turkish.d.ts +33 -0
  233. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +33 -0
  234. package/dist/types/components.d.ts +21 -0
  235. package/dist/types/environment.d.ts +2 -2
  236. package/dist/types/types/checkout/api/CheckoutSession.d.ts +9 -1
  237. package/dist/types/types/generated/graphql.internal.types.d.ts +713 -4
  238. package/dist/types/types/generated/graphql.internal.types.ts +956 -4
  239. package/dist/types/types/global.d.ts +2 -0
  240. package/dist/zonos-elements/index.esm.js +1 -1
  241. package/dist/zonos-elements/p-058f6124.js +1 -0
  242. package/dist/zonos-elements/{p-7aa50ef2.entry.js → p-0d18d94b.entry.js} +1 -1
  243. package/dist/zonos-elements/{p-c01f86b4.entry.js → p-12459b59.entry.js} +1 -1
  244. package/dist/zonos-elements/{p-de8899bc.js → p-13ed3789.js} +1 -1
  245. package/dist/zonos-elements/{p-8205ae87.system.entry.js → p-17fbfda0.system.entry.js} +1 -1
  246. package/dist/zonos-elements/p-18d411c3.system.entry.js +1 -0
  247. package/dist/zonos-elements/{p-69b9b711.entry.js → p-1b56814d.entry.js} +1 -1
  248. package/dist/zonos-elements/p-1b8771bb.js +1 -0
  249. package/dist/zonos-elements/{p-eea7ac64.js → p-1e6509d7.js} +1 -1
  250. package/dist/zonos-elements/{p-c7311ce5.system.entry.js → p-1f63615f.system.entry.js} +1 -1
  251. package/dist/zonos-elements/{p-5062dcf3.system.entry.js → p-234f0339.system.entry.js} +1 -1
  252. package/dist/zonos-elements/p-2435f196.entry.js +1 -0
  253. package/dist/zonos-elements/p-26848428.entry.js +1 -0
  254. package/dist/zonos-elements/p-28d62fc8.system.entry.js +1 -0
  255. package/dist/zonos-elements/p-29b60bf3.system.js +1 -0
  256. package/dist/zonos-elements/{p-1c4d12f0.entry.js → p-2aa44601.entry.js} +1 -1
  257. package/dist/zonos-elements/p-2b7ef406.system.js +18 -0
  258. package/dist/zonos-elements/p-34d10122.js +1 -0
  259. package/dist/zonos-elements/{p-e17bbcee.entry.js → p-3827041d.entry.js} +1 -1
  260. package/dist/zonos-elements/{p-14c920b2.system.entry.js → p-38881641.system.entry.js} +1 -1
  261. package/dist/zonos-elements/{p-c6e3d747.system.js → p-3fbd9cc0.system.js} +1 -1
  262. package/dist/zonos-elements/p-45bd8072.system.js +1 -0
  263. package/dist/zonos-elements/{p-bc4bfa06.js → p-48228d76.js} +1 -1
  264. package/dist/zonos-elements/{p-9c49daa4.entry.js → p-4aefd668.entry.js} +1 -1
  265. package/dist/zonos-elements/p-4d5932ac.system.entry.js +1 -0
  266. package/dist/zonos-elements/{p-a359e0a2.system.entry.js → p-4e4fa1fb.system.entry.js} +1 -1
  267. package/dist/zonos-elements/{p-c36696f9.js → p-4f7d64f6.js} +1 -1
  268. package/dist/zonos-elements/p-53db5f85.system.js +1 -0
  269. package/dist/zonos-elements/{p-403b9fca.entry.js → p-59fe8416.entry.js} +1 -1
  270. package/dist/zonos-elements/{p-7b400b5f.system.entry.js → p-5ca50862.system.entry.js} +1 -1
  271. package/dist/zonos-elements/p-5dd86dd9.system.js +1 -0
  272. package/dist/zonos-elements/p-5f628e57.entry.js +1 -0
  273. package/dist/zonos-elements/{p-b54a95ea.system.entry.js → p-5fceccc3.system.entry.js} +1 -1
  274. package/dist/zonos-elements/p-64ad0854.entry.js +1 -0
  275. package/dist/zonos-elements/{p-942358eb.system.js → p-65892fa7.system.js} +1 -1
  276. package/dist/zonos-elements/{p-aa028d91.entry.js → p-66d72216.entry.js} +1 -1
  277. package/dist/zonos-elements/{p-58248f03.entry.js → p-66e1dc55.entry.js} +1 -1
  278. package/dist/zonos-elements/{p-57fa64d7.js → p-67897a0d.js} +1 -1
  279. package/dist/zonos-elements/{p-917f714c.system.entry.js → p-6f19845a.system.entry.js} +1 -1
  280. package/dist/zonos-elements/{p-291f7ccb.system.entry.js → p-7042c6da.system.entry.js} +1 -1
  281. package/dist/zonos-elements/{p-232b0fb5.system.entry.js → p-70c8a47d.system.entry.js} +1 -1
  282. package/dist/zonos-elements/p-7261e245.system.js +13 -0
  283. package/dist/zonos-elements/p-741e07e1.system.entry.js +1 -0
  284. package/dist/zonos-elements/{p-3e67ca05.entry.js → p-7427dd1e.entry.js} +1 -1
  285. package/dist/zonos-elements/{p-23d497e3.system.js → p-7501c637.system.js} +1 -1
  286. package/dist/zonos-elements/p-77113201.system.js +1 -0
  287. package/dist/zonos-elements/{p-a12cb7ce.entry.js → p-77c0a02b.entry.js} +1 -1
  288. package/dist/zonos-elements/p-7d7ffb42.js +1 -0
  289. package/dist/zonos-elements/{p-1acf0a71.system.entry.js → p-85529818.system.entry.js} +1 -1
  290. package/dist/zonos-elements/{p-cfb9b847.system.entry.js → p-87d89870.system.entry.js} +1 -1
  291. package/dist/zonos-elements/{p-443e1f30.system.js → p-8c6624b6.system.js} +1 -1
  292. package/dist/zonos-elements/{p-57cee1b5.system.entry.js → p-8d5f928c.system.entry.js} +1 -1
  293. package/dist/zonos-elements/p-8f1ab25c.system.entry.js +1 -0
  294. package/dist/zonos-elements/{p-5762e217.js → p-908f13ae.js} +1 -1
  295. package/dist/zonos-elements/{p-63a3d3b9.system.js → p-90b8c428.system.js} +1 -1
  296. package/dist/zonos-elements/{p-8f0f6449.entry.js → p-939ba2a5.entry.js} +1 -1
  297. package/dist/zonos-elements/p-9581bffb.js +1 -0
  298. package/dist/zonos-elements/p-959918fe.system.js +1 -0
  299. package/dist/zonos-elements/p-997b7eef.js +1 -0
  300. package/dist/zonos-elements/{p-0792688d.system.entry.js → p-9bc5e944.system.entry.js} +1 -1
  301. package/dist/zonos-elements/p-9c6917ab.system.js +1 -0
  302. package/dist/zonos-elements/{p-f8d56ba9.system.js → p-9d44fef6.system.js} +1 -1
  303. package/dist/zonos-elements/p-9d64783a.entry.js +1 -0
  304. package/dist/zonos-elements/{p-71a8d971.system.entry.js → p-9f49e35a.system.entry.js} +1 -1
  305. package/dist/zonos-elements/{p-2f55895c.system.entry.js → p-a026b5ad.system.entry.js} +1 -1
  306. package/dist/zonos-elements/{p-85e59f3a.system.entry.js → p-a1a3657e.system.entry.js} +1 -1
  307. package/dist/zonos-elements/{p-c2f34b10.system.entry.js → p-a1b0e9a5.system.entry.js} +1 -1
  308. package/dist/zonos-elements/{p-fb9fb873.system.entry.js → p-a1c476d6.system.entry.js} +1 -1
  309. package/dist/zonos-elements/p-a6a401e5.system.entry.js +1 -0
  310. package/dist/zonos-elements/{p-5edef7c3.system.js → p-ab25379f.system.js} +1 -1
  311. package/dist/zonos-elements/p-ac30b7a8.system.js +1 -0
  312. package/dist/zonos-elements/{p-37bb5f2d.entry.js → p-b004146f.entry.js} +1 -1
  313. package/dist/zonos-elements/{p-3908f78d.system.entry.js → p-b07da3e8.system.entry.js} +1 -1
  314. package/dist/zonos-elements/{p-71f10bf0.entry.js → p-b08bf843.entry.js} +1 -1
  315. package/dist/zonos-elements/p-b334c76c.entry.js +1 -0
  316. package/dist/zonos-elements/{p-69212d0f.entry.js → p-b9581a92.entry.js} +1 -1
  317. package/dist/zonos-elements/{p-84cf1a90.system.entry.js → p-bdaf94a4.system.entry.js} +1 -1
  318. package/dist/zonos-elements/{p-231baaf8.entry.js → p-c1ab70d2.entry.js} +1 -1
  319. package/dist/zonos-elements/p-c30a155e.js +1 -0
  320. package/dist/zonos-elements/{p-aedd3911.entry.js → p-c9d4eb42.entry.js} +1 -1
  321. package/dist/zonos-elements/{p-3e85b9f5.system.entry.js → p-cad67b10.system.entry.js} +1 -1
  322. package/dist/zonos-elements/p-cc78c9d4.js +17 -0
  323. package/dist/zonos-elements/p-ce75b047.js +2 -0
  324. package/dist/zonos-elements/{p-909e2bc3.system.js → p-d18a2b2c.system.js} +1 -1
  325. package/dist/zonos-elements/{p-83377e23.entry.js → p-d2301d8a.entry.js} +1 -1
  326. package/dist/zonos-elements/p-d46484aa.entry.js +1 -0
  327. package/dist/zonos-elements/{p-3972663a.system.entry.js → p-d634f954.system.entry.js} +1 -1
  328. package/dist/zonos-elements/{p-14735e9a.system.entry.js → p-dbb3db89.system.entry.js} +1 -1
  329. package/dist/zonos-elements/{p-4592ae49.entry.js → p-ddcbea81.entry.js} +1 -1
  330. package/dist/zonos-elements/p-def2d465.js +1 -0
  331. package/dist/zonos-elements/p-df316670.system.js +1 -0
  332. package/dist/zonos-elements/p-e219d011.js +1 -0
  333. package/dist/zonos-elements/p-e331a235.js +1 -0
  334. package/dist/zonos-elements/p-e4d58bd7.js +1 -0
  335. package/dist/zonos-elements/{p-48475755.entry.js → p-e9ca4447.entry.js} +1 -1
  336. package/dist/zonos-elements/{p-6adfb3af.system.entry.js → p-ed61dedd.system.entry.js} +1 -1
  337. package/dist/zonos-elements/p-ee217693.entry.js +1 -0
  338. package/dist/zonos-elements/{p-ae16dda9.system.js → p-f0855df3.system.js} +1 -1
  339. package/dist/zonos-elements/p-f0938b51.system.entry.js +1 -0
  340. package/dist/zonos-elements/{p-d5b7d3c3.entry.js → p-f25e7f5a.entry.js} +1 -1
  341. package/dist/zonos-elements/{p-0ff93ca6.entry.js → p-f4cc124f.entry.js} +1 -1
  342. package/dist/zonos-elements/p-f830f800.js +1 -0
  343. package/dist/zonos-elements/p-fa0139c3.system.js +1 -0
  344. package/dist/zonos-elements/p-fa5767c3.system.js +1 -0
  345. package/dist/zonos-elements/{p-39fa55c7.entry.js → p-fbfaa4f9.entry.js} +1 -1
  346. package/dist/zonos-elements/p-fe6cc354.entry.js +1 -0
  347. package/dist/zonos-elements/zonos-elements.css +1 -1
  348. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  349. package/dist/zonos-elements/zonos-elements.js +1 -1
  350. package/package.json +70 -52
  351. package/dist/cjs/index-69fa8852.js +0 -1961
  352. package/dist/cjs/zonos-toggle.cjs.entry.js +0 -35
  353. package/dist/esm/index-0bbe9693.js +0 -1928
  354. package/dist/esm/zonos-toggle.entry.js +0 -31
  355. package/dist/esm-es5/cart-ba8f3890.js +0 -1
  356. package/dist/esm-es5/cleanHtmlMarkdown-b5b18743.js +0 -1
  357. package/dist/esm-es5/hasInclusivePrice-6fcc712f.js +0 -1
  358. package/dist/esm-es5/index-0bbe9693.js +0 -2
  359. package/dist/esm-es5/localization-853b48a9.js +0 -1
  360. package/dist/esm-es5/paypal-8d8518c0.js +0 -17
  361. package/dist/esm-es5/zonos-address-display_9.entry.js +0 -1
  362. package/dist/esm-es5/zonos-toggle.entry.js +0 -1
  363. package/dist/esm-es5/zonosStore-b434e436.js +0 -1
  364. package/dist/zonos-elements/p-002e45f9.system.js +0 -17
  365. package/dist/zonos-elements/p-01dada4e.js +0 -1
  366. package/dist/zonos-elements/p-09aabce0.js +0 -1
  367. package/dist/zonos-elements/p-0b7beb16.system.entry.js +0 -1
  368. package/dist/zonos-elements/p-0ef2a242.js +0 -1
  369. package/dist/zonos-elements/p-0f787f5d.entry.js +0 -1
  370. package/dist/zonos-elements/p-1dbeeab2.entry.js +0 -1
  371. package/dist/zonos-elements/p-1f894984.js +0 -1
  372. package/dist/zonos-elements/p-27f6930b.js +0 -1
  373. package/dist/zonos-elements/p-2c2a1339.system.entry.js +0 -1
  374. package/dist/zonos-elements/p-3bec13dd.system.js +0 -1
  375. package/dist/zonos-elements/p-41299ffb.js +0 -1
  376. package/dist/zonos-elements/p-43a22d85.entry.js +0 -1
  377. package/dist/zonos-elements/p-4ffbb0d6.system.js +0 -1
  378. package/dist/zonos-elements/p-64661dd1.js +0 -1
  379. package/dist/zonos-elements/p-719403e0.system.js +0 -1
  380. package/dist/zonos-elements/p-71d855b8.system.entry.js +0 -1
  381. package/dist/zonos-elements/p-72ff005c.entry.js +0 -1
  382. package/dist/zonos-elements/p-786d1c24.js +0 -1
  383. package/dist/zonos-elements/p-7dba5f23.system.js +0 -1
  384. package/dist/zonos-elements/p-866afec1.js +0 -1
  385. package/dist/zonos-elements/p-94c5fbfc.system.entry.js +0 -1
  386. package/dist/zonos-elements/p-989d3af9.system.js +0 -2
  387. package/dist/zonos-elements/p-9fa90292.system.entry.js +0 -1
  388. package/dist/zonos-elements/p-ab41bab5.js +0 -2
  389. package/dist/zonos-elements/p-abf38ed6.js +0 -1
  390. package/dist/zonos-elements/p-ae26aec5.system.js +0 -1
  391. package/dist/zonos-elements/p-af85846e.system.js +0 -1
  392. package/dist/zonos-elements/p-b2a0ab4a.js +0 -1
  393. package/dist/zonos-elements/p-b2ae8eb7.system.js +0 -1
  394. package/dist/zonos-elements/p-bf5e47e2.entry.js +0 -1
  395. package/dist/zonos-elements/p-c027a832.system.js +0 -1
  396. package/dist/zonos-elements/p-c1fb3a2d.entry.js +0 -1
  397. package/dist/zonos-elements/p-c2442878.system.js +0 -1
  398. package/dist/zonos-elements/p-d45285aa.system.js +0 -1
  399. package/dist/zonos-elements/p-dcf999d8.entry.js +0 -1
  400. package/dist/zonos-elements/p-e9e6bea7.system.entry.js +0 -1
  401. package/dist/zonos-elements/p-f6c2c743.entry.js +0 -1
  402. package/dist/zonos-elements/p-fc776473.js +0 -1
  403. package/dist/zonos-elements/p-fe06c9ea.js +0 -17
  404. package/dist/zonos-elements/p-fe96e239.system.js +0 -1
@@ -1,9 +1,252 @@
1
- import { z as zonosStore, c as createStore } from './zonosStore-b434e436.js';
2
- import { s as storageStore, l as localizationStore, e as getOverridenZCountry, t as translate, f as filterValidTests, b as storageStoreSetEnabledVariantTestKeys } from './localization-853b48a9.js';
3
- import { f as fallbackApiList, h as handleFetch, g as getIsTestMode, a as getIsStagingMode, s as sendErrorLog, l as logError, j as jsonParse } from './handleFetch-a844cac1.js';
1
+ import { c as createStore, z as zonosStore } from './zonosStore-5242a58d.js';
2
+ import { s as storageStore, l as localizationStore, e as getOverridenZCountry, t as translate, f as filterValidTests, b as storageStoreSetEnabledVariantTestKeys } from './localization-f4a7fb5a.js';
4
3
  import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
5
- import { i as isDarkColor } from './isDarkColor-9ddd90cc.js';
6
- import { g as getBorderRadius } from './getBorderRadius-877f6389.js';
4
+ import { h as handleFetch, l as logError, f as fallbackApiList, g as getIsTestMode, a as getIsStagingMode, s as sendErrorLog, j as jsonParse } from './handleFetch-a844cac1.js';
5
+ import { i as isDarkColor } from './isDarkColor-3537021b.js';
6
+ import { g as getBorderRadius } from './getBorderRadius-c21a42e5.js';
7
+
8
+ const getCheckoutSession = async () => {
9
+ if (!storageStore.checkoutSessionId) {
10
+ return {
11
+ errors: [{ message: 'No checkout session id found' }],
12
+ json: null,
13
+ };
14
+ }
15
+ const searchParams = new URLSearchParams();
16
+ searchParams.set('checkoutSessionId', storageStore.checkoutSessionId);
17
+ const { errors, json } = await handleFetch(`/api/zonos-elements/get-checkout-session?${searchParams.toString()}`);
18
+ return { errors, json };
19
+ };
20
+
21
+ const { onChange: storeCreditStoreOnChange, reset: reset$2, state: storeCreditStore, } = createStore(() => ({
22
+ amountToApply: null,
23
+ appliedAmount: null,
24
+ availableBalance: null,
25
+ error: null,
26
+ isApplying: false,
27
+ isEnabled: false,
28
+ orderIdCreated: null,
29
+ remainingBalance: null,
30
+ useFullBalance: true,
31
+ }));
32
+ /**
33
+ * Reset store credit store to initial state
34
+ */
35
+ const storeCreditStoreReset = () => {
36
+ reset$2();
37
+ };
38
+ /**
39
+ * Set the available balance from the checkout session's customerProfile.storeCreditBalance
40
+ */
41
+ const storeCreditStoreSetBalanceFromSession = (balance) => {
42
+ log('Store credit balance from session', 'info', balance);
43
+ storeCreditStore.availableBalance = balance;
44
+ };
45
+ /**
46
+ * Re-fetch the store credit balance from the checkout session.
47
+ * Called when the payment step loads to ensure the balance is fresh.
48
+ */
49
+ const storeCreditStoreRefreshBalance = async () => {
50
+ var _a, _b;
51
+ const { errors, json } = await getCheckoutSession();
52
+ if (errors.length || !json) {
53
+ logError('Failed to refresh store credit balance');
54
+ return;
55
+ }
56
+ const balance = (_b = (_a = json.checkoutSession.customerProfile) === null || _a === void 0 ? void 0 : _a.storeCreditBalance) !== null && _b !== void 0 ? _b : null;
57
+ storeCreditStoreSetBalanceFromSession(balance);
58
+ };
59
+ /**
60
+ * Apply store credit to the checkout session.
61
+ * This must be called BEFORE payment confirmation.
62
+ * The amount/mode are already set via checkout session update with storeCreditApplication.
63
+ */
64
+ const storeCreditStoreApplyCredit = async () => {
65
+ var _a;
66
+ const checkoutSessionId = storageStore.checkoutSessionId;
67
+ if (!checkoutSessionId) {
68
+ const error = 'No checkout session found';
69
+ logError(error);
70
+ storeCreditStore.error = error;
71
+ return { error, success: false };
72
+ }
73
+ log('Applying store credit', 'info', { checkoutSessionId });
74
+ storeCreditStore.isApplying = true;
75
+ storeCreditStore.error = null;
76
+ try {
77
+ const { errors, json } = await handleFetch('/api/zonos-elements/store-credit/apply', {
78
+ body: {
79
+ checkoutSessionId,
80
+ },
81
+ method: 'POST',
82
+ });
83
+ if (errors.length > 0 || !json) {
84
+ const errorMessage = ((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.message) || 'Failed to apply store credit';
85
+ logError(errorMessage);
86
+ storeCreditStore.error = errorMessage;
87
+ storeCreditStore.isApplying = false;
88
+ return { error: errorMessage, success: false };
89
+ }
90
+ storeCreditStore.appliedAmount = json.amountApplied;
91
+ storeCreditStore.remainingBalance = json.remainingBalance;
92
+ storeCreditStore.isApplying = false;
93
+ log('Store credit applied', 'info', {
94
+ amountApplied: json.amountApplied,
95
+ remainingBalance: json.remainingBalance,
96
+ });
97
+ return { error: null, success: true };
98
+ }
99
+ catch (e) {
100
+ const errorMessage = e instanceof Error ? e.message : 'Failed to apply store credit';
101
+ logError(errorMessage);
102
+ storeCreditStore.error = errorMessage;
103
+ storeCreditStore.isApplying = false;
104
+ return { error: errorMessage, success: false };
105
+ }
106
+ };
107
+ /**
108
+ * Enable or disable store credit usage.
109
+ * When enabling, defaults to full balance mode.
110
+ * When disabling, clears the amount.
111
+ */
112
+ const storeCreditStoreSetEnabled = (enabled) => {
113
+ storeCreditStore.isEnabled = enabled;
114
+ storeCreditStore.error = null;
115
+ if (!enabled) {
116
+ storeCreditStore.amountToApply = null;
117
+ }
118
+ };
119
+ /**
120
+ * Set the amount of store credit to apply
121
+ * Validates against available balance and cart total
122
+ */
123
+ const storeCreditStoreSetAmount = (amount) => {
124
+ if (amount === null) {
125
+ storeCreditStore.amountToApply = null;
126
+ storeCreditStore.error = null;
127
+ return;
128
+ }
129
+ // Validate amount
130
+ if (amount <= 0) {
131
+ storeCreditStore.error = 'Amount must be greater than zero';
132
+ return;
133
+ }
134
+ if (storeCreditStore.availableBalance !== null &&
135
+ amount > storeCreditStore.availableBalance) {
136
+ storeCreditStore.error = 'Amount exceeds available balance';
137
+ return;
138
+ }
139
+ const orderTotal = cartStore.total + (cartStore.storeCredit || 0);
140
+ if (amount > orderTotal) {
141
+ storeCreditStore.error = 'Amount exceeds order total';
142
+ return;
143
+ }
144
+ storeCreditStore.error = null;
145
+ storeCreditStore.amountToApply = amount;
146
+ };
147
+ /**
148
+ * Toggle whether to use full balance or custom amount.
149
+ * When switching to custom mode, clears the applied amount so the user
150
+ * must explicitly apply via the Apply button.
151
+ */
152
+ const storeCreditStoreSetUseFullBalance = (useFullBalance) => {
153
+ storeCreditStore.useFullBalance = useFullBalance;
154
+ storeCreditStore.error = null;
155
+ if (useFullBalance && storeCreditStore.availableBalance !== null) {
156
+ const orderTotal = cartStore.total + (cartStore.storeCredit || 0);
157
+ const maxAmount = Math.min(storeCreditStore.availableBalance, orderTotal);
158
+ storeCreditStore.amountToApply = maxAmount;
159
+ }
160
+ else if (!useFullBalance) {
161
+ storeCreditStore.amountToApply = null;
162
+ }
163
+ };
164
+ /**
165
+ * Get the storeCreditApplication input for checkout session update.
166
+ * Sends mode: 'NONE' when store credit is not being used to clear any
167
+ * previously applied store credit on the backend.
168
+ */
169
+ const storeCreditStoreGetInput = () => {
170
+ if (!storeCreditStore.isEnabled || storeCreditStore.amountToApply === null) {
171
+ return { mode: 'NONE' };
172
+ }
173
+ if (storeCreditStore.useFullBalance) {
174
+ return { mode: 'FULL' };
175
+ }
176
+ return {
177
+ amount: storeCreditStore.amountToApply,
178
+ mode: 'PARTIAL',
179
+ };
180
+ };
181
+ /**
182
+ * Get the effective amount to apply based on settings
183
+ */
184
+ const storeCreditStoreGetEffectiveAmount = () => {
185
+ if (!storeCreditStore.isEnabled ||
186
+ storeCreditStore.availableBalance === null) {
187
+ return 0;
188
+ }
189
+ if (storeCreditStore.useFullBalance) {
190
+ return Math.min(storeCreditStore.availableBalance, cartStore.total + (cartStore.storeCredit || 0));
191
+ }
192
+ return storeCreditStore.amountToApply || 0;
193
+ };
194
+ /**
195
+ * Check whether the effective store credit amount covers the full order total.
196
+ * When true, the Stripe/PayPal payment flow should be skipped and
197
+ * `storeCreditStoreCreateOrder` should be used instead.
198
+ *
199
+ * Relies on the backend's computed `cartStore.total` (remaining amount to pay
200
+ * after store credit) rather than a client-side comparison, which avoids issues
201
+ * with currency mismatches or rounding.
202
+ */
203
+ const storeCreditStoreCoversFullAmount = () => {
204
+ // Only consider full coverage after the backend has confirmed store credit
205
+ // was applied (cartStore.storeCredit > 0) and the remaining total is 0.
206
+ return (storeCreditStore.amountToApply !== null &&
207
+ storeCreditStore.amountToApply > 0 &&
208
+ cartStore.storeCredit > 0 &&
209
+ cartStore.total <= 0);
210
+ };
211
+ /**
212
+ * Create an order paid entirely by store credit.
213
+ * Should only be called when `storeCreditStoreCoversFullAmount()` is true.
214
+ */
215
+ const storeCreditStoreCreateOrder = async () => {
216
+ var _a, _b, _c;
217
+ const checkoutSessionId = storageStore.checkoutSessionId;
218
+ if (!checkoutSessionId) {
219
+ const error = 'No checkout session found';
220
+ logError(error);
221
+ storeCreditStore.error = error;
222
+ return { error, orderId: null, success: false };
223
+ }
224
+ log('Creating store credit order', 'info', { checkoutSessionId });
225
+ try {
226
+ const { errors, json } = await handleFetch('/api/zonos-elements/store-credit/order-create', {
227
+ body: {
228
+ checkoutSessionId,
229
+ },
230
+ method: 'POST',
231
+ });
232
+ if (errors.length > 0 || !json) {
233
+ const errorMessage = ((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.message) || 'Failed to create store credit order';
234
+ logError(errorMessage);
235
+ storeCreditStore.error = errorMessage;
236
+ return { error: errorMessage, orderId: null, success: false };
237
+ }
238
+ const orderId = ((_c = (_b = json.checkoutSessionStoreCreditOrderCreate) === null || _b === void 0 ? void 0 : _b.order) === null || _c === void 0 ? void 0 : _c.id) || null;
239
+ storeCreditStore.orderIdCreated = orderId;
240
+ log('Store credit order created', 'info', { orderId });
241
+ return { error: null, orderId, success: true };
242
+ }
243
+ catch (e) {
244
+ const errorMessage = e instanceof Error ? e.message : 'Failed to create store credit order';
245
+ logError(errorMessage);
246
+ storeCreditStore.error = errorMessage;
247
+ return { error: errorMessage, orderId: null, success: false };
248
+ }
249
+ };
7
250
 
8
251
  /**
9
252
  * Extract first name and last name from the name string
@@ -511,19 +754,6 @@ const sortServiceLevelOptionsByAmount = (serviceLevels) => {
511
754
  return sortedServiceLevels;
512
755
  };
513
756
 
514
- const getCheckoutSession = async () => {
515
- if (!storageStore.checkoutSessionId) {
516
- return {
517
- errors: [{ message: 'No checkout session id found' }],
518
- json: null,
519
- };
520
- }
521
- const searchParams = new URLSearchParams();
522
- searchParams.set('checkoutSessionId', storageStore.checkoutSessionId);
523
- const { errors, json } = await handleFetch(`/api/zonos-elements/get-checkout-session?${searchParams.toString()}`);
524
- return { errors, json };
525
- };
526
-
527
757
  /**
528
758
  * Validate checkout session before confirming payment
529
759
  */
@@ -1636,7 +1866,7 @@ const stripeStoreUpdateCheckoutSessionBaseCurrency = async () => {
1636
1866
  /**
1637
1867
  * Update checkout session. Use for updating amount with landed cost id, or update session when cart items change
1638
1868
  */
1639
- const stripeStoreUpdateCheckoutSession = async ({ adjustmentsAmount, cartId, currency, id, itemsAmount, landedCostId, presentmentCountryCode, }) => {
1869
+ const stripeStoreUpdateCheckoutSession = async ({ adjustmentsAmount, cartId, currency, id, itemsAmount, landedCostId, presentmentCountryCode, storeCreditApplication, }) => {
1640
1870
  const varianceTestInput = storageStore.enabledVariantTestKeys || [];
1641
1871
  // No need to set loading state here because this function will be called under the hood to update
1642
1872
  // landed cost id for the section.
@@ -1659,6 +1889,7 @@ const stripeStoreUpdateCheckoutSession = async ({ adjustmentsAmount, cartId, cur
1659
1889
  presentmentCountryCode,
1660
1890
  shipToPartyId: stripeStore.partyShippingId,
1661
1891
  skipPaymentIntent: stripeStore.skipPaymentIntent,
1892
+ storeCreditApplication,
1662
1893
  varianceTestInput,
1663
1894
  },
1664
1895
  method: 'POST',
@@ -1835,6 +2066,7 @@ const { onChange: cartStoreOnChange, reset, state: cartStore, } = createStore(()
1835
2066
  shippingData: null,
1836
2067
  shouldHideDiscountInput: false,
1837
2068
  step: 'customer-info',
2069
+ storeCredit: 0,
1838
2070
  subtotal: 0,
1839
2071
  tabItems: {
1840
2072
  'customer-info': {
@@ -1923,8 +2155,16 @@ const cartStoreCheckItemRestrictions = (itemsWorkflow) => {
1923
2155
  restrictedItems: mappedRestrictedItems,
1924
2156
  };
1925
2157
  };
2158
+ let storeCreditUpdateTimeout = null;
1926
2159
  const cartStoreReset = () => {
1927
2160
  storageStore.checkoutSessionId = null;
2161
+ // clear pending store credit debounce timer
2162
+ if (storeCreditUpdateTimeout) {
2163
+ clearTimeout(storeCreditUpdateTimeout);
2164
+ storeCreditUpdateTimeout = null;
2165
+ }
2166
+ // reset store credit store
2167
+ storeCreditStoreReset();
1928
2168
  // reset cart store
1929
2169
  reset();
1930
2170
  };
@@ -1938,11 +2178,13 @@ const cartStoreUpdateToErrorState = ({ messages, title, }) => {
1938
2178
  };
1939
2179
  };
1940
2180
  const cartStoreApplySubtotals = ({ dutiesTaxesFeesEstimate, method, subtotals, }) => {
2181
+ var _a;
1941
2182
  // update exchange rate so we can use it to display cart items
1942
2183
  cartStore.exchangeRate = subtotals.exchangeRate;
1943
2184
  cartStore.adjustmentTotal = subtotals.adjustments;
1944
2185
  cartStore.dutiesTaxesFees =
1945
2186
  method === 'DAP' ? null : subtotals.landedCostTotal;
2187
+ cartStore.storeCredit = (_a = subtotals.storeCredit) !== null && _a !== void 0 ? _a : 0;
1946
2188
  cartStore.subtotal = subtotals.items;
1947
2189
  cartStore.total = subtotals.total;
1948
2190
  cartStore.currency = subtotals.presentmentCurrencyCode;
@@ -1959,13 +2201,15 @@ const cartStoreHasOneEligibleItem = () => {
1959
2201
  return !!checkItems.find(item => !item.isRestricted);
1960
2202
  };
1961
2203
  const cartStoreSetCheckoutSession = (checkoutSession) => {
1962
- var _a, _b, _c, _d, _e;
2204
+ var _a, _b, _c, _d, _e, _f, _g;
1963
2205
  // update stripe store with updated information
1964
2206
  stripeStore.clientSecret = checkoutSession.clientSecret;
1965
2207
  stripeStore.stripeCustomerSessionClientSecret =
1966
2208
  checkoutSession.customerSessionClientSecret;
1967
2209
  stripeStore.customerProfile = checkoutSession.customerProfile;
1968
2210
  cartStore.checkoutSession = checkoutSession;
2211
+ // Populate store credit balance from checkout session customer profile
2212
+ storeCreditStoreSetBalanceFromSession((_b = (_a = checkoutSession.customerProfile) === null || _a === void 0 ? void 0 : _a.storeCreditBalance) !== null && _b !== void 0 ? _b : null);
1969
2213
  if (!checkoutSession.id) {
1970
2214
  // Log error to track down the issue
1971
2215
  void sendErrorLog({
@@ -1985,10 +2229,10 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
1985
2229
  const availableSelectedVariantTestKeys = filterValidTests(checkoutSession.varianceTestResults || []);
1986
2230
  storageStoreSetEnabledVariantTestKeys(availableSelectedVariantTestKeys);
1987
2231
  // Check if there is a redirect URL in the metadata to override
1988
- const externalConfirmationPageURL = ((_c = (_b = (_a = cartStore.checkoutSession) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'externalConfirmationPageURL')) === null || _c === void 0 ? void 0 : _c.value) ||
2232
+ const externalConfirmationPageURL = ((_e = (_d = (_c = cartStore.checkoutSession) === null || _c === void 0 ? void 0 : _c.metadata) === null || _d === void 0 ? void 0 : _d.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'externalConfirmationPageURL')) === null || _e === void 0 ? void 0 : _e.value) ||
1989
2233
  (
1990
2234
  // Sometimes externalConfirmationPageURL is not in checkoutSession create/update, check if there is a redirect URL in the cart metadata to override
1991
- (_e = (_d = window.Zonos.cartData) === null || _d === void 0 ? void 0 : _d.metadata.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'externalConfirmationPageURL')) === null || _e === void 0 ? void 0 : _e.value) ||
2235
+ (_g = (_f = window.Zonos.cartData) === null || _f === void 0 ? void 0 : _f.metadata.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'externalConfirmationPageURL')) === null || _g === void 0 ? void 0 : _g.value) ||
1992
2236
  null;
1993
2237
  if (externalConfirmationPageURL) {
1994
2238
  log(`Found externalConfirmationPageURL: ${externalConfirmationPageURL}`);
@@ -2259,5 +2503,49 @@ const cartStoreResetTabItems = () => {
2259
2503
  cartStore.tabItems = Object.assign(Object.assign({}, cartStore.tabItems), { 'customer-info': Object.assign(Object.assign({}, cartStore.tabItems['customer-info']), { isDone: false }), payment: Object.assign(Object.assign({}, cartStore.tabItems.payment), { isDone: false }), shipping: Object.assign(Object.assign({}, cartStore.tabItems.shipping), { isDone: false }) });
2260
2504
  cartStoreResetSelectedShippingOption();
2261
2505
  };
2506
+ const cartStoreUpdateStoreCreditImmediate = async () => {
2507
+ var _a, _b;
2508
+ if (!storageStore.checkoutSessionId) {
2509
+ log('Could not update store credit without checkout session id', 'info');
2510
+ return;
2511
+ }
2512
+ const selectedLandedCost = cartStore.selectedLandedCost;
2513
+ const currency = cartStore.currency || ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '';
2514
+ const adjustmentsAmount = cartStore.adjustments.reduce((prev, adj) => prev + adj.amount, 0);
2515
+ const itemsAmount = cartStore.items.reduce((amount, item) => amount + item.amount * item.quantity, 0);
2516
+ const { errors, json } = await stripeStoreUpdateCheckoutSession({
2517
+ adjustmentsAmount,
2518
+ cartId: window.Zonos.cartId,
2519
+ currency,
2520
+ id: storageStore.checkoutSessionId,
2521
+ itemsAmount,
2522
+ landedCostId: selectedLandedCost === null || selectedLandedCost === void 0 ? void 0 : selectedLandedCost.landedCostId,
2523
+ presentmentCountryCode: localizationStore.selectedCountryCode,
2524
+ storeCreditApplication: storeCreditStoreGetInput(),
2525
+ });
2526
+ if (errors.length > 0 || !json) {
2527
+ logError('Error updating checkout session with store credit');
2528
+ return;
2529
+ }
2530
+ // Apply updated subtotals from the response
2531
+ cartStoreApplySubtotals({
2532
+ method: ((_b = json.checkoutSessionUpdate.landedCost) === null || _b === void 0 ? void 0 : _b.method) || 'DDP',
2533
+ subtotals: json.checkoutSessionUpdate.subtotals,
2534
+ });
2535
+ cartStoreSetCheckoutSession(json.checkoutSessionUpdate);
2536
+ };
2537
+ /**
2538
+ * Update the checkout session with the current store credit selection.
2539
+ * Debounced to prevent multiple rapid requests when store changes cascade.
2540
+ */
2541
+ const cartStoreUpdateStoreCredit = () => {
2542
+ if (storeCreditUpdateTimeout) {
2543
+ clearTimeout(storeCreditUpdateTimeout);
2544
+ }
2545
+ storeCreditUpdateTimeout = setTimeout(() => {
2546
+ storeCreditUpdateTimeout = null;
2547
+ void cartStoreUpdateStoreCreditImmediate();
2548
+ }, 300);
2549
+ };
2262
2550
 
2263
- export { validateCheckoutSession as A, stripeStoreOnChange as B, stripeStoreBuildAddressForPartyCreate as C, cartStoreUpdateSelectedShippingOption as D, cartStoreHasOneEligibleItem as E, stripeStoreApplyPromoCode as F, stripeStoreRemovePromoCode as G, stripeStoreResetPromoCode as H, stripeStoreMessageBasedOnStatus as I, stripeStoreTranslateAddressToLatin as J, extractName as K, stripeStoreAsyncAddressUpdate as L, cartStoreGetShippingTransitInfo as M, cartStoreGetMethod as N, sortServiceLevelOptionsByAmount as O, stripeStoreSaveDomesticShippingSession as a, stripeStore as b, stripeStoreRetrievePayment as c, cartStore as d, cartStoreUpdateItems as e, cartStoreReset as f, cartStoreResetTabItems as g, cartStoreClearCheckoutInterval as h, initStripeElements as i, stripeStoreInitCheckoutSession as j, stripeStoreGetPaymentIntent as k, cartStoreStartCheckoutInterval as l, getCheckoutSessionBody as m, cartStoreUpdateToErrorState as n, stripeStoreCleanupDomesticShippingSession as o, cartStoreSetCheckoutSession as p, stripeStorePrefetchLandedCost as q, cartStoreNextStep as r, stripeStoreGetDomesticShippingSession as s, trackConversionEvent as t, stripeStoreUpdateCheckoutSessionBaseCurrency as u, stripeStoreHandleInventoryCheck as v, stripeStoreConfirmPayment as w, stripeStoreHandleInventoryRefund as x, stripeStoreReset as y, cartStoreOnChange as z };
2551
+ export { stripeStoreConfirmPayment as A, stripeStoreHandleInventoryRefund as B, stripeStoreReset as C, cartStoreOnChange as D, storeCreditStoreGetEffectiveAmount as E, stripeStoreOnChange as F, stripeStoreBuildAddressForPartyCreate as G, cartStoreUpdateSelectedShippingOption as H, cartStoreHasOneEligibleItem as I, stripeStoreApplyPromoCode as J, stripeStoreRemovePromoCode as K, stripeStoreResetPromoCode as L, stripeStoreMessageBasedOnStatus as M, storeCreditStore as N, storeCreditStoreReset as O, stripeStoreTranslateAddressToLatin as P, extractName as Q, stripeStoreAsyncAddressUpdate as R, cartStoreGetShippingTransitInfo as S, cartStoreGetMethod as T, sortServiceLevelOptionsByAmount as U, storeCreditStoreSetEnabled as V, storeCreditStoreSetUseFullBalance as W, cartStoreUpdateStoreCredit as X, storeCreditStoreSetAmount as Y, storeCreditStoreRefreshBalance as Z, stripeStoreSaveDomesticShippingSession as a, stripeStore as b, stripeStoreRetrievePayment as c, cartStore as d, cartStoreUpdateItems as e, cartStoreReset as f, cartStoreResetTabItems as g, cartStoreClearCheckoutInterval as h, initStripeElements as i, stripeStoreInitCheckoutSession as j, stripeStoreGetPaymentIntent as k, cartStoreStartCheckoutInterval as l, getCheckoutSessionBody as m, cartStoreUpdateToErrorState as n, stripeStoreCleanupDomesticShippingSession as o, cartStoreSetCheckoutSession as p, stripeStorePrefetchLandedCost as q, cartStoreNextStep as r, stripeStoreGetDomesticShippingSession as s, trackConversionEvent as t, stripeStoreUpdateCheckoutSessionBaseCurrency as u, stripeStoreHandleInventoryCheck as v, storeCreditStoreApplyCredit as w, storeCreditStoreCoversFullAmount as x, validateCheckoutSession as y, storeCreditStoreCreateOrder as z };
@@ -23,6 +23,10 @@ function trimTrailingNewlines (string) {
23
23
  return string.substring(0, indexEnd)
24
24
  }
25
25
 
26
+ function trimNewlines (string) {
27
+ return trimTrailingNewlines(trimLeadingNewlines(string))
28
+ }
29
+
26
30
  var blockElements = [
27
31
  'ADDRESS', 'ARTICLE', 'ASIDE', 'AUDIO', 'BLOCKQUOTE', 'BODY', 'CANVAS',
28
32
  'CENTER', 'DD', 'DIR', 'DIV', 'DL', 'DT', 'FIELDSET', 'FIGCAPTION', 'FIGURE',
@@ -114,8 +118,7 @@ rules.blockquote = {
114
118
  filter: 'blockquote',
115
119
 
116
120
  replacement: function (content) {
117
- content = content.replace(/^\n+|\n+$/g, '');
118
- content = content.replace(/^/gm, '> ');
121
+ content = trimNewlines(content).replace(/^/gm, '> ');
119
122
  return '\n\n' + content + '\n\n'
120
123
  }
121
124
  };
@@ -137,10 +140,6 @@ rules.listItem = {
137
140
  filter: 'li',
138
141
 
139
142
  replacement: function (content, node, options) {
140
- content = content
141
- .replace(/^\n+/, '') // remove leading newlines
142
- .replace(/\n+$/, '\n') // replace trailing newlines with just a single one
143
- .replace(/\n/gm, '\n '); // indent
144
143
  var prefix = options.bulletListMarker + ' ';
145
144
  var parent = node.parentNode;
146
145
  if (parent.nodeName === 'OL') {
@@ -148,8 +147,11 @@ rules.listItem = {
148
147
  var index = Array.prototype.indexOf.call(parent.children, node);
149
148
  prefix = (start ? Number(start) + index : index + 1) + '. ';
150
149
  }
150
+ var isParagraph = /\n$/.test(content);
151
+ content = trimNewlines(content) + (isParagraph ? '\n' : '');
152
+ content = content.replace(/\n/gm, '\n' + ' '.repeat(prefix.length)); // indent
151
153
  return (
152
- prefix + content + (node.nextSibling && !/\n$/.test(content) ? '\n' : '')
154
+ prefix + content + (node.nextSibling ? '\n' : '')
153
155
  )
154
156
  }
155
157
  };
@@ -1,4 +1,4 @@
1
- import { _ as _root, b as _baseGetTag, i as isObjectLike_1, d as isObject_1 } from './zonosStore-b434e436.js';
1
+ import { _ as _root, b as _baseGetTag, i as isObjectLike_1, d as isObject_1 } from './zonosStore-5242a58d.js';
2
2
 
3
3
  var root = _root;
4
4
 
@@ -1,4 +1,4 @@
1
- import { z as zonosStore } from './zonosStore-b434e436.js';
1
+ import { z as zonosStore } from './zonosStore-5242a58d.js';
2
2
 
3
3
  /**
4
4
  * Get the border radius for the elements based on the style
@@ -1,5 +1,5 @@
1
- import { i as isDarkColor, t as tinycolor } from './isDarkColor-9ddd90cc.js';
2
- import { i as isContrastColor } from './isContrastColor-69778cea.js';
1
+ import { i as isDarkColor, t as tinycolor } from './isDarkColor-3537021b.js';
2
+ import { i as isContrastColor } from './isContrastColor-c17e83c9.js';
3
3
 
4
4
  const getContrastColor = ({ backgroundColor, color, }) => {
5
5
  if (backgroundColor === color) {
@@ -1,4 +1,4 @@
1
- import { l as localizationStore } from './localization-853b48a9.js';
1
+ import { l as localizationStore } from './localization-f4a7fb5a.js';
2
2
 
3
3
  /**
4
4
  * Since the backend and the frontend are using the same keys,