@zonos/elements 1.3.102 → 1.3.103

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 (99) hide show
  1. package/dist/cjs/{CheckoutConfig-704147ec.js → CheckoutConfig-090e2b05.js} +1 -1
  2. package/dist/cjs/{cart-213f42f0.js → cart-207f884e.js} +1 -1
  3. package/dist/cjs/{createCustomEvent-f2792ab7.js → createCustomEvent-16d055b8.js} +2 -2
  4. package/dist/cjs/{handleFetch-5a16f2bc.js → handleFetch-b0bbc10b.js} +12 -5
  5. package/dist/cjs/index.cjs.js +9 -9
  6. package/dist/cjs/{paypal-d881282c.js → paypal-8f5dccc8.js} +2 -2
  7. package/dist/cjs/zonos-address_7.cjs.entry.js +2 -2
  8. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +4 -4
  9. package/dist/cjs/zonos-checkout.cjs.entry.js +60 -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 +4 -0
  18. package/dist/collection/components/utils/logging/log.js +11 -5
  19. package/dist/collection/components/utils/logging/sendLoadCheckoutFacadeLog.js +24 -0
  20. package/dist/collection/components/utils/logging/sendLoadScriptLog.js +17 -8
  21. package/dist/esm/{CheckoutConfig-d237227e.js → CheckoutConfig-9cdb7beb.js} +1 -1
  22. package/dist/esm/{cart-9a4c155b.js → cart-90943a07.js} +1 -1
  23. package/dist/esm/{createCustomEvent-65611cd0.js → createCustomEvent-3ea6c7c5.js} +2 -2
  24. package/dist/esm/{handleFetch-ce924688.js → handleFetch-41e3d2b2.js} +12 -6
  25. package/dist/esm/index.js +10 -10
  26. package/dist/esm/{paypal-63e83a4a.js → paypal-417c64a1.js} +2 -2
  27. package/dist/esm/zonos-address_7.entry.js +2 -2
  28. package/dist/esm/zonos-cart-items_13.entry.js +4 -4
  29. package/dist/esm/zonos-checkout.entry.js +60 -5
  30. package/dist/esm/zonos-controller.entry.js +2 -2
  31. package/dist/esm/zonos-country-flag.entry.js +2 -2
  32. package/dist/esm/zonos-country-select_4.entry.js +2 -2
  33. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  34. package/dist/esm/zonos-hello.entry.js +2 -2
  35. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  36. package/dist/esm/zonos-notification_3.entry.js +3 -3
  37. package/dist/esm-es5/{CheckoutConfig-d237227e.js → CheckoutConfig-9cdb7beb.js} +1 -1
  38. package/dist/esm-es5/{cart-9a4c155b.js → cart-90943a07.js} +1 -1
  39. package/dist/esm-es5/{createCustomEvent-65611cd0.js → createCustomEvent-3ea6c7c5.js} +1 -1
  40. package/dist/esm-es5/handleFetch-41e3d2b2.js +1 -0
  41. package/dist/esm-es5/index.js +1 -1
  42. package/dist/esm-es5/{paypal-63e83a4a.js → paypal-417c64a1.js} +1 -1
  43. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  44. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  45. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  46. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  47. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  48. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  49. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  50. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  51. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  52. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  53. package/dist/scripts/index.js +1 -1
  54. package/dist/scripts/loadZonos.js +1 -1
  55. package/dist/scripts/zonos.js +1 -1
  56. package/dist/types/components/utils/logging/log.d.ts +4 -0
  57. package/dist/types/components/utils/logging/sendLoadCheckoutFacadeLog.d.ts +1 -0
  58. package/dist/types/components/utils/logging/sendLoadScriptLog.d.ts +12 -0
  59. package/dist/zonos-elements/index.esm.js +1 -1
  60. package/dist/zonos-elements/{p-6b1aee83.entry.js → p-0d42fb2f.entry.js} +1 -1
  61. package/dist/zonos-elements/{p-481a5dde.system.entry.js → p-105e5a07.system.entry.js} +1 -1
  62. package/dist/zonos-elements/p-1fc16bee.system.js +1 -0
  63. package/dist/zonos-elements/{p-4814d204.system.js → p-21f04cb8.system.js} +1 -1
  64. package/dist/zonos-elements/p-27b6bbc2.system.js +1 -0
  65. package/dist/zonos-elements/{p-daec1676.system.entry.js → p-317066a3.system.entry.js} +1 -1
  66. package/dist/zonos-elements/{p-3deca7bd.system.js → p-32ff2c95.system.js} +1 -1
  67. package/dist/zonos-elements/{p-d2da5f75.system.entry.js → p-3b19daa3.system.entry.js} +1 -1
  68. package/dist/zonos-elements/{p-4f97ab5c.system.entry.js → p-3f897fc1.system.entry.js} +1 -1
  69. package/dist/zonos-elements/{p-ad7d949c.entry.js → p-4813b1f8.entry.js} +1 -1
  70. package/dist/zonos-elements/{p-5900a867.entry.js → p-4e697c43.entry.js} +1 -1
  71. package/dist/zonos-elements/{p-203d901c.system.entry.js → p-55f68290.system.entry.js} +1 -1
  72. package/dist/zonos-elements/p-574495ac.system.entry.js +1 -0
  73. package/dist/zonos-elements/{p-1c9972d5.system.entry.js → p-57de792d.system.entry.js} +1 -1
  74. package/dist/zonos-elements/{p-d17fc7b5.js → p-591cf960.js} +1 -1
  75. package/dist/zonos-elements/{p-419c27c5.system.js → p-598cfc03.system.js} +1 -1
  76. package/dist/zonos-elements/{p-38b8a13d.system.js → p-61b1aa56.system.js} +1 -1
  77. package/dist/zonos-elements/{p-8a384947.entry.js → p-6772ace5.entry.js} +1 -1
  78. package/dist/zonos-elements/{p-0af4e659.entry.js → p-714241c8.entry.js} +1 -1
  79. package/dist/zonos-elements/{p-bce83a4e.js → p-7dfc395b.js} +1 -1
  80. package/dist/zonos-elements/p-8de25afe.js +1 -0
  81. package/dist/zonos-elements/{p-0ba0151f.system.entry.js → p-9209614f.system.entry.js} +1 -1
  82. package/dist/zonos-elements/{p-06b63d33.system.entry.js → p-a017dfc8.system.entry.js} +1 -1
  83. package/dist/zonos-elements/{p-ee48a87e.system.entry.js → p-a7b75673.system.entry.js} +1 -1
  84. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  85. package/dist/zonos-elements/{p-c64a74bc.js → p-cc652908.js} +1 -1
  86. package/dist/zonos-elements/{p-aad51da3.js → p-d0a6b588.js} +1 -1
  87. package/dist/zonos-elements/p-d4e524de.entry.js +1 -0
  88. package/dist/zonos-elements/{p-86afd38a.entry.js → p-da2183ab.entry.js} +1 -1
  89. package/dist/zonos-elements/{p-ca02bd48.entry.js → p-e0da243f.entry.js} +1 -1
  90. package/dist/zonos-elements/{p-2d77afbc.entry.js → p-e9614eb2.entry.js} +1 -1
  91. package/dist/zonos-elements/{p-076413a3.entry.js → p-fcd593bd.entry.js} +1 -1
  92. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  93. package/package.json +1 -1
  94. package/dist/esm-es5/handleFetch-ce924688.js +0 -1
  95. package/dist/zonos-elements/p-480556ea.system.js +0 -1
  96. package/dist/zonos-elements/p-5036a49f.system.js +0 -1
  97. package/dist/zonos-elements/p-539cc913.js +0 -1
  98. package/dist/zonos-elements/p-762a00e2.system.entry.js +0 -1
  99. package/dist/zonos-elements/p-92b0a91c.entry.js +0 -1
