@zonos/elements 1.3.12-alpha.9 → 1.3.12

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 (88) hide show
  1. package/dist/cjs/{cart-37e23be9.js → cart-b32bfb92.js} +1 -1
  2. package/dist/cjs/{sendErrorLog-7b3d82e4.js → sendErrorLog-5f732a8a.js} +1 -1
  3. package/dist/cjs/{submitGtag-d0718b63.js → submitGtag-fe94f3a0.js} +12 -4
  4. package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
  5. package/dist/cjs/zonos-card_2.cjs.entry.js +1 -1
  6. package/dist/cjs/zonos-cart-items_10.cjs.entry.js +3 -3
  7. package/dist/cjs/zonos-checkout.cjs.entry.js +3 -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_3.cjs.entry.js +1 -1
  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-payment.cjs.entry.js +1 -1
  14. package/dist/collection/components/utils/api/trackConversionEvent.js +12 -3
  15. package/dist/collection/components/utils/hello/currencyConversion/getInitialElementAmount.js +1 -1
  16. package/dist/collection/components/utils/logging/sendLoadScriptLog.js +5 -0
  17. package/dist/collection/scripts/zonosBase.js +1 -0
  18. package/dist/collection/types/generated/graphql.customer.types.js +11 -0
  19. package/dist/collection/types/generated/graphql.frontend.types.js +4 -0
  20. package/dist/components/stripe.js +1 -1
  21. package/dist/components/trackConversionEvent.js +12 -4
  22. package/dist/esm/{cart-7961927b.js → cart-9f9f26f9.js} +1 -1
  23. package/dist/esm/{sendErrorLog-4d9581da.js → sendErrorLog-283f65ab.js} +1 -1
  24. package/dist/esm/{submitGtag-4c1f09dc.js → submitGtag-5847d1a1.js} +12 -4
  25. package/dist/esm/zonos-address_4.entry.js +2 -2
  26. package/dist/esm/zonos-card_2.entry.js +1 -1
  27. package/dist/esm/zonos-cart-items_10.entry.js +3 -3
  28. package/dist/esm/zonos-checkout.entry.js +3 -3
  29. package/dist/esm/zonos-controller.entry.js +1 -1
  30. package/dist/esm/zonos-country-flag.entry.js +1 -1
  31. package/dist/esm/zonos-country-select_3.entry.js +1 -1
  32. package/dist/esm/zonos-hello-dialog.entry.js +1 -1
  33. package/dist/esm/zonos-hello.entry.js +1 -1
  34. package/dist/esm/zonos-payment.entry.js +1 -1
  35. package/dist/esm-es5/{cart-7961927b.js → cart-9f9f26f9.js} +1 -1
  36. package/dist/esm-es5/{sendErrorLog-4d9581da.js → sendErrorLog-283f65ab.js} +1 -1
  37. package/dist/esm-es5/{submitGtag-4c1f09dc.js → submitGtag-5847d1a1.js} +1 -1
  38. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  39. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  40. package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
  41. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  42. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  43. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  44. package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
  45. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  46. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  47. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  48. package/dist/scripts/loadZonos.js +1 -1
  49. package/dist/scripts/zonos.js +1 -1
  50. package/dist/scripts/zonosBase.js +1 -1
  51. package/dist/types/scripts/zonosBase.d.ts +5 -0
  52. package/dist/types/types/LogLoadScriptRequestBody.d.ts +1 -0
  53. package/dist/types/types/checkout/CheckoutConfig.d.ts +1 -1
  54. package/dist/types/types/generated/graphql.customer.types.d.ts +15 -2
  55. package/dist/types/types/generated/graphql.customer.types.ts +21 -2
  56. package/dist/types/types/generated/graphql.frontend.types.d.ts +16 -0
  57. package/dist/types/types/generated/graphql.frontend.types.ts +29 -0
  58. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  59. package/dist/zonos-elements/{p-63775f6d.js → p-03da9e9d.js} +1 -1
  60. package/dist/zonos-elements/{p-7efb9c12.system.entry.js → p-0b3cb5c2.system.entry.js} +1 -1
  61. package/dist/zonos-elements/{p-e4919505.entry.js → p-11d1645b.entry.js} +1 -1
  62. package/dist/zonos-elements/{p-bdb72353.system.entry.js → p-14c7d651.system.entry.js} +1 -1
  63. package/dist/zonos-elements/{p-3eb402c8.entry.js → p-29034d9c.entry.js} +1 -1
  64. package/dist/zonos-elements/{p-dd4f3724.system.js → p-3639f458.system.js} +1 -1
  65. package/dist/zonos-elements/{p-5a3ceb49.entry.js → p-50777610.entry.js} +1 -1
  66. package/dist/zonos-elements/{p-0bdac452.system.js → p-5a464374.system.js} +1 -1
  67. package/dist/zonos-elements/{p-e5fd850c.system.entry.js → p-62c458ac.system.entry.js} +1 -1
  68. package/dist/zonos-elements/p-6e81adba.system.js +1 -1
  69. package/dist/zonos-elements/{p-44842b39.system.entry.js → p-70c1f877.system.entry.js} +1 -1
  70. package/dist/zonos-elements/{p-431648d8.system.entry.js → p-76ac5680.system.entry.js} +1 -1
  71. package/dist/zonos-elements/{p-8eb876e8.system.entry.js → p-887bfef2.system.entry.js} +1 -1
  72. package/dist/zonos-elements/{p-d6aa3011.system.entry.js → p-8f2e4f81.system.entry.js} +1 -1
  73. package/dist/zonos-elements/{p-2191b884.entry.js → p-9726ff53.entry.js} +1 -1
  74. package/dist/zonos-elements/{p-e1796e2a.entry.js → p-9ab6e2b5.entry.js} +1 -1
  75. package/dist/zonos-elements/{p-4eba3abe.entry.js → p-a17fcb0a.entry.js} +1 -1
  76. package/dist/zonos-elements/{p-a6c9c505.system.js → p-ad9c7245.system.js} +1 -1
  77. package/dist/zonos-elements/{p-33f5634a.entry.js → p-b2d9dc9d.entry.js} +1 -1
  78. package/dist/zonos-elements/{p-f0b5d2fb.entry.js → p-b4a086e0.entry.js} +1 -1
  79. package/dist/zonos-elements/p-c43da0c6.js +1 -0
  80. package/dist/zonos-elements/{p-e4be7bd8.js → p-c5321a31.js} +1 -1
  81. package/dist/zonos-elements/{p-e90e2126.entry.js → p-e1bb026f.entry.js} +1 -1
  82. package/dist/zonos-elements/{p-339c505b.system.entry.js → p-e237784c.system.entry.js} +1 -1
  83. package/dist/zonos-elements/{p-2da8e12a.system.entry.js → p-f254612d.system.entry.js} +1 -1
  84. package/dist/zonos-elements/{p-4b3923d2.system.entry.js → p-f7da5199.system.entry.js} +1 -1
  85. package/dist/zonos-elements/{p-44f4dd4b.entry.js → p-ff699d46.entry.js} +1 -1
  86. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  87. package/package.json +1 -1
  88. package/dist/zonos-elements/p-0c5d3595.js +0 -1
