@zonos/elements 1.3.211 → 1.3.213

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 (94) hide show
  1. package/dist/cjs/{cart-7a7f3b59.js → cart-e0b62259.js} +13 -6
  2. package/dist/cjs/index.cjs.js +7 -7
  3. package/dist/cjs/{localization-33348cf3.js → localization-91bcde0e.js} +11 -10
  4. package/dist/cjs/{paypal-4124a81b.js → paypal-93e5de01.js} +2 -2
  5. package/dist/cjs/zonos-address_11.cjs.entry.js +2 -2
  6. package/dist/cjs/zonos-cart-items_14.cjs.entry.js +9 -9
  7. package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
  8. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  9. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +3 -3
  12. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
  13. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  14. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  15. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +3 -2
  16. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +1 -1
  17. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +4 -3
  18. package/dist/collection/components/main/zonos-controller.js +2 -2
  19. package/dist/collection/components/store/checkout/cart.js +6 -0
  20. package/dist/collection/components/store/hello/localization.js +11 -10
  21. package/dist/collection/components/utils/api/cartCalculateLandedCost.js +6 -5
  22. package/dist/esm/{cart-b0ab7f79.js → cart-c3540cd7.js} +14 -7
  23. package/dist/esm/index.js +7 -7
  24. package/dist/esm/{localization-f1b9c0ef.js → localization-cf31c728.js} +11 -10
  25. package/dist/esm/{paypal-5e2a45c3.js → paypal-5963c1ab.js} +2 -2
  26. package/dist/esm/zonos-address_11.entry.js +2 -2
  27. package/dist/esm/zonos-cart-items_14.entry.js +9 -9
  28. package/dist/esm/zonos-checkout.entry.js +3 -3
  29. package/dist/esm/zonos-controller.entry.js +2 -2
  30. package/dist/esm/zonos-country-flag.entry.js +1 -1
  31. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  32. package/dist/esm/zonos-empty-state-payment_4.entry.js +3 -3
  33. package/dist/esm/zonos-hello-dialog.entry.js +1 -1
  34. package/dist/esm/zonos-hello.entry.js +1 -1
  35. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  36. package/dist/esm-es5/cart-c3540cd7.js +1 -0
  37. package/dist/esm-es5/index.js +1 -1
  38. package/dist/esm-es5/{localization-f1b9c0ef.js → localization-cf31c728.js} +1 -1
  39. package/dist/esm-es5/{paypal-5e2a45c3.js → paypal-5963c1ab.js} +1 -1
  40. package/dist/esm-es5/zonos-address_11.entry.js +1 -1
  41. package/dist/esm-es5/zonos-cart-items_14.entry.js +1 -1
  42. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  43. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  44. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  45. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  46. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  47. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  48. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  49. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  50. package/dist/scripts/index.d.ts +10 -2
  51. package/dist/scripts/index.js +1 -1
  52. package/dist/scripts/loadZonos.js +1 -1
  53. package/dist/scripts/zonos.js +1 -1
  54. package/dist/types/components/store/zonosStore.d.ts +1 -1
  55. package/dist/types/scripts/_zonosBase.d.ts +6 -2
  56. package/dist/types/types/utils/ZonosSettings.d.ts +4 -0
  57. package/dist/zonos-elements/index.esm.js +1 -1
  58. package/dist/zonos-elements/{p-0b48c596.entry.js → p-003f37f4.entry.js} +1 -1
  59. package/dist/zonos-elements/p-0707379c.entry.js +1 -0
  60. package/dist/zonos-elements/p-0fd105fa.system.entry.js +1 -0
  61. package/dist/zonos-elements/{p-88860d83.system.entry.js → p-137ee43a.system.entry.js} +1 -1
  62. package/dist/zonos-elements/{p-5f125617.entry.js → p-1d0e40b7.entry.js} +1 -1
  63. package/dist/zonos-elements/{p-c63b2c78.system.entry.js → p-236643d0.system.entry.js} +1 -1
  64. package/dist/zonos-elements/{p-55de2720.system.entry.js → p-299efbcf.system.entry.js} +1 -1
  65. package/dist/zonos-elements/{p-e1d4ec4e.system.js → p-4444bb4e.system.js} +1 -1
  66. package/dist/zonos-elements/{p-1da85818.entry.js → p-6a157c84.entry.js} +1 -1
  67. package/dist/zonos-elements/{p-73463715.entry.js → p-6d7e45f3.entry.js} +1 -1
  68. package/dist/zonos-elements/{p-951a35e2.system.entry.js → p-6e5236eb.system.entry.js} +1 -1
  69. package/dist/zonos-elements/{p-c6171f11.system.entry.js → p-6e8354c1.system.entry.js} +1 -1
  70. package/dist/zonos-elements/{p-e90ff8fb.entry.js → p-752220fe.entry.js} +1 -1
  71. package/dist/zonos-elements/{p-92803d13.system.js → p-7567bb2f.system.js} +1 -1
  72. package/dist/zonos-elements/p-81b357f7.system.js +1 -1
  73. package/dist/zonos-elements/p-9004bdda.entry.js +1 -0
  74. package/dist/zonos-elements/{p-e9632a92.system.entry.js → p-a1cd5572.system.entry.js} +1 -1
  75. package/dist/zonos-elements/{p-749a0fc6.js → p-a45a15a0.js} +1 -1
  76. package/dist/zonos-elements/{p-858a55d2.entry.js → p-a4efb55c.entry.js} +1 -1
  77. package/dist/zonos-elements/{p-3041f0fd.system.entry.js → p-a9ad60a5.system.entry.js} +1 -1
  78. package/dist/zonos-elements/p-adbc4643.system.js +1 -0
  79. package/dist/zonos-elements/p-aeae5a7f.entry.js +1 -0
  80. package/dist/zonos-elements/{p-3a0fdfb2.system.entry.js → p-b22fcbda.system.entry.js} +1 -1
  81. package/dist/zonos-elements/{p-4a1a69a9.js → p-c8433f89.js} +1 -1
  82. package/dist/zonos-elements/{p-7439cba7.system.entry.js → p-e72b61c1.system.entry.js} +1 -1
  83. package/dist/zonos-elements/{p-e51480a4.entry.js → p-ec7a6d28.entry.js} +1 -1
  84. package/dist/zonos-elements/p-f979a131.js +1 -0
  85. package/dist/zonos-elements/{p-1f08477f.system.js → p-fb898c4f.system.js} +1 -1
  86. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  87. package/package.json +1 -1
  88. package/dist/esm-es5/cart-b0ab7f79.js +0 -1
  89. package/dist/zonos-elements/p-19bb71d1.entry.js +0 -1
  90. package/dist/zonos-elements/p-20f929d8.entry.js +0 -1
  91. package/dist/zonos-elements/p-3b1ef4b2.js +0 -1
  92. package/dist/zonos-elements/p-ab7fed30.entry.js +0 -1
  93. package/dist/zonos-elements/p-dc0076a4.system.entry.js +0 -1
  94. package/dist/zonos-elements/p-f672d549.system.js +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-f8ee56aa.js');