@@ -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 getZCountryUrlParam, p as cartStoreSetCheckoutSession, q as stripeStorePrefetchLandedCost, r as cartStoreNextStep, u as stripeStoreHandleInventoryCheck, v as stripeStoreConfirmPayment, w as stripeStoreReset, x as localizationStoreOnUpdate } from './cart-9a4c155b.js';
3
- import { s as submitGtag, p as paypalInitScript } from './paypal-63e83a4a.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 getZCountryUrlParam, p as cartStoreSetCheckoutSession, q as stripeStorePrefetchLandedCost, r as cartStoreNextStep, u as stripeStoreHandleInventoryCheck, v as stripeStoreConfirmPayment, w as stripeStoreReset, x as localizationStoreOnUpdate } from './cart-90943a07.js';
3
+ import { s as submitGtag, p as paypalInitScript } from './paypal-417c64a1.js';
4
4
  import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-7798ac16.js';
5
- import { h as handleFetch, l as log, a as logError, s as sendErrorLog, b as allLogs } from './handleFetch-ce924688.js';
6
- import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-65611cd0.js';
5
+ import { h as handleFetch, l as log, a as logError, s as sendErrorLog, g as getElapsedTime, b as allLogs } from './handleFetch-41e3d2b2.js';
6
+ import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-3ea6c7c5.js';
7
7
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
8
8
  import { c as classes } from './classes-0d95c529.js';
9
9
  import { g as getBorderRadius } from './getBorderRadius-e55a9df1.js';
10
10
  import { i as isDarkColor } from './isDarkColor-4261bc3c.js';
