@zonos/elements 1.3.249 → 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 (242) hide show
  1. package/dist/cjs/{cart-eca56521.js → cart-fcd1359c.js} +318 -19
  2. package/dist/cjs/{hasInclusivePrice-e7d67b45.js → hasInclusivePrice-745a8f29.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{invoice-918f2c2b.js → invoice-f040e147.js} +2 -2
  5. package/dist/cjs/{isCollectMobileTablet-89911215.js → isCollectMobileTablet-cf92852e.js} +2 -2
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{localization-878ef681.js → localization-523b793a.js} +660 -0
  8. package/dist/cjs/{paypal-6acca678.js → paypal-8c98c0a1.js} +29 -2
  9. package/dist/cjs/{placeTestOrder-f1c1e939.js → placeTestOrder-9b1e09f0.js} +2 -2
  10. package/dist/cjs/{renderCheckoutCurrency-d9590e81.js → renderCheckoutCurrency-94b6e51d.js} +2 -2
  11. package/dist/cjs/{zonos-address-display_9.cjs.entry.js → zonos-address-display_8.cjs.entry.js} +3 -79
  12. package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-card_5.cjs.entry.js +3 -3
  14. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +74 -20
  15. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +113 -0
  16. package/dist/cjs/zonos-checkout.cjs.entry.js +52 -3
  17. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
  18. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
  19. package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
  20. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  21. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  22. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-elements.cjs.js +1 -1
  24. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  25. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  26. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
  27. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +6 -6
  28. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
  29. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  30. package/dist/cjs/zonos-store-credit.cjs.entry.js +113 -0
  31. package/dist/collection/collection-manifest.json +1 -0
  32. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +3 -0
  33. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +49 -4
  34. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +18 -10
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/assets/StoreCreditIcon.svg +3 -0
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.css +139 -0
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.js +137 -0
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +52 -1
  39. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +1 -1
  40. package/dist/collection/components/main/zonos-controller.js +1 -1
  41. package/dist/collection/components/store/checkout/cart.js +62 -4
  42. package/dist/collection/components/store/checkout/paypal.js +28 -0
  43. package/dist/collection/components/store/checkout/storeCredit.js +237 -0
  44. package/dist/collection/components/store/checkout/stripe.js +2 -1
  45. package/dist/collection/components/store/translationStore/strings.arabic.js +33 -0
  46. package/dist/collection/components/store/translationStore/strings.base.js +33 -0
  47. package/dist/collection/components/store/translationStore/strings.chinese.js +33 -0
  48. package/dist/collection/components/store/translationStore/strings.danish.js +33 -0
  49. package/dist/collection/components/store/translationStore/strings.dutch.js +33 -0
  50. package/dist/collection/components/store/translationStore/strings.french.js +33 -0
  51. package/dist/collection/components/store/translationStore/strings.german.js +33 -0
  52. package/dist/collection/components/store/translationStore/strings.hebrew.js +33 -0
  53. package/dist/collection/components/store/translationStore/strings.indonesian.js +33 -0
  54. package/dist/collection/components/store/translationStore/strings.italian.js +33 -0
  55. package/dist/collection/components/store/translationStore/strings.japanese.js +33 -0
  56. package/dist/collection/components/store/translationStore/strings.korean.js +33 -0
  57. package/dist/collection/components/store/translationStore/strings.norwegian.js +33 -0
  58. package/dist/collection/components/store/translationStore/strings.polish.js +33 -0
  59. package/dist/collection/components/store/translationStore/strings.portuguese.js +33 -0
  60. package/dist/collection/components/store/translationStore/strings.russian.js +33 -0
  61. package/dist/collection/components/store/translationStore/strings.spanish.js +33 -0
  62. package/dist/collection/components/store/translationStore/strings.swedish.js +33 -0
  63. package/dist/collection/components/store/translationStore/strings.turkish.js +33 -0
  64. package/dist/collection/components/store/translationStore/strings.vietnamese.js +33 -0
  65. package/dist/collection/types/generated/graphql.internal.types.js +589 -0
  66. package/dist/esm/{cart-efb30253.js → cart-6e465f7b.js} +309 -21
  67. package/dist/esm/{hasInclusivePrice-565ddbe5.js → hasInclusivePrice-c49d384d.js} +1 -1
  68. package/dist/esm/index.js +7 -7
  69. package/dist/esm/{invoice-0e462fcc.js → invoice-d416ba65.js} +2 -2
  70. package/dist/esm/{isCollectMobileTablet-0bcba25a.js → isCollectMobileTablet-48040572.js} +2 -2
  71. package/dist/esm/loader.js +1 -1
  72. package/dist/esm/{localization-c1aff677.js → localization-f4a7fb5a.js} +660 -0
  73. package/dist/esm/{paypal-06b67be0.js → paypal-6af6b978.js} +29 -2
  74. package/dist/esm/{placeTestOrder-6c9a6c8a.js → placeTestOrder-d19ac166.js} +2 -2
  75. package/dist/esm/{renderCheckoutCurrency-910fea67.js → renderCheckoutCurrency-c8aa8e7e.js} +2 -2
  76. package/dist/esm/{zonos-address-display_9.entry.js → zonos-address-display_8.entry.js} +4 -79
  77. package/dist/esm/zonos-address_4.entry.js +2 -2
  78. package/dist/esm/zonos-card_5.entry.js +3 -3
  79. package/dist/esm/zonos-cart-items_12.entry.js +74 -20
  80. package/dist/esm/zonos-checkbox_2.entry.js +108 -0
  81. package/dist/esm/zonos-checkout.entry.js +52 -3
  82. package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
  83. package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
  84. package/dist/esm/zonos-collect.entry.js +4 -4
  85. package/dist/esm/zonos-controller.entry.js +2 -2
  86. package/dist/esm/zonos-country-flag.entry.js +1 -1
  87. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  88. package/dist/esm/zonos-elements.js +1 -1
  89. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  90. package/dist/esm/zonos-hello.entry.js +1 -1
  91. package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
  92. package/dist/esm/zonos-invoice-finish_5.entry.js +6 -6
  93. package/dist/esm/zonos-invoice.entry.js +4 -4
  94. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  95. package/dist/esm/zonos-store-credit.entry.js +109 -0
  96. package/dist/esm-es5/cart-6e465f7b.js +1 -0
  97. package/dist/esm-es5/hasInclusivePrice-c49d384d.js +1 -0
  98. package/dist/esm-es5/index.js +1 -1
  99. package/dist/esm-es5/{invoice-0e462fcc.js → invoice-d416ba65.js} +1 -1
  100. package/dist/esm-es5/{isCollectMobileTablet-0bcba25a.js → isCollectMobileTablet-48040572.js} +1 -1
  101. package/dist/esm-es5/loader.js +1 -1
  102. package/dist/esm-es5/localization-f4a7fb5a.js +1 -0
  103. package/dist/esm-es5/paypal-6af6b978.js +17 -0
  104. package/dist/esm-es5/{placeTestOrder-6c9a6c8a.js → placeTestOrder-d19ac166.js} +1 -1
  105. package/dist/esm-es5/{renderCheckoutCurrency-910fea67.js → renderCheckoutCurrency-c8aa8e7e.js} +1 -1
  106. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -0
  107. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  108. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  109. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  110. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -0
  111. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  112. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  113. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  114. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  115. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  116. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  117. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  118. package/dist/esm-es5/zonos-elements.js +1 -1
  119. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  120. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  121. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  122. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  123. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  124. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  125. package/dist/esm-es5/zonos-store-credit.entry.js +1 -0
  126. package/dist/scripts/index.d.ts +58 -1
  127. package/dist/scripts/index.js +1 -1
  128. package/dist/scripts/loadZonos.js +1 -1
  129. package/dist/scripts/zonos.js +1 -1
  130. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +1 -0
  131. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.d.ts +17 -0
  132. package/dist/types/components/store/checkout/cart.d.ts +8 -1
  133. package/dist/types/components/store/checkout/storeCredit.d.ts +111 -0
  134. package/dist/types/components/store/checkout/stripe.d.ts +1 -1
  135. package/dist/types/components/store/translationStore/strings.arabic.d.ts +33 -0
  136. package/dist/types/components/store/translationStore/strings.base.d.ts +33 -0
  137. package/dist/types/components/store/translationStore/strings.chinese.d.ts +33 -0
  138. package/dist/types/components/store/translationStore/strings.danish.d.ts +33 -0
  139. package/dist/types/components/store/translationStore/strings.dutch.d.ts +33 -0
  140. package/dist/types/components/store/translationStore/strings.french.d.ts +33 -0
  141. package/dist/types/components/store/translationStore/strings.german.d.ts +33 -0
  142. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +33 -0
  143. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +33 -0
  144. package/dist/types/components/store/translationStore/strings.italian.d.ts +33 -0
  145. package/dist/types/components/store/translationStore/strings.japanese.d.ts +33 -0
  146. package/dist/types/components/store/translationStore/strings.korean.d.ts +33 -0
  147. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +33 -0
  148. package/dist/types/components/store/translationStore/strings.polish.d.ts +33 -0
  149. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +33 -0
  150. package/dist/types/components/store/translationStore/strings.russian.d.ts +33 -0
  151. package/dist/types/components/store/translationStore/strings.spanish.d.ts +33 -0
  152. package/dist/types/components/store/translationStore/strings.swedish.d.ts +33 -0
  153. package/dist/types/components/store/translationStore/strings.turkish.d.ts +33 -0
  154. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +33 -0
  155. package/dist/types/components.d.ts +21 -0
  156. package/dist/types/types/checkout/api/CheckoutSession.d.ts +9 -1
  157. package/dist/types/types/generated/graphql.internal.types.d.ts +713 -4
  158. package/dist/types/types/generated/graphql.internal.types.ts +956 -4
  159. package/dist/zonos-elements/index.esm.js +1 -1
  160. package/dist/zonos-elements/{p-456c0e52.js → p-13ed3789.js} +1 -1
  161. package/dist/zonos-elements/{p-0a2abbab.system.entry.js → p-17fbfda0.system.entry.js} +1 -1
  162. package/dist/zonos-elements/{p-8a424412.entry.js → p-1b56814d.entry.js} +1 -1
  163. package/dist/zonos-elements/p-1e6509d7.js +1 -0
  164. package/dist/zonos-elements/{p-3ad2a9a3.system.entry.js → p-1f63615f.system.entry.js} +1 -1
  165. package/dist/zonos-elements/p-2435f196.entry.js +1 -0
  166. package/dist/zonos-elements/{p-4d4b7faa.entry.js → p-26848428.entry.js} +1 -1
  167. package/dist/zonos-elements/p-28d62fc8.system.entry.js +1 -0
  168. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  169. package/dist/zonos-elements/p-2b7ef406.system.js +18 -0
  170. package/dist/zonos-elements/{p-54c95926.entry.js → p-3827041d.entry.js} +1 -1
  171. package/dist/zonos-elements/{p-321d2963.js → p-48228d76.js} +1 -1
  172. package/dist/zonos-elements/p-4d5932ac.system.entry.js +1 -0
  173. package/dist/zonos-elements/{p-4d081ce8.entry.js → p-59fe8416.entry.js} +1 -1
  174. package/dist/zonos-elements/{p-101226f3.system.entry.js → p-5ca50862.system.entry.js} +1 -1
  175. package/dist/zonos-elements/{p-36bea5d5.system.entry.js → p-5fceccc3.system.entry.js} +1 -1
  176. package/dist/zonos-elements/p-64ad0854.entry.js +1 -0
  177. package/dist/zonos-elements/{p-c87d3d50.system.js → p-65892fa7.system.js} +1 -1
  178. package/dist/zonos-elements/{p-b9a4430c.entry.js → p-66e1dc55.entry.js} +1 -1
  179. package/dist/zonos-elements/{p-09110bb7.system.entry.js → p-7042c6da.system.entry.js} +1 -1
  180. package/dist/zonos-elements/p-741e07e1.system.entry.js +1 -0
  181. package/dist/zonos-elements/{p-0aeba2c7.system.js → p-77113201.system.js} +1 -1
  182. package/dist/zonos-elements/{p-6d37f669.entry.js → p-77c0a02b.entry.js} +1 -1
  183. package/dist/zonos-elements/{p-a75b3efc.system.entry.js → p-85529818.system.entry.js} +1 -1
  184. package/dist/zonos-elements/p-8f1ab25c.system.entry.js +1 -0
  185. package/dist/zonos-elements/{p-1b5f89d5.system.js → p-90b8c428.system.js} +1 -1
  186. package/dist/zonos-elements/p-997b7eef.js +1 -0
  187. package/dist/zonos-elements/{p-4c087a8e.system.entry.js → p-9bc5e944.system.entry.js} +1 -1
  188. package/dist/zonos-elements/p-9c6917ab.system.js +1 -0
  189. package/dist/zonos-elements/{p-358dfb9e.entry.js → p-9d64783a.entry.js} +1 -1
  190. package/dist/zonos-elements/{p-1f1bf95c.system.entry.js → p-9f49e35a.system.entry.js} +1 -1
  191. package/dist/zonos-elements/{p-3ece0f96.system.entry.js → p-a026b5ad.system.entry.js} +1 -1
  192. package/dist/zonos-elements/{p-4a395eea.system.entry.js → p-a1a3657e.system.entry.js} +1 -1
  193. package/dist/zonos-elements/{p-079bc009.system.entry.js → p-a1b0e9a5.system.entry.js} +1 -1
  194. package/dist/zonos-elements/p-a6a401e5.system.entry.js +1 -0
  195. package/dist/zonos-elements/{p-302b7105.system.entry.js → p-b07da3e8.system.entry.js} +1 -1
  196. package/dist/zonos-elements/{p-f31fbbf0.entry.js → p-b08bf843.entry.js} +1 -1
  197. package/dist/zonos-elements/p-b334c76c.entry.js +1 -0
  198. package/dist/zonos-elements/{p-bc6b33fa.entry.js → p-b9581a92.entry.js} +1 -1
  199. package/dist/zonos-elements/p-c30a155e.js +1 -0
  200. package/dist/zonos-elements/{p-9c64ca98.system.entry.js → p-cad67b10.system.entry.js} +1 -1
  201. package/dist/zonos-elements/p-cc78c9d4.js +17 -0
  202. package/dist/zonos-elements/{p-5eaa0de1.entry.js → p-d2301d8a.entry.js} +1 -1
  203. package/dist/zonos-elements/p-d46484aa.entry.js +1 -0
  204. package/dist/zonos-elements/{p-b589f621.system.entry.js → p-d634f954.system.entry.js} +1 -1
  205. package/dist/zonos-elements/p-df316670.system.js +1 -0
  206. package/dist/zonos-elements/p-e331a235.js +1 -0
  207. package/dist/zonos-elements/p-e4d58bd7.js +1 -0
  208. package/dist/zonos-elements/{p-8d1efd7b.entry.js → p-e9ca4447.entry.js} +1 -1
  209. package/dist/zonos-elements/{p-c9e3bc98.system.js → p-f0855df3.system.js} +1 -1
  210. package/dist/zonos-elements/{p-06e2bc14.entry.js → p-f25e7f5a.entry.js} +1 -1
  211. package/dist/zonos-elements/{p-b360ee5b.entry.js → p-f4cc124f.entry.js} +1 -1
  212. package/dist/zonos-elements/{p-bd004403.system.js → p-fa0139c3.system.js} +1 -1
  213. package/dist/zonos-elements/{p-8b206982.system.js → p-fa5767c3.system.js} +1 -1
  214. package/dist/zonos-elements/{p-26718a78.entry.js → p-fbfaa4f9.entry.js} +1 -1
  215. package/dist/zonos-elements/p-fe6cc354.entry.js +1 -0
  216. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  217. package/package.json +1 -1
  218. package/dist/cjs/zonos-toggle.cjs.entry.js +0 -35
  219. package/dist/esm/zonos-toggle.entry.js +0 -31
  220. package/dist/esm-es5/cart-efb30253.js +0 -1
  221. package/dist/esm-es5/hasInclusivePrice-565ddbe5.js +0 -1
  222. package/dist/esm-es5/localization-c1aff677.js +0 -1
  223. package/dist/esm-es5/paypal-06b67be0.js +0 -17
  224. package/dist/esm-es5/zonos-address-display_9.entry.js +0 -1
  225. package/dist/esm-es5/zonos-toggle.entry.js +0 -1
  226. package/dist/zonos-elements/p-096182f0.system.js +0 -1
  227. package/dist/zonos-elements/p-127e0395.js +0 -17
  228. package/dist/zonos-elements/p-197d9b23.system.entry.js +0 -1
  229. package/dist/zonos-elements/p-25dd58f8.system.entry.js +0 -1
  230. package/dist/zonos-elements/p-445072f8.js +0 -1
  231. package/dist/zonos-elements/p-507f00d2.js +0 -1
  232. package/dist/zonos-elements/p-5fd0cd66.system.js +0 -1
  233. package/dist/zonos-elements/p-661cd4ce.system.entry.js +0 -1
  234. package/dist/zonos-elements/p-777e0a81.entry.js +0 -1
  235. package/dist/zonos-elements/p-7e77b055.system.entry.js +0 -1
  236. package/dist/zonos-elements/p-80524eac.entry.js +0 -1
  237. package/dist/zonos-elements/p-9eea270b.entry.js +0 -1
  238. package/dist/zonos-elements/p-c4e358f2.js +0 -1
  239. package/dist/zonos-elements/p-cda52300.js +0 -1
  240. package/dist/zonos-elements/p-d233ef0d.entry.js +0 -1
  241. package/dist/zonos-elements/p-f8f7d491.js +0 -1
  242. package/dist/zonos-elements/p-fc0aa91e.system.js +0 -18
@@ -1,6 +1,6 @@
1
1
  import { c as createStore, z as zonosStore } from './zonosStore-5242a58d.js';
2
- import { t as trackConversionEvent, A as validateCheckoutSession, b as stripeStore, d as cartStore, v as stripeStoreHandleInventoryCheck, r as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-efb30253.js';
3
- import { t as translate, s as storageStore } from './localization-c1aff677.js';
2
+ import { t as trackConversionEvent, y as validateCheckoutSession, b as stripeStore, d as cartStore, v as stripeStoreHandleInventoryCheck, w as storeCreditStoreApplyCredit, x as storeCreditStoreCoversFullAmount, z as storeCreditStoreCreateOrder, r as cartStoreNextStep, h as cartStoreClearCheckoutInterval, E as storeCreditStoreGetEffectiveAmount } from './cart-6e465f7b.js';
3
+ import { t as translate, s as storageStore } from './localization-f4a7fb5a.js';
4
4
  import { h as handleFetch, l as logError, j as jsonParse } from './handleFetch-a844cac1.js';
5
5
  import { i as isContrastColor } from './isContrastColor-c17e83c9.js';
6
6
  import { l as log } from './VarianceTest-572cecf5.js';
@@ -363,6 +363,33 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
363
363
  if (cartStore.inventoryCheckErrorMessage) {
364
364
  return '';
365
365
  }
366
+ // Apply store credit if customer has selected an amount
367
+ const storeCreditAmount = storeCreditStoreGetEffectiveAmount();
368
+ if (storeCreditAmount > 0) {
369
+ const storeCreditResult = await storeCreditStoreApplyCredit();
370
+ if (!storeCreditResult.success) {
371
+ paypalStore.paypalErrorMessage =
372
+ storeCreditResult.error ||
373
+ translate('Unable to apply store credit. Please try again.');
374
+ onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
375
+ return '';
376
+ }
377
+ }
378
+ // If store credit covers the full order, create order directly
379
+ if (storeCreditStoreCoversFullAmount()) {
380
+ const orderResult = await storeCreditStoreCreateOrder();
381
+ if (!orderResult.success) {
382
+ paypalStore.paypalErrorMessage =
383
+ orderResult.error ||
384
+ translate('Unable to place order with store credit. Please try again.');
385
+ onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
386
+ return '';
387
+ }
388
+ onPaypalSessionDone === null || onPaypalSessionDone === void 0 ? void 0 : onPaypalSessionDone({ orderId: orderResult.orderId || '' });
389
+ cartStoreNextStep();
390
+ cartStoreClearCheckoutInterval();
391
+ return '';
392
+ }
366
393
  const paypalOrderId = await paypalStoreCreaterOrder({
367
394
  checkoutSessionId,
368
395
  });
@@ -1,5 +1,5 @@
1
- import { d as cartStore } from './cart-efb30253.js';
2
- import { s as storageStore } from './localization-c1aff677.js';
1
+ import { d as cartStore } from './cart-6e465f7b.js';
2
+ import { s as storageStore } from './localization-f4a7fb5a.js';
3
3
  import { l as logError, h as handleFetch } from './handleFetch-a844cac1.js';
4
4
 
5
5
  const placeTestOrder = async () => {
@@ -1,5 +1,5 @@
1
- import { d as cartStore } from './cart-efb30253.js';
2
- import { o as applyInclusiveEffectiveRate, d as currencyFormat } from './localization-c1aff677.js';
1
+ import { d as cartStore } from './cart-6e465f7b.js';
2
+ import { o as applyInclusiveEffectiveRate, d as currencyFormat } from './localization-f4a7fb5a.js';
3
3
 
4
4
  const getDisplayCurrency = () => {
5
5
  var _a, _b;
@@ -1,18 +1,18 @@
1
1
  import { r as registerInstance, h, a as Host, d as createEvent, g as getElement } from './index-cfd394c8.js';
2
- import { t as translate, l as localizationStore, s as storageStore, q as storageStoreOnChange } from './localization-c1aff677.js';
2
+ import { t as translate, l as localizationStore, s as storageStore, q as storageStoreOnChange } from './localization-f4a7fb5a.js';
3
3
  import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
4
- import { K as extractName, b as stripeStore, q as stripeStorePrefetchLandedCost, t as trackConversionEvent } from './cart-efb30253.js';
4
+ import { Q as extractName, b as stripeStore, q as stripeStorePrefetchLandedCost, t as trackConversionEvent } from './cart-6e465f7b.js';
5
5
  import { c as classes } from './classes-0d95c529.js';
6
6
  import { g as getBorderRadius } from './getBorderRadius-c21a42e5.js';
7
7
  import { z as zonosStore, f as zonosStoreFontFamily } from './zonosStore-5242a58d.js';
8
8
  import { R as RemoveIcon$2 } from './RemoveIcon-9dc5dd1a.js';
9
- import { i as isDarkColor } from './isDarkColor-3537021b.js';
10
9
  import { t as throttle_1 } from './throttle-0504ba2c.js';
11
10
  import { i as isCheckoutMobile } from './handleFetch-a844cac1.js';
12
11
  import { a as shouldRenderTaxIdInput, s as shouldRenderShortAddressCodeInput } from './shouldRenderTaxIdInput-2572bf77.js';
13
12
  import { l as log } from './VarianceTest-572cecf5.js';
14
13
  import { c as countryRequireTaxId, s as shipToTaxIdLabels } from './TaxId-50d72254.js';
15
14
  import { i as inheritAriaAttributes, a as inheritAttributes } from './helpers-2f6955b1.js';
15
+ import { i as isDarkColor } from './isDarkColor-3537021b.js';
16
16
  import './debounce-efc0e473.js';
17
17
  import './ShortAddressCode-7620e622.js';
18
18
 
@@ -375,81 +375,6 @@ const ZonosAddressUpdateDialog = class {
375
375
  };
376
376
  ZonosAddressUpdateDialog.style = ZonosAddressUpdateDialogStyle0;
377
377
 
378
- const colorPrefixes = [
379
- 'blue',
380
- 'cyan',
381
- 'green',
382
- 'orange',
383
- 'purple',
384
- 'red',
385
- 'gray',
386
- 'glass',
387
- ];
388
-
389
- const zonosCheckboxCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--zonos--size);width:var(--zonos--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--zonos--background-color);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";
390
- const ZonosCheckboxStyle0 = zonosCheckboxCss;
391
-
392
- let inputId$1 = 0;
393
- const ZonosCheckbox = class {
394
- constructor(hostRef) {
395
- registerInstance(this, hostRef);
396
- this.checkboxSelected = createEvent(this, "checkboxSelected", 7);
397
- this.inputId = `zonos--checkbox-${++inputId$1}`;
398
- /**
399
- * background color of the checkbox
400
- */
401
- this.backgroundColor = 'blue';
402
- /**
403
- * Whether or not the checkbox is checked
404
- */
405
- this.isChecked = false;
406
- /**
407
- * Whether or not the checkbox is disabled
408
- */
409
- this.isDisabled = false;
410
- /**
411
- * Size of the checkbox
412
- */
413
- this.size = 12;
414
- /**
415
- * Font size of the checkbox text
416
- */
417
- this.fontSize = 'base';
418
- }
419
- onClick() {
420
- if (this.isDisabled) {
421
- return;
422
- }
423
- this.checkboxSelected.emit(!this.isChecked);
424
- }
425
- render() {
426
- const isBackgroundVariable = colorPrefixes.includes(this.backgroundColor);
427
- const backgroundColor = isBackgroundVariable
428
- ? `var(--zonos-elements-${this.backgroundColor}-600)`
429
- : this.backgroundColor;
430
- const checkmarkColor = isBackgroundVariable
431
- ? // use lighter color if the color is amino variable
432
- `var(--zonos-elements-${this.backgroundColor}-200)`
433
- : // if it's not an amino variable, use white if the background is dark, and dark if the background is light
434
- !isDarkColor(backgroundColor)
435
- ? 'var(--zonos-elements-gray-800)'
436
- : 'var(--zonos-elements-gray-0)';
437
- const borderStyle = getBorderRadius({
438
- customRoundRadius: '4px',
439
- overrideBorderStyle: this.borderStyle,
440
- });
441
- return (h(Host, { key: 'c2a9023becafd6d19ad769d449383924c85c641f', class: classes(['zonos--elements zonos--checkbox']), style: {
442
- '--zonos--background-color': backgroundColor,
443
- '--zonos--border-radius': borderStyle,
444
- '--zonos--font-family': zonosStoreFontFamily(),
445
- '--zonos--size': `${this.size}px`,
446
- } }, h("label", { key: '352e8bda93f1ac9a7a55ba7038e922626c3a9594', class: classes([this.isDisabled && 'disabled']), htmlFor: this.inputId }, h("input", { key: '71d664f9d83345ad4c143f71209bdb0a2cb16745', checked: this.isChecked, disabled: this.isDisabled, hidden: true, id: this.inputId, onChange: e => {
447
- this.checkboxSelected.emit(e.target.checked);
448
- }, type: "checkbox" }), h("span", { key: 'c772c4e8dbbbef8035874616a0254fb4114a97c8', class: "checkmark-container" }, h("svg", { key: 'd497191975edeca268cc014431535f4befdd7b2c', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '15b26fdf72a058e81d4472d0c757a725c04e3f47', "clip-rule": "evenodd", d: "M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z", fill: "currentColor", "fill-rule": "evenodd" }))), this.label && (h("zonos-text", { key: '2d6015d16eda08dc39eff677f4858d2aed620891', size: this.fontSize }, this.label)))));
449
- }
450
- };
451
- ZonosCheckbox.style = ZonosCheckboxStyle0;
452
-
453
378
  const isValidZip = ({ countryFields, zip, }) => {
454
379
  if (!countryFields) {
455
380
  return true;
@@ -7414,4 +7339,4 @@ const ZonosStripeSelect = class {
7414
7339
  };
7415
7340
  ZonosStripeSelect.style = ZonosStripeSelectStyle0;
7416
7341
 
7417
- export { ZonosAddressDisplay as zonos_address_display, ZonosAddressForm as zonos_address_form, ZonosAddressSuggestions as zonos_address_suggestions, ZonosAddressUpdateDialog as zonos_address_update_dialog, ZonosCheckbox as zonos_checkbox, ZonosAddress as zonos_custom_address, ZonosDialog as zonos_dialog, ZonosStripePhoneInput as zonos_stripe_phone_input, ZonosStripeSelect as zonos_stripe_select };
7342
+ export { ZonosAddressDisplay as zonos_address_display, ZonosAddressForm as zonos_address_form, ZonosAddressSuggestions as zonos_address_suggestions, ZonosAddressUpdateDialog as zonos_address_update_dialog, ZonosAddress as zonos_custom_address, ZonosDialog as zonos_dialog, ZonosStripePhoneInput as zonos_stripe_phone_input, ZonosStripeSelect as zonos_stripe_select };
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, d as createEvent, h, a as Host, g as getElement } from './index-cfd394c8.js';
2
2
  import { t as throttle_1 } from './throttle-0504ba2c.js';
3
- import { b as stripeStore, t as trackConversionEvent, K as extractName, B as stripeStoreOnChange, q as stripeStorePrefetchLandedCost, d as cartStore } from './cart-efb30253.js';
4
- import { s as storageStore, r as getFallbackDefaultCountryCode, t as translate, q as storageStoreOnChange, l as localizationStore } from './localization-c1aff677.js';
3
+ import { b as stripeStore, t as trackConversionEvent, Q as extractName, F as stripeStoreOnChange, q as stripeStorePrefetchLandedCost, d as cartStore } from './cart-6e465f7b.js';
4
+ import { s as storageStore, r as getFallbackDefaultCountryCode, t as translate, q as storageStoreOnChange, l as localizationStore } from './localization-f4a7fb5a.js';
5
5
  import { z as zonosStore, g as getZonosStoreTheme, f as zonosStoreFontFamily } from './zonosStore-5242a58d.js';
6
6
  import { l as logError, i as isCheckoutMobile, s as sendErrorLog } from './handleFetch-a844cac1.js';
7
7
  import { a as shouldRenderTaxIdInput, s as shouldRenderShortAddressCodeInput } from './shouldRenderTaxIdInput-2572bf77.js';
@@ -2,10 +2,10 @@ import { r as registerInstance, h, a as Host, g as getElement, d as createEvent
2
2
  import { f as zonosStoreFontFamily } from './zonosStore-5242a58d.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
4
  import { g as getBorderRadius } from './getBorderRadius-c21a42e5.js';
5
- import { b as stripeStore, t as trackConversionEvent } from './cart-efb30253.js';
6
- import { s as storageStore } from './localization-c1aff677.js';
5
+ import { b as stripeStore, t as trackConversionEvent } from './cart-6e465f7b.js';
6
+ import { s as storageStore } from './localization-f4a7fb5a.js';
7
7
  import { l as logError } from './handleFetch-a844cac1.js';
8
- import { d as paypalStoreInitButtons, e as paypalStoreOnChange } from './paypal-06b67be0.js';
8
+ import { d as paypalStoreInitButtons, e as paypalStoreOnChange } from './paypal-6af6b978.js';
9
9
  import { l as log } from './VarianceTest-572cecf5.js';
10
10
  import './isDarkColor-3537021b.js';
11
11
  import './isContrastColor-c17e83c9.js';
@@ -1,19 +1,19 @@
1
1
  import { r as registerInstance, e as getAssetPath, h, a as Host, F as Fragment, d as createEvent, g as getElement } from './index-cfd394c8.js';
2
- import { d as cartStore, E as cartStoreHasOneEligibleItem, F as stripeStoreApplyPromoCode, G as stripeStoreRemovePromoCode, b as stripeStore, y as stripeStoreReset, c as stripeStoreRetrievePayment, t as trackConversionEvent, H as stripeStoreResetPromoCode, I as stripeStoreMessageBasedOnStatus, r as cartStoreNextStep, J as stripeStoreTranslateAddressToLatin, K as extractName, z as cartStoreOnChange, L as stripeStoreAsyncAddressUpdate, D as cartStoreUpdateSelectedShippingOption, M as cartStoreGetShippingTransitInfo, N as cartStoreGetMethod, O as sortServiceLevelOptionsByAmount } from './cart-efb30253.js';
3
- import { t as translate, l as localizationStore, s as storageStore, c as localizationStoreOnChange } from './localization-c1aff677.js';
4
- import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-910fea67.js';
2
+ import { d as cartStore, I as cartStoreHasOneEligibleItem, J as stripeStoreApplyPromoCode, K as stripeStoreRemovePromoCode, b as stripeStore, C as stripeStoreReset, c as stripeStoreRetrievePayment, t as trackConversionEvent, L as stripeStoreResetPromoCode, M as stripeStoreMessageBasedOnStatus, N as storeCreditStore, O as storeCreditStoreReset, x as storeCreditStoreCoversFullAmount, r as cartStoreNextStep, P as stripeStoreTranslateAddressToLatin, Q as extractName, D as cartStoreOnChange, R as stripeStoreAsyncAddressUpdate, H as cartStoreUpdateSelectedShippingOption, S as cartStoreGetShippingTransitInfo, T as cartStoreGetMethod, U as sortServiceLevelOptionsByAmount } from './cart-6e465f7b.js';
3
+ import { t as translate, l as localizationStore, s as storageStore, c as localizationStoreOnChange } from './localization-f4a7fb5a.js';
4
+ import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-c8aa8e7e.js';
5
5
  import { c as cleanHtmlMarkdown } from './cleanHtmlMarkdown-5f7856f2.js';
6
6
  import { c as classes } from './classes-0d95c529.js';
7
7
  import { z as zonosStore, h as zonosStoreOnChange, g as getZonosStoreTheme, f as zonosStoreFontFamily } from './zonosStore-5242a58d.js';
8
- import { D as DUTY_KEY, T as TAXES_KEY, h as hasInclusivePrice } from './hasInclusivePrice-565ddbe5.js';
9
- import { c as paypalStoreReset, a as paypalStore } from './paypal-06b67be0.js';
8
+ import { D as DUTY_KEY, T as TAXES_KEY, h as hasInclusivePrice } from './hasInclusivePrice-c49d384d.js';
9
+ import { c as paypalStoreReset, a as paypalStore } from './paypal-6af6b978.js';
10
10
  import { h as handleFetch, s as sendErrorLog, j as jsonParse, g as getIsTestMode, i as isCheckoutMobile, a as getIsStagingMode } from './handleFetch-a844cac1.js';
11
11
  import { c as createCustomEvent } from './createCustomEvent-58159025.js';
12
12
  import { g as getBorderRadius } from './getBorderRadius-c21a42e5.js';
13
13
  import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
14
14
  import { s as submitGtag } from './submitGtag-13de9f1f.js';
15
15
  import { l as languages } from './ILanguage-cd6acb72.js';
16
- import { p as placeTestOrder } from './placeTestOrder-6c9a6c8a.js';
16
+ import { p as placeTestOrder } from './placeTestOrder-d19ac166.js';
17
17
  import { i as isDarkColor } from './isDarkColor-3537021b.js';
18
18
  import { g as getContrastColor } from './getContrastColor-98f0d1d5.js';
19
19
  import { i as isColorVariable } from './isColorVariable-0a94004f.js';
@@ -296,6 +296,9 @@ const ZonosCartSubtotal = class {
296
296
  } }), h("zonos-button", { loading: this.loading, onClick: () => applyPromoCode(), variant: "primary" }, translate('Apply'))))))), !!cartStore.adjustmentTotal && (h("tr", { class: "zonos--row zonos--cart-discount" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("div", { class: "zonos--title-with-icon" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Discounts')))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("zonos-text", { type: "semiBoldLabel" }, renderCheckoutCurrency({
297
297
  amount: cartStore.adjustmentTotal,
298
298
  isForeign: true,
299
+ }))))), !!cartStore.storeCredit && (h("tr", { class: "zonos--row zonos--cart-store-credit" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Store credit'))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("zonos-text", { textColor: "green-600", type: "semiBoldLabel" }, "-", renderCheckoutCurrency({
300
+ amount: cartStore.storeCredit,
301
+ isForeign: true,
299
302
  }))))), h("tr", { class: "zonos--row zonos--cart-pay-total" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Order total'))), h("td", { class: "zonos--column zonos--cart-total-price" }, h("zonos-text", { type: "semiBoldLabel" }, renderCheckoutCurrency({
300
303
  amount: total,
301
304
  isForeign: true,
@@ -726,6 +729,47 @@ const ZonosCheckoutFinish = class {
726
729
  paypalStoreReset();
727
730
  storageStore.checkoutSessionId = null;
728
731
  };
732
+ this.checkStoreCreditOrderStatus = async () => {
733
+ // show success message right away when order id is already created
734
+ this.isLoading = false;
735
+ if (storeCreditStore.orderIdCreated) {
736
+ const checkoutSessionId = storageStore.checkoutSessionId;
737
+ submitGtag({
738
+ event: 'zonos-checkout-success',
739
+ metadata: this.buildPurchaseMetadata({
740
+ checkoutSessionId: checkoutSessionId || '',
741
+ }),
742
+ });
743
+ submitGtag({
744
+ event: 'purchase',
745
+ metadata: this.buildPurchaseMetadata({
746
+ checkoutSessionId: checkoutSessionId || '',
747
+ }),
748
+ });
749
+ void trackConversionEvent({
750
+ checkoutSessionId,
751
+ eventName: 'checkout_orderCompleted',
752
+ });
753
+ this.notificationType = 'success';
754
+ this.notificationTitle = translate("You're all set!");
755
+ this.notificationMessages =
756
+ stripeStoreMessageBasedOnStatus('succeeded').messages;
757
+ // override title if notification type is success
758
+ this.useOverrideSuccessNotification();
759
+ const successEvent = createCustomEvent('zonos-checkout-success', {
760
+ message: 'Zonos Checkout successfully processed order',
761
+ });
762
+ document.dispatchEvent(successEvent);
763
+ // wait this to finish before resetting store and checkout session id
764
+ await this.handleSuccessBehavior();
765
+ }
766
+ // reset stores when checkout is finished
767
+ stripeStoreResetPromoCode();
768
+ stripeStoreReset();
769
+ paypalStoreReset();
770
+ storeCreditStoreReset();
771
+ storageStore.checkoutSessionId = null;
772
+ };
729
773
  this.closeClickHandler = () => {
730
774
  this.closeClick.emit();
731
775
  };
@@ -758,6 +802,9 @@ const ZonosCheckoutFinish = class {
758
802
  if (cartStore.isStagingMode) {
759
803
  void this.checkStagingOrderStatus();
760
804
  }
805
+ else if (storeCreditStore.orderIdCreated) {
806
+ void this.checkStoreCreditOrderStatus();
807
+ }
761
808
  else if (paypalStore.orderIdCreated) {
762
809
  void this.checkPaypalPaymentStatus();
763
810
  }
@@ -767,11 +814,11 @@ const ZonosCheckoutFinish = class {
767
814
  }
768
815
  render() {
769
816
  const isTestMode = getIsTestMode();
770
- return (h(Host, { key: '80a543fca5dbc63dde41806702b2f6dd4fa849ab', class: "zonos--checkout-finish zonos--elements", style: {
817
+ return (h(Host, { key: 'c74f250bac797f8c000bac4892bc5ab56c0867bb', class: "zonos--checkout-finish zonos--elements", style: {
771
818
  '--zonos--border-radius': getBorderRadius({
772
819
  overrideBorderStyle: this.borderRadius,
773
820
  }),
774
- } }, !this.isLoading && (h("div", { key: '6cab293041902e156563f37db6f0e77caaeeaaf9', class: "zonos--finish-details" }, h("div", { key: '6bf32844fa9d38eae6e9f337e56b7918e49bf793', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: 'bf13e59b7bc2380609ffba879fa2b1d8c5d9a9e0', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", { key: 'c246affb94a9799e0c556affb73b2ebfb69a9c7f', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (h("zonos-button", { key: '61fa4fa0e09c0ce2905281b2696f42172c7a2bcd',
821
+ } }, !this.isLoading && (h("div", { key: '5ee705381b0246f5035f512c9d19beba6dc33d4f', class: "zonos--finish-details" }, h("div", { key: '1d1a54d8f73535aaada32601c5e771c9fd381104', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: '68c898ee87166d08bd52702ae8f9bfe51c393076', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", { key: '98b6eaff782fe34a8dbd258e4c7d0c81c3577bcc', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (h("zonos-button", { key: 'ccc5e7973b2e962e22ac56dcad6e33b048621036',
775
822
  // Only show loading spinner if it's not an error notification
776
823
  loading: this.isWaitingToRedirect &&
777
824
  this.notificationType !== 'error', onClick: () => {
@@ -783,9 +830,9 @@ const ZonosCheckoutFinish = class {
783
830
  }
784
831
  this.closeClickHandler();
785
832
  }, size: "md", variant: "primary" }, translate('Close'))), !window.Zonos.isLegacyCheckout &&
786
- this.shouldRenderKeepShoppingButton() && (h("zonos-button", { key: '9227d7832ed477be556cb6d59c644a74c293c740', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
833
+ this.shouldRenderKeepShoppingButton() && (h("zonos-button", { key: 'cd30bc010f2a3e935d9b80e56389581a9150b021', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
787
834
  cartStore.step === 'finish' &&
788
- this.notificationType === 'success' && (h("div", { key: '9107be1ef7895b0a5e3fe0a985036a11de7011d3', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: 'b0de8743bea8dd9ac7099bd5b77811f80d80a380', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: 'f90749b9af4c17eac554efb6d3d12cc41ac6e3c8', onClick: () => {
835
+ this.notificationType === 'success' && (h("div", { key: '458809f316ac5129efbc7fe90d1549c042d477af', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: 'dcf0c595cb119a731c34c1aff09960db8a1fb251', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: '76d55870370b4906970b3e2109617ba2230eee7e', onClick: () => {
789
836
  const isZonosDashboard = window.location.hostname.includes('dashboard.zonos.com');
790
837
  this.redirectToUrl(isZonosDashboard
791
838
  ? '/orders/all'
@@ -904,7 +951,8 @@ const ZonosCheckoutPayment = class {
904
951
  */
905
952
  this.continueClickHandler = async ({ currencyCode, }) => {
906
953
  var _a, _b;
907
- if (!this.handleValidate()) {
954
+ // Skip Stripe payment validation when store credit covers the full order
955
+ if (!storeCreditStoreCoversFullAmount() && !this.handleValidate()) {
908
956
  this.showErrorBanner = true;
909
957
  // Attempt to submit the form so the missing input error will be shown in Stripe
910
958
  void ((_a = stripeStore.stripeElements) === null || _a === void 0 ? void 0 : _a.submit());
@@ -995,6 +1043,7 @@ const ZonosCheckoutPayment = class {
995
1043
  const isTestMode = getIsTestMode();
996
1044
  const isStagingMode = cartStore.isStagingMode || getIsStagingMode();
997
1045
  const isPaypalTabSelected = ((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
1046
+ const storeCreditCoversFullOrder = storeCreditStoreCoversFullAmount();
998
1047
  const renderPayment = () => {
999
1048
  if (isStagingMode) {
1000
1049
  const { colorPrimary } = zonosStore.appearance;
@@ -1010,7 +1059,9 @@ const ZonosCheckoutPayment = class {
1010
1059
  variant: this.submitBtnType }, translate('Place test order')))));
1011
1060
  }
1012
1061
  return (h(Fragment, null, this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), this.hasStripePaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, stripeStore.customErrorMessage ||
1013
- translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (h(Fragment, null, h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
1062
+ translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), cartStore.customerAuthenticationToken &&
1063
+ storeCreditStore.availableBalance != null &&
1064
+ storeCreditStore.availableBalance > 0 && (h("zonos-store-credit", null)), storeCreditCoversFullOrder ? (h("zonos-banner", { intent: "info" }, translate('Store credit covers your full order'))) : (h("zonos-payment", null)), h("div", { class: "zonos--group-btn" }, (!isPaypalTabSelected || storeCreditCoversFullOrder) && (h(Fragment, null, h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
1014
1065
  stripeStore.checkoutSettlementCurrency === 'USD', loading: this.continueLoading &&
1015
1066
  stripeStore.checkoutSettlementCurrency !== 'USD', onClick: async () => {
1016
1067
  if (!cartStore.checkoutSession) {
@@ -1023,22 +1074,25 @@ const ZonosCheckoutPayment = class {
1023
1074
  });
1024
1075
  }, size: "lg",
1025
1076
  // use primary type when on mobile mode
1026
- variant: this.submitBtnType }, translate('Pay [orderTotal]', {
1027
- orderTotal: renderCheckoutCurrency({
1028
- amount: cartStore.total,
1029
- isForeign: true,
1030
- }),
1031
- })), stripeStore.shouldRenderPayInUsdButton && (h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
1077
+ variant: this.submitBtnType }, storeCreditCoversFullOrder
1078
+ ? translate('Place order')
1079
+ : translate('Pay [orderTotal]', {
1080
+ orderTotal: renderCheckoutCurrency({
1081
+ amount: cartStore.total,
1082
+ isForeign: true,
1083
+ }),
1084
+ })), !storeCreditCoversFullOrder &&
1085
+ stripeStore.shouldRenderPayInUsdButton && (h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
1032
1086
  stripeStore.checkoutSettlementCurrency !== 'USD', loading: this.continueLoading &&
1033
1087
  stripeStore.checkoutSettlementCurrency === 'USD', onClick: async () => {
1034
1088
  await this.continueClickHandler({
1035
1089
  currencyCode: 'USD',
1036
1090
  });
1037
- }, size: "lg", variant: "subtle" }, translate('Click to pay in USD'))))), h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
1091
+ }, size: "lg", variant: "subtle" }, translate('Click to pay in USD'))))), !storeCreditCoversFullOrder && (h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
1038
1092
  this.paypalSessionDone.emit(orderId);
1039
1093
  }, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
1040
1094
  display: isPaypalTabSelected ? 'block' : 'none',
1041
- } })), isTestMode && (h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, h("zonos-v-stack", { spacing: 16 }, h("div", null, h("zonos-text", { type: "semiBoldLabel" }, translate('Test cards')), h("zonos-text", { textColor: "gray-700" }, translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), h("zonos-button", { icon: h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, translate('Success'), " (****4242)"), h("zonos-button", { icon: h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, translate('Failure'), " (****0002)")), h("zonos-notification", null)))));
1095
+ } }))), isTestMode && (h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, h("zonos-v-stack", { spacing: 16 }, h("div", null, h("zonos-text", { type: "semiBoldLabel" }, translate('Test cards')), h("zonos-text", { textColor: "gray-700" }, translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), h("zonos-button", { icon: h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, translate('Success'), " (****4242)"), h("zonos-button", { icon: h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, translate('Failure'), " (****0002)")), h("zonos-notification", null)))));
1042
1096
  };
1043
1097
  return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), renderPayment())));
1044
1098
  }
@@ -0,0 +1,108 @@
1
+ import { r as registerInstance, d as createEvent, h, a as Host } from './index-cfd394c8.js';
2
+ import { f as zonosStoreFontFamily } from './zonosStore-5242a58d.js';
3
+ import { c as classes } from './classes-0d95c529.js';
4
+ import { g as getBorderRadius } from './getBorderRadius-c21a42e5.js';
5
+ import { i as isDarkColor } from './isDarkColor-3537021b.js';
6
+ import './VarianceTest-572cecf5.js';
7
+
8
+ const colorPrefixes = [
9
+ 'blue',
10
+ 'cyan',
11
+ 'green',
12
+ 'orange',
13
+ 'purple',
14
+ 'red',
15
+ 'gray',
16
+ 'glass',
17
+ ];
18
+
19
+ const zonosCheckboxCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--zonos--size);width:var(--zonos--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--zonos--background-color);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";
20
+ const ZonosCheckboxStyle0 = zonosCheckboxCss;
21
+
22
+ let inputId = 0;
23
+ const ZonosCheckbox = class {
24
+ constructor(hostRef) {
25
+ registerInstance(this, hostRef);
26
+ this.checkboxSelected = createEvent(this, "checkboxSelected", 7);
27
+ this.inputId = `zonos--checkbox-${++inputId}`;
28
+ /**
29
+ * background color of the checkbox
30
+ */
31
+ this.backgroundColor = 'blue';
32
+ /**
33
+ * Whether or not the checkbox is checked
34
+ */
35
+ this.isChecked = false;
36
+ /**
37
+ * Whether or not the checkbox is disabled
38
+ */
39
+ this.isDisabled = false;
40
+ /**
41
+ * Size of the checkbox
42
+ */
43
+ this.size = 12;
44
+ /**
45
+ * Font size of the checkbox text
46
+ */
47
+ this.fontSize = 'base';
48
+ }
49
+ onClick() {
50
+ if (this.isDisabled) {
51
+ return;
52
+ }
53
+ this.checkboxSelected.emit(!this.isChecked);
54
+ }
55
+ render() {
56
+ const isBackgroundVariable = colorPrefixes.includes(this.backgroundColor);
57
+ const backgroundColor = isBackgroundVariable
58
+ ? `var(--zonos-elements-${this.backgroundColor}-600)`
59
+ : this.backgroundColor;
60
+ const checkmarkColor = isBackgroundVariable
61
+ ? // use lighter color if the color is amino variable
62
+ `var(--zonos-elements-${this.backgroundColor}-200)`
63
+ : // if it's not an amino variable, use white if the background is dark, and dark if the background is light
64
+ !isDarkColor(backgroundColor)
65
+ ? 'var(--zonos-elements-gray-800)'
66
+ : 'var(--zonos-elements-gray-0)';
67
+ const borderStyle = getBorderRadius({
68
+ customRoundRadius: '4px',
69
+ overrideBorderStyle: this.borderStyle,
70
+ });
71
+ return (h(Host, { key: 'c2a9023becafd6d19ad769d449383924c85c641f', class: classes(['zonos--elements zonos--checkbox']), style: {
72
+ '--zonos--background-color': backgroundColor,
73
+ '--zonos--border-radius': borderStyle,
74
+ '--zonos--font-family': zonosStoreFontFamily(),
75
+ '--zonos--size': `${this.size}px`,
76
+ } }, h("label", { key: '352e8bda93f1ac9a7a55ba7038e922626c3a9594', class: classes([this.isDisabled && 'disabled']), htmlFor: this.inputId }, h("input", { key: '71d664f9d83345ad4c143f71209bdb0a2cb16745', checked: this.isChecked, disabled: this.isDisabled, hidden: true, id: this.inputId, onChange: e => {
77
+ this.checkboxSelected.emit(e.target.checked);
78
+ }, type: "checkbox" }), h("span", { key: 'c772c4e8dbbbef8035874616a0254fb4114a97c8', class: "checkmark-container" }, h("svg", { key: 'd497191975edeca268cc014431535f4befdd7b2c', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, h("path", { key: '15b26fdf72a058e81d4472d0c757a725c04e3f47', "clip-rule": "evenodd", d: "M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z", fill: "currentColor", "fill-rule": "evenodd" }))), this.label && (h("zonos-text", { key: '2d6015d16eda08dc39eff677f4858d2aed620891', size: this.fontSize }, this.label)))));
79
+ }
80
+ };
81
+ ZonosCheckbox.style = ZonosCheckboxStyle0;
82
+
83
+ const zonosToggleCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .wrapper{position:relative;border-radius:6px;background-color:var(--zonos-elements-gray-50);display:-ms-flexbox;display:flex}:host .zonos--toggle-selected-slider{z-index:1;position:absolute;background-color:var(--zonos-elements-raised-surface-color);height:100%;-webkit-box-shadow:var(--zonos-elements-shadow-button-standard);box-shadow:var(--zonos-elements-shadow-button-standard);border-radius:6px;-webkit-animation:translate 0.3s ease-in-out;animation:translate 0.3s ease-in-out}:host .zonos--option{background:transparent;border:0;z-index:2;cursor:pointer;padding:4px 12px;border-radius:6px;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);font-size:var(--zonos-elements-font-size-base);font-weight:500;color:var(--zonos-elements-text-color-secondary)}:host .zonos--option:focus{outline:none}:host .zonos--option:hover:not(.selected){color:var(--zonos-elements-text-color)}:host .zonos--option.selected{color:var(--zonos-elements-text-color);background-color:var(--zonos-elements-raised-surface-color);height:100%;-webkit-box-shadow:var(--zonos-elements-shadow-button-standard);box-shadow:var(--zonos-elements-shadow-button-standard);border-radius:6px;-webkit-animation:translate 0.3s ease-in-out;animation:translate 0.3s ease-in-out}";
84
+ const ZonosToggleStyle0 = zonosToggleCss;
85
+
86
+ const ZonosToggle = class {
87
+ constructor(hostRef) {
88
+ registerInstance(this, hostRef);
89
+ this.toggleChanged = createEvent(this, "toggleChanged", 7);
90
+ /**
91
+ * Options for the toggle
92
+ */
93
+ this.options = [];
94
+ }
95
+ render() {
96
+ return (h(Host, { key: 'e6be1b38ea1fd978a231a1c3dc85a92c1d86a24b', class: classes(['zonos--elements zonos--toggle']), style: {
97
+ '--zonos--font-family': zonosStoreFontFamily(),
98
+ } }, h("div", { key: 'e9ccac29c3f653e3e9d81d336089d6aaea6bbf6c', class: "wrapper" }, this.options.map(option => {
99
+ const selected = option.value === this.value;
100
+ return (h("button", { class: classes(['zonos--option', selected && 'selected']), key: option.value, onClick: () => {
101
+ this.toggleChanged.emit(option.value);
102
+ } }, option.label));
103
+ }))));
104
+ }
105
+ };
106
+ ZonosToggle.style = ZonosToggleStyle0;
107
+
108
+ export { ZonosCheckbox as zonos_checkbox, ZonosToggle as zonos_toggle };
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, h, F as Fragment, a as Host } from './index-cfd394c8.js';
2
- import { s as stripeStoreGetDomesticShippingSession, a as stripeStoreSaveDomesticShippingSession, b as stripeStore, i as initStripeElements, c as stripeStoreRetrievePayment, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStoreInitCheckoutSession, k as stripeStoreGetPaymentIntent, l as cartStoreStartCheckoutInterval, t as trackConversionEvent, m as getCheckoutSessionBody, n as cartStoreUpdateToErrorState, o as stripeStoreCleanupDomesticShippingSession, p as cartStoreSetCheckoutSession, q as stripeStorePrefetchLandedCost, r as cartStoreNextStep, u as stripeStoreUpdateCheckoutSessionBaseCurrency, v as stripeStoreHandleInventoryCheck, w as stripeStoreConfirmPayment, x as stripeStoreHandleInventoryRefund, y as stripeStoreReset, z as cartStoreOnChange } from './cart-efb30253.js';
3
- import { p as paypalStoreHasPaypalEnabled, a as paypalStore, b as paypalInitScript } from './paypal-06b67be0.js';
4
- import { f as filterValidTests, l as localizationStore, a as localizationStoreUpdateSelectedCountryCode, g as getZCountryUrlParam, s as storageStore, V as VARIANT_TEST_KEY_EXPIRATION, b as storageStoreSetEnabledVariantTestKeys, t as translate, c as localizationStoreOnChange, d as currencyFormat } from './localization-c1aff677.js';
2
+ import { s as stripeStoreGetDomesticShippingSession, a as stripeStoreSaveDomesticShippingSession, b as stripeStore, i as initStripeElements, c as stripeStoreRetrievePayment, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStoreInitCheckoutSession, k as stripeStoreGetPaymentIntent, l as cartStoreStartCheckoutInterval, t as trackConversionEvent, m as getCheckoutSessionBody, n as cartStoreUpdateToErrorState, o as stripeStoreCleanupDomesticShippingSession, p as cartStoreSetCheckoutSession, q as stripeStorePrefetchLandedCost, r as cartStoreNextStep, u as stripeStoreUpdateCheckoutSessionBaseCurrency, v as stripeStoreHandleInventoryCheck, w as storeCreditStoreApplyCredit, x as storeCreditStoreCoversFullAmount, y as validateCheckoutSession, z as storeCreditStoreCreateOrder, A as stripeStoreConfirmPayment, B as stripeStoreHandleInventoryRefund, C as stripeStoreReset, D as cartStoreOnChange, E as storeCreditStoreGetEffectiveAmount } from './cart-6e465f7b.js';
3
+ import { p as paypalStoreHasPaypalEnabled, a as paypalStore, b as paypalInitScript } from './paypal-6af6b978.js';
4
+ import { f as filterValidTests, l as localizationStore, a as localizationStoreUpdateSelectedCountryCode, g as getZCountryUrlParam, s as storageStore, V as VARIANT_TEST_KEY_EXPIRATION, b as storageStoreSetEnabledVariantTestKeys, t as translate, c as localizationStoreOnChange, d as currencyFormat } from './localization-f4a7fb5a.js';
5
5
  import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-5242a58d.js';
6
6
  import { b as buildCartItemsByTempCart } from './buildCartItemsByTempCart-a117f75d.js';
7
7
  import { h as handleFetch, b as getAdditionalLogMetadata, g as getIsTestMode, l as logError, j as jsonParse, s as sendErrorLog, a as getIsStagingMode, i as isCheckoutMobile } from './handleFetch-a844cac1.js';
@@ -1663,6 +1663,55 @@ const ZonosCheckout = class {
1663
1663
  this.submitLoading = false;
1664
1664
  return;
1665
1665
  }
1666
+ // Apply store credit if customer has selected an amount
1667
+ const storeCreditAmount = storeCreditStoreGetEffectiveAmount();
1668
+ if (storeCreditAmount > 0) {
1669
+ const storeCreditResult = await storeCreditStoreApplyCredit();
1670
+ if (!storeCreditResult.success) {
1671
+ stripeStore.hasPaymentError = true;
1672
+ stripeStore.customErrorMessage =
1673
+ storeCreditResult.error ||
1674
+ translate('Unable to apply store credit. Please try again.');
1675
+ this.submitLoading = false;
1676
+ return;
1677
+ }
1678
+ }
1679
+ // If store credit covers the full order, create order directly without payment
1680
+ if (storeCreditStoreCoversFullAmount()) {
1681
+ try {
1682
+ // Validate checkout session (landed cost ID, etc.) before creating order
1683
+ const checkoutSessionStatus = await validateCheckoutSession();
1684
+ if (!checkoutSessionStatus.valid) {
1685
+ stripeStore.hasPaymentError = true;
1686
+ stripeStore.customErrorMessage = checkoutSessionStatus.errorMessage;
1687
+ this.submitLoading = false;
1688
+ return;
1689
+ }
1690
+ const orderResult = await storeCreditStoreCreateOrder();
1691
+ if (!orderResult.success) {
1692
+ stripeStore.hasPaymentError = true;
1693
+ stripeStore.customErrorMessage =
1694
+ orderResult.error ||
1695
+ translate('Unable to place order with store credit. Please try again.');
1696
+ this.submitLoading = false;
1697
+ return;
1698
+ }
1699
+ cartStoreNextStep();
1700
+ cartStoreClearCheckoutInterval();
1701
+ }
1702
+ catch (err) {
1703
+ logError(err);
1704
+ submitGtag({
1705
+ event: 'zonos-checkout-payment-fail',
1706
+ metadata: {
1707
+ checkoutSessionId: storageStore.checkoutSessionId,
1708
+ },
1709
+ });
1710
+ stripeStore.hasPaymentError = true;
1711
+ }
1712
+ this.submitLoading = false;
1713
+ return;
1714
+ }
1666
1715
  try {
1667
1716
  await stripeStoreConfirmPayment();
1668
1717
  cartStoreNextStep();
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, e as getAssetPath, h, a as Host } from './index-cfd394c8.js';
2
- import { d as cartStore } from './cart-efb30253.js';
2
+ import { d as cartStore } from './cart-6e465f7b.js';
3
3
  import { c as cleanHtmlMarkdown } from './cleanHtmlMarkdown-5f7856f2.js';
4
4
  import { f as zonosStoreFontFamily } from './zonosStore-5242a58d.js';
5
5
  import { c as classes } from './classes-0d95c529.js';
6
6
  import { s as styles } from './styles-6fc2fad9.js';
7
- import './localization-c1aff677.js';
7
+ import './localization-f4a7fb5a.js';
8
8
  import './handleFetch-a844cac1.js';
9
9
  import './VarianceTest-572cecf5.js';
10
10
  import './isDarkColor-3537021b.js';
@@ -1,18 +1,18 @@
1
1
  import { r as registerInstance, d as createEvent, h, F as Fragment, a as Host, g as getElement } from './index-cfd394c8.js';
2
- import { b as stripeStore, c as stripeStoreRetrievePayment, t as trackConversionEvent, H as stripeStoreResetPromoCode, y as stripeStoreReset, I as stripeStoreMessageBasedOnStatus, d as cartStore, r as cartStoreNextStep, z as cartStoreOnChange } from './cart-efb30253.js';
3
- import { c as paypalStoreReset, a as paypalStore, b as paypalInitScript } from './paypal-06b67be0.js';
4
- import { t as translate, s as storageStore, l as localizationStore, p as translationStoreOnChange } from './localization-c1aff677.js';
2
+ import { b as stripeStore, c as stripeStoreRetrievePayment, t as trackConversionEvent, L as stripeStoreResetPromoCode, C as stripeStoreReset, M as stripeStoreMessageBasedOnStatus, d as cartStore, r as cartStoreNextStep, D as cartStoreOnChange } from './cart-6e465f7b.js';
3
+ import { c as paypalStoreReset, a as paypalStore, b as paypalInitScript } from './paypal-6af6b978.js';
4
+ import { t as translate, s as storageStore, l as localizationStore, p as translationStoreOnChange } from './localization-f4a7fb5a.js';
5
5
  import { z as zonosStore } from './zonosStore-5242a58d.js';
6
6
  import { h as handleFetch, s as sendErrorLog, g as getIsTestMode, i as isCheckoutMobile, a as getIsStagingMode } from './handleFetch-a844cac1.js';
7
7
  import { c as createCustomEvent } from './createCustomEvent-58159025.js';
8
8
  import { g as getBorderRadius } from './getBorderRadius-c21a42e5.js';
9
9
  import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
10
10
  import { s as submitGtag } from './submitGtag-13de9f1f.js';
11
- import { i as isCollectMobile, a as isCollectTablet, e as collectStore } from './isCollectMobileTablet-0bcba25a.js';
11
+ import { i as isCollectMobile, a as isCollectTablet, e as collectStore } from './isCollectMobileTablet-48040572.js';
12
12
  import { c as classes } from './classes-0d95c529.js';
13
13
  import { l as languages } from './ILanguage-cd6acb72.js';
14
- import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-910fea67.js';
15
- import { p as placeTestOrder } from './placeTestOrder-6c9a6c8a.js';
14
+ import { r as renderCheckoutCurrency } from './renderCheckoutCurrency-c8aa8e7e.js';
15
+ import { p as placeTestOrder } from './placeTestOrder-d19ac166.js';
16
16
  import { r as renderFallback } from './renderFallback-b250f4e9.js';
17
17
  import './isDarkColor-3537021b.js';
18
18
  import './isContrastColor-c17e83c9.js';