@zonos/elements 1.3.291 → 1.3.293

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 (52) hide show
  1. package/dist/cjs/{collect-Oeo5tjN5.js → collect-DnrvaXUI.js} +24 -4
  2. package/dist/cjs/index.cjs.js +30 -8
  3. package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +1 -1
  4. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +1 -1
  5. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +1 -1
  6. package/dist/cjs/zonos-collect.cjs.entry.js +1 -1
  7. package/dist/cjs/zonos-controller.cjs.entry.js +9 -0
  8. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  9. package/dist/collection/components/utils/checkout/injectDomesticElementHideStyle.js +9 -0
  10. package/dist/collection/scripts/_stripe.js +23 -1
  11. package/dist/esm/{collect-CdrR5OBy.js → collect-Eo4gtyql.js} +24 -4
  12. package/dist/esm/index.js +30 -8
  13. package/dist/esm/zonos-address-completion-dialog_7.entry.js +1 -1
  14. package/dist/esm/zonos-airwallex-payment.entry.js +1 -1
  15. package/dist/esm/zonos-collect-finish_6.entry.js +1 -1
  16. package/dist/esm/zonos-collect.entry.js +1 -1
  17. package/dist/esm/zonos-controller.entry.js +9 -0
  18. package/dist/esm/zonos-country-flag.entry.js +1 -1
  19. package/dist/esm-es5/{collect-CdrR5OBy.js → collect-Eo4gtyql.js} +4 -2
  20. package/dist/esm-es5/index.js +6 -6
  21. package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +1 -1
  22. package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
  23. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  24. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  25. package/dist/esm-es5/zonos-controller.entry.js +6 -0
  26. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  27. package/dist/scripts/index.d.ts +2 -0
  28. package/dist/scripts/index.js +1 -1
  29. package/dist/scripts/loadZonos.js +1 -1
  30. package/dist/scripts/zonos.js +1 -1
  31. package/dist/types/components/store/checkout/cart.d.ts +2 -0
  32. package/dist/zonos-elements/index.esm.js +1 -1
  33. package/dist/zonos-elements/{p-e0e9cff5.system.entry.js → p-06030d3b.system.entry.js} +6 -0
  34. package/dist/zonos-elements/{p-DzLNk-Pf.js → p-0mGRBGcf.js} +1 -1
  35. package/dist/zonos-elements/{p-552fbde1.system.entry.js → p-155ed3d3.system.entry.js} +6 -6
  36. package/dist/zonos-elements/{p-04bded81.system.entry.js → p-31043c2e.system.entry.js} +1 -1
  37. package/dist/zonos-elements/{p-938fc1e4.entry.js → p-3a2da031.entry.js} +1 -1
  38. package/dist/zonos-elements/p-4679f0ec.entry.js +1 -0
  39. package/dist/zonos-elements/{p-b2dd7f02.system.entry.js → p-5967a1c1.system.entry.js} +1 -1
  40. package/dist/zonos-elements/{p-c5bab786.entry.js → p-725e29bb.entry.js} +1 -1
  41. package/dist/zonos-elements/{p-c3646ae6.system.entry.js → p-7bd99479.system.entry.js} +3 -3
  42. package/dist/zonos-elements/{p-e005b6a5.system.entry.js → p-9c33f7ed.system.entry.js} +1 -1
  43. package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
  44. package/dist/zonos-elements/{p-DNc279vN.system.js → p-CZD8WvyY.system.js} +33 -31
  45. package/dist/zonos-elements/{p-DuufSrhH.system.js → p-D6qXIvFm.system.js} +52 -52
  46. package/dist/zonos-elements/{p-6e296228.entry.js → p-ad9ff14c.entry.js} +1 -1
  47. package/dist/zonos-elements/p-c9d5d8f1.entry.js +1 -0
  48. package/dist/zonos-elements/{p-550d4eea.entry.js → p-d8b312e5.entry.js} +1 -1
  49. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  50. package/package.json +6 -4
  51. package/dist/zonos-elements/p-82595838.entry.js +0 -1
  52. package/dist/zonos-elements/p-dea26048.entry.js +0 -1
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-DAAr465v.js');
4
- var collect = require('./collect-Oeo5tjN5.js');
4
+ var collect = require('./collect-DnrvaXUI.js');
5
5
  var cart = require('./cart-B6Aty-21.js');