11
- import { s as setupCartData, d as domesticRedirectedBtnSelector, c as checkoutHiddenBtnSelector } from './CheckoutConfig-d237227e.js';
11
+ import { s as setupCartData, d as domesticRedirectedBtnSelector, c as checkoutHiddenBtnSelector } from './CheckoutConfig-9cdb7beb.js';
12
12
  import { R as RemoveIcon } from './RemoveIcon-9dc5dd1a.js';
13
13
 
14
14
  /**
@@ -180,6 +180,58 @@ const watchBigcommerceDomesticCheckout = ({ domesticRedirectedBtnSelector, onShi
180
180
  });
181
181
  };
182
182
 
183
+ const getNavigatorConnection = () => {
184
+ const connection = 'connection' in window.navigator
185
+ ? // connection is not yet supported in all browsers
186
+ window.navigator.connection
187
+ : null;
188
+ const mozConnection = 'mozConnection' in window.navigator
189
+ ? // mozConnection is not yet supported in all browsers
190
+ window.navigator.mozConnection
191
+ : null;
192
+ const webkitConnection = 'webkitConnection' in window.navigator
193
+ ? // webkitConnection is not yet supported in all browsers
194
+ window.navigator.webkitConnection
195
+ : null;
196
+ const baseConnection = connection || mozConnection || webkitConnection;
197
+ return baseConnection;
198
+ };
199
+
200
+ const getAdditionalLogMetadata = () => {
201
+ const userAgentData = 'userAgentData' in window.navigator
202
+ ? // userAgentData is not yet supported in all browsers
203
+ window.navigator.userAgentData
204
+ : null;
205
+ const baseConnection = getNavigatorConnection();
206
+ return {
207
+ connectionDownlink: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.downlink,
208
+ connectionEffectiveType: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.effectiveType,
209
+ connectionRtt: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.rtt,
210
+ connectionSaveData: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.saveData,
211
+ userAgent: userAgentData && userAgentData.brands.length > 0
212
+ ? userAgentData
213
+ : window.navigator.userAgent,
214
+ };
215
+ };
216
+
217
+ const sendLoadCheckoutFacadeLog = async () => {
218
+ const { elapsedTime } = getElapsedTime();
219
+ const scriptLoadLogBody = {
220
+ cache: 'miss',
221
+ eventName: 'jsdelivr',
222
+ flag: 'LOG_CHECKOUT_FACADE_LOAD',
223
+ href: window.location.href,
224
+ loadTime: elapsedTime,
225
+ metadata: Object.assign({ allLogs }, getAdditionalLogMetadata()),
226
+ scriptLoadUrl: 'checkoutFacade',
227
+ storeId: window.Zonos.storeId,
228
+ };
229
+ void handleFetch('/api/zonos-elements/log-script-load', {
230
+ body: scriptLoadLogBody,
231
+ method: 'POST',
232
+ });
233
+ };
234
+
183
235
  const MessageIcon = `<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">
184
236
  <path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>
185
237
  </svg>
@@ -386,6 +438,9 @@ const ZonosCheckout = class {
386
438
  cartStore.shouldHideDiscountInput = !enabled;
387
439
  submitGtag('zonos-checkout-start');
388
440
  void trackConversionEvent('checkout_open');
441
+ if (window.Zonos.isLegacyCheckout) {
442
+ void sendLoadCheckoutFacadeLog();
443
+ }
389
444
  }
390
445
  catch (err) {
391
446
  // stop loading
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-86b8247e.js';
2
- import { y as isValidSelector, j as stripeStore, z as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-9a4c155b.js';
2
+ import { y as isValidSelector, j as stripeStore, z as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-90943a07.js';
3
3
  import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-7798ac16.js';
4
- import { h as handleFetch, a as logError, l as log } from './handleFetch-ce924688.js';
4
+ import { h as handleFetch, a as logError, l as log } from './handleFetch-41e3d2b2.js';
5
5
  import './isDarkColor-4261bc3c.js';
6
6
  import './getBorderRadius-e55a9df1.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-9a4c155b.js';
2
+ import { l as localizationStore } from './cart-90943a07.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-7798ac16.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
- import './handleFetch-ce924688.js';
5
+ import './handleFetch-41e3d2b2.js';
6
6
  import './isDarkColor-4261bc3c.js';
7
7
  import './getBorderRadius-e55a9df1.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-9a4c155b.js';
2
+ import { a as localizationStoreUpdateSelectedCountryCode, t as translate, l as localizationStore } from './cart-90943a07.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-7798ac16.js';
4
4
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
5
5
  import { i as isDarkColor } from './isDarkColor-4261bc3c.js';
6
6
  import { l as languages } from './ILanguage-cd6acb72.js';
7
- import './handleFetch-ce924688.js';
7
+ import './handleFetch-41e3d2b2.js';
8
8
  import './getBorderRadius-e55a9df1.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-9a4c155b.js';
2
+ import { t as translate, l as localizationStore, E as currencyFormat } from './cart-90943a07.js';
3
3
  import { z as zonosStore } from './zonosStore-7798ac16.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-ce924688.js';
7
+ import './handleFetch-41e3d2b2.js';
8
8
  import './isDarkColor-4261bc3c.js';
9
9
  import './getBorderRadius-e55a9df1.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-7798ac16.js';
3
- import { l as localizationStore, y as isValidSelector, t as translate, o as getZCountryUrlParam, A as setZCountryUrlParam, B as currencyDisplay, C as currencyConvertAndFormat, D as currencyConvert, E as currencyFormat } from './cart-9a4c155b.js';
3
+ import { l as localizationStore, y as isValidSelector, t as translate, o as getZCountryUrlParam, A as setZCountryUrlParam, B as currencyDisplay, C as currencyConvertAndFormat, D as currencyConvert, E as currencyFormat } from './cart-90943a07.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
- import { h as handleFetch, a as logError, l as log } from './handleFetch-ce924688.js';
5
+ import { h as handleFetch, a as logError, l as log } from './handleFetch-41e3d2b2.js';
6
6
  import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
7
7
  import './isDarkColor-4261bc3c.js';
8
8
  import './getBorderRadius-e55a9df1.js';
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
2
- import { Q as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-9a4c155b.js';
2
+ import { Q as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-90943a07.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-7798ac16.js';
4
4
  import { l as languages } from './ILanguage-cd6acb72.js';
5
- import './handleFetch-ce924688.js';
5
+ import './handleFetch-41e3d2b2.js';
6
6
  import './isDarkColor-4261bc3c.js';
7
7
  import './getBorderRadius-e55a9df1.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-7798ac16.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
- import { j as stripeStore } from './cart-9a4c155b.js';
5
- import { a as logError, l as log } from './handleFetch-ce924688.js';
6
- import { c as paypalStoreInitButtons } from './paypal-63e83a4a.js';
4
+ import { j as stripeStore } from './cart-90943a07.js';
5
+ import { a as logError, l as log } from './handleFetch-41e3d2b2.js';
6
+ import { c as paypalStoreInitButtons } from './paypal-417c64a1.js';
7
7
  import './isDarkColor-4261bc3c.js';
8
8
  import './getBorderRadius-e55a9df1.js';
9
9
 
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r["throw"](t))}catch(t){a(t)}}function u(t){t.done?n(t.value):o(t.value).then(i,c)}u((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,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(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(n=0)),n)try{if(r=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:n.label++;return{value:c[1],done:false};case 5:n.label++;o=c[1];c=[0];continue;case 7:c=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){n.label=c[1];break}if(c[0]===6&&n.label<a[1]){n.label=a[1];a=c;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(c);break}if(a[2])n.ops.pop();n.trys.pop();continue}c=e.call(t,n)}catch(t){c=[6,t];o=0}finally{r=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-ce924688.js";var getTempCartById=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e,n,r,o,a;return __generator(this,(function(i){switch(i.label){case 0:e=new URLSearchParams(window.location.search);n=e.get("zonosTestMode")==="1";return[4,handleFetch("/api/zonos-elements/get-temp-cart",{body:{isTestMode:n,tempCartUUID:t},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:r=i.sent(),o=r.errors,a=r.json;if(!a||o.length){return[2,null]}return[2,a]}}))}))};var setupCartData=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return[4,getTempCartById(t)];case 1:e=n.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,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r["throw"](t))}catch(t){a(t)}}function u(t){t.done?n(t.value):o(t.value).then(i,c)}u((r=r.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,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(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,c[0]&&(n=0)),n)try{if(r=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:n.label++;return{value:c[1],done:false};case 5:n.label++;o=c[1];c=[0];continue;case 7:c=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){n.label=c[1];break}if(c[0]===6&&n.label<a[1]){n.label=a[1];a=c;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(c);break}if(a[2])n.ops.pop();n.trys.pop();continue}c=e.call(t,n)}catch(t){c=[6,t];o=0}finally{r=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-41e3d2b2.js";var getTempCartById=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e,n,r,o,a;return __generator(this,(function(i){switch(i.label){case 0:e=new URLSearchParams(window.location.search);n=e.get("zonosTestMode")==="1";return[4,handleFetch("/api/zonos-elements/get-temp-cart",{body:{isTestMode:n,tempCartUUID:t},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:r=i.sent(),o=r.errors,a=r.json;if(!a||o.length){return[2,null]}return[2,a]}}))}))};var setupCartData=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(n){switch(n.label){case 0:return[4,getTempCartById(t)];case 1:e=n.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};