@zonos/elements 1.3.195 → 1.3.197

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 (79) hide show
  1. package/dist/cjs/{cart-bc882927.js → cart-2e3968e9.js} +7 -2
  2. package/dist/cjs/index.cjs.js +7 -7
  3. package/dist/cjs/{paypal-608fa681.js → paypal-b5c80f16.js} +1 -1
  4. package/dist/cjs/zonos-address_11.cjs.entry.js +9 -9
  5. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +2 -2
  6. package/dist/cjs/zonos-checkout.cjs.entry.js +9 -44
  7. package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
  8. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  9. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +2 -2
  11. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
  12. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  13. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  14. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +7 -42
  15. package/dist/collection/components/store/checkout/stripe.js +7 -2
  16. package/dist/collection/components/stripe/zonos-address/zonos-address.js +8 -8
  17. package/dist/esm/{cart-2f0ee51d.js → cart-006b6633.js} +7 -2
  18. package/dist/esm/index.js +7 -7
  19. package/dist/esm/{paypal-3ecdf234.js → paypal-86483f34.js} +1 -1
  20. package/dist/esm/zonos-address_11.entry.js +9 -9
  21. package/dist/esm/zonos-cart-items_13.entry.js +2 -2
  22. package/dist/esm/zonos-checkout.entry.js +9 -44
  23. package/dist/esm/zonos-controller.entry.js +1 -1
  24. package/dist/esm/zonos-country-flag.entry.js +1 -1
  25. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  26. package/dist/esm/zonos-empty-state-payment_4.entry.js +2 -2
  27. package/dist/esm/zonos-hello-dialog.entry.js +1 -1
  28. package/dist/esm/zonos-hello.entry.js +1 -1
  29. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  30. package/dist/esm-es5/{cart-2f0ee51d.js → cart-006b6633.js} +1 -1
  31. package/dist/esm-es5/index.js +1 -1
  32. package/dist/esm-es5/{paypal-3ecdf234.js → paypal-86483f34.js} +1 -1
  33. package/dist/esm-es5/zonos-address_11.entry.js +1 -1
  34. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  35. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  36. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  37. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  38. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  39. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  40. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  41. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  42. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  43. package/dist/scripts/index.js +1 -1
  44. package/dist/scripts/loadZonos.js +1 -1
  45. package/dist/scripts/zonos.js +1 -1
  46. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +0 -4
  47. package/dist/types/types/generated/graphql.internal.types.d.ts +8 -0
  48. package/dist/types/types/generated/graphql.internal.types.ts +8 -0
  49. package/dist/zonos-elements/index.esm.js +1 -1
  50. package/dist/zonos-elements/{p-39e369f6.system.entry.js → p-06547c8c.system.entry.js} +1 -1
  51. package/dist/zonos-elements/{p-3e15061e.system.entry.js → p-0d5fe109.system.entry.js} +1 -1
  52. package/dist/zonos-elements/{p-34b5ae9c.system.js → p-0f94e320.system.js} +1 -1
  53. package/dist/zonos-elements/{p-4931d780.entry.js → p-1383ab6b.entry.js} +1 -1
  54. package/dist/zonos-elements/{p-127deab4.system.entry.js → p-2abcaaa1.system.entry.js} +1 -1
  55. package/dist/zonos-elements/{p-de73fec0.system.js → p-3bcf2091.system.js} +1 -1
  56. package/dist/zonos-elements/p-3febb54a.entry.js +1 -0
  57. package/dist/zonos-elements/{p-139566b2.system.entry.js → p-49e78ccc.system.entry.js} +1 -1
  58. package/dist/zonos-elements/{p-5d7c9ac3.entry.js → p-4e11db81.entry.js} +1 -1
  59. package/dist/zonos-elements/{p-2f34e29a.js → p-63bfe67c.js} +1 -1
  60. package/dist/zonos-elements/{p-0fe6efef.system.entry.js → p-76468d91.system.entry.js} +1 -1
  61. package/dist/zonos-elements/{p-649d3e92.entry.js → p-7b1e8a42.entry.js} +1 -1
  62. package/dist/zonos-elements/{p-9e27aaff.system.entry.js → p-81bf423c.system.entry.js} +1 -1
  63. package/dist/zonos-elements/{p-e275d241.entry.js → p-8558486d.entry.js} +1 -1
  64. package/dist/zonos-elements/{p-dc1b3bcb.entry.js → p-9350f23a.entry.js} +1 -1
  65. package/dist/zonos-elements/{p-8df9a41b.entry.js → p-a35aab84.entry.js} +1 -1
  66. package/dist/zonos-elements/{p-c7f0941d.system.entry.js → p-b1970c2c.system.entry.js} +1 -1
  67. package/dist/zonos-elements/{p-f8253ae4.system.entry.js → p-bde07ab8.system.entry.js} +1 -1
  68. package/dist/zonos-elements/{p-6ccb1b13.entry.js → p-c1173557.entry.js} +1 -1
  69. package/dist/zonos-elements/{p-6a31eb14.system.js → p-c69c3219.system.js} +1 -1
  70. package/dist/zonos-elements/p-cd86baf3.entry.js +1 -0
  71. package/dist/zonos-elements/{p-4abc1b34.system.entry.js → p-d319e084.system.entry.js} +1 -1
  72. package/dist/zonos-elements/{p-23752a7e.entry.js → p-ddbeb2ec.entry.js} +1 -1
  73. package/dist/zonos-elements/{p-fccf8c66.system.entry.js → p-e5d4705e.system.entry.js} +1 -1
  74. package/dist/zonos-elements/p-ea6d87a1.system.js +1 -1
  75. package/dist/zonos-elements/{p-264e7688.js → p-f57b0170.js} +1 -1
  76. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  77. package/package.json +1 -1
  78. package/dist/zonos-elements/p-6b2358f2.entry.js +0 -1
  79. package/dist/zonos-elements/p-76d8844b.entry.js +0 -1
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, H as Host, F as Fragment } from './index-a457c60c.js';
2
- import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as stripeStoreRetrievePayment, e as cartStore, f as stripeStore, g as cartStoreUpdateItems, h as cartStoreReset, j as cartStoreResetTabItems, k as cartStoreClearCheckoutInterval, m as stripeStoreInitCheckoutSession, n as stripeStoreGetPaymentIntent, o as cartStoreStartCheckoutInterval, t as trackConversionEvent, p as getCheckoutSessionBody, q as cartStoreUpdateToErrorState, r as translate, u as getZCountryUrlParam, v as cartStoreSetCheckoutSession, w as stripeStorePrefetchLandedCost, x as cartStoreNextStep, y as stripeStoreUpdateCheckoutSessionBaseCurrency, z as stripeStoreHandleInventoryCheck, A as stripeStoreConfirmPayment, B as stripeStoreHandleInventoryRefund, C as stripeStoreReset, D as localizationStoreOnUpdate, E as currencyFormat } from './cart-2f0ee51d.js';
3
- import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript, b as paypalStore } from './paypal-3ecdf234.js';
2
+ import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as stripeStoreRetrievePayment, e as cartStore, f as stripeStore, g as cartStoreUpdateItems, h as cartStoreReset, j as cartStoreResetTabItems, k as cartStoreClearCheckoutInterval, m as stripeStoreInitCheckoutSession, n as stripeStoreGetPaymentIntent, o as cartStoreStartCheckoutInterval, t as trackConversionEvent, p as getCheckoutSessionBody, q as cartStoreUpdateToErrorState, r as translate, u as getZCountryUrlParam, v as cartStoreSetCheckoutSession, w as stripeStorePrefetchLandedCost, x as cartStoreNextStep, y as stripeStoreUpdateCheckoutSessionBaseCurrency, z as stripeStoreHandleInventoryCheck, A as stripeStoreConfirmPayment, B as stripeStoreHandleInventoryRefund, C as stripeStoreReset, D as localizationStoreOnUpdate, E as currencyFormat } from './cart-006b6633.js';
3
+ import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript, b as paypalStore } from './paypal-86483f34.js';
4
4
  import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-cdabc848.js';
