@pendo/agent 2.335.0 → 2.336.0

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
@@ -2108,8 +2108,16 @@ var _ = /*@__PURE__*/getDefaultExportFromCjs(underscoreExports);
2108
2108
  /*
2109
2109
  * @license MIT - https://github.com/taylorhakes/promise-polyfill
2110
2110
  */
2111
- // Modified to not affect global environment
2112
- var Promise$1 = window.Promise;
2111
+ // Modified to not affect global environment: the `var` keeps the binding module-local
2112
+ // so the polyfill never assigns to the real global `Promise`.
2113
+ //
2114
+ // Main-thread only. Reading `window` here is safe because rollup's `inject` is skipped
2115
+ // for the nested worker build (see `skipPlugins` on webWorkerLoader in
2116
+ // rollup/web-sdk.config.mjs): a worker realm has a native Promise and no `window`, so
2117
+ // injecting this polyfill there was both unreachable and fatal — it threw
2118
+ // `ReferenceError: window is not defined` at worker startup and stopped session replay
2119
+ // with a WORKER_ERROR. APP-163474.
2120
+ var Promise$1;
2113
2121
 
2114
2122
  Promise$1 = (function (global, factory) {
2115
2123
  var nativePromise = global.Promise;
@@ -7523,7 +7531,7 @@ function applyMatrix2dRect(matrix2d, rect) {
7523
7531
  return transformedRect;
7524
7532
  }
7525
7533
 
7526
- var VERSION = '2.335.0_';
7534
+ var VERSION = '2.336.0_';
7527
7535
 
7528
7536
  var decodeURIComponent = _.isFunction(window.decodeURIComponent) ? window.decodeURIComponent : _.identity;
7529
7537
 
@@ -4029,8 +4029,8 @@ let SERVER = '';
4029
4029
  let ASSET_HOST = '';
4030
4030
  let ASSET_PATH = '';
4031
4031
  let DESIGNER_SERVER = '';
4032
- let VERSION = '2.335.0_';
4033
- let PACKAGE_VERSION = '2.335.0';
4032
+ let VERSION = '2.336.0_';
4033
+ let PACKAGE_VERSION = '2.336.0';
4034
4034
  let LOADER = 'xhr';
4035
4035
  /* eslint-enable web-sdk-eslint-rules/no-gulp-env-references */
4036
4036
  /**
@@ -4922,8 +4922,16 @@ var agentStorage = (function () {
4922
4922
  /*
4923
4923
  * @license MIT - https://github.com/taylorhakes/promise-polyfill
4924
4924
  */
4925
- // Modified to not affect global environment
4926
- var Promise$1 = window.Promise;
4925
+ // Modified to not affect global environment: the `var` keeps the binding module-local
4926
+ // so the polyfill never assigns to the real global `Promise`.
4927
+ //
4928
+ // Main-thread only. Reading `window` here is safe because rollup's `inject` is skipped
4929
+ // for the nested worker build (see `skipPlugins` on webWorkerLoader in
4930
+ // rollup/web-sdk.config.mjs): a worker realm has a native Promise and no `window`, so
4931
+ // injecting this polyfill there was both unreachable and fatal — it threw
4932
+ // `ReferenceError: window is not defined` at worker startup and stopped session replay
4933
+ // with a WORKER_ERROR. APP-163474.
4934
+ var Promise$1;
4927
4935
 
4928
4936
  Promise$1 = (function (global, factory) {
4929
4937
  var nativePromise = global.Promise;
@@ -20275,11 +20283,17 @@ var GuideStateModule = (function () {
20275
20283
  var stepId = stepState.guideStepId;
20276
20284
  if (stepState.visitorId && stepState.visitorId !== context.getters.visitorId())
20277
20285
  return;
20278
- if (!mostRecentLastGuideStepSeen || stepState.time > mostRecentLastGuideStepSeen.time) {
20286
+ var guide = guides[guideId];
20287
+ // Only states updateLastGuideStepSeen will actually apply can win here -- it ignores
20288
+ // unknown guides and embedded ones (which always carry a channel). Letting one win
20289
+ // and then get dropped strands lastGuideStepSeen on the stale payload value, e.g.
20290
+ // when an embedded guideSeen lands a few millis after a guideAdvanced.
20291
+ var canUpdateLastGuideStepSeen = guide && !guide.channel;
20292
+ if (canUpdateLastGuideStepSeen &&
20293
+ (!mostRecentLastGuideStepSeen || stepState.time > mostRecentLastGuideStepSeen.time)) {
20279
20294
  mostRecentLastGuideStepSeen = stepState;
20280
20295
  }
20281
20296
  // checking / updating seenState in step list
20282
- var guide = guides[guideId];
20283
20297
  if (guide) {
20284
20298
  var step = _.findWhere(guide.steps, { id: stepId });
20285
20299
  if (step) {
@@ -21281,7 +21295,7 @@ function resourceCenterProc(resourceCenter) {
21281
21295
  }
21282
21296
  }
21283
21297
  // Place Element Activated Notification Badge
21284
- if (resourceCenter.launchMethod === 'dom') {
21298
+ if (resourceCenter.launchMethod === 'dom' && resourceCenter.canShowOnDevice()) {
21285
21299
  BuildingBlockResourceCenter.updateNotificationBubbles();
21286
21300
  BuildingBlockResourceCenter.adjustNotificationBubbleForResize();
21287
21301
  }
@@ -23060,6 +23074,9 @@ class GuideCache {
23060
23074
  cachedStep.seenState = lastGuideStepSeen.state;
23061
23075
  cachedStep.seenReason = lastGuideStepSeen.seenReason;
23062
23076
  cachedStep.lastSeenAt = lastGuideStepSeen.time;
23077
+ if (lastGuideStepSeen.destinationStepId != null) {
23078
+ cachedStep.destinationStepId = lastGuideStepSeen.destinationStepId;
23079
+ }
23063
23080
  if (lastGuideStepSeen.dismissCount != null) {
23064
23081
  cachedStep.dismissCount = lastGuideStepSeen.dismissCount;
23065
23082
  }
@@ -23273,6 +23290,12 @@ function backdropInertRuntimeScript(step, guide, pendo) {
23273
23290
  if (step.hasBackdrop) {
23274
23291
  const BuildingBlockGuides = pendo.BuildingBlocks.BuildingBlockGuides;
23275
23292
  const excludeElements = getTargetAreaElementsForBlockOut(step);
23293
+ // The preview bar iframe is a sibling of the guide under <body>; inerting it
23294
+ // would make preview mode's controls unclickable while the backdrop shows.
23295
+ const previewBar = document.getElementById('pendo-preview');
23296
+ if (previewBar) {
23297
+ excludeElements.push(previewBar);
23298
+ }
23276
23299
  const inertElements = BuildingBlockGuides.addInertOutsideGuide(step.guideElement[0], [], excludeElements);
23277
23300
  step.hiddenElements = (step.hiddenElements || []).concat(inertElements);
23278
23301
  }
@@ -23854,7 +23877,7 @@ var onGuideAdvanced = function (evt, step, isIntermediateStep) {
23854
23877
  log.info('Guide advance canceled during runtime in step: ' + step.id);
23855
23878
  return;
23856
23879
  }
23857
- var isGoToStep = evt && evt.action && evt.action === 'goToStep' || false;
23880
+ var isGoToStep = evt && (evt.action === 'goToStep' || evt.action === 'submitPollAndGoToStep') || false;
23858
23881
  var currentGuide = findGuideById(step.guideId);
23859
23882
  var language = currentGuide && currentGuide.language;
23860
23883
  var currentIndex = currentGuide && currentGuide.steps && _.findIndex(currentGuide.steps, (s) => step.id == s.id);
@@ -23942,7 +23965,7 @@ var onGuidePrevious = function (evt, step) {
23942
23965
  }
23943
23966
  var guideId = step.guideId;
23944
23967
  var currentGuide = findGuideById(guideId);
23945
- var isGoToStep = evt && evt.action && evt.action === 'goToStep' || false;
23968
+ var isGoToStep = evt && (evt.action === 'goToStep' || evt.action === 'submitPollAndGoToStep') || false;
23946
23969
  var currentIndex = _.indexOf(currentGuide.steps, step);
23947
23970
  if (currentIndex === 0) {
23948
23971
  return;
@@ -42809,8 +42832,16 @@ var setTimeout$1 = setTimeout;
42809
42832
  /*
42810
42833
  * @license MIT - https://github.com/taylorhakes/promise-polyfill
42811
42834
  */
42812
- // Modified to not affect global environment
42813
- var Promise$1 = window.Promise;
42835
+ // Modified to not affect global environment: the `var` keeps the binding module-local
42836
+ // so the polyfill never assigns to the real global `Promise`.
42837
+ //
42838
+ // Main-thread only. Reading `window` here is safe because rollup's `inject` is skipped
42839
+ // for the nested worker build (see `skipPlugins` on webWorkerLoader in
42840
+ // rollup/web-sdk.config.mjs): a worker realm has a native Promise and no `window`, so
42841
+ // injecting this polyfill there was both unreachable and fatal — it threw
42842
+ // `ReferenceError: window is not defined` at worker startup and stopped session replay
42843
+ // with a WORKER_ERROR. APP-163474.
42844
+ var Promise$1;
42814
42845
 
42815
42846
  Promise$1 = (function (global, factory) {
42816
42847
  var nativePromise = global.Promise;
@@ -51287,394 +51318,6 @@ var WorkerFactory = /*#__PURE__*/createInlineWorkerFactory(/* rollup-plugin-web-
51287
51318
  ((function (exports) {
51288
51319
  '__worker_loader_strict__';
51289
51320
 
51290
- // Resolve the global object without relying on a bare `window` identifier.
51291
- // `window` is only a bound global in a normal browser realm; when the agent is
51292
- // loaded via the npm `loadAsModule` path (or inside a Web Worker) the module is
51293
- // evaluated in a realm where `window` is undeclared, so referencing it bare
51294
- // throws a ReferenceError at module-load. `globalThis` resolves in every realm.
51295
- function getGlobalScope() {
51296
- if (typeof globalThis !== 'undefined') {
51297
- return globalThis;
51298
- }
51299
- if (typeof self !== 'undefined') {
51300
- return self;
51301
- }
51302
- if (typeof window !== 'undefined') {
51303
- return window;
51304
- }
51305
- return {};
51306
- }
51307
-
51308
- var globalScope = getGlobalScope();
51309
-
51310
- var setTimeout = safeBind(globalScope.setTimeout, globalScope);
51311
-
51312
- function safeBind(fn, scope) {
51313
- if (typeof fn.bind === 'function') {
51314
- return fn.bind(scope);
51315
- }
51316
- return fn;
51317
- }
51318
-
51319
- setTimeout = (function(global) {
51320
- function getZoneSafeMethod(method) {
51321
- var zoneSymbol = '__symbol__';
51322
- /* global Zone */
51323
- if (typeof Zone !== 'undefined' && Zone[zoneSymbol] instanceof Function) {
51324
- var fn = global[Zone[zoneSymbol](method)];
51325
- if (fn instanceof Function) {
51326
- return fn;
51327
- }
51328
- }
51329
- return safeBind(global[method], global);
51330
- }
51331
-
51332
- return getZoneSafeMethod('setTimeout');
51333
- })(globalScope);
51334
-
51335
- var setTimeout$1 = setTimeout;
51336
-
51337
- /*
51338
- * @license MIT - https://github.com/taylorhakes/promise-polyfill
51339
- */
51340
- // Modified to not affect global environment
51341
- var Promise$1 = window.Promise;
51342
-
51343
- Promise$1 = (function (global, factory) {
51344
- var nativePromise = global.Promise;
51345
- if (typeof nativePromise !== 'function' || !/native/.test(nativePromise)) {
51346
- return factory();
51347
- }
51348
-
51349
- return nativePromise;
51350
- }(window, (function () {
51351
- /**
51352
- * @this {Promise}
51353
- */
51354
- function finallyConstructor(callback) {
51355
- var constructor = this.constructor;
51356
- return this.then(
51357
- function(value) {
51358
- // @ts-ignore
51359
- return constructor.resolve(callback()).then(function() {
51360
- return value;
51361
- });
51362
- },
51363
- function(reason) {
51364
- // @ts-ignore
51365
- return constructor.resolve(callback()).then(function() {
51366
- // @ts-ignore
51367
- return constructor.reject(reason);
51368
- });
51369
- }
51370
- );
51371
- }
51372
-
51373
- function allSettled(arr) {
51374
- var P = this;
51375
- return new P(function(resolve, reject) {
51376
- if (!(arr && typeof arr.length !== 'undefined')) {
51377
- return reject(
51378
- new TypeError(
51379
- typeof arr +
51380
- ' ' +
51381
- arr +
51382
- ' is not iterable(cannot read property Symbol(Symbol.iterator))'
51383
- )
51384
- );
51385
- }
51386
- var args = Array.prototype.slice.call(arr);
51387
- if (args.length === 0) return resolve([]);
51388
- var remaining = args.length;
51389
-
51390
- function res(i, val) {
51391
- if (val && (typeof val === 'object' || typeof val === 'function')) {
51392
- var then = val.then;
51393
- if (typeof then === 'function') {
51394
- then.call(
51395
- val,
51396
- function(val) {
51397
- res(i, val);
51398
- },
51399
- function(e) {
51400
- args[i] = { status: 'rejected', reason: e };
51401
- if (--remaining === 0) {
51402
- resolve(args);
51403
- }
51404
- }
51405
- );
51406
- return;
51407
- }
51408
- }
51409
- args[i] = { status: 'fulfilled', value: val };
51410
- if (--remaining === 0) {
51411
- resolve(args);
51412
- }
51413
- }
51414
-
51415
- for (var i = 0; i < args.length; i++) {
51416
- res(i, args[i]);
51417
- }
51418
- });
51419
- }
51420
-
51421
- // Store setTimeout reference so promise-polyfill will be unaffected by
51422
- // other code modifying setTimeout (like sinon.useFakeTimers())
51423
- var setTimeoutFunc = setTimeout$1;
51424
-
51425
- function isArray(x) {
51426
- return Boolean(x && typeof x.length !== 'undefined');
51427
- }
51428
-
51429
- function noop() {}
51430
-
51431
- // Polyfill for Function.prototype.bind
51432
- function bind(fn, thisArg) {
51433
- return function() {
51434
- fn.apply(thisArg, arguments);
51435
- };
51436
- }
51437
-
51438
- /**
51439
- * @constructor
51440
- * @param {Function} fn
51441
- */
51442
- function Promise(fn) {
51443
- if (!(this instanceof Promise))
51444
- throw new TypeError('Promises must be constructed via new');
51445
- if (typeof fn !== 'function') throw new TypeError('not a function');
51446
- /** @type {!number} */
51447
- this._state = 0;
51448
- /** @type {!boolean} */
51449
- this._handled = false;
51450
- /** @type {Promise|undefined} */
51451
- this._value = undefined;
51452
- /** @type {!Array<!Function>} */
51453
- this._deferreds = [];
51454
-
51455
- doResolve(fn, this);
51456
- }
51457
-
51458
- function handle(self, deferred) {
51459
- while (self._state === 3) {
51460
- self = self._value;
51461
- }
51462
- if (self._state === 0) {
51463
- self._deferreds.push(deferred);
51464
- return;
51465
- }
51466
- self._handled = true;
51467
- Promise._immediateFn(function() {
51468
- var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;
51469
- if (cb === null) {
51470
- (self._state === 1 ? resolve : reject)(deferred.promise, self._value);
51471
- return;
51472
- }
51473
- var ret;
51474
- try {
51475
- ret = cb(self._value);
51476
- } catch (e) {
51477
- reject(deferred.promise, e);
51478
- return;
51479
- }
51480
- resolve(deferred.promise, ret);
51481
- });
51482
- }
51483
-
51484
- function resolve(self, newValue) {
51485
- try {
51486
- // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure
51487
- if (newValue === self)
51488
- throw new TypeError('A promise cannot be resolved with itself.');
51489
- if (
51490
- newValue &&
51491
- (typeof newValue === 'object' || typeof newValue === 'function')
51492
- ) {
51493
- var then = newValue.then;
51494
- if (newValue instanceof Promise) {
51495
- self._state = 3;
51496
- self._value = newValue;
51497
- finale(self);
51498
- return;
51499
- } else if (typeof then === 'function') {
51500
- doResolve(bind(then, newValue), self);
51501
- return;
51502
- }
51503
- }
51504
- self._state = 1;
51505
- self._value = newValue;
51506
- finale(self);
51507
- } catch (e) {
51508
- reject(self, e);
51509
- }
51510
- }
51511
-
51512
- function reject(self, newValue) {
51513
- self._state = 2;
51514
- self._value = newValue;
51515
- finale(self);
51516
- }
51517
-
51518
- function finale(self) {
51519
- if (self._state === 2 && self._deferreds.length === 0) {
51520
- Promise._immediateFn(function() {
51521
- if (!self._handled) {
51522
- Promise._unhandledRejectionFn(self._value);
51523
- }
51524
- });
51525
- }
51526
-
51527
- for (var i = 0, len = self._deferreds.length; i < len; i++) {
51528
- handle(self, self._deferreds[i]);
51529
- }
51530
- self._deferreds = null;
51531
- }
51532
-
51533
- /**
51534
- * @constructor
51535
- */
51536
- function Handler(onFulfilled, onRejected, promise) {
51537
- this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;
51538
- this.onRejected = typeof onRejected === 'function' ? onRejected : null;
51539
- this.promise = promise;
51540
- }
51541
-
51542
- /**
51543
- * Take a potentially misbehaving resolver function and make sure
51544
- * onFulfilled and onRejected are only called once.
51545
- *
51546
- * Makes no guarantees about asynchrony.
51547
- */
51548
- function doResolve(fn, self) {
51549
- var done = false;
51550
- try {
51551
- fn(
51552
- function(value) {
51553
- if (done) return;
51554
- done = true;
51555
- resolve(self, value);
51556
- },
51557
- function(reason) {
51558
- if (done) return;
51559
- done = true;
51560
- reject(self, reason);
51561
- }
51562
- );
51563
- } catch (ex) {
51564
- if (done) return;
51565
- done = true;
51566
- reject(self, ex);
51567
- }
51568
- }
51569
-
51570
- Promise.prototype['catch'] = function(onRejected) {
51571
- return this.then(null, onRejected);
51572
- };
51573
-
51574
- Promise.prototype.then = function(onFulfilled, onRejected) {
51575
- // @ts-ignore
51576
- var prom = new this.constructor(noop);
51577
-
51578
- handle(this, new Handler(onFulfilled, onRejected, prom));
51579
- return prom;
51580
- };
51581
-
51582
- Promise.prototype['finally'] = finallyConstructor;
51583
-
51584
- Promise.all = function(arr) {
51585
- return new Promise(function(resolve, reject) {
51586
- if (!isArray(arr)) {
51587
- return reject(new TypeError('Promise.all accepts an array'));
51588
- }
51589
-
51590
- var args = Array.prototype.slice.call(arr);
51591
- if (args.length === 0) return resolve([]);
51592
- var remaining = args.length;
51593
-
51594
- function res(i, val) {
51595
- try {
51596
- if (val && (typeof val === 'object' || typeof val === 'function')) {
51597
- var then = val.then;
51598
- if (typeof then === 'function') {
51599
- then.call(
51600
- val,
51601
- function(val) {
51602
- res(i, val);
51603
- },
51604
- reject
51605
- );
51606
- return;
51607
- }
51608
- }
51609
- args[i] = val;
51610
- if (--remaining === 0) {
51611
- resolve(args);
51612
- }
51613
- } catch (ex) {
51614
- reject(ex);
51615
- }
51616
- }
51617
-
51618
- for (var i = 0; i < args.length; i++) {
51619
- res(i, args[i]);
51620
- }
51621
- });
51622
- };
51623
-
51624
- Promise.allSettled = allSettled;
51625
-
51626
- Promise.resolve = function(value) {
51627
- if (value && typeof value === 'object' && value.constructor === Promise) {
51628
- return value;
51629
- }
51630
-
51631
- return new Promise(function(resolve) {
51632
- resolve(value);
51633
- });
51634
- };
51635
-
51636
- Promise.reject = function(value) {
51637
- return new Promise(function(resolve, reject) {
51638
- reject(value);
51639
- });
51640
- };
51641
-
51642
- Promise.race = function(arr) {
51643
- return new Promise(function(resolve, reject) {
51644
- if (!isArray(arr)) {
51645
- return reject(new TypeError('Promise.race accepts an array'));
51646
- }
51647
-
51648
- for (var i = 0, len = arr.length; i < len; i++) {
51649
- Promise.resolve(arr[i]).then(resolve, reject);
51650
- }
51651
- });
51652
- };
51653
-
51654
- // Use polyfill for setImmediate for performance gains
51655
- Promise._immediateFn =
51656
- // @ts-ignore
51657
- (typeof setImmediate === 'function' &&
51658
- function(fn) {
51659
- // @ts-ignore
51660
- setImmediate(fn);
51661
- }) ||
51662
- function(fn) {
51663
- setTimeoutFunc(fn, 0);
51664
- };
51665
-
51666
- Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) {
51667
- if (typeof console !== 'undefined' && console) {
51668
- console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console
51669
- }
51670
- };
51671
-
51672
- return Promise;
51673
-
51674
- })));
51675
-
51676
- var Promise$2 = Promise$1;
51677
-
51678
51321
  var b64 = (function() {
51679
51322
 
51680
51323
  var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_'.split('');
@@ -51841,7 +51484,7 @@ var WorkerFactory = /*#__PURE__*/createInlineWorkerFactory(/* rollup-plugin-web-
51841
51484
  postMessage({ ready: true });
51842
51485
  // This unresolved promise keeps the lock held with the worker until the worker is
51843
51486
  // terminated at which point the lock is released.
51844
- return new Promise$2(() => { });
51487
+ return new Promise(() => { });
51845
51488
  });
51846
51489
  }
51847
51490
  return;