@pendo/agent 2.320.2 → 2.320.3

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.
@@ -3967,8 +3967,8 @@ let SERVER = '';
3967
3967
  let ASSET_HOST = '';
3968
3968
  let ASSET_PATH = '';
3969
3969
  let DESIGNER_SERVER = '';
3970
- let VERSION = '2.320.2_';
3971
- let PACKAGE_VERSION = '2.320.2';
3970
+ let VERSION = '2.320.3_';
3971
+ let PACKAGE_VERSION = '2.320.3';
3972
3972
  let LOADER = 'xhr';
3973
3973
  /* eslint-enable web-sdk-eslint-rules/no-gulp-env-references */
3974
3974
  /**
@@ -40598,12 +40598,12 @@ function TextCapture() {
40598
40598
  return {
40599
40599
  name: 'TextCapture',
40600
40600
  initialize: init,
40601
- teardown,
40602
- isEnabled,
40603
- isTextCapturable,
40604
- hasWhitelist,
40601
+ teardown: teardown,
40602
+ isEnabled: isEnabled,
40603
+ isTextCapturable: isTextCapturable,
40604
+ hasWhitelist: hasWhitelist,
40605
40605
  serializer: textSerializer,
40606
- guideActivity
40606
+ guideActivity: guideActivity
40607
40607
  };
40608
40608
  // technically not idempotent but might actually be right. not sure.
40609
40609
  function init(pendo, PluginAPI) {
@@ -40642,30 +40642,30 @@ function TextCapture() {
40642
40642
  function guideActivity(pendo, event) {
40643
40643
  if (!isEnabled())
40644
40644
  return;
40645
- const { _ } = pendo;
40646
- const eventData = event.data[0];
40645
+ var _ = pendo._;
40646
+ var eventData = event.data[0];
40647
40647
  if (eventData && eventData.type === 'guideActivity') {
40648
- const shownSteps = _.reduce(pendo.getActiveGuides({ channel: '*' }), (shown, guide) => {
40648
+ var shownSteps = _.reduce(pendo.getActiveGuides({ channel: '*' }), function (shown, guide) {
40649
40649
  if (guide.isShown()) {
40650
- return shown.concat(_.filter(guide.steps, (step) => step.isShown()));
40650
+ return shown.concat(_.filter(guide.steps, function (step) { return step.isShown(); }));
40651
40651
  }
40652
40652
  return shown;
40653
40653
  }, []);
40654
40654
  if (!shownSteps.length)
40655
40655
  return;
40656
- const findDomBlockInDomJson = pendo.BuildingBlocks.BuildingBlockGuides.findDomBlockInDomJson;
40657
- let elementJson;
40658
- _.find(shownSteps, (step) => {
40656
+ var findDomBlockInDomJson_1 = pendo.BuildingBlocks.BuildingBlockGuides.findDomBlockInDomJson;
40657
+ var elementJson_1;
40658
+ _.find(shownSteps, function (step) {
40659
40659
  if (!step.domJson)
40660
40660
  return false;
40661
- elementJson = findDomBlockInDomJson(step.domJson, function (domJson) {
40661
+ elementJson_1 = findDomBlockInDomJson_1(step.domJson, function (domJson) {
40662
40662
  return domJson.props && domJson.props.id && domJson.props.id === eventData.props.ui_element_id;
40663
40663
  });
40664
- return elementJson;
40664
+ return elementJson_1;
40665
40665
  });
40666
- if (!elementJson)
40666
+ if (!elementJson_1)
40667
40667
  return;
40668
- eventData.props.ui_element_text = elementJson.content;
40668
+ eventData.props.ui_element_text = elementJson_1.content;
40669
40669
  }
40670
40670
  }
40671
40671
  function isEnabled() {
@@ -42375,22 +42375,22 @@ const startListening = (
42375
42375
  };
42376
42376
 
42377
42377
  function VocPortal() {
42378
- let pendoGlobal;
42379
- let pluginAPI;
42378
+ var pendoGlobal;
42379
+ var pluginAPI;
42380
42380
  return {
42381
42381
  name: 'VocPortal',
42382
- initialize,
42383
- routeHandlerLookup,
42384
- queryMessageHandler,
42385
- resizeMessageHandler,
42386
- teardown
42382
+ initialize: initialize,
42383
+ routeHandlerLookup: routeHandlerLookup,
42384
+ queryMessageHandler: queryMessageHandler,
42385
+ resizeMessageHandler: resizeMessageHandler,
42386
+ teardown: teardown
42387
42387
  };
42388
42388
  function initialize(pendo, PluginAPI) {
42389
42389
  pendoGlobal = pendo;
42390
42390
  pluginAPI = PluginAPI;
42391
- const { frameId } = PluginAPI.EventTracer.addTracerIds({});
42391
+ var frameId = PluginAPI.EventTracer.addTracerIds({}).frameId;
42392
42392
  this.removeResizeEvent = pendoGlobal.attachEvent(window, 'resize', resizePortalIframe);
42393
- startListening('VocPortal', frameId, routeHandlerLookup, () => '*');
42393
+ startListening('VocPortal', frameId, routeHandlerLookup, function () { return '*'; });
42394
42394
  }
42395
42395
  function routeHandlerLookup(path) {
42396
42396
  switch (path) {
@@ -42403,14 +42403,14 @@ function VocPortal() {
42403
42403
  }
42404
42404
  }
42405
42405
  function resizePortalIframe() {
42406
- const vocPortalRcContainer = document.getElementById('pendo-resource-center-container');
42407
- const vocPortalRcDOM = pendoGlobal.dom(vocPortalRcContainer);
42406
+ var vocPortalRcContainer = document.getElementById('pendo-resource-center-container');
42407
+ var vocPortalRcDOM = pendoGlobal.dom(vocPortalRcContainer);
42408
42408
  pluginAPI.sizeElements(vocPortalRcDOM);
42409
42409
  }
42410
42410
  function queryMessageHandler(_, responseHandler) {
42411
- const metadata = pendoGlobal.getSerializedMetadata();
42412
- const sandBoxMode = !!pendoGlobal.designer || pluginAPI.store.getters['preview/isInPreviewMode']();
42413
- const response = {
42411
+ var metadata = pendoGlobal.getSerializedMetadata();
42412
+ var sandBoxMode = !!pendoGlobal.designer || pluginAPI.store.getters['preview/isInPreviewMode']();
42413
+ var response = {
42414
42414
  apiKey: pendoGlobal.apiKey,
42415
42415
  url: pendoGlobal.url.externalizeURL(),
42416
42416
  visitor: metadata.visitor,
@@ -42424,26 +42424,19 @@ function VocPortal() {
42424
42424
  }
42425
42425
  function resizeMessageHandler(msg) {
42426
42426
  try {
42427
- const { 'value': widthValue, 'unit': widthUnit, 'isImportant': widthIsImportant } = msg.data.width;
42428
- const { 'value': heightValue, 'unit': heightUnit, 'isImportant': heightIsImportant } = msg.data.height;
42427
+ var _a = msg.data.width, widthValue = _a["value"], widthUnit = _a["unit"], widthIsImportant = _a["isImportant"];
42428
+ var _b = msg.data.height, heightValue = _b["value"], heightUnit = _b["unit"], heightIsImportant = _b["isImportant"];
42429
42429
  if (typeof widthValue !== 'number' || typeof heightValue !== 'number') {
42430
42430
  return;
42431
42431
  }
42432
- const validUnits = ['px', '%', 'vh', 'vw'];
42432
+ var validUnits = ['px', '%', 'vh', 'vw'];
42433
42433
  if (!pendoGlobal._.contains(validUnits, widthUnit) || !pendoGlobal._.contains(validUnits, heightUnit)) {
42434
42434
  return;
42435
42435
  }
42436
- const width = `${widthValue}${widthUnit}${widthIsImportant ? ' !important' : ''}`;
42437
- const height = `${heightValue}${heightUnit}${heightIsImportant ? ' !important' : ''}`;
42438
- const container = document.getElementById('pendo-resource-center-container');
42439
- pluginAPI.util.addInlineStyles('pendo-voc-portal-styles', `#pendo-resource-center-container:has(iframe[src*="portal"][src*="mode=rc"]) {
42440
- width: ${width};
42441
- height: ${height};
42442
- ._pendo-step-container-size {
42443
- width: ${width};
42444
- height: ${height};
42445
- }
42446
- }`, container);
42436
+ var width = "".concat(widthValue).concat(widthUnit).concat(widthIsImportant ? ' !important' : '');
42437
+ var height = "".concat(heightValue).concat(heightUnit).concat(heightIsImportant ? ' !important' : '');
42438
+ var container = document.getElementById('pendo-resource-center-container');
42439
+ pluginAPI.util.addInlineStyles('pendo-voc-portal-styles', "#pendo-resource-center-container:has(iframe[src*=\"portal\"][src*=\"mode=rc\"]) {\n width: ".concat(width, ";\n height: ").concat(height, ";\n ._pendo-step-container-size {\n width: ").concat(width, ";\n height: ").concat(height, ";\n }\n }"), container);
42447
42440
  resizePortalIframe();
42448
42441
  }
42449
42442
  catch (err) {
@@ -46492,7 +46485,10 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
46492
46485
  removes: [{ index: index2 }]
46493
46486
  });
46494
46487
  }
46495
- return target.apply(thisArg, argumentsList);
46488
+ try {
46489
+ return target.apply(thisArg, argumentsList);
46490
+ } catch (e2) {
46491
+ }
46496
46492
  }
46497
46493
  )
46498
46494
  });
@@ -46621,7 +46617,10 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
46621
46617
  ]
46622
46618
  });
46623
46619
  }
46624
- return target.apply(thisArg, argumentsList);
46620
+ try {
46621
+ return target.apply(thisArg, argumentsList);
46622
+ } catch (e2) {
46623
+ }
46625
46624
  }
46626
46625
  )
46627
46626
  }
@@ -48627,61 +48626,6 @@ var n;
48627
48626
  }(n || (n = {}));
48628
48627
  return record; }
48629
48628
 
48630
- var SessionRecorderBuffer = /** @class */ (function () {
48631
- function SessionRecorderBuffer(interval, maxCount) {
48632
- if (maxCount === void 0) { maxCount = Infinity; }
48633
- this.data = [];
48634
- this.sequenceNumber = 0;
48635
- this.interval = interval;
48636
- this.maxCount = maxCount;
48637
- this.doubledMaxCount = maxCount * 2;
48638
- }
48639
- SessionRecorderBuffer.prototype.isEmpty = function () {
48640
- return this.data.length === 0;
48641
- };
48642
- SessionRecorderBuffer.prototype.count = function () {
48643
- return this.data.length;
48644
- };
48645
- SessionRecorderBuffer.prototype.clear = function () {
48646
- this.data.length = 0;
48647
- };
48648
- SessionRecorderBuffer.prototype.clearSequence = function () {
48649
- this.sequenceNumber = 0;
48650
- };
48651
- SessionRecorderBuffer.prototype.push = function (event) {
48652
- this.data.push(event);
48653
- this.checkRateLimit();
48654
- };
48655
- SessionRecorderBuffer.prototype.pack = function (envelope, _) {
48656
- var eventsToSend = this.data.splice(0, this.maxCount);
48657
- envelope.recordingPayload = eventsToSend;
48658
- envelope.sequence = this.sequenceNumber;
48659
- envelope.recordingPayloadCount = eventsToSend.length;
48660
- if (eventsToSend.length) {
48661
- envelope.browserTime = eventsToSend[0].timestamp;
48662
- }
48663
- envelope.recordingPayloadMetadata = _.map(eventsToSend, function (event) {
48664
- var metadata = _.pick(event, 'type', 'timestamp');
48665
- if (event.data) {
48666
- metadata.data = _.pick(event.data, 'source', 'type', 'x', 'y', 'id', 'height', 'width', 'href');
48667
- }
48668
- return metadata;
48669
- });
48670
- this.sequenceNumber += eventsToSend.length;
48671
- return envelope;
48672
- };
48673
- SessionRecorderBuffer.prototype.checkRateLimit = function () {
48674
- var length = this.data.length;
48675
- if (length >= this.doubledMaxCount && length % this.maxCount === 0) {
48676
- var elapsed = this.data[length - 1].timestamp - this.data[length - this.doubledMaxCount].timestamp;
48677
- if (elapsed <= this.interval && this.onRateLimit) {
48678
- this.onRateLimit();
48679
- }
48680
- }
48681
- };
48682
- return SessionRecorderBuffer;
48683
- }());
48684
-
48685
48629
  var __assign = function() {
48686
48630
  __assign = Object.assign || function __assign(t) {
48687
48631
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -48748,6 +48692,61 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
48748
48692
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
48749
48693
  };
48750
48694
 
48695
+ var SessionRecorderBuffer = /** @class */ (function () {
48696
+ function SessionRecorderBuffer(interval, maxCount) {
48697
+ if (maxCount === void 0) { maxCount = Infinity; }
48698
+ this.data = [];
48699
+ this.sequenceNumber = 0;
48700
+ this.interval = interval;
48701
+ this.maxCount = maxCount;
48702
+ this.doubledMaxCount = maxCount * 2;
48703
+ }
48704
+ SessionRecorderBuffer.prototype.isEmpty = function () {
48705
+ return this.data.length === 0;
48706
+ };
48707
+ SessionRecorderBuffer.prototype.count = function () {
48708
+ return this.data.length;
48709
+ };
48710
+ SessionRecorderBuffer.prototype.clear = function () {
48711
+ this.data.length = 0;
48712
+ };
48713
+ SessionRecorderBuffer.prototype.clearSequence = function () {
48714
+ this.sequenceNumber = 0;
48715
+ };
48716
+ SessionRecorderBuffer.prototype.push = function (event) {
48717
+ this.data.push(event);
48718
+ this.checkRateLimit();
48719
+ };
48720
+ SessionRecorderBuffer.prototype.pack = function (envelope, _) {
48721
+ var eventsToSend = this.data.splice(0, this.maxCount);
48722
+ envelope.recordingPayload = eventsToSend;
48723
+ envelope.sequence = this.sequenceNumber;
48724
+ envelope.recordingPayloadCount = eventsToSend.length;
48725
+ if (eventsToSend.length) {
48726
+ envelope.browserTime = eventsToSend[0].timestamp;
48727
+ }
48728
+ envelope.recordingPayloadMetadata = _.map(eventsToSend, function (event) {
48729
+ var metadata = _.pick(event, 'type', 'timestamp');
48730
+ if (event.data) {
48731
+ metadata.data = _.pick(event.data, 'source', 'type', 'x', 'y', 'id', 'height', 'width', 'href');
48732
+ }
48733
+ return metadata;
48734
+ });
48735
+ this.sequenceNumber += eventsToSend.length;
48736
+ return envelope;
48737
+ };
48738
+ SessionRecorderBuffer.prototype.checkRateLimit = function () {
48739
+ var length = this.data.length;
48740
+ if (length >= this.doubledMaxCount && length % this.maxCount === 0) {
48741
+ var elapsed = this.data[length - 1].timestamp - this.data[length - this.doubledMaxCount].timestamp;
48742
+ if (elapsed <= this.interval && this.onRateLimit) {
48743
+ this.onRateLimit();
48744
+ }
48745
+ }
48746
+ };
48747
+ return SessionRecorderBuffer;
48748
+ }());
48749
+
48751
48750
  var RECORDING_CONFIG_WORKERURL$1 = 'recording.workerUrl';
48752
48751
  var MAX_SIZE = 2000000;
48753
48752
  var RESOURCE_CACHING$1 = 'resourceCaching';
@@ -48982,33 +48981,33 @@ function maskText(options, text, element) {
48982
48981
  return text;
48983
48982
  }
48984
48983
 
48985
- const RECORDING_CONFIG = 'recording';
48986
- const RECORDING_CONFIG_ENABLED = 'recording.enabled';
48987
- const RECORDING_CONFIG_AUTO_START = 'recording.autoStart';
48988
- const RECORDING_CONFIG_WORKERURL = 'recording.workerUrl';
48989
- const RECORDING_CONFIG_ON_RECORDING_START = 'recording.onRecordingStart';
48990
- const RECORDING_CONFIG_ON_RECORDING_STOP = 'recording.onRecordingStop';
48991
- const RECORDING_CONFIG_WORKER_OVERRIDE = 'recording.workerOverride';
48992
- const RECORDING_CONFIG_TREAT_IFRAME_AS_ROOT = 'recording.treatIframeAsRoot';
48993
- const RECORDING_CONFIG_DISABLE_UNLOAD = 'recording.disableUnload';
48994
- const RESOURCE_CACHING = 'resourceCaching';
48995
- const ONE_DAY_IN_MILLISECONDS = 24 * 60 * 60 * 1000;
48996
- const ONE_MINUTE_IN_MILLISECONDS = 60 * 1000;
48997
- const THIRTY_MINUTES = 1000 * 60 * 30;
48998
- const ONE_HUNDRED_MB_IN_BYTES = 100 * 1024 * 1024;
48999
- const SESSION_RECORDING_ID = 'pendo_srId';
49000
- const SESSION_RECORDING_LAST_USER_INTERACTION_EVENT = 'pendo_srLastUserInteractionEvent';
49001
- const SEND_INTERVAL = 5000;
49002
- const MAX_SEND_COUNT = 20000;
49003
- const EVENT_TYPES = {
48984
+ var RECORDING_CONFIG = 'recording';
48985
+ var RECORDING_CONFIG_ENABLED = 'recording.enabled';
48986
+ var RECORDING_CONFIG_AUTO_START = 'recording.autoStart';
48987
+ var RECORDING_CONFIG_WORKERURL = 'recording.workerUrl';
48988
+ var RECORDING_CONFIG_ON_RECORDING_START = 'recording.onRecordingStart';
48989
+ var RECORDING_CONFIG_ON_RECORDING_STOP = 'recording.onRecordingStop';
48990
+ var RECORDING_CONFIG_WORKER_OVERRIDE = 'recording.workerOverride';
48991
+ var RECORDING_CONFIG_TREAT_IFRAME_AS_ROOT = 'recording.treatIframeAsRoot';
48992
+ var RECORDING_CONFIG_DISABLE_UNLOAD = 'recording.disableUnload';
48993
+ var RESOURCE_CACHING = 'resourceCaching';
48994
+ var ONE_DAY_IN_MILLISECONDS = 24 * 60 * 60 * 1000;
48995
+ var ONE_MINUTE_IN_MILLISECONDS = 60 * 1000;
48996
+ var THIRTY_MINUTES = 1000 * 60 * 30;
48997
+ var ONE_HUNDRED_MB_IN_BYTES = 100 * 1024 * 1024;
48998
+ var SESSION_RECORDING_ID = 'pendo_srId';
48999
+ var SESSION_RECORDING_LAST_USER_INTERACTION_EVENT = 'pendo_srLastUserInteractionEvent';
49000
+ var SEND_INTERVAL = 5000;
49001
+ var MAX_SEND_COUNT = 20000;
49002
+ var EVENT_TYPES = {
49004
49003
  INCREMENTAL_SOURCE_MUTATION: 0,
49005
49004
  FULL_SNAPSHOT: 2,
49006
49005
  INCREMENTAL_SNAPSHOT: 3,
49007
49006
  META: 4,
49008
49007
  INCREMENTAL_SOURCE_INPUT: 5
49009
49008
  };
49010
- class SessionRecorder {
49011
- constructor(rrwebRecord, WorkerClass) {
49009
+ var SessionRecorder = /** @class */ (function () {
49010
+ function SessionRecorder(rrwebRecord, WorkerClass) {
49012
49011
  this.name = 'Replay';
49013
49012
  this.record = rrwebRecord;
49014
49013
  this.WorkerClass = WorkerClass;
@@ -49016,8 +49015,8 @@ class SessionRecorder {
49016
49015
  this.eventsSinceLastKeyFrame = 0;
49017
49016
  this.currentRecordingSize = 0;
49018
49017
  }
49019
- addConfigOptions() {
49020
- const cf = this.api.ConfigReader;
49018
+ SessionRecorder.prototype.addConfigOptions = function () {
49019
+ var cf = this.api.ConfigReader;
49021
49020
  cf.addOption(RECORDING_CONFIG, [cf.sources.PENDO_CONFIG_SRC], {});
49022
49021
  /**
49023
49022
  * Determines if replay will immediately begin collecting data. If false, you can resume collecting
@@ -49103,12 +49102,12 @@ class SessionRecorder {
49103
49102
  */
49104
49103
  cf.addOption(RECORDING_CONFIG_TREAT_IFRAME_AS_ROOT, [cf.sources.SNIPPET_SRC], undefined);
49105
49104
  cf.addOption(RESOURCE_CACHING, [cf.sources.PENDO_CONFIG_SRC], undefined);
49106
- }
49107
- initialize(pendo, PluginAPI) {
49105
+ };
49106
+ SessionRecorder.prototype.initialize = function (pendo, PluginAPI) {
49108
49107
  this.pendo = pendo;
49109
49108
  this.api = PluginAPI;
49110
- const bind = this.pendo._.bind;
49111
- const configReader = this.api.ConfigReader;
49109
+ var bind = this.pendo._.bind;
49110
+ var configReader = this.api.ConfigReader;
49112
49111
  this.buffer = new SessionRecorderBuffer(SEND_INTERVAL, MAX_SEND_COUNT);
49113
49112
  this.buffer.onRateLimit = bind(this.rateLimitExceeded, this);
49114
49113
  this.transport = new Transport(this.WorkerClass, this.pendo, this.api);
@@ -49126,8 +49125,8 @@ class SessionRecorder {
49126
49125
  ? configReader.get(RECORDING_CONFIG_ON_RECORDING_START) : function () { };
49127
49126
  this.onRecordingStop = this.pendo._.isFunction(configReader.get(RECORDING_CONFIG_ON_RECORDING_STOP))
49128
49127
  ? configReader.get(RECORDING_CONFIG_ON_RECORDING_STOP) : function () { };
49129
- let isSessionReplayEnabled = false;
49130
- const snippetOverrideValue = configReader.get(RECORDING_CONFIG_ENABLED);
49128
+ var isSessionReplayEnabled = false;
49129
+ var snippetOverrideValue = configReader.get(RECORDING_CONFIG_ENABLED);
49131
49130
  // The snippet config value should take precedence over whatever value the backend returns,
49132
49131
  // but ONLY for replay being enabled - all other values should be taken from the backend
49133
49132
  if (this.pendo._.isBoolean(snippetOverrideValue)) {
@@ -49146,7 +49145,7 @@ class SessionRecorder {
49146
49145
  this.api.log.info('Session Replay is disabled because excludeNonGuideAnalytics is enabled');
49147
49146
  return;
49148
49147
  }
49149
- const sessionIdKey = this.sessionIdKey = `${SESSION_RECORDING_ID}.${this.pendo.apiKey}`;
49148
+ var sessionIdKey = this.sessionIdKey = "".concat(SESSION_RECORDING_ID, ".").concat(this.pendo.apiKey);
49150
49149
  this.pendo.recording = {
49151
49150
  start: bind(this.start, this),
49152
49151
  stop: bind(this.stop, this)
@@ -49187,8 +49186,8 @@ class SessionRecorder {
49187
49186
  * @label SESSION_RECORDING_LAST_USER_INTERACTION_EVENT
49188
49187
  */
49189
49188
  this.api.agentStorage.registry.addSession(SESSION_RECORDING_LAST_USER_INTERACTION_EVENT);
49190
- }
49191
- teardown() {
49189
+ };
49190
+ SessionRecorder.prototype.teardown = function () {
49192
49191
  delete this.pendo.recording;
49193
49192
  delete this.allowStart;
49194
49193
  this.pendo._.each(this.subscriptions, function (unsubscribe) {
@@ -49198,35 +49197,36 @@ class SessionRecorder {
49198
49197
  this.subscriptions.length = 0;
49199
49198
  this.stop();
49200
49199
  this.transport.stop();
49201
- }
49202
- ready() {
49200
+ };
49201
+ SessionRecorder.prototype.ready = function () {
49203
49202
  if (this.api.ConfigReader.get(RECORDING_CONFIG_AUTO_START) !== false) {
49204
49203
  this.start();
49205
49204
  }
49206
- }
49207
- addPageLifecycleListeners() {
49205
+ };
49206
+ SessionRecorder.prototype.addPageLifecycleListeners = function () {
49207
+ var _this = this;
49208
49208
  // It's important these event listeners use the capture phase, so making it explicit.
49209
- const useCapture = true;
49210
- this.pendo._.each(['pageshow', 'focus', 'blur', 'visibilitychange', 'resume'], (type) => {
49211
- this.pageLifecycleListeners.push(this.api.attachEventInternal(window, type, this.pendo._.bind(this.checkPageLifecycleState, this), useCapture));
49209
+ var useCapture = true;
49210
+ this.pendo._.each(['pageshow', 'focus', 'blur', 'visibilitychange', 'resume'], function (type) {
49211
+ _this.pageLifecycleListeners.push(_this.api.attachEventInternal(window, type, _this.pendo._.bind(_this.checkPageLifecycleState, _this), useCapture));
49212
49212
  });
49213
- }
49214
- removePageLifecycleListeners() {
49213
+ };
49214
+ SessionRecorder.prototype.removePageLifecycleListeners = function () {
49215
49215
  this.pendo._.each(this.pageLifecycleListeners, function (teardownFn) {
49216
49216
  teardownFn();
49217
49217
  });
49218
49218
  this.pageLifecycleListeners = [];
49219
- }
49220
- checkPageLifecycleState() {
49221
- const state = this.getPageLifecycleState();
49219
+ };
49220
+ SessionRecorder.prototype.checkPageLifecycleState = function () {
49221
+ var state = this.getPageLifecycleState();
49222
49222
  if (state === 'active' || state === 'passive') {
49223
49223
  if (!this.isRecording() && this.allowStart) {
49224
49224
  this.removePageLifecycleListeners();
49225
49225
  this.ready();
49226
49226
  }
49227
49227
  }
49228
- }
49229
- getPageLifecycleState() {
49228
+ };
49229
+ SessionRecorder.prototype.getPageLifecycleState = function () {
49230
49230
  if (document.visibilityState === 'hidden') {
49231
49231
  return 'hidden';
49232
49232
  }
@@ -49234,8 +49234,9 @@ class SessionRecorder {
49234
49234
  return 'active';
49235
49235
  }
49236
49236
  return 'passive';
49237
- }
49238
- changeIdentity(identifyEvent) {
49237
+ };
49238
+ SessionRecorder.prototype.changeIdentity = function (identifyEvent) {
49239
+ var _this = this;
49239
49240
  if (!this.allowStart)
49240
49241
  return;
49241
49242
  clearTimeout(this._changeIdentityTimer);
@@ -49250,55 +49251,56 @@ class SessionRecorder {
49250
49251
  }
49251
49252
  this.visitorId = identifyEvent.data[0].visitor_id;
49252
49253
  this.accountId = identifyEvent.data[0].account_id;
49253
- this._changeIdentityTimer = setTimeout$1(() => {
49254
- this._start();
49254
+ this._changeIdentityTimer = setTimeout$1(function () {
49255
+ _this._start();
49255
49256
  }, 500);
49256
- }
49257
- changeMetadata(metadataEvent) {
49258
- const { hashChanged, options } = metadataEvent.data[0];
49257
+ };
49258
+ SessionRecorder.prototype.changeMetadata = function (metadataEvent) {
49259
+ var _a = metadataEvent.data[0], hashChanged = _a.hashChanged, options = _a.options;
49259
49260
  if (this.allowStart && hashChanged) {
49260
49261
  clearTimeout(this._changeIdentityTimer);
49261
49262
  this.visitorId = options.visitor.id;
49262
49263
  this.accountId = options.account.id;
49263
49264
  return this.checkVisitorEligibility();
49264
49265
  }
49265
- }
49266
- checkVisitorEligibility(continuationCallback) {
49266
+ };
49267
+ SessionRecorder.prototype.checkVisitorEligibility = function (continuationCallback) {
49268
+ var _this = this;
49267
49269
  if (!this.isRecording() && this.pendo._.isNull(this.visitorId) && this.pendo._.isNull(this.accountId))
49268
49270
  return;
49269
49271
  this.isCheckingVisitorEligibility = true;
49270
- return this.fetchVisitorConfig().then(visitorConfig => {
49271
- if ((!visitorConfig || !visitorConfig.enable) && this.isRecording()) {
49272
- this.stop();
49272
+ return this.fetchVisitorConfig().then(function (visitorConfig) {
49273
+ if ((!visitorConfig || !visitorConfig.enable) && _this.isRecording()) {
49274
+ _this.stop();
49273
49275
  }
49274
- if (visitorConfig && visitorConfig.enable && this.isRecording()) {
49276
+ if (visitorConfig && visitorConfig.enable && _this.isRecording()) {
49275
49277
  if (continuationCallback) {
49276
- continuationCallback.call(this);
49278
+ continuationCallback.call(_this);
49277
49279
  }
49278
- this.api.Events.trigger('recording:unpaused');
49280
+ _this.api.Events.trigger('recording:unpaused');
49279
49281
  }
49280
- if (visitorConfig && visitorConfig.enable && !this.isRecording()) {
49281
- this._startRecordingForVisitor(visitorConfig);
49282
+ if (visitorConfig && visitorConfig.enable && !_this.isRecording()) {
49283
+ _this._startRecordingForVisitor(visitorConfig);
49282
49284
  }
49283
- this.isCheckingVisitorEligibility = false;
49284
- }).catch((e) => {
49285
- this.isCheckingVisitorEligibility = false;
49286
- this.api.log.critical('Failed to re-fetch recording config', { error: e });
49287
- this.logStopReason('VISITOR_CONFIG_ERROR');
49285
+ _this.isCheckingVisitorEligibility = false;
49286
+ })["catch"](function (e) {
49287
+ _this.isCheckingVisitorEligibility = false;
49288
+ _this.api.log.critical('Failed to re-fetch recording config', { error: e });
49289
+ _this.logStopReason('VISITOR_CONFIG_ERROR');
49288
49290
  });
49289
- }
49290
- snapshot() {
49291
+ };
49292
+ SessionRecorder.prototype.snapshot = function () {
49291
49293
  if (!this.isRecording())
49292
49294
  return;
49293
49295
  this.send();
49294
49296
  this.record.takeFullSnapshot();
49295
- }
49296
- isRecording() {
49297
+ };
49298
+ SessionRecorder.prototype.isRecording = function () {
49297
49299
  return this.interval != null;
49298
- }
49299
- recordingConfig(visitorConfig) {
49300
- const recordingOptions = this.pendo._.extend({}, this.config.options, visitorConfig);
49301
- const maskOptions = {
49300
+ };
49301
+ SessionRecorder.prototype.recordingConfig = function (visitorConfig) {
49302
+ var recordingOptions = this.pendo._.extend({}, this.config.options, visitorConfig);
49303
+ var maskOptions = {
49302
49304
  maskAllText: recordingOptions.privateByDefault != null ? recordingOptions.privateByDefault : true,
49303
49305
  maskTextSelector: ['.pendo-sr-mask'].concat(recordingOptions.maskedSelectors || []).join(','),
49304
49306
  unmaskTextSelector: ['.pendo-sr-unmask'].concat(recordingOptions.unmaskedSelectors || []).join(','),
@@ -49313,9 +49315,9 @@ class SessionRecorder {
49313
49315
  password: true,
49314
49316
  tel: true
49315
49317
  });
49316
- const blockedSelectors = ['.pendo-ignore', '.pendo-sr-ignore'].concat(recordingOptions.blockedSelectors || []);
49317
- const hiddenSelectors = ['.pendo-sr-hide'].concat(recordingOptions.hiddenSelectors || []);
49318
- const config = {
49318
+ var blockedSelectors = ['.pendo-ignore', '.pendo-sr-ignore'].concat(recordingOptions.blockedSelectors || []);
49319
+ var hiddenSelectors = ['.pendo-sr-hide'].concat(recordingOptions.hiddenSelectors || []);
49320
+ var config = {
49319
49321
  maskInputFn: this.pendo._.partial(maskInput, maskOptions),
49320
49322
  maskTextFn: this.pendo._.partial(maskText, maskOptions),
49321
49323
  maskTextSelector: '*',
@@ -49329,7 +49331,7 @@ class SessionRecorder {
49329
49331
  emitFromIframe: !!this.api.ConfigReader.get(RECORDING_CONFIG_TREAT_IFRAME_AS_ROOT)
49330
49332
  };
49331
49333
  return config;
49332
- }
49334
+ };
49333
49335
  /**
49334
49336
  * Used to start collecting replay data.
49335
49337
  *
@@ -49339,67 +49341,71 @@ class SessionRecorder {
49339
49341
  * @example
49340
49342
  * pendo.recording.start()
49341
49343
  */
49342
- start() {
49344
+ SessionRecorder.prototype.start = function () {
49343
49345
  this._restartPtm = this.api.analytics.ptm().pause();
49344
49346
  this.allowStart = true;
49345
49347
  this.visitorId = this.pendo.get_visitor_id();
49346
49348
  this.accountId = this.pendo.get_account_id();
49347
49349
  this._start();
49348
- }
49349
- _markEvents(events) {
49350
+ };
49351
+ SessionRecorder.prototype._markEvents = function (events) {
49350
49352
  if (!this.recordingId || !this.isRecording())
49351
49353
  return;
49352
- for (var e of events) {
49354
+ for (var _i = 0, events_1 = events; _i < events_1.length; _i++) {
49355
+ var e = events_1[_i];
49353
49356
  if ((e.visitor_id === this.visitorId || e.visitorId === this.visitorId) && e.type !== 'identify') {
49354
49357
  e.recordingId = this.recordingId;
49355
49358
  e.recordingSessionId = this.sessionId(this.recordingId);
49356
49359
  }
49357
49360
  }
49358
- }
49359
- restartPtm() {
49361
+ };
49362
+ SessionRecorder.prototype.restartPtm = function () {
49360
49363
  if (this.pendo._.isFunction(this._restartPtm)) {
49361
49364
  this._markEvents(this.pendo.buffers.events);
49362
- for (var silo of this.pendo.buffers.silos) {
49365
+ for (var _i = 0, _a = this.pendo.buffers.silos; _i < _a.length; _i++) {
49366
+ var silo = _a[_i];
49363
49367
  this._markEvents(silo);
49364
49368
  }
49365
49369
  this._restartPtm();
49366
49370
  this._restartPtm = null;
49367
49371
  }
49368
- }
49369
- _start() {
49372
+ };
49373
+ SessionRecorder.prototype._start = function () {
49374
+ var _this = this;
49370
49375
  if (this.isRecording())
49371
49376
  return;
49372
49377
  if (!this.pendo.isSendingEvents())
49373
49378
  return;
49374
49379
  if (!this.allowStart)
49375
49380
  return;
49376
- return this.fetchVisitorConfig().then(visitorConfig => {
49377
- if (!this.allowStart)
49381
+ return this.fetchVisitorConfig().then(function (visitorConfig) {
49382
+ if (!_this.allowStart)
49378
49383
  return;
49379
49384
  if (!visitorConfig || !visitorConfig.enable) {
49380
- this.restartPtm();
49381
- this.logStopReason('VISITOR_DISABLED');
49385
+ _this.restartPtm();
49386
+ _this.logStopReason('VISITOR_DISABLED');
49382
49387
  return;
49383
49388
  }
49384
- this._startRecordingForVisitor(visitorConfig);
49385
- }).catch((e) => {
49386
- this.restartPtm();
49389
+ _this._startRecordingForVisitor(visitorConfig);
49390
+ })["catch"](function (e) {
49391
+ _this.restartPtm();
49387
49392
  if (e && /Failed to fetch/.test(e.toString())) {
49388
49393
  return;
49389
49394
  }
49390
- this.api.log.critical('Failed to fetch recording config', {
49395
+ _this.api.log.critical('Failed to fetch recording config', {
49391
49396
  error: e,
49392
- visitorId: this.visitorId,
49393
- accountId: this.accountId,
49394
- url: this.pendo.url.get()
49397
+ visitorId: _this.visitorId,
49398
+ accountId: _this.accountId,
49399
+ url: _this.pendo.url.get()
49395
49400
  });
49396
- this.logStopReason('VISITOR_CONFIG_ERROR');
49401
+ _this.logStopReason('VISITOR_CONFIG_ERROR');
49397
49402
  });
49398
- }
49399
- _startRecordingForVisitor(visitorConfig) {
49403
+ };
49404
+ SessionRecorder.prototype._startRecordingForVisitor = function (visitorConfig) {
49405
+ var _this = this;
49400
49406
  this.api.Events.trigger('recording:unpaused');
49401
49407
  this.transport.start(this.config);
49402
- const disableFallback = this.pendo._.get(this.config, 'disableFallback', true);
49408
+ var disableFallback = this.pendo._.get(this.config, 'disableFallback', true);
49403
49409
  if (disableFallback && !this.transport.worker) {
49404
49410
  this.restartPtm();
49405
49411
  this.pendo.log('Worker failed to start and main thread fallback is disabled. Recording prevented from starting.');
@@ -49411,9 +49417,9 @@ class SessionRecorder {
49411
49417
  this.visitorConfig = visitorConfig;
49412
49418
  this.clearOldSessionId();
49413
49419
  this.sendQueue.start();
49414
- this.interval = setInterval(() => {
49415
- if (!this.sendQueue.failed()) {
49416
- this.send();
49420
+ this.interval = setInterval(function () {
49421
+ if (!_this.sendQueue.failed()) {
49422
+ _this.send();
49417
49423
  }
49418
49424
  }, SEND_INTERVAL);
49419
49425
  var config = this.recordingConfig(visitorConfig);
@@ -49428,8 +49434,8 @@ class SessionRecorder {
49428
49434
  this.restartPtm();
49429
49435
  this.logStopReason('RECORDING_ERROR');
49430
49436
  }
49431
- }
49432
- _sendIds() {
49437
+ };
49438
+ SessionRecorder.prototype._sendIds = function () {
49433
49439
  if (window != window.top)
49434
49440
  return;
49435
49441
  this.api.frames.getChannel().postMessage({
@@ -49438,16 +49444,16 @@ class SessionRecorder {
49438
49444
  _sessionId: this._sessionId,
49439
49445
  topId: this.api.store.state.frames.topId
49440
49446
  });
49441
- }
49442
- _refreshIds() {
49447
+ };
49448
+ SessionRecorder.prototype._refreshIds = function () {
49443
49449
  if (window == window.top)
49444
49450
  return;
49445
49451
  this.api.frames.getChannel().postMessage({
49446
49452
  type: 'pendo:sr:refresh'
49447
49453
  });
49448
- }
49449
- _frameMessage(e) {
49450
- const message = e.data;
49454
+ };
49455
+ SessionRecorder.prototype._frameMessage = function (e) {
49456
+ var message = e.data;
49451
49457
  if (message.type === 'pendo:sr:id') {
49452
49458
  // When useBroadcastChannel is true, code in filterCrossWindowMessages restricts messages to frames in the
49453
49459
  // current browser window/tab. Due to a race condition in clone-detection, you can have two tabs that
@@ -49463,17 +49469,18 @@ class SessionRecorder {
49463
49469
  else if (message.type === 'pendo:sr:refresh' && window == window.top) {
49464
49470
  this._sendIds();
49465
49471
  }
49466
- }
49467
- clearSessionId() {
49472
+ };
49473
+ SessionRecorder.prototype.clearSessionId = function () {
49468
49474
  delete this._sessionId;
49469
49475
  this.api.sessionStorage.removeItem(SESSION_RECORDING_ID);
49470
49476
  this.api.sessionStorage.removeItem(this.sessionIdKey);
49471
- }
49472
- sessionId(defaultId = this.pendo.randomString(16)) {
49477
+ };
49478
+ SessionRecorder.prototype.sessionId = function (defaultId) {
49479
+ if (defaultId === void 0) { defaultId = this.pendo.randomString(16); }
49473
49480
  if (!this._sessionId) {
49474
- let currentSessionId = this.api.sessionStorage.getItem(this.sessionIdKey);
49481
+ var currentSessionId = this.api.sessionStorage.getItem(this.sessionIdKey);
49475
49482
  if (!currentSessionId) {
49476
- let legacySessionId = this.api.sessionStorage.getItem(SESSION_RECORDING_ID);
49483
+ var legacySessionId = this.api.sessionStorage.getItem(SESSION_RECORDING_ID);
49477
49484
  if (legacySessionId) {
49478
49485
  currentSessionId = legacySessionId;
49479
49486
  this.api.sessionStorage.removeItem(SESSION_RECORDING_ID);
@@ -49486,41 +49493,41 @@ class SessionRecorder {
49486
49493
  this._sessionId = currentSessionId;
49487
49494
  }
49488
49495
  return this._sessionId;
49489
- }
49490
- clearOldSessionId() {
49491
- let lastUserInteractionEventInfo = this.getLastUserInteractionEventInformation();
49496
+ };
49497
+ SessionRecorder.prototype.clearOldSessionId = function () {
49498
+ var lastUserInteractionEventInfo = this.getLastUserInteractionEventInformation();
49492
49499
  if (lastUserInteractionEventInfo) {
49493
- const lastEmitTime = lastUserInteractionEventInfo.timestamp;
49494
- const sameVisitor = lastUserInteractionEventInfo.visitorId === this.visitorId && lastUserInteractionEventInfo.accountId === this.accountId;
49495
- const withinInactivityLimit = lastEmitTime > Date.now() - this.pendo._.get(this.visitorConfig, 'inactivityDuration', THIRTY_MINUTES);
49500
+ var lastEmitTime = lastUserInteractionEventInfo.timestamp;
49501
+ var sameVisitor = lastUserInteractionEventInfo.visitorId === this.visitorId && lastUserInteractionEventInfo.accountId === this.accountId;
49502
+ var withinInactivityLimit = lastEmitTime > Date.now() - this.pendo._.get(this.visitorConfig, 'inactivityDuration', THIRTY_MINUTES);
49496
49503
  if (sameVisitor && withinInactivityLimit)
49497
49504
  return;
49498
49505
  }
49499
49506
  this.clearSessionInfo();
49500
49507
  this.isNewSession = true;
49501
- }
49502
- clearSessionInfo() {
49508
+ };
49509
+ SessionRecorder.prototype.clearSessionInfo = function () {
49503
49510
  this.currentRecordingSize = 0;
49504
49511
  this.clearSessionId();
49505
49512
  this.clearLastUserInteractionEventInformation();
49506
- }
49507
- isUserInteraction(event) {
49513
+ };
49514
+ SessionRecorder.prototype.isUserInteraction = function (event) {
49508
49515
  if (event.type !== EVENT_TYPES.INCREMENTAL_SNAPSHOT) {
49509
49516
  return false;
49510
49517
  }
49511
49518
  return event.data.source > EVENT_TYPES.INCREMENTAL_SOURCE_MUTATION && event.data.source <= EVENT_TYPES.INCREMENTAL_SOURCE_INPUT;
49512
- }
49513
- storeLastUserInteractionEventInformation(event, visitorId, accountId, skipUserInteractionCheck) {
49519
+ };
49520
+ SessionRecorder.prototype.storeLastUserInteractionEventInformation = function (event, visitorId, accountId, skipUserInteractionCheck) {
49514
49521
  if (this.isUserInteraction(event) || skipUserInteractionCheck) {
49515
- this.lastUserInteractionEventInfo = { timestamp: event.timestamp, visitorId, accountId };
49522
+ this.lastUserInteractionEventInfo = { timestamp: event.timestamp, visitorId: visitorId, accountId: accountId };
49516
49523
  this.api.sessionStorage.setItem(SESSION_RECORDING_LAST_USER_INTERACTION_EVENT, JSON.stringify(this.lastUserInteractionEventInfo));
49517
49524
  }
49518
- }
49519
- clearLastUserInteractionEventInformation() {
49525
+ };
49526
+ SessionRecorder.prototype.clearLastUserInteractionEventInformation = function () {
49520
49527
  delete this.lastUserInteractionEventInfo;
49521
49528
  this.api.sessionStorage.removeItem(SESSION_RECORDING_LAST_USER_INTERACTION_EVENT);
49522
- }
49523
- getLastUserInteractionEventInformation() {
49529
+ };
49530
+ SessionRecorder.prototype.getLastUserInteractionEventInformation = function () {
49524
49531
  if (this.lastUserInteractionEventInfo)
49525
49532
  return this.lastUserInteractionEventInfo;
49526
49533
  try {
@@ -49530,7 +49537,7 @@ class SessionRecorder {
49530
49537
  catch (e) { // nothing here yet or failed to be written; don't need to log
49531
49538
  return null;
49532
49539
  }
49533
- }
49540
+ };
49534
49541
  /**
49535
49542
  * Handle new rrweb events coming in. This will also make sure that we are properly sending a "keyframe"
49536
49543
  * as the BE expects it. A "keyframe" should consist of only the events needed to start a recording. This includes
@@ -49541,19 +49548,19 @@ class SessionRecorder {
49541
49548
  * @param event.type The enum type of the specific event (e.g. meta, full snapshot, incremental snapshot)
49542
49549
  * @param event.data The specific data to describe the event, this is different depending on what the type is
49543
49550
  */
49544
- emit(event) {
49545
- const isMeta = event.type === EVENT_TYPES.META;
49546
- const isSnapshot = event.type === EVENT_TYPES.FULL_SNAPSHOT;
49547
- const prevLastEmitTime = this.pendo._.get(this.getLastUserInteractionEventInformation(), 'timestamp');
49548
- const inactivityDuration = this.pendo._.get(this.visitorConfig, 'inactivityDuration', THIRTY_MINUTES);
49549
- let skipUserInteractionCheck = false;
49551
+ SessionRecorder.prototype.emit = function (event) {
49552
+ var isMeta = event.type === EVENT_TYPES.META;
49553
+ var isSnapshot = event.type === EVENT_TYPES.FULL_SNAPSHOT;
49554
+ var prevLastEmitTime = this.pendo._.get(this.getLastUserInteractionEventInformation(), 'timestamp');
49555
+ var inactivityDuration = this.pendo._.get(this.visitorConfig, 'inactivityDuration', THIRTY_MINUTES);
49556
+ var skipUserInteractionCheck = false;
49550
49557
  if (event.timestamp && event.timestamp.getTime) {
49551
49558
  event.timestamp = event.timestamp.getTime();
49552
49559
  }
49553
49560
  if (!event.timestamp) {
49554
49561
  event.timestamp = (new Date()).getTime();
49555
49562
  }
49556
- const withinInactivityLimit = prevLastEmitTime && event.timestamp - prevLastEmitTime <= inactivityDuration;
49563
+ var withinInactivityLimit = prevLastEmitTime && event.timestamp - prevLastEmitTime <= inactivityDuration;
49557
49564
  // If we don't have a last emit time and a META event is emitted, store the META event as the last user interaction
49558
49565
  // event. This most commonly happens when a replay is first started and establishes a baseline timestamp to
49559
49566
  // to compare inactivity against. For subsequent META events that are part of the same replay, we should have
@@ -49576,7 +49583,7 @@ class SessionRecorder {
49576
49583
  this.logStopReason('INACTIVE_HIDDEN_TAB');
49577
49584
  }
49578
49585
  if (!this.isCheckingVisitorEligibility) {
49579
- const continuationCallback = function () {
49586
+ var continuationCallback = function () {
49580
49587
  this.send();
49581
49588
  this.clearSessionInfo();
49582
49589
  this.snapshot();
@@ -49612,13 +49619,13 @@ class SessionRecorder {
49612
49619
  }
49613
49620
  else if (!isMeta) {
49614
49621
  this.eventsSinceLastKeyFrame += 1;
49615
- const timeSinceLastKeyFrame = event.timestamp - this.lastKeyFrameTime;
49616
- const exceeds24Hours = timeSinceLastKeyFrame >= ONE_DAY_IN_MILLISECONDS;
49617
- const exceedsTimeFreq = timeSinceLastKeyFrame >= this.pendo._.get(this.visitorConfig, 'keyframeTimeFrequency', 30645047); // Defaults determined by BE originally, shouldn't really ever be used
49618
- const exceedsEventFreq = this.eventsSinceLastKeyFrame >= this.pendo._.get(this.visitorConfig, 'keyframeEventFrequency', 4548); // Defaults determined by BE originally, shouldn't really ever be used
49619
- const exceedsRecordingSizeLimit = this.currentRecordingSize >= this.pendo._.get(this.visitorConfig, 'recordingSizeLimit', ONE_HUNDRED_MB_IN_BYTES);
49622
+ var timeSinceLastKeyFrame = event.timestamp - this.lastKeyFrameTime;
49623
+ var exceeds24Hours = timeSinceLastKeyFrame >= ONE_DAY_IN_MILLISECONDS;
49624
+ var exceedsTimeFreq = timeSinceLastKeyFrame >= this.pendo._.get(this.visitorConfig, 'keyframeTimeFrequency', 30645047); // Defaults determined by BE originally, shouldn't really ever be used
49625
+ var exceedsEventFreq = this.eventsSinceLastKeyFrame >= this.pendo._.get(this.visitorConfig, 'keyframeEventFrequency', 4548); // Defaults determined by BE originally, shouldn't really ever be used
49626
+ var exceedsRecordingSizeLimit = this.currentRecordingSize >= this.pendo._.get(this.visitorConfig, 'recordingSizeLimit', ONE_HUNDRED_MB_IN_BYTES);
49620
49627
  if (exceeds24Hours || (exceedsTimeFreq && exceedsEventFreq) || exceedsRecordingSizeLimit) {
49621
- const continuationCallback = function () {
49628
+ var continuationCallback = function () {
49622
49629
  this.currentRecordingSize = 0;
49623
49630
  this.snapshot();
49624
49631
  };
@@ -49630,18 +49637,18 @@ class SessionRecorder {
49630
49637
  }
49631
49638
  }
49632
49639
  }
49633
- }
49634
- updateCurrentRecordingSize(recordingPayloadSize) {
49640
+ };
49641
+ SessionRecorder.prototype.updateCurrentRecordingSize = function (recordingPayloadSize) {
49635
49642
  this.currentRecordingSize += recordingPayloadSize;
49636
- }
49637
- onWorkerMessage(messageData) {
49643
+ };
49644
+ SessionRecorder.prototype.onWorkerMessage = function (messageData) {
49638
49645
  switch (messageData.type) {
49639
49646
  case 'workerDied': {
49640
49647
  this.logStopReason('WORKER_DIED');
49641
49648
  break;
49642
49649
  }
49643
49650
  case 'recordingPayloadSize': {
49644
- const { recordingPayloadSize, exceedsPayloadSizeLimit } = messageData;
49651
+ var recordingPayloadSize = messageData.recordingPayloadSize, exceedsPayloadSizeLimit = messageData.exceedsPayloadSizeLimit;
49645
49652
  if (!recordingPayloadSize)
49646
49653
  return;
49647
49654
  // stop recording if recording payload exceeds allowed payload size
@@ -49654,7 +49661,7 @@ class SessionRecorder {
49654
49661
  break;
49655
49662
  }
49656
49663
  case 'hostedResources': {
49657
- const { hostedResourcesEvent } = messageData;
49664
+ var hostedResourcesEvent = messageData.hostedResourcesEvent;
49658
49665
  if (!hostedResourcesEvent)
49659
49666
  return;
49660
49667
  this.sendHostedResources(hostedResourcesEvent);
@@ -49665,12 +49672,12 @@ class SessionRecorder {
49665
49672
  break;
49666
49673
  }
49667
49674
  case 'missingData': {
49668
- this.logStopReason(`MISSING_${messageData.missingData}`);
49675
+ this.logStopReason("MISSING_".concat(messageData.missingData));
49669
49676
  break;
49670
49677
  }
49671
49678
  }
49672
- }
49673
- addRecordingId(event) {
49679
+ };
49680
+ SessionRecorder.prototype.addRecordingId = function (event) {
49674
49681
  if (!this.isRecording())
49675
49682
  return;
49676
49683
  if (!this.recordingId || !event || !event.data || !event.data.length)
@@ -49689,7 +49696,7 @@ class SessionRecorder {
49689
49696
  return;
49690
49697
  }
49691
49698
  this._markEvents([capturedEvent]);
49692
- }
49699
+ };
49693
49700
  /**
49694
49701
  * Used to stop collecting replay data.
49695
49702
  *
@@ -49700,7 +49707,7 @@ class SessionRecorder {
49700
49707
  * @example
49701
49708
  * pendo.recording.stop()
49702
49709
  */
49703
- stop() {
49710
+ SessionRecorder.prototype.stop = function () {
49704
49711
  if (this._stop) {
49705
49712
  this._stop();
49706
49713
  }
@@ -49718,32 +49725,33 @@ class SessionRecorder {
49718
49725
  this.accountId = null;
49719
49726
  this.clearSessionInfo();
49720
49727
  this.onRecordingStop();
49721
- }
49722
- handleHidden() {
49728
+ };
49729
+ SessionRecorder.prototype.handleHidden = function () {
49723
49730
  this.send({ hidden: true });
49724
- }
49725
- handleUnload() {
49731
+ };
49732
+ SessionRecorder.prototype.handleUnload = function () {
49726
49733
  if (this.api.ConfigReader.get(RECORDING_CONFIG_DISABLE_UNLOAD))
49727
49734
  return;
49728
49735
  this.send({ unload: true });
49729
- }
49730
- buildRequestUrl(baseUrl, queryObj) {
49736
+ };
49737
+ SessionRecorder.prototype.buildRequestUrl = function (baseUrl, queryObj) {
49731
49738
  var authedQueryObj = this.pendo._.extend({}, this.api.agent.getJwtInfoCopy(), queryObj);
49732
49739
  var queryString = this.pendo._.map(authedQueryObj, function (value, key) {
49733
- return `${key}=${value}`;
49740
+ return "".concat(key, "=").concat(value);
49734
49741
  }).join('&');
49735
- return queryString.length ? `${baseUrl}?${queryString}` : baseUrl;
49736
- }
49737
- sendFailure(reason) {
49742
+ return queryString.length ? "".concat(baseUrl, "?").concat(queryString) : baseUrl;
49743
+ };
49744
+ SessionRecorder.prototype.sendFailure = function (reason) {
49738
49745
  this.stop();
49739
49746
  this.logStopReason(reason);
49740
- }
49741
- rateLimitExceeded() {
49747
+ };
49748
+ SessionRecorder.prototype.rateLimitExceeded = function () {
49742
49749
  this.send(); // sends first chunk of 20k
49743
49750
  this.stop(); // sends 2nd chunk of 20k, rest is ignored
49744
49751
  this.logStopReason('DATA_OVERLOAD');
49745
- }
49746
- send({ unload = false, keyframe = false, hidden = false } = {}) {
49752
+ };
49753
+ SessionRecorder.prototype.send = function (_a) {
49754
+ var _b = _a === void 0 ? {} : _a, _c = _b.unload, unload = _c === void 0 ? false : _c, _d = _b.keyframe, keyframe = _d === void 0 ? false : _d, _e = _b.hidden, hidden = _e === void 0 ? false : _e;
49747
49755
  if (!this.isRecording())
49748
49756
  return;
49749
49757
  if (!this.buffer)
@@ -49773,7 +49781,7 @@ class SessionRecorder {
49773
49781
  }
49774
49782
  // Used to add promoted metadata onto the recording event
49775
49783
  this.api.Events.eventCaptured.trigger(payload);
49776
- const params = {
49784
+ var params = {
49777
49785
  v: this.pendo.VERSION,
49778
49786
  recordingId: this.recordingId
49779
49787
  };
@@ -49784,11 +49792,11 @@ class SessionRecorder {
49784
49792
  params.ns = 1;
49785
49793
  this.isNewSession = false;
49786
49794
  }
49787
- var url = this.buildRequestUrl(`${this.pendo.HOST}/data/rec/${this.pendo.apiKey}`, params);
49795
+ var url = this.buildRequestUrl("".concat(this.pendo.HOST, "/data/rec/").concat(this.pendo.apiKey), params);
49788
49796
  payload = this.buffer.pack(payload, this.pendo._);
49789
49797
  if (unload || hidden) {
49790
49798
  try {
49791
- this.sendQueue.drain([{ url, payload }], unload);
49799
+ this.sendQueue.drain([{ url: url, payload: payload }], unload);
49792
49800
  }
49793
49801
  catch (e) {
49794
49802
  if (e.reason) {
@@ -49800,29 +49808,30 @@ class SessionRecorder {
49800
49808
  }
49801
49809
  }
49802
49810
  else {
49803
- this.sendQueue.push({ url, payload });
49811
+ this.sendQueue.push({ url: url, payload: payload });
49804
49812
  }
49805
49813
  if (!this.buffer.isEmpty()) {
49806
- this.send({ unload });
49814
+ this.send({ unload: unload });
49807
49815
  }
49808
- }
49809
- fetchVisitorConfig() {
49810
- const jzb = this.pendo.compress({
49816
+ };
49817
+ SessionRecorder.prototype.fetchVisitorConfig = function () {
49818
+ var jzb = this.pendo.compress({
49811
49819
  url: this.pendo.url.get(),
49812
49820
  metadata: this.pendo.getSerializedMetadata(),
49813
49821
  visitorId: this.visitorId,
49814
49822
  accountId: this.accountId
49815
49823
  });
49816
- const url = this.buildRequestUrl(`${this.pendo.HOST}/data/recordingconf/${this.pendo.apiKey}`, {
49817
- jzb,
49824
+ var url = this.buildRequestUrl("".concat(this.pendo.HOST, "/data/recordingconf/").concat(this.pendo.apiKey), {
49825
+ jzb: jzb,
49818
49826
  ct: (new Date().getTime()),
49819
49827
  v: this.pendo.VERSION
49820
49828
  });
49821
49829
  return fetch(url, {
49822
49830
  method: 'GET'
49823
- }).then(response => response.json());
49824
- }
49825
- logStopReason(reason, error) {
49831
+ }).then(function (response) { return response.json(); });
49832
+ };
49833
+ SessionRecorder.prototype.logStopReason = function (reason, error) {
49834
+ var _this = this;
49826
49835
  var tracer = this.api.EventTracer.addTracerIds({});
49827
49836
  var payload = this.pendo._.extend({
49828
49837
  type: 'recording',
@@ -49838,51 +49847,53 @@ class SessionRecorder {
49838
49847
  recordingPayload: [],
49839
49848
  sequence: 0,
49840
49849
  recordingPayloadCount: 0,
49841
- props: Object.assign({ reason }, (error && { error: error instanceof Error ? error === null || error === void 0 ? void 0 : error.message : error }))
49850
+ props: __assign({ reason: reason }, (error && { error: error instanceof Error ? error === null || error === void 0 ? void 0 : error.message : error }))
49842
49851
  }, tracer);
49843
49852
  var jzb = this.pendo.compress(payload);
49844
- var url = this.buildRequestUrl(`${this.pendo.HOST}/data/rec/${this.pendo.apiKey}`, {
49845
- jzb,
49853
+ var url = this.buildRequestUrl("".concat(this.pendo.HOST, "/data/rec/").concat(this.pendo.apiKey), {
49854
+ jzb: jzb,
49846
49855
  ct: (new Date().getTime()),
49847
49856
  v: this.pendo.VERSION,
49848
49857
  recordingId: payload.recordingId
49849
49858
  });
49850
49859
  var body = this.pendo.compress(payload, 'binary');
49851
49860
  return this.transport.post(url, {
49852
- body,
49861
+ body: body,
49853
49862
  keepalive: true
49854
- }).catch((e) => {
49855
- this.api.log.critical('Failed to send reason for stopping recording', { error: e });
49863
+ })["catch"](function (e) {
49864
+ _this.api.log.critical('Failed to send reason for stopping recording', { error: e });
49856
49865
  });
49857
- }
49858
- sendHostedResources(event) {
49866
+ };
49867
+ SessionRecorder.prototype.sendHostedResources = function (event) {
49868
+ var _this = this;
49859
49869
  var tracer = this.api.EventTracer.addTracerIds({});
49860
- var payload = this.pendo._.extend(Object.assign(Object.assign({}, event), { browserTime: new Date().getTime() }), tracer);
49861
- var url = this.buildRequestUrl(`${this.pendo.HOST}/data/rec/${this.pendo.apiKey}`, {
49870
+ var payload = this.pendo._.extend(__assign(__assign({}, event), { browserTime: new Date().getTime() }), tracer);
49871
+ var url = this.buildRequestUrl("".concat(this.pendo.HOST, "/data/rec/").concat(this.pendo.apiKey), {
49862
49872
  ct: (new Date().getTime()),
49863
49873
  v: this.pendo.VERSION,
49864
49874
  recordingId: payload.recordingId
49865
49875
  });
49866
49876
  var body = this.pendo.compress(payload, 'binary');
49867
49877
  return this.transport.post(url, {
49868
- body,
49878
+ body: body,
49869
49879
  keepalive: true
49870
- }).catch((e) => {
49871
- this.api.log.critical('Failed to send hosted resources for recording event', { error: e });
49880
+ })["catch"](function (e) {
49881
+ _this.api.log.critical('Failed to send hosted resources for recording event', { error: e });
49872
49882
  });
49873
- }
49883
+ };
49874
49884
  /**
49875
49885
  * This should fire when an event is triggered in clearClonedStorage. Under normal circumstances, the event will be
49876
49886
  * triggered before recording begins in the cloned tab. On the off chance tabId changes again though, create a new
49877
49887
  * replay. We want to avoid scenarios where a single recordingId is associated with multiple tabIds. This can happen if
49878
49888
  * clone detection runs in a duplicated tab before it runs in the original tab.
49879
49889
  */
49880
- handleTabIdChange() {
49890
+ SessionRecorder.prototype.handleTabIdChange = function () {
49881
49891
  this.send();
49882
49892
  this.clearSessionInfo();
49883
49893
  this.snapshot();
49884
- }
49885
- }
49894
+ };
49895
+ return SessionRecorder;
49896
+ }());
49886
49897
 
49887
49898
  function wrapMethodWithCatch(method) {
49888
49899
  return function () {
@@ -49903,7 +49914,8 @@ function errorLogger(recorder) {
49903
49914
  return recorder;
49904
49915
  if (!recorder.constructor || !recorder.constructor.prototype)
49905
49916
  return recorder;
49906
- for (let methodName of Object.getOwnPropertyNames(recorder.constructor.prototype)) {
49917
+ for (var _i = 0, _a = Object.getOwnPropertyNames(recorder.constructor.prototype); _i < _a.length; _i++) {
49918
+ var methodName = _a[_i];
49907
49919
  if (methodName === 'constructor')
49908
49920
  continue;
49909
49921
  recorder[methodName] = wrapMethodWithCatch(recorder[methodName]);