@zonos/elements 1.3.79 → 1.3.81

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 (103) hide show
  1. package/dist/cjs/{CheckoutConfig-2fef694e.js → CheckoutConfig-850071ae.js} +1 -1
  2. package/dist/cjs/{cart-977c9d4c.js → cart-97e693e4.js} +4 -5
  3. package/dist/cjs/{createCustomEvent-2b19361e.js → createCustomEvent-777b3fa7.js} +2 -2
  4. package/dist/cjs/{handleFetch-661a8225.js → handleFetch-45e76490.js} +29 -1
  5. package/dist/cjs/index.cjs.js +10 -10
  6. package/dist/cjs/{paypal-3008c89e.js → paypal-16029169.js} +2 -2
  7. package/dist/cjs/zonos-address_8.cjs.entry.js +2 -2
  8. package/dist/cjs/zonos-badge_13.cjs.entry.js +4 -4
  9. package/dist/cjs/zonos-checkout.cjs.entry.js +17 -5
  10. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  11. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  14. package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
  15. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  16. package/dist/cjs/zonos-notification_3.cjs.entry.js +3 -3
  17. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +14 -1
  18. package/dist/collection/components/store/checkout/stripe.js +1 -1
  19. package/dist/collection/components/store/hello/localization.js +2 -3
  20. package/dist/collection/components/utils/handleFetch.js +1 -0
  21. package/dist/collection/components/utils/logging/log.js +26 -1
  22. package/dist/collection/components/utils/logging/sendErrorLog.js +2 -0
  23. package/dist/collection/scripts/_extractZonosQaUrl.js +16 -0
  24. package/dist/collection/scripts/_getZonosQaUrl.js +13 -4
  25. package/dist/esm/{CheckoutConfig-c7954c2a.js → CheckoutConfig-c0ec120d.js} +1 -1
  26. package/dist/esm/{cart-414322dc.js → cart-9bf6dece.js} +4 -5
  27. package/dist/esm/{createCustomEvent-fcd6d294.js → createCustomEvent-a18e45a2.js} +2 -2
  28. package/dist/esm/{handleFetch-80ecfb91.js → handleFetch-0133265e.js} +29 -2
  29. package/dist/esm/index.js +11 -11
  30. package/dist/esm/{paypal-3fecd52f.js → paypal-edab4cee.js} +2 -2
  31. package/dist/esm/zonos-address_8.entry.js +2 -2
  32. package/dist/esm/zonos-badge_13.entry.js +4 -4
  33. package/dist/esm/zonos-checkout.entry.js +17 -5
  34. package/dist/esm/zonos-controller.entry.js +2 -2
  35. package/dist/esm/zonos-country-flag.entry.js +2 -2
  36. package/dist/esm/zonos-country-select_4.entry.js +2 -2
  37. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  38. package/dist/esm/zonos-hello.entry.js +2 -2
  39. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  40. package/dist/esm/zonos-notification_3.entry.js +3 -3
  41. package/dist/esm-es5/{CheckoutConfig-c7954c2a.js → CheckoutConfig-c0ec120d.js} +1 -1
  42. package/dist/esm-es5/{cart-414322dc.js → cart-9bf6dece.js} +1 -1
  43. package/dist/esm-es5/{createCustomEvent-fcd6d294.js → createCustomEvent-a18e45a2.js} +1 -1
  44. package/dist/esm-es5/handleFetch-0133265e.js +1 -0
  45. package/dist/esm-es5/index.js +1 -1
  46. package/dist/esm-es5/{paypal-3fecd52f.js → paypal-edab4cee.js} +1 -1
  47. package/dist/esm-es5/zonos-address_8.entry.js +1 -1
  48. package/dist/esm-es5/zonos-badge_13.entry.js +1 -1
  49. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  50. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  51. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  52. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  53. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  54. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  55. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  56. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  57. package/dist/scripts/index.js +1 -1
  58. package/dist/scripts/loadZonos.js +1 -1
  59. package/dist/scripts/zonos.js +1 -1
  60. package/dist/types/components/utils/logging/log.d.ts +2 -1
  61. package/dist/types/scripts/_extractZonosQaUrl.d.ts +1 -0
  62. package/dist/types/scripts/_getZonosQaUrl.d.ts +1 -1
  63. package/dist/zonos-elements/index.esm.js +1 -1
  64. package/dist/zonos-elements/p-197c5707.system.js +1 -0
  65. package/dist/zonos-elements/{p-ced3aa4f.system.entry.js → p-1b8c8e0c.system.entry.js} +1 -1
  66. package/dist/zonos-elements/p-214724f8.system.entry.js +1 -0
  67. package/dist/zonos-elements/{p-d5818f0a.js → p-23358611.js} +1 -1
  68. package/dist/zonos-elements/{p-0290df9c.entry.js → p-264fbd27.entry.js} +1 -1
  69. package/dist/zonos-elements/{p-9c02a170.system.js → p-49478dba.system.js} +1 -1
  70. package/dist/zonos-elements/{p-0a1db77d.system.entry.js → p-51f8c3d5.system.entry.js} +1 -1
  71. package/dist/zonos-elements/{p-0f640802.system.js → p-62044821.system.js} +1 -1
  72. package/dist/zonos-elements/{p-75fd8895.js → p-6b4fec5a.js} +1 -1
  73. package/dist/zonos-elements/{p-a725574a.entry.js → p-6f821997.entry.js} +1 -1
  74. package/dist/zonos-elements/{p-c2920074.js → p-7ca0622f.js} +1 -1
  75. package/dist/zonos-elements/{p-cce51fa5.system.entry.js → p-811ed9bf.system.entry.js} +1 -1
  76. package/dist/zonos-elements/{p-81cdd0d5.system.js → p-8c0ff373.system.js} +1 -1
  77. package/dist/zonos-elements/{p-f8dace42.system.entry.js → p-8cbbdd53.system.entry.js} +1 -1
  78. package/dist/zonos-elements/{p-86bfda32.system.entry.js → p-8dae668f.system.entry.js} +1 -1
  79. package/dist/zonos-elements/{p-bbabc829.system.entry.js → p-92ba4082.system.entry.js} +1 -1
  80. package/dist/zonos-elements/{p-e68941ce.system.entry.js → p-95f0ffd1.system.entry.js} +1 -1
  81. package/dist/zonos-elements/{p-982aa677.entry.js → p-97f0d9d2.entry.js} +1 -1
  82. package/dist/zonos-elements/{p-72f0641d.entry.js → p-a2fedd1c.entry.js} +1 -1
  83. package/dist/zonos-elements/{p-3d01ac9a.entry.js → p-a3200d5c.entry.js} +1 -1
  84. package/dist/zonos-elements/p-ad7ce197.js +1 -0
  85. package/dist/zonos-elements/{p-6b3fd741.js → p-b8e85bf5.js} +1 -1
  86. package/dist/zonos-elements/p-bc4a147d.entry.js +1 -0
  87. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  88. package/dist/zonos-elements/{p-acbec292.system.entry.js → p-d08ed3ea.system.entry.js} +1 -1
  89. package/dist/zonos-elements/{p-2d466263.system.js → p-d26d827d.system.js} +1 -1
  90. package/dist/zonos-elements/{p-1047233d.entry.js → p-d775bd42.entry.js} +1 -1
  91. package/dist/zonos-elements/{p-4032de50.entry.js → p-df4deb97.entry.js} +1 -1
  92. package/dist/zonos-elements/p-e3cb74fd.system.js +1 -0
  93. package/dist/zonos-elements/{p-166b3181.entry.js → p-e468f85e.entry.js} +1 -1
  94. package/dist/zonos-elements/{p-f0d6f027.system.entry.js → p-f7b5ae86.system.entry.js} +1 -1
  95. package/dist/zonos-elements/{p-c1400636.entry.js → p-fac38f60.entry.js} +1 -1
  96. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  97. package/package.json +1 -1
  98. package/dist/esm-es5/handleFetch-80ecfb91.js +0 -1
  99. package/dist/zonos-elements/p-2ec2e9d3.js +0 -1
  100. package/dist/zonos-elements/p-502d5e52.system.entry.js +0 -1
  101. package/dist/zonos-elements/p-5880738e.system.js +0 -1
  102. package/dist/zonos-elements/p-c4957e35.system.js +0 -1
  103. package/dist/zonos-elements/p-e6ec9f12.entry.js +0 -1