5
5
  import { h as handleFetch, l as log, b as logError, s as sendErrorLog, c as getElapsedTime, d as allLogs, e as getAdditionalLogMetadata, g as getIsTestMode, j as jsonParse, a as getIsStagingMode, i as isCheckoutMobile } from './handleFetch-621e45bc.js';
6
6
  import { c as classes } from './classes-0d95c529.js';
@@ -331,35 +331,6 @@ const ZonosCheckout = class {
331
331
  paypalEnabled: paypalStoreHasPaypalEnabled(),
332
332
  });
333
333
  };
334
- /**
335
- * Check if the cart is expired, return `true` if the cart is expired
336
- */
337
- this.handleCartExpiredCheck = () => {
338
- var _a;
339
- // don't check for cart expiration if the cart is in test mode
340
- if (getIsTestMode()) {
341
- log('Not checking for cart expiration in test mode');
342
- return false;
343
- }
344
- // Do nothing if no cart data or cart expiration is not set
345
- if (!zonosStore.checkoutSettings.defaultCartExpiration ||
346
- !((_a = window.Zonos.cartData) === null || _a === void 0 ? void 0 : _a.createdAt)) {
347
- return false;
348
- }
349
- const cartCreatedAt = new Date(window.Zonos.cartData.createdAt).getTime();
350
- const currentTime = new Date().getTime();
351
- const timeDiff = currentTime - cartCreatedAt;
352
- const timeDiffInSeconds = Math.floor(timeDiff / 1000);
353
- log(`currentTime: ${currentTime} | cartCreatedAt: ${cartCreatedAt}`);
354
- log(`Cart has been created for ${timeDiffInSeconds / 60} minutes`);
355
- if (zonosStore.checkoutSettings.defaultCartExpiration) {
356
- if (timeDiffInSeconds > zonosStore.checkoutSettings.defaultCartExpiration) {
357
- this.isCartExpired = true;
358
- return true;
359
- }
360
- }
361
- return false;
362
- };
363
334
  /**
364
335
  * Check if stripe payment intent is succeeded or in a good state to move forward
365
336
  */