@@ -4842,7 +4842,7 @@ const getInitialElementAmount = (element) => {
4842
4842
  return null;
4843
4843
  }
4844
4844
  // If the element has no data-domestic attribute, or the text content is different from the data-zintl attribute, set the data-domestic attribute
4845
- if (!domesticValue || element.textContent !== intlValue) {
4845
+ if (!domesticValue || (element.textContent !== intlValue && intlValue)) {
4846
4846
  // Store the original value on the element once, and international on every new conversion
4847
4847
  element.setAttribute('data-domestic', cleanedText);
4848
4848
  return parseFloat(cleanedText);
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const cart = require('./cart-37e23be9.js');
3
+ const cart = require('./cart-b32bfb92.js');
4
4
 
5
5
  const checkoutBreakpoint = 890;
6
6
  const isCheckoutMobile = (isMobile) => {
@@ -1,22 +1,30 @@
1
1
  'use strict';
2
2
 
3
- const cart = require('./cart-37e23be9.js');
3
+ const cart = require('./cart-b32bfb92.js');
4
4
  const zonosStore = require('./zonosStore-bd2a0c59.js');
5
5
 
6
6
  const trackConversionEvent = async (eventName, metadata) => {
7
7
  var _a, _b;
8
- // If a Zonos domain, or in qa mode with zonosQaUrl, or debug mode is on, we don't want analytics to be tracked
9
- if (window.location.href.includes('zonos.com') ||
8
+ const isDevelopment = window.location.href.includes('zonos.com') ||
10
9
  // legacy mock checkout, no need to track analytics for this
11
10
  window.location.href.includes('checkout.iglobalstores.com') ||
12
11
  !!((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.zonosQaUrl) ||
13
- !!((_b = window.Zonos) === null || _b === void 0 ? void 0 : _b.debug)) {
12
+ !!((_b = window.Zonos) === null || _b === void 0 ? void 0 : _b.debug);
13
+ if (isDevelopment &&
14
+ // if found, it means we want to test the conversion event in development site
15
+ !window.Zonos.zonosConversionTest) {
14
16
  return;
15
17
  }
16
18
  const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/track-conversion-event`;
17
19
  const countryCode = cart.localizationStore.selectedCountryCode;
18
20
  const organizationId = zonosStore.zonosStore.organizationId;
21
+ const checkoutSessionId = cart.cartStore.checkoutSessionId;
22
+ if (!checkoutSessionId) {
23
+ // checkoutSessionId is required for tracking conversion events to work properly
24
+ return;
25
+ }
19
26
  const body = {
27
+ checkoutSessionId,
20
28
  countryCode,
21
29
  eventName,
22
30
  metadata,
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-564fe383.js');
6
- const cart = require('./cart-37e23be9.js');
6
+ const cart = require('./cart-b32bfb92.js');
7
7
  const zonosStore = require('./zonosStore-bd2a0c59.js');
8
- const sendErrorLog = require('./sendErrorLog-7b3d82e4.js');
8
+ const sendErrorLog = require('./sendErrorLog-5f732a8a.js');
9
9
  const classes = require('./classes-b7918f56.js');
10
10
  const getBorderRadius = require('./getBorderRadius-4fa738c3.js');
11
11
  const isDarkColor = require('./isDarkColor-7faf0a82.js');
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-564fe383.js');
6
6
  const zonosStore = require('./zonosStore-bd2a0c59.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const cart = require('./cart-37e23be9.js');
8
+ const cart = require('./cart-b32bfb92.js');
9
9
  const ILanguage = require('./ILanguage-d247b45b.js');
10
10
  require('./isDarkColor-7faf0a82.js');
11
11
  require('./getBorderRadius-4fa738c3.js');
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-564fe383.js');
6
- const cart = require('./cart-37e23be9.js');
6
+ const cart = require('./cart-b32bfb92.js');
7
7
  const zonosStore = require('./zonosStore-bd2a0c59.js');
8
- const submitGtag = require('./submitGtag-d0718b63.js');
8
+ const submitGtag = require('./submitGtag-fe94f3a0.js');
9
9
  const getBorderRadius = require('./getBorderRadius-4fa738c3.js');
10
- const sendErrorLog = require('./sendErrorLog-7b3d82e4.js');
10
+ const sendErrorLog = require('./sendErrorLog-5f732a8a.js');
11
11
  const classes = require('./classes-b7918f56.js');
12
12
  const ILanguage = require('./ILanguage-d247b45b.js');
13
13
  const isDarkColor = require('./isDarkColor-7faf0a82.js');
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-564fe383.js');
6
- const cart = require('./cart-37e23be9.js');
6
+ const cart = require('./cart-b32bfb92.js');
7
7
  const zonosStore = require('./zonosStore-bd2a0c59.js');
8
- const submitGtag = require('./submitGtag-d0718b63.js');
9
- const sendErrorLog = require('./sendErrorLog-7b3d82e4.js');
8
+ const submitGtag = require('./submitGtag-fe94f3a0.js');
9
+ const sendErrorLog = require('./sendErrorLog-5f732a8a.js');
10
10
  const classes = require('./classes-b7918f56.js');
11
11
  const getBorderRadius = require('./getBorderRadius-4fa738c3.js');
12
12
  const isDarkColor = require('./isDarkColor-7faf0a82.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-564fe383.js');
6
- const cart = require('./cart-37e23be9.js');
6
+ const cart = require('./cart-b32bfb92.js');
7
7
  const zonosStore = require('./zonosStore-bd2a0c59.js');
8
8
  require('./isDarkColor-7faf0a82.js');
9
9
  require('./getBorderRadius-4fa738c3.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-564fe383.js');
6
- const cart = require('./cart-37e23be9.js');
6
+ const cart = require('./cart-b32bfb92.js');
7
7
  const zonosStore = require('./zonosStore-bd2a0c59.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  require('./isDarkColor-7faf0a82.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-564fe383.js');
6
- const cart = require('./cart-37e23be9.js');
6
+ const cart = require('./cart-b32bfb92.js');
7
7
  const zonosStore = require('./zonosStore-bd2a0c59.js');
8
8
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
9
9
  const isDarkColor = require('./isDarkColor-7faf0a82.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-564fe383.js');
6
- const cart = require('./cart-37e23be9.js');
6
+ const cart = require('./cart-b32bfb92.js');
7
7
  const zonosStore = require('./zonosStore-bd2a0c59.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-564fe383.js');
6
6
  const zonosStore = require('./zonosStore-bd2a0c59.js');
7
- const cart = require('./cart-37e23be9.js');
7
+ const cart = require('./cart-b32bfb92.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
10
10
  require('./isDarkColor-7faf0a82.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-564fe383.js');
6
- const cart = require('./cart-37e23be9.js');
6
+ const cart = require('./cart-b32bfb92.js');
7
7
  require('./zonosStore-bd2a0c59.js');
8
8
  require('./isDarkColor-7faf0a82.js');
9
9
  require('./getBorderRadius-4fa738c3.js');
@@ -1,20 +1,29 @@
1
+ import { cartStore } from "../../store/checkout/cart";
1
2
  import { localizationStore } from "../../store/hello/localization";
2
3
  import { zonosStore } from "../../store/zonosStore";
3
4
  import { handleFetch } from "../handleFetch";
4
5
  export const trackConversionEvent = async (eventName, metadata) => {
5
6
  var _a, _b;
6
- // If a Zonos domain, or in qa mode with zonosQaUrl, or debug mode is on, we don't want analytics to be tracked
7
- if (window.location.href.includes('zonos.com') ||
7
+ const isDevelopment = window.location.href.includes('zonos.com') ||
8
8
  // legacy mock checkout, no need to track analytics for this
9
9
  window.location.href.includes('checkout.iglobalstores.com') ||
10
10
  !!((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.zonosQaUrl) ||
11
- !!((_b = window.Zonos) === null || _b === void 0 ? void 0 : _b.debug)) {
11
+ !!((_b = window.Zonos) === null || _b === void 0 ? void 0 : _b.debug);
12
+ if (isDevelopment &&
13
+ // if found, it means we want to test the conversion event in development site
14
+ !window.Zonos.zonosConversionTest) {
12
15
  return;
13
16
  }
14
17
  const url = `${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/track-conversion-event`;
15
18
  const countryCode = localizationStore.selectedCountryCode;
16
19
  const organizationId = zonosStore.organizationId;
20
+ const checkoutSessionId = cartStore.checkoutSessionId;
21
+ if (!checkoutSessionId) {
22
+ // checkoutSessionId is required for tracking conversion events to work properly
23
+ return;
24
+ }
17
25
  const body = {
26
+ checkoutSessionId,
18
27
  countryCode,
19
28
  eventName,
20
29
  metadata,
@@ -8,7 +8,7 @@ export const getInitialElementAmount = (element) => {
8
8
  return null;
9
9
  }
10
10
  // If the element has no data-domestic attribute, or the text content is different from the data-zintl attribute, set the data-domestic attribute
11
- if (!domesticValue || element.textContent !== intlValue) {
11
+ if (!domesticValue || (element.textContent !== intlValue && intlValue)) {
12
12
  // Store the original value on the element once, and international on every new conversion
13
13
  element.setAttribute('data-domestic', cleanedText);
14
14
  return parseFloat(cleanedText);
@@ -1,6 +1,11 @@
1
1
  import { handleFetch } from "../handleFetch";
2
2
  import { getNavigatorConnection } from "./getNavigatorConnection";
3
+ const disabled = true;
3
4
  export const sendLoadScriptLog = async (params) => {
5
+ // turn off for now
6
+ if (disabled) {
7
+ return;
8
+ }
4
9
  const userAgentData = 'userAgentData' in window.navigator
5
10
  ? // userAgentData is not yet supported in all browsers
6
11
  window.navigator.userAgentData
@@ -27,6 +27,7 @@ _a = Zonos;
27
27
  Zonos.doneInit = false;
28
28
  // if query 'zonosDebug=1' param from url, debug mode is on
29
29
  Zonos.debug = !!window.location.search.match(/\?.*(&*)zonosDebug=1/);
30
+ Zonos.zonosConversionTest = !!window.location.search.match(/\?.*(&*)zonosConversionTest/);
30
31
  Zonos.isBigCommerce = false;
31
32
  Zonos.internationalHideSelector = '';
32
33
  Zonos.zonosQaUrl = null;
@@ -192,6 +192,10 @@ export const catalogItemSource = {
192
192
  LegacyMigration: 'LEGACY_MIGRATION',
193
193
  UserProvided: 'USER_PROVIDED',
194
194
  };
195
+ export const catalogSettingMigrationAction = {
196
+ Evaluate: 'EVALUATE',
197
+ Migrate: 'MIGRATE',
198
+ };
195
199
  export const catalogStatus = {
196
200
  Disabled: 'DISABLED',
197
201
  Enabled: 'ENABLED',
@@ -1539,6 +1543,13 @@ export const lcgBillingMethod = {
1539
1543
  BillingDgs: 'BILLING_DGS',
1540
1544
  Legacy: 'LEGACY',
1541
1545
  };
1546
+ export const manualClassificationBulkJobStatus = {
1547
+ Completed: 'COMPLETED',
1548
+ Error: 'ERROR',
1549
+ Initialized: 'INITIALIZED',
1550
+ ManuallyClassified: 'MANUALLY_CLASSIFIED',
1551
+ Processing: 'PROCESSING',
1552
+ };
1542
1553
  export const manualClassificationRequestCreateStatus = {
1543
1554
  Created: 'CREATED',
1544
1555
  Existing: 'EXISTING',
@@ -38,6 +38,7 @@ export const featureAudienceNameEnum = {
38
38
  FrontendEngineer: 'frontend_engineer',
39
39
  I18nKnownLanguage: 'i18n_known_language',
40
40
  I18nSales: 'i18n_sales',
41
+ ItHead: 'it_head',
41
42
  NewCheckoutMerchant: 'new_checkout_merchant',
42
43
  Onboarding: 'onboarding',
43
44
  PrincipalEngineer: 'principal_engineer',
@@ -496,6 +497,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
496
497
  cleanupTestZonosElementSetting(variables, requestHeaders) {
497
498
  return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'cleanupTestZonosElementSetting', 'mutation');
498
499
  },
500
+ getConversionEventBySessionIdAndOrgId(variables, requestHeaders) {
501
+ return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'getConversionEventBySessionIdAndOrgId', 'query');
502
+ },
499
503
  hasPreviousErrors(variables, requestHeaders) {
500
504
  return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'hasPreviousErrors', 'query');
501
505
  },
@@ -4840,7 +4840,7 @@ const getInitialElementAmount = (element) => {
4840
4840
  return null;
4841
4841
  }
4842
4842
  // If the element has no data-domestic attribute, or the text content is different from the data-zintl attribute, set the data-domestic attribute
4843
- if (!domesticValue || element.textContent !== intlValue) {
4843
+ if (!domesticValue || (element.textContent !== intlValue && intlValue)) {
4844
4844
  // Store the original value on the element once, and international on every new conversion
4845
4845
  element.setAttribute('data-domestic', cleanedText);
4846
4846
  return parseFloat(cleanedText);
@@ -1,20 +1,28 @@
1
- import { h as handleFetch, a as localizationStore } from './stripe.js';
1
+ import { h as handleFetch, c as cartStore, a as localizationStore } from './stripe.js';
2
2
  import { z as zonosStore } from './zonosStore.js';
3
3
 
4
4
  const trackConversionEvent = async (eventName, metadata) => {
5
5
  var _a, _b;
6
- // If a Zonos domain, or in qa mode with zonosQaUrl, or debug mode is on, we don't want analytics to be tracked
7
- if (window.location.href.includes('zonos.com') ||
6
+ const isDevelopment = window.location.href.includes('zonos.com') ||
8
7
  // legacy mock checkout, no need to track analytics for this
9
8
  window.location.href.includes('checkout.iglobalstores.com') ||
10
9
  !!((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.zonosQaUrl) ||
11
- !!((_b = window.Zonos) === null || _b === void 0 ? void 0 : _b.debug)) {
10
+ !!((_b = window.Zonos) === null || _b === void 0 ? void 0 : _b.debug);
11
+ if (isDevelopment &&
12
+ // if found, it means we want to test the conversion event in development site
13
+ !window.Zonos.zonosConversionTest) {
12
14
  return;
13
15
  }
14
16
  const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/track-conversion-event`;
15
17
  const countryCode = localizationStore.selectedCountryCode;
16
18
  const organizationId = zonosStore.organizationId;
19
+ const checkoutSessionId = cartStore.checkoutSessionId;
20
+ if (!checkoutSessionId) {
21
+ // checkoutSessionId is required for tracking conversion events to work properly
22
+ return;
23
+ }
17
24
  const body = {
25
+ checkoutSessionId,
18
26
  countryCode,
19
27
  eventName,
20
28
  metadata,
@@ -4840,7 +4840,7 @@ const getInitialElementAmount = (element) => {
4840
4840
  return null;
4841
4841
  }
4842
4842
  // If the element has no data-domestic attribute, or the text content is different from the data-zintl attribute, set the data-domestic attribute
4843
- if (!domesticValue || element.textContent !== intlValue) {
4843
+ if (!domesticValue || (element.textContent !== intlValue && intlValue)) {
4844
4844
  // Store the original value on the element once, and international on every new conversion
4845
4845
  element.setAttribute('data-domestic', cleanedText);
4846
4846
  return parseFloat(cleanedText);
@@ -1,4 +1,4 @@
1
- import { r as handleFetch } from './cart-7961927b.js';
1
+ import { r as handleFetch } from './cart-9f9f26f9.js';
2
2
 
3
3
  const checkoutBreakpoint = 890;
4
4
  const isCheckoutMobile = (isMobile) => {
@@ -1,20 +1,28 @@
1
- import { r as handleFetch, l as localizationStore, a as log } from './cart-7961927b.js';
1
+ import { r as handleFetch, f as cartStore, l as localizationStore, a as log } from './cart-9f9f26f9.js';
2
2
  import { z as zonosStore } from './zonosStore-c4c45591.js';
3
3
 
4
4
  const trackConversionEvent = async (eventName, metadata) => {
5
5
  var _a, _b;
6
- // If a Zonos domain, or in qa mode with zonosQaUrl, or debug mode is on, we don't want analytics to be tracked
7
- if (window.location.href.includes('zonos.com') ||
6
+ const isDevelopment = window.location.href.includes('zonos.com') ||
8
7
  // legacy mock checkout, no need to track analytics for this
9
8
  window.location.href.includes('checkout.iglobalstores.com') ||
10
9
  !!((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.zonosQaUrl) ||
11
- !!((_b = window.Zonos) === null || _b === void 0 ? void 0 : _b.debug)) {
10
+ !!((_b = window.Zonos) === null || _b === void 0 ? void 0 : _b.debug);
11
+ if (isDevelopment &&
12
+ // if found, it means we want to test the conversion event in development site
13
+ !window.Zonos.zonosConversionTest) {
12
14
  return;
13
15
  }
14
16
  const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/track-conversion-event`;
15
17
  const countryCode = localizationStore.selectedCountryCode;
16
18
  const organizationId = zonosStore.organizationId;
19
+ const checkoutSessionId = cartStore.checkoutSessionId;
20
+ if (!checkoutSessionId) {
21
+ // checkoutSessionId is required for tracking conversion events to work properly
22
+ return;
23
+ }
17
24
  const body = {
25
+ checkoutSessionId,
18
26
  countryCode,
19
27
  eventName,
20
28
  metadata,
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-dd40cc85.js';
2
- import { j as stripeStore, d as logError, l as localizationStore, t as translate, n as stripeStorePrefetchLandedCost } from './cart-7961927b.js';
2
+ import { j as stripeStore, d as logError, l as localizationStore, t as translate, n as stripeStorePrefetchLandedCost } from './cart-9f9f26f9.js';
3
3
  import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-c4c45591.js';
4
- import { s as sendErrorLog, i as isCheckoutMobile } from './sendErrorLog-4d9581da.js';
4
+ import { s as sendErrorLog, i as isCheckoutMobile } from './sendErrorLog-283f65ab.js';
5
5
  import { c as classes } from './classes-0d95c529.js';
6
6
  import { g as getBorderRadius } from './getBorderRadius-a89e45fb.js';
7
7
  import { i as isDarkColor } from './isDarkColor-6bf71e51.js';
@@ -1,7 +1,7 @@
1
1
  import { r as registerInstance, h, H as Host } from './index-dd40cc85.js';
2
2
  import { d as zonosStoreFontFamily } from './zonosStore-c4c45591.js';
3
3
  import { c as classes } from './classes-0d95c529.js';
4
- import { F as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-7961927b.js';
4
+ import { F as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-9f9f26f9.js';
5
5
  import { l as languages } from './ILanguage-97790bee.js';
6
6
  import './isDarkColor-6bf71e51.js';
7
7
  import './getBorderRadius-a89e45fb.js';
@@ -1,9 +1,9 @@
1
1
  import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-dd40cc85.js';
2
- import { f as cartStore, t as translate, r as handleFetch, q as stripeStoreReset, j as stripeStore, C as stripeStoreRetrievePayment, l as localizationStore, D as cartStoreUpdateSelectedShippingOption, E as cartStoreGetShippingTransitInfo } from './cart-7961927b.js';
2
+ import { f as cartStore, t as translate, r as handleFetch, q as stripeStoreReset, j as stripeStore, C as stripeStoreRetrievePayment, l as localizationStore, D as cartStoreUpdateSelectedShippingOption, E as cartStoreGetShippingTransitInfo } from './cart-9f9f26f9.js';
3
3
  import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-c4c45591.js';
4
- import { t as trackConversionEvent, s as submitGtag, c as createCustomEvent } from './submitGtag-4c1f09dc.js';
4
+ import { t as trackConversionEvent, s as submitGtag, c as createCustomEvent } from './submitGtag-5847d1a1.js';
5
5
  import { g as getBorderRadius } from './getBorderRadius-a89e45fb.js';
6
- import { s as sendErrorLog, i as isCheckoutMobile } from './sendErrorLog-4d9581da.js';
6
+ import { s as sendErrorLog, i as isCheckoutMobile } from './sendErrorLog-283f65ab.js';
7
7
  import { c as classes } from './classes-0d95c529.js';
8
8
  import { l as languages } from './ILanguage-97790bee.js';
9
9
  import { t as tinycolor, i as isDarkColor } from './isDarkColor-6bf71e51.js';
@@ -1,8 +1,8 @@
1
1
  import { r as registerInstance, h, F as Fragment, H as Host } from './index-dd40cc85.js';
2
- import { l as localizationStore, a as log, s as stripeStoreGetDomesticShippingSession, b as localizationStoreUpdateSelectedCountryCode, c as stripeStoreCleanupDomesticShippingSession, d as logError, e as stripeStoreSaveDomesticShippingSession, i as initStripeElements, f as cartStore, g as cartStoreUpdateItems, h as cartStoreReset, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreUpdateToErrorState, t as translate, n as stripeStorePrefetchLandedCost, o as cartStoreNextStep, p as stripeStoreConfirmPayment, q as stripeStoreReset } from './cart-7961927b.js';
2
+ import { l as localizationStore, a as log, s as stripeStoreGetDomesticShippingSession, b as localizationStoreUpdateSelectedCountryCode, c as stripeStoreCleanupDomesticShippingSession, d as logError, e as stripeStoreSaveDomesticShippingSession, i as initStripeElements, f as cartStore, g as cartStoreUpdateItems, h as cartStoreReset, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreUpdateToErrorState, t as translate, n as stripeStorePrefetchLandedCost, o as cartStoreNextStep, p as stripeStoreConfirmPayment, q as stripeStoreReset } from './cart-9f9f26f9.js';
3
3
  import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-c4c45591.js';
4
- import { c as createCustomEvent, s as submitGtag, t as trackConversionEvent } from './submitGtag-4c1f09dc.js';
5
- import { s as sendErrorLog, i as isCheckoutMobile } from './sendErrorLog-4d9581da.js';
4
+ import { c as createCustomEvent, s as submitGtag, t as trackConversionEvent } from './submitGtag-5847d1a1.js';
5
+ import { s as sendErrorLog, i as isCheckoutMobile } from './sendErrorLog-283f65ab.js';
6
6
  import { c as classes } from './classes-0d95c529.js';
7
7
  import { g as getBorderRadius } from './getBorderRadius-a89e45fb.js';
8
8
  import { i as isDarkColor } from './isDarkColor-6bf71e51.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-dd40cc85.js';
2
- import { r as handleFetch, d as logError, u as isValidSelector, a as log, j as stripeStore, v as initLocalizationStore, b as localizationStoreUpdateSelectedCountryCode } from './cart-7961927b.js';
2
+ import { r as handleFetch, d as logError, u as isValidSelector, a as log, j as stripeStore, v as initLocalizationStore, b as localizationStoreUpdateSelectedCountryCode } from './cart-9f9f26f9.js';
3
3
  import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-c4c45591.js';
4
4
  import './isDarkColor-6bf71e51.js';
5
5
  import './getBorderRadius-a89e45fb.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-dd40cc85.js';
2
- import { l as localizationStore } from './cart-7961927b.js';
2
+ import { l as localizationStore } from './cart-9f9f26f9.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-c4c45591.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
5
  import './isDarkColor-6bf71e51.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-dd40cc85.js';
2
- import { b as localizationStoreUpdateSelectedCountryCode, l as localizationStore } from './cart-7961927b.js';
2
+ import { b as localizationStoreUpdateSelectedCountryCode, l as localizationStore } from './cart-9f9f26f9.js';
3
3
  import { d as zonosStoreFontFamily } from './zonosStore-c4c45591.js';
4
4
  import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
5
5
  import { i as isDarkColor } from './isDarkColor-6bf71e51.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-dd40cc85.js';
2
- import { B as currencyFormat, l as localizationStore, t as translate } from './cart-7961927b.js';
2
+ import { B as currencyFormat, l as localizationStore, t as translate } from './cart-9f9f26f9.js';
3
3
  import { z as zonosStore } from './zonosStore-c4c45591.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-dd40cc85.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-c4c45591.js';
3
- import { r as handleFetch, d as logError, l as localizationStore, u as isValidSelector, t as translate, w as getZCountryUrlParam, x as setZCountryUrlParam, a as log, y as currencyDisplay, z as currencyConvertAndFormat, A as currencyConvert, B as currencyFormat } from './cart-7961927b.js';
3
+ import { r as handleFetch, d as logError, l as localizationStore, u as isValidSelector, t as translate, w as getZCountryUrlParam, x as setZCountryUrlParam, a as log, y as currencyDisplay, z as currencyConvertAndFormat, A as currencyConvert, B as currencyFormat } from './cart-9f9f26f9.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
5
  import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
6
6
  import './isDarkColor-6bf71e51.js';
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-dd40cc85.js';
2
- import { j as stripeStore, d as logError } from './cart-7961927b.js';
2
+ import { j as stripeStore, d as logError } from './cart-9f9f26f9.js';
3
3
  import './zonosStore-c4c45591.js';
4
4
  import './isDarkColor-6bf71e51.js';
5
5
  import './getBorderRadius-a89e45fb.js';