4
- const localization = require('./localization-33348cf3.js');
4
+ const localization = require('./localization-91bcde0e.js');
5
5
  const handleFetch = require('./handleFetch-7cf3752e.js');
6
6
  const isDarkColor = require('./isDarkColor-428965f4.js');
7
7
  const getBorderRadius = require('./getBorderRadius-1b5e33cf.js');
@@ -256,7 +256,7 @@ const calculateLandedCost = async (abortController) => {
256
256
  };
257
257
 
258
258
  const cartCalculateLandedCost = async ({ abortController, cartId, }) => {
259
- var _a, _b, _c, _d;
259
+ var _a, _b, _c, _d, _e;
260
260
  // request to get landed cost info
261
261
  const { errors, json } = await handleFetch.handleFetch('/api/zonos-elements/cart-calculate-landed-cost', {
262
262
  body: prepCartCalculateLandedCost(cartId),
@@ -264,10 +264,11 @@ const cartCalculateLandedCost = async ({ abortController, cartId, }) => {
264
264
  signal: abortController === null || abortController === void 0 ? void 0 : abortController.signal,
265
265
  });
266
266
  if (errors.length || !json) {
267
- const isAbortedRequest = ((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.message) === 'The user aborted a request.' ||
268
- ((_b = errors[0]) === null || _b === void 0 ? void 0 : _b.message.includes('signal is aborted')) ||
269
- ((_c = errors[0]) === null || _c === void 0 ? void 0 : _c.message.includes('The operation was aborted')) ||
270
- ((_d = errors[0]) === null || _d === void 0 ? void 0 : _d.message.includes('Fetch is aborted'));
267
+ const isAbortedRequest = typeof ((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.message) === 'string' &&
268
+ (((_b = errors[0]) === null || _b === void 0 ? void 0 : _b.message) === 'The user aborted a request.' ||
269
+ ((_c = errors[0]) === null || _c === void 0 ? void 0 : _c.message.includes('signal is aborted')) ||
270
+ ((_d = errors[0]) === null || _d === void 0 ? void 0 : _d.message.includes('The operation was aborted')) ||
271
+ ((_e = errors[0]) === null || _e === void 0 ? void 0 : _e.message.includes('Fetch is aborted')));
271
272
  const errorMessage = isAbortedRequest
272
273
  ? 'The landed cost calculation request was aborted to initiate a new one.'
273
274
  : 'Failed to calculate landed cost';
@@ -1968,6 +1969,12 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
1968
1969
  * For some service levels, the landed cost that's DAP and we do remittance on behalf of the merchant, these landed cost should be treated as DDP
1969
1970
  */
1970
1971
  const cartStoreGetMethod = (landedCost) => {
1972
+ var _a, _b, _c;
1973
+ // If the landed cost is DAP and the country is domestic, then treat it as DDP since no duty or fee is due at the door
1974
+ if (landedCost.method === 'DAP' &&
1975
+ ((_b = (_a = zonosStore.zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.domesticCountries) === null || _b === void 0 ? void 0 : _b.includes(((_c = stripeStore.stripeAddressEventData) === null || _c === void 0 ? void 0 : _c.value.address.country) || 'US'))) {
1976
+ return 'DDP';
1977
+ }
1971
1978
  if (landedCost.method === 'DAP' &&
1972
1979
  landedCost.remittance.length &&
1973
1980
  landedCost.landedCostGuaranteeCode === 'ZONOS') {
@@ -132,7 +132,7 @@ const getZonosQaUrl = () => {
132
132
  return null;
133
133
  }
134
134
  const qaUrl = extractZonosQaUrl(window.location.href);
135
- const cdnUrl = "https://v1.3.211.js.zonos.com";
135
+ const cdnUrl = "https://v1.3.213.js.zonos.com";
136
136
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
137
137
  if (!qaUrl &&
138
138
  (cdnUrl.includes('test.') ||
@@ -375,10 +375,10 @@ const zonosLoadUrl = (() => {
375
375
  }
376
376
  return null;
377
377
  })();
378
- const ZONOS_URL = "https://v1.3.211.js.zonos.com";
379
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.211";
380
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.211";
381
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.211";
378
+ const ZONOS_URL = "https://v1.3.213.js.zonos.com";
379
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.213";
380
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.213";
381
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.213";
382
382
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
383
383
  const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
384
384
  class Zonos {
@@ -396,7 +396,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
396
396
  ? new URLSearchParams(window.location.search).get('iframeLogType')
397
397
  : null;
398
398
  Zonos.isBigCommerce = false;
399
- Zonos.releaseDate = "1749224734539";
399
+ Zonos.releaseDate = "1749249803483";
400
400
  Zonos.isLegacyCheckout = false;
401
401
  Zonos.domain = typeof window !== 'undefined'
402
402
  ? // domain that embeds the iframe
@@ -414,7 +414,7 @@ Zonos.isNpm = true;
414
414
  Zonos.zonosQaUrl = null;
415
415
  Zonos.zonosQaUrlApi = null;
416
416
  Zonos.trackEventLogs = [];
417
- Zonos.version = `v${"1.3.211"}`;
417
+ Zonos.version = `v${"1.3.213"}`;
418
418
  Zonos.modeAlerted = false;
419
419
  Zonos.cartData = null;
420
420
  Zonos.paypal = null;
@@ -13962,6 +13962,15 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
13962
13962
  return;
13963
13963
  }
13964
13964
  const currencyCode = getCurrencyCode(selectedCountryCode);
13965
+ // Only trigger callback onCountryChange if the country code has been set before
13966
+ if (!isFirstTime) {
13967
+ // Trigger callback onCountryChange
13968
+ (_a = zonosStore.zonosStore.onCountryChange) === null || _a === void 0 ? void 0 : _a.call(zonosStore.zonosStore, {
13969
+ countryCode: selectedCountryCode,
13970
+ currencyCode,
13971
+ isShippableCountry: isShippableCountry,
13972
+ });
13973
+ }
13965
13974
  if (!currencyCode) {
13966
13975
  return;
13967
13976
  }
@@ -13971,16 +13980,8 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
13971
13980
  window.sessionStorage.setItem('zonos--country', selectedCountryCode);
13972
13981
  // Update the URL query param with the new country code
13973
13982
  setZCountryUrlParam(selectedCountryCode);
13974
- (_a = document
13975
- .querySelector('zonos-hello')) === null || _a === void 0 ? void 0 : _a.setAttribute('z-country', selectedCountryCode);
13976
- // Only trigger callback onCountryChange if the country code has been set before
13977
- if (!isFirstTime) {
13978
- // Trigger callback onCountryChange
13979
- (_b = zonosStore.zonosStore.onCountryChange) === null || _b === void 0 ? void 0 : _b.call(zonosStore.zonosStore, {
13980
- countryCode: selectedCountryCode,
13981
- currencyCode,
13982
- });
13983
- }
13983
+ (_b = document
13984
+ .querySelector('zonos-hello')) === null || _b === void 0 ? void 0 : _b.setAttribute('z-country', selectedCountryCode);
13984
13985
  };
13985
13986
  const initHelloCountryList = (allCountries) => {
13986
13987
  const showCountryList = zonosStore.zonosStore.helloSettings.showCountryList;
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-f8ee56aa.js');
4
- const cart = require('./cart-7a7f3b59.js');
5
- const localization = require('./localization-33348cf3.js');
4
+ const cart = require('./cart-e0b62259.js');
5
+ const localization = require('./localization-91bcde0e.js');
6
6
  const handleFetch = require('./handleFetch-7cf3752e.js');
7
7
  const isDarkColor = require('./isDarkColor-428965f4.js');
8
8
 
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-1c710d00.js');
6
6
  const debounce$1 = require('./debounce-465a4328.js');
7
7
  const zonosStore = require('./zonosStore-f8ee56aa.js');
8
- const cart = require('./cart-7a7f3b59.js');
9
- const localization = require('./localization-33348cf3.js');
8
+ const cart = require('./cart-e0b62259.js');
9
+ const localization = require('./localization-91bcde0e.js');
10
10
  const handleFetch = require('./handleFetch-7cf3752e.js');
11
11
  const shouldRenderTaxIdInput = require('./shouldRenderTaxIdInput-9b8a8de1.js');
12
12
  const TaxId = require('./TaxId-12acedde.js');
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1c710d00.js');
6
- const cart = require('./cart-7a7f3b59.js');
7
- const localization = require('./localization-33348cf3.js');
6
+ const cart = require('./cart-e0b62259.js');
7
+ const localization = require('./localization-91bcde0e.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
- const paypal = require('./paypal-4124a81b.js');
10
9
  const zonosStore = require('./zonosStore-f8ee56aa.js');
10
+ const paypal = require('./paypal-93e5de01.js');
11
11
  const handleFetch = require('./handleFetch-7cf3752e.js');
12
12
  const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
13
13
  const getBorderRadius = require('./getBorderRadius-1b5e33cf.js');
@@ -1220,9 +1220,9 @@ const ZonosCartSubtotal = class {
1220
1220
  return (index.h(index.Fragment, null, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, cart.cartStore.selectedShippingOption.displayName), cart.cartStore.selectedShippingOptionTransitTime && (index.h("zonos-text", { class: "zonos--caption", type: "caption" }, cart.cartStore.selectedShippingOptionTransitTime))));
1221
1221
  };
1222
1222
  const renderLandedCost = () => {
1223
- var _a;
1223
+ var _a, _b, _c;
1224
1224
  // Domestic US doesn't have duty applied, just taxes and fees
1225
- if (((_a = cart.stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.value.address.country) === 'US') {
1225
+ if ((_b = (_a = zonosStore.zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.domesticCountries) === null || _b === void 0 ? void 0 : _b.includes(((_c = cart.stripeStore.stripeAddressEventData) === null || _c === void 0 ? void 0 : _c.value.address.country) || 'US')) {
1226
1226
  return (index.h(index.Fragment, null, index.h("td", { class: "zonos--column zonos--cart-subtotal-title" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, localization.translate('Taxes and fees'))), index.h("td", { class: "zonos--column zonos--cart-subtotal-price" }, index.h("div", { class: "zonos--cart-duty-tax-price" }, cart.cartStore.dutiesTaxesFees !== null ||
1227
1227
  cart.cartStore.dutiesTaxesFeesEstimate !== null
1228
1228
  ? renderCheckoutCurrency({
@@ -2679,7 +2679,6 @@ const ZonosCustomerInfo = class {
2679
2679
  catch (_a) { }
2680
2680
  }
2681
2681
  componentWillLoad() {
2682
- this.watchShouldEnabledCustomAddress();
2683
2682
  this.storeUnsubscribeList = [
2684
2683
  zonosStore.zonosStoreOnChange('genericSettings', () => {
2685
2684
  this.genericSettings = zonosStore.zonosStore.genericSettings;
@@ -2691,6 +2690,7 @@ const ZonosCustomerInfo = class {
2691
2690
  this.addressFormRenderType = cart.cartStore.addressFormRenderType;
2692
2691
  }),
2693
2692
  ];
2693
+ this.watchShouldEnabledCustomAddress();
2694
2694
  }
2695
2695
  render() {
2696
2696
  var _a, _b, _c, _d, _e, _f;
@@ -2962,11 +2962,11 @@ const ZonosShipping = class {
2962
2962
  this.continueClicked.emit();
2963
2963
  };
2964
2964
  this.getLandedCostMethodLabelSuffix = (method) => {
2965
- var _a;
2965
+ var _a, _b, _c;
2966
2966
  switch (true) {
2967
2967
  // DAP description for non-US countries only
2968
2968
  case method === 'DAP' &&
2969
- ((_a = cart.stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.value.address.country) !== 'US':
2969
+ !((_b = (_a = zonosStore.zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.domesticCountries) === null || _b === void 0 ? void 0 : _b.includes(((_c = cart.stripeStore.stripeAddressEventData) === null || _c === void 0 ? void 0 : _c.value.address.country) || 'US')):
2970
2970
  return localization.translate(` (Duties due at door)`);
2971
2971
  default:
2972
2972
  return '';
@@ -3056,7 +3056,6 @@ const ZonosShipping = class {
3056
3056
  this.storeUnsubscribeList.forEach(subscription => subscription());
3057
3057
  }
3058
3058
  componentWillLoad() {
3059
- void this.preselectFirstShippingMethod();
3060
3059
  this.storeUnsubscribeList = [
3061
3060
  cart.cartStoreOnChange('shippingData', () => {
3062
3061
  if (this.isOutdatedShippingData()) {
@@ -3071,6 +3070,7 @@ const ZonosShipping = class {
3071
3070
  }
3072
3071
  }),
3073
3072
  ];
3073
+ void this.preselectFirstShippingMethod();
3074
3074
  }
3075
3075
  render() {
3076
3076
  // re-init service levels if the currency is toggled
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1c710d00.js');
6
- const cart = require('./cart-7a7f3b59.js');
7
- const paypal = require('./paypal-4124a81b.js');
8
- const localization = require('./localization-33348cf3.js');
6
+ const cart = require('./cart-e0b62259.js');
7
+ const paypal = require('./paypal-93e5de01.js');
8
+ const localization = require('./localization-91bcde0e.js');
9
9
  const zonosStore = require('./zonosStore-f8ee56aa.js');
10
10
  const handleFetch = require('./handleFetch-7cf3752e.js');
11
11
  const updateCheckoutSessionAttributes = require('./updateCheckoutSessionAttributes-047bc0cb.js');
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1c710d00.js');
6
- const cart = require('./cart-7a7f3b59.js');
7
- const localization = require('./localization-33348cf3.js');
6
+ const cart = require('./cart-e0b62259.js');
7
+ const localization = require('./localization-91bcde0e.js');
8
8
  const zonosStore = require('./zonosStore-f8ee56aa.js');
9
9
  const getGenericSettingsOverride = require('./getGenericSettingsOverride-c0ca32b9.js');
10
10
  const handleFetch = require('./handleFetch-7cf3752e.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1c710d00.js');
6
- const localization = require('./localization-33348cf3.js');
6
+ const localization = require('./localization-91bcde0e.js');
7
7
  const zonosStore = require('./zonosStore-f8ee56aa.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  require('./handleFetch-7cf3752e.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1c710d00.js');
6
- const localization = require('./localization-33348cf3.js');
6
+ const localization = require('./localization-91bcde0e.js');
7
7
  const zonosStore = require('./zonosStore-f8ee56aa.js');
8
8
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
9
9
  const isDarkColor = require('./isDarkColor-428965f4.js');
@@ -6,10 +6,10 @@ const index = require('./index-1c710d00.js');
6
6
  const zonosStore = require('./zonosStore-f8ee56aa.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
  const getBorderRadius = require('./getBorderRadius-1b5e33cf.js');
9
- const cart = require('./cart-7a7f3b59.js');
10
- const localization = require('./localization-33348cf3.js');
9
+ const cart = require('./cart-e0b62259.js');
10
+ const localization = require('./localization-91bcde0e.js');
11
11
  const handleFetch = require('./handleFetch-7cf3752e.js');
12
- const paypal = require('./paypal-4124a81b.js');
12
+ const paypal = require('./paypal-93e5de01.js');
13
13
  require('./VarianceTest-0cb1e118.js');
14
14
  require('./isDarkColor-428965f4.js');
15
15
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1c710d00.js');
6
- const localization = require('./localization-33348cf3.js');
6
+ const localization = require('./localization-91bcde0e.js');
7
7
  const zonosStore = require('./zonosStore-f8ee56aa.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-1c710d00.js');
6
6
  const debounce = require('./debounce-465a4328.js');
7
- const localization = require('./localization-33348cf3.js');
7
+ const localization = require('./localization-91bcde0e.js');
8
8
  const zonosStore = require('./zonosStore-f8ee56aa.js');
9
9
  const classes = require('./classes-b7918f56.js');
10
10
  const handleFetch = require('./handleFetch-7cf3752e.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1c710d00.js');
6
- const localization = require('./localization-33348cf3.js');
6
+ const localization = require('./localization-91bcde0e.js');
7
7
  const zonosStore = require('./zonosStore-f8ee56aa.js');
8
8
  const ILanguage = require('./ILanguage-98b04442.js');
9
9
  require('./handleFetch-7cf3752e.js');
@@ -2,6 +2,7 @@ import { Fragment, h, Host } from "@stencil/core";
2
2
  import { cartStore, cartStoreHasOneEligibleItem, } from "../../../store/checkout/cart";
3
3
  import { stripeStore, stripeStoreApplyPromoCode, stripeStoreRemovePromoCode, } from "../../../store/checkout/stripe";
4
4
  import { translate } from "../../../store/translationStore";
5
+ import { zonosStore } from "../../../store/zonosStore";
5
6
  import { renderCheckoutCurrency } from "../../../utils/checkout/renderCheckoutCurrency";
6
7
  export class ZonosCartSubtotal {
7
8
  constructor() {
@@ -46,9 +47,9 @@ export class ZonosCartSubtotal {
46
47
  return (h(Fragment, null, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, cartStore.selectedShippingOption.displayName), cartStore.selectedShippingOptionTransitTime && (h("zonos-text", { class: "zonos--caption", type: "caption" }, cartStore.selectedShippingOptionTransitTime))));
47
48
  };
48
49
  const renderLandedCost = () => {
49
- var _a;
50
+ var _a, _b, _c;
50
51
  // Domestic US doesn't have duty applied, just taxes and fees
51
- if (((_a = stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.value.address.country) === 'US') {
52
+ if ((_b = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.domesticCountries) === null || _b === void 0 ? void 0 : _b.includes(((_c = stripeStore.stripeAddressEventData) === null || _c === void 0 ? void 0 : _c.value.address.country) || 'US')) {
52
53
  return (h(Fragment, null, h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Taxes and fees'))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("div", { class: "zonos--cart-duty-tax-price" }, cartStore.dutiesTaxesFees !== null ||
53
54
  cartStore.dutiesTaxesFeesEstimate !== null
54
55
  ? renderCheckoutCurrency({
@@ -341,7 +341,6 @@ export class ZonosCustomerInfo {
341
341
  catch (_a) { }
342
342
  }
343
343
  componentWillLoad() {
344
- this.watchShouldEnabledCustomAddress();
345
344
  this.storeUnsubscribeList = [
346
345
  zonosStoreOnChange('genericSettings', () => {
347
346
  this.genericSettings = zonosStore.genericSettings;
@@ -353,6 +352,7 @@ export class ZonosCustomerInfo {
353
352
  this.addressFormRenderType = cartStore.addressFormRenderType;
354
353
  }),
355
354
  ];
355
+ this.watchShouldEnabledCustomAddress();
356
356
  }
357
357
  render() {
358
358
  var _a, _b, _c, _d, _e, _f;
@@ -3,6 +3,7 @@ import { cartStore, cartStoreGetMethod, cartStoreGetShippingTransitInfo, cartSto
3
3
  import { stripeStore, stripeStoreAsyncAddressUpdate, } from "../../../store/checkout/stripe";
4
4
  import { storageStore } from "../../../store/storageStore";
5
5
  import { translate } from "../../../store/translationStore";
6
+ import { zonosStore } from "../../../store/zonosStore";
6
7
  import { trackConversionEvent } from "../../../utils/api/trackConversionEvent";
7
8
  import { renderCheckoutCurrency } from "../../../utils/checkout/renderCheckoutCurrency";
8
9
  import { sortServiceLevelOptionsByAmount } from "../../../utils/checkout/sortServiceLevelOptionsByAmount";
@@ -89,11 +90,11 @@ export class ZonosShipping {
89
90
  this.continueClicked.emit();
90
91
  };
91
92
  this.getLandedCostMethodLabelSuffix = (method) => {
92
- var _a;
93
+ var _a, _b, _c;
93
94
  switch (true) {
94
95
  // DAP description for non-US countries only
95
96
  case method === 'DAP' &&
96
- ((_a = stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.value.address.country) !== 'US':
97
+ !((_b = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.domesticCountries) === null || _b === void 0 ? void 0 : _b.includes(((_c = stripeStore.stripeAddressEventData) === null || _c === void 0 ? void 0 : _c.value.address.country) || 'US')):
97
98
  return translate(` (Duties due at door)`);
98
99
  default:
99
100
  return '';
@@ -183,7 +184,6 @@ export class ZonosShipping {
183
184
  this.storeUnsubscribeList.forEach(subscription => subscription());
184
185
  }
185
186
  componentWillLoad() {
186
- void this.preselectFirstShippingMethod();
187
187
  this.storeUnsubscribeList = [
188
188
  cartStoreOnChange('shippingData', () => {
189
189
  if (this.isOutdatedShippingData()) {
@@ -198,6 +198,7 @@ export class ZonosShipping {
198
198
  }
199
199
  }),
200
200
  ];
201
+ void this.preselectFirstShippingMethod();
201
202
  }
202
203
  render() {
203
204
  // re-init service levels if the currency is toggled
@@ -291,7 +291,7 @@ export class ZonosController {
291
291
  "mutable": false,
292
292
  "complexType": {
293
293
  "original": "LoadZonosParamsConfig",
294
- "resolved": "{ appearance?: Partial<AppearanceConfig> | undefined; checkoutSettings?: Partial<CheckoutConfig> | undefined; currencyConverter?: CurrencyConverter | undefined; helloSettings?: Partial<HelloConfig> | undefined; overrideCurrencyFormat?: { currencyDisplay?: \"symbol\" | \"name\" | \"code\" | \"narrowSymbol\" | undefined; } | ((params: { amount: number; currencyCode: CurrencyCode; numberFormat: NumberFormat; }) => string) | undefined; onCountryChange?: ((props: { countryCode: CountryCode; currencyCode: CurrencyCode; }) => void) | undefined; }",
294
+ "resolved": "{ appearance?: Partial<AppearanceConfig> | undefined; checkoutSettings?: Partial<CheckoutConfig> | undefined; currencyConverter?: CurrencyConverter | undefined; helloSettings?: Partial<HelloConfig> | undefined; overrideCurrencyFormat?: { currencyDisplay?: \"symbol\" | \"name\" | \"code\" | \"narrowSymbol\" | undefined; } | ((params: { amount: number; currencyCode: CurrencyCode; numberFormat: NumberFormat; }) => string) | undefined; onCountryChange?: ((props: { countryCode: CountryCode; currencyCode: CurrencyCode | null; isShippableCountry: boolean; }) => void) | undefined; }",
295
295
  "references": {
296
296
  "LoadZonosParamsConfig": {
297
297
  "location": "import",
@@ -460,7 +460,7 @@ export class ZonosController {
460
460
  "signature": "(config: LoadZonosParamsConfig) => Promise<void>",
461
461
  "parameters": [{
462
462
  "name": "config",
463
- "type": "{ appearance?: Partial<AppearanceConfig> | undefined; checkoutSettings?: Partial<CheckoutConfig> | undefined; currencyConverter?: CurrencyConverter | undefined; helloSettings?: Partial<HelloConfig> | undefined; overrideCurrencyFormat?: { currencyDisplay?: \"symbol\" | \"name\" | \"code\" | \"narrowSymbol\" | undefined; } | ((params: { amount: number; currencyCode: CurrencyCode; numberFormat: NumberFormat; }) => string) | undefined; onCountryChange?: ((props: { countryCode: CountryCode; currencyCode: CurrencyCode; }) => void) | undefined; }",
463
+ "type": "{ appearance?: Partial<AppearanceConfig> | undefined; checkoutSettings?: Partial<CheckoutConfig> | undefined; currencyConverter?: CurrencyConverter | undefined; helloSettings?: Partial<HelloConfig> | undefined; overrideCurrencyFormat?: { currencyDisplay?: \"symbol\" | \"name\" | \"code\" | \"narrowSymbol\" | undefined; } | ((params: { amount: number; currencyCode: CurrencyCode; numberFormat: NumberFormat; }) => string) | undefined; onCountryChange?: ((props: { countryCode: CountryCode; currencyCode: CurrencyCode | null; isShippableCountry: boolean; }) => void) | undefined; }",
464
464
  "docs": "config that need to override the default setting"
465
465
  }],
466
466
  "references": {
@@ -270,6 +270,12 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
270
270
  * For some service levels, the landed cost that's DAP and we do remittance on behalf of the merchant, these landed cost should be treated as DDP
271
271
  */
272
272
  const cartStoreGetMethod = (landedCost) => {
273
+ var _a, _b, _c;
274
+ // If the landed cost is DAP and the country is domestic, then treat it as DDP since no duty or fee is due at the door
275
+ if (landedCost.method === 'DAP' &&
276
+ ((_b = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.domesticCountries) === null || _b === void 0 ? void 0 : _b.includes(((_c = stripeStore.stripeAddressEventData) === null || _c === void 0 ? void 0 : _c.value.address.country) || 'US'))) {
277
+ return 'DDP';
278
+ }
273
279
  if (landedCost.method === 'DAP' &&
274
280
  landedCost.remittance.length &&
275
281
  landedCost.landedCostGuaranteeCode === 'ZONOS') {
@@ -156,6 +156,15 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
156
156
  return;
157
157
  }
158
158
  const currencyCode = getCurrencyCode(selectedCountryCode);
159
+ // Only trigger callback onCountryChange if the country code has been set before
160
+ if (!isFirstTime) {
161
+ // Trigger callback onCountryChange
162
+ (_a = zonosStore.onCountryChange) === null || _a === void 0 ? void 0 : _a.call(zonosStore, {
163
+ countryCode: selectedCountryCode,
164
+ currencyCode,
165
+ isShippableCountry: isShippableCountry,
166
+ });
167
+ }
159
168
  if (!currencyCode) {
160
169
  return;
161
170
  }
@@ -165,16 +174,8 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
165
174
  window.sessionStorage.setItem('zonos--country', selectedCountryCode);
166
175
  // Update the URL query param with the new country code
167
176
  setZCountryUrlParam(selectedCountryCode);
168
- (_a = document
169
- .querySelector('zonos-hello')) === null || _a === void 0 ? void 0 : _a.setAttribute('z-country', selectedCountryCode);
170
- // Only trigger callback onCountryChange if the country code has been set before
171
- if (!isFirstTime) {
172
- // Trigger callback onCountryChange
173
- (_b = zonosStore.onCountryChange) === null || _b === void 0 ? void 0 : _b.call(zonosStore, {
174
- countryCode: selectedCountryCode,
175
- currencyCode,
176
- });
177
- }
177
+ (_b = document
178
+ .querySelector('zonos-hello')) === null || _b === void 0 ? void 0 : _b.setAttribute('z-country', selectedCountryCode);
178
179
  };
179
180
  const initHelloCountryList = (allCountries) => {
180
181
  const showCountryList = zonosStore.helloSettings.showCountryList;
@@ -1,7 +1,7 @@
1
1
  import { prepCartCalculateLandedCost } from "./prepCalculateLandedCost";
2
2
  import { handleFetch } from "../handleFetch";
3
3
  export const cartCalculateLandedCost = async ({ abortController, cartId, }) => {
4
- var _a, _b, _c, _d;
4
+ var _a, _b, _c, _d, _e;
5
5
  // request to get landed cost info
6
6
  const { errors, json } = await handleFetch('/api/zonos-elements/cart-calculate-landed-cost', {
7
7
  body: prepCartCalculateLandedCost(cartId),
@@ -9,10 +9,11 @@ export const cartCalculateLandedCost = async ({ abortController, cartId, }) => {
9
9
  signal: abortController === null || abortController === void 0 ? void 0 : abortController.signal,
10
10
  });
11
11
  if (errors.length || !json) {
12
- const isAbortedRequest = ((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.message) === 'The user aborted a request.' ||
13
- ((_b = errors[0]) === null || _b === void 0 ? void 0 : _b.message.includes('signal is aborted')) ||
14
- ((_c = errors[0]) === null || _c === void 0 ? void 0 : _c.message.includes('The operation was aborted')) ||
15
- ((_d = errors[0]) === null || _d === void 0 ? void 0 : _d.message.includes('Fetch is aborted'));
12
+ const isAbortedRequest = typeof ((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.message) === 'string' &&
13
+ (((_b = errors[0]) === null || _b === void 0 ? void 0 : _b.message) === 'The user aborted a request.' ||
14
+ ((_c = errors[0]) === null || _c === void 0 ? void 0 : _c.message.includes('signal is aborted')) ||
15
+ ((_d = errors[0]) === null || _d === void 0 ? void 0 : _d.message.includes('The operation was aborted')) ||
16
+ ((_e = errors[0]) === null || _e === void 0 ? void 0 : _e.message.includes('Fetch is aborted')));
16
17
  const errorMessage = isAbortedRequest
17
18
  ? 'The landed cost calculation request was aborted to initiate a new one.'
18
19
  : 'Failed to calculate landed cost';
@@ -1,5 +1,5 @@
1
1
  import { z as zonosStore, c as createStore } from './zonosStore-c456b933.js';
2
- import { s as storageStore, l as localizationStore, t as translate, f as filterValidTests, b as storageStoreSetEnabledVariantTestKeys } from './localization-f1b9c0ef.js';
2
+ import { s as storageStore, l as localizationStore, t as translate, f as filterValidTests, b as storageStoreSetEnabledVariantTestKeys } from './localization-cf31c728.js';
3
3
  import { l as log, f as fallbackApiList, h as handleFetch, g as getIsTestMode, a as getIsStagingMode, s as sendErrorLog, d as allLogs, b as logError, j as jsonParse } from './handleFetch-dd74bbb1.js';
4
4
  import { i as isDarkColor } from './isDarkColor-1f58b6be.js';
5
5
  import { g as getBorderRadius } from './getBorderRadius-87593ff4.js';
@@ -254,7 +254,7 @@ const calculateLandedCost = async (abortController) => {
254
254
  };
255
255
 
256
256
  const cartCalculateLandedCost = async ({ abortController, cartId, }) => {
257
- var _a, _b, _c, _d;
257
+ var _a, _b, _c, _d, _e;
258
258
  // request to get landed cost info
259
259
  const { errors, json } = await handleFetch('/api/zonos-elements/cart-calculate-landed-cost', {
260
260
  body: prepCartCalculateLandedCost(cartId),
@@ -262,10 +262,11 @@ const cartCalculateLandedCost = async ({ abortController, cartId, }) => {
262
262
  signal: abortController === null || abortController === void 0 ? void 0 : abortController.signal,
263
263
  });
264
264
  if (errors.length || !json) {
265
- const isAbortedRequest = ((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.message) === 'The user aborted a request.' ||
266
- ((_b = errors[0]) === null || _b === void 0 ? void 0 : _b.message.includes('signal is aborted')) ||
267
- ((_c = errors[0]) === null || _c === void 0 ? void 0 : _c.message.includes('The operation was aborted')) ||
268
- ((_d = errors[0]) === null || _d === void 0 ? void 0 : _d.message.includes('Fetch is aborted'));
265
+ const isAbortedRequest = typeof ((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.message) === 'string' &&
266
+ (((_b = errors[0]) === null || _b === void 0 ? void 0 : _b.message) === 'The user aborted a request.' ||
267
+ ((_c = errors[0]) === null || _c === void 0 ? void 0 : _c.message.includes('signal is aborted')) ||
268
+ ((_d = errors[0]) === null || _d === void 0 ? void 0 : _d.message.includes('The operation was aborted')) ||
269
+ ((_e = errors[0]) === null || _e === void 0 ? void 0 : _e.message.includes('Fetch is aborted')));
269
270
  const errorMessage = isAbortedRequest
270
271
  ? 'The landed cost calculation request was aborted to initiate a new one.'
271
272
  : 'Failed to calculate landed cost';
@@ -1966,6 +1967,12 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
1966
1967
  * For some service levels, the landed cost that's DAP and we do remittance on behalf of the merchant, these landed cost should be treated as DDP
1967
1968
  */
1968
1969
  const cartStoreGetMethod = (landedCost) => {
1970
+ var _a, _b, _c;
1971
+ // If the landed cost is DAP and the country is domestic, then treat it as DDP since no duty or fee is due at the door
1972
+ if (landedCost.method === 'DAP' &&
1973
+ ((_b = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.domesticCountries) === null || _b === void 0 ? void 0 : _b.includes(((_c = stripeStore.stripeAddressEventData) === null || _c === void 0 ? void 0 : _c.value.address.country) || 'US'))) {
1974
+ return 'DDP';
1975
+ }
1969
1976
  if (landedCost.method === 'DAP' &&
1970
1977
  landedCost.remittance.length &&
1971
1978
  landedCost.landedCostGuaranteeCode === 'ZONOS') {
@@ -2140,4 +2147,4 @@ const cartStoreResetTabItems = () => {
2140
2147
  cartStoreResetSelectedShippingOption();
2141
2148
  };
2142
2149
 
2143
- export { cartStoreHasOneEligibleItem as A, stripeStoreApplyPromoCode as B, stripeStoreRemovePromoCode as C, stripeStoreResetPromoCode as D, stripeStoreMessageBasedOnStatus as E, stripeStoreTranslateAddressToLatin as F, cartStoreOnChange as G, stripeStoreAsyncAddressUpdate as H, cartStoreUpdateSelectedShippingOption as I, cartStoreGetShippingTransitInfo as J, sortServiceLevelOptionsByAmount as K, cartStoreGetMethod as L, stripeStoreCleanupDomesticShippingSession as a, stripeStoreSaveDomesticShippingSession as b, stripeStore as c, stripeStoreRetrievePayment as d, cartStore as e, cartStoreUpdateItems as f, cartStoreReset as g, cartStoreResetTabItems as h, initStripeElements as i, cartStoreClearCheckoutInterval as j, stripeStoreInitCheckoutSession as k, stripeStoreGetPaymentIntent as l, cartStoreStartCheckoutInterval as m, getCheckoutSessionBody as n, cartStoreUpdateToErrorState as o, cartStoreSetCheckoutSession as p, stripeStorePrefetchLandedCost as q, cartStoreNextStep as r, stripeStoreGetDomesticShippingSession as s, trackConversionEvent as t, stripeStoreUpdateCheckoutSessionBaseCurrency as u, stripeStoreHandleInventoryCheck as v, stripeStoreConfirmPayment as w, stripeStoreHandleInventoryRefund as x, stripeStoreReset as y, validateCheckoutSession as z };
2150
+ export { cartStoreHasOneEligibleItem as A, stripeStoreApplyPromoCode as B, stripeStoreRemovePromoCode as C, stripeStoreResetPromoCode as D, stripeStoreMessageBasedOnStatus as E, stripeStoreTranslateAddressToLatin as F, cartStoreOnChange as G, stripeStoreAsyncAddressUpdate as H, cartStoreUpdateSelectedShippingOption as I, cartStoreGetShippingTransitInfo as J, cartStoreGetMethod as K, sortServiceLevelOptionsByAmount as L, stripeStoreCleanupDomesticShippingSession as a, stripeStoreSaveDomesticShippingSession as b, stripeStore as c, stripeStoreRetrievePayment as d, cartStore as e, cartStoreUpdateItems as f, cartStoreReset as g, cartStoreResetTabItems as h, initStripeElements as i, cartStoreClearCheckoutInterval as j, stripeStoreInitCheckoutSession as k, stripeStoreGetPaymentIntent as l, cartStoreStartCheckoutInterval as m, getCheckoutSessionBody as n, cartStoreUpdateToErrorState as o, cartStoreSetCheckoutSession as p, stripeStorePrefetchLandedCost as q, cartStoreNextStep as r, stripeStoreGetDomesticShippingSession as s, trackConversionEvent as t, stripeStoreUpdateCheckoutSessionBaseCurrency as u, stripeStoreHandleInventoryCheck as v, stripeStoreConfirmPayment as w, stripeStoreHandleInventoryRefund as x, stripeStoreReset as y, validateCheckoutSession as z };
package/dist/esm/index.js CHANGED
@@ -129,7 +129,7 @@ const getZonosQaUrl = () => {
129
129
  return null;
130
130
  }
131
131
  const qaUrl = extractZonosQaUrl(window.location.href);
132
- const cdnUrl = "https://v1.3.211.js.zonos.com";
132
+ const cdnUrl = "https://v1.3.213.js.zonos.com";
133
133
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
134
134
  if (!qaUrl &&
135
135
  (cdnUrl.includes('test.') ||
@@ -372,10 +372,10 @@ const zonosLoadUrl = (() => {
372
372
  }
373
373
  return null;
374
374
  })();
375
- const ZONOS_URL = "https://v1.3.211.js.zonos.com";
376
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.211";
377
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.211";
378
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.211";
375
+ const ZONOS_URL = "https://v1.3.213.js.zonos.com";
376
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.213";
377
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.213";
378
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.213";
379
379
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
380
380
  const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
381
381
  class Zonos {
@@ -393,7 +393,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
393
393
  ? new URLSearchParams(window.location.search).get('iframeLogType')
394
394
  : null;
395
395
  Zonos.isBigCommerce = false;
396
- Zonos.releaseDate = "1749224734539";
396
+ Zonos.releaseDate = "1749249803483";
397
397
  Zonos.isLegacyCheckout = false;
398
398
  Zonos.domain = typeof window !== 'undefined'
399
399
  ? // domain that embeds the iframe
@@ -411,7 +411,7 @@ Zonos.isNpm = true;
411
411
  Zonos.zonosQaUrl = null;
412
412
  Zonos.zonosQaUrlApi = null;
413
413
  Zonos.trackEventLogs = [];
414
- Zonos.version = `v${"1.3.211"}`;
414
+ Zonos.version = `v${"1.3.213"}`;
415
415
  Zonos.modeAlerted = false;
416
416
  Zonos.cartData = null;
417
417
  Zonos.paypal = null;
@@ -13960,6 +13960,15 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
13960
13960
  return;
13961
13961
  }
13962
13962
  const currencyCode = getCurrencyCode(selectedCountryCode);
13963
+ // Only trigger callback onCountryChange if the country code has been set before
13964
+ if (!isFirstTime) {
13965
+ // Trigger callback onCountryChange
13966
+ (_a = zonosStore.onCountryChange) === null || _a === void 0 ? void 0 : _a.call(zonosStore, {
13967
+ countryCode: selectedCountryCode,
13968
+ currencyCode,
13969
+ isShippableCountry: isShippableCountry,
13970
+ });
13971
+ }
13963
13972
  if (!currencyCode) {
13964
13973
  return;
13965
13974
  }
@@ -13969,16 +13978,8 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
13969
13978
  window.sessionStorage.setItem('zonos--country', selectedCountryCode);
13970
13979
  // Update the URL query param with the new country code
13971
13980
  setZCountryUrlParam(selectedCountryCode);
13972
- (_a = document
13973
- .querySelector('zonos-hello')) === null || _a === void 0 ? void 0 : _a.setAttribute('z-country', selectedCountryCode);
13974
- // Only trigger callback onCountryChange if the country code has been set before
13975
- if (!isFirstTime) {
13976
- // Trigger callback onCountryChange
13977
- (_b = zonosStore.onCountryChange) === null || _b === void 0 ? void 0 : _b.call(zonosStore, {
13978
- countryCode: selectedCountryCode,
13979
- currencyCode,
13980
- });
13981
- }
13981
+ (_b = document
13982
+ .querySelector('zonos-hello')) === null || _b === void 0 ? void 0 : _b.setAttribute('z-country', selectedCountryCode);
13982
13983
  };
13983
13984
  const initHelloCountryList = (allCountries) => {
13984
13985
  const showCountryList = zonosStore.helloSettings.showCountryList;