@zonos/elements 1.3.139 → 1.3.140

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 (148) hide show
  1. package/dist/cjs/{cart-0070bff2.js → cart-e1b59d03.js} +180 -1
  2. package/dist/cjs/index.cjs.js +12 -13
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/cjs/{paypal-7c8a99b0.js → paypal-86cc51e4.js} +13 -1
  5. package/dist/cjs/zonos-address_7.cjs.entry.js +1 -1
  6. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +49 -7
  7. package/dist/cjs/zonos-checkout.cjs.entry.js +5 -3
  8. package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
  9. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-elements.cjs.js +1 -1
  12. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
  13. package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
  14. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  15. package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
  16. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +24 -2
  17. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +4 -2
  18. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +11 -4
  19. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +1 -1
  20. package/dist/collection/components/store/checkout/paypal.js +14 -1
  21. package/dist/collection/components/store/checkout/stripe.js +9 -0
  22. package/dist/collection/components/store/hello/localization.js +3 -1
  23. package/dist/collection/components/store/translationStore/strings.arabic.js +6 -0
  24. package/dist/collection/components/store/translationStore/strings.base.js +6 -0
  25. package/dist/collection/components/store/translationStore/strings.chinese.js +6 -0
  26. package/dist/collection/components/store/translationStore/strings.danish.js +6 -0
  27. package/dist/collection/components/store/translationStore/strings.dutch.js +6 -0
  28. package/dist/collection/components/store/translationStore/strings.french.js +6 -0
  29. package/dist/collection/components/store/translationStore/strings.german.js +6 -0
  30. package/dist/collection/components/store/translationStore/strings.hebrew.js +6 -0
  31. package/dist/collection/components/store/translationStore/strings.indonesian.js +6 -0
  32. package/dist/collection/components/store/translationStore/strings.italian.js +6 -0
  33. package/dist/collection/components/store/translationStore/strings.japanese.js +6 -0
  34. package/dist/collection/components/store/translationStore/strings.korean.js +6 -0
  35. package/dist/collection/components/store/translationStore/strings.norwegian.js +6 -0
  36. package/dist/collection/components/store/translationStore/strings.polish.js +6 -0
  37. package/dist/collection/components/store/translationStore/strings.portuguese.js +6 -0
  38. package/dist/collection/components/store/translationStore/strings.russian.js +6 -0
  39. package/dist/collection/components/store/translationStore/strings.spanish.js +6 -0
  40. package/dist/collection/components/store/translationStore/strings.swedish.js +6 -0
  41. package/dist/collection/components/store/translationStore/strings.turkish.js +6 -0
  42. package/dist/collection/components/store/translationStore/strings.vietnamese.js +6 -0
  43. package/dist/collection/components/utils/api/getCheckoutSession.js +14 -0
  44. package/dist/collection/components/utils/resetToSelectedTab.js +17 -0
  45. package/dist/collection/components/utils/validateCheckoutSession.js +39 -0
  46. package/dist/collection/scripts/_zonosBase.js +5 -6
  47. package/dist/esm/{cart-e5fb3abe.js → cart-709f053f.js} +181 -3
  48. package/dist/esm/index.js +12 -13
  49. package/dist/esm/loader.js +1 -1
  50. package/dist/esm/{paypal-9636651e.js → paypal-77a60c44.js} +13 -1
  51. package/dist/esm/zonos-address_7.entry.js +1 -1
  52. package/dist/esm/zonos-cart-items_13.entry.js +49 -7
  53. package/dist/esm/zonos-checkout.entry.js +5 -3
  54. package/dist/esm/zonos-controller.entry.js +1 -1
  55. package/dist/esm/zonos-country-flag.entry.js +1 -1
  56. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  57. package/dist/esm/zonos-elements.js +1 -1
  58. package/dist/esm/zonos-hello-dialog.entry.js +1 -1
  59. package/dist/esm/zonos-hello.entry.js +2 -2
  60. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  61. package/dist/esm/zonos-notification_3.entry.js +2 -2
  62. package/dist/esm-es5/cart-709f053f.js +1 -0
  63. package/dist/esm-es5/index.js +1 -1
  64. package/dist/esm-es5/loader.js +1 -1
  65. package/dist/esm-es5/paypal-77a60c44.js +17 -0
  66. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  67. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  68. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  69. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  70. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  71. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  72. package/dist/esm-es5/zonos-elements.js +1 -1
  73. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  74. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  75. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  76. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  77. package/dist/scripts/index.js +1 -1
  78. package/dist/scripts/loadZonos.js +1 -1
  79. package/dist/scripts/zonos.js +1 -1
  80. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.d.ts +6 -0
  81. package/dist/types/components/store/checkout/stripe.d.ts +4 -0
  82. package/dist/types/components/store/translationStore/strings.arabic.d.ts +6 -0
  83. package/dist/types/components/store/translationStore/strings.base.d.ts +6 -0
  84. package/dist/types/components/store/translationStore/strings.chinese.d.ts +6 -0
  85. package/dist/types/components/store/translationStore/strings.danish.d.ts +6 -0
  86. package/dist/types/components/store/translationStore/strings.dutch.d.ts +6 -0
  87. package/dist/types/components/store/translationStore/strings.french.d.ts +6 -0
  88. package/dist/types/components/store/translationStore/strings.german.d.ts +6 -0
  89. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +6 -0
  90. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +6 -0
  91. package/dist/types/components/store/translationStore/strings.italian.d.ts +6 -0
  92. package/dist/types/components/store/translationStore/strings.japanese.d.ts +6 -0
  93. package/dist/types/components/store/translationStore/strings.korean.d.ts +6 -0
  94. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +6 -0
  95. package/dist/types/components/store/translationStore/strings.polish.d.ts +6 -0
  96. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +6 -0
  97. package/dist/types/components/store/translationStore/strings.russian.d.ts +6 -0
  98. package/dist/types/components/store/translationStore/strings.spanish.d.ts +6 -0
  99. package/dist/types/components/store/translationStore/strings.swedish.d.ts +6 -0
  100. package/dist/types/components/store/translationStore/strings.turkish.d.ts +6 -0
  101. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +6 -0
  102. package/dist/types/components/store/translationStore.d.ts +1 -1
  103. package/dist/types/components/utils/api/getCheckoutSession.d.ts +9 -0
  104. package/dist/types/components/utils/resetToSelectedTab.d.ts +12 -0
  105. package/dist/types/components/utils/validateCheckoutSession.d.ts +9 -0
  106. package/dist/types/types/checkout/api/CheckoutSession.d.ts +5 -1
  107. package/dist/types/types/generated/graphql.internal.types.d.ts +112 -0
  108. package/dist/types/types/generated/graphql.internal.types.ts +102 -1
  109. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  110. package/dist/zonos-elements/index.esm.js +1 -1
  111. package/dist/zonos-elements/{p-85545d0b.system.entry.js → p-01ad5be8.system.entry.js} +1 -1
  112. package/dist/zonos-elements/p-0c027d2e.entry.js +1 -0
  113. package/dist/zonos-elements/{p-d66cbed3.system.entry.js → p-1c4ff7b2.system.entry.js} +1 -1
  114. package/dist/zonos-elements/{p-30f75fc0.system.entry.js → p-22d69480.system.entry.js} +1 -1
  115. package/dist/zonos-elements/{p-3316bcb0.system.entry.js → p-25c7e4fa.system.entry.js} +1 -1
  116. package/dist/zonos-elements/p-26b24d0b.system.js +1 -0
  117. package/dist/zonos-elements/{p-456d8ac3.system.entry.js → p-289ded20.system.entry.js} +1 -1
  118. package/dist/zonos-elements/{p-f8d7bad6.entry.js → p-35b8dcde.entry.js} +1 -1
  119. package/dist/zonos-elements/{p-daf800c5.system.entry.js → p-49e4ca08.system.entry.js} +1 -1
  120. package/dist/zonos-elements/{p-d374ef35.system.entry.js → p-64a04391.system.entry.js} +1 -1
  121. package/dist/zonos-elements/p-6b0aa1bb.system.js +17 -0
  122. package/dist/zonos-elements/{p-59f7cc80.entry.js → p-8368a79e.entry.js} +1 -1
  123. package/dist/zonos-elements/{p-e176da08.system.entry.js → p-896d62a4.system.entry.js} +1 -1
  124. package/dist/zonos-elements/p-8f9affb3.system.entry.js +1 -0
  125. package/dist/zonos-elements/p-a58731ec.system.js +1 -0
  126. package/dist/zonos-elements/{p-9138a10d.entry.js → p-ad1d6ea2.entry.js} +1 -1
  127. package/dist/zonos-elements/p-afffdfc2.js +1 -0
  128. package/dist/zonos-elements/{p-3f71bac6.entry.js → p-b832ec52.entry.js} +1 -1
  129. package/dist/zonos-elements/{p-0931f518.entry.js → p-b9efc660.entry.js} +1 -1
  130. package/dist/zonos-elements/p-be2feba6.entry.js +1 -0
  131. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  132. package/dist/zonos-elements/{p-244fe3a1.system.entry.js → p-cf72603f.system.entry.js} +1 -1
  133. package/dist/zonos-elements/p-d35376d3.js +17 -0
  134. package/dist/zonos-elements/{p-035571bf.entry.js → p-e6c31531.entry.js} +1 -1
  135. package/dist/zonos-elements/{p-99190477.entry.js → p-f2867195.entry.js} +1 -1
  136. package/dist/zonos-elements/{p-d58b6247.entry.js → p-f8ca3e71.entry.js} +1 -1
  137. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  138. package/package.json +2 -1
  139. package/dist/esm-es5/cart-e5fb3abe.js +0 -1
  140. package/dist/esm-es5/paypal-9636651e.js +0 -17
  141. package/dist/zonos-elements/p-1037c75b.system.js +0 -1
  142. package/dist/zonos-elements/p-4e4a45cb.js +0 -17
  143. package/dist/zonos-elements/p-75048606.system.js +0 -1
  144. package/dist/zonos-elements/p-79a8c9ef.system.js +0 -17
  145. package/dist/zonos-elements/p-b7652a21.system.entry.js +0 -1
  146. package/dist/zonos-elements/p-e3112267.entry.js +0 -1
  147. package/dist/zonos-elements/p-f64e4276.js +0 -1
  148. package/dist/zonos-elements/p-f66fbfe8.entry.js +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-293bb3ba.js');
