@pendo/agent 2.332.0 → 2.332.1

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.
package/dist/dom.esm.js CHANGED
@@ -1,4 +1,24 @@
1
- var setTimeout = safeBind(window.setTimeout, window);
1
+ // Resolve the global object without relying on a bare `window` identifier.
2
+ // `window` is only a bound global in a normal browser realm; when the agent is
3
+ // loaded via the npm `loadAsModule` path (or inside a Web Worker) the module is
4
+ // evaluated in a realm where `window` is undeclared, so referencing it bare
5
+ // throws a ReferenceError at module-load. `globalThis` resolves in every realm.
6
+ function getGlobalScope() {
7
+ if (typeof globalThis !== 'undefined') {
8
+ return globalThis;
9
+ }
10
+ if (typeof self !== 'undefined') {
11
+ return self;
12
+ }
13
+ if (typeof window !== 'undefined') {
14
+ return window;
15
+ }
16
+ return {};
17
+ }
18
+
19
+ var globalScope = getGlobalScope();
20
+
21
+ var setTimeout = safeBind(globalScope.setTimeout, globalScope);
2
22
 
3
23
  function safeBind(fn, scope) {
4
24
  if (typeof fn.bind === 'function') {
@@ -21,7 +41,7 @@ setTimeout = (function(global) {
21
41
  }
22
42
 
23
43
  return getZoneSafeMethod('setTimeout');
24
- })(window);
44
+ })(globalScope);
25
45
 
26
46
  var setTimeout$1 = setTimeout;
27
47
 
@@ -7502,7 +7522,7 @@ function applyMatrix2dRect(matrix2d, rect) {
7502
7522
  return transformedRect;
7503
7523
  }
7504
7524
 
7505
- var VERSION = '2.332.0_';
7525
+ var VERSION = '2.332.1_';
7506
7526
 
7507
7527
  var decodeURIComponent = _.isFunction(window.decodeURIComponent) ? window.decodeURIComponent : _.identity;
7508
7528