6
6
  var localization = require('./localization-BzNeXeDe.js');
7
7
  var zonosStore = require('./zonosStore-Bx9jK82G.js');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-DAAr465v.js');
4
- var collect = require('./collect-Oeo5tjN5.js');
4
+ var collect = require('./collect-DnrvaXUI.js');
5
5
  var cart = require('./cart-B6Aty-21.js');
6
6
  var paypal = require('./paypal-CuKshRmZ.js');
7
7
  var localization = require('./localization-BzNeXeDe.js');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var index = require('./index-DAAr465v.js');
4
- var collect = require('./collect-Oeo5tjN5.js');
4
+ var collect = require('./collect-DnrvaXUI.js');
5
5
  var cart = require('./cart-B6Aty-21.js');
6
6
  var paypal = require('./paypal-CuKshRmZ.js');
7
7
  var localization = require('./localization-BzNeXeDe.js');
@@ -194,6 +194,15 @@ const injectDomesticElementHideStyle = (domesticElementSelector) => {
194
194
  merchantSelector: domesticElementSelector,
195
195
  supportsIs: supportsIsSelector,
196
196
  });
197
+ // A raw `<` is never a valid CSS selector character, and it is the
198
+ // character that would close a `<style>` tag if this string were ever
199
+ // assigned as HTML. Some parsers (current jsdom) do not throw on it, so
200
+ // reject it before `querySelector`. `>` stays allowed: it is the child
201
+ // combinator.
202
+ if (fullSelector.includes('<')) {
203
+ VarianceTest.log(`Skip domesticElementSelector injection: "${domesticElementSelector}" contains "<"`, 'warn');
204
+ return;
205
+ }
197
206
  // The browser's own parser is the source of truth — `document.querySelector`
198
207
  // throws `DOMException(SyntaxError)` for syntactically invalid selectors.
199
208
  // Validating the exact string we're about to emit catches both malformed
@@ -9,7 +9,7 @@ require('./VarianceTest-C98whVgO.js');
9
9
 
