@zonos/elements 1.3.268 → 1.3.269

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 (162) hide show
  1. package/dist/cjs/{cart-af7c024e.js → cart-87fbbb5a.js} +1 -1
  2. package/dist/cjs/{hasInclusivePrice-0fa6e022.js → hasInclusivePrice-c86ed1f5.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{invoice-c2e3f232.js → invoice-952f32c4.js} +2 -2
  5. package/dist/cjs/{isCollectMobileTablet-6014787b.js → isCollectMobileTablet-1cb21c59.js} +2 -2
  6. package/dist/cjs/{localization-f897bc45.js → localization-a969f224.js} +239 -2
  7. package/dist/cjs/{paypal-6756a0da.js → paypal-cfe1e8e9.js} +2 -2
  8. package/dist/cjs/{placeTestOrder-a4874e51.js → placeTestOrder-613878fb.js} +2 -2
  9. package/dist/cjs/{renderCheckoutCurrency-584d50fe.js → renderCheckoutCurrency-5a333d29.js} +2 -2
  10. package/dist/cjs/zonos-address-display_8.cjs.entry.js +2 -2
  11. package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-card_5.cjs.entry.js +3 -3
  13. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +6 -6
  14. package/dist/cjs/zonos-checkout.cjs.entry.js +15 -72
  15. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
  16. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
  17. package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
  18. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  19. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  20. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  21. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  22. package/dist/cjs/zonos-hello.cjs.entry.js +2 -45
  23. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
  24. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +6 -6
  25. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
  26. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  27. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +3 -3
  28. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +2 -44
  29. package/dist/collection/components/store/hello/localization.js +12 -1
  30. package/dist/collection/components/utils/checkout/bigcommerceStorefrontApi.js +28 -0
  31. package/dist/collection/components/utils/checkout/removeBigcommerceCartShipping.js +83 -0
  32. package/dist/collection/components/utils/hello/shouldShowHelloWidget.js +61 -0
  33. package/dist/collection/utils/toggleBigcommerceNativeCurrencySelector.js +2 -1
  34. package/dist/esm/{cart-68c16805.js → cart-663ef7d5.js} +1 -1
  35. package/dist/esm/{hasInclusivePrice-f1ca1610.js → hasInclusivePrice-f8bd057d.js} +1 -1
  36. package/dist/esm/index.js +7 -7
  37. package/dist/esm/{invoice-d0eadc6a.js → invoice-db7211a6.js} +2 -2
  38. package/dist/esm/{isCollectMobileTablet-11ade63f.js → isCollectMobileTablet-24c912b1.js} +2 -2
  39. package/dist/esm/{localization-8e81b696.js → localization-dc19e8bb.js} +236 -3
  40. package/dist/esm/{paypal-e32877e9.js → paypal-cdbe69ef.js} +2 -2
  41. package/dist/esm/{placeTestOrder-4cf429d7.js → placeTestOrder-ba67e208.js} +2 -2
  42. package/dist/esm/{renderCheckoutCurrency-9459b8a3.js → renderCheckoutCurrency-fb1cbd28.js} +2 -2
  43. package/dist/esm/zonos-address-display_8.entry.js +2 -2
  44. package/dist/esm/zonos-address_4.entry.js +2 -2
  45. package/dist/esm/zonos-card_5.entry.js +3 -3
  46. package/dist/esm/zonos-cart-items_12.entry.js +6 -6
  47. package/dist/esm/zonos-checkout.entry.js +4 -61
  48. package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
  49. package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
  50. package/dist/esm/zonos-collect.entry.js +4 -4
  51. package/dist/esm/zonos-controller.entry.js +2 -2
  52. package/dist/esm/zonos-country-flag.entry.js +1 -1
  53. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  54. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  55. package/dist/esm/zonos-hello.entry.js +2 -45
  56. package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
  57. package/dist/esm/zonos-invoice-finish_5.entry.js +6 -6
  58. package/dist/esm/zonos-invoice.entry.js +4 -4
  59. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  60. package/dist/esm/zonos-policy-consent_2.entry.js +3 -3
  61. package/dist/esm-es5/{cart-68c16805.js → cart-663ef7d5.js} +1 -1
  62. package/dist/esm-es5/{hasInclusivePrice-f1ca1610.js → hasInclusivePrice-f8bd057d.js} +1 -1
  63. package/dist/esm-es5/index.js +1 -1
  64. package/dist/esm-es5/{invoice-d0eadc6a.js → invoice-db7211a6.js} +1 -1
  65. package/dist/esm-es5/{isCollectMobileTablet-11ade63f.js → isCollectMobileTablet-24c912b1.js} +1 -1
  66. package/dist/esm-es5/{localization-8e81b696.js → localization-dc19e8bb.js} +1 -1
  67. package/dist/esm-es5/{paypal-e32877e9.js → paypal-cdbe69ef.js} +1 -1
  68. package/dist/esm-es5/{placeTestOrder-4cf429d7.js → placeTestOrder-ba67e208.js} +1 -1
  69. package/dist/esm-es5/{renderCheckoutCurrency-9459b8a3.js → renderCheckoutCurrency-fb1cbd28.js} +1 -1
  70. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
  71. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  72. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  73. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  74. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  75. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  76. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  77. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  78. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  79. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  80. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  81. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  82. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  83. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  84. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  85. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  86. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  87. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
  88. package/dist/scripts/index.js +1 -1
  89. package/dist/scripts/loadZonos.js +1 -1
  90. package/dist/scripts/zonos.js +1 -1
  91. package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +0 -1
  92. package/dist/types/components/utils/checkout/bigcommerceStorefrontApi.d.ts +9 -0
  93. package/dist/types/components/utils/checkout/removeBigcommerceCartShipping.d.ts +18 -0
  94. package/dist/types/components/utils/hello/shouldShowHelloWidget.d.ts +16 -0
  95. package/dist/zonos-elements/index.esm.js +1 -1
  96. package/dist/zonos-elements/{p-50362897.entry.js → p-049fc407.entry.js} +1 -1
  97. package/dist/zonos-elements/{p-c7ca3e98.system.entry.js → p-0581cfc9.system.entry.js} +1 -1
  98. package/dist/zonos-elements/{p-01913da8.js → p-097d7819.js} +1 -1
  99. package/dist/zonos-elements/{p-5e18d92b.system.entry.js → p-09d32e53.system.entry.js} +1 -1
  100. package/dist/zonos-elements/{p-8ddc21f1.system.entry.js → p-0daed059.system.entry.js} +1 -1
  101. package/dist/zonos-elements/p-1bde60d5.system.entry.js +1 -0
  102. package/dist/zonos-elements/{p-dcafbd4e.js → p-243dda5f.js} +1 -1
  103. package/dist/zonos-elements/p-263d14da.system.entry.js +1 -0
  104. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  105. package/dist/zonos-elements/p-2be4335f.js +1 -0
  106. package/dist/zonos-elements/{p-64e8f05d.system.entry.js → p-33a37c42.system.entry.js} +1 -1
  107. package/dist/zonos-elements/{p-17e3cd62.js → p-44147850.js} +1 -1
  108. package/dist/zonos-elements/{p-97da66f2.entry.js → p-488c1af1.entry.js} +1 -1
  109. package/dist/zonos-elements/{p-95b460e9.system.entry.js → p-48ec0b61.system.entry.js} +1 -1
  110. package/dist/zonos-elements/p-4af88255.entry.js +1 -0
  111. package/dist/zonos-elements/p-4b6e367d.system.js +1 -0
  112. package/dist/zonos-elements/{p-7fef8558.entry.js → p-513e8278.entry.js} +1 -1
  113. package/dist/zonos-elements/p-56711a61.js +1 -0
  114. package/dist/zonos-elements/{p-e3d6f9b4.entry.js → p-57b55808.entry.js} +1 -1
  115. package/dist/zonos-elements/p-57c3c68f.entry.js +1 -0
  116. package/dist/zonos-elements/{p-c3459f4a.entry.js → p-680da401.entry.js} +1 -1
  117. package/dist/zonos-elements/p-699276f2.system.js +1 -0
  118. package/dist/zonos-elements/{p-a0ee01dd.system.entry.js → p-71528303.system.entry.js} +1 -1
  119. package/dist/zonos-elements/{p-44b279cc.system.js → p-7662d32a.system.js} +1 -1
  120. package/dist/zonos-elements/{p-48805ed6.system.entry.js → p-82ce355d.system.entry.js} +1 -1
  121. package/dist/zonos-elements/{p-620a9013.entry.js → p-84d4f04d.entry.js} +1 -1
  122. package/dist/zonos-elements/{p-673407b8.entry.js → p-858103a0.entry.js} +1 -1
  123. package/dist/zonos-elements/{p-bc9a30a1.system.entry.js → p-882fb843.system.entry.js} +1 -1
  124. package/dist/zonos-elements/{p-24091606.system.entry.js → p-8a24701c.system.entry.js} +1 -1
  125. package/dist/zonos-elements/{p-593764cf.system.entry.js → p-8f0bdb87.system.entry.js} +1 -1
  126. package/dist/zonos-elements/{p-4fe3d5e0.system.js → p-8f817a47.system.js} +1 -1
  127. package/dist/zonos-elements/{p-38311c16.entry.js → p-9092f655.entry.js} +1 -1
  128. package/dist/zonos-elements/{p-6f41c193.entry.js → p-9377b5c2.entry.js} +1 -1
  129. package/dist/zonos-elements/{p-b93b66c2.entry.js → p-9799193c.entry.js} +1 -1
  130. package/dist/zonos-elements/{p-fc5007e0.entry.js → p-9a509268.entry.js} +1 -1
  131. package/dist/zonos-elements/{p-69089a6f.system.entry.js → p-9ea67d63.system.entry.js} +1 -1
  132. package/dist/zonos-elements/{p-7166df08.entry.js → p-a237429e.entry.js} +1 -1
  133. package/dist/zonos-elements/{p-1eef8c23.system.js → p-a3a79b2f.system.js} +1 -1
  134. package/dist/zonos-elements/p-accccb9c.entry.js +1 -0
  135. package/dist/zonos-elements/{p-623fc89a.system.entry.js → p-b0ed0fe7.system.entry.js} +1 -1
  136. package/dist/zonos-elements/{p-7628569a.entry.js → p-ba127f51.entry.js} +1 -1
  137. package/dist/zonos-elements/{p-72c3756a.js → p-bbef037c.js} +1 -1
  138. package/dist/zonos-elements/p-be64a52e.entry.js +1 -0
  139. package/dist/zonos-elements/{p-5b05b461.system.js → p-c2023a08.system.js} +1 -1
  140. package/dist/zonos-elements/{p-1376e67f.system.entry.js → p-c4ef873a.system.entry.js} +1 -1
  141. package/dist/zonos-elements/{p-774de1ec.system.js → p-c5caf47b.system.js} +1 -1
  142. package/dist/zonos-elements/{p-108b5307.system.entry.js → p-c62293d5.system.entry.js} +1 -1
  143. package/dist/zonos-elements/{p-b71ef46e.js → p-cd5444b0.js} +1 -1
  144. package/dist/zonos-elements/p-d437bc28.js +1 -0
  145. package/dist/zonos-elements/{p-2ccd20c0.system.js → p-d932973f.system.js} +1 -1
  146. package/dist/zonos-elements/{p-95f3bbad.system.entry.js → p-df0c8fb6.system.entry.js} +1 -1
  147. package/dist/zonos-elements/{p-c91fade3.entry.js → p-e05e5825.entry.js} +1 -1
  148. package/dist/zonos-elements/{p-53a59935.system.js → p-f5684fc2.system.js} +1 -1
  149. package/dist/zonos-elements/{p-af12a1b7.system.entry.js → p-fc270539.system.entry.js} +1 -1
  150. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  151. package/package.json +1 -1
  152. package/dist/zonos-elements/p-000b895a.entry.js +0 -1
  153. package/dist/zonos-elements/p-06e7fe2a.system.entry.js +0 -1
  154. package/dist/zonos-elements/p-0803ad10.js +0 -1
  155. package/dist/zonos-elements/p-11439d12.entry.js +0 -1
  156. package/dist/zonos-elements/p-17be8409.entry.js +0 -1
  157. package/dist/zonos-elements/p-5fa2395d.system.js +0 -1
  158. package/dist/zonos-elements/p-72960738.js +0 -1
  159. package/dist/zonos-elements/p-7a220941.system.js +0 -1
  160. package/dist/zonos-elements/p-7cf8e1f0.js +0 -1
  161. package/dist/zonos-elements/p-8116d3ba.entry.js +0 -1
  162. package/dist/zonos-elements/p-b9a615bc.system.entry.js +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-45a87908.js');
4
- const localization = require('./localization-f897bc45.js');
4
+ const localization = require('./localization-a969f224.js');
5
5
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
6
6
  const handleFetch = require('./handleFetch-954f30e1.js');
7
7
  const isDarkColor = require('./isDarkColor-5d6ca405.js');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const localization = require('./localization-f897bc45.js');
3
+ const localization = require('./localization-a969f224.js');
4
4
 
5
5
  /**
6
6
  * Since the backend and the frontend are using the same keys,
@@ -133,7 +133,7 @@ const getZonosQaUrl = () => {
133
133
  return null;
134
134
  }
135
135
  const qaUrl = extractZonosQaUrl(window.location.href);
136
- const cdnUrl = "https://v1.3.268.js.zonos.com";
136
+ const cdnUrl = "https://v1.3.269.js.zonos.com";
137
137
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
138
138
  if (!qaUrl &&
139
139
  (cdnUrl.includes('test.') ||
@@ -381,10 +381,10 @@ const zonosLoadUrl = (() => {
381
381
  return null;
382
382
  })();
383
383
  const startLoadTime = Date.now();
384
- const ZONOS_URL = "https://v1.3.268.js.zonos.com";
385
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.268";
386
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.268";
387
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.268";
384
+ const ZONOS_URL = "https://v1.3.269.js.zonos.com";
385
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.269";
386
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.269";
387
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.269";
388
388
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
389
389
  const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
390
390
  class Zonos {
@@ -402,7 +402,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
402
402
  ? new URLSearchParams(window.location.search).get('iframeLogType')
403
403
  : null;
404
404
  Zonos.isBigCommerce = false;
405
- Zonos.releaseDate = "1780932937557";
405
+ Zonos.releaseDate = "1781282532525";
406
406
  Zonos.isLegacyCheckout = false;
407
407
  Zonos.googleAnalyticId = null;
408
408
  Zonos.googleAnalyticReady = false;
@@ -427,7 +427,7 @@ Zonos.isNpm = true;
427
427
  Zonos.zonosQaUrl = null;
428
428
  Zonos.zonosQaUrlApi = null;
429
429
  Zonos.trackEventLogs = [];
430
- Zonos.version = `v${"1.3.268"}`;
430
+ Zonos.version = `v${"1.3.269"}`;
431
431
  Zonos.modeAlerted = false;
432
432
  Zonos.cartData = null;
433
433
  Zonos.paypal = null;
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-45a87908.js');
4
- const cart = require('./cart-af7c024e.js');
5
- const localization = require('./localization-f897bc45.js');
4
+ const cart = require('./cart-87fbbb5a.js');
5
+ const localization = require('./localization-a969f224.js');
6
6
  const handleFetch = require('./handleFetch-954f30e1.js');
7
7
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
8
8
 
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-45a87908.js');
4
- const cart = require('./cart-af7c024e.js');
5
- const localization = require('./localization-f897bc45.js');
4
+ const cart = require('./cart-87fbbb5a.js');
5
+ const localization = require('./localization-a969f224.js');
6
6
  const handleFetch = require('./handleFetch-954f30e1.js');
7
7
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
8
8
 
@@ -17184,6 +17184,229 @@ const getShippingZones = async () => {
17184
17184
  return shippingZones || null;
17185
17185
  };
17186
17186
 
17187
+ /**
17188
+ * Fetch the checkout/cart ID from the BigCommerce Storefront Cart API.
17189
+ * The `/checkout` page URL does not include the checkout ID, so we
17190
+ * retrieve it from `/api/storefront/cart` which returns the active cart(s).
17191
+ */
17192
+ const fetchCheckoutId = async () => {
17193
+ var _a, _b;
17194
+ try {
17195
+ const response = await fetch('/api/storefront/cart', {
17196
+ credentials: 'same-origin',
17197
+ headers: {
17198
+ Accept: 'application/json',
17199
+ },
17200
+ });
17201
+ if (!response.ok) {
17202
+ VarianceTest.log(`Failed to fetch BigCommerce cart: ${String(response.status)}`, 'error');
17203
+ return null;
17204
+ }
17205
+ const carts = (await response.json());
17206
+ return (_b = (_a = carts === null || carts === void 0 ? void 0 : carts[0]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : null;
17207
+ }
17208
+ catch (error) {
17209
+ handleFetch.logError('Error fetching BigCommerce cart data', error);
17210
+ return null;
17211
+ }
17212
+ };
17213
+ /**
17214
+ * Fetch checkout data from the BigCommerce Storefront API.
17215
+ * This API is cookie-authenticated (same-origin), so no token is needed.
17216
+ */
17217
+ const fetchBigCommerceCheckout = async (checkoutId) => {
17218
+ try {
17219
+ const response = await fetch(`/api/storefront/checkouts/${checkoutId}?include=customer.customerGroup,customer.addresses`, {
17220
+ credentials: 'same-origin',
17221
+ headers: {
17222
+ Accept: 'application/json',
17223
+ 'Content-Type': 'application/json',
17224
+ },
17225
+ });
17226
+ if (!response.ok) {
17227
+ VarianceTest.log(`Failed to fetch BigCommerce checkout: ${String(response.status)}`, 'error');
17228
+ return null;
17229
+ }
17230
+ return (await response.json());
17231
+ }
17232
+ catch (error) {
17233
+ handleFetch.logError('Error fetching BigCommerce checkout data', error);
17234
+ return null;
17235
+ }
17236
+ };
17237
+ /**
17238
+ * Delete a consignment (a saved shipping selection, e.g. a domestic shipping
17239
+ * quote the shopper added on the cart page) from the active BigCommerce
17240
+ * checkout via the Storefront API. Cookie-authenticated (same-origin), so no
17241
+ * token is needed. Returns the updated checkout on success, or null on
17242
+ * failure.
17243
+ */
17244
+ const deleteBigCommerceConsignment = async (checkoutId, consignmentId) => {
17245
+ try {
17246
+ const response = await fetch(`/api/storefront/checkouts/${checkoutId}/consignments/${consignmentId}`, {
17247
+ credentials: 'same-origin',
17248
+ headers: {
17249
+ Accept: 'application/json',
17250
+ 'Content-Type': 'application/json',
17251
+ },
17252
+ method: 'DELETE',
17253
+ });
17254
+ if (!response.ok) {
17255
+ VarianceTest.log(`Failed to delete BigCommerce consignment: ${String(response.status)}`, 'error');
17256
+ return null;
17257
+ }
17258
+ return (await response.json());
17259
+ }
17260
+ catch (error) {
17261
+ handleFetch.logError('Error deleting BigCommerce consignment', error);
17262
+ return null;
17263
+ }
17264
+ };
17265
+ /**
17266
+ * Whether the BigCommerce shopper is already logged in. We key off the
17267
+ * customer's numeric `id` since the storefront API populates it only for
17268
+ * authenticated sessions (guest checkouts have an empty `customer` object).
17269
+ */
17270
+ const isBigCommerceCustomerLoggedIn = (checkout) => { var _a; return !!((_a = checkout === null || checkout === void 0 ? void 0 : checkout.customer) === null || _a === void 0 ? void 0 : _a.id); };
17271
+
17272
+ /**
17273
+ * Whether the Hello widget should be shown for the current shopper. This is the
17274
+ * single source of truth for Hello's visibility decision — the `zonos-hello`
17275
+ * component renders by it, and other features (e.g. BigCommerce cart shipping
17276
+ * cleanup) gate on it so their behavior stays in lockstep with what the shopper
17277
+ * actually sees.
17278
+ *
17279
+ * Resolves the configured `widgetVisibility` behavior (with the deprecated
17280
+ * `showForCountries` override) against the selected country and shipping-zone
17281
+ * state, then applies the include/exclude country overrides.
17282
+ *
17283
+ * @param showLog - emit a debug log when the shopper is not in a shipping zone.
17284
+ * Defaults to `true`; pass `false` from non-rendering callers to avoid log
17285
+ * noise.
17286
+ */
17287
+ const shouldShowHelloWidget = (showLog = true) => {
17288
+ var _a, _b;
17289
+ if (!localizationStore.localizationLoaded) {
17290
+ return false;
17291
+ }
17292
+ const { countryDisplayRules, showForCountries } = zonosStore.zonosStore.helloSettings;
17293
+ const visibilityRules = countryDisplayRules === null || countryDisplayRules === void 0 ? void 0 : countryDisplayRules.widgetVisibility;
17294
+ const selectedCountry = localizationStore.selectedCountryCode;
17295
+ // Resolve behavior: deprecated showForCountries overrides widgetVisibility.behavior
17296
+ // If showForCountries is an array of country codes, treat as legacy explicit list
17297
+ const behavior = Array.isArray(showForCountries)
17298
+ ? showForCountries
17299
+ : (showForCountries !== null && showForCountries !== void 0 ? showForCountries : visibilityRules === null || visibilityRules === void 0 ? void 0 : visibilityRules.behavior);
17300
+ if (showLog && !localizationStore.isShippableCountry) {
17301
+ VarianceTest.log(`Hello: not shippable country - Show for countries: ${behavior}`);
17302
+ }
17303
+ // Legacy: explicit list of country codes from deprecated showForCountries
17304
+ if (Array.isArray(behavior)) {
17305
+ return !!selectedCountry && behavior.includes(selectedCountry);
17306
+ }
17307
+ // Determine base visibility from behavior
17308
+ let isVisible;
17309
+ if (behavior === 'ALL') {
17310
+ isVisible = true;
17311
+ }
17312
+ else {
17313
+ // Default: ONLY_SHIPPABLE
17314
+ isVisible = localizationStore.isShippableCountry;
17315
+ }
17316
+ // Apply includedCountries — force show the widget for these countries
17317
+ if (!isVisible &&
17318
+ selectedCountry &&
17319
+ ((_a = visibilityRules === null || visibilityRules === void 0 ? void 0 : visibilityRules.includedCountries) === null || _a === void 0 ? void 0 : _a.includes(selectedCountry))) {
17320
+ isVisible = true;
17321
+ }
17322
+ // Apply excludedCountries — force hide the widget for these countries
17323
+ if (isVisible &&
17324
+ selectedCountry &&
17325
+ ((_b = visibilityRules === null || visibilityRules === void 0 ? void 0 : visibilityRules.excludedCountries) === null || _b === void 0 ? void 0 : _b.includes(selectedCountry))) {
17326
+ isVisible = false;
17327
+ }
17328
+ return isVisible;
17329
+ };
17330
+
17331
+ /**
17332
+ * Guard against overlapping passes. `removeBigcommerceCartShipping` is fired on
17333
+ * every country change; without this flag, rapid country switches could stack
17334
+ * concurrent fetch/DELETE cycles against the same cart before the reload kicks
17335
+ * in.
17336
+ */
17337
+ let isRemoving = false;
17338
+ /**
17339
+ * On the BigCommerce cart page, drop any native domestic shipping quote the
17340
+ * shopper added before they switched to an international country, then reload
17341
+ * the page.
17342
+ *
17343
+ * The native cart stores a shipping estimate as a consignment on the active
17344
+ * checkout. When Hello is shown the shopper is checking out internationally
17345
+ * through Zonos, so that domestic shipping cost should not linger in the Grand
17346
+ * Total. We delete the consignment(s) and reload so the server re-renders the
17347
+ * cart consistently (subtotal, shipping, and Grand Total all add up).
17348
+ *
17349
+ * No-ops unless all of the following hold: the host is BigCommerce, the shopper
17350
+ * is on the cart page, they are in a shipping zone with Hello shown, and the
17351
+ * active checkout actually has a consignment. Because the reload happens only
17352
+ * when a consignment is found and removed, the freshly-loaded page has none —
17353
+ * so this cannot loop.
17354
+ */
17355
+ const removeBigcommerceCartShipping = async () => {
17356
+ var _a, _b;
17357
+ if (typeof window === 'undefined' || !((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.isBigCommerce)) {
17358
+ return;
17359
+ }
17360
+ // Only on the cart page and only when Hello is shown — elsewhere there is no
17361
+ // Grand Total to correct. Gate on Hello visibility (not raw shipping-zone
17362
+ // membership) so include/exclude country overrides are respected.
17363
+ if (window.location.pathname !== '/cart.php' ||
17364
+ !localizationStore.isShippableCountry ||
17365
+ !shouldShowHelloWidget(false)) {
17366
+ return;
17367
+ }
17368
+ if (isRemoving) {
17369
+ return;
17370
+ }
17371
+ isRemoving = true;
17372
+ try {
17373
+ const checkoutId = await fetchCheckoutId();
17374
+ if (!checkoutId) {
17375
+ return;
17376
+ }
17377
+ const checkout = await fetchBigCommerceCheckout(checkoutId);
17378
+ const consignmentIds = ((_b = checkout === null || checkout === void 0 ? void 0 : checkout.consignments) !== null && _b !== void 0 ? _b : [])
17379
+ .map(consignment => consignment.id)
17380
+ .filter((id) => !!id);
17381
+ // Nothing to do if there is no domestic shipping quote on the cart.
17382
+ if (!consignmentIds.length) {
17383
+ return;
17384
+ }
17385
+ VarianceTest.log(`Removing ${String(consignmentIds.length)} BigCommerce cart consignment(s) for international shopper`, 'info');
17386
+ // `deleteBigCommerceConsignment` resolves to null on failure (it swallows
17387
+ // the error and logs it), so a non-null result means that consignment was
17388
+ // actually removed.
17389
+ const deleteResults = await Promise.all(consignmentIds.map(consignmentId => deleteBigCommerceConsignment(checkoutId, consignmentId)));
17390
+ const removedCount = deleteResults.filter(Boolean).length;
17391
+ // Only reload when at least one consignment was actually removed. If every
17392
+ // DELETE failed, reloading would re-run this on init with the same
17393
+ // consignments still present and trap the shopper in a reload loop.
17394
+ if (!removedCount) {
17395
+ VarianceTest.log('No BigCommerce cart consignments were removed; skipping reload to avoid a reload loop', 'warn');
17396
+ return;
17397
+ }
17398
+ // Reload so the server re-renders the cart consistently without the removed
17399
+ // shipping, instead of surgically patching the DOM total.
17400
+ window.location.reload();
17401
+ }
17402
+ catch (error) {
17403
+ handleFetch.logError('Error removing BigCommerce cart shipping consignment', error);
17404
+ }
17405
+ finally {
17406
+ isRemoving = false;
17407
+ }
17408
+ };
17409
+
17187
17410
  const applyInclusiveEffectiveRate = (amount) => {
17188
17411
  const inclusivePrice = localizationStore.inclusivePricingConfigurations.find(x => x.shipToCountry === localizationStore.selectedCountryCode);
17189
17412
  if (!inclusivePrice) {
@@ -17574,7 +17797,7 @@ const toggleBigcommerceNativeCurrencySelector = () => {
17574
17797
  return;
17575
17798
  }
17576
17799
  const bigcommerceCurrencyCode = document.body.dataset.currencyCode;
17577
- const shouldHide = localizationStore.isShippableCountry &&
17800
+ const shouldHide = (shouldShowHelloWidget(false) || localizationStore.isShippableCountry) &&
17578
17801
  !!bigcommerceCurrencyCode &&
17579
17802
  bigcommerceCurrencyCode === zonosStore.zonosStore.sourceCurrency;
17580
17803
  try {
@@ -17759,6 +17982,11 @@ const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelecte
17759
17982
  // because `currencyDisplay` is also invoked from the price-mutation
17760
17983
  // observer in `zonos-hello.tsx`, which fires on every DOM render.
17761
17984
  toggleBigcommerceNativeCurrencySelector();
17985
+ // On the BigCommerce cart page, drop any native domestic shipping quote the
17986
+ // shopper added before switching to an international country so the Grand
17987
+ // Total reflects only subtotal + coupon. No-ops off-cart, off-BigCommerce,
17988
+ // for non-shippable countries, or when the cart has no consignment.
17989
+ void removeBigcommerceCartShipping();
17762
17990
  if (!selectedCountryCode) {
17763
17991
  return;
17764
17992
  }
@@ -17936,7 +18164,12 @@ const initLocalizationStore = async () => {
17936
18164
  newSelectedCountryCode: 'CA',
17937
18165
  });
17938
18166
  }
17939
- localizationStore.localizationLoaded = true;
18167
+ if (!localizationStore.localizationLoaded) {
18168
+ localizationStore.localizationLoaded = true;
18169
+ void removeBigcommerceCartShipping();
18170
+ // shouldShowHelloWidget is false because localization is not loaded yet
18171
+ void toggleBigcommerceNativeCurrencySelector();
18172
+ }
17940
18173
  };
17941
18174
 
17942
18175
  exports.VARIANT_TEST_KEY_EXPIRATION = VARIANT_TEST_KEY_EXPIRATION;
@@ -17945,17 +18178,21 @@ exports.currencyConvert = currencyConvert;
17945
18178
  exports.currencyConvertAndFormat = currencyConvertAndFormat;
17946
18179
  exports.currencyDisplay = currencyDisplay;
17947
18180
  exports.currencyFormat = currencyFormat;
18181
+ exports.fetchBigCommerceCheckout = fetchBigCommerceCheckout;
18182
+ exports.fetchCheckoutId = fetchCheckoutId;
17948
18183
  exports.filterValidTests = filterValidTests;
17949
18184
  exports.getFallbackDefaultCountryCode = getFallbackDefaultCountryCode;
17950
18185
  exports.getOverridenZCountry = getOverridenZCountry;
17951
18186
  exports.getZCountryUrlParam = getZCountryUrlParam;
17952
18187
  exports.initLocalizationStore = initLocalizationStore;
18188
+ exports.isBigCommerceCustomerLoggedIn = isBigCommerceCustomerLoggedIn;
17953
18189
  exports.isValidSelector = isValidSelector;
17954
18190
  exports.localizationStore = localizationStore;
17955
18191
  exports.localizationStoreOnChange = localizationStoreOnChange;
17956
18192
  exports.localizationStoreUpdateSelectedCountryCode = localizationStoreUpdateSelectedCountryCode;
17957
18193
  exports.localizationStoreUpdateSelectedLocale = localizationStoreUpdateSelectedLocale;
17958
18194
  exports.setZCountryUrlParam = setZCountryUrlParam;
18195
+ exports.shouldShowHelloWidget = shouldShowHelloWidget;
17959
18196
  exports.storageStore = storageStore;
17960
18197
  exports.storageStoreOnChange = storageStoreOnChange;
17961
18198
  exports.storageStoreSetEnabledVariantTestKeys = storageStoreSetEnabledVariantTestKeys;
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-45a87908.js');
4
- const cart = require('./cart-af7c024e.js');
5
- const localization = require('./localization-f897bc45.js');
4
+ const cart = require('./cart-87fbbb5a.js');
5
+ const localization = require('./localization-a969f224.js');
6
6
  const handleFetch = require('./handleFetch-954f30e1.js');
7
7
  const isContrastColor = require('./isContrastColor-76592c92.js');
8
8
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const cart = require('./cart-af7c024e.js');
4
- const localization = require('./localization-f897bc45.js');
3
+ const cart = require('./cart-87fbbb5a.js');
4
+ const localization = require('./localization-a969f224.js');
5
5
  const handleFetch = require('./handleFetch-954f30e1.js');
6
6
 
7
7
  const placeTestOrder = async () => {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const cart = require('./cart-af7c024e.js');
4
- const localization = require('./localization-f897bc45.js');
3
+ const cart = require('./cart-87fbbb5a.js');
4
+ const localization = require('./localization-a969f224.js');
5
5
 
6
6
  const getDisplayCurrency = () => {
7
7
  var _a, _b;
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const localization = require('./localization-f897bc45.js');
6
+ const localization = require('./localization-a969f224.js');
7
7
  const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
8
- const cart = require('./cart-af7c024e.js');
8
+ const cart = require('./cart-87fbbb5a.js');
9
9
  const classes = require('./classes-b7918f56.js');
10
10
  const getBorderRadius = require('./getBorderRadius-fc683d94.js');
11
11
  const zonosStore = require('./zonosStore-45a87908.js');
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
6
  const throttle = require('./throttle-02c2e917.js');
7
- const cart = require('./cart-af7c024e.js');
8
- const localization = require('./localization-f897bc45.js');
7
+ const cart = require('./cart-87fbbb5a.js');
8
+ const localization = require('./localization-a969f224.js');
9
9
  const zonosStore = require('./zonosStore-45a87908.js');
10
10
  const handleFetch = require('./handleFetch-954f30e1.js');
11
11
  const shouldRenderTaxIdInput = require('./shouldRenderTaxIdInput-b8abf6de.js');
@@ -6,10 +6,10 @@ const index = require('./index-b1f95d96.js');
6
6
  const zonosStore = require('./zonosStore-45a87908.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
  const getBorderRadius = require('./getBorderRadius-fc683d94.js');
9
- const cart = require('./cart-af7c024e.js');
10
- const localization = require('./localization-f897bc45.js');
9
+ const cart = require('./cart-87fbbb5a.js');
10
+ const localization = require('./localization-a969f224.js');
11
11
  const handleFetch = require('./handleFetch-954f30e1.js');
12
- const paypal = require('./paypal-6756a0da.js');
12
+ const paypal = require('./paypal-cfe1e8e9.js');
13
13
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
14
14
  require('./isDarkColor-5d6ca405.js');
15
15
  require('./isContrastColor-76592c92.js');
@@ -3,20 +3,20 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const cart = require('./cart-af7c024e.js');
7
- const localization = require('./localization-f897bc45.js');
8
- const renderCheckoutCurrency = require('./renderCheckoutCurrency-584d50fe.js');
6
+ const cart = require('./cart-87fbbb5a.js');
7
+ const localization = require('./localization-a969f224.js');
8
+ const renderCheckoutCurrency = require('./renderCheckoutCurrency-5a333d29.js');
9
9
  const cleanHtmlMarkdown = require('./cleanHtmlMarkdown-31da84b7.js');
10
10
  const classes = require('./classes-b7918f56.js');
11
11
  const zonosStore = require('./zonosStore-45a87908.js');
12
- const hasInclusivePrice = require('./hasInclusivePrice-0fa6e022.js');
13
- const paypal = require('./paypal-6756a0da.js');
12
+ const hasInclusivePrice = require('./hasInclusivePrice-c86ed1f5.js');
13
+ const paypal = require('./paypal-cfe1e8e9.js');
14
14
  const handleFetch = require('./handleFetch-954f30e1.js');
15
15
  const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
16
16
  const getBorderRadius = require('./getBorderRadius-fc683d94.js');
17
17
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
18
18
  const ILanguage = require('./ILanguage-98b04442.js');
19
- const placeTestOrder = require('./placeTestOrder-a4874e51.js');
19
+ const placeTestOrder = require('./placeTestOrder-613878fb.js');
20
20
  const isDarkColor = require('./isDarkColor-5d6ca405.js');
21
21
  const getContrastColor = require('./getContrastColor-d5134ef3.js');
22
22
  const isColorVariable = require('./isColorVariable-525dbfa7.js');
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const cart = require('./cart-af7c024e.js');
7
- const paypal = require('./paypal-6756a0da.js');
8
- const localization = require('./localization-f897bc45.js');
6
+ const cart = require('./cart-87fbbb5a.js');
7
+ const paypal = require('./paypal-cfe1e8e9.js');
8
+ const localization = require('./localization-a969f224.js');
9
9
  const zonosStore = require('./zonosStore-45a87908.js');
10
10
  const buildCartItemsByTempCart = require('./buildCartItemsByTempCart-edddbf4b.js');
11
11
  const handleFetch = require('./handleFetch-954f30e1.js');
@@ -97,63 +97,6 @@ const buildCartUrl = ({ cartId, checkoutSessionId, customerAddress1, customerAdd
97
97
  return `${hostedCheckoutUrl}?${urlParams.toString()}`;
98
98
  };
99
99
 
100
- /**
101
- * Fetch the checkout/cart ID from the BigCommerce Storefront Cart API.
102
- * The `/checkout` page URL does not include the checkout ID, so we
103
- * retrieve it from `/api/storefront/cart` which returns the active cart(s).
104
- */
105
- const fetchCheckoutId = async () => {
106
- var _a, _b;
107
- try {
108
- const response = await fetch('/api/storefront/cart', {
109
- credentials: 'same-origin',
110
- headers: {
111
- Accept: 'application/json',
112
- },
113
- });
114
- if (!response.ok) {
115
- VarianceTest.log(`Failed to fetch BigCommerce cart: ${String(response.status)}`, 'error');
116
- return null;
117
- }
118
- const carts = (await response.json());
119
- return (_b = (_a = carts === null || carts === void 0 ? void 0 : carts[0]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : null;
120
- }
121
- catch (error) {
122
- handleFetch.logError('Error fetching BigCommerce cart data', error);
123
- return null;
124
- }
125
- };
126
- /**
127
- * Fetch checkout data from the BigCommerce Storefront API.
128
- * This API is cookie-authenticated (same-origin), so no token is needed.
129
- */
130
- const fetchBigCommerceCheckout = async (checkoutId) => {
131
- try {
132
- const response = await fetch(`/api/storefront/checkouts/${checkoutId}?include=customer.customerGroup,customer.addresses`, {
133
- credentials: 'same-origin',
134
- headers: {
135
- Accept: 'application/json',
136
- 'Content-Type': 'application/json',
137
- },
138
- });
139
- if (!response.ok) {
140
- VarianceTest.log(`Failed to fetch BigCommerce checkout: ${String(response.status)}`, 'error');
141
- return null;
142
- }
143
- return (await response.json());
144
- }
145
- catch (error) {
146
- handleFetch.logError('Error fetching BigCommerce checkout data', error);
147
- return null;
148
- }
149
- };
150
- /**
151
- * Whether the BigCommerce shopper is already logged in. We key off the
152
- * customer's numeric `id` since the storefront API populates it only for
153
- * authenticated sessions (guest checkouts have an empty `customer` object).
154
- */
155
- const isBigCommerceCustomerLoggedIn = (checkout) => { var _a; return !!((_a = checkout === null || checkout === void 0 ? void 0 : checkout.customer) === null || _a === void 0 ? void 0 : _a.id); };
156
-
157
100
  /**
158
101
  * The query flag that BigCommerce carries back to `cart.php` after the
159
102
  * shopper logs in. When present, Zonos-elements knows to resume the
@@ -270,7 +213,7 @@ const fetchBypassOutcome = async (preFetched) => {
270
213
  // caller-supplied data when available.
271
214
  const checkoutId = preFetched
272
215
  ? preFetched.checkoutId
273
- : await fetchCheckoutId();
216
+ : await localization.fetchCheckoutId();
274
217
  if (!checkoutId) {
275
218
  // No active cart yet — inconclusive. Common on fresh sessions where
276
219
  // `initBigCommerceBypassCheck` runs before the user has added anything
@@ -280,7 +223,7 @@ const fetchBypassOutcome = async (preFetched) => {
280
223
  }
281
224
  const checkout = preFetched
282
225
  ? preFetched.checkout
283
- : await fetchBigCommerceCheckout(checkoutId);
226
+ : await localization.fetchBigCommerceCheckout(checkoutId);
284
227
  if (!checkout) {
285
228
  // API call failed (network error, non-200, etc.) — inconclusive.
286
229
  // Caching this would permanently disable bypass for the session if
@@ -535,7 +478,7 @@ const checkBigCommerceForceLogin = async ({ preFetched, } = {}) => {
535
478
  }
536
479
  const checkoutId = preFetched
537
480
  ? preFetched.checkoutId
538
- : await fetchCheckoutId();
481
+ : await localization.fetchCheckoutId();
539
482
  if (!checkoutId) {
540
483
  // No active cart — nothing to protect. Force-login only matters once
541
484
  // the shopper has a cart we're about to carry into Zonos checkout.
@@ -543,7 +486,7 @@ const checkBigCommerceForceLogin = async ({ preFetched, } = {}) => {
543
486
  }
544
487
  const checkout = preFetched
545
488
  ? preFetched.checkout
546
- : await fetchBigCommerceCheckout(checkoutId);
489
+ : await localization.fetchBigCommerceCheckout(checkoutId);
547
490
  if (!checkout) {
548
491
  // Storefront API failure — fail open so a transient outage doesn't
549
492
  // block the shopper. The merchant's BC checkout will still enforce
@@ -551,7 +494,7 @@ const checkBigCommerceForceLogin = async ({ preFetched, } = {}) => {
551
494
  VarianceTest.log('BigCommerce force-login check: failed to fetch checkout data, allowing flow to continue', 'info');
552
495
  return SKIP;
553
496
  }
554
- if (isBigCommerceCustomerLoggedIn(checkout)) {
497
+ if (localization.isBigCommerceCustomerLoggedIn(checkout)) {
555
498
  return SKIP;
556
499
  }
557
500
  VarianceTest.log('BigCommerce force-login check: guest shopper on no-guest-checkout store, redirecting to /login.php', 'info');
@@ -768,11 +711,11 @@ const checkLoggedInUserShippingAddress = async ({ onInternationalCheckoutSelecte
768
711
  // function always needs the checkout for the address check, so reusing one
769
712
  // fetch avoids the earlier 4x round-trip fan-out where bypass, address
770
713
  // lookup, and force-login each fetched independently.
771
- const checkoutId = await fetchCheckoutId();
714
+ const checkoutId = await localization.fetchCheckoutId();
772
715
  if (!checkoutId) {
773
716
  return 'noAction';
774
717
  }
775
- const checkout = await fetchBigCommerceCheckout(checkoutId);
718
+ const checkout = await localization.fetchBigCommerceCheckout(checkoutId);
776
719
  const preFetched = { checkout, checkoutId };
777
720
  // Check if the customer belongs to a bypass group (e.g. resellers) before
778
721
  // redirecting them away from BigCommerce native checkout. This delegates to
@@ -874,9 +817,9 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
874
817
  // changes — prevents stale customer-group data from a cached fetch. Share
875
818
  // one fetch between the bypass and force-login decisions so this poll
876
819
  // tick does 2 Storefront API round trips instead of 4.
877
- const checkoutId = await fetchCheckoutId();
820
+ const checkoutId = await localization.fetchCheckoutId();
878
821
  const checkout = checkoutId
879
- ? await fetchBigCommerceCheckout(checkoutId)
822
+ ? await localization.fetchBigCommerceCheckout(checkoutId)
880
823
  : null;
881
824
  const preFetched = { checkout, checkoutId };
882
825
  const { shouldBypass } = await checkBigCommerceBypassCustomerGroup({
@@ -1640,12 +1583,12 @@ const ZonosCheckout = class {
1640
1583
  if (hasManualDefault) {
1641
1584
  return;
1642
1585
  }
1643
- const checkoutId = await fetchCheckoutId();
1586
+ const checkoutId = await localization.fetchCheckoutId();
1644
1587
  if (!checkoutId) {
1645
1588
  return;
1646
1589
  }
1647
- const checkout = await fetchBigCommerceCheckout(checkoutId);
1648
- if (!isBigCommerceCustomerLoggedIn(checkout)) {
1590
+ const checkout = await localization.fetchBigCommerceCheckout(checkoutId);
1591
+ if (!localization.isBigCommerceCustomerLoggedIn(checkout)) {
1649
1592
  return;
1650
1593
  }
1651
1594
  const addresses = getBigCommerceCustomerAddresses(checkout, {
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const cart = require('./cart-af7c024e.js');
6
+ const cart = require('./cart-87fbbb5a.js');
7
7
  const cleanHtmlMarkdown = require('./cleanHtmlMarkdown-31da84b7.js');
8
8
  const zonosStore = require('./zonosStore-45a87908.js');
9
9
  const classes = require('./classes-b7918f56.js');
10
10
  const styles = require('./styles-d1e64fb9.js');
11
- require('./localization-f897bc45.js');
11
+ require('./localization-a969f224.js');
12
12
  require('./handleFetch-954f30e1.js');
13
13
  require('./VarianceTest-bec00ea8.js');
14
14
  require('./isDarkColor-5d6ca405.js');