@@ -1,5 +1,30 @@
1
- const log = (message, type, ...additionalInfo) => {
1
+ const startTime = performance.now();
2
+ const allLogs = [];
3
+ const prepInfo = (info) => {
4
+ if (typeof info === 'string') {
5
+ return info;
6
+ }
7
+ try {
8
+ const infoToJson = JSON.stringify(info);
9
+ return infoToJson;
10
+ }
11
+ catch (e1) {
12
+ if (info && typeof info.toString === 'function') {
13
+ const infoToString = info.toString();
14
+ return infoToString;
15
+ }
16
+ return 'Unable to stringify info';
17
+ }
18
+ };
19
+ const log = (message, type, ..._additionalInfo) => {
2
20
  var _a, _b;
21
+ const time = performance.now() - startTime;
22
+ const elapsedTime =
23
+ // format the time to seconds if over 1 second
24
+ time > 1000 ? `${(time / 1000).toFixed(2)}s` : `${time.toFixed(2)}ms`;
25
+ const additionalInfo = [`(${elapsedTime})`, ..._additionalInfo];
26
+ const preppedInfo = additionalInfo.map(prepInfo).join(' ');
27
+ allLogs.push([type, message, preppedInfo].filter(Boolean).join(' '));
3
28
  const isDebug = !!((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.debug) ||
4
29
  !!window.location.search.match(/\?.*(&*)zonosDebug=1/);
5
30
  // if debug is false, do not log
@@ -91,6 +116,7 @@ const jsonParse = (_data) => {
91
116
  */
92
117
  const postReleaseReportingDuration = 1 * 3600 * 1000; // 1 hour
93
118
  const sendErrorLog = async ({ endpoint, errors, metadata, shouldPostReleaseErrorReporting, }) => {
119
+ log('sendErrorLog', 'warn', endpoint, metadata, errors);
94
120
  if (shouldPostReleaseErrorReporting) {
95
121
  // We only want to report errors that happened if current time is less than 2 hours after release time
96
122
  const releaseTime = Number(window.Zonos.releaseDate);
@@ -310,6 +336,7 @@ const handleFetch = async (path, _opts) => {
310
336
  method });
311
337
  // This is for testing fallback API, set fallback API type to start with
312
338
  const useFallbackApi = new URLSearchParams(window.location.search).get('useFallbackApi');
339
+ log(path, 'info');
313
340
  return handleRequestWithFallback({
314
341
  basePathType: useFallbackApi || MAIN_BASE_API_TYPE,
315
342
  options,
@@ -317,4 +344,4 @@ const handleFetch = async (path, _opts) => {
317
344
  });
318
345
  };
319
346
 
320
- export { logError as a, fallbackApiList as f, handleFetch as h, jsonParse as j, log as l, sendErrorLog as s };
347
+ export { logError as a, allLogs as b, fallbackApiList as f, handleFetch as h, jsonParse as j, log as l, sendErrorLog as s };
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { l as log, a as logError } from './handleFetch-80ecfb91.js';
2
- import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-c7954c2a.js';
3
- export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-c7954c2a.js';
1
+ import { l as log, a as logError } from './handleFetch-0133265e.js';
2
+ import { s as setupCartData, c as checkoutHiddenBtnSelector } from './CheckoutConfig-c0ec120d.js';
3
+ export { c as checkoutHiddenBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-c0ec120d.js';
4
4
 
5
5
  /**
6
6
  * Get the load version and url based on the loadScriptSrc and version
@@ -94,7 +94,7 @@ const getZonosQaUrl = () => {
94
94
  return null;
95
95
  }
96
96
  const qaUrl = extractZonosQaUrl(window.location.href);
97
- const cdnUrl = "https://v1.3.79.js.zonos.com";
97
+ const cdnUrl = "https://v1.3.81.js.zonos.com";
98
98
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
99
99
  if (!qaUrl &&
100
100
  (cdnUrl.includes('test.') ||
@@ -116,7 +116,7 @@ const getZonosQaUrl = () => {
116
116
  }
117
117
  const suffixDomain = 'preview.js.zonos.com';
118
118
  const fullUrl = `https://${qaUrl}.${suffixDomain}`;
119
- log(`[ZONOS-WARNING] using '${fullUrl}' for loading script`, 'warn');
119
+ log(`[ZONOS-WARNING] using '${fullUrl}' for loading elements script`, 'warn');
120
120
  // request to the url and check if the request has an error
121
121
  void fetch(fullUrl)
122
122
  .then(() => {
@@ -278,10 +278,10 @@ const zonosLoadUrl = (() => {
278
278
  }
279
279
  return null;
280
280
  })();
281
- const ZONOS_URL = "https://v1.3.79.js.zonos.com";
282
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.79";
283
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.79";
284
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.79";
281
+ const ZONOS_URL = "https://v1.3.81.js.zonos.com";
282
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.81";
283
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.81";
284
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.81";
285
285
  const INTER_FONT_URL = 'https://rsms.me';
286
286
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
287
287
  const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
@@ -296,7 +296,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
296
296
  !!window.location.search.match(/\?.*(&*)zonosConversionTest/);
297
297
  Zonos._paypalMockResponse = null;
298
298
  Zonos.isBigCommerce = false;
299
- Zonos.releaseDate = "1728594533601";
299
+ Zonos.releaseDate = "1728674078511";
300
300
  Zonos.isLegacyCheckout = false;
301
301
  /**
302
302
  * By default, the package will load from npm
@@ -304,7 +304,7 @@ Zonos.isLegacyCheckout = false;
304
304
  Zonos.isNpm = true;
305
305
  Zonos.zonosQaUrl = null;
306
306
  Zonos.zonosQaUrlApi = null;
307
- Zonos.version = `v${"1.3.79"}`;
307
+ Zonos.version = `v${"1.3.81"}`;
308
308
  Zonos.modeAlerted = false;
309
309
  Zonos.cartData = null;
310
310
  Zonos.paypal = null;
@@ -1,6 +1,6 @@
1
1
  import { z as zonosStore, c as createStore } from './zonosStore-0dc7a947.js';
2
- import { d as cartStore, r as stripeStoreHandleInventoryCheck, t as translate, q as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-414322dc.js';
3
- import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-80ecfb91.js';
2
+ import { d as cartStore, r as stripeStoreHandleInventoryCheck, t as translate, q as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-9bf6dece.js';
3
+ import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-0133265e.js';
4
4
  import { t as tinycolor } from './isDarkColor-b3afa948.js';
5
5
 
6
6
  /*!
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-86b8247e.js';
2
- import { j as stripeStore, l as localizationStore, t as translate } from './cart-414322dc.js';
2
+ import { j as stripeStore, l as localizationStore, t as translate } from './cart-9bf6dece.js';
3
3
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
4
- import { a as logError } from './handleFetch-80ecfb91.js';
4
+ import { a as logError } from './handleFetch-0133265e.js';
5
5
  import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
6
6
  import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
7
7
  import { c as classes } from './classes-0d95c529.js';
@@ -1,11 +1,11 @@
1
1
  import { r as registerInstance, h, H as Host, a as getAssetPath, F as Fragment, c as createEvent, d as getElement } from './index-86b8247e.js';
2
2
  import { d as zonosStoreFontFamily, z as zonosStore, g as getZonosStoreTheme } from './zonosStore-0dc7a947.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
- import { d as cartStore, t as translate, E as currencyFormat, F as cartStoreHasOneEligibleItem, v as stripeStoreReset, j as stripeStore, G as stripeStoreRetrievePayment, H as stripeStoreMessageBasedOnStatus, l as localizationStore, I as stripeStoreTranslateAddressToLatin, J as cartStoreUpdateSelectedShippingOption, K as cartStoreGetShippingTransitInfo } from './cart-414322dc.js';
5
- import { s as submitGtag, a as paypalStore, b as paypalStoreReset, c as paypalStoreHasPaypalEnabled, i as isContrastColor } from './paypal-3fecd52f.js';
6
- import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-fcd6d294.js';
4
+ import { d as cartStore, t as translate, E as currencyFormat, F as cartStoreHasOneEligibleItem, v as stripeStoreReset, j as stripeStore, G as stripeStoreRetrievePayment, H as stripeStoreMessageBasedOnStatus, l as localizationStore, I as stripeStoreTranslateAddressToLatin, J as cartStoreUpdateSelectedShippingOption, K as cartStoreGetShippingTransitInfo } from './cart-9bf6dece.js';
5
+ import { s as submitGtag, a as paypalStore, b as paypalStoreReset, c as paypalStoreHasPaypalEnabled, i as isContrastColor } from './paypal-edab4cee.js';
6
+ import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-a18e45a2.js';
7
7
  import { g as getBorderRadius } from './getBorderRadius-cff1e39b.js';
8
- import { h as handleFetch, s as sendErrorLog } from './handleFetch-80ecfb91.js';
8
+ import { h as handleFetch, s as sendErrorLog } from './handleFetch-0133265e.js';
9
9
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
10
10
  import { l as languages } from './ILanguage-cd6acb72.js';
11
11
  import { i as isDarkColor, t as tinycolor } from './isDarkColor-b3afa948.js';
@@ -1,14 +1,14 @@
1
1
  import { r as registerInstance, h, H as Host, F as Fragment } from './index-86b8247e.js';
2
- import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, n as cartStoreUpdateToErrorState, t as translate, o as cartStoreSetCheckoutSession, p as stripeStorePrefetchLandedCost, q as cartStoreNextStep, r as stripeStoreHandleInventoryCheck, u as stripeStoreConfirmPayment, v as stripeStoreReset, w as localizationStoreOnUpdate } from './cart-414322dc.js';
3
- import { s as submitGtag, p as paypalInitScript } from './paypal-3fecd52f.js';
2
+ import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, n as cartStoreUpdateToErrorState, t as translate, o as cartStoreSetCheckoutSession, p as stripeStorePrefetchLandedCost, q as cartStoreNextStep, r as stripeStoreHandleInventoryCheck, u as stripeStoreConfirmPayment, v as stripeStoreReset, w as localizationStoreOnUpdate } from './cart-9bf6dece.js';
3
+ import { s as submitGtag, p as paypalInitScript } from './paypal-edab4cee.js';
4
4
  import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-0dc7a947.js';
5
- import { c as createCustomEvent, t as trackConversionEvent, g as getIsTestMode } from './createCustomEvent-fcd6d294.js';
5
+ import { c as createCustomEvent, t as trackConversionEvent, g as getIsTestMode } from './createCustomEvent-a18e45a2.js';
6
6
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
7
- import { l as log, a as logError, s as sendErrorLog } from './handleFetch-80ecfb91.js';
7
+ import { l as log, a as logError, s as sendErrorLog, b as allLogs } from './handleFetch-0133265e.js';
8
8
  import { c as classes } from './classes-0d95c529.js';
9
9
  import { g as getBorderRadius } from './getBorderRadius-cff1e39b.js';
10
10
  import { i as isDarkColor } from './isDarkColor-b3afa948.js';
11
- import { s as setupCartData, d as domesticRedirectedBtnSelector, c as checkoutHiddenBtnSelector } from './CheckoutConfig-c7954c2a.js';
11
+ import { s as setupCartData, d as domesticRedirectedBtnSelector, c as checkoutHiddenBtnSelector } from './CheckoutConfig-c0ec120d.js';
12
12
  import { R as RemoveIcon } from './RemoveIcon-9dc5dd1a.js';
13
13
 
14
14
  /**
@@ -349,6 +349,7 @@ const ZonosCheckout = class {
349
349
  button,
350
350
  });
351
351
  button.addEventListener('click', async (e) => {
352
+ var _a;
352
353
  if (!isShippableCountry() || isDisabledCountry()) {
353
354
  return;
354
355
  }
@@ -381,6 +382,17 @@ const ZonosCheckout = class {
381
382
  ],
382
383
  title: translate('Error creating Checkout'),
383
384
  });
385
+ // We want to log the error anytime we fail to create a checkout session
386
+ void sendErrorLog({
387
+ endpoint: 'Error creating Checkout',
388
+ errors: [err instanceof Error ? err.toString() : 'Unknown error'],
389
+ metadata: {
390
+ allLogs,
391
+ cartId: window.Zonos.cartId,
392
+ href: window.location.href,
393
+ storeBaseUrl: (_a = window.Zonos.cartData) === null || _a === void 0 ? void 0 : _a.storeBaseUrl,
394
+ },
395
+ });
384
396
  }
385
397
  }, {
386
398
  // Trigger this event before any other event
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-86b8247e.js';
2
- import { x as isValidSelector, j as stripeStore, y as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-414322dc.js';
2
+ import { x as isValidSelector, j as stripeStore, y as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-9bf6dece.js';
3
3
  import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
4
- import { h as handleFetch, a as logError, l as log } from './handleFetch-80ecfb91.js';
4
+ import { h as handleFetch, a as logError, l as log } from './handleFetch-0133265e.js';
5
5
  import './isDarkColor-b3afa948.js';
6
6
  import './getBorderRadius-cff1e39b.js';
7
7
 
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-86b8247e.js';
2
- import { l as localizationStore } from './cart-414322dc.js';
2
+ import { l as localizationStore } from './cart-9bf6dece.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
- import './handleFetch-80ecfb91.js';
5
+ import './handleFetch-0133265e.js';
6
6
  import './isDarkColor-b3afa948.js';
7
7
  import './getBorderRadius-cff1e39b.js';
8
8
 
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-86b8247e.js';
2
- import { a as localizationStoreUpdateSelectedCountryCode, t as translate, l as localizationStore } from './cart-414322dc.js';
2
+ import { a as localizationStoreUpdateSelectedCountryCode, t as translate, l as localizationStore } from './cart-9bf6dece.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
4
4
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
5
5
  import { i as isDarkColor } from './isDarkColor-b3afa948.js';
6
6
  import { l as languages } from './ILanguage-cd6acb72.js';
7
- import './handleFetch-80ecfb91.js';
7
+ import './handleFetch-0133265e.js';
8
8
  import './getBorderRadius-cff1e39b.js';
9
9
 
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-86b8247e.js';
2
- import { t as translate, l as localizationStore, E as currencyFormat } from './cart-414322dc.js';
2
+ import { t as translate, l as localizationStore, E as currencyFormat } from './cart-9bf6dece.js';
3
3
  import { z as zonosStore } from './zonosStore-0dc7a947.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
5
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
6
6
  import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
7
- import './handleFetch-80ecfb91.js';
7
+ import './handleFetch-0133265e.js';
8
8
  import './isDarkColor-b3afa948.js';
9
9
  import './getBorderRadius-cff1e39b.js';
10
10
 
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
2
2
  import { _ as _root, e as _baseGetTag, i as isObjectLike_1, f as isObject_1, z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-0dc7a947.js';
3
- import { l as localizationStore, x as isValidSelector, t as translate, z as getZCountryUrlParam, A as setZCountryUrlParam, B as currencyDisplay, C as currencyConvertAndFormat, D as currencyConvert, E as currencyFormat } from './cart-414322dc.js';
3
+ import { l as localizationStore, x as isValidSelector, t as translate, z as getZCountryUrlParam, A as setZCountryUrlParam, B as currencyDisplay, C as currencyConvertAndFormat, D as currencyConvert, E as currencyFormat } from './cart-9bf6dece.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
- import { h as handleFetch, a as logError, l as log } from './handleFetch-80ecfb91.js';
5
+ import { h as handleFetch, a as logError, l as log } from './handleFetch-0133265e.js';
6
6
  import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
7
7
  import './isDarkColor-b3afa948.js';
8
8
  import './getBorderRadius-cff1e39b.js';
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
2
- import { L as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-414322dc.js';
2
+ import { L as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-9bf6dece.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
4
4
  import { l as languages } from './ILanguage-cd6acb72.js';
5
- import './handleFetch-80ecfb91.js';
5
+ import './handleFetch-0133265e.js';
6
6
  import './isDarkColor-b3afa948.js';
7
7
  import './getBorderRadius-cff1e39b.js';
8
8
 
@@ -1,9 +1,9 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement, c as createEvent } from './index-86b8247e.js';
2
2
  import { d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
- import { j as stripeStore } from './cart-414322dc.js';
5
- import { a as logError, l as log } from './handleFetch-80ecfb91.js';
6
- import { d as paypalStoreInitButtons } from './paypal-3fecd52f.js';
4
+ import { j as stripeStore } from './cart-9bf6dece.js';
5
+ import { a as logError, l as log } from './handleFetch-0133265e.js';
6
+ import { d as paypalStoreInitButtons } from './paypal-edab4cee.js';
7
7
  import './isDarkColor-b3afa948.js';
8
8
  import './getBorderRadius-cff1e39b.js';
9
9
 
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function c(t){try{u(n["throw"](t))}catch(t){a(t)}}function u(t){t.done?r(t.value):o(t.value).then(i,c)}u((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(t){return function(e){return u([t,e])}}function u(c){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(r=0)),r)try{if(n=1,o&&(a=c[0]&2?o["return"]:c[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,c[1])).done)return a;if(o=0,a)c=[c[0]&2,a.value];switch(c[0]){case 0:case 1:a=c;break;case 4:r.label++;return{value:c[1],done:false};case 5:r.label++;o=c[1];c=[0];continue;case 7:c=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1];a=c;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(c);break}if(a[2])r.ops.pop();r.trys.pop();continue}c=e.call(t,r)}catch(t){c=[6,t];o=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{h as handleFetch,l as log,a as logError}from"./handleFetch-80ecfb91.js";var getTempCartById=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(o){switch(o.label){case 0:return[4,handleFetch("/api/zonos-elements/get-temp-cart",{body:{tempCartUUID:t},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:e=o.sent(),r=e.errors,n=e.json;if(!n||r.length){return[2,null]}return[2,n]}}))}))};var setupCartData=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,getTempCartById(t)];case 1:e=r.sent();log("[ZONOS - loadZonos] getting temp cart data","info",e);if(!e){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}return[2,{cartData:e.cartData,storeFavicon:e.storeFaviconUrl,storeId:e.cartData.storeId,storeLogo:e.storeLogoUrl,zonosApiKey:e.cartData.credentialToken}]}}))}))};var checkoutHiddenBtnSelector="zonos--checkout-hidden-button";var domesticRedirectedBtnSelector="zonos--domestic-redirected-checkout-button";export{checkoutHiddenBtnSelector as c,domesticRedirectedBtnSelector as d,setupCartData as s};
1
+ var __awaiter=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,a){function i(t){try{u(n.next(t))}catch(t){a(t)}}function c(t){try{u(n["throw"](t))}catch(t){a(t)}}function u(t){t.done?r(t.value):o(t.value).then(i,c)}u((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(t){return function(e){return u([t,e])}}function u(c){if(n)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(r=0)),r)try{if(n=1,o&&(a=c[0]&2?o["return"]:c[0]?o["throw"]||((a=o["return"])&&a.call(o),0):o.next)&&!(a=a.call(o,c[1])).done)return a;if(o=0,a)c=[c[0]&2,a.value];switch(c[0]){case 0:case 1:a=c;break;case 4:r.label++;return{value:c[1],done:false};case 5:r.label++;o=c[1];c=[0];continue;case 7:c=r.ops.pop();r.trys.pop();continue;default:if(!(a=r.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){r.label=c[1];break}if(c[0]===6&&r.label<a[1]){r.label=a[1];a=c;break}if(a&&r.label<a[2]){r.label=a[2];r.ops.push(c);break}if(a[2])r.ops.pop();r.trys.pop();continue}c=e.call(t,r)}catch(t){c=[6,t];o=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};import{h as handleFetch,l as log,a as logError}from"./handleFetch-0133265e.js";var getTempCartById=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e,r,n;return __generator(this,(function(o){switch(o.label){case 0:return[4,handleFetch("/api/zonos-elements/get-temp-cart",{body:{tempCartUUID:t},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:e=o.sent(),r=e.errors,n=e.json;if(!n||r.length){return[2,null]}return[2,n]}}))}))};var setupCartData=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(r){switch(r.label){case 0:return[4,getTempCartById(t)];case 1:e=r.sent();log("[ZONOS - loadZonos] getting temp cart data","info",e);if(!e){logError("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}return[2,{cartData:e.cartData,storeFavicon:e.storeFaviconUrl,storeId:e.cartData.storeId,storeLogo:e.storeLogoUrl,zonosApiKey:e.cartData.credentialToken}]}}))}))};var checkoutHiddenBtnSelector="zonos--checkout-hidden-button";var domesticRedirectedBtnSelector="zonos--domestic-redirected-checkout-button";export{checkoutHiddenBtnSelector as c,domesticRedirectedBtnSelector as d,setupCartData as s};