10
10
  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}`;
11
11
 
12
- const FLAG_URL = "https://zonos-store-assets.s3.amazonaws.com/images/elements-flags";
12
+ const FLAG_URL = "https://assets.zonos.com/images/elements-flags";
13
13
  const ZonosCountryFlag = class {
14
14
  constructor(hostRef) {
15
15
  index.registerInstance(this, hostRef);
@@ -93,6 +93,15 @@ export const injectDomesticElementHideStyle = (domesticElementSelector) => {
93
93
  merchantSelector: domesticElementSelector,
94
94
  supportsIs: supportsIsSelector,
95
95
  });
96
+ // A raw `<` is never a valid CSS selector character, and it is the
97
+ // character that would close a `<style>` tag if this string were ever
98
+ // assigned as HTML. Some parsers (current jsdom) do not throw on it, so
99
+ // reject it before `querySelector`. `>` stays allowed: it is the child
100
+ // combinator.
101
+ if (fullSelector.includes('<')) {
102
+ log(`Skip domesticElementSelector injection: "${domesticElementSelector}" contains "<"`, 'warn');
103
+ return;
104
+ }
96
105
  // The browser's own parser is the source of truth — `document.querySelector`
97
106
  // throws `DOMException(SyntaxError)` for syntactically invalid selectors.
98
107
  // Validating the exact string we're about to emit catches both malformed
@@ -1,8 +1,10 @@
1
1
  /* eslint-disable no-console */
2
2
  /** Loading stripe script extracted from stripe.js repository */
3
3
  import { logError } from "../components/utils/logging/logError";
4
+ const STRIPE_API_VERSION = '2025-02-24.acacia';
4
5
  const V3_URL = 'https://js.stripe.com/v3';
5
6
  const V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
7
+ const V3_VERSION = 3;
6
8
  const EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';
7
9
  export const zonosStripeFindScript = () => {
8
10
  const scripts = document.querySelectorAll(`script[src^="${V3_URL}"]`);
@@ -83,11 +85,31 @@ const registerWrapper = (stripe, startTime) => {
83
85
  }
84
86
  stripe._registerWrapper({ name: 'stripe-js', startTime });
85
87
  };
88
+ const getStripeVersion = (stripeConstructor) => {
89
+ if (!('version' in stripeConstructor)) {
90
+ return;
91
+ }
92
+ const { version } = stripeConstructor;
93
+ return typeof version === 'number' || typeof version === 'string'
94
+ ? version
95
+ : undefined;
96
+ };
86
97
  export const initStripe = (maybeStripe, args, startTime) => {
87
98
  if (maybeStripe === null) {
88
99
  return null;
89
100
  }
90
- const stripe = maybeStripe.apply(undefined, args);
101
+ const [publishableKey, callerOptions] = args;
102
+ const options = Object.assign({}, callerOptions);
103
+ const stripeVersion = getStripeVersion(maybeStripe);
104
+ const isNamedRelease = typeof stripeVersion === 'string' &&
105
+ stripeVersion !== V3_VERSION.toString();
106
+ if (isNamedRelease) {
107
+ delete options.apiVersion;
108
+ }
109
+ else {
110
+ options.apiVersion = STRIPE_API_VERSION;
111
+ }
112
+ const stripe = maybeStripe(publishableKey, options);
91
113
  registerWrapper(stripe, startTime);
92
114
  return stripe;
93
115
  };
@@ -2045,7 +2045,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
2045
2045
  var e = new Error(message);
2046
2046
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
2047
2047
  };
2048
- var version = "1.35.0";
2048
+ var version = "1.35.1";
2049
2049
  var packageJson = {
2050
2050
  version: version};
2051
2051
 
@@ -2144,7 +2144,8 @@ var SDK_URL_MAPPING = {
2144
2144
  payments: '/assets/elements.bundle.min.js',
2145
2145
  sca: '/hosted-sca/sdk/v1/index.js',
2146
2146
  taxForm: '/widgets/taxForm/sdk/v1/index.js',
2147
- billing: '/widgets/checkout/sdk/v1/index.js'
2147
+ billing: '/widgets/checkout/sdk/v1/index.js',
2148
+ balance: '/widgets/embedded-balance/sdk/v1/index.js'
2148
2149
  };
2149
2150
  var ELEMENT_TO_SDK = {
2150
2151
  // legacy
@@ -2178,7 +2179,16 @@ var ELEMENT_TO_SDK = {
2178
2179
  scaManagement: 'sca',
2179
2180
  taxForm: 'taxForm',
2180
2181
  // billing elements
2181
- embeddedCheckout: 'billing'
2182
+ embeddedCheckout: 'billing',
2183
+ // balance elements
2184
+ balanceOverview: 'balance',
2185
+ balanceDetail: 'balance',
2186
+ balanceActivities: 'balance',
2187
+ balanceActivityDetails: 'balance',
2188
+ balanceHistoryChart: 'balance',
2189
+ balanceInfo: 'balance',
2190
+ balanceScheduledTransactions: 'balance',
2191
+ balanceList: 'balance'
2182
2192
  };
2183
2193
  var ELEMENT_GROUP_TO_ELEMENT = {
2184
2194
  payments: [
@@ -2207,7 +2217,17 @@ var ELEMENT_GROUP_TO_ELEMENT = {
2207
2217
  'lendingRfi',
2208
2218
  'mrmRfi',
2209
2219
  ],
2210
- billing: ['embeddedCheckout']
2220
+ billing: ['embeddedCheckout'],
2221
+ balance: [
2222
+ 'balanceOverview',
2223
+ 'balanceDetail',
2224
+ 'balanceActivities',
2225
+ 'balanceHistoryChart',
2226
+ 'balanceInfo',
2227
+ 'balanceScheduledTransactions',
2228
+ 'balanceList',
2229
+ 'balanceActivityDetails',
2230
+ ]
2211
2231
  };
2212
2232
  var SDK_DEPENDENCIES = {
2213
2233
  billing: ['payments']
package/dist/esm/index.js CHANGED
@@ -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.291.js.zonos.com";
134
+ const cdnUrl = "https://v1.3.293.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.') ||
@@ -185,8 +185,10 @@ const getZonosQaUrl = () => {
185
185
 
186
186
  /* eslint-disable no-console */
187
187
  /** Loading stripe script extracted from stripe.js repository */
188
+ const STRIPE_API_VERSION = '2025-02-24.acacia';
188
189
  const V3_URL = 'https://js.stripe.com/v3';
189
190
  const V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
191
+ const V3_VERSION = 3;
190
192
  const EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';
191
193
  const zonosStripeFindScript = () => {
192
194
  const scripts = document.querySelectorAll(`script[src^="${V3_URL}"]`);
@@ -264,11 +266,31 @@ const registerWrapper = (stripe, startTime) => {
264
266
  }
265
267
  stripe._registerWrapper({ name: 'stripe-js', startTime });
266
268
  };
269
+ const getStripeVersion = (stripeConstructor) => {
270
+ if (!('version' in stripeConstructor)) {
271
+ return;
272
+ }
273
+ const { version } = stripeConstructor;
274
+ return typeof version === 'number' || typeof version === 'string'
275
+ ? version
276
+ : undefined;
277
+ };
267
278
  const initStripe = (maybeStripe, args, startTime) => {
268
279
  if (maybeStripe === null) {
269
280
  return null;
270
281
  }
271
- const stripe = maybeStripe.apply(undefined, args);
282
+ const [publishableKey, callerOptions] = args;
283
+ const options = Object.assign({}, callerOptions);
284
+ const stripeVersion = getStripeVersion(maybeStripe);
285
+ const isNamedRelease = typeof stripeVersion === 'string' &&
286
+ stripeVersion !== V3_VERSION.toString();
287
+ if (isNamedRelease) {
288
+ delete options.apiVersion;
289
+ }
290
+ else {
291
+ options.apiVersion = STRIPE_API_VERSION;
292
+ }
293
+ const stripe = maybeStripe(publishableKey, options);
272
294
  registerWrapper(stripe, startTime);
273
295
  return stripe;
274
296
  };
@@ -394,10 +416,10 @@ const zonosLoadUrl = (() => {
394
416
  return null;
395
417
  })();
396
418
  const startLoadTime = Date.now();
397
- const ZONOS_URL = "https://v1.3.291.js.zonos.com";
398
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.291";
399
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.291";
400
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.291";
419
+ const ZONOS_URL = "https://v1.3.293.js.zonos.com";
420
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.293";
421
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.293";
422
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.293";
401
423
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
402
424
  const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
403
425
  class Zonos {
@@ -415,7 +437,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
415
437
  ? new URLSearchParams(window.location.search).get('iframeLogType')
416
438
  : null;
417
439
  Zonos.isBigCommerce = false;
418
- Zonos.releaseDate = "1790780729336";
440
+ Zonos.releaseDate = "1792077383128";
419
441
  Zonos.isLegacyCheckout = false;
420
442
  Zonos.googleAnalyticId = null;
421
443
  Zonos.googleAnalyticReady = false;
@@ -440,7 +462,7 @@ Zonos.isNpm = true;
440
462
  Zonos.zonosQaUrl = null;
441
463
  Zonos.zonosQaUrlApi = null;
442
464
  Zonos.trackEventLogs = [];
443
- Zonos.version = `v${"1.3.291"}`;
465
+ Zonos.version = `v${"1.3.293"}`;
444
466
  Zonos.modeAlerted = false;
445
467
  Zonos.cartData = null;
446
468
  Zonos.paypal = null;