@@ -567,22 +538,12 @@ const ZonosCheckout = class {
567
538
  return false;
568
539
  }
569
540
  window.Zonos.cartData = cartData;
570
- const isExpired = this.handleCartExpiredCheck();
571
- if (isExpired) {
572
- // Do not proceed if the cart is expired
573
- return false;
574
- }
575
541
  const { adjustments, cartItems } = buildCartItemsByTempCart(cartData);
576
542
  await cartStoreUpdateItems({ adjustments, cartItems });
577
543
  }
578
544
  // if tempCartUUID is provided, use it instead of buildCartDetail
579
545
  else if (window.Zonos.cartData) {
580
546
  log('tempCartUUID is provided, start building cart');
581
- const isExpired = this.handleCartExpiredCheck();
582
- if (isExpired) {
583
- // Do not proceed if the cart is expired
584
- return false;
585
- }
586
547
  const { adjustments, cartItems } = buildCartItemsByTempCart(window.Zonos.cartData);
587
548
  await cartStoreUpdateItems({ adjustments, cartItems });
588
549
  }
@@ -773,9 +734,6 @@ const ZonosCheckout = class {
773
734
  try {
774
735
  // buildCartDetail may throw an error
775
736
  const result = await this.buildCartAndInit();
776
- if (this.isCartExpired) {
777
- throw new Error('This shopping cart is expired');
778
- }
779
737
  if (!result) {
780
738
  throw new Error('Error building cart');
781
739
  }
@@ -804,6 +762,13 @@ const ZonosCheckout = class {
804
762
  }
805
763
  }
806
764
  catch (err) {
765
+ if (err instanceof Error) {
766
+ const message = err.message;
767
+ if (message === 'Cart is expired.') {
768
+ this.isCartExpired = true;
769
+ return;
770
+ }
771
+ }
807
772
  // stop loading
808
773
  stripeStore.isFetchingSession = false;
809
774
  logError(err);
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-a457c60c.js';
2
- import { G as isValidSelector, f as stripeStore, H as initLocalizationStore, e as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-2f0ee51d.js';
2
+ import { G as isValidSelector, f as stripeStore, H as initLocalizationStore, e as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-006b6633.js';
3
3
  import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-cdabc848.js';
4
4
  import { g as getGenericSettingsOverride, i as iframeServices, a as injectPrivateIframe } from './getGenericSettingsOverride-0bc3e118.js';
5
5
  import { h as handleFetch, b as logError, l as log } from './handleFetch-621e45bc.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-a457c60c.js';
2
- import { l as localizationStore } from './cart-2f0ee51d.js';
2
+ import { l as localizationStore } from './cart-006b6633.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-cdabc848.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
5
  import './handleFetch-621e45bc.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-a457c60c.js';
2
- import { a as localizationStoreUpdateSelectedCountryCode, r as translate, l as localizationStore } from './cart-2f0ee51d.js';
2
+ import { a as localizationStoreUpdateSelectedCountryCode, r as translate, l as localizationStore } from './cart-006b6633.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-cdabc848.js';
4
4
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
5
5
  import { i as isDarkColor } from './isDarkColor-4c7b2ffc.js';
@@ -2,9 +2,9 @@ import { r as registerInstance, h, H as Host, d as getElement, c as createEvent
2
2
  import { d as zonosStoreFontFamily } from './zonosStore-cdabc848.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
4
  import { g as getBorderRadius } from './getBorderRadius-413e97eb.js';
5
- import { f as stripeStore, t as trackConversionEvent, e as cartStore } from './cart-2f0ee51d.js';
5
+ import { f as stripeStore, t as trackConversionEvent, e as cartStore } from './cart-006b6633.js';
6
6
  import { b as logError, l as log } from './handleFetch-621e45bc.js';
7
- import { d as paypalStoreInitButtons } from './paypal-3ecdf234.js';
7
+ import { d as paypalStoreInitButtons } from './paypal-86483f34.js';
8
8
  import './isDarkColor-4c7b2ffc.js';
9
9
 
10
10
  const PaymentEmptyStateDarkIcon = `<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-a457c60c.js';
2
- import { r as translate, l as localizationStore, E as currencyFormat } from './cart-2f0ee51d.js';
2
+ import { r as translate, l as localizationStore, E as currencyFormat } from './cart-006b6633.js';
3
3
  import { z as zonosStore } from './zonosStore-cdabc848.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
5
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
@@ -1,6 +1,6 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-a457c60c.js';
2
2
  import { d as debounce_1 } from './debounce-a2121722.js';
3
- import { l as localizationStore, G as isValidSelector, r as translate, u as getZCountryUrlParam, I as setZCountryUrlParam, J as currencyDisplay, K as currencyConvertAndFormat, L as currencyConvert, E as currencyFormat } from './cart-2f0ee51d.js';
3
+ import { l as localizationStore, G as isValidSelector, r as translate, u as getZCountryUrlParam, I as setZCountryUrlParam, J as currencyDisplay, K as currencyConvertAndFormat, L as currencyConvert, E as currencyFormat } from './cart-006b6633.js';
4
4
  import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-cdabc848.js';
5
5
  import { c as classes } from './classes-0d95c529.js';
6
6
  import { h as handleFetch, b as logError, l as log } from './handleFetch-621e45bc.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-a457c60c.js';
2
- import { W as localizationStoreUpdateSelectedLocale, r as translate, l as localizationStore } from './cart-2f0ee51d.js';
2
+ import { W as localizationStoreUpdateSelectedLocale, r as translate, l as localizationStore } from './cart-006b6633.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-cdabc848.js';
4
4
  import { l as languages } from './ILanguage-cd6acb72.js';
5
5
  import './handleFetch-621e45bc.js';