4
- const cart = require('./cart-0070bff2.js');
4
+ const cart = require('./cart-e1b59d03.js');
5
5
  const handleFetch = require('./handleFetch-4a90f091.js');
6
6
  const isDarkColor = require('./isDarkColor-dd6d723b.js');
7
7
 
@@ -308,6 +308,15 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
308
308
  });
309
309
  return {
310
310
  createOrder: async () => {
311
+ const checkoutSessionStatus = await cart.validateCheckoutSession();
312
+ if (!checkoutSessionStatus.valid) {
313
+ paypalStore.paypalErrorMessage = checkoutSessionStatus.errorMessage;
314
+ // reset stripe error message
315
+ cart.stripeStore.hasPaymentError = false;
316
+ cart.stripeStore.customErrorMessage = null;
317
+ onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
318
+ return '';
319
+ }
311
320
  try {
312
321
  // reset paypal error banner
313
322
  paypalStore.paypalErrorMessage = null;
@@ -334,6 +343,9 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
334
343
  catch (err) {
335
344
  handleFetch.logError('Failed to create paypal order', err);
336
345
  paypalStore.paypalErrorMessage = cart.translate('Failed to create PayPal order. Please try again, or consider using an alternative method.');
346
+ // reset stripe error message
347
+ cart.stripeStore.hasPaymentError = false;
348
+ cart.stripeStore.customErrorMessage = null;
337
349
  // trigger fail event
338
350
  onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
339
351
  return '';
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-0070bff2.js');
6
+ const cart = require('./cart-e1b59d03.js');
7
7
  const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
8
8
  const handleFetch = require('./handleFetch-4a90f091.js');
9
9
  const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-0070bff2.js');
6
+ const cart = require('./cart-e1b59d03.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const paypal = require('./paypal-7c8a99b0.js');
8
+ const paypal = require('./paypal-86cc51e4.js');
9
9
  const zonosStore = require('./zonosStore-293bb3ba.js');
10
10
  const createCustomEvent = require('./createCustomEvent-3e982e57.js');
11
11
  const getBorderRadius = require('./getBorderRadius-f72d8edf.js');
@@ -1714,9 +1714,22 @@ const ZonosCheckoutPayment = class {
1714
1714
  this.continueLoading = false;
1715
1715
  this.submitBtnColor = undefined;
1716
1716
  this.showErrorBanner = false;
1717
+ this.hasStripePaymentError = false;
1718
+ }
1719
+ stripePaymentErrorWatcher() {
1720
+ if (this.hasStripePaymentError) {
1721
+ setTimeout(() => {
1722
+ var _a;
1723
+ // scroll to the top of the page when the payment error is shown
1724
+ (_a = this.ele.querySelector('zonos-banner')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
1725
+ behavior: 'smooth',
1726
+ });
1727
+ }, 0);
1728
+ }
1717
1729
  }
1718
1730
  render() {
1719
1731
  var _a;
1732
+ this.hasStripePaymentError = cart.stripeStore.hasPaymentError;
1720
1733
  if (!cart.stripeStore.stripeElements) {
1721
1734
  return null;
1722
1735
  }
@@ -1726,7 +1739,8 @@ const ZonosCheckoutPayment = class {
1726
1739
  }
1727
1740
  const isTestMode = createCustomEvent.getIsTestMode();
1728
1741
  const isPaypalTabSelected = ((_a = cart.stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
1729
- return (index.h(index.Host, { class: "zonos--checkout-payment zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Payment method')), this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, cart.translate('Missing required fields. Make sure all fields are completed.'))), cart.stripeStore.hasPaymentError && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, cart.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (index.h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => {
1742
+ return (index.h(index.Host, { class: "zonos--checkout-payment zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Payment method')), this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, cart.translate('Missing required fields. Make sure all fields are completed.'))), this.hasStripePaymentError && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, cart.stripeStore.customErrorMessage ||
1743
+ cart.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (index.h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => {
1730
1744
  this.continueClickHandler();
1731
1745
  }, size: "lg",
1732
1746
  // use primary type when on mobile mode
@@ -1741,6 +1755,10 @@ const ZonosCheckoutPayment = class {
1741
1755
  display: isPaypalTabSelected ? 'block' : 'none',
1742
1756
  } })), isTestMode && (index.h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, index.h("zonos-v-stack", { spacing: 16 }, index.h("div", null, index.h("zonos-text", { type: "semiBoldLabel" }, cart.translate('Test cards')), index.h("zonos-text", { textColor: "gray-700" }, cart.translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), index.h("zonos-button", { icon: index.h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, cart.translate('Success'), " (****4242)"), index.h("zonos-button", { icon: index.h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, cart.translate('Failure'), " (****0002)")), index.h("zonos-notification", null))))));
1743
1757
  }
1758
+ get ele() { return index.getElement(this); }
1759
+ static get watchers() { return {
1760
+ "hasStripePaymentError": ["stripePaymentErrorWatcher"]
1761
+ }; }
1744
1762
  };
1745
1763
  ZonosCheckoutPayment.style = ZonosCheckoutPaymentStyle0;
1746
1764
 
@@ -1767,6 +1785,24 @@ const getContrastColor = ({ backgroundColor, color, }) => {
1767
1785
  return isNewColorContrastEnough ? newDarkerColor : newLigherColor;
1768
1786
  };
1769
1787
 
1788
+ /**
1789
+ * Reset any done tabs after selected tab to undone. This is to force user to go through all tabs again
1790
+ */
1791
+ const resetToSelectedTab = ({ selectedTab, tabList, }) => {
1792
+ const selectedTabIndex = tabList[selectedTab].index;
1793
+ // Any tab after the selected tab should be reset
1794
+ const tabsToReset = Object.values(tabList)
1795
+ .slice(selectedTabIndex - 1, Object.keys(tabList).length)
1796
+ .map(tab => tab.value);
1797
+ const newTabList = Object.assign({}, tabList);
1798
+ Object.values(newTabList).forEach(tab => {
1799
+ if (tabsToReset.includes(tab.value)) {
1800
+ tab.isDone = false;
1801
+ }
1802
+ });
1803
+ return newTabList;
1804
+ };
1805
+
1770
1806
  const TabCheckmark = `<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
1771
1807
  <path fill-rule="evenodd" clip-rule="evenodd" d="M18.289 7.40424C18.618 7.65585 18.6808 8.12656 18.4291 8.4556L11.9291 16.9556C11.7978 17.1273 11.5988 17.234 11.383 17.2484C11.1673 17.2627 10.9559 17.1832 10.803 17.0303L6.80304 13.0303C6.51015 12.7374 6.51015 12.2626 6.80304 11.9697C7.09594 11.6768 7.57081 11.6768 7.8637 11.9697L11.258 15.3639L17.2376 7.54442C17.4892 7.21539 17.9599 7.15263 18.289 7.40424Z" fill="currentColor"/>
1772
1808
  </svg>
@@ -1816,6 +1852,12 @@ const ZonosCheckoutProgressTabs = class {
1816
1852
  async setTabSelected(tabValue) {
1817
1853
  if (this.isTabClickable(tabValue)) {
1818
1854
  cart.cartStore.step = tabValue;
1855
+ // reset tabItems state until the selected step
1856
+ const newTabItems = resetToSelectedTab({
1857
+ selectedTab: tabValue,
1858
+ tabList: cart.cartStore.tabItems,
1859
+ });
1860
+ cart.cartStore.tabItems = newTabItems;
1819
1861
  }
1820
1862
  }
1821
1863
  render() {
@@ -1833,17 +1875,17 @@ const ZonosCheckoutProgressTabs = class {
1833
1875
  color: labelSelectedColor,
1834
1876
  })
1835
1877
  : labelSelectedColor;
1836
- return (index.h(index.Host, { key: '058b0f0300f5c836ae7eda80b41800402f1c35f0', class: "zonos--elements", style: {
1878
+ return (index.h(index.Host, { key: '592fe18f902f828c4dcdcab28221617ba63ea358', class: "zonos--elements", style: {
1837
1879
  '--zonos--color': contrastLabelColor,
1838
1880
  '--zonos--progress-percent': this.getTotalSuccessStep(),
1839
- } }, index.h("div", { key: '46c1a753f2529d2d1bf2ca6a53c5b7c91c973da1', class: "zonos--tab-wrapper" }, Object.values(cart.cartStore.tabItems).map((tab, index$1) => {
1881
+ } }, index.h("div", { key: 'd173893ab0da684a189127ab511db90ba3a0985c', class: "zonos--tab-wrapper" }, Object.values(cart.cartStore.tabItems).map((tab, index$1) => {
1840
1882
  const isSelected = tab.value === selectedStep;
1841
1883
  return (index.h("button", { class: classes.classes([
1842
1884
  'zonos--tab-item',
1843
1885
  tab.value === selectedStep && 'selected',
1844
1886
  tab.isDone && 'done',
1845
- ]), disabled: !this.isTabClickable(tab.value), key: tab.value, onClick: () => (cart.cartStore.step = tab.value) }, index.h("div", { class: "zonos--tab-index" }, index.h("zonos-text", { class: "zonos--tab-index-label", textColor: isSelected ? contrastLabelColor : 'gray-1000', type: "label" }, index$1 + 1), index.h("zonos-icon", { class: "zonos--tab-index-done-icon", content: TabCheckmark, iconColor: isSelected ? contrastLabelColor : 'gray-1000' })), index.h("zonos-text", { textColor: isSelected ? contrastLabelColor : 'gray-1000', type: "label" }, cart.translate(tab.label))));
1846
- })), index.h("div", { key: '1e298a465e94737039c8861285db1c171103f9a3', class: "zonos--tab-progress" }, index.h("div", { key: '849cda2eec874b8e25d9788ceb3e61df8ed420a8', class: "zonos--progress-bar-fill" }))));
1887
+ ]), disabled: !this.isTabClickable(tab.value), key: tab.value, onClick: () => this.setTabSelected(tab.value) }, index.h("div", { class: "zonos--tab-index" }, index.h("zonos-text", { class: "zonos--tab-index-label", textColor: isSelected ? contrastLabelColor : 'gray-1000', type: "label" }, index$1 + 1), index.h("zonos-icon", { class: "zonos--tab-index-done-icon", content: TabCheckmark, iconColor: isSelected ? contrastLabelColor : 'gray-1000' })), index.h("zonos-text", { textColor: isSelected ? contrastLabelColor : 'gray-1000', type: "label" }, cart.translate(tab.label))));
1888
+ })), index.h("div", { key: '1e8dbcee0cc21837b030760250755fe5292bd261', class: "zonos--tab-progress" }, index.h("div", { key: 'a9250c1ca7b7a40f5b6d0bbbeca24f657471cda1', class: "zonos--progress-bar-fill" }))));
1847
1889
  }
1848
1890
  static get assetsDirs() { return ["assets"]; }
1849
1891
  get ele() { return index.getElement(this); }
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-0070bff2.js');
7
- const paypal = require('./paypal-7c8a99b0.js');
6
+ const cart = require('./cart-e1b59d03.js');
7
+ const paypal = require('./paypal-86cc51e4.js');
8
8
  const zonosStore = require('./zonosStore-293bb3ba.js');
9
9
  const handleFetch = require('./handleFetch-4a90f091.js');
10
10
  const createCustomEvent = require('./createCustomEvent-3e982e57.js');
@@ -901,6 +901,8 @@ const ZonosCheckout = class {
901
901
  window.location.reload();
902
902
  }
903
903
  async handleStripePaymentContinue() {
904
+ // reset paypal error message
905
+ paypal.paypalStore.paypalErrorMessage = null;
904
906
  // reset error state
905
907
  cart.stripeStore.hasPaymentError = false;
906
908
  this.submitLoading = true;
@@ -1156,7 +1158,7 @@ const ZonosCheckout = class {
1156
1158
  : cart.translate('It looks like you placed an order just a few minutes ago ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?', {
1157
1159
  date: this.formatDate(((_c = this.placedOrderInfo) === null || _c === void 0 ? void 0 : _c.time) || null),
1158
1160
  time: this.formatTime(((_d = this.placedOrderInfo) === null || _d === void 0 ? void 0 : _d.time) || null),
1159
- }), dialogTitle: cart.translate('Are you sure?'), dialogWidth: 450, onCancelClicked: () => {
1161
+ }), dialogTitle: cart.translate('Are you sure?'), dialogWidth: 530, onCancelClicked: () => {
1160
1162
  this.handleCancelOrderDuplication();
1161
1163
  },
1162
1164
  // Mark user selected confirm to close the dialog
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-0070bff2.js');
6
+ const cart = require('./cart-e1b59d03.js');
7
7
  const zonosStore = require('./zonosStore-293bb3ba.js');
8
8
  const handleFetch = require('./handleFetch-4a90f091.js');
9
9
  require('./isDarkColor-dd6d723b.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-0070bff2.js');
6
+ const cart = require('./cart-e1b59d03.js');
7
7
  const zonosStore = require('./zonosStore-293bb3ba.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  require('./handleFetch-4a90f091.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-0070bff2.js');
6
+ const cart = require('./cart-e1b59d03.js');
7
7
  const zonosStore = require('./zonosStore-293bb3ba.js');
8
8
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
9
9
  const isDarkColor = require('./isDarkColor-dd6d723b.js');
@@ -19,7 +19,7 @@ var patchBrowser = () => {
19
19
 
20
20
  patchBrowser().then(async (options) => {
21
21
  await appGlobals.globalScripts();
22
- return index.bootstrapLazy(JSON.parse("[[\"zonos-checkout.cjs\",[[2,\"zonos-checkout\",{\"appearanceSettingsOverride\":[16],\"preview\":[4],\"mobile\":[4],\"defaultAddress\":[16],\"forceDialogOpen\":[4,\"force-dialog-open\"],\"defaultAddressParams\":[32],\"open\":[32],\"stripe\":[32],\"submitLoading\":[32],\"collapseReviewMobile\":[32],\"isAttachError\":[32],\"isMobile\":[32],\"isIframed\":[32],\"zonosReviewRef\":[32],\"storybookPaymentStatusOverride\":[32],\"isLegacyCheckout\":[32],\"confirmDialogOpen\":[32],\"isCartExpired\":[32],\"inventoryCheckErrorMessage\":[32],\"placedOrderInfo\":[32],\"closeDialogHandler\":[64],\"init\":[64],\"setToFinishStep\":[64],\"mockCheckoutSession\":[64]},[[16,\"zonos--init-cart-info\",\"initCartInfoHandler\"],[4,\"keydown\",\"handleKeyPress\"],[9,\"resize\",\"handleWindowResize\"]],{\"appearanceSettingsOverride\":[\"appearanceSettingsOverrideChanged\",\"handleAppearanceSettingsOverrideChange\"],\"mobile\":[\"handleMobileChange\"],\"defaultAddress\":[\"handleAddressChange\"],\"open\":[\"handleOpenChange\"]}]]],[\"zonos-hello.cjs\",[[1,\"zonos-hello\",{\"mobileLocationOverride\":[1,\"mobile-location-override\"],\"animateFromLeftOverride\":[4,\"animate-from-left-override\"],\"appearanceSettingsOverride\":[16],\"showPeekMessage\":[32],\"zonosStoreHelloSettings\":[32],\"showDialog\":[32],\"peekMessage\":[32],\"initialUrl\":[32],\"allRestrictedItems\":[32],\"allFoundProducts\":[32],\"productsOnPage\":[32],\"isHelloWidgetRendered\":[32],\"isMobile\":[32],\"getCountryList\":[64],\"displayCurrency\":[64],\"convertAndFormat\":[64],\"convert\":[64],\"format\":[64],\"openHelloDialog\":[64]},[[9,\"resize\",\"handleResize\"]],{\"appearanceSettingsOverride\":[\"handleAppearanceSettingsOverrideChange\"]}]]],[\"zonos-controller.cjs\",[[1,\"zonos-controller\",{\"config\":[16],\"zonosApiKey\":[1,\"zonos-api-key\"],\"initCheckoutElement\":[64],\"setupGoogleFont\":[64],\"showNotification\":[64],\"reset\":[64],\"overrideConfig\":[64],\"overrideCountry\":[64],\"getAppearanceSetting\":[64],\"updateOrganizationName\":[64]},[[8,\"locationchange\",\"handleLocationChange\"]]]]],[\"zonos-tooltip.cjs\",[[1,\"zonos-tooltip\",{\"label\":[1],\"subtitle\":[1],\"showTooltip\":[32]}]]],[\"zonos-component.cjs\",[[1,\"zonos-component\",{\"first\":[1],\"middle\":[1],\"last\":[1]}]]],[\"zonos-link.cjs\",[[1,\"zonos-link\",{\"href\":[1],\"rel\":[1],\"target\":[1],\"linkTitle\":[1,\"link-title\"]}]]],[\"zonos-logo.cjs\",[[1,\"zonos-logo\",{\"theme\":[1],\"width\":[1]}]]],[\"zonos-hello-dialog.cjs\",[[1,\"zonos-hello-dialog\",{\"isOpen\":[4,\"is-open\"],\"setIsOpen\":[16],\"mobileLocationOverride\":[1,\"mobile-location-override\"],\"animateFromLeftOverride\":[4,\"animate-from-left-override\"],\"appearanceSettings\":[16],\"restrictedItems\":[16],\"welcomeMessage\":[32],\"showCountrySelect\":[32],\"showLanguageSelect\":[32]},[[4,\"click\",\"globalClickHandler\"]],{\"isOpen\":[\"isOpenHandler\"]}]]],[\"zonos-badge.cjs\",[[1,\"zonos-badge\",{\"bold\":[4],\"badgeColor\":[1,\"badge-color\"],\"icon\":[16],\"iconRight\":[4,\"icon-right\"],\"size\":[1],\"rounded\":[4],\"loading\":[4],\"dismissHandler\":[16]}]]],[\"zonos-shipping-rich-radio.cjs\",[[1,\"zonos-shipping-rich-radio\",{\"items\":[16],\"borderColor\":[1,\"border-color\"],\"borderStyle\":[1,\"border-style\"],\"theme\":[1],\"selectedItem\":[16]}]]],[\"zonos-toggle.cjs\",[[1,\"zonos-toggle\",{\"options\":[16],\"value\":[1]}]]],[\"zonos-collapse.cjs\",[[1,\"zonos-collapse\",{\"collapsed\":[4],\"collapseSize\":[2,\"collapse-size\"],\"height\":[32],\"iframe\":[32]}]]],[\"zonos-card.cjs\",[[1,\"zonos-card\",{\"actions\":[16],\"backgroundColor\":[1,\"background-color\"],\"borderRadius\":[2,\"border-radius\"],\"footerActions\":[16],\"footerContent\":[16],\"footerHeight\":[2,\"footer-height\"],\"label\":[16],\"spacing\":[1]}]]],[\"zonos-input.cjs\",[[1,\"zonos-input\",{\"inputValue\":[1,\"input-value\"],\"inputLabel\":[1,\"input-label\"],\"inputSize\":[1,\"input-size\"],\"isDisabled\":[4,\"is-disabled\"],\"isError\":[4,\"is-error\"],\"inputPlaceholder\":[1,\"input-placeholder\"],\"value\":[32]},null,{\"inputValue\":[\"onInputValueChange\"]}]]],[\"zonos-notification_3.cjs\",[[2,\"zonos-payment\",{\"titleText\":[1,\"title-text\"],\"stripe\":[32],\"stripeElements\":[32]},null,{\"stripeElements\":[\"watchInitStripe\"],\"stripe\":[\"watchInitStripe\"]}],[2,\"zonos-paypal-payment\"],[1,\"zonos-notification\",{\"notificationArray\":[32],\"showNotification\":[64]}]]],[\"zonos-banner.cjs\",[[1,\"zonos-banner\",{\"bannerTitle\":[1,\"banner-title\"],\"intent\":[1],\"hasContent\":[32]}]]],[\"zonos-country-flag.cjs\",[[1,\"zonos-country-flag\",{\"countryCode\":[1,\"country-code\"],\"size\":[2]}]]],[\"zonos-v-stack.cjs\",[[1,\"zonos-v-stack\",{\"spacing\":[2]}]]],[\"zonos-text.cjs\",[[1,\"zonos-text\",{\"textColor\":[1,\"text-color\"],\"size\":[1],\"type\":[1],\"weight\":[2],\"ready\":[32]}]]],[\"zonos-button_3.cjs\",[[17,\"zonos-button\",{\"buttonColor\":[1,\"button-color\"],\"backgroundColor\":[1,\"background-color\"],\"borderStyle\":[1,\"border-style\"],\"isDisabled\":[4,\"is-disabled\"],\"icon\":[16],\"iconRight\":[4,\"icon-right\"],\"size\":[1],\"variant\":[1],\"noBackground\":[4,\"no-background\"],\"withBoxShadow\":[4,\"with-box-shadow\"],\"noPaddingLeft\":[4,\"no-padding-left\"],\"noPaddingRight\":[4,\"no-padding-right\"],\"loading\":[4],\"justifyContent\":[1,\"justify-content\"],\"theme\":[1],\"hasIcon\":[32],\"hasContent\":[32]},[[2,\"click\",\"clickHandler\"]],{\"icon\":[\"iconChangeHandler\"]}],[1,\"zonos-spinner\",{\"size\":[2],\"spinnerColor\":[1,\"spinner-color\"]}],[1,\"zonos-icon\",{\"autoHeight\":[4,\"auto-height\"],\"iconColor\":[1,\"icon-color\"],\"content\":[1],\"size\":[2]}]]],[\"zonos-language-select_2.cjs\",[[1,\"zonos-language-select\",{\"handleOnClose\":[16]}],[1,\"zonos-select-dialog-header\",{\"handleOnClose\":[16],\"label\":[1]}]]],[\"zonos-country-select_4.cjs\",[[1,\"zonos-country-select\",{\"handleOnClose\":[16],\"inputValue\":[32]}],[1,\"zonos-hello-dialog-footer\",{\"appearanceSettings\":[16],\"setShowCountrySelect\":[16],\"setShowLanguageSelect\":[16]}],[1,\"zonos-custom-message\",{\"icon\":[1],\"message\":[1]}],[2,\"zonos-virtual-scroll\",{\"renderItem\":[16],\"itemWidth\":[2,\"item-width\"],\"fallbackItemHeight\":[2,\"fallback-item-height\"],\"itemHeights\":[16],\"container\":[32],\"scrollTop\":[32],\"totalHeight\":[32]},null,{\"itemHeights\":[\"updateTotalHeight\"],\"fallbackItemHeight\":[\"updateTotalHeight\"]}]]],[\"zonos-address_7.cjs\",[[1,\"zonos-address-update-dialog\",{\"continueLoading\":[4,\"continue-loading\"],\"dialogLoading\":[4,\"dialog-loading\"],\"dialogOpen\":[4,\"dialog-open\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"shippingAddress\":[16],\"billingAddress\":[16],\"translatedShippingAddress\":[16],\"translatedBillingAddress\":[16],\"showErrorBanner\":[32],\"translatedShippingAddressState\":[32],\"translatedBillingAddressState\":[32]},null,{\"translatedShippingAddress\":[\"watchTranslatedShippingAddress\"],\"translatedBillingAddress\":[\"watchTranslatedBillingAddress\"]}],[2,\"zonos-address\",{\"type\":[1],\"titleText\":[1,\"title-text\"],\"defaultAddress\":[16],\"stripe\":[32],\"isDirtyAddress\":[32]},null,{\"stripe\":[\"watchInitStripe\"]}],[1,\"zonos-checkbox\",{\"backgroundColor\":[1,\"background-color\"],\"label\":[1],\"isChecked\":[4,\"is-checked\"],\"isDisabled\":[4,\"is-disabled\"],\"size\":[2],\"fontSize\":[1,\"font-size\"],\"borderStyle\":[1,\"border-style\"]},[[1,\"click\",\"onClick\"]]],[2,\"zonos-link-authentication\",{\"titleText\":[1,\"title-text\"],\"defaultEmail\":[1,\"default-email\"],\"isEmailError\":[4,\"is-email-error\"],\"stripe\":[32]},null,{\"stripe\":[\"watchInitStripe\"]}],[1,\"zonos-dialog\",{\"open\":[4],\"headerText\":[1,\"header-text\"],\"width\":[1],\"height\":[1],\"minHeight\":[1,\"min-height\"],\"noHeader\":[4,\"no-header\"],\"noBodyPadding\":[4,\"no-body-padding\"],\"noBorder\":[4,\"no-border\"],\"borderStyle\":[1,\"border-style\"],\"noCloseButton\":[4,\"no-close-button\"],\"noClickOutside\":[4,\"no-click-outside\"],\"mobile\":[4],\"isLoading\":[4,\"is-loading\"],\"isMobile\":[32]},[[9,\"resize\",\"handleWindowResize\"],[4,\"keydown\",\"handleKeyDown\"]]],[1,\"zonos-address-display\",{\"currentAddress\":[16],\"addressType\":[1,\"address-type\"]}],[1,\"zonos-address-form\",{\"currentAddress\":[16],\"translatedAddress\":[16],\"addressType\":[1,\"address-type\"],\"localAddress\":[32]},null,{\"translatedAddress\":[\"watchCurrentAddress\"]}]]],[\"zonos-cart-items_13.cjs\",[[2,\"zonos-customer-info\",{\"continueLoading\":[4,\"continue-loading\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"defaultAddress\":[16],\"showErrorBanner\":[32],\"shippingCountry\":[32],\"isCheckingForRestrictedItems\":[32],\"isValidatingAddress\":[32],\"invalidShippingCharacterList\":[32],\"invalidBillingCharacterList\":[32],\"openAddressValidationDialog\":[32],\"isEmailError\":[32]}],[2,\"zonos-checkout-payment\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"continueLoading\":[4,\"continue-loading\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"showErrorBanner\":[32]}],[1,\"zonos-checkout-footer\",{\"mobile\":[4],\"dataTheme\":[1,\"data-theme\"],\"showLanguageDialog\":[32],\"isMobile\":[32]},[[4,\"click\",\"handleGlobalClick\"]],{\"mobile\":[\"handleMobileChange\"]}],[2,\"zonos-shipping\",{\"continueLoading\":[4,\"continue-loading\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"selectedShippingMethod\":[32],\"collapsedDAPOptions\":[32],\"isSelecting\":[32],\"showErrorBanner\":[32],\"serviceLevelsDDP\":[32],\"serviceLevelsDAP\":[32],\"serviceLevelsOther\":[32],\"serviceLevelsAll\":[32],\"displayBaseCurrency\":[32]}],[1,\"zonos-cart-subtotal\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"loading\":[32]}],[1,\"zonos-cart-restricted-items\",{\"hide\":[4],\"errorImages\":[32],\"internalCollapsed\":[32],\"firstRender\":[32]}],[1,\"zonos-checkout-finish\",{\"borderRadius\":[1,\"border-radius\"],\"storybookForceStatus\":[1,\"storybook-force-status\"],\"overrideNotification\":[16],\"isLoading\":[32],\"notificationType\":[32],\"notificationTitle\":[32],\"notificationMessages\":[32],\"notificationActionText\":[32],\"order\":[32],\"isWaitingToRedirect\":[32]}],[1,\"zonos-confirm-dialog\",{\"dialogTitle\":[1,\"dialog-title\"],\"dialogIntent\":[1,\"dialog-intent\"],\"dialogSubtitle\":[1,\"dialog-subtitle\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"dialogConfirmBtnText\":[1,\"dialog-confirm-btn-text\"],\"dialogWidth\":[2,\"dialog-width\"],\"dialogCancelBtnText\":[1,\"dialog-cancel-btn-text\"],\"dialogType\":[1,\"dialog-type\"],\"isMobile\":[4,\"is-mobile\"],\"dialogOpen\":[4,\"dialog-open\"],\"noClickOutside\":[4,\"no-click-outside\"]},[[4,\"keydown\",\"handleKeyDown\"]]],[1,\"zonos-checkout-progress-tabs\",{\"tabColor\":[1,\"tab-color\"],\"backgroundColor\":[1,\"background-color\"],\"setTabItems\":[64],\"setTabSelected\":[64]}],[1,\"zonos-review\",{\"mobile\":[4],\"collapsed\":[4],\"isMobile\":[32]},[[9,\"resize\",\"handleWindowResize\"]]],[1,\"zonos-cart-items\",{\"errorImages\":[32]}],[1,\"zonos-currency-toggle\",{\"errorImages\":[32]}],[1,\"zonos-rest-state\",{\"restStateSubtitle\":[1,\"rest-state-subtitle\"],\"restStateTitle\":[1,\"rest-state-title\"],\"restStateType\":[1,\"rest-state-type\"],\"isErrorImageLoad\":[32]}]]]]"), options);
22
+ return index.bootstrapLazy(JSON.parse("[[\"zonos-checkout.cjs\",[[2,\"zonos-checkout\",{\"appearanceSettingsOverride\":[16],\"preview\":[4],\"mobile\":[4],\"defaultAddress\":[16],\"forceDialogOpen\":[4,\"force-dialog-open\"],\"defaultAddressParams\":[32],\"open\":[32],\"stripe\":[32],\"submitLoading\":[32],\"collapseReviewMobile\":[32],\"isAttachError\":[32],\"isMobile\":[32],\"isIframed\":[32],\"zonosReviewRef\":[32],\"storybookPaymentStatusOverride\":[32],\"isLegacyCheckout\":[32],\"confirmDialogOpen\":[32],\"isCartExpired\":[32],\"inventoryCheckErrorMessage\":[32],\"placedOrderInfo\":[32],\"closeDialogHandler\":[64],\"init\":[64],\"setToFinishStep\":[64],\"mockCheckoutSession\":[64]},[[16,\"zonos--init-cart-info\",\"initCartInfoHandler\"],[4,\"keydown\",\"handleKeyPress\"],[9,\"resize\",\"handleWindowResize\"]],{\"appearanceSettingsOverride\":[\"appearanceSettingsOverrideChanged\",\"handleAppearanceSettingsOverrideChange\"],\"mobile\":[\"handleMobileChange\"],\"defaultAddress\":[\"handleAddressChange\"],\"open\":[\"handleOpenChange\"]}]]],[\"zonos-hello.cjs\",[[1,\"zonos-hello\",{\"mobileLocationOverride\":[1,\"mobile-location-override\"],\"animateFromLeftOverride\":[4,\"animate-from-left-override\"],\"appearanceSettingsOverride\":[16],\"showPeekMessage\":[32],\"zonosStoreHelloSettings\":[32],\"showDialog\":[32],\"peekMessage\":[32],\"initialUrl\":[32],\"allRestrictedItems\":[32],\"allFoundProducts\":[32],\"productsOnPage\":[32],\"isHelloWidgetRendered\":[32],\"isMobile\":[32],\"getCountryList\":[64],\"displayCurrency\":[64],\"convertAndFormat\":[64],\"convert\":[64],\"format\":[64],\"openHelloDialog\":[64]},[[9,\"resize\",\"handleResize\"]],{\"appearanceSettingsOverride\":[\"handleAppearanceSettingsOverrideChange\"]}]]],[\"zonos-controller.cjs\",[[1,\"zonos-controller\",{\"config\":[16],\"zonosApiKey\":[1,\"zonos-api-key\"],\"initCheckoutElement\":[64],\"setupGoogleFont\":[64],\"showNotification\":[64],\"reset\":[64],\"overrideConfig\":[64],\"overrideCountry\":[64],\"getAppearanceSetting\":[64],\"updateOrganizationName\":[64]},[[8,\"locationchange\",\"handleLocationChange\"]]]]],[\"zonos-tooltip.cjs\",[[1,\"zonos-tooltip\",{\"label\":[1],\"subtitle\":[1],\"showTooltip\":[32]}]]],[\"zonos-component.cjs\",[[1,\"zonos-component\",{\"first\":[1],\"middle\":[1],\"last\":[1]}]]],[\"zonos-link.cjs\",[[1,\"zonos-link\",{\"href\":[1],\"rel\":[1],\"target\":[1],\"linkTitle\":[1,\"link-title\"]}]]],[\"zonos-logo.cjs\",[[1,\"zonos-logo\",{\"theme\":[1],\"width\":[1]}]]],[\"zonos-hello-dialog.cjs\",[[1,\"zonos-hello-dialog\",{\"isOpen\":[4,\"is-open\"],\"setIsOpen\":[16],\"mobileLocationOverride\":[1,\"mobile-location-override\"],\"animateFromLeftOverride\":[4,\"animate-from-left-override\"],\"appearanceSettings\":[16],\"restrictedItems\":[16],\"welcomeMessage\":[32],\"showCountrySelect\":[32],\"showLanguageSelect\":[32]},[[4,\"click\",\"globalClickHandler\"]],{\"isOpen\":[\"isOpenHandler\"]}]]],[\"zonos-badge.cjs\",[[1,\"zonos-badge\",{\"bold\":[4],\"badgeColor\":[1,\"badge-color\"],\"icon\":[16],\"iconRight\":[4,\"icon-right\"],\"size\":[1],\"rounded\":[4],\"loading\":[4],\"dismissHandler\":[16]}]]],[\"zonos-shipping-rich-radio.cjs\",[[1,\"zonos-shipping-rich-radio\",{\"items\":[16],\"borderColor\":[1,\"border-color\"],\"borderStyle\":[1,\"border-style\"],\"theme\":[1],\"selectedItem\":[16]}]]],[\"zonos-toggle.cjs\",[[1,\"zonos-toggle\",{\"options\":[16],\"value\":[1]}]]],[\"zonos-collapse.cjs\",[[1,\"zonos-collapse\",{\"collapsed\":[4],\"collapseSize\":[2,\"collapse-size\"],\"height\":[32],\"iframe\":[32]}]]],[\"zonos-card.cjs\",[[1,\"zonos-card\",{\"actions\":[16],\"backgroundColor\":[1,\"background-color\"],\"borderRadius\":[2,\"border-radius\"],\"footerActions\":[16],\"footerContent\":[16],\"footerHeight\":[2,\"footer-height\"],\"label\":[16],\"spacing\":[1]}]]],[\"zonos-input.cjs\",[[1,\"zonos-input\",{\"inputValue\":[1,\"input-value\"],\"inputLabel\":[1,\"input-label\"],\"inputSize\":[1,\"input-size\"],\"isDisabled\":[4,\"is-disabled\"],\"isError\":[4,\"is-error\"],\"inputPlaceholder\":[1,\"input-placeholder\"],\"value\":[32]},null,{\"inputValue\":[\"onInputValueChange\"]}]]],[\"zonos-notification_3.cjs\",[[2,\"zonos-payment\",{\"titleText\":[1,\"title-text\"],\"stripe\":[32],\"stripeElements\":[32]},null,{\"stripeElements\":[\"watchInitStripe\"],\"stripe\":[\"watchInitStripe\"]}],[2,\"zonos-paypal-payment\"],[1,\"zonos-notification\",{\"notificationArray\":[32],\"showNotification\":[64]}]]],[\"zonos-banner.cjs\",[[1,\"zonos-banner\",{\"bannerTitle\":[1,\"banner-title\"],\"intent\":[1],\"hasContent\":[32]}]]],[\"zonos-country-flag.cjs\",[[1,\"zonos-country-flag\",{\"countryCode\":[1,\"country-code\"],\"size\":[2]}]]],[\"zonos-v-stack.cjs\",[[1,\"zonos-v-stack\",{\"spacing\":[2]}]]],[\"zonos-text.cjs\",[[1,\"zonos-text\",{\"textColor\":[1,\"text-color\"],\"size\":[1],\"type\":[1],\"weight\":[2],\"ready\":[32]}]]],[\"zonos-button_3.cjs\",[[17,\"zonos-button\",{\"buttonColor\":[1,\"button-color\"],\"backgroundColor\":[1,\"background-color\"],\"borderStyle\":[1,\"border-style\"],\"isDisabled\":[4,\"is-disabled\"],\"icon\":[16],\"iconRight\":[4,\"icon-right\"],\"size\":[1],\"variant\":[1],\"noBackground\":[4,\"no-background\"],\"withBoxShadow\":[4,\"with-box-shadow\"],\"noPaddingLeft\":[4,\"no-padding-left\"],\"noPaddingRight\":[4,\"no-padding-right\"],\"loading\":[4],\"justifyContent\":[1,\"justify-content\"],\"theme\":[1],\"hasIcon\":[32],\"hasContent\":[32]},[[2,\"click\",\"clickHandler\"]],{\"icon\":[\"iconChangeHandler\"]}],[1,\"zonos-spinner\",{\"size\":[2],\"spinnerColor\":[1,\"spinner-color\"]}],[1,\"zonos-icon\",{\"autoHeight\":[4,\"auto-height\"],\"iconColor\":[1,\"icon-color\"],\"content\":[1],\"size\":[2]}]]],[\"zonos-language-select_2.cjs\",[[1,\"zonos-language-select\",{\"handleOnClose\":[16]}],[1,\"zonos-select-dialog-header\",{\"handleOnClose\":[16],\"label\":[1]}]]],[\"zonos-country-select_4.cjs\",[[1,\"zonos-country-select\",{\"handleOnClose\":[16],\"inputValue\":[32]}],[1,\"zonos-hello-dialog-footer\",{\"appearanceSettings\":[16],\"setShowCountrySelect\":[16],\"setShowLanguageSelect\":[16]}],[1,\"zonos-custom-message\",{\"icon\":[1],\"message\":[1]}],[2,\"zonos-virtual-scroll\",{\"renderItem\":[16],\"itemWidth\":[2,\"item-width\"],\"fallbackItemHeight\":[2,\"fallback-item-height\"],\"itemHeights\":[16],\"container\":[32],\"scrollTop\":[32],\"totalHeight\":[32]},null,{\"itemHeights\":[\"updateTotalHeight\"],\"fallbackItemHeight\":[\"updateTotalHeight\"]}]]],[\"zonos-address_7.cjs\",[[1,\"zonos-address-update-dialog\",{\"continueLoading\":[4,\"continue-loading\"],\"dialogLoading\":[4,\"dialog-loading\"],\"dialogOpen\":[4,\"dialog-open\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"shippingAddress\":[16],\"billingAddress\":[16],\"translatedShippingAddress\":[16],\"translatedBillingAddress\":[16],\"showErrorBanner\":[32],\"translatedShippingAddressState\":[32],\"translatedBillingAddressState\":[32]},null,{\"translatedShippingAddress\":[\"watchTranslatedShippingAddress\"],\"translatedBillingAddress\":[\"watchTranslatedBillingAddress\"]}],[2,\"zonos-address\",{\"type\":[1],\"titleText\":[1,\"title-text\"],\"defaultAddress\":[16],\"stripe\":[32],\"isDirtyAddress\":[32]},null,{\"stripe\":[\"watchInitStripe\"]}],[1,\"zonos-checkbox\",{\"backgroundColor\":[1,\"background-color\"],\"label\":[1],\"isChecked\":[4,\"is-checked\"],\"isDisabled\":[4,\"is-disabled\"],\"size\":[2],\"fontSize\":[1,\"font-size\"],\"borderStyle\":[1,\"border-style\"]},[[1,\"click\",\"onClick\"]]],[2,\"zonos-link-authentication\",{\"titleText\":[1,\"title-text\"],\"defaultEmail\":[1,\"default-email\"],\"isEmailError\":[4,\"is-email-error\"],\"stripe\":[32]},null,{\"stripe\":[\"watchInitStripe\"]}],[1,\"zonos-dialog\",{\"open\":[4],\"headerText\":[1,\"header-text\"],\"width\":[1],\"height\":[1],\"minHeight\":[1,\"min-height\"],\"noHeader\":[4,\"no-header\"],\"noBodyPadding\":[4,\"no-body-padding\"],\"noBorder\":[4,\"no-border\"],\"borderStyle\":[1,\"border-style\"],\"noCloseButton\":[4,\"no-close-button\"],\"noClickOutside\":[4,\"no-click-outside\"],\"mobile\":[4],\"isLoading\":[4,\"is-loading\"],\"isMobile\":[32]},[[9,\"resize\",\"handleWindowResize\"],[4,\"keydown\",\"handleKeyDown\"]]],[1,\"zonos-address-display\",{\"currentAddress\":[16],\"addressType\":[1,\"address-type\"]}],[1,\"zonos-address-form\",{\"currentAddress\":[16],\"translatedAddress\":[16],\"addressType\":[1,\"address-type\"],\"localAddress\":[32]},null,{\"translatedAddress\":[\"watchCurrentAddress\"]}]]],[\"zonos-cart-items_13.cjs\",[[2,\"zonos-customer-info\",{\"continueLoading\":[4,\"continue-loading\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"isMobile\":[4,\"is-mobile\"],\"defaultAddress\":[16],\"showErrorBanner\":[32],\"shippingCountry\":[32],\"isCheckingForRestrictedItems\":[32],\"isValidatingAddress\":[32],\"invalidShippingCharacterList\":[32],\"invalidBillingCharacterList\":[32],\"openAddressValidationDialog\":[32],\"isEmailError\":[32]}],[2,\"zonos-checkout-payment\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"continueLoading\":[4,\"continue-loading\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"showErrorBanner\":[32],\"hasStripePaymentError\":[32]},null,{\"hasStripePaymentError\":[\"stripePaymentErrorWatcher\"]}],[1,\"zonos-checkout-footer\",{\"mobile\":[4],\"dataTheme\":[1,\"data-theme\"],\"showLanguageDialog\":[32],\"isMobile\":[32]},[[4,\"click\",\"handleGlobalClick\"]],{\"mobile\":[\"handleMobileChange\"]}],[2,\"zonos-shipping\",{\"continueLoading\":[4,\"continue-loading\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"submitBtnType\":[1,\"submit-btn-type\"],\"selectedShippingMethod\":[32],\"collapsedDAPOptions\":[32],\"isSelecting\":[32],\"showErrorBanner\":[32],\"serviceLevelsDDP\":[32],\"serviceLevelsDAP\":[32],\"serviceLevelsOther\":[32],\"serviceLevelsAll\":[32],\"displayBaseCurrency\":[32]}],[1,\"zonos-cart-subtotal\",{\"submitBtnType\":[1,\"submit-btn-type\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"loading\":[32]}],[1,\"zonos-cart-restricted-items\",{\"hide\":[4],\"errorImages\":[32],\"internalCollapsed\":[32],\"firstRender\":[32]}],[1,\"zonos-checkout-finish\",{\"borderRadius\":[1,\"border-radius\"],\"storybookForceStatus\":[1,\"storybook-force-status\"],\"overrideNotification\":[16],\"isLoading\":[32],\"notificationType\":[32],\"notificationTitle\":[32],\"notificationMessages\":[32],\"notificationActionText\":[32],\"order\":[32],\"isWaitingToRedirect\":[32]}],[1,\"zonos-confirm-dialog\",{\"dialogTitle\":[1,\"dialog-title\"],\"dialogIntent\":[1,\"dialog-intent\"],\"dialogSubtitle\":[1,\"dialog-subtitle\"],\"submitBtnColor\":[1,\"submit-btn-color\"],\"dialogConfirmBtnText\":[1,\"dialog-confirm-btn-text\"],\"dialogWidth\":[2,\"dialog-width\"],\"dialogCancelBtnText\":[1,\"dialog-cancel-btn-text\"],\"dialogType\":[1,\"dialog-type\"],\"isMobile\":[4,\"is-mobile\"],\"dialogOpen\":[4,\"dialog-open\"],\"noClickOutside\":[4,\"no-click-outside\"]},[[4,\"keydown\",\"handleKeyDown\"]]],[1,\"zonos-checkout-progress-tabs\",{\"tabColor\":[1,\"tab-color\"],\"backgroundColor\":[1,\"background-color\"],\"setTabItems\":[64],\"setTabSelected\":[64]}],[1,\"zonos-review\",{\"mobile\":[4],\"collapsed\":[4],\"isMobile\":[32]},[[9,\"resize\",\"handleWindowResize\"]]],[1,\"zonos-cart-items\",{\"errorImages\":[32]}],[1,\"zonos-currency-toggle\",{\"errorImages\":[32]}],[1,\"zonos-rest-state\",{\"restStateSubtitle\":[1,\"rest-state-subtitle\"],\"restStateTitle\":[1,\"rest-state-title\"],\"restStateType\":[1,\"rest-state-type\"],\"isErrorImageLoad\":[32]}]]]]"), options);
23
23
  });
24
24
 
25
25
  exports.setNonce = index.setNonce;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-0070bff2.js');
6
+ const cart = require('./cart-e1b59d03.js');
7
7
  const zonosStore = require('./zonosStore-293bb3ba.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
6
  const zonosStore = require('./zonosStore-293bb3ba.js');
7
- const cart = require('./cart-0070bff2.js');
7
+ const cart = require('./cart-e1b59d03.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  const handleFetch = require('./handleFetch-4a90f091.js');
10
10
  const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
@@ -803,7 +803,7 @@ const ZonosHello = class {
803
803
  }
804
804
  render() {
805
805
  var _a, _b;
806
- const isExcludedUrl = (_a = zonosStore.zonosStore.helloSettings.excludedUrlPatterns) === null || _a === void 0 ? void 0 : _a.some(pattern => new RegExp(pattern).test(window.location.href));
806
+ const isExcludedUrl = (_a = zonosStore.zonosStore.helloSettings.excludedUrlPatterns) === null || _a === void 0 ? void 0 : _a.some(pattern => pattern && new RegExp(pattern).test(window.location.href));
807
807
  if (isExcludedUrl) {
808
808
  handleFetch.log('Hello is excluded on this url', 'warn');
809
809
  return null;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-0070bff2.js');
6
+ const cart = require('./cart-e1b59d03.js');
7
7
  const zonosStore = require('./zonosStore-293bb3ba.js');
8
8
  const ILanguage = require('./ILanguage-98b04442.js');
9
9
  require('./handleFetch-4a90f091.js');
@@ -6,9 +6,9 @@ const index = require('./index-d56e0a8b.js');
6
6
  const zonosStore = require('./zonosStore-293bb3ba.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
  const getBorderRadius = require('./getBorderRadius-f72d8edf.js');
9
- const cart = require('./cart-0070bff2.js');
9
+ const cart = require('./cart-e1b59d03.js');
10
10
  const handleFetch = require('./handleFetch-4a90f091.js');
11
- const paypal = require('./paypal-7c8a99b0.js');
11
+ const paypal = require('./paypal-86cc51e4.js');
12
12
  require('./isDarkColor-dd6d723b.js');
13
13
 
14
14
  const zonosNotificationCss = ":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-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";
@@ -40,9 +40,22 @@ export class ZonosCheckoutPayment {
40
40
  this.continueLoading = false;
41
41
  this.submitBtnColor = undefined;
42
42
  this.showErrorBanner = false;
43
+ this.hasStripePaymentError = false;
44
+ }
45
+ stripePaymentErrorWatcher() {
46
+ if (this.hasStripePaymentError) {
47
+ setTimeout(() => {
48
+ var _a;
49
+ // scroll to the top of the page when the payment error is shown
50
+ (_a = this.ele.querySelector('zonos-banner')) === null || _a === void 0 ? void 0 : _a.scrollIntoView({
51
+ behavior: 'smooth',
52
+ });
53
+ }, 0);
54
+ }
43
55
  }
44
56
  render() {
45
57
  var _a;
58
+ this.hasStripePaymentError = stripeStore.hasPaymentError;
46
59
  if (!stripeStore.stripeElements) {
47
60
  return null;
48
61
  }
@@ -52,7 +65,8 @@ export class ZonosCheckoutPayment {
52
65
  }
53
66
  const isTestMode = getIsTestMode();
54
67
  const isPaypalTabSelected = ((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
55
- 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')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), stripeStore.hasPaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, 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("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => {
68
+ 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')), 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 ||
69
+ 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("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => {
56
70
  this.continueClickHandler();
57
71
  }, size: "lg",
58
72
  // use primary type when on mobile mode
@@ -142,7 +156,8 @@ export class ZonosCheckoutPayment {
142
156
  }
143
157
  static get states() {
144
158
  return {
145
- "showErrorBanner": {}
159
+ "showErrorBanner": {},
160
+ "hasStripePaymentError": {}
146
161
  };
147
162
  }
148
163
  static get events() {
@@ -193,4 +208,11 @@ export class ZonosCheckoutPayment {
193
208
  }
194
209
  }];
195
210
  }
211
+ static get elementRef() { return "ele"; }
212
+ static get watchers() {
213
+ return [{
214
+ "propName": "hasStripePaymentError",
215
+ "methodName": "stripePaymentErrorWatcher"
216
+ }];
217
+ }
196
218
  }
@@ -1,6 +1,6 @@
1
1
  import { Fragment, h, Host, } from "@stencil/core";
2
2
  import { cartStore, cartStoreClearCheckoutInterval, cartStoreNextStep, cartStoreReset, cartStoreResetTabItems, cartStoreSetCheckoutSession, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
3
- import { paypalInitScript, paypalStoreHasPaypalEnabled, } from "../../store/checkout/paypal";
3
+ import { paypalInitScript, paypalStore, paypalStoreHasPaypalEnabled, } from "../../store/checkout/paypal";
4
4
  import { getCheckoutSessionBody, initStripeElements, stripeStore, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreHandleInventoryCheck, stripeStoreHandleInventoryRefund, stripeStoreInitCheckoutSession, stripeStorePrefetchLandedCost, stripeStoreReset, stripeStoreRetrievePayment, } from "../../store/checkout/stripe";
5
5
  import { localizationStore, localizationStoreOnUpdate, } from "../../store/hello/localization";
6
6
  import { translate } from "../../store/translationStore";
@@ -690,6 +690,8 @@ export class ZonosCheckout {
690
690
  window.location.reload();
691
691
  }
692
692
  async handleStripePaymentContinue() {
693
+ // reset paypal error message
694
+ paypalStore.paypalErrorMessage = null;
693
695
  // reset error state
694
696
  stripeStore.hasPaymentError = false;
695
697
  this.submitLoading = true;
@@ -945,7 +947,7 @@ export class ZonosCheckout {
945
947
  : translate('It looks like you placed an order just a few minutes ago ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?', {
946
948
  date: this.formatDate(((_c = this.placedOrderInfo) === null || _c === void 0 ? void 0 : _c.time) || null),
947
949
  time: this.formatTime(((_d = this.placedOrderInfo) === null || _d === void 0 ? void 0 : _d.time) || null),
948
- }), dialogTitle: translate('Are you sure?'), dialogWidth: 450, onCancelClicked: () => {
950
+ }), dialogTitle: translate('Are you sure?'), dialogWidth: 530, onCancelClicked: () => {
949
951
  this.handleCancelOrderDuplication();
950
952
  },
951
953
  // Mark user selected confirm to close the dialog
@@ -5,6 +5,7 @@ import { zonosStore } from "../../store/zonosStore";
5
5
  import { classes } from "../../utils/classes";
6
6
  import { getContrastColor } from "../../utils/getContrastColor";
7
7
  import { isColorVariable } from "../../utils/isColorVariable";
8
+ import { resetToSelectedTab } from "../../utils/resetToSelectedTab";
8
9
  // eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
9
10
  import TabCheckmark from "./assets/TabCheckmark.svg";
10
11
  export class ZonosCheckoutProgressTabs {
@@ -47,6 +48,12 @@ export class ZonosCheckoutProgressTabs {
47
48
  async setTabSelected(tabValue) {
48
49
  if (this.isTabClickable(tabValue)) {
49
50
  cartStore.step = tabValue;
51
+ // reset tabItems state until the selected step
52
+ const newTabItems = resetToSelectedTab({
53
+ selectedTab: tabValue,
54
+ tabList: cartStore.tabItems,
55
+ });
56
+ cartStore.tabItems = newTabItems;
50
57
  }
51
58
  }
52
59
  render() {
@@ -64,17 +71,17 @@ export class ZonosCheckoutProgressTabs {
64
71
  color: labelSelectedColor,
65
72
  })
66
73
  : labelSelectedColor;
67
- return (h(Host, { key: '058b0f0300f5c836ae7eda80b41800402f1c35f0', class: "zonos--elements", style: {
74
+ return (h(Host, { key: '592fe18f902f828c4dcdcab28221617ba63ea358', class: "zonos--elements", style: {
68
75
  '--zonos--color': contrastLabelColor,
69
76
  '--zonos--progress-percent': this.getTotalSuccessStep(),
70
- } }, h("div", { key: '46c1a753f2529d2d1bf2ca6a53c5b7c91c973da1', class: "zonos--tab-wrapper" }, Object.values(cartStore.tabItems).map((tab, index) => {
77
+ } }, h("div", { key: 'd173893ab0da684a189127ab511db90ba3a0985c', class: "zonos--tab-wrapper" }, Object.values(cartStore.tabItems).map((tab, index) => {
71
78
  const isSelected = tab.value === selectedStep;
72
79
  return (h("button", { class: classes([
73
80
  'zonos--tab-item',
74
81
  tab.value === selectedStep && 'selected',
75
82
  tab.isDone && 'done',
76
- ]), disabled: !this.isTabClickable(tab.value), key: tab.value, onClick: () => (cartStore.step = tab.value) }, h("div", { class: "zonos--tab-index" }, h("zonos-text", { class: "zonos--tab-index-label", textColor: isSelected ? contrastLabelColor : 'gray-1000', type: "label" }, index + 1), h("zonos-icon", { class: "zonos--tab-index-done-icon", content: TabCheckmark, iconColor: isSelected ? contrastLabelColor : 'gray-1000' })), h("zonos-text", { textColor: isSelected ? contrastLabelColor : 'gray-1000', type: "label" }, translate(tab.label))));
77
- })), h("div", { key: '1e298a465e94737039c8861285db1c171103f9a3', class: "zonos--tab-progress" }, h("div", { key: '849cda2eec874b8e25d9788ceb3e61df8ed420a8', class: "zonos--progress-bar-fill" }))));
83
+ ]), disabled: !this.isTabClickable(tab.value), key: tab.value, onClick: () => this.setTabSelected(tab.value) }, h("div", { class: "zonos--tab-index" }, h("zonos-text", { class: "zonos--tab-index-label", textColor: isSelected ? contrastLabelColor : 'gray-1000', type: "label" }, index + 1), h("zonos-icon", { class: "zonos--tab-index-done-icon", content: TabCheckmark, iconColor: isSelected ? contrastLabelColor : 'gray-1000' })), h("zonos-text", { textColor: isSelected ? contrastLabelColor : 'gray-1000', type: "label" }, translate(tab.label))));
84
+ })), h("div", { key: '1e8dbcee0cc21837b030760250755fe5292bd261', class: "zonos--tab-progress" }, h("div", { key: 'a9250c1ca7b7a40f5b6d0bbbeca24f657471cda1', class: "zonos--progress-bar-fill" }))));
78
85
  }
79
86
  static get is() { return "zonos-checkout-progress-tabs"; }
80
87
  static get encapsulation() { return "shadow"; }
@@ -343,7 +343,7 @@ export class ZonosHello {
343
343
  }
344
344
  render() {
345
345
  var _a, _b;
346
- const isExcludedUrl = (_a = zonosStore.helloSettings.excludedUrlPatterns) === null || _a === void 0 ? void 0 : _a.some(pattern => new RegExp(pattern).test(window.location.href));
346
+ const isExcludedUrl = (_a = zonosStore.helloSettings.excludedUrlPatterns) === null || _a === void 0 ? void 0 : _a.some(pattern => pattern && new RegExp(pattern).test(window.location.href));
347
347
  if (isExcludedUrl) {
348
348
  log('Hello is excluded on this url', 'warn');
349
349
  return null;
@@ -1,7 +1,7 @@
1
1
  import { loadScript, } from "@paypal/paypal-js";
2
2
  import { createStore } from "@stencil/store";
3
3
  import { cartStore, cartStoreClearCheckoutInterval, cartStoreNextStep, } from "./cart";
4
- import { stripeStoreHandleInventoryCheck } from "./stripe";
4
+ import { stripeStore, stripeStoreHandleInventoryCheck, } from "./stripe";
5
5
  import { translate } from "../translationStore";
6
6
  import { zonosStore } from "../zonosStore";
7
7
  import { paypalCaptureOrder } from "../../utils/api/paypalCaptureOrder";
@@ -11,6 +11,7 @@ import { jsonParse } from "../../utils/jsonParse";
11
11
  import { log } from "../../utils/logging/log";
12
12
  import { logError } from "../../utils/logging/logError";
13
13
  import { submitGtag } from "../../utils/submitGtag";
14
+ import { validateCheckoutSession } from "../../utils/validateCheckoutSession";
14
15
  const { reset: paypalStoreReset, state: paypalStore } = createStore(() => ({
15
16
  orderIdCreated: null,
16
17
  paypalButtons: [],
@@ -73,6 +74,15 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
73
74
  });
74
75
  return {
75
76
  createOrder: async () => {
77
+ const checkoutSessionStatus = await validateCheckoutSession();
78
+ if (!checkoutSessionStatus.valid) {
79
+ paypalStore.paypalErrorMessage = checkoutSessionStatus.errorMessage;
80
+ // reset stripe error message
81
+ stripeStore.hasPaymentError = false;
82
+ stripeStore.customErrorMessage = null;
83
+ onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
84
+ return '';
85
+ }
76
86
  try {
77
87
  // reset paypal error banner
78
88
  paypalStore.paypalErrorMessage = null;
@@ -99,6 +109,9 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
99
109
  catch (err) {
100
110
  logError('Failed to create paypal order', err);
101
111
  paypalStore.paypalErrorMessage = translate('Failed to create PayPal order. Please try again, or consider using an alternative method.');
112
+ // reset stripe error message
113
+ stripeStore.hasPaymentError = false;
114
+ stripeStore.customErrorMessage = null;
102
115
  // trigger fail event
103
116
  onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
104
117
  return '';
@@ -13,10 +13,12 @@ import { jsonParse } from "../../utils/jsonParse";
13
13
  import { log } from "../../utils/logging/log";
14
14
  import { logError } from "../../utils/logging/logError";
15
15
  import { sendErrorLog } from "../../utils/logging/sendErrorLog";
16
+ import { validateCheckoutSession } from "../../utils/validateCheckoutSession";
16
17
  import { addressRuleStyle } from "../../../styles/stripe/addressRuleStyle";
17
18
  import { defaultVariable } from "../../../styles/stripe/defaultVariable";
18
19
  const { onChange, reset, state: stripeStore, } = createStore(() => ({
19
20
  clientSecret: sessionStorage.getItem('zonos--client-secret') || null,
21
+ customErrorMessage: null,
20
22
  fetchingLandedCostAbortController: null,
21
23
  hasPaymentError: false,
22
24
  isFetchingLandedCost: false,
@@ -464,9 +466,16 @@ const stripeStoreConfirmPayment = async () => {
464
466
  const stripeElements = stripeStore.stripeElements;
465
467
  const stripe = stripeStore.stripe;
466
468
  const stripeClientSecret = stripeStore.clientSecret;
469
+ stripeStore.customErrorMessage = null;
467
470
  if (!((_b = cartStore.selectedLandedCost) === null || _b === void 0 ? void 0 : _b.landedCost.id)) {
468
471
  throw new Error('Attempted to confirm the payment when no landed cost is found in store');
469
472
  }
473
+ // Check if the checkout session is valid before proceeding
474
+ const checkoutSessionStatus = await validateCheckoutSession();
475
+ if (!checkoutSessionStatus.valid) {
476
+ stripeStore.customErrorMessage = checkoutSessionStatus.errorMessage;
477
+ throw new Error(checkoutSessionStatus.errorMessage);
478
+ }
470
479
  if (stripe &&
471
480
  stripeElements &&
472
481
  stripePaymentReady &&
@@ -95,6 +95,7 @@ const getNewLocalization = async () => {
95
95
  startExchangeRateTimeout({ isGuaranteed, maxAge });
96
96
  };
97
97
  const getCustomMessages = async () => {
98
+ log(`Getting custom messages for ${localizationStore.selectedCountryCode}`);
98
99
  if (!localizationStore.selectedCountryCode || !zonosStore.storeId) {
99
100
  return;
100
101
  }
@@ -154,7 +155,6 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
154
155
  }
155
156
  localizationStore.targetCurrency = currencyCode;
156
157
  void getNewLocalization();
157
- void getCustomMessages();
158
158
  // Save the country code to session storage for later use
159
159
  window.sessionStorage.setItem('zonos--country', selectedCountryCode);
160
160
  // Update the URL query param with the new country code
@@ -215,6 +215,7 @@ const localizationStoreUpdateSelectedLocale = (newSelectedLocale) => {
215
215
  localizationStore.selectedLocale = newSelectedLocale;
216
216
  translationStoreUpdateLanguage(newSelectedLocale);
217
217
  void updateCheckoutSessionLanguage();
218
+ void getCustomMessages();
218
219
  };
219
220
  const initLocalizationStore = async () => {
220
221
  // all countries from countries.json, shipping zone and localization
@@ -230,6 +231,7 @@ const initLocalizationStore = async () => {
230
231
  initHelloCountryList(allCountries || {});
231
232
  const { country, locale } = localization;
232
233
  log(`Country code from localization: ${country}`);
234
+ log(`Locale from localization: ${locale}`);
233
235
  // update selected country code in store
234
236
  localizationStoreUpdateSelectedCountryCode(country);
235
237
  // use locale from params if it exists, otherwise use locale from localization