@zonos/elements 1.3.192 → 1.3.194

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 (179) hide show
  1. package/dist/cjs/{cart-27f6c7a4.js → cart-bc882927.js} +3 -3
  2. package/dist/cjs/{debounce-3eaa4f7e.js → debounce-d393fafe.js} +1 -1
  3. package/dist/cjs/{getBorderRadius-87f3b69c.js → getBorderRadius-3d0a563e.js} +1 -1
  4. package/dist/cjs/index.cjs.js +7 -7
  5. package/dist/cjs/{isDarkColor-d0c67c3d.js → isDarkColor-92a10a85.js} +1 -1
  6. package/dist/cjs/{paypal-84d83a76.js → paypal-608fa681.js} +3 -3
  7. package/dist/cjs/{containsNonLatinChars-2be5129b.js → shouldRenderTaxIdInput-9b8a8de1.js} +23 -0
  8. package/dist/cjs/zonos-address_11.cjs.entry.js +53 -25
  9. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  12. package/dist/cjs/zonos-card.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +30 -13
  14. package/dist/cjs/zonos-checkout.cjs.entry.js +5 -5
  15. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  16. package/dist/cjs/zonos-controller.cjs.entry.js +4 -4
  17. package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -4
  18. package/dist/cjs/zonos-country-select_4.cjs.entry.js +4 -4
  19. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +5 -5
  20. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +4 -4
  21. package/dist/cjs/zonos-hello.cjs.entry.js +5 -5
  22. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  23. package/dist/cjs/zonos-language-select_2.cjs.entry.js +4 -4
  24. package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
  25. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
  26. package/dist/cjs/zonos-stripe-input.cjs.entry.js +3 -3
  27. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  28. package/dist/cjs/zonos-toggle.cjs.entry.js +1 -1
  29. package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
  30. package/dist/cjs/{zonosStore-adc42868.js → zonosStore-c466b127.js} +1 -0
  31. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +6 -2
  32. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +8 -6
  33. package/dist/collection/components/store/zonosStore.js +1 -0
  34. package/dist/collection/components/stripe/zonos-address/zonos-address.js +18 -3
  35. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +18 -4
  36. package/dist/collection/components/utils/checkout/shouldRenderTaxIdInput.js +20 -0
  37. package/dist/collection/components/utils/taxIdValidationResult.js +18 -4
  38. package/dist/collection/types/generated/graphql.internal.types.js +13 -0
  39. package/dist/esm/{cart-f5c12be6.js → cart-2f0ee51d.js} +3 -3
  40. package/dist/esm/{debounce-3cf0793c.js → debounce-a2121722.js} +1 -1
  41. package/dist/esm/{getBorderRadius-a9a48f79.js → getBorderRadius-413e97eb.js} +1 -1
  42. package/dist/esm/index.js +7 -7
  43. package/dist/esm/{isDarkColor-62cbddb5.js → isDarkColor-4c7b2ffc.js} +1 -1
  44. package/dist/esm/{paypal-594f49e9.js → paypal-3ecdf234.js} +3 -3
  45. package/dist/esm/{containsNonLatinChars-2d8810c3.js → shouldRenderTaxIdInput-8bc112bb.js} +23 -1
  46. package/dist/esm/zonos-address_11.entry.js +47 -19
  47. package/dist/esm/zonos-badge.entry.js +1 -1
  48. package/dist/esm/zonos-banner.entry.js +1 -1
  49. package/dist/esm/zonos-button_3.entry.js +3 -3
  50. package/dist/esm/zonos-card.entry.js +2 -2
  51. package/dist/esm/zonos-cart-items_13.entry.js +29 -12
  52. package/dist/esm/zonos-checkout.entry.js +5 -5
  53. package/dist/esm/zonos-collapse.entry.js +1 -1
  54. package/dist/esm/zonos-controller.entry.js +4 -4
  55. package/dist/esm/zonos-country-flag.entry.js +4 -4
  56. package/dist/esm/zonos-country-select_4.entry.js +4 -4
  57. package/dist/esm/zonos-empty-state-payment_4.entry.js +5 -5
  58. package/dist/esm/zonos-hello-dialog.entry.js +4 -4
  59. package/dist/esm/zonos-hello.entry.js +5 -5
  60. package/dist/esm/zonos-input.entry.js +2 -2
  61. package/dist/esm/zonos-language-select_2.entry.js +4 -4
  62. package/dist/esm/zonos-logo.entry.js +1 -1
  63. package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
  64. package/dist/esm/zonos-stripe-input.entry.js +3 -3
  65. package/dist/esm/zonos-text.entry.js +1 -1
  66. package/dist/esm/zonos-toggle.entry.js +1 -1
  67. package/dist/esm/zonos-v-stack.entry.js +1 -1
  68. package/dist/esm/{zonosStore-1ce34e04.js → zonosStore-cdabc848.js} +1 -0
  69. package/dist/esm-es5/{cart-f5c12be6.js → cart-2f0ee51d.js} +1 -1
  70. package/dist/esm-es5/{debounce-3cf0793c.js → debounce-a2121722.js} +1 -1
  71. package/dist/esm-es5/{getBorderRadius-a9a48f79.js → getBorderRadius-413e97eb.js} +1 -1
  72. package/dist/esm-es5/index.js +1 -1
  73. package/dist/esm-es5/{isDarkColor-62cbddb5.js → isDarkColor-4c7b2ffc.js} +1 -1
  74. package/dist/esm-es5/{paypal-594f49e9.js → paypal-3ecdf234.js} +1 -1
  75. package/dist/esm-es5/shouldRenderTaxIdInput-8bc112bb.js +1 -0
  76. package/dist/esm-es5/zonos-address_11.entry.js +1 -1
  77. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  78. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  79. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  80. package/dist/esm-es5/zonos-card.entry.js +1 -1
  81. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  82. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  83. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  84. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  85. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  86. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  87. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  88. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  89. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  90. package/dist/esm-es5/zonos-input.entry.js +1 -1
  91. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  92. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  93. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  94. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  95. package/dist/esm-es5/zonos-text.entry.js +1 -1
  96. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  97. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  98. package/dist/esm-es5/{zonosStore-1ce34e04.js → zonosStore-cdabc848.js} +1 -1
  99. package/dist/scripts/index.d.ts +10 -0
  100. package/dist/scripts/index.js +1 -1
  101. package/dist/scripts/loadZonos.js +1 -1
  102. package/dist/scripts/zonos.js +1 -1
  103. package/dist/types/components/utils/checkout/shouldRenderTaxIdInput.d.ts +7 -0
  104. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +1 -0
  105. package/dist/types/types/checkout/CheckoutConfig.d.ts +4 -0
  106. package/dist/types/types/generated/graphql.internal.types.d.ts +18 -0
  107. package/dist/types/types/generated/graphql.internal.types.ts +24 -0
  108. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  109. package/dist/zonos-elements/index.esm.js +1 -1
  110. package/dist/zonos-elements/p-02787d8c.entry.js +1 -0
  111. package/dist/zonos-elements/{p-31e90130.system.js → p-06ed3582.system.js} +1 -1
  112. package/dist/zonos-elements/{p-315d8e78.system.entry.js → p-0fe6efef.system.entry.js} +1 -1
  113. package/dist/zonos-elements/{p-83a7ece6.system.entry.js → p-127deab4.system.entry.js} +1 -1
  114. package/dist/zonos-elements/{p-53ffdb91.js → p-13796f98.js} +1 -1
  115. package/dist/zonos-elements/{p-313ef896.entry.js → p-147ca395.entry.js} +1 -1
  116. package/dist/zonos-elements/{p-e99354d5.entry.js → p-1eddec23.entry.js} +1 -1
  117. package/dist/zonos-elements/{p-1146b6e0.entry.js → p-23752a7e.entry.js} +1 -1
  118. package/dist/zonos-elements/{p-f3f27bf2.system.entry.js → p-24a2e899.system.entry.js} +1 -1
  119. package/dist/zonos-elements/{p-657390e6.js → p-264e7688.js} +1 -1
  120. package/dist/zonos-elements/{p-f7d3e48b.entry.js → p-2882b9f4.entry.js} +1 -1
  121. package/dist/zonos-elements/{p-d7b5b237.js → p-2f34e29a.js} +1 -1
  122. package/dist/zonos-elements/{p-94a80d93.system.entry.js → p-33488109.system.entry.js} +1 -1
  123. package/dist/zonos-elements/p-337fab4e.js +1 -0
  124. package/dist/zonos-elements/{p-682e09fc.system.entry.js → p-39e369f6.system.entry.js} +1 -1
  125. package/dist/zonos-elements/{p-678ccc3f.system.entry.js → p-3ddecaa4.system.entry.js} +1 -1
  126. package/dist/zonos-elements/{p-9aa94d71.system.entry.js → p-3e15061e.system.entry.js} +1 -1
  127. package/dist/zonos-elements/{p-2097fae5.js → p-4593324c.js} +1 -1
  128. package/dist/zonos-elements/{p-23975acb.system.entry.js → p-48f70043.system.entry.js} +1 -1
  129. package/dist/zonos-elements/{p-77654589.entry.js → p-4931d780.entry.js} +1 -1
  130. package/dist/zonos-elements/{p-db3f6d6e.system.entry.js → p-4abc1b34.system.entry.js} +1 -1
  131. package/dist/zonos-elements/{p-46d3e378.system.entry.js → p-55711b80.system.entry.js} +1 -1
  132. package/dist/zonos-elements/{p-03bbd1af.entry.js → p-578bf5d7.entry.js} +1 -1
  133. package/dist/zonos-elements/{p-1e612c29.entry.js → p-5c061a35.entry.js} +1 -1
  134. package/dist/zonos-elements/p-5d7c9ac3.entry.js +1 -0
  135. package/dist/zonos-elements/{p-67b904c2.entry.js → p-6096c1c5.entry.js} +1 -1
  136. package/dist/zonos-elements/{p-7bed199d.entry.js → p-649d3e92.entry.js} +1 -1
  137. package/dist/zonos-elements/{p-e2d45b2e.system.js → p-6a31eb14.system.js} +1 -1
  138. package/dist/zonos-elements/{p-5f896e9a.entry.js → p-6adc6e27.entry.js} +1 -1
  139. package/dist/zonos-elements/{p-97e330cd.entry.js → p-6b2358f2.entry.js} +1 -1
  140. package/dist/zonos-elements/{p-0dae66d2.entry.js → p-6ccb1b13.entry.js} +1 -1
  141. package/dist/zonos-elements/p-78a6e775.system.js +1 -0
  142. package/dist/zonos-elements/{p-aca3a2bb.entry.js → p-7bb9c330.entry.js} +1 -1
  143. package/dist/zonos-elements/{p-1b29bc5f.system.entry.js → p-8a9d4605.system.entry.js} +1 -1
  144. package/dist/zonos-elements/{p-3707564c.entry.js → p-8df9a41b.entry.js} +1 -1
  145. package/dist/zonos-elements/{p-2416aaa1.system.entry.js → p-94e3e50d.system.entry.js} +1 -1
  146. package/dist/zonos-elements/{p-eeaff898.system.entry.js → p-9e27aaff.system.entry.js} +1 -1
  147. package/dist/zonos-elements/{p-abc66a0b.entry.js → p-9f6dd86a.entry.js} +1 -1
  148. package/dist/zonos-elements/p-a2df5a4b.system.entry.js +1 -0
  149. package/dist/zonos-elements/{p-0fdd7034.system.entry.js → p-a64ab131.system.entry.js} +1 -1
  150. package/dist/zonos-elements/{p-35f33601.system.entry.js → p-aac95779.system.entry.js} +1 -1
  151. package/dist/zonos-elements/{p-443b5db2.entry.js → p-ad3c5358.entry.js} +1 -1
  152. package/dist/zonos-elements/{p-b5edee66.system.js → p-af6af82e.system.js} +1 -1
  153. package/dist/zonos-elements/{p-f4cc688e.system.entry.js → p-b6afcf3f.system.entry.js} +1 -1
  154. package/dist/zonos-elements/{p-17299200.js → p-b8d87932.js} +1 -1
  155. package/dist/zonos-elements/{p-81ee1683.entry.js → p-b8d91f99.entry.js} +1 -1
  156. package/dist/zonos-elements/{p-c140a0bd.system.entry.js → p-c770044a.system.entry.js} +1 -1
  157. package/dist/zonos-elements/p-c7f0941d.system.entry.js +1 -0
  158. package/dist/zonos-elements/{p-b610f70c.system.js → p-d422ad1d.system.js} +1 -1
  159. package/dist/zonos-elements/{p-89fcd305.system.entry.js → p-d4842d10.system.entry.js} +1 -1
  160. package/dist/zonos-elements/{p-4d1269a7.entry.js → p-dc1b3bcb.entry.js} +1 -1
  161. package/dist/zonos-elements/{p-f1f765fc.system.js → p-de47028a.system.js} +1 -1
  162. package/dist/zonos-elements/{p-3831dab5.system.js → p-de73fec0.system.js} +1 -1
  163. package/dist/zonos-elements/{p-a09f64e1.entry.js → p-e275d241.entry.js} +1 -1
  164. package/dist/zonos-elements/p-ea6d87a1.system.js +1 -1
  165. package/dist/zonos-elements/p-eeb1081e.js +1 -0
  166. package/dist/zonos-elements/{p-bbbaea3a.system.js → p-f28eb1dd.system.js} +1 -1
  167. package/dist/zonos-elements/{p-d0f4b6c3.entry.js → p-f6e587bb.entry.js} +1 -1
  168. package/dist/zonos-elements/{p-3d130579.system.entry.js → p-f8253ae4.system.entry.js} +1 -1
  169. package/dist/zonos-elements/{p-751bfce8.system.entry.js → p-fccf8c66.system.entry.js} +1 -1
  170. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  171. package/package.json +1 -1
  172. package/dist/esm-es5/containsNonLatinChars-2d8810c3.js +0 -1
  173. package/dist/zonos-elements/p-0347d209.entry.js +0 -1
  174. package/dist/zonos-elements/p-0c64dbbb.js +0 -1
  175. package/dist/zonos-elements/p-2670438c.system.js +0 -1
  176. package/dist/zonos-elements/p-5e46a2b2.system.entry.js +0 -1
  177. package/dist/zonos-elements/p-be83c06e.entry.js +0 -1
  178. package/dist/zonos-elements/p-df695903.system.entry.js +0 -1
  179. package/dist/zonos-elements/p-e892fb29.js +0 -1
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const zonosStore = require('./zonosStore-adc42868.js');
3
+ const zonosStore = require('./zonosStore-c466b127.js');
4
4
  const handleFetch = require('./handleFetch-969d05d8.js');
5
- const isDarkColor = require('./isDarkColor-d0c67c3d.js');
6
- const getBorderRadius = require('./getBorderRadius-87f3b69c.js');
5
+ const isDarkColor = require('./isDarkColor-92a10a85.js');
6
+ const getBorderRadius = require('./getBorderRadius-3d0a563e.js');
7
7
 
8
8
  const stringsArabic = {
9
9
  ' (Duties due at door)': {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const zonosStore = require('./zonosStore-adc42868.js');
3
+ const zonosStore = require('./zonosStore-c466b127.js');
4
4
 
5
5
  var root = zonosStore._root;
6
6
 
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const zonosStore = require('./zonosStore-adc42868.js');
3
+ const zonosStore = require('./zonosStore-c466b127.js');
4
4
 
5
5
  /**
6
6
  * Get the border radius for the elements based on the style
@@ -131,7 +131,7 @@ const getZonosQaUrl = () => {
131
131
  return null;
132
132
  }
133
133
  const qaUrl = extractZonosQaUrl(window.location.href);
134
- const cdnUrl = "https://v1.3.192.js.zonos.com";
134
+ const cdnUrl = "https://v1.3.194.js.zonos.com";
135
135
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
136
136
  if (!qaUrl &&
137
137
  (cdnUrl.includes('test.') ||
@@ -372,10 +372,10 @@ const zonosLoadUrl = (() => {
372
372
  }
373
373
  return null;
374
374
  })();
375
- const ZONOS_URL = "https://v1.3.192.js.zonos.com";
376
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.192";
377
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.192";
378
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.192";
375
+ const ZONOS_URL = "https://v1.3.194.js.zonos.com";
376
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.194";
377
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.194";
378
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.194";
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 = "1745964248308";
396
+ Zonos.releaseDate = "1746221316172";
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.192"}`;
414
+ Zonos.version = `v${"1.3.194"}`;
415
415
  Zonos.modeAlerted = false;
416
416
  Zonos.cartData = null;
417
417
  Zonos.paypal = null;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const zonosStore = require('./zonosStore-adc42868.js');
3
+ const zonosStore = require('./zonosStore-c466b127.js');
4
4
 
5
5
  var tinycolor$1 = {exports: {}};
6
6
 
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const zonosStore = require('./zonosStore-adc42868.js');
4
- const cart = require('./cart-27f6c7a4.js');
3
+ const zonosStore = require('./zonosStore-c466b127.js');
4
+ const cart = require('./cart-bc882927.js');
5
5
  const handleFetch = require('./handleFetch-969d05d8.js');
6
- const isDarkColor = require('./isDarkColor-d0c67c3d.js');
6
+ const isDarkColor = require('./isDarkColor-92a10a85.js');
7
7
 
8
8
  /*!
9
9
  * paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ const TaxId = require('./TaxId-12acedde.js');
4
+
3
5
  const isTextContainsNonLatinChars = (text) => {
4
6
  const specialCharacters = /[ʼˮ՚ߴߵ']{1}/u;
5
7
  /**
@@ -20,5 +22,26 @@ const containsNonLatinChars = (params) => {
20
22
  return nonLatinValueList;
21
23
  };
22
24
 
25
+ const isInTaxIdCountry = (countryCode) => {
26
+ return TaxId.countryRequireTaxId.includes(countryCode);
27
+ };
28
+ /**
29
+ * Checks if the tax ID input should be rendered based on the company name and country code.
30
+ */
31
+ const shouldRenderTaxIdInput = ({ companyName, countryCode, }) => {
32
+ // Only show the tax ID input if the country is in the EU and the company name is provided
33
+ if (TaxId.euCountryCodes.includes(countryCode)) {
34
+ return companyName.trim().length > 0;
35
+ }
36
+ // If country require tax id, show the input
37
+ const isCountryRequireTaxId = isInTaxIdCountry(countryCode);
38
+ if (isCountryRequireTaxId) {
39
+ return true;
40
+ }
41
+ // If country doesn't require tax ID, no need to show the input
42
+ return false;
43
+ };
44
+
23
45
  exports.containsNonLatinChars = containsNonLatinChars;
24
46
  exports.isTextContainsNonLatinChars = isTextContainsNonLatinChars;
47
+ exports.shouldRenderTaxIdInput = shouldRenderTaxIdInput;
@@ -3,16 +3,16 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0993f42d.js');
6
- const cart = require('./cart-27f6c7a4.js');
6
+ const cart = require('./cart-bc882927.js');
7
+ const zonosStore = require('./zonosStore-c466b127.js');
7
8
  const handleFetch = require('./handleFetch-969d05d8.js');
9
+ const shouldRenderTaxIdInput = require('./shouldRenderTaxIdInput-9b8a8de1.js');
8
10
  const TaxId = require('./TaxId-12acedde.js');
9
- const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
10
11
  const classes = require('./classes-b7918f56.js');
11
- const getBorderRadius = require('./getBorderRadius-87f3b69c.js');
12
- const zonosStore = require('./zonosStore-adc42868.js');
12
+ const getBorderRadius = require('./getBorderRadius-3d0a563e.js');
13
13
  const RemoveIcon$2 = require('./RemoveIcon-081ac073.js');
14
- const isDarkColor = require('./isDarkColor-d0c67c3d.js');
15
- const debounce$1 = require('./debounce-3eaa4f7e.js');
14
+ const isDarkColor = require('./isDarkColor-92a10a85.js');
15
+ const debounce$1 = require('./debounce-d393fafe.js');
16
16
  const helpers = require('./helpers-5bdbb68c.js');
17
17
 
18
18
  const zonosAddressCss = ".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h .zonos--company-name-input.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";
@@ -211,8 +211,16 @@ const ZonosAddress$1 = class {
211
211
  if (!countryCode) {
212
212
  return null;
213
213
  }
214
- const isCountryRequireTaxId = this.isInTaxIdCountry(countryCode);
215
- if (!isCountryRequireTaxId) {
214
+ // This just to type guard the countryCode, if it's able to get to this point it should already be in country that has tax id input
215
+ if (!this.isInTaxIdCountry(countryCode)) {
216
+ return null;
217
+ }
218
+ const taxIdInputRendered = shouldRenderTaxIdInput.shouldRenderTaxIdInput({
219
+ companyName: cart.stripeStore.companyName,
220
+ countryCode,
221
+ });
222
+ // Don't render tax id input if the country doesn't require tax id
223
+ if (!taxIdInputRendered) {
216
224
  return null;
217
225
  }
218
226
  const taxIdInputInfo = TaxId.shipToTaxIdLabels[countryCode];
@@ -226,6 +234,11 @@ const ZonosAddress$1 = class {
226
234
  if (this.type === 'billing') {
227
235
  return null;
228
236
  }
237
+ // only render the company input if the setting is enabled
238
+ const isCompanyNameEnabled = zonosStore.zonosStore.checkoutSettings.companyFieldsStatus === 'ENABLED';
239
+ if (!isCompanyNameEnabled) {
240
+ return null;
241
+ }
229
242
  return (index.h("zonos-stripe-input", { class: "zonos--company-name-input", inputLabel: cart.translate('Company name (optional)'), inputValue: cart.stripeStore.companyName, onInputChange: (event) => {
230
243
  cart.stripeStore.companyName = event.detail;
231
244
  } }));
@@ -250,7 +263,7 @@ const ZonosAddress$1 = class {
250
263
  this.isAddressFilled = true;
251
264
  }
252
265
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
253
- return (index.h(index.Host, { key: 'd0ca96da12614cde628ff4dad124b54c454cd140', class: "zonos--address zonos--elements" }, index.h("zonos-text", { key: '761b0fb6b313cb6884c3f48f7e46261650669502', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), index.h("div", { key: '634b40091645760295a5ef544be8080826739301', class: "zonos--address-component" })));
266
+ return (index.h(index.Host, { key: '237dca631e154da8d53a8ffce5090b39e9324fde', class: "zonos--address zonos--elements" }, index.h("zonos-text", { key: 'af7c7f0f7515f428b07179ceea4fd7811f2d20e1', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), index.h("div", { key: 'e7b9fead0c4e35fc662be8728b8e58bb3b697178', class: "zonos--address-component" })));
254
267
  }
255
268
  get el() { return index.getElement(this); }
256
269
  static get watchers() { return {
@@ -276,7 +289,7 @@ const ZonosAddressDisplay = class {
276
289
  const { city, country, email, line1, line2, name, phone, postal_code, state, } = this.currentAddress;
277
290
  const shippingZoneCountry = (_a = cart.localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[country];
278
291
  const renderEnteredInfoText = ({ bold, content, }) => {
279
- const textColor = containsNonLatinChars.isTextContainsNonLatinChars(content)
292
+ const textColor = shouldRenderTaxIdInput.isTextContainsNonLatinChars(content)
280
293
  ? 'red-600'
281
294
  : 'gray-1000';
282
295
  return (index.h("zonos-text", { textColor: textColor, type: bold ? 'boldLabel' : 'body' }, content));
@@ -322,13 +335,13 @@ const ZonosAddressForm = class {
322
335
  const lastName = name.split(' ').slice(1).join(' ') || '';
323
336
  return (index.h(index.Host, { key: '8b578737e33203a23563be7e9be0778deec99bbf', class: "zonos--address-form zonos--elements" }, index.h("div", { key: '793675a1348547bf3f781788956befe325191011', class: "zonos--title" }, index.h("zonos-text", { key: '13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9', textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
324
337
  ? cart.translate('Shipping')
325
- : cart.translate('Billing'))), index.h("div", { key: '2c5de5b5283fb99ee5f8b61d7a217177986fc2db', class: "zonos--address-group" }, index.h("div", { key: '23bf3c893071000d5995a5f175867bab11929193', class: "zonos--contact" }, index.h("zonos-text", { key: '7cdfe2a84ebad89ba5b16498d75def99cf392384', type: "label" }, cart.translate('Contact')), index.h("zonos-input", { key: '1c39c38767fd306c5eb1164cdc989b8291209cf0', class: "zonos--form-email", inputLabel: cart.translate('Email'), inputValue: this.currentAddress.email, isDisabled: true }), index.h("div", { key: 'cbdf61217125e22b1a6cec9a340ef0aca2c75670', class: "zonos--name zonos--address-row" }, index.h("zonos-input", { key: '360c99e7b2c6caa64580d5768b5bb53368927275', class: "zonos--form-first-name", inputLabel: cart.translate('First name'), inputValue: firstName, isError: containsNonLatinChars.isTextContainsNonLatinChars(firstName), onInputChange: e => this.onInputChange({
338
+ : cart.translate('Billing'))), index.h("div", { key: '2c5de5b5283fb99ee5f8b61d7a217177986fc2db', class: "zonos--address-group" }, index.h("div", { key: '23bf3c893071000d5995a5f175867bab11929193', class: "zonos--contact" }, index.h("zonos-text", { key: '7cdfe2a84ebad89ba5b16498d75def99cf392384', type: "label" }, cart.translate('Contact')), index.h("zonos-input", { key: '1c39c38767fd306c5eb1164cdc989b8291209cf0', class: "zonos--form-email", inputLabel: cart.translate('Email'), inputValue: this.currentAddress.email, isDisabled: true }), index.h("div", { key: 'cbdf61217125e22b1a6cec9a340ef0aca2c75670', class: "zonos--name zonos--address-row" }, index.h("zonos-input", { key: '360c99e7b2c6caa64580d5768b5bb53368927275', class: "zonos--form-first-name", inputLabel: cart.translate('First name'), inputValue: firstName, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(firstName), onInputChange: e => this.onInputChange({
326
339
  key: 'name',
327
340
  value: `${e.detail} ${lastName}`,
328
- }) }), index.h("zonos-input", { key: '8ce5fa5c15c6f7928339ea10009ce0e68954a91f', class: "zonos--form-last-name", inputLabel: cart.translate('Last name'), inputValue: lastName, isError: containsNonLatinChars.isTextContainsNonLatinChars(lastName), onInputChange: e => this.onInputChange({
341
+ }) }), index.h("zonos-input", { key: '8ce5fa5c15c6f7928339ea10009ce0e68954a91f', class: "zonos--form-last-name", inputLabel: cart.translate('Last name'), inputValue: lastName, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(lastName), onInputChange: e => this.onInputChange({
329
342
  key: 'name',
330
343
  value: `${firstName} ${e.detail}`,
331
- }) }))), index.h("div", { key: '7b4fa2d3baa6cb257e7688e5ba6777123898b3fd', class: "zonos--address" }, index.h("zonos-text", { key: '9d5782331b2642755a755aeb7f98c9f4d87f9a20', type: "label" }, cart.translate('Address')), index.h("zonos-input", { key: 'a622025924ca86bdbf1d3c04b79e6dee172b4c42', class: "zonos--form-country", inputLabel: cart.translate('Country'), inputValue: country, isDisabled: true }), index.h("zonos-input", { key: 'f99b3a74db09ab5730878e80705b9aeac76bf800', class: "zonos--form-line1", inputLabel: cart.translate('Address line 1'), inputValue: line1, isError: containsNonLatinChars.isTextContainsNonLatinChars(line1), onInputChange: e => this.onInputChange({ key: 'line1', value: e.detail }) }), index.h("zonos-input", { key: '5d16aefa45a78045c87d166aaaec0255606e455e', class: "zonos--form-line2", inputLabel: cart.translate('Address line 2'), inputValue: line2, isError: containsNonLatinChars.isTextContainsNonLatinChars(line2), onInputChange: e => this.onInputChange({ key: 'line2', value: e.detail }) }), index.h("div", { key: 'dc166be9381142835d72e731cb38a718522a068a', class: "zonos--address-row" }, index.h("zonos-input", { key: '4f1a98f9d10ce0cff3ef18a3037a12382552b31d', class: "zonos--form-city", inputLabel: cart.translate('City'), inputValue: city, isError: containsNonLatinChars.isTextContainsNonLatinChars(city), onInputChange: e => this.onInputChange({ key: 'city', value: e.detail }) }), index.h("zonos-input", { key: 'd4f97900b5fe2e1619950a52d1d1f716a8bc19ff', class: "zonos--form-state", inputLabel: cart.translate('State/Province'), inputValue: state, isError: containsNonLatinChars.isTextContainsNonLatinChars(state), onInputChange: e => this.onInputChange({ key: 'state', value: e.detail }) })), index.h("zonos-input", { key: 'cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733', class: "zonos--form-postal-code", inputLabel: cart.translate('Postal code'), inputValue: postal_code, isError: containsNonLatinChars.isTextContainsNonLatinChars(postal_code), onInputChange: e => this.onInputChange({ key: 'postal_code', value: e.detail }) }), index.h("zonos-input", { key: '7421c82847eded6bdbcce49ef8196124d8e50c1d', class: "zonos--form-phone", inputLabel: cart.translate('Phone number'), inputValue: phone, onInputChange: e => this.onInputChange({ key: 'phone', value: e.detail }) })))));
344
+ }) }))), index.h("div", { key: '7b4fa2d3baa6cb257e7688e5ba6777123898b3fd', class: "zonos--address" }, index.h("zonos-text", { key: '9d5782331b2642755a755aeb7f98c9f4d87f9a20', type: "label" }, cart.translate('Address')), index.h("zonos-input", { key: 'a622025924ca86bdbf1d3c04b79e6dee172b4c42', class: "zonos--form-country", inputLabel: cart.translate('Country'), inputValue: country, isDisabled: true }), index.h("zonos-input", { key: 'f99b3a74db09ab5730878e80705b9aeac76bf800', class: "zonos--form-line1", inputLabel: cart.translate('Address line 1'), inputValue: line1, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(line1), onInputChange: e => this.onInputChange({ key: 'line1', value: e.detail }) }), index.h("zonos-input", { key: '5d16aefa45a78045c87d166aaaec0255606e455e', class: "zonos--form-line2", inputLabel: cart.translate('Address line 2'), inputValue: line2, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(line2), onInputChange: e => this.onInputChange({ key: 'line2', value: e.detail }) }), index.h("div", { key: 'dc166be9381142835d72e731cb38a718522a068a', class: "zonos--address-row" }, index.h("zonos-input", { key: '4f1a98f9d10ce0cff3ef18a3037a12382552b31d', class: "zonos--form-city", inputLabel: cart.translate('City'), inputValue: city, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(city), onInputChange: e => this.onInputChange({ key: 'city', value: e.detail }) }), index.h("zonos-input", { key: 'd4f97900b5fe2e1619950a52d1d1f716a8bc19ff', class: "zonos--form-state", inputLabel: cart.translate('State/Province'), inputValue: state, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(state), onInputChange: e => this.onInputChange({ key: 'state', value: e.detail }) })), index.h("zonos-input", { key: 'cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733', class: "zonos--form-postal-code", inputLabel: cart.translate('Postal code'), inputValue: postal_code, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(postal_code), onInputChange: e => this.onInputChange({ key: 'postal_code', value: e.detail }) }), index.h("zonos-input", { key: '7421c82847eded6bdbcce49ef8196124d8e50c1d', class: "zonos--form-phone", inputLabel: cart.translate('Phone number'), inputValue: phone, onInputChange: e => this.onInputChange({ key: 'phone', value: e.detail }) })))));
332
345
  }
333
346
  static get watchers() { return {
334
347
  "translatedAddress": ["watchCurrentAddress"]
@@ -482,11 +495,11 @@ const ZonosAddressUpdateDialog = class {
482
495
  translatedAddress: this.translatedShippingAddressState,
483
496
  });
484
497
  // check to see if there are still non-latin characters in the translated address
485
- const shippingNonlatinChars = containsNonLatinChars.containsNonLatinChars(Object.assign(Object.assign({}, translatedShippingAddress), { country: this.shippingAddress.country }));
498
+ const shippingNonlatinChars = shouldRenderTaxIdInput.containsNonLatinChars(Object.assign(Object.assign({}, translatedShippingAddress), { country: this.shippingAddress.country }));
486
499
  // get list of non-latin characters field in the billing address
487
500
  const billingNonLatinChars = translatedBillingAddress &&
488
501
  this.billingAddress &&
489
- containsNonLatinChars.containsNonLatinChars(Object.assign(Object.assign({}, translatedBillingAddress), { country: this.billingAddress.country }));
502
+ shouldRenderTaxIdInput.containsNonLatinChars(Object.assign(Object.assign({}, translatedBillingAddress), { country: this.billingAddress.country }));
490
503
  const shippingHasNonLatinChars = !!Object.keys(shippingNonlatinChars)
491
504
  .length;
492
505
  const billingHasNonLatinChars = !!billingNonLatinChars && !!Object.keys(billingNonLatinChars).length;
@@ -1060,8 +1073,16 @@ const ZonosAddress = class {
1060
1073
  if (!countryCode) {
1061
1074
  return null;
1062
1075
  }
1063
- const isCountryRequireTaxId = this.isInTaxIdCountry(countryCode);
1064
- if (!isCountryRequireTaxId) {
1076
+ // This just to type guard the countryCode, if it's able to get to this point it should already be in country that has tax id input
1077
+ if (!this.isInTaxIdCountry(countryCode)) {
1078
+ return null;
1079
+ }
1080
+ const taxIdInputRendered = shouldRenderTaxIdInput.shouldRenderTaxIdInput({
1081
+ companyName: cart.stripeStore.companyName,
1082
+ countryCode,
1083
+ });
1084
+ // Don't render tax id input if the country doesn't require tax id
1085
+ if (!taxIdInputRendered) {
1065
1086
  return null;
1066
1087
  }
1067
1088
  const taxIdInputInfo = TaxId.shipToTaxIdLabels[countryCode];
@@ -1074,6 +1095,11 @@ const ZonosAddress = class {
1074
1095
  if (this.type === 'billing') {
1075
1096
  return null;
1076
1097
  }
1098
+ // only render the company input if the setting is enabled
1099
+ const isCompanyNameEnabled = zonosStore.zonosStore.checkoutSettings.companyFieldsStatus === 'ENABLED';
1100
+ if (!isCompanyNameEnabled) {
1101
+ return null;
1102
+ }
1077
1103
  return (index.h("zonos-stripe-input", { class: "zonos--company-name-input", inputLabel: cart.translate('Company name (optional)'), inputValue: cart.stripeStore.companyName, onInputChange: (event) => {
1078
1104
  cart.stripeStore.companyName = event.detail;
1079
1105
  } }));
@@ -1547,10 +1573,10 @@ const ZonosAddress = class {
1547
1573
  this.country = cart.localizationStore.selectedCountryCode;
1548
1574
  }
1549
1575
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
1550
- return (index.h(index.Host, { key: '66cc13d7c7a01e23610447ffff5b87ee3b62e65c', class: classes.classes([
1576
+ return (index.h(index.Host, { key: '896476a9cf01cbb6e88312c1c90a7a022a83269d', class: classes.classes([
1551
1577
  'zonos--address zonos--elements',
1552
1578
  `zonos--${this.type}-address`,
1553
- ]) }, index.h("zonos-text", { key: '52902420cfc1af2d18c2d502eed38870386e3a3c', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderCustomAddressForm()));
1579
+ ]) }, index.h("zonos-text", { key: 'e1a3320ae6c3c8bb104604cef6fc2e6c711b6543', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderCustomAddressForm()));
1554
1580
  }
1555
1581
  get el() { return index.getElement(this); }
1556
1582
  static get watchers() { return {
@@ -7810,26 +7836,28 @@ const ZonosStripePhoneInput = class {
7810
7836
  const fontSize = zonosStore.zonosStore.appearance.fontSizeInputValue || 16;
7811
7837
  const hasContent = !!this.phoneNumber;
7812
7838
  const countryOptionsList = this.countryOptions
7813
- ? Object.values(this.countryOptions).filter(Boolean)
7839
+ ? Object.values(this.countryOptions)
7840
+ .filter(Boolean)
7841
+ .sort((a, b) => a.displayName.localeCompare(b.displayName))
7814
7842
  : [];
7815
- return (index.h(index.Host, { key: 'ece9737db2ea37d1e75a8840e911221a6604ead2', class: classes.classes([
7843
+ return (index.h(index.Host, { key: 'c7ca4076eb70b166979d21074d068912af1496c5', class: classes.classes([
7816
7844
  'zonos--phone-input zonos--elements',
7817
7845
  isDark && 'dark',
7818
- ]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius.getBorderRadius(), '--zonos--font-family': zonosStore.zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, index.h("div", { key: 'b3cda8bc90655aab7c45b8dce02f615236e73e0f', class: classes.classes([
7846
+ ]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius.getBorderRadius(), '--zonos--font-family': zonosStore.zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, index.h("div", { key: '5460d79c86d34daf94538f063274c45ae3be2239', class: classes.classes([
7819
7847
  'zonos--label-wrapper',
7820
7848
  this.disabled && 'disabled',
7821
7849
  this.isFocused && 'focused',
7822
7850
  hasContent && 'has-content',
7823
7851
  this.error && 'has-error',
7824
7852
  this.inputLabel && 'has-label',
7825
- ]) }, index.h("select", { key: '43c8539ccc6d4a2dee364c540c552a737cf450ed', class: "zonos--select", disabled: this.disabled, onBlur: this.handleBlur, onChange: this.handleCountryChange, onFocus: this.handleFocus }, countryOptionsList.map(option => {
7853
+ ]) }, index.h("select", { key: '290d89088b9a800b31ed19cfe3de6831322a3f5a', class: "zonos--select", disabled: this.disabled, onBlur: this.handleBlur, onChange: this.handleCountryChange, onFocus: this.handleFocus }, countryOptionsList.map(option => {
7826
7854
  var _a;
7827
7855
  return (index.h("option", { key: option.countryCode, selected: option.countryCode === ((_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.countryCode), value: option.countryCode }, option.displayName, " (+", option.phoneCode, ")"));
7828
- })), index.h("div", { key: '50609301fd2740f213b9f4c3385dd1628e663265', class: "zonos--input-group" }, index.h("div", { key: '5920176f0986fbeb623469a2d99d7b7182b95150', class: "zonos--select-wrapper" }, index.h("div", { key: 'c96f9003f77cbd2f3ee2bfc9ae453307a3c08d3b', class: "zonos--country-select" }, index.h("div", { key: '3afef887d3f8ebfd421e887364ba660f1435236c', class: "zonos--country-select-content" }, this.selectedCountry && (index.h("div", { key: 'aa2c0384d1f5139af73e5d21fa2b728c1a3a1251', class: "zonos--country-select-selected" }, index.h("div", { key: '9ea7d3e818b50a279979cb89248e8c46bb66da0e', class: "zonos--country-flag-wrapper" }, index.h("zonos-country-flag", { key: '1c49374c7e5051ac640b1dbe20aab27e485eecd4', class: "zonos--country-flag", countryCode: this.selectedCountry.countryCode })), index.h("div", { key: 'f95d8a3f59bd62b8d488350015bd52be310cfe85', class: "zonos--country-code" }, "+", this.selectedCountry.phoneCode))), index.h("div", { key: 'e69bbd00f23ed3997bcbea13842b49600b6abe81', class: "zonos--select-chevron-wrapper" }, index.h("zonos-icon", { key: 'a20941918412c6cad3e03ba3684fd9f6c2db8bd8', "aria-label": "Expand collapsed section", class: "zonos--select-chevron", content: ChevronDownIcon$1, iconColor: "gray-800" }))))), index.h("div", { key: 'fb832d25cb005ce39082ff7829000d13a35b453b', class: classes.classes([
7856
+ })), index.h("div", { key: 'b0271d3453869ed79a36d62f5f6bacb22a509b46', class: "zonos--input-group" }, index.h("div", { key: '49486c915fa2f65878a6f8ab73c48997e4ba1461', class: "zonos--select-wrapper" }, index.h("div", { key: '63412e8077e062efef5f42c3a77e583ade435b53', class: "zonos--country-select" }, index.h("div", { key: '5c073598dfeaa0c8de68f07b1a7789f4a56a24c8', class: "zonos--country-select-content" }, this.selectedCountry && (index.h("div", { key: '8a32922d75343005fde7446736746cd531ff63f8', class: "zonos--country-select-selected" }, index.h("div", { key: '859cdbc4c1879c38f0c848ff42b38bc5492d3e96', class: "zonos--country-flag-wrapper" }, index.h("zonos-country-flag", { key: '9167a7c586e2d693bfdcad7773df60a324600be7', class: "zonos--country-flag", countryCode: this.selectedCountry.countryCode })), index.h("div", { key: 'b39dcadb22202d866fc8e1217bbe2e17704e2300', class: "zonos--country-code" }, "+", this.selectedCountry.phoneCode))), index.h("div", { key: '4b0a4ce8c94e6e3125cfde55542b38efb6a8a787', class: "zonos--select-chevron-wrapper" }, index.h("zonos-icon", { key: '25322152ca9550a8b2e667f8f993c38a972aa9ce', "aria-label": "Expand collapsed section", class: "zonos--select-chevron", content: ChevronDownIcon$1, iconColor: "gray-800" }))))), index.h("div", { key: 'c6a93ba0656e09a154c3d91327f3573e0288234b', class: classes.classes([
7829
7857
  'zonos--input-container',
7830
7858
  this.inputLabel && 'has-label',
7831
7859
  hasContent && 'has-content',
7832
- ]) }, index.h("input", Object.assign({ key: '8a5fa81c091f92937e448a60175241b6e906af68' }, this.inheritedAttributes, { autoComplete: this.autoComplete, class: "zonos--floated-input", disabled: this.disabled, id: this.inputId, onBlur: this.handleBlur, onFocus: this.handleFocus, onInput: this.handlePhoneChange, placeholder: ((_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.phonePlaceholder) || '', ref: el => (this.inputRef = el), type: "tel" })), this.inputLabel && (index.h("div", { key: '269197d54f8226a66f1033fce49a793fe4790341', class: "zonos--floated-label" }, index.h("label", { key: '7d3b810eba257a877ff4370457af8f4117c8a82f', htmlFor: this.inputId }, this.inputLabel || cart.translate('Phone number'))))))), this.error && (index.h("zonos-text", { key: 'ba21514e60b298d4d353d92246e91eadd1e6d744', textColor: "red-600" }, this.error))));
7860
+ ]) }, index.h("input", Object.assign({ key: '49246ff464685feaa9414d1e7b36f55b82fff564' }, this.inheritedAttributes, { autoComplete: this.autoComplete, class: "zonos--floated-input", disabled: this.disabled, id: this.inputId, onBlur: this.handleBlur, onFocus: this.handleFocus, onInput: this.handlePhoneChange, placeholder: ((_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.phonePlaceholder) || '', ref: el => (this.inputRef = el), type: "tel" })), this.inputLabel && (index.h("div", { key: '653d278b7ffc634bc7892d54c8fcab7b7626f80e', class: "zonos--floated-label" }, index.h("label", { key: 'c637ddca7164396d57e8a5eaf98b0e523ee27258', htmlFor: this.inputId }, this.inputLabel || cart.translate('Phone number'))))))), this.error && (index.h("zonos-text", { key: 'dcc70c068fef73e804eba1f134673168a0bbaf90', textColor: "red-600" }, this.error))));
7833
7861
  }
7834
7862
  get el() { return index.getElement(this); }
7835
7863
  static get watchers() { return {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0993f42d.js');
6
- const zonosStore = require('./zonosStore-adc42868.js');
6
+ const zonosStore = require('./zonosStore-c466b127.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
 
9
9
  const RemoveLineIcon = `<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0993f42d.js');
6
- const zonosStore = require('./zonosStore-adc42868.js');
6
+ const zonosStore = require('./zonosStore-c466b127.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
 
9
9
  const zonosBannerCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{border-radius:var(--zonos-elements-radius-10);padding:16px;background:var(--zonos-elements-gray-100)}:host .zonos--container{display:grid;-ms-flex-align:center;align-items:center;grid-template-areas:\"icon header\" \". content\";grid-template-columns:32px auto 0}:host .zonos--icon-wrapper{grid-area:icon;display:-ms-flexbox;display:flex;justify-self:start}:host .zonos--header-wrapper{margin-top:0px;grid-area:header}:host .zonos--content-wrapper{grid-area:content;margin-top:4px}:host(.info){background-color:var(--zonos-elements-blue-100);border:1px solid var(--zonos-elements-blue-200)}:host(.success){background-color:var(--zonos-elements-green-100);border:1px solid var(--zonos-elements-green-200)}:host(.error){background-color:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host(.warning){background-color:var(--zonos-elements-orange-100);border:1px solid var(--zonos-elements-orange-200)}";
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0993f42d.js');
6
- const zonosStore = require('./zonosStore-adc42868.js');
6
+ const zonosStore = require('./zonosStore-c466b127.js');
7
7
  const helpers = require('./helpers-5bdbb68c.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
- const getBorderRadius = require('./getBorderRadius-87f3b69c.js');
9
+ const getBorderRadius = require('./getBorderRadius-3d0a563e.js');
10
10
  const isColorVariable = require('./isColorVariable-525dbfa7.js');
11
- const isDarkColor = require('./isDarkColor-d0c67c3d.js');
11
+ const isDarkColor = require('./isDarkColor-92a10a85.js');
12
12
  const styles = require('./styles-d1e64fb9.js');
13
13
 
14
14
  /**
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0993f42d.js');
6
- const zonosStore = require('./zonosStore-adc42868.js');
6
+ const zonosStore = require('./zonosStore-c466b127.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const getBorderRadius = require('./getBorderRadius-87f3b69c.js');
8
+ const getBorderRadius = require('./getBorderRadius-3d0a563e.js');
9
9
 
10
10
  const zonosCardCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .styled-card{border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));padding:var(--spacing, 24px);text-align:left;background-color:var(--zonos--background-color);overflow:hidden}:host .styled-card hr{margin-left:calc(var(--spacing, 24px) * -1);margin-right:calc(var(--spacing, 24px) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, 24px);border-bottom:var(--zonos-elements-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);border-top:var(--zonos-elements-border);background:var(--zonos-elements-surface-color-secondary);margin-top:var(--spacing, 24px);border-bottom-left-radius:var(--zonos-elements-radius-8);border-bottom-right-radius:var(--zonos-elements-radius-8);height:var(--footerHeight)}";
11
11
  const ZonosCardStyle0 = zonosCardCss;
@@ -3,17 +3,17 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0993f42d.js');
6
- const cart = require('./cart-27f6c7a4.js');
6
+ const cart = require('./cart-bc882927.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const paypal = require('./paypal-84d83a76.js');
9
- const zonosStore = require('./zonosStore-adc42868.js');
8
+ const paypal = require('./paypal-608fa681.js');
9
+ const zonosStore = require('./zonosStore-c466b127.js');
10
10
  const handleFetch = require('./handleFetch-969d05d8.js');
11
11
  const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
12
- const getBorderRadius = require('./getBorderRadius-87f3b69c.js');
12
+ const getBorderRadius = require('./getBorderRadius-3d0a563e.js');
13
13
  const ILanguage = require('./ILanguage-98b04442.js');
14
- const isDarkColor = require('./isDarkColor-d0c67c3d.js');
14
+ const isDarkColor = require('./isDarkColor-92a10a85.js');
15
15
  const isColorVariable = require('./isColorVariable-525dbfa7.js');
16
- const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
16
+ const shouldRenderTaxIdInput = require('./shouldRenderTaxIdInput-9b8a8de1.js');
17
17
  const TaxId = require('./TaxId-12acedde.js');
18
18
 
19
19
  const getDisplayCurrency = () => {
@@ -1894,7 +1894,9 @@ const ZonosCheckoutPayment = class {
1894
1894
  variant: this.submitBtnType }, cart.translate('Place test order')))));
1895
1895
  }
1896
1896
  return (index.h(index.Fragment, null, this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, cart.translate('Missing required fields. Make sure all fields are completed.'))), this.hasStripePaymentError && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, cart.stripeStore.customErrorMessage ||
1897
- cart.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (index.h(index.Fragment, null, index.h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, loading: this.continueLoading, onClick: async () => {
1897
+ cart.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (index.h(index.Fragment, null, index.h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
1898
+ cart.stripeStore.checkoutSettlementCurrency === 'USD', loading: this.continueLoading &&
1899
+ cart.stripeStore.checkoutSettlementCurrency !== 'USD', onClick: async () => {
1898
1900
  if (!cart.cartStore.checkoutSession) {
1899
1901
  handleFetch.log('Checkout session is not found');
1900
1902
  return;
@@ -1910,7 +1912,9 @@ const ZonosCheckoutPayment = class {
1910
1912
  amount: cart.cartStore.total,
1911
1913
  isForeign: true,
1912
1914
  }),
1913
- })), cart.stripeStore.shouldRenderPayInUsdButton && (index.h("zonos-button", { class: "zonos--pay-in-base-currency-btn", loading: this.continueLoading, onClick: async () => {
1915
+ })), cart.stripeStore.shouldRenderPayInUsdButton && (index.h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
1916
+ cart.stripeStore.checkoutSettlementCurrency !== 'USD', loading: this.continueLoading &&
1917
+ cart.stripeStore.checkoutSettlementCurrency === 'USD', onClick: async () => {
1914
1918
  await this.continueClickHandler({
1915
1919
  currencyCode: 'USD',
1916
1920
  });
@@ -2208,16 +2212,29 @@ const isTaxIdRequired = (shippingCountry) => {
2208
2212
  };
2209
2213
  const taxIdValidationResult = ({ companyName, shippingCountry, taxId, }) => {
2210
2214
  // Check to see if we are required to collect tax id for the shipping country or not
2211
- const taxRequired = isTaxIdRequired(shippingCountry);
2212
- if (!taxRequired) {
2215
+ const isTaxIdInputRendered = shouldRenderTaxIdInput.shouldRenderTaxIdInput({
2216
+ companyName,
2217
+ countryCode: shippingCountry,
2218
+ });
2219
+ // If the tax id input is not even rendered, no need to validate anything and allow to proceed. Validate when tax id input is not even rendered would prevent the user from checking out
2220
+ if (!isTaxIdInputRendered) {
2221
+ return {
2222
+ error: null,
2223
+ valid: true,
2224
+ };
2225
+ }
2226
+ // Cache the result of isTaxIdRequired for reuse
2227
+ const taxIdRequired = isTaxIdRequired(shippingCountry);
2228
+ if (!taxIdRequired) {
2229
+ // If the shipping country does not require a tax id, the validation immediately returns valid
2213
2230
  return {
2214
2231
  error: null,
2215
2232
  valid: true,
2216
2233
  };
2217
2234
  }
2218
- // For GB, tax id is not required if company name is not filled (not business address)
2235
+ // For all EU countries, tax id is not required if company name is not filled (not business address)
2219
2236
  if (TaxId.euCountryCodes.includes(shippingCountry)) {
2220
- if (!companyName) {
2237
+ if (!companyName.trim()) {
2221
2238
  return {
2222
2239
  error: null,
2223
2240
  valid: true,
@@ -2534,7 +2551,7 @@ const ZonosCustomerInfo = class {
2534
2551
  }
2535
2552
  const { address: addressValue, firstName, lastName, name } = address.value;
2536
2553
  const { city, country, line1, line2, postal_code, state } = addressValue;
2537
- const invalidList = containsNonLatinChars.containsNonLatinChars({
2554
+ const invalidList = shouldRenderTaxIdInput.containsNonLatinChars({
2538
2555
  city,
2539
2556
  country,
2540
2557
  line1,
@@ -3,14 +3,14 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0993f42d.js');
6
- const cart = require('./cart-27f6c7a4.js');
7
- const paypal = require('./paypal-84d83a76.js');
8
- const zonosStore = require('./zonosStore-adc42868.js');
6
+ const cart = require('./cart-bc882927.js');
7
+ const paypal = require('./paypal-608fa681.js');
8
+ const zonosStore = require('./zonosStore-c466b127.js');
9
9
  const handleFetch = require('./handleFetch-969d05d8.js');
10
10
  const classes = require('./classes-b7918f56.js');
11
11
  const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
12
- const getBorderRadius = require('./getBorderRadius-87f3b69c.js');
13
- const isDarkColor = require('./isDarkColor-d0c67c3d.js');
12
+ const getBorderRadius = require('./getBorderRadius-3d0a563e.js');
13
+ const isDarkColor = require('./isDarkColor-92a10a85.js');
14
14
  const styles = require('./styles-d1e64fb9.js');
15
15
  const CheckoutConfig = require('./CheckoutConfig-4afc683b.js');
16
16
  const RemoveIcon = require('./RemoveIcon-081ac073.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0993f42d.js');
6
- const zonosStore = require('./zonosStore-adc42868.js');
6
+ const zonosStore = require('./zonosStore-c466b127.js');
7
7
 
8
8
  const zonosCollapseCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";
9
9
  const ZonosCollapseStyle0 = zonosCollapseCss;
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0993f42d.js');
6
- const cart = require('./cart-27f6c7a4.js');
7
- const zonosStore = require('./zonosStore-adc42868.js');
6
+ const cart = require('./cart-bc882927.js');
7
+ const zonosStore = require('./zonosStore-c466b127.js');
8
8
  const getGenericSettingsOverride = require('./getGenericSettingsOverride-c0ca32b9.js');
9
9
  const handleFetch = require('./handleFetch-969d05d8.js');
10
- require('./isDarkColor-d0c67c3d.js');
11
- require('./getBorderRadius-87f3b69c.js');
10
+ require('./isDarkColor-92a10a85.js');
11
+ require('./getBorderRadius-3d0a563e.js');
12
12
 
13
13
  const getZonosSettings = async () => {
14
14
  if (window.Zonos.cartSettings) {
@@ -3,12 +3,12 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0993f42d.js');
6
- const cart = require('./cart-27f6c7a4.js');
7
- const zonosStore = require('./zonosStore-adc42868.js');
6
+ const cart = require('./cart-bc882927.js');
7
+ const zonosStore = require('./zonosStore-c466b127.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  require('./handleFetch-969d05d8.js');
10
- require('./isDarkColor-d0c67c3d.js');
11
- require('./getBorderRadius-87f3b69c.js');
10
+ require('./isDarkColor-92a10a85.js');
11
+ require('./getBorderRadius-3d0a563e.js');
12
12
 
13
13
  const zonosCountryFlagCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .flag-container{position:relative;overflow:hidden;width:100%;height:100%}:host .flag-icon{position:absolute;top:0;left:0;width:100%;height:100%;background-position:center;background-repeat:no-repeat;background-size:cover}";
14
14
  const ZonosCountryFlagStyle0 = zonosCountryFlagCss;
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0993f42d.js');
6
- const cart = require('./cart-27f6c7a4.js');
7
- const zonosStore = require('./zonosStore-adc42868.js');
6
+ const cart = require('./cart-bc882927.js');
7
+ const zonosStore = require('./zonosStore-c466b127.js');
8
8
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
9
- const isDarkColor = require('./isDarkColor-d0c67c3d.js');
9
+ const isDarkColor = require('./isDarkColor-92a10a85.js');
10
10
  const ILanguage = require('./ILanguage-98b04442.js');
11
11
  require('./handleFetch-969d05d8.js');
12
- require('./getBorderRadius-87f3b69c.js');
12
+ require('./getBorderRadius-3d0a563e.js');
13
13
 
14
14
  /**
15
15
  * Fuse.js v7.0.0 - Lightweight fuzzy-search (http://fusejs.io)
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0993f42d.js');
6
- const zonosStore = require('./zonosStore-adc42868.js');
6
+ const zonosStore = require('./zonosStore-c466b127.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const getBorderRadius = require('./getBorderRadius-87f3b69c.js');
9
- const cart = require('./cart-27f6c7a4.js');
8
+ const getBorderRadius = require('./getBorderRadius-3d0a563e.js');
9
+ const cart = require('./cart-bc882927.js');
10
10
  const handleFetch = require('./handleFetch-969d05d8.js');
11
- const paypal = require('./paypal-84d83a76.js');
12
- require('./isDarkColor-d0c67c3d.js');
11
+ const paypal = require('./paypal-608fa681.js');
12
+ require('./isDarkColor-92a10a85.js');
13
13
 
14
14
  const PaymentEmptyStateDarkIcon = `<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">
15
15
  <mask id="mask0_3739_19124" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">
@@ -3,14 +3,14 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0993f42d.js');
6
- const cart = require('./cart-27f6c7a4.js');
7
- const zonosStore = require('./zonosStore-adc42868.js');
6
+ const cart = require('./cart-bc882927.js');
7
+ const zonosStore = require('./zonosStore-c466b127.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
10
10
  const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
11
11
  require('./handleFetch-969d05d8.js');
12
- require('./isDarkColor-d0c67c3d.js');
13
- require('./getBorderRadius-87f3b69c.js');
12
+ require('./isDarkColor-92a10a85.js');
13
+ require('./getBorderRadius-3d0a563e.js');
14
14
 
15
15
  const getHasMoreSpaceAbove = (ref) => {
16
16
  const componentRect = ref.getBoundingClientRect();