@pendo/agent 2.322.1 → 2.323.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.
@@ -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.322.1_';
3971
- let PACKAGE_VERSION = '2.322.1';
3970
+ let VERSION = '2.323.0_';
3971
+ let PACKAGE_VERSION = '2.323.0';
3972
3972
  let LOADER = 'xhr';
3973
3973
  /* eslint-enable web-sdk-eslint-rules/no-gulp-env-references */
3974
3974
  /**
@@ -4493,7 +4493,9 @@ function enableCookies(enabled) {
4493
4493
  var getCookie = function (name) {
4494
4494
  var result;
4495
4495
  // eslint-disable-next-line no-cond-assign
4496
- return (result = new RegExp('(^|; )' + name + '=([^;]*)').exec(document.cookie)) ? decodeURIComponent(result[2]) : null;
4496
+ return (result = new RegExp('(^|; )' + name + '=([^;]*)').exec(document.cookie))
4497
+ ? decodeURIComponent(result[2])
4498
+ : null;
4497
4499
  };
4498
4500
  var setCookie = function (name, val, millisToExpire, isSecure) {
4499
4501
  if (!areCookiesEnabled)
@@ -4509,7 +4511,14 @@ var setCookie = function (name, val, millisToExpire, isSecure) {
4509
4511
  const canSecure = document.location.protocol === 'https:' || isSecure;
4510
4512
  const sameSite = canSecure ? 'None' : 'Strict';
4511
4513
  expireDate.setTime(expireDate.getTime() + cookieTTL);
4512
- var cookie = name + '=' + encodeURIComponent(val) + (millisToExpire ? ';expires=' + expireDate.toUTCString() : '') + '; path=/' + (canSecure ? ';secure' : '') + '; SameSite=' + sameSite;
4514
+ var cookie = name +
4515
+ '=' +
4516
+ encodeURIComponent(val) +
4517
+ (millisToExpire ? ';expires=' + expireDate.toUTCString() : '') +
4518
+ '; path=/' +
4519
+ (canSecure ? ';secure' : '') +
4520
+ '; SameSite=' +
4521
+ sameSite;
4513
4522
  if (cookieDomain) {
4514
4523
  cookie += ';domain=' + cookieDomain;
4515
4524
  }
@@ -4623,9 +4632,9 @@ class StorageRegistry {
4623
4632
  * moving forward with new Agent refactoring and modularizing the code base.
4624
4633
  */
4625
4634
  /*
4626
- The majority of prior existing functionality still remains where it was. The
4627
- core Storage api is now in `agentStorage` with the original references still in place.
4628
- */
4635
+ The majority of prior existing functionality still remains where it was. The
4636
+ core Storage api is now in `agentStorage` with the original references still in place.
4637
+ */
4629
4638
  var agentStorage = (function () {
4630
4639
  const registry = new StorageRegistry();
4631
4640
  function wrapStorageWriteMethod(writeMethod, registryMethod) {
@@ -4657,18 +4666,18 @@ var agentStorage = (function () {
4657
4666
  return true;
4658
4667
  }
4659
4668
  catch (e) {
4660
- return e instanceof DOMException && (
4661
- // everything except Firefox
4662
- e.code === 22 ||
4663
- // Firefox
4664
- e.code === 1014 ||
4665
- // test name field too, because code might not be present
4669
+ return (e instanceof DOMException &&
4666
4670
  // everything except Firefox
4667
- e.name === 'QuotaExceededError' ||
4668
- // Firefox
4669
- e.name === 'NS_ERROR_DOM_QUOTA_REACHED') &&
4671
+ (e.code === 22 ||
4672
+ // Firefox
4673
+ e.code === 1014 ||
4674
+ // test name field too, because code might not be present
4675
+ // everything except Firefox
4676
+ e.name === 'QuotaExceededError' ||
4677
+ // Firefox
4678
+ e.name === 'NS_ERROR_DOM_QUOTA_REACHED') &&
4670
4679
  // acknowledge QuotaExceededError only if there's something already stored
4671
- (storage && storage.length !== 0);
4680
+ (storage && storage.length !== 0));
4672
4681
  }
4673
4682
  });
4674
4683
  function resetCache(mFn) {
@@ -4724,10 +4733,19 @@ var agentStorage = (function () {
4724
4733
  try {
4725
4734
  // JSON parsables: Numbers, Booleans, and Objects
4726
4735
  var obj = JSON.parse(value);
4727
- if (!obj.ttl) {
4736
+ // value is either a TimedStorageItem or just a PlainOldStorageItem
4737
+ // a TimedStorageItem will have both a ttl and value property
4738
+ const isTimedStorageItem = obj !== null && typeof obj === 'object' && 'ttl' in obj && 'value' in obj;
4739
+ if (!isTimedStorageItem) {
4728
4740
  return value;
4729
4741
  }
4730
- else if (obj.ttl < new Date().getTime()) {
4742
+ // ttl must always be an unsigned, non-zero number (a positive,
4743
+ // finite epoch-millis timestamp). Anything else (null, NaN, a
4744
+ // string, a negative number, 0, etc.) is treated as a missing /
4745
+ // invalid ttl and we fall through to returning the stored value
4746
+ // rather than discarding it as expired.
4747
+ const hasValidTtl = typeof obj.ttl === 'number' && isFinite(obj.ttl) && obj.ttl > 0;
4748
+ if (hasValidTtl && obj.ttl < new Date().getTime()) {
4731
4749
  return null;
4732
4750
  }
4733
4751
  return String(obj.value || obj);
@@ -4813,6 +4831,7 @@ var agentStorage = (function () {
4813
4831
  const wrappedPendoLocalStorage = _.extend({}, pendoLocalStorage$4);
4814
4832
  wrappedPendoLocalStorage.setItem = wrapStorageWriteMethod(wrappedPendoLocalStorage.setItem, 'hasLocal');
4815
4833
  return {
4834
+ /* API */
4816
4835
  read,
4817
4836
  write: wrapStorageWriteMethod(write, 'hasLocal'),
4818
4837
  clear,
@@ -11672,7 +11691,7 @@ function isTrustedOrigin(host) {
11672
11691
  return true;
11673
11692
  // Domains that Pendo owns, will be swapped in by build patches
11674
11693
  const patterns = [
11675
- /^https:\/\/(adopt\.)?((us1)\.)?(app|via|adopt|cdn|oem)(\.(au|eu|gov|hsbc|jpn))?\.pendo\.io$/,
11694
+ /^https:\/\/(adopt\.)?((us1)\.)?(app|via|adopt|cdn|oem|novus-api|novus)(\.(au|eu|gov|hsbc|jpn))?\.pendo\.io$/,
11676
11695
  /^https:\/\/([0-9]{8}t[0-9]{4}-dot-)pendo-(au|eu|govramp|hsbc|io|jp-prod|us1)\.appspot\.com$/,
11677
11696
  /^https:\/\/hotfix-(ops|app)-([0-9]+-dot-)pendo-(au|eu|govramp|hsbc|io|jp-prod|us1)\.appspot\.com$/,
11678
11697
  /^https:\/\/pendo-(au|eu|govramp|hsbc|io|jp-prod|us1)-static\.storage\.googleapis\.com$/,
@@ -16046,6 +16065,12 @@ const TOOLTIP_CONSTANTS = {
16046
16065
  BORDER_CARET: 10
16047
16066
  }
16048
16067
  };
16068
+ const HYPHEN_BORDER_BY_SIDE = {
16069
+ Top: 'border-top',
16070
+ Right: 'border-right',
16071
+ Bottom: 'border-bottom',
16072
+ Left: 'border-left'
16073
+ };
16049
16074
  var BuildingBlockTooltips = (function () {
16050
16075
  return {
16051
16076
  createBBTooltip,
@@ -16190,7 +16215,7 @@ var BuildingBlockTooltips = (function () {
16190
16215
  guideContainer.style.position = 'absolute';
16191
16216
  }
16192
16217
  if (caretDimensions.height && caretDimensions.width) {
16193
- buildTooltipCaret(tooltipDiv, tooltipDimensions, caretDimensions, elementPos);
16218
+ buildTooltipCaret(tooltipDiv, tooltipDimensions, caretDimensions);
16194
16219
  }
16195
16220
  var inheritedZIndex = TOOLTIP_CONSTANTS.Z_INDEX.DEFAULT;
16196
16221
  if (guideContainer && guideContainer.style && guideContainer.style['z-index']) {
@@ -16250,8 +16275,21 @@ var BuildingBlockTooltips = (function () {
16250
16275
  else if (tooltipDimensions.layoutDir === 'left') {
16251
16276
  tooltipDimensions.left -= caretSizes.height;
16252
16277
  }
16278
+ if (caretSizes.height && caretSizes.width) {
16279
+ populateCaretStyleMaps(tooltipDimensions, caretSizes, elementPos);
16280
+ }
16253
16281
  return tooltipDimensions;
16254
16282
  }
16283
+ function populateCaretStyleMaps(tooltipDimensions, caretSizes, elementPos) {
16284
+ tooltipDimensions.caret = {};
16285
+ if (tooltipDimensions.layoutDir === 'top' || tooltipDimensions.layoutDir === 'bottom') {
16286
+ _.extend(tooltipDimensions.caret, buildTopOrBottomCaretStyleMap(tooltipDimensions, caretSizes, elementPos));
16287
+ }
16288
+ if (tooltipDimensions.layoutDir === 'left' || tooltipDimensions.layoutDir === 'right') {
16289
+ _.extend(tooltipDimensions.caret, buildLeftOrRightCaretStyleMap(tooltipDimensions, caretSizes));
16290
+ }
16291
+ tooltipDimensions.caretBorder = buildBorderCaretStyleMap(tooltipDimensions.caret, caretSizes, tooltipDimensions.layoutDir);
16292
+ }
16255
16293
  function calculateVwRelativeToLayoutDir(guideContainer, tooltipContext) {
16256
16294
  const { elementPos, tooltipSizes, screenDimensions, caretDimensions, elementIsNotVisible } = tooltipContext;
16257
16295
  const caretFullWidth = (parseInt(caretDimensions.width, 10) || 0);
@@ -16481,51 +16519,51 @@ var BuildingBlockTooltips = (function () {
16481
16519
  caretDiv.setAttribute('class', 'pendo-tooltip-caret pendo-tooltip-caret--' + tooltipDimensions.layoutDir);
16482
16520
  caretDiv.style.position = 'absolute';
16483
16521
  caretDiv.style.zIndex = TOOLTIP_CONSTANTS.Z_INDEX.CARET;
16484
- updateCaretStyles(caretDiv, tooltipDimensions, caretDimensions, elementPos);
16522
+ updateCaretStyles(caretDiv, tooltipDimensions.caret);
16485
16523
  var guideDiv = tooltipDiv.find('#pendo-guide-container')[0].parentNode;
16486
16524
  guideDiv.appendChild(caretDiv);
16487
16525
  if (!caretDimensions.borderWidth)
16488
16526
  return;
16489
- var borderCaret = buildBorderCaret(caretDiv, caretDimensions, tooltipDimensions.layoutDir);
16527
+ var borderCaret = buildBorderCaret(caretDiv, tooltipDimensions);
16490
16528
  guideDiv.appendChild(borderCaret);
16491
16529
  }
16492
- function updateCaretStyles(caretDiv, tooltipDimensions, caretDimensions, elementPos) {
16493
- if (tooltipDimensions.layoutDir === 'top' || tooltipDimensions.layoutDir === 'bottom') {
16494
- styleTopOrBottomCaret(caretDiv, tooltipDimensions, caretDimensions, elementPos);
16495
- }
16496
- if (tooltipDimensions.layoutDir === 'left' || tooltipDimensions.layoutDir === 'right') {
16497
- styleLeftOrRightCaret(caretDiv, tooltipDimensions, caretDimensions);
16498
- }
16530
+ function updateCaretStyles(caretDiv, caretStyleMap) {
16531
+ _.extend(caretDiv.style, caretStyleMap);
16499
16532
  }
16500
16533
  function styleTopOrBottomCaret(caret, tooltipDimensions, caretDimensions, elementPos) {
16501
- caret.style['border-left'] = caretDimensions.width + 'px solid transparent';
16502
- caret.style['border-right'] = caretDimensions.width + 'px solid transparent';
16503
- caret.style.right = '';
16534
+ _.extend(caret.style, buildTopOrBottomCaretStyleMap(tooltipDimensions, caretDimensions, elementPos));
16535
+ return caret;
16536
+ }
16537
+ function buildTopOrBottomCaretStyleMap(tooltipDimensions, caretDimensions, elementPos) {
16538
+ var styleMap = {};
16539
+ styleMap['border-left'] = caretDimensions.width + 'px solid transparent';
16540
+ styleMap['border-right'] = caretDimensions.width + 'px solid transparent';
16541
+ styleMap.right = '';
16504
16542
  const caretOffset = calculateCaretOffset(elementPos, tooltipDimensions, caretDimensions, tooltipDimensions.hbias);
16505
- caret.style.left = caretOffset + 'px';
16543
+ styleMap.left = caretOffset + 'px';
16506
16544
  // Tooltip is below element, put caret on the top of the tooltip
16507
16545
  if (tooltipDimensions.layoutDir === 'bottom') {
16508
- caret.style['border-bottom'] = caretDimensions.height + 'px solid ' + caretDimensions.backgroundColor;
16509
- caret.style['border-top'] = '';
16546
+ styleMap['border-bottom'] = caretDimensions.height + 'px solid ' + caretDimensions.backgroundColor;
16547
+ styleMap['border-top'] = '';
16510
16548
  var caretTop = -1 * caretDimensions.height;
16511
16549
  if (caretDimensions.borderWidth) {
16512
16550
  caretTop = caretTop + caretDimensions.borderWidth;
16513
16551
  }
16514
- caret.style.top = caretTop + 'px';
16515
- caret.style.bottom = '';
16552
+ styleMap.top = caretTop + 'px';
16553
+ styleMap.bottom = '';
16516
16554
  }
16517
16555
  // Tooltip is above element, put caret on the bottom of the tooltip
16518
16556
  if (tooltipDimensions.layoutDir === 'top') {
16519
- caret.style['border-top'] = caretDimensions.height + 'px solid ' + caretDimensions.backgroundColor;
16520
- caret.style['border-bottom'] = '';
16557
+ styleMap['border-top'] = caretDimensions.height + 'px solid ' + caretDimensions.backgroundColor;
16558
+ styleMap['border-bottom'] = '';
16521
16559
  var caretBottom = -1 * caretDimensions.height;
16522
16560
  if (caretDimensions.borderWidth) {
16523
16561
  caretBottom = caretBottom + caretDimensions.borderWidth;
16524
16562
  }
16525
- caret.style.bottom = caretBottom + 'px';
16526
- caret.style.top = '';
16563
+ styleMap.bottom = caretBottom + 'px';
16564
+ styleMap.top = '';
16527
16565
  }
16528
- return caret;
16566
+ return styleMap;
16529
16567
  }
16530
16568
  function calculateCaretOffset(elementPos, tooltipDimensions, caretDimensions, bias) {
16531
16569
  if (elementPos && elementPos.left) {
@@ -16545,17 +16583,22 @@ var BuildingBlockTooltips = (function () {
16545
16583
  }
16546
16584
  }
16547
16585
  function styleLeftOrRightCaret(caret, tooltipDimensions, caretDimensions) {
16586
+ _.extend(caret.style, buildLeftOrRightCaretStyleMap(tooltipDimensions, caretDimensions));
16587
+ return caret;
16588
+ }
16589
+ function buildLeftOrRightCaretStyleMap(tooltipDimensions, caretDimensions) {
16548
16590
  var screenDimensions = getScreenDimensions();
16549
- caret.style['border-top'] = caretDimensions.width + 'px solid transparent';
16550
- caret.style['border-bottom'] = caretDimensions.width + 'px solid transparent';
16551
- caret.style.bottom = '';
16591
+ var styleMap = {};
16592
+ styleMap['border-top'] = caretDimensions.width + 'px solid transparent';
16593
+ styleMap['border-bottom'] = caretDimensions.width + 'px solid transparent';
16594
+ styleMap.bottom = '';
16552
16595
  if (tooltipDimensions.vbias === TOP) {
16553
16596
  var maxArrowTop = tooltipDimensions.height - caretDimensions.width * 2 - caretDimensions.offset - caretDimensions.borderWidth;
16554
- caret.style.top = maxArrowTop + 'px';
16597
+ styleMap.top = maxArrowTop + 'px';
16555
16598
  tooltipDimensions.top += caretDimensions.offset + caretDimensions.width + caretDimensions.borderWidth;
16556
16599
  }
16557
16600
  else if (tooltipDimensions.vbias === BOTTOM) {
16558
- caret.style.top = (caretDimensions.offset + caretDimensions.borderWidth) + 'px';
16601
+ styleMap.top = (caretDimensions.offset + caretDimensions.borderWidth) + 'px';
16559
16602
  tooltipDimensions.top -= caretDimensions.offset + caretDimensions.width + caretDimensions.borderWidth;
16560
16603
  if (tooltipDimensions.top + tooltipDimensions.height > screenDimensions.height) {
16561
16604
  tooltipDimensions.top = tooltipDimensions.top - (tooltipDimensions.top + tooltipDimensions.height - screenDimensions.height);
@@ -16563,40 +16606,64 @@ var BuildingBlockTooltips = (function () {
16563
16606
  tooltipDimensions.top = Math.max(0, tooltipDimensions.top);
16564
16607
  }
16565
16608
  else { // ASSUME CENTER
16566
- caret.style.top = (tooltipDimensions.height / 2) - caretDimensions.width + 'px';
16609
+ styleMap.top = (tooltipDimensions.height / 2) - caretDimensions.width + 'px';
16567
16610
  }
16568
16611
  // Tooltip is to the left of the element, put caret on the right of the tooltip
16569
16612
  if (tooltipDimensions.layoutDir === 'left') {
16570
- caret.style['border-left'] = caretDimensions.height + 'px solid ' + caretDimensions.backgroundColor;
16571
- caret.style['border-right'] = '';
16613
+ styleMap['border-left'] = caretDimensions.height + 'px solid ' + caretDimensions.backgroundColor;
16614
+ styleMap['border-right'] = '';
16572
16615
  var caretRight = -1 * caretDimensions.height;
16573
16616
  if (caretDimensions.borderWidth) {
16574
16617
  caretRight = caretRight + caretDimensions.borderWidth;
16575
16618
  }
16576
- caret.style.right = caretRight + 'px';
16577
- caret.style.left = '';
16619
+ styleMap.right = caretRight + 'px';
16620
+ styleMap.left = '';
16578
16621
  }
16579
16622
  // Tooltip is to the right of the element, put caret on the left of the tooltip
16580
16623
  if (tooltipDimensions.layoutDir === 'right') {
16581
- caret.style['border-right'] = caretDimensions.height + 'px solid ' + caretDimensions.backgroundColor;
16582
- caret.style['border-left'] = '';
16624
+ styleMap['border-right'] = caretDimensions.height + 'px solid ' + caretDimensions.backgroundColor;
16625
+ styleMap['border-left'] = '';
16583
16626
  var caretLeft = -1 * caretDimensions.height;
16584
16627
  if (caretDimensions.borderWidth) {
16585
16628
  caretLeft = caretLeft + caretDimensions.borderWidth;
16586
16629
  }
16587
- caret.style.left = caretLeft + 'px';
16588
- caret.style.right = '';
16630
+ styleMap.left = caretLeft + 'px';
16631
+ styleMap.right = '';
16589
16632
  }
16590
- return caret;
16633
+ return styleMap;
16591
16634
  }
16592
- function buildBorderCaret(caret, caretDimensions, tooltipLayoutDirection) {
16635
+ function buildBorderCaret(caret, tooltipDimensions) {
16593
16636
  var borderCaret = caret.cloneNode();
16594
16637
  borderCaret.setAttribute('class', 'pendo-tooltip-caret-border');
16595
16638
  borderCaret.style.zIndex = TOOLTIP_CONSTANTS.Z_INDEX.BORDER_CARET;
16596
- updateBorderCaretStyles(borderCaret, caretDimensions, tooltipLayoutDirection, caret);
16639
+ updateCaretStyles(borderCaret, tooltipDimensions.caretBorder);
16597
16640
  return borderCaret;
16598
16641
  }
16599
- function updateBorderCaretStyles(borderCaret, caretDimensions, tooltipLayoutDirection, caretDiv) {
16642
+ function borderColorFromCaretStyleMap(caretMap, borderColorKey, hyphenKey) {
16643
+ if (caretMap[borderColorKey]) {
16644
+ return caretMap[borderColorKey];
16645
+ }
16646
+ var shorthand = caretMap[hyphenKey];
16647
+ if (!shorthand) {
16648
+ return '';
16649
+ }
16650
+ if (/transparent/i.test(shorthand)) {
16651
+ return 'transparent';
16652
+ }
16653
+ var solidIdx = shorthand.indexOf('solid');
16654
+ if (solidIdx === -1) {
16655
+ return '';
16656
+ }
16657
+ return shorthand.slice(solidIdx + 5).trim();
16658
+ }
16659
+ function borderWidthFromCaretStyleMap(caretMap, borderWidthKey, hyphenKey) {
16660
+ if (caretMap[borderWidthKey]) {
16661
+ return parseInt(caretMap[borderWidthKey], 10) || 0;
16662
+ }
16663
+ var shorthand = caretMap[hyphenKey];
16664
+ return shorthand ? (parseInt(shorthand, 10) || 0) : 0;
16665
+ }
16666
+ function buildBorderCaretStyleMap(caretMap, caretDimensions, tooltipLayoutDirection) {
16600
16667
  var borderStyles = {
16601
16668
  top: '',
16602
16669
  right: '',
@@ -16605,12 +16672,15 @@ var BuildingBlockTooltips = (function () {
16605
16672
  };
16606
16673
  var borderDirections = ['Top', 'Right', 'Bottom', 'Left'];
16607
16674
  for (var i = 0; i < borderDirections.length; i++) {
16608
- var borderWidthKey = 'border' + borderDirections[i] + 'Width'; // borderTopWidth, etc
16609
- var borderColorKey = 'border' + borderDirections[i] + 'Color'; // borderTopColor, etc
16610
- var borderStyleKey = 'border' + borderDirections[i] + 'Style'; // borderTopStyle, etc
16611
- if (caretDiv.style[borderWidthKey]) {
16612
- borderStyles[borderWidthKey] = parseInt(caretDiv.style[borderWidthKey], 10) + caretDimensions.borderWidth + 'px';
16613
- borderStyles[borderColorKey] = determineBorderCaretColor(caretDiv.style[borderColorKey], caretDimensions.borderColor);
16675
+ var side = borderDirections[i];
16676
+ var borderWidthKey = 'border' + side + 'Width';
16677
+ var borderColorKey = 'border' + side + 'Color';
16678
+ var borderStyleKey = 'border' + side + 'Style';
16679
+ var hyphenKey = HYPHEN_BORDER_BY_SIDE[side];
16680
+ var widthVal = borderWidthFromCaretStyleMap(caretMap, borderWidthKey, hyphenKey);
16681
+ if (widthVal) {
16682
+ borderStyles[borderWidthKey] = widthVal + caretDimensions.borderWidth + 'px';
16683
+ borderStyles[borderColorKey] = determineBorderCaretColor(borderColorFromCaretStyleMap(caretMap, borderColorKey, hyphenKey), caretDimensions.borderColor);
16614
16684
  borderStyles[borderStyleKey] = 'solid';
16615
16685
  }
16616
16686
  else {
@@ -16619,27 +16689,28 @@ var BuildingBlockTooltips = (function () {
16619
16689
  borderStyles[borderStyleKey] = '';
16620
16690
  }
16621
16691
  }
16692
+ var bw = caretDimensions.borderWidth;
16622
16693
  // Tooltip is above element, border moves further down
16623
16694
  if (tooltipLayoutDirection === 'top') {
16624
- borderStyles.left = parseInt(caretDiv.style.left, 10) - caretDimensions.borderWidth + 'px';
16625
- borderStyles.bottom = parseInt(caretDiv.style.bottom, 10) - caretDimensions.borderWidth + 'px';
16695
+ borderStyles.left = parseInt(caretMap.left, 10) - bw + 'px';
16696
+ borderStyles.bottom = parseInt(caretMap.bottom, 10) - bw + 'px';
16626
16697
  }
16627
16698
  // Tooltip is below element, border moves further up
16628
16699
  if (tooltipLayoutDirection === 'bottom') {
16629
- borderStyles.left = parseInt(caretDiv.style.left, 10) - caretDimensions.borderWidth + 'px';
16630
- borderStyles.top = parseInt(caretDiv.style.top, 10) - caretDimensions.borderWidth + 'px';
16700
+ borderStyles.left = parseInt(caretMap.left, 10) - bw + 'px';
16701
+ borderStyles.top = parseInt(caretMap.top, 10) - bw + 'px';
16631
16702
  }
16632
16703
  // Tooltip is to the right of the element, border moves further left
16633
16704
  if (tooltipLayoutDirection === 'right') {
16634
- borderStyles.top = parseInt(caretDiv.style.top, 10) - caretDimensions.borderWidth + 'px';
16635
- borderStyles.left = parseInt(caretDiv.style.left, 10) - caretDimensions.borderWidth + 'px';
16705
+ borderStyles.top = parseInt(caretMap.top, 10) - bw + 'px';
16706
+ borderStyles.left = parseInt(caretMap.left, 10) - bw + 'px';
16636
16707
  }
16637
16708
  // Tooltip is to the left of the element, border moves further right
16638
16709
  if (tooltipLayoutDirection === 'left') {
16639
- borderStyles.top = parseInt(caretDiv.style.top, 10) - caretDimensions.borderWidth + 'px';
16640
- borderStyles.right = parseInt(caretDiv.style.right, 10) - caretDimensions.borderWidth + 'px';
16710
+ borderStyles.top = parseInt(caretMap.top, 10) - bw + 'px';
16711
+ borderStyles.right = parseInt(caretMap.right, 10) - bw + 'px';
16641
16712
  }
16642
- _.extend(borderCaret.style, borderStyles);
16713
+ return borderStyles;
16643
16714
  }
16644
16715
  function determineBorderCaretColor(currentColor, borderColor) {
16645
16716
  if (currentColor === 'transparent')
@@ -16690,10 +16761,10 @@ var BuildingBlockTooltips = (function () {
16690
16761
  var caretDiv = ttdiv.find('.pendo-tooltip-caret')[0];
16691
16762
  var borderCaret = ttdiv.find('.pendo-tooltip-caret-border')[0];
16692
16763
  if (caretDiv) {
16693
- updateCaretStyles(caretDiv, tooltipDimensions, caretStyles, elPos);
16764
+ updateCaretStyles(caretDiv, tooltipDimensions.caret);
16694
16765
  }
16695
16766
  if (borderCaret) {
16696
- updateBorderCaretStyles(borderCaret, caretStyles, tooltipDimensions.layoutDir, caretDiv);
16767
+ updateCaretStyles(borderCaret, tooltipDimensions.caretBorder);
16697
16768
  }
16698
16769
  }
16699
16770
  // we can update the tooltipDimensions.top and tooltipDimensions.left now
@@ -17756,7 +17827,7 @@ function buildNodeFromJSON(json, step, guides) {
17756
17827
  }
17757
17828
  else if (propKey === 'data-pendo-code-block' && propValue === true && !ConfigReader.get('preventCodeInjection')) {
17758
17829
  const htmlString = step.getContent();
17759
- if (trim.call(htmlString).length === 0)
17830
+ if (!htmlString || trim.call(htmlString).length === 0)
17760
17831
  return;
17761
17832
  curNode.addClass('pendo-code-block').html(htmlString);
17762
17833
  }
@@ -23757,11 +23828,32 @@ const captureStepRenderStatus = (step, eligible, reason) => {
23757
23828
  Events.stepEligibility.trigger({ stepId: id, guideId, eligible, reason });
23758
23829
  return eligible;
23759
23830
  };
23831
+ function isHtmlTooltipStep(step) {
23832
+ if (_.get(step, 'attributes.buildingBlockLayoutType') !== 'tooltip')
23833
+ return false;
23834
+ return Boolean(_.get(step, 'attributes.htmlContent') || step.htmlContent || step.htmlContentUrl);
23835
+ }
23836
+ function getHtmlTooltipSelector(step) {
23837
+ return step.elementPathRule || _.get(step, 'attributes.elementPathRule');
23838
+ }
23760
23839
  var canStepBeRendered = function (step) {
23761
23840
  const statusWriter = _.partial(captureStepRenderStatus, step);
23762
23841
  if (isDismissedUntilReload(step)) {
23763
23842
  return statusWriter(false, 'dismissed');
23764
23843
  }
23844
+ // HTML guide tooltips don't set step.type === 'tooltip' (they keep the
23845
+ // guide-level type, typically 'lightbox') and don't have step.domJson, so
23846
+ // the standard tooltip detection below misses them. Without filtering here,
23847
+ // an HTML tooltip with a missing or invisible anchor sails through eligibility
23848
+ // and silently falls back to a lightbox layout at render time.
23849
+ if (isHtmlTooltipStep(step)) {
23850
+ var htmlSelector = getHtmlTooltipSelector(step);
23851
+ var htmlAnchor = htmlSelector ? SizzleProxy(htmlSelector)[0] : null;
23852
+ if (isElementVisible(htmlAnchor)) {
23853
+ return statusWriter(true, 'target_element_html_tooltip');
23854
+ }
23855
+ return statusWriter(wouldBeVisibleAfterAutoScroll(htmlAnchor), 'target_element_html_tooltip_scroll');
23856
+ }
23765
23857
  if (!step.elementPathRule && (step.type === 'lightbox' || step.type === 'whatsnew')) {
23766
23858
  return statusWriter(true, '');
23767
23859
  }
@@ -25765,7 +25857,7 @@ function createPreviewBar() {
25765
25857
  var script = document.createElement('script');
25766
25858
  script.src = getPreviewModeAssetUrl();
25767
25859
  script.onload = function () {
25768
- var whiteLabelSettings = ConfigReader.get('whiteLabelSettings');
25860
+ var whiteLabelSettings = getWhiteLabelSettings(findStoredPreviewConfig());
25769
25861
  if (whiteLabelSettings && frame.contentWindow) {
25770
25862
  frame.contentWindow.postMessage({
25771
25863
  mutation: 'preview/setWhiteLabelSettings',
@@ -25904,6 +25996,19 @@ function sendPreviewModeFailureMessage(document, errorObj) {
25904
25996
  }
25905
25997
  }, location.origin);
25906
25998
  }
25999
+ function getWhiteLabelSettings(config) {
26000
+ var whiteLabelSettings = ConfigReader.get('whiteLabelSettings');
26001
+ if (!whiteLabelSettings && config && config.ux === 'novus') {
26002
+ whiteLabelSettings = {
26003
+ logoUrl: 'https://novus.pendo.io/novus-square-icon.svg',
26004
+ logoStyle: {
26005
+ maxWidth: '40px',
26006
+ maxHeight: '40px'
26007
+ }
26008
+ };
26009
+ }
26010
+ return whiteLabelSettings;
26011
+ }
25907
26012
  function updatePreview(document, activeGuides, lastGuideStepSeen) {
25908
26013
  if (!isInPreviewMode())
25909
26014
  return;
@@ -25958,7 +26063,7 @@ function updatePreview(document, activeGuides, lastGuideStepSeen) {
25958
26063
  hostname: SERVER
25959
26064
  }
25960
26065
  }, location.origin);
25961
- var whiteLabelSettings = ConfigReader.get('whiteLabelSettings');
26066
+ var whiteLabelSettings = getWhiteLabelSettings(config);
25962
26067
  if (whiteLabelSettings) {
25963
26068
  previewFrame.contentWindow.postMessage({
25964
26069
  mutation: 'preview/setWhiteLabelSettings',
@@ -29159,11 +29264,18 @@ function teardown() {
29159
29264
  try {
29160
29265
  Events.appHidden.trigger();
29161
29266
  Events.appUnloaded.trigger();
29162
- _.each(teardownFns, function (teardownFn) {
29163
- teardownFn();
29164
- });
29267
+ try {
29268
+ _.each(teardownFns, function (teardownFn) {
29269
+ teardownFn();
29270
+ });
29271
+ }
29272
+ finally {
29273
+ // Always drain the registered teardown fns even if one throws;
29274
+ // otherwise a single bad teardown leaves stale entries that
29275
+ // would be re-invoked on the next initialize/teardown cycle.
29276
+ teardownFns.length = 0;
29277
+ }
29165
29278
  pageLoad.reset();
29166
- teardownFns.length = 0;
29167
29279
  SingletonMessageHandler.close();
29168
29280
  Eventable.clear(Events);
29169
29281
  Eventable.clear(PublicEvents);
@@ -40735,19 +40847,17 @@ function TextCapture() {
40735
40847
  }
40736
40848
  }
40737
40849
 
40738
- var substitutionRegex = '\\{(?:\\s?)([^.\\s]?visitor|account|parentAccount)\\.([^|\\s/]*)(?:\\s?\\|\\s?([^}]+|[\\/s]+))?(?:\\s?\\/\\s?){1}\\}';
40739
- var skipStepString = '{skipStep:* *(auto|\\d+)\\/}';
40740
- var goToMiddleString = '(?!0)(\\d+)';
40741
- var goToString = "({goto-".concat(goToMiddleString, "\\/})");
40742
- var containerSelector = '[id^="pendo-guide-container"]';
40743
- function lookupGuideButtons(domJson, buttons) {
40744
- if (buttons === void 0) { buttons = []; }
40850
+ const substitutionRegex = '\\{(?:\\s?)([^.\\s]?visitor|account|parentAccount)\\.([^|\\s/]*)(?:\\s?\\|\\s?([^}]+|[\\/s]+))?(?:\\s?\\/\\s?){1}\\}';
40851
+ const skipStepString = '{skipStep:* *(auto|\\d+)\\/}';
40852
+ const goToMiddleString = '(?!0)(\\d+)';
40853
+ const goToString = `({goto-${goToMiddleString}\\/})`;
40854
+ const containerSelector = '[id^="pendo-guide-container"]';
40855
+ function lookupGuideButtons(domJson, buttons = []) {
40745
40856
  if (domJson.type === 'button' && domJson.actions) {
40746
40857
  buttons.push(domJson);
40747
40858
  }
40748
40859
  if (domJson.children) {
40749
- for (var _i = 0, _a = domJson.children; _i < _a.length; _i++) {
40750
- var child = _a[_i];
40860
+ for (const child of domJson.children) {
40751
40861
  lookupGuideButtons(child, buttons);
40752
40862
  }
40753
40863
  }
@@ -40776,16 +40886,15 @@ function removeMarkdownSyntax(element, textToReplace, replacementText, pendo) {
40776
40886
  }
40777
40887
  }
40778
40888
  var guideMarkdownUtil = {
40779
- substitutionRegex: substitutionRegex,
40780
- skipStepString: skipStepString,
40781
- goToString: goToString,
40782
- containerSelector: containerSelector,
40783
- lookupGuideButtons: lookupGuideButtons,
40784
- removeMarkdownSyntax: removeMarkdownSyntax
40889
+ substitutionRegex,
40890
+ skipStepString,
40891
+ goToString,
40892
+ containerSelector,
40893
+ lookupGuideButtons,
40894
+ removeMarkdownSyntax
40785
40895
  };
40786
40896
 
40787
- function getZoneSafeMethod(_, method, target) {
40788
- if (target === void 0) { target = window; }
40897
+ function getZoneSafeMethod(_, method, target = window) {
40789
40898
  var zoneSymbol = '__symbol__';
40790
40899
  /* global Zone */
40791
40900
  if (typeof Zone !== 'undefined' && _.isFunction(Zone[zoneSymbol])) {
@@ -40798,20 +40907,20 @@ function getZoneSafeMethod(_, method, target) {
40798
40907
  }
40799
40908
 
40800
40909
  // Does not support submit and go to
40801
- var goToRegex = new RegExp(guideMarkdownUtil.goToString);
40802
- var PollBranching = {
40910
+ const goToRegex = new RegExp(guideMarkdownUtil.goToString);
40911
+ const PollBranching = {
40803
40912
  name: 'PollBranching',
40804
- script: function (step, guide, pendo) {
40805
- var isAdvanceIntercepted = false;
40806
- var branchingQuestions = initialBranchingSetup(step, pendo);
40913
+ script(step, guide, pendo) {
40914
+ let isAdvanceIntercepted = false;
40915
+ const branchingQuestions = initialBranchingSetup(step, pendo);
40807
40916
  if (branchingQuestions) {
40808
40917
  // If there are too many branching questions saved, exit and run the guide normally.
40809
40918
  if (pendo._.size(branchingQuestions) > 1)
40810
40919
  return;
40811
- this.on('beforeAdvance', function (evt) {
40812
- var noResponseSelected = step.guideElement.find('[branching] .pendo-radio:checked').length === 0;
40813
- var responseLabel = step.guideElement.find('[branching] .pendo-radio:checked + label')[0];
40814
- var noGotoLabel;
40920
+ this.on('beforeAdvance', (evt) => {
40921
+ const noResponseSelected = step.guideElement.find('[branching] .pendo-radio:checked').length === 0;
40922
+ const responseLabel = step.guideElement.find('[branching] .pendo-radio:checked + label')[0];
40923
+ let noGotoLabel;
40815
40924
  if (responseLabel) {
40816
40925
  noGotoLabel = pendo._.isNull(responseLabel.getAttribute('goToStep'));
40817
40926
  }
@@ -40822,58 +40931,58 @@ var PollBranching = {
40822
40931
  });
40823
40932
  }
40824
40933
  },
40825
- test: function (step, guide, pendo) {
40934
+ test(step, guide, pendo) {
40826
40935
  var _a;
40827
- var branchingQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find('._pendo-multi-choice-poll-question:contains("{branching/}")');
40936
+ let branchingQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find('._pendo-multi-choice-poll-question:contains("{branching/}")');
40828
40937
  return !pendo._.isUndefined(branchingQuestions) && pendo._.size(branchingQuestions);
40829
40938
  },
40830
- designerListener: function (pendo) {
40831
- var target = pendo.dom.getBody();
40832
- var config = {
40939
+ designerListener(pendo) {
40940
+ const target = pendo.dom.getBody();
40941
+ const config = {
40833
40942
  attributeFilter: ['data-layout'],
40834
40943
  attributes: true,
40835
40944
  childList: true,
40836
40945
  characterData: true,
40837
40946
  subtree: true
40838
40947
  };
40839
- var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
40840
- var observer = new MutationObserver(applyBranchingIndicators);
40948
+ const MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
40949
+ const observer = new MutationObserver(applyBranchingIndicators);
40841
40950
  observer.observe(target, config);
40842
40951
  function applyBranchingIndicators(mutations) {
40843
40952
  pendo._.each(mutations, function (mutation) {
40844
40953
  var _a;
40845
- var nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelector);
40954
+ const nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelector);
40846
40955
  if (mutation.addedNodes.length && nodeHasQuerySelector) {
40847
40956
  if (mutation.addedNodes[0].querySelector('._pendo-multi-choice-poll-select-border')) {
40848
40957
  if (pendo._.size(pendo.dom('._pendo-multi-choice-poll-question:contains("{branching/}")'))) {
40849
40958
  pendo
40850
40959
  .dom('._pendo-multi-choice-poll-question:contains("{branching/}")')
40851
- .each(function (question, index) {
40852
- pendo._.each(pendo.dom("#".concat(question.id, " *")), function (element) {
40960
+ .each((question, index) => {
40961
+ pendo._.each(pendo.dom(`#${question.id} *`), (element) => {
40853
40962
  guideMarkdownUtil.removeMarkdownSyntax(element, '{branching/}', '', pendo);
40854
40963
  });
40855
40964
  pendo
40856
- .dom("#".concat(question.id, " p"))
40965
+ .dom(`#${question.id} p`)
40857
40966
  .css({ display: 'inline-block !important' })
40858
40967
  .append(branchingIcon('#999', '20px'))
40859
40968
  .attr({ title: 'Custom Branching Added' });
40860
- var dataPendoPollId = question.getAttribute('data-pendo-poll-id');
40861
- if (pendo.dom("._pendo-multi-choice-poll-question[data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0]) {
40969
+ let dataPendoPollId = question.getAttribute('data-pendo-poll-id');
40970
+ if (pendo.dom(`._pendo-multi-choice-poll-question[data-pendo-poll-id=${dataPendoPollId}]`)[0]) {
40862
40971
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
40863
40972
  pendo
40864
- .dom("._pendo-multi-choice-poll-question[data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0]
40973
+ .dom(`._pendo-multi-choice-poll-question[data-pendo-poll-id=${dataPendoPollId}]`)[0]
40865
40974
  .textContent.trim();
40866
40975
  }
40867
- var pollLabels = pendo.dom("label[for*=".concat(dataPendoPollId, "]"));
40976
+ let pollLabels = pendo.dom(`label[for*=${dataPendoPollId}]`);
40868
40977
  if (pendo._.size(pollLabels)) {
40869
- pendo._.forEach(pollLabels, function (label) {
40978
+ pendo._.forEach(pollLabels, (label) => {
40870
40979
  if (goToRegex.test(label.textContent)) {
40871
- var labelTitle = goToRegex.exec(label.textContent)[2];
40980
+ let labelTitle = goToRegex.exec(label.textContent)[2];
40872
40981
  guideMarkdownUtil.removeMarkdownSyntax(label, goToRegex, '', pendo);
40873
40982
  pendo
40874
40983
  .dom(label)
40875
40984
  .append(branchingIcon('#999', '14px'))
40876
- .attr({ title: "Branching to step ".concat(labelTitle) });
40985
+ .attr({ title: `Branching to step ${labelTitle}` });
40877
40986
  }
40878
40987
  });
40879
40988
  }
@@ -40881,9 +40990,9 @@ var PollBranching = {
40881
40990
  pendo
40882
40991
  .dom(question)
40883
40992
  .append(branchingErrorHTML(question.dataset.pendoPollId));
40884
- pendo.dom("#".concat(question.id, " #pendo-ps-branching-svg")).remove();
40993
+ pendo.dom(`#${question.id} #pendo-ps-branching-svg`).remove();
40885
40994
  pendo
40886
- .dom("#".concat(question.id, " p"))
40995
+ .dom(`#${question.id} p`)
40887
40996
  .css({ display: 'inline-block !important' })
40888
40997
  .append(branchingIcon('red', '20px'))
40889
40998
  .attr({ title: 'Unsupported Branching configuration' });
@@ -40895,31 +41004,49 @@ var PollBranching = {
40895
41004
  });
40896
41005
  }
40897
41006
  function branchingErrorHTML(dataPendoPollId) {
40898
- return "<div style=\"text-align:lrft; font-size: 14px; color: red;\n font-style: italic; margin-top: 0px;\" class=\"branching-wrapper\"\n name=\"".concat(dataPendoPollId, "\">\n * Branching Error: Multiple branching polls not supported</div>");
41007
+ return `<div style="text-align:lrft; font-size: 14px; color: red;
41008
+ font-style: italic; margin-top: 0px;" class="branching-wrapper"
41009
+ name="${dataPendoPollId}">
41010
+ * Branching Error: Multiple branching polls not supported</div>`;
40899
41011
  }
40900
41012
  function branchingIcon(color, size) {
40901
- return "<svg id=\"pendo-ps-branching-svg\" viewBox=\"0 0 24 24\" fill=\"none\"\n style=\"margin-left: 5px;\n height:".concat(size, "; width:").concat(size, "; display:inline; vertical-align:middle;\" xmlns=\"http://www.w3.org/2000/svg\">\n <g stroke-width=\"0\"></g>\n <g stroke-linecap=\"round\" stroke-linejoin=\"round\"></g>\n <g> <circle cx=\"4\" cy=\"7\" r=\"2\" stroke=\"").concat(color, "\"\n stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></circle>\n <circle cx=\"20\" cy=\"7\" r=\"2\" stroke=\"").concat(color, "\"\n stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></circle>\n <circle cx=\"20\" cy=\"17\" r=\"2\" stroke=\"").concat(color, "\" stroke-width=\"2\"\n stroke-linecap=\"round\" stroke-linejoin=\"round\"></circle>\n <path d=\"M18 7H6\" stroke=\"").concat(color, "\" stroke-width=\"2\"\n stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n <path d=\"M7 7V7C8.65685 7 10 8.34315 10 10V15C10 16.1046 10.8954 17 12 17H18\"\n stroke=\"").concat(color, "\" stroke-width=\"2\" stroke-linecap=\"round\"\n stroke-linejoin=\"round\"></path> </g></svg>");
41013
+ return `<svg id="pendo-ps-branching-svg" viewBox="0 0 24 24" fill="none"
41014
+ style="margin-left: 5px;
41015
+ height:${size}; width:${size}; display:inline; vertical-align:middle;" xmlns="http://www.w3.org/2000/svg">
41016
+ <g stroke-width="0"></g>
41017
+ <g stroke-linecap="round" stroke-linejoin="round"></g>
41018
+ <g> <circle cx="4" cy="7" r="2" stroke="${color}"
41019
+ stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></circle>
41020
+ <circle cx="20" cy="7" r="2" stroke="${color}"
41021
+ stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></circle>
41022
+ <circle cx="20" cy="17" r="2" stroke="${color}" stroke-width="2"
41023
+ stroke-linecap="round" stroke-linejoin="round"></circle>
41024
+ <path d="M18 7H6" stroke="${color}" stroke-width="2"
41025
+ stroke-linecap="round" stroke-linejoin="round"></path>
41026
+ <path d="M7 7V7C8.65685 7 10 8.34315 10 10V15C10 16.1046 10.8954 17 12 17H18"
41027
+ stroke="${color}" stroke-width="2" stroke-linecap="round"
41028
+ stroke-linejoin="round"></path> </g></svg>`;
40902
41029
  }
40903
41030
  }
40904
41031
  };
40905
41032
  function initialBranchingSetup(step, pendo) {
40906
- var questions = step.guideElement.find('._pendo-multi-choice-poll-question:contains("{branching/}")');
40907
- pendo._.forEach(questions, function (question) {
40908
- var dataPendoPollId = question.getAttribute('data-pendo-poll-id');
40909
- pendo._.each(step.guideElement.find("#".concat(question.id, " *")), function (element) {
41033
+ const questions = step.guideElement.find('._pendo-multi-choice-poll-question:contains("{branching/}")');
41034
+ pendo._.forEach(questions, (question) => {
41035
+ let dataPendoPollId = question.getAttribute('data-pendo-poll-id');
41036
+ pendo._.each(step.guideElement.find(`#${question.id} *`), (element) => {
40910
41037
  guideMarkdownUtil.removeMarkdownSyntax(element, '{branching/}', '', pendo);
40911
41038
  });
40912
- var pollLabels = step.guideElement.find("label[for*=".concat(dataPendoPollId, "]"));
40913
- pendo._.forEach(pollLabels, function (label) {
41039
+ let pollLabels = step.guideElement.find(`label[for*=${dataPendoPollId}]`);
41040
+ pendo._.forEach(pollLabels, (label) => {
40914
41041
  if (pendo._.isNull(goToRegex.exec(label.textContent))) {
40915
41042
  return;
40916
41043
  }
40917
- var gotoSubstring = goToRegex.exec(label.textContent)[1];
40918
- var gotoIndex = goToRegex.exec(label.textContent)[2];
41044
+ let gotoSubstring = goToRegex.exec(label.textContent)[1];
41045
+ let gotoIndex = goToRegex.exec(label.textContent)[2];
40919
41046
  label.setAttribute('goToStep', gotoIndex);
40920
41047
  guideMarkdownUtil.removeMarkdownSyntax(label, gotoSubstring, '', pendo);
40921
41048
  });
40922
- var pollChoiceContainer = step.guideElement.find("[data-pendo-poll-id=".concat(dataPendoPollId, "]._pendo-multi-choice-poll-select-border"));
41049
+ let pollChoiceContainer = step.guideElement.find(`[data-pendo-poll-id=${dataPendoPollId}]._pendo-multi-choice-poll-select-border`);
40923
41050
  if (pollChoiceContainer && pollChoiceContainer.length) {
40924
41051
  pollChoiceContainer[0].setAttribute('branching', '');
40925
41052
  }
@@ -40928,24 +41055,24 @@ function initialBranchingSetup(step, pendo) {
40928
41055
  }
40929
41056
  function branchingGoToStep(event, step, guide, pendo) {
40930
41057
  var _a;
40931
- var checkedPollInputId = (_a = step.guideElement.find('[branching] input.pendo-radio[data-pendo-poll-id]:checked')[0]) === null || _a === void 0 ? void 0 : _a.id;
40932
- var checkedPollLabel = step.guideElement.find("label[for=\"".concat(checkedPollInputId, "\"]"))[0];
40933
- var checkedPollLabelStepIndex = checkedPollLabel === null || checkedPollLabel === void 0 ? void 0 : checkedPollLabel.getAttribute('goToStep');
40934
- var pollStepIndex = checkedPollLabelStepIndex - 1;
41058
+ let checkedPollInputId = (_a = step.guideElement.find('[branching] input.pendo-radio[data-pendo-poll-id]:checked')[0]) === null || _a === void 0 ? void 0 : _a.id;
41059
+ let checkedPollLabel = step.guideElement.find(`label[for="${checkedPollInputId}"]`)[0];
41060
+ let checkedPollLabelStepIndex = checkedPollLabel === null || checkedPollLabel === void 0 ? void 0 : checkedPollLabel.getAttribute('goToStep');
41061
+ let pollStepIndex = checkedPollLabelStepIndex - 1;
40935
41062
  if (pollStepIndex < 0)
40936
41063
  return;
40937
- var destinationObject = {
41064
+ const destinationObject = {
40938
41065
  destinationStepId: guide.steps[pollStepIndex].id,
40939
- step: step
41066
+ step
40940
41067
  };
40941
41068
  pendo.goToStep(destinationObject);
40942
41069
  event.cancel = true;
40943
41070
  }
40944
41071
 
40945
- var MetadataSubstitution = {
41072
+ const MetadataSubstitution = {
40946
41073
  name: 'MetadataSubstitution',
40947
- script: function (step, guide, pendo) {
40948
- var placeholderData = findSubstitutableElements(pendo);
41074
+ script(step, guide, pendo) {
41075
+ const placeholderData = findSubstitutableElements(pendo);
40949
41076
  if (step.domJson) {
40950
41077
  findSubstitutableUrlsInJson(step.domJson, placeholderData, pendo);
40951
41078
  }
@@ -40953,22 +41080,22 @@ var MetadataSubstitution = {
40953
41080
  pendo._.each(placeholderData, function (placeholder) {
40954
41081
  processPlaceholder(placeholder, pendo);
40955
41082
  });
40956
- var containerId = "pendo-g-".concat(step.id);
40957
- var context_1 = step.guideElement;
40958
- updateGuideContainer(containerId, context_1, pendo);
41083
+ const containerId = `pendo-g-${step.id}`;
41084
+ const context = step.guideElement;
41085
+ updateGuideContainer(containerId, context, pendo);
40959
41086
  }
40960
41087
  },
40961
- designerListener: function (pendo) {
40962
- var target = pendo.dom.getBody();
41088
+ designerListener(pendo) {
41089
+ const target = pendo.dom.getBody();
40963
41090
  if (pendo.designerv2) {
40964
41091
  pendo.designerv2.runMetadataSubstitutionForDesignerPreview = function runMetadataSubstitutionForDesignerPreview() {
40965
41092
  var _a;
40966
41093
  if (!document.querySelector(guideMarkdownUtil.containerSelector))
40967
41094
  return;
40968
- var step = (_a = pendo.designerv2.currentlyPreviewedGuide) === null || _a === void 0 ? void 0 : _a.steps[0];
41095
+ const step = (_a = pendo.designerv2.currentlyPreviewedGuide) === null || _a === void 0 ? void 0 : _a.steps[0];
40969
41096
  if (!step)
40970
41097
  return;
40971
- var placeholderData = findSubstitutableElements(pendo);
41098
+ const placeholderData = findSubstitutableElements(pendo);
40972
41099
  if (step.buildingBlocks) {
40973
41100
  findSubstitutableUrlsInJson(step.buildingBlocks, placeholderData, pendo);
40974
41101
  }
@@ -40978,32 +41105,32 @@ var MetadataSubstitution = {
40978
41105
  return;
40979
41106
  processPlaceholder(placeholder, pendo);
40980
41107
  });
40981
- var containerId = "pendo-g-".concat(step.id);
40982
- var context_2 = step.guideElement;
40983
- updateGuideContainer(containerId, context_2, pendo);
41108
+ const containerId = `pendo-g-${step.id}`;
41109
+ const context = step.guideElement;
41110
+ updateGuideContainer(containerId, context, pendo);
40984
41111
  }
40985
41112
  };
40986
41113
  }
40987
- var config = {
41114
+ const config = {
40988
41115
  attributeFilter: ['data-layout'],
40989
41116
  attributes: true,
40990
41117
  childList: true,
40991
41118
  characterData: true,
40992
41119
  subtree: true
40993
41120
  };
40994
- var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
40995
- var observer = new MutationObserver(applySubstitutionIndicators);
41121
+ const MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
41122
+ const observer = new MutationObserver(applySubstitutionIndicators);
40996
41123
  observer.observe(target, config);
40997
41124
  function applySubstitutionIndicators(mutations) {
40998
41125
  pendo._.each(mutations, function (mutation) {
40999
41126
  var _a;
41000
41127
  if (mutation.addedNodes.length) {
41001
41128
  if (document.querySelector(guideMarkdownUtil.containerSelector)) {
41002
- var placeholderData = findSubstitutableElements(pendo);
41003
- var step = (_a = pendo.designerv2.currentlyPreviewedGuide) === null || _a === void 0 ? void 0 : _a.steps[0];
41129
+ const placeholderData = findSubstitutableElements(pendo);
41130
+ const step = (_a = pendo.designerv2.currentlyPreviewedGuide) === null || _a === void 0 ? void 0 : _a.steps[0];
41004
41131
  if (!step)
41005
41132
  return;
41006
- var pendoBlocks = step.buildingBlocks;
41133
+ const pendoBlocks = step.buildingBlocks;
41007
41134
  if (!pendo._.isUndefined(pendoBlocks)) {
41008
41135
  findSubstitutableUrlsInJson(pendoBlocks, placeholderData, pendo);
41009
41136
  }
@@ -41013,9 +41140,9 @@ var MetadataSubstitution = {
41013
41140
  return;
41014
41141
  processPlaceholder(placeholder, pendo);
41015
41142
  });
41016
- var containerId = "pendo-g-".concat(step.id);
41017
- var context_3 = step.guideElement;
41018
- updateGuideContainer(containerId, context_3, pendo);
41143
+ const containerId = `pendo-g-${step.id}`;
41144
+ const context = step.guideElement;
41145
+ updateGuideContainer(containerId, context, pendo);
41019
41146
  }
41020
41147
  }
41021
41148
  }
@@ -41024,18 +41151,18 @@ var MetadataSubstitution = {
41024
41151
  }
41025
41152
  };
41026
41153
  function processPlaceholder(placeholder, pendo) {
41027
- var match;
41028
- var data = placeholder.data, target = placeholder.target;
41029
- var subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
41154
+ let match;
41155
+ const { data, target } = placeholder;
41156
+ const subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
41030
41157
  while ((match = matchPlaceholder(placeholder, subRegex))) {
41031
- var usedArrayPath = Array.isArray(match) && match.length >= 2;
41032
- var currentStr = target === 'textContent'
41158
+ const usedArrayPath = Array.isArray(match) && match.length >= 2;
41159
+ const currentStr = target === 'textContent'
41033
41160
  ? data[target]
41034
41161
  : decodeURI((data.getAttribute && (target === 'href' || target === 'value') ? (data.getAttribute(target) || '') : data[target]));
41035
- var matched = usedArrayPath ? match : subRegex.exec(currentStr);
41162
+ const matched = usedArrayPath ? match : subRegex.exec(currentStr);
41036
41163
  if (!matched)
41037
41164
  continue;
41038
- var mdValue = getSubstituteValue(matched, pendo);
41165
+ const mdValue = getSubstituteValue(matched, pendo);
41039
41166
  substituteMetadataByTarget(data, target, mdValue, matched);
41040
41167
  }
41041
41168
  }
@@ -41044,48 +41171,48 @@ function matchPlaceholder(placeholder, regex) {
41044
41171
  return placeholder.data[placeholder.target].match(regex);
41045
41172
  }
41046
41173
  else {
41047
- var raw = placeholder.data.getAttribute && (placeholder.target === 'href' || placeholder.target === 'value')
41174
+ const raw = placeholder.data.getAttribute && (placeholder.target === 'href' || placeholder.target === 'value')
41048
41175
  ? (placeholder.data.getAttribute(placeholder.target) || '')
41049
41176
  : placeholder.data[placeholder.target];
41050
41177
  return decodeURI(raw).match(regex);
41051
41178
  }
41052
41179
  }
41053
41180
  function getMetadataValueCaseInsensitive(metadata, type, property) {
41054
- var kind = metadata && metadata[type];
41181
+ const kind = metadata && metadata[type];
41055
41182
  if (!kind || typeof kind !== 'object')
41056
41183
  return undefined;
41057
- var direct = Object.prototype.hasOwnProperty.call(kind, property) ? kind[property] : undefined;
41184
+ const direct = Object.prototype.hasOwnProperty.call(kind, property) ? kind[property] : undefined;
41058
41185
  if (direct !== undefined) {
41059
41186
  return direct;
41060
41187
  }
41061
- var propLower = property.toLowerCase();
41062
- var key = Object.keys(kind).find(function (k) { return k.toLowerCase() === propLower; });
41063
- var value = key !== undefined ? kind[key] : undefined;
41188
+ const propLower = property.toLowerCase();
41189
+ const key = Object.keys(kind).find(k => k.toLowerCase() === propLower);
41190
+ const value = key !== undefined ? kind[key] : undefined;
41064
41191
  return value;
41065
41192
  }
41066
41193
  function getSubstituteValue(match, pendo) {
41067
41194
  if (pendo._.isUndefined(match[1]) || pendo._.isUndefined(match[2])) {
41068
41195
  return;
41069
41196
  }
41070
- var type = match[1];
41071
- var property = match[2];
41072
- var defaultValue = match[3];
41197
+ let type = match[1];
41198
+ let property = match[2];
41199
+ let defaultValue = match[3];
41073
41200
  if (pendo._.isUndefined(type) || pendo._.isUndefined(property)) {
41074
41201
  return;
41075
41202
  }
41076
- var metadata = pendo.getSerializedMetadata();
41077
- var mdValue = getMetadataValueCaseInsensitive(metadata, type, property);
41203
+ const metadata = pendo.getSerializedMetadata();
41204
+ let mdValue = getMetadataValueCaseInsensitive(metadata, type, property);
41078
41205
  if (mdValue === undefined || mdValue === null)
41079
41206
  mdValue = defaultValue || '';
41080
41207
  return mdValue;
41081
41208
  }
41082
41209
  function substituteMetadataByTarget(data, target, mdValue, matched) {
41083
- var isElement = data && typeof data.getAttribute === 'function';
41084
- var current = (target === 'href' || target === 'value') && isElement
41210
+ const isElement = data && typeof data.getAttribute === 'function';
41211
+ const current = (target === 'href' || target === 'value') && isElement
41085
41212
  ? (data.getAttribute(target) || '')
41086
41213
  : data[target];
41087
41214
  if (target === 'href' || target === 'value') {
41088
- var safeValue = window.encodeURIComponent(String(mdValue === undefined || mdValue === null ? '' : mdValue));
41215
+ const safeValue = window.encodeURIComponent(String(mdValue === undefined || mdValue === null ? '' : mdValue));
41089
41216
  data[target] = decodeURI(current).replace(matched[0], safeValue);
41090
41217
  }
41091
41218
  else {
@@ -41099,9 +41226,8 @@ function updateGuideContainer(containerId, context, pendo) {
41099
41226
  pendo.flexElement(pendo.dom(guideMarkdownUtil.containerSelector));
41100
41227
  pendo.BuildingBlocks.BuildingBlockGuides.recalculateGuideHeight(containerId, context);
41101
41228
  }
41102
- function findSubstitutableUrlsInJson(originalData, placeholderData, pendo) {
41103
- if (placeholderData === void 0) { placeholderData = []; }
41104
- var subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
41229
+ function findSubstitutableUrlsInJson(originalData, placeholderData = [], pendo) {
41230
+ const subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
41105
41231
  if ((originalData.name === 'url' || originalData.name === 'href') && originalData.value) {
41106
41232
  if (subRegex.test(originalData.value)) {
41107
41233
  placeholderData.push({
@@ -41111,37 +41237,37 @@ function findSubstitutableUrlsInJson(originalData, placeholderData, pendo) {
41111
41237
  }
41112
41238
  }
41113
41239
  if (originalData.properties && originalData.id === 'href_link_block') {
41114
- pendo._.each(originalData.properties, function (prop) {
41240
+ pendo._.each(originalData.properties, (prop) => {
41115
41241
  findSubstitutableUrlsInJson(prop, placeholderData, pendo);
41116
41242
  });
41117
41243
  }
41118
41244
  if (originalData.views) {
41119
- pendo._.each(originalData.views, function (view) {
41245
+ pendo._.each(originalData.views, (view) => {
41120
41246
  findSubstitutableUrlsInJson(view, placeholderData, pendo);
41121
41247
  });
41122
41248
  }
41123
41249
  if (originalData.parameters) {
41124
- pendo._.each(originalData.parameters, function (param) {
41250
+ pendo._.each(originalData.parameters, (param) => {
41125
41251
  findSubstitutableUrlsInJson(param, placeholderData, pendo);
41126
41252
  });
41127
41253
  }
41128
41254
  if (originalData.actions) {
41129
- pendo._.each(originalData.actions, function (action) {
41255
+ pendo._.each(originalData.actions, (action) => {
41130
41256
  findSubstitutableUrlsInJson(action, placeholderData, pendo);
41131
41257
  });
41132
41258
  }
41133
41259
  if (originalData.children) {
41134
- pendo._.each(originalData.children, function (child) {
41260
+ pendo._.each(originalData.children, (child) => {
41135
41261
  findSubstitutableUrlsInJson(child, placeholderData, pendo);
41136
41262
  });
41137
41263
  }
41138
41264
  return placeholderData;
41139
41265
  }
41140
41266
  function findSubstitutableElements(pendo) {
41141
- var elements = pendo.dom("".concat(guideMarkdownUtil.containerSelector, " *:not(.pendo-inline-ui)"));
41267
+ let elements = pendo.dom(`${guideMarkdownUtil.containerSelector} *:not(.pendo-inline-ui)`);
41142
41268
  return pendo._.chain(elements)
41143
41269
  .filter(function (placeholder) {
41144
- var subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
41270
+ const subRegex = new RegExp(guideMarkdownUtil.substitutionRegex);
41145
41271
  if (placeholder.localName === 'a') {
41146
41272
  return subRegex.test(decodeURI(placeholder.href)) || subRegex.test(placeholder.textContent);
41147
41273
  }
@@ -41197,25 +41323,51 @@ function findSubstitutableElements(pendo) {
41197
41323
  .value();
41198
41324
  }
41199
41325
  function substitutionIcon(color, size) {
41200
- return ("<div title=\"Metadata Substitution added\">\n <svg id=\"pendo-ps-substitution-icon\" viewBox=\"0 0 24 24\"\n preserveAspectRatio=\"xMidYMid meet\"\n height=".concat(size, " width=").concat(size, " title=\"Metadata Substitution\"\n style=\"bottom:5px; right:10px; position: absolute;\"\n fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" stroke=\"").concat(color, "\"\n transform=\"matrix(1, 0, 0, 1, 0, 0)rotate(0)\">\n <g stroke-width=\"0\"></g>\n <g stroke-linecap=\"round\" stroke-linejoin=\"round\"\n stroke=\"").concat(color, "\" stroke-width=\"0.528\"></g>\n <g><path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M5 5.5C4.17157 5.5 3.5 6.17157 3.5 7V10C3.5 10.8284\n 4.17157 11.5 5 11.5H8C8.82843 11.5 9.5 10.8284 9.5\n 10V9H17V11C17 11.2761 17.2239 11.5 17.5 11.5C17.7761\n 11.5 18 11.2761 18 11V8.5C18 8.22386 17.7761 8 17.5\n 8H9.5V7C9.5 6.17157 8.82843 5.5 8 5.5H5ZM8.5 7C8.5\n 6.72386 8.27614 6.5 8 6.5H5C4.72386 6.5 4.5 6.72386\n 4.5 7V10C4.5 10.2761 4.72386 10.5 5 10.5H8C8.27614\n 10.5 8.5 10.2761 8.5 10V7Z\" fill=\"").concat(color, "\"></path>\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\"\n d=\"M7 13C7 12.7239 6.77614 12.5 6.5 12.5C6.22386 12.5\n 6 12.7239 6 13V15.5C6 15.7761 6.22386 16 6.5\n 16H14.5V17C14.5 17.8284 15.1716 18.5 16 18.5H19C19.8284\n 18.5 20.5 17.8284 20.5 17V14C20.5 13.1716 19.8284 12.5\n 19 12.5H16C15.1716 12.5 14.5 13.1716 14.5\n 14V15H7V13ZM15.5 17C15.5 17.2761 15.7239 17.5 16\n 17.5H19C19.2761 17.5 19.5 17.2761 19.5 17V14C19.5\n 13.7239 19.2761 13.5 19 13.5H16C15.7239 13.5 15.5\n 13.7239 15.5 14V17Z\" fill=\"").concat(color, "\"></path> </g></svg></div>"));
41201
- }
41202
-
41203
- var requiredElement = '<span class="_pendo-required-indicator" style="color:red; font-style:italic;" title="Question is required"> *</span>';
41204
- var requiredSyntax = '{required/}';
41205
- var RequiredQuestions = {
41326
+ return (`<div title="Metadata Substitution added">
41327
+ <svg id="pendo-ps-substitution-icon" viewBox="0 0 24 24"
41328
+ preserveAspectRatio="xMidYMid meet"
41329
+ height=${size} width=${size} title="Metadata Substitution"
41330
+ style="bottom:5px; right:10px; position: absolute;"
41331
+ fill="none" xmlns="http://www.w3.org/2000/svg" stroke="${color}"
41332
+ transform="matrix(1, 0, 0, 1, 0, 0)rotate(0)">
41333
+ <g stroke-width="0"></g>
41334
+ <g stroke-linecap="round" stroke-linejoin="round"
41335
+ stroke="${color}" stroke-width="0.528"></g>
41336
+ <g><path fill-rule="evenodd" clip-rule="evenodd"
41337
+ d="M5 5.5C4.17157 5.5 3.5 6.17157 3.5 7V10C3.5 10.8284
41338
+ 4.17157 11.5 5 11.5H8C8.82843 11.5 9.5 10.8284 9.5
41339
+ 10V9H17V11C17 11.2761 17.2239 11.5 17.5 11.5C17.7761
41340
+ 11.5 18 11.2761 18 11V8.5C18 8.22386 17.7761 8 17.5
41341
+ 8H9.5V7C9.5 6.17157 8.82843 5.5 8 5.5H5ZM8.5 7C8.5
41342
+ 6.72386 8.27614 6.5 8 6.5H5C4.72386 6.5 4.5 6.72386
41343
+ 4.5 7V10C4.5 10.2761 4.72386 10.5 5 10.5H8C8.27614
41344
+ 10.5 8.5 10.2761 8.5 10V7Z" fill="${color}"></path>
41345
+ <path fill-rule="evenodd" clip-rule="evenodd"
41346
+ d="M7 13C7 12.7239 6.77614 12.5 6.5 12.5C6.22386 12.5
41347
+ 6 12.7239 6 13V15.5C6 15.7761 6.22386 16 6.5
41348
+ 16H14.5V17C14.5 17.8284 15.1716 18.5 16 18.5H19C19.8284
41349
+ 18.5 20.5 17.8284 20.5 17V14C20.5 13.1716 19.8284 12.5
41350
+ 19 12.5H16C15.1716 12.5 14.5 13.1716 14.5
41351
+ 14V15H7V13ZM15.5 17C15.5 17.2761 15.7239 17.5 16
41352
+ 17.5H19C19.2761 17.5 19.5 17.2761 19.5 17V14C19.5
41353
+ 13.7239 19.2761 13.5 19 13.5H16C15.7239 13.5 15.5
41354
+ 13.7239 15.5 14V17Z" fill="${color}"></path> </g></svg></div>`);
41355
+ }
41356
+
41357
+ const requiredElement = '<span class="_pendo-required-indicator" style="color:red; font-style:italic;" title="Question is required"> *</span>';
41358
+ const requiredSyntax = '{required/}';
41359
+ const RequiredQuestions = {
41206
41360
  name: 'RequiredQuestions',
41207
- script: function (step, guide, pendo) {
41361
+ script(step, guide, pendo) {
41208
41362
  var _a;
41209
- var requiredPollIds = [];
41210
- var submitButtons = (_a = guideMarkdownUtil.lookupGuideButtons(step.domJson)) === null || _a === void 0 ? void 0 : _a.filter(function (button) {
41211
- return button.actions.find(function (action) { return action.action === 'submitPoll' || action.action === 'submitPollAndGoToStep'; });
41212
- });
41213
- var requiredQuestions = processRequiredQuestions();
41363
+ let requiredPollIds = [];
41364
+ let submitButtons = (_a = guideMarkdownUtil.lookupGuideButtons(step.domJson)) === null || _a === void 0 ? void 0 : _a.filter(button => button.actions.find(action => action.action === 'submitPoll' || action.action === 'submitPollAndGoToStep'));
41365
+ const requiredQuestions = processRequiredQuestions();
41214
41366
  if (requiredQuestions) {
41215
- pendo._.forEach(requiredQuestions, function (question) {
41367
+ pendo._.forEach(requiredQuestions, (question) => {
41216
41368
  if (question.classList.contains('_pendo-open-text-poll-question')) {
41217
- var pollId = question.dataset.pendoPollId;
41218
- step.attachEvent(step.guideElement.find("[data-pendo-poll-id=".concat(pollId, "]._pendo-open-text-poll-input"))[0], 'input', function () {
41369
+ let pollId = question.dataset.pendoPollId;
41370
+ step.attachEvent(step.guideElement.find(`[data-pendo-poll-id=${pollId}]._pendo-open-text-poll-input`)[0], 'input', function () {
41219
41371
  evaluateRequiredQuestions(requiredQuestions);
41220
41372
  });
41221
41373
  }
@@ -41227,8 +41379,8 @@ var RequiredQuestions = {
41227
41379
  });
41228
41380
  }
41229
41381
  function getEligibleQuestions() {
41230
- var allQuestions = step.guideElement.find("[class*=-poll-question]:contains(".concat(requiredSyntax, ")"));
41231
- return pendo._.reduce(allQuestions, function (eligibleQuestions, question) {
41382
+ const allQuestions = step.guideElement.find(`[class*=-poll-question]:contains(${requiredSyntax})`);
41383
+ return pendo._.reduce(allQuestions, (eligibleQuestions, question) => {
41232
41384
  if (question.classList.contains('_pendo-yes-no-poll-question'))
41233
41385
  return eligibleQuestions;
41234
41386
  eligibleQuestions.push(question);
@@ -41236,19 +41388,27 @@ var RequiredQuestions = {
41236
41388
  }, []);
41237
41389
  }
41238
41390
  function processRequiredQuestions() {
41239
- var questions = getEligibleQuestions();
41391
+ let questions = getEligibleQuestions();
41240
41392
  if (questions) {
41241
- pendo._.forEach(questions, function (question) {
41242
- var dataPendoPollId = question.getAttribute('data-pendo-poll-id');
41393
+ pendo._.forEach(questions, question => {
41394
+ let dataPendoPollId = question.getAttribute('data-pendo-poll-id');
41243
41395
  requiredPollIds.push(dataPendoPollId);
41244
- pendo._.each(step.guideElement.find("#".concat(question.id, " *, #").concat(question.id)), function (element) {
41396
+ pendo._.each(step.guideElement.find(`#${question.id} *, #${question.id}`), (element) => {
41245
41397
  guideMarkdownUtil.removeMarkdownSyntax(element, requiredSyntax, '', pendo);
41246
41398
  });
41247
- step.guideElement.find("#".concat(question.id, " p")).append(requiredElement);
41399
+ step.guideElement.find(`#${question.id} p`).append(requiredElement);
41248
41400
  });
41249
41401
  }
41250
41402
  if (pendo._.size(requiredPollIds)) {
41251
- var disabledButtonStyles = "<style type=text/css\n id=_pendo-guide-required-disabled>\n ._pendo-button:disabled, ._pendo-buttons[disabled] {\n border: 1px solid #999999 !important;\n background-color: #cccccc !important;\n color: #666666 !important;\n pointer-events: none !important;\n }\n </style>";
41403
+ const disabledButtonStyles = `<style type=text/css
41404
+ id=_pendo-guide-required-disabled>
41405
+ ._pendo-button:disabled, ._pendo-buttons[disabled] {
41406
+ border: 1px solid #999999 !important;
41407
+ background-color: #cccccc !important;
41408
+ color: #666666 !important;
41409
+ pointer-events: none !important;
41410
+ }
41411
+ </style>`;
41252
41412
  if (pendo.dom('#_pendo-guide-required-disabled').length === 0) {
41253
41413
  pendo.dom('head').append(disabledButtonStyles);
41254
41414
  }
@@ -41259,11 +41419,15 @@ var RequiredQuestions = {
41259
41419
  function evaluateRequiredQuestions(questions) {
41260
41420
  if (questions.length === 0)
41261
41421
  return;
41262
- var allRequiredComplete = true;
41263
- var responses = [];
41264
- responses = responses.concat(pendo._.map(questions, function (question) {
41265
- var pollId = question.getAttribute('data-pendo-poll-id');
41266
- var input = step.guideElement.find("\n [data-pendo-poll-id=".concat(pollId, "] textarea,\n [data-pendo-poll-id=").concat(pollId, "] input:text,\n [data-pendo-poll-id=").concat(pollId, "] select,\n [data-pendo-poll-id=").concat(pollId, "] input:radio:checked"));
41422
+ let allRequiredComplete = true;
41423
+ let responses = [];
41424
+ responses = responses.concat(pendo._.map(questions, (question) => {
41425
+ let pollId = question.getAttribute('data-pendo-poll-id');
41426
+ let input = step.guideElement.find(`
41427
+ [data-pendo-poll-id=${pollId}] textarea,
41428
+ [data-pendo-poll-id=${pollId}] input:text,
41429
+ [data-pendo-poll-id=${pollId}] select,
41430
+ [data-pendo-poll-id=${pollId}] input:radio:checked`);
41267
41431
  if (input && input.length && input[0].value) {
41268
41432
  return input[0].value;
41269
41433
  }
@@ -41280,48 +41444,48 @@ var RequiredQuestions = {
41280
41444
  }
41281
41445
  function disableEligibleButtons(buttons) {
41282
41446
  pendo._.each(buttons, function (button) {
41283
- if (step.guideElement.find("#".concat(button.props.id))[0]) {
41284
- step.guideElement.find("#".concat(button.props.id))[0].disabled = true;
41285
- step.guideElement.find("#".concat(button.props.id))[0].parentElement.title = 'Please complete all required questions.';
41447
+ if (step.guideElement.find(`#${button.props.id}`)[0]) {
41448
+ step.guideElement.find(`#${button.props.id}`)[0].disabled = true;
41449
+ step.guideElement.find(`#${button.props.id}`)[0].parentElement.title = 'Please complete all required questions.';
41286
41450
  }
41287
41451
  });
41288
41452
  }
41289
41453
  function enableEligibleButtons(buttons) {
41290
41454
  pendo._.each(buttons, function (button) {
41291
- if (step.guideElement.find("#".concat(button.props.id))[0]) {
41292
- step.guideElement.find("#".concat(button.props.id))[0].disabled = false;
41293
- step.guideElement.find("#".concat(button.props.id))[0].parentElement.title = '';
41455
+ if (step.guideElement.find(`#${button.props.id}`)[0]) {
41456
+ step.guideElement.find(`#${button.props.id}`)[0].disabled = false;
41457
+ step.guideElement.find(`#${button.props.id}`)[0].parentElement.title = '';
41294
41458
  }
41295
41459
  });
41296
41460
  }
41297
41461
  },
41298
- test: function (step, guide, pendo) {
41462
+ test(step, guide, pendo) {
41299
41463
  var _a;
41300
- var requiredQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find("[class*=-poll-question]:contains(".concat(requiredSyntax, ")"));
41464
+ let requiredQuestions = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find(`[class*=-poll-question]:contains(${requiredSyntax})`);
41301
41465
  return !pendo._.isUndefined(requiredQuestions) && pendo._.size(requiredQuestions);
41302
41466
  },
41303
- designerListener: function (pendo) {
41304
- var requiredQuestions = [];
41305
- var target = pendo.dom.getBody();
41306
- var config = {
41467
+ designerListener(pendo) {
41468
+ const requiredQuestions = [];
41469
+ const target = pendo.dom.getBody();
41470
+ const config = {
41307
41471
  attributeFilter: ['data-layout'],
41308
41472
  attributes: true,
41309
41473
  childList: true,
41310
41474
  characterData: true,
41311
41475
  subtree: true
41312
41476
  };
41313
- var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
41314
- var observer = new MutationObserver(applyRequiredIndicators);
41477
+ const MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
41478
+ const observer = new MutationObserver(applyRequiredIndicators);
41315
41479
  observer.observe(target, config);
41316
41480
  function applyRequiredIndicators(mutations) {
41317
41481
  pendo._.each(mutations, function (mutation) {
41318
41482
  var _a;
41319
- var nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll);
41483
+ const nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll);
41320
41484
  if (mutation.addedNodes.length && nodeHasQuerySelector) {
41321
- var eligiblePolls = mutation.addedNodes[0].querySelectorAll('[class*=-poll-wrapper], [class*=-poll-select-border]');
41485
+ let eligiblePolls = mutation.addedNodes[0].querySelectorAll('[class*=-poll-wrapper], [class*=-poll-select-border]');
41322
41486
  if (eligiblePolls) {
41323
41487
  pendo._.each(eligiblePolls, function (poll) {
41324
- var dataPendoPollId;
41488
+ let dataPendoPollId;
41325
41489
  if (poll.classList.contains('_pendo-open-text-poll-wrapper') ||
41326
41490
  poll.classList.contains('_pendo-number-scale-poll-wrapper')) {
41327
41491
  dataPendoPollId = poll.getAttribute('name');
@@ -41329,27 +41493,27 @@ var RequiredQuestions = {
41329
41493
  else {
41330
41494
  dataPendoPollId = poll.getAttribute('data-pendo-poll-id');
41331
41495
  }
41332
- var questionText;
41333
- var pollQuesiton = pendo.dom("[class*=\"-poll-question\"][data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0];
41496
+ let questionText;
41497
+ const pollQuesiton = pendo.dom(`[class*="-poll-question"][data-pendo-poll-id=${dataPendoPollId}]`)[0];
41334
41498
  if (pollQuesiton) {
41335
- questionText = pendo.dom("[class*=\"-poll-question\"][data-pendo-poll-id=".concat(dataPendoPollId, "]"))[0].textContent;
41499
+ questionText = pendo.dom(`[class*="-poll-question"][data-pendo-poll-id=${dataPendoPollId}]`)[0].textContent;
41336
41500
  }
41337
- var requiredSyntaxIndex = questionText.indexOf(requiredSyntax);
41501
+ const requiredSyntaxIndex = questionText.indexOf(requiredSyntax);
41338
41502
  if (requiredSyntaxIndex > -1) {
41339
- pendo._.each(pendo.dom("[data-pendo-poll-id=".concat(dataPendoPollId, "]:not(.pendo-radio)")), function (element) {
41340
- pendo._.each(pendo.dom("#".concat(element.id, " *:not(\".pendo-radio\"), #").concat(element.id, ":not(\".pendo-radio\")")), function (item) {
41503
+ pendo._.each(pendo.dom(`[data-pendo-poll-id=${dataPendoPollId}]:not(.pendo-radio)`), (element) => {
41504
+ pendo._.each(pendo.dom(`#${element.id} *:not(".pendo-radio"), #${element.id}:not(".pendo-radio")`), (item) => {
41341
41505
  guideMarkdownUtil.removeMarkdownSyntax(item, requiredSyntax, '', pendo);
41342
41506
  });
41343
41507
  });
41344
- if (pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "] p")).length !== 0 || pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "] li")).length !== 0) {
41345
- pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "] p")).append(requiredElement);
41346
- pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "] li")).append(requiredElement);
41508
+ if (pendo.dom(`.bb-text[data-pendo-poll-id=${dataPendoPollId}] p`).length !== 0 || pendo.dom(`.bb-text[data-pendo-poll-id=${dataPendoPollId}] li`).length !== 0) {
41509
+ pendo.dom(`.bb-text[data-pendo-poll-id=${dataPendoPollId}] p`).append(requiredElement);
41510
+ pendo.dom(`.bb-text[data-pendo-poll-id=${dataPendoPollId}] li`).append(requiredElement);
41347
41511
  }
41348
41512
  else {
41349
- pendo.dom(".bb-text[data-pendo-poll-id=".concat(dataPendoPollId, "]")).append(requiredElement);
41513
+ pendo.dom(`.bb-text[data-pendo-poll-id=${dataPendoPollId}]`).append(requiredElement);
41350
41514
  }
41351
41515
  if (pendo._.contains(requiredQuestions, dataPendoPollId)) {
41352
- var questionIndex = requiredQuestions.indexOf(dataPendoPollId);
41516
+ let questionIndex = requiredQuestions.indexOf(dataPendoPollId);
41353
41517
  if (questionIndex !== -1) {
41354
41518
  requiredQuestions.splice(questionIndex, 1);
41355
41519
  }
@@ -41360,7 +41524,7 @@ var RequiredQuestions = {
41360
41524
  }
41361
41525
  else {
41362
41526
  if (pendo._.contains(requiredQuestions, dataPendoPollId)) {
41363
- var index = requiredQuestions.indexOf(dataPendoPollId);
41527
+ let index = requiredQuestions.indexOf(dataPendoPollId);
41364
41528
  if (index !== -1) {
41365
41529
  requiredQuestions.splice(index, 1);
41366
41530
  }
@@ -41374,54 +41538,54 @@ var RequiredQuestions = {
41374
41538
  }
41375
41539
  };
41376
41540
 
41377
- var skipStepRegex = new RegExp(guideMarkdownUtil.skipStepString);
41378
- var SkipToEligibleStep = {
41379
- script: function (step, guide, pendo) {
41380
- var isAdvanceIntercepted = false;
41381
- var isPreviousIntercepted = false;
41382
- var guideContainer = step.guideElement.find(guideMarkdownUtil.containerSelector);
41383
- var guideContainerAriaLabel = guideContainer.attr('aria-label');
41384
- var stepNumberOrAuto = skipStepRegex.exec(guideContainerAriaLabel)[1];
41541
+ const skipStepRegex = new RegExp(guideMarkdownUtil.skipStepString);
41542
+ const SkipToEligibleStep = {
41543
+ script(step, guide, pendo) {
41544
+ let isAdvanceIntercepted = false;
41545
+ let isPreviousIntercepted = false;
41546
+ let guideContainer = step.guideElement.find(guideMarkdownUtil.containerSelector);
41547
+ let guideContainerAriaLabel = guideContainer.attr('aria-label');
41548
+ let stepNumberOrAuto = skipStepRegex.exec(guideContainerAriaLabel)[1];
41385
41549
  if (guideContainer) {
41386
41550
  guideContainer.attr({ 'aria-label': guideContainer.attr('aria-label').replace(skipStepRegex, '') });
41387
41551
  }
41388
- this.on('beforeAdvance', function (evt) {
41552
+ this.on('beforeAdvance', (evt) => {
41389
41553
  if (guide.getPositionOfStep(step) === guide.steps.length || pendo._.isUndefined(stepNumberOrAuto))
41390
41554
  return; // exit on the last step of a guide or when we don't have an argument
41391
- var eligibleStep = findEligibleSkipStep(stepNumberOrAuto, 'next');
41555
+ let eligibleStep = findEligibleSkipStep(stepNumberOrAuto, 'next');
41392
41556
  if (!isAdvanceIntercepted && stepNumberOrAuto) {
41393
41557
  isAdvanceIntercepted = true;
41394
- pendo.goToStep({ destinationStepId: eligibleStep.id, step: step });
41558
+ pendo.goToStep({ destinationStepId: eligibleStep.id, step });
41395
41559
  evt.cancel = true;
41396
41560
  }
41397
41561
  });
41398
- this.on('beforePrevious', function (evt) {
41562
+ this.on('beforePrevious', (evt) => {
41399
41563
  if (pendo._.isUndefined(stepNumberOrAuto))
41400
41564
  return;
41401
- var eligibleStep = findEligibleSkipStep(stepNumberOrAuto, 'previous');
41565
+ let eligibleStep = findEligibleSkipStep(stepNumberOrAuto, 'previous');
41402
41566
  if (!isPreviousIntercepted && stepNumberOrAuto) {
41403
41567
  isPreviousIntercepted = true;
41404
- pendo.goToStep({ destinationStepId: eligibleStep.id, step: step });
41568
+ pendo.goToStep({ destinationStepId: eligibleStep.id, step });
41405
41569
  evt.cancel = true;
41406
41570
  }
41407
41571
  });
41408
41572
  function findEligibleSkipStep(stepNumber, direction) {
41409
41573
  // Find the next eligible step by using getPosition of step (1 based)
41410
41574
  // getPosition - 2 gives the previous step
41411
- var skipForwardStep = findStepOnPage(guide.getPositionOfStep(step), 'next', stepNumber);
41412
- var skipPreviousStep = findStepOnPage(guide.getPositionOfStep(step) - 2, 'previous', stepNumber);
41575
+ let skipForwardStep = findStepOnPage(guide.getPositionOfStep(step), 'next', stepNumber);
41576
+ let skipPreviousStep = findStepOnPage(guide.getPositionOfStep(step) - 2, 'previous', stepNumber);
41413
41577
  if (skipForwardStep && direction == 'next') {
41414
- pendo.goToStep({ destinationStepId: skipForwardStep, step: step });
41578
+ pendo.goToStep({ destinationStepId: skipForwardStep, step });
41415
41579
  }
41416
41580
  if (skipPreviousStep && direction == 'previous') {
41417
- pendo.goToStep({ destinationStepId: skipPreviousStep, step: step });
41581
+ pendo.goToStep({ destinationStepId: skipPreviousStep, step });
41418
41582
  }
41419
41583
  return direction === 'next' ? skipForwardStep : skipPreviousStep;
41420
41584
  }
41421
41585
  function findStepOnPage(stepIndex, direction, stepNumber) {
41422
41586
  if (pendo._.isNaN(stepIndex))
41423
41587
  return;
41424
- var $step = guide.steps[stepIndex];
41588
+ let $step = guide.steps[stepIndex];
41425
41589
  if ($step && !$step.canShow()) {
41426
41590
  if (stepNumber !== 'auto') {
41427
41591
  return guide.steps[stepNumber - 1];
@@ -41438,34 +41602,34 @@ var SkipToEligibleStep = {
41438
41602
  }
41439
41603
  }
41440
41604
  },
41441
- test: function (step, guide, pendo) {
41605
+ test(step, guide, pendo) {
41442
41606
  var _a;
41443
- var guideContainerAriaLabel = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find(guideMarkdownUtil.containerSelector).attr('aria-label');
41607
+ const guideContainerAriaLabel = (_a = step.guideElement) === null || _a === void 0 ? void 0 : _a.find(guideMarkdownUtil.containerSelector).attr('aria-label');
41444
41608
  return pendo._.isString(guideContainerAriaLabel) && guideContainerAriaLabel.indexOf('{skipStep') !== -1;
41445
41609
  },
41446
- designerListener: function (pendo) {
41447
- var target = pendo.dom.getBody();
41448
- var config = {
41610
+ designerListener(pendo) {
41611
+ const target = pendo.dom.getBody();
41612
+ const config = {
41449
41613
  attributeFilter: ['data-layout'],
41450
41614
  attributes: true,
41451
41615
  childList: true,
41452
41616
  characterData: true,
41453
41617
  subtree: true
41454
41618
  };
41455
- var MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
41456
- var observer = new MutationObserver(applySkipStepIndicator);
41619
+ const MutationObserver = getZoneSafeMethod(pendo._, 'MutationObserver');
41620
+ const observer = new MutationObserver(applySkipStepIndicator);
41457
41621
  observer.observe(target, config);
41458
41622
  // create an observer instance
41459
41623
  function applySkipStepIndicator(mutations) {
41460
41624
  pendo._.each(mutations, function (mutation) {
41461
41625
  var _a, _b;
41462
- var nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll);
41626
+ const nodeHasQuerySelector = pendo._.isFunction((_a = mutation.addedNodes[0]) === null || _a === void 0 ? void 0 : _a.querySelectorAll);
41463
41627
  if (mutation.addedNodes.length && nodeHasQuerySelector) {
41464
- var guideContainer = mutation.addedNodes[0].querySelectorAll(guideMarkdownUtil.containerSelector);
41465
- var guideContainerAriaLabel = (_b = guideContainer[0]) === null || _b === void 0 ? void 0 : _b.getAttribute('aria-label');
41628
+ let guideContainer = mutation.addedNodes[0].querySelectorAll(guideMarkdownUtil.containerSelector);
41629
+ let guideContainerAriaLabel = (_b = guideContainer[0]) === null || _b === void 0 ? void 0 : _b.getAttribute('aria-label');
41466
41630
  if (guideContainerAriaLabel) {
41467
41631
  if (guideContainerAriaLabel.match(skipStepRegex)) {
41468
- var fullSkipStepString = guideContainerAriaLabel.match(skipStepRegex)[0];
41632
+ let fullSkipStepString = guideContainerAriaLabel.match(skipStepRegex)[0];
41469
41633
  guideContainerAriaLabel.replace(fullSkipStepString, '');
41470
41634
  if (!pendo.dom('#_pendoSkipIcon').length) {
41471
41635
  pendo.dom(guideMarkdownUtil.containerSelector).append(skipIcon('#999', '30px').trim());
@@ -41476,30 +41640,48 @@ var SkipToEligibleStep = {
41476
41640
  });
41477
41641
  }
41478
41642
  function skipIcon(color, size) {
41479
- return ("<div title=\"Skip step added\"><svg id=\"_pendoSkipIcon\" version=\"1.0\" xmlns=\"http://www.w3.org/2000/svg\"\n width=\"".concat(size, "\" height=\"").concat(size, "\" viewBox=\"0 0 512.000000 512.000000\"\n preserveAspectRatio=\"xMidYMid meet\" style=\"bottom:5px; right:10px; position: absolute;\">\n <g transform=\"translate(0.000000,512.000000) scale(0.100000,-0.100000)\"\n fill=\"").concat(color, "\" stroke=\"none\">\n <path d=\"M2185 4469 c-363 -38 -739 -186 -1034 -407 -95 -71 -273 -243 -357\n -343 -205 -246 -364 -577 -429 -897 -25 -121 -45 -288 -45 -373 l0 -49 160 0\n 160 0 0 48 c0 26 5 88 10 137 68 593 417 1103 940 1374 1100 570 2418 -137\n 2560 -1374 5 -49 10 -111 10 -137 l0 -47 -155 -3 -155 -3 235 -235 235 -236\n 235 236 235 235 -155 3 -155 3 0 48 c0 27 -5 95 -10 152 -100 989 -878 1767\n -1869 1868 -117 12 -298 12 -416 0z\"/>\n <path d=\"M320 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M960 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M1600 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M2240 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M2880 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z\"/>\n <path d=\"M3840 1440 l0 -160 480 0 480 0 0 160 0 160 -480 0 -480 0 0 -160z\"/>\n </g></svg></div>\n "));
41643
+ return (`<div title="Skip step added"><svg id="_pendoSkipIcon" version="1.0" xmlns="http://www.w3.org/2000/svg"
41644
+ width="${size}" height="${size}" viewBox="0 0 512.000000 512.000000"
41645
+ preserveAspectRatio="xMidYMid meet" style="bottom:5px; right:10px; position: absolute;">
41646
+ <g transform="translate(0.000000,512.000000) scale(0.100000,-0.100000)"
41647
+ fill="${color}" stroke="none">
41648
+ <path d="M2185 4469 c-363 -38 -739 -186 -1034 -407 -95 -71 -273 -243 -357
41649
+ -343 -205 -246 -364 -577 -429 -897 -25 -121 -45 -288 -45 -373 l0 -49 160 0
41650
+ 160 0 0 48 c0 26 5 88 10 137 68 593 417 1103 940 1374 1100 570 2418 -137
41651
+ 2560 -1374 5 -49 10 -111 10 -137 l0 -47 -155 -3 -155 -3 235 -235 235 -236
41652
+ 235 236 235 235 -155 3 -155 3 0 48 c0 27 -5 95 -10 152 -100 989 -878 1767
41653
+ -1869 1868 -117 12 -298 12 -416 0z"/>
41654
+ <path d="M320 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
41655
+ <path d="M960 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
41656
+ <path d="M1600 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
41657
+ <path d="M2240 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
41658
+ <path d="M2880 1440 l0 -160 160 0 160 0 0 160 0 160 -160 0 -160 0 0 -160z"/>
41659
+ <path d="M3840 1440 l0 -160 480 0 480 0 0 160 0 160 -480 0 -480 0 0 -160z"/>
41660
+ </g></svg></div>
41661
+ `);
41480
41662
  }
41481
41663
  }
41482
41664
  };
41483
41665
 
41484
41666
  function GuideMarkdown() {
41485
- var guideMarkdown;
41486
- var pluginApi;
41487
- var globalPendo;
41667
+ let guideMarkdown;
41668
+ let pluginApi;
41669
+ let globalPendo;
41488
41670
  return {
41489
41671
  name: 'GuideMarkdown',
41490
41672
  initialize: init,
41491
- teardown: teardown
41673
+ teardown
41492
41674
  };
41493
41675
  function init(pendo, PluginAPI) {
41494
41676
  globalPendo = pendo;
41495
41677
  pluginApi = PluginAPI;
41496
- var configReader = PluginAPI.ConfigReader;
41497
- var GUIDEMARKDOWN_CONFIG = 'guideMarkdown';
41678
+ const configReader = PluginAPI.ConfigReader;
41679
+ const GUIDEMARKDOWN_CONFIG = 'guideMarkdown';
41498
41680
  configReader.addOption(GUIDEMARKDOWN_CONFIG, [
41499
41681
  configReader.sources.SNIPPET_SRC,
41500
41682
  configReader.sources.PENDO_CONFIG_SRC
41501
41683
  ], false);
41502
- var markdownScriptsEnabled = configReader.get(GUIDEMARKDOWN_CONFIG);
41684
+ const markdownScriptsEnabled = configReader.get(GUIDEMARKDOWN_CONFIG);
41503
41685
  if (!markdownScriptsEnabled)
41504
41686
  return;
41505
41687
  guideMarkdown = [PollBranching, MetadataSubstitution, RequiredQuestions, SkipToEligibleStep];
@@ -42538,8 +42720,8 @@ function Feedback() {
42538
42720
  var widgetLoaded = false;
42539
42721
  var feedbackAllowedProductId = '';
42540
42722
  var initialized = false;
42541
- var PING_COOKIE = 'feedback_ping_sent';
42542
- var PING_COOKIE_EXPIRATION = 1000 * 60 * 60;
42723
+ const PING_COOKIE = 'feedback_ping_sent';
42724
+ const PING_COOKIE_EXPIRATION = 1000 * 60 * 60;
42543
42725
  var overflowMediaQuery = '@media only screen and (max-device-width:1112px){#feedback-widget{overflow-y:scroll}}';
42544
42726
  var slideIn = '@-webkit-keyframes pendoFeedbackSlideIn{from{opacity:0;transform:translate(145px,0) rotate(270deg) translateY(-50%)}to{opacity:1;transform:translate(50%,0) rotate(270deg) translateY(-50%)}}@keyframes pendoFeedbackSlideIn{from{opacity:0;transform:translate(145px,0) rotate(270deg) translateY(-50%)}to{opacity:1;transform:translate(50%,0) rotate(270deg) translateY(-50%)}}';
42545
42727
  var slideInLeft = '@-webkit-keyframes pendoFeedbackSlideIn-left{from{opacity:0;transform:rotate(270deg) translateX(-55%) translateY(-55%)}to{opacity:1;transform:rotate(270deg) translateX(-55%) translateY(0)}}@keyframes pendoFeedbackSlideIn-left{from{opacity:0;transform:rotate(270deg) translateX(-55%) translateY(-55%)}to{opacity:1;transform:rotate(270deg) translateX(-55%) translateY(0)}}';
@@ -42559,28 +42741,28 @@ function Feedback() {
42559
42741
  feedbackStyles: 'pendo-feedback-styles',
42560
42742
  feedbackFrameStyles: 'pendo-feedback-visible-buttons-styles'
42561
42743
  };
42562
- var globalPendo;
42563
- var pluginApi;
42744
+ let globalPendo;
42745
+ let pluginApi;
42564
42746
  return {
42565
42747
  name: 'Feedback',
42566
- initialize: initialize,
42567
- teardown: teardown,
42568
- validate: validate
42748
+ initialize,
42749
+ teardown,
42750
+ validate
42569
42751
  };
42570
42752
  function initialize(pendo, PluginAPI) {
42571
42753
  globalPendo = pendo;
42572
42754
  pluginApi = PluginAPI;
42573
42755
  var publicFeedback = {
42574
- ping: ping,
42575
- init: init,
42756
+ ping,
42757
+ init,
42576
42758
  initialized: getInitialized,
42577
- loginAndRedirect: loginAndRedirect,
42578
- openFeedback: openFeedback,
42579
- initializeFeedbackOnce: initializeFeedbackOnce,
42580
- isFeedbackLoaded: isFeedbackLoaded,
42581
- convertPendoToFeedbackOptions: convertPendoToFeedbackOptions,
42759
+ loginAndRedirect,
42760
+ openFeedback,
42761
+ initializeFeedbackOnce,
42762
+ isFeedbackLoaded,
42763
+ convertPendoToFeedbackOptions,
42582
42764
  isUnsupportedIE: pendo._.partial(isUnsupportedIE, PluginAPI),
42583
- removeFeedbackWidget: removeFeedbackWidget
42765
+ removeFeedbackWidget
42584
42766
  };
42585
42767
  pendo.feedback = publicFeedback;
42586
42768
  pendo.getFeedbackSettings = getFeedbackSettings;
@@ -42608,7 +42790,7 @@ function Feedback() {
42608
42790
  */
42609
42791
  PluginAPI.agentStorage.registry.addLocal(PING_COOKIE, { duration: PING_COOKIE_EXPIRATION });
42610
42792
  return {
42611
- validate: validate
42793
+ validate
42612
42794
  };
42613
42795
  }
42614
42796
  function teardown() {
@@ -42628,18 +42810,18 @@ function Feedback() {
42628
42810
  return result;
42629
42811
  }
42630
42812
  function pingOrInitialize() {
42631
- var options = getPendoOptions();
42813
+ const options = getPendoOptions();
42632
42814
  if (initialized) {
42633
- var feedbackOptions = convertPendoToFeedbackOptions(options);
42815
+ const feedbackOptions = convertPendoToFeedbackOptions(options);
42634
42816
  ping(feedbackOptions);
42635
42817
  }
42636
42818
  else if (shouldInitializeFeedback() && !globalPendo._.isEmpty(options)) {
42637
- var settings = pluginApi.ConfigReader.get('feedbackSettings');
42638
- init(options, settings)["catch"](globalPendo._.noop);
42819
+ const settings = pluginApi.ConfigReader.get('feedbackSettings');
42820
+ init(options, settings).catch(globalPendo._.noop);
42639
42821
  }
42640
42822
  }
42641
42823
  function handleIdentityChange(event) {
42642
- var visitorId = globalPendo._.get(event, 'data.0.visitor_id') || globalPendo._.get(event, 'data.0.options.visitor.id');
42824
+ const visitorId = globalPendo._.get(event, 'data.0.visitor_id') || globalPendo._.get(event, 'data.0.options.visitor.id');
42643
42825
  if (globalPendo.isAnonymousVisitor(visitorId)) {
42644
42826
  removeFeedbackWidget();
42645
42827
  return;
@@ -42709,9 +42891,9 @@ function Feedback() {
42709
42891
  if (toSend.data && toSend.data !== '{}' && toSend.data !== 'null') {
42710
42892
  return globalPendo.ajax
42711
42893
  .postJSON(getFullUrl('/widget/pendo_ping'), toSend)
42712
- .then(function (response) {
42894
+ .then((response) => {
42713
42895
  onWidgetPingResponse(response);
42714
- })["catch"](function () { onPingFailure(); });
42896
+ }).catch(() => { onPingFailure(); });
42715
42897
  }
42716
42898
  }
42717
42899
  return pluginApi.q.resolve();
@@ -42845,10 +43027,10 @@ function Feedback() {
42845
43027
  return globalPendo.ajax.postJSON(getFullUrl('/analytics'), toSend);
42846
43028
  }
42847
43029
  function addOverlay() {
42848
- var widget = globalPendo.dom("#".concat(elemIds.feedbackWidget));
43030
+ const widget = globalPendo.dom(`#${elemIds.feedbackWidget}`);
42849
43031
  if (!widget)
42850
43032
  return;
42851
- var overlayStyles = {
43033
+ const overlayStyles = {
42852
43034
  'position': 'fixed',
42853
43035
  'top': '0',
42854
43036
  'right': '0',
@@ -42860,7 +43042,7 @@ function Feedback() {
42860
43042
  'animation': 'pendoFeedbackFadeIn 0.5s 0s 1 alternate both',
42861
43043
  '-webkit-animation': 'pendoFeedbackFadeIn 0.5s 0s 1 alternate both'
42862
43044
  };
42863
- var overlayElement = globalPendo.dom(document.createElement('div'));
43045
+ const overlayElement = globalPendo.dom(document.createElement('div'));
42864
43046
  overlayElement.attr('id', 'feedback-overlay');
42865
43047
  overlayElement.css(overlayStyles);
42866
43048
  overlayElement.appendTo(widget.getParent());
@@ -42965,22 +43147,22 @@ function Feedback() {
42965
43147
  }
42966
43148
  }
42967
43149
  function buildOuterTriggerDiv(positionInfo) {
42968
- var horizontalStyles = getHorizontalPositionStyles(positionInfo);
42969
- var verticalStyles = getVerticalPositionStyles(positionInfo);
42970
- var styles = globalPendo._.extend({
43150
+ const horizontalStyles = getHorizontalPositionStyles(positionInfo);
43151
+ const verticalStyles = getVerticalPositionStyles(positionInfo);
43152
+ const styles = globalPendo._.extend({
42971
43153
  'position': 'fixed',
42972
43154
  'height': '43px',
42973
43155
  'opacity': '1 !important',
42974
43156
  'z-index': '9001'
42975
43157
  }, horizontalStyles, verticalStyles);
42976
- var outerTrigger = globalPendo.dom(document.createElement('div'));
43158
+ const outerTrigger = globalPendo.dom(document.createElement('div'));
42977
43159
  outerTrigger.attr('id', elemIds.feedbackTrigger);
42978
43160
  outerTrigger.css(styles);
42979
43161
  outerTrigger.attr('data-turbolinks-permanent', '');
42980
43162
  return outerTrigger;
42981
43163
  }
42982
43164
  function buildNotification() {
42983
- var styles = {
43165
+ const styles = {
42984
43166
  'background-color': '#D85039',
42985
43167
  'color': '#fff',
42986
43168
  'border-radius': '50%',
@@ -42997,20 +43179,20 @@ function Feedback() {
42997
43179
  'animation-delay': '1s',
42998
43180
  'animation-iteration-count': '1'
42999
43181
  };
43000
- var notification = globalPendo.dom(document.createElement('span'));
43182
+ const notification = globalPendo.dom(document.createElement('span'));
43001
43183
  notification.attr('id', 'feedback-trigger-notification');
43002
43184
  notification.css(styles);
43003
43185
  return notification;
43004
43186
  }
43005
43187
  function buildTriggerButton(settings, positionInfo) {
43006
- var borderRadius;
43188
+ let borderRadius;
43007
43189
  if (positionInfo.horizontalPosition === 'left') {
43008
43190
  borderRadius = '0 0 5px 5px';
43009
43191
  }
43010
43192
  else {
43011
43193
  borderRadius = '3px 3px 0 0';
43012
43194
  }
43013
- var styles = {
43195
+ const styles = {
43014
43196
  'border': 'none',
43015
43197
  'padding': '11px 18px 14px 18px',
43016
43198
  'background-color': settings.triggerColor,
@@ -43021,21 +43203,32 @@ function Feedback() {
43021
43203
  'cursor': 'pointer',
43022
43204
  'text-align': 'left'
43023
43205
  };
43024
- var triggerButton = globalPendo.dom(document.createElement('button'));
43206
+ const triggerButton = globalPendo.dom(document.createElement('button'));
43025
43207
  triggerButton.attr('id', elemIds.feedbackTriggerButton);
43026
43208
  triggerButton.css(styles);
43027
43209
  triggerButton.text(settings.triggerText);
43028
43210
  return triggerButton;
43029
43211
  }
43030
43212
  function addTriggerPseudoStyles() {
43031
- var pseudoStyles = "\n #feedback-trigger button:hover {\n box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;\n outline: none !important;\n background: #3e566f !important;\n }\n #feedback-trigger button:focus {\n box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;\n outline: none !important;\n background: #3e566f !important;\n }\n ";
43213
+ const pseudoStyles = `
43214
+ #feedback-trigger button:hover {
43215
+ box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;
43216
+ outline: none !important;
43217
+ background: #3e566f !important;
43218
+ }
43219
+ #feedback-trigger button:focus {
43220
+ box-shadow: 0 -5px 20px rgba(0,0,0,.19) !important;
43221
+ outline: none !important;
43222
+ background: #3e566f !important;
43223
+ }
43224
+ `;
43032
43225
  pluginApi.util.addInlineStyles('pendo-feedback-trigger-styles', pseudoStyles);
43033
43226
  }
43034
43227
  function createTrigger(settings, positionInfo) {
43035
43228
  addTriggerPseudoStyles();
43036
- var triggerElement = buildOuterTriggerDiv(positionInfo);
43037
- var notificationElement = buildNotification();
43038
- var triggerButtonElement = buildTriggerButton(settings, positionInfo);
43229
+ const triggerElement = buildOuterTriggerDiv(positionInfo);
43230
+ const notificationElement = buildNotification();
43231
+ const triggerButtonElement = buildTriggerButton(settings, positionInfo);
43039
43232
  triggerElement.append(notificationElement);
43040
43233
  triggerElement.append(triggerButtonElement);
43041
43234
  triggerElement.appendTo(globalPendo.dom.getBody());
@@ -43059,7 +43252,7 @@ function Feedback() {
43059
43252
  iframeWrapper.css(getWidgetOriginalStyles());
43060
43253
  iframeWrapper.attr('id', elemIds.feedbackWidget);
43061
43254
  iframeWrapper.attr('data-turbolinks-permanent', 'true');
43062
- iframeWrapper.addClass("buttonIs-".concat(horizontalPosition));
43255
+ iframeWrapper.addClass(`buttonIs-${horizontalPosition}`);
43063
43256
  return iframeWrapper;
43064
43257
  }
43065
43258
  function buildIframeContainer() {
@@ -43076,13 +43269,22 @@ function Feedback() {
43076
43269
  return iframeContainer;
43077
43270
  }
43078
43271
  function addWidgetVisibleButtonStyles(buttonStylePosition) {
43079
- var side = buttonStylePosition === 'left' ? 'left' : 'right'; // just in case something was not left or right for some reason
43080
- var styles = "\n .buttonIs-".concat(side, ".visible {\n ").concat(side, ": 0 !important;\n width: 470px !important;\n animation-direction: alternate-reverse !important;\n animation: pendoFeedbackSlideFrom-").concat(side, " 0.5s 0s 1 alternate both !important;\n -webkit-animation: pendoFeedbackSlideFrom-").concat(side, " 0.5s 0s 1 alternate both !important;\n z-index: 9002 !important;\n }\n ");
43272
+ let side = buttonStylePosition === 'left' ? 'left' : 'right'; // just in case something was not left or right for some reason
43273
+ const styles = `
43274
+ .buttonIs-${side}.visible {
43275
+ ${side}: 0 !important;
43276
+ width: 470px !important;
43277
+ animation-direction: alternate-reverse !important;
43278
+ animation: pendoFeedbackSlideFrom-${side} 0.5s 0s 1 alternate both !important;
43279
+ -webkit-animation: pendoFeedbackSlideFrom-${side} 0.5s 0s 1 alternate both !important;
43280
+ z-index: 9002 !important;
43281
+ }
43282
+ `;
43081
43283
  pluginApi.util.addInlineStyles(elemIds.feedbackFrameStyles, styles);
43082
43284
  }
43083
43285
  function initialiseWidgetFrame(horizontalPosition) {
43084
43286
  addWidgetVisibleButtonStyles(horizontalPosition);
43085
- var iframeElement = buildIframeWrapper(horizontalPosition);
43287
+ const iframeElement = buildIframeWrapper(horizontalPosition);
43086
43288
  iframeElement.append(buildIframeContainer());
43087
43289
  iframeElement.appendTo(globalPendo.dom.getBody());
43088
43290
  subscribeToIframeMessages();
@@ -43106,7 +43308,7 @@ function Feedback() {
43106
43308
  return widgetLoaded;
43107
43309
  }
43108
43310
  function getPendoOptions() {
43109
- var options = pluginApi.ConfigReader.getLocalConfig();
43311
+ let options = pluginApi.ConfigReader.getLocalConfig();
43110
43312
  if (!globalPendo._.isObject(options))
43111
43313
  options = {};
43112
43314
  if (!globalPendo._.isObject(options.visitor))
@@ -43134,7 +43336,7 @@ function Feedback() {
43134
43336
  return true;
43135
43337
  }
43136
43338
  function getQueryParam(url, paramName) {
43137
- var results = new RegExp('[?&]' + paramName + '=([^&#]*)').exec(url);
43339
+ const results = new RegExp('[?&]' + paramName + '=([^&#]*)').exec(url);
43138
43340
  if (results == null) {
43139
43341
  return null;
43140
43342
  }
@@ -43151,13 +43353,13 @@ function Feedback() {
43151
43353
  return pluginApi.q.reject();
43152
43354
  if (!canInitFeedback(pendoOptions))
43153
43355
  return pluginApi.q.reject();
43154
- var feedbackOptions = convertPendoToFeedbackOptions(pendoOptions);
43356
+ const feedbackOptions = convertPendoToFeedbackOptions(pendoOptions);
43155
43357
  try {
43156
- var fdbkDst_1 = getQueryParam(globalPendo.url.get(), 'fdbkDst');
43157
- if (fdbkDst_1 && fdbkDst_1.startsWith('case')) {
43358
+ const fdbkDst = getQueryParam(globalPendo.url.get(), 'fdbkDst');
43359
+ if (fdbkDst && fdbkDst.startsWith('case')) {
43158
43360
  initialized = true;
43159
43361
  getFeedbackLoginUrl().then(function (loginUrl) {
43160
- var destinationUrl = loginUrl + '&fdbkDst=' + fdbkDst_1;
43362
+ const destinationUrl = loginUrl + '&fdbkDst=' + fdbkDst;
43161
43363
  window.location.href = destinationUrl;
43162
43364
  });
43163
43365
  return;
@@ -43206,7 +43408,7 @@ function Feedback() {
43206
43408
  function convertPendoToFeedbackOptions(options) {
43207
43409
  var jwtOptions = pluginApi.agent.getJwtInfoCopy();
43208
43410
  if (globalPendo._.isEmpty(jwtOptions)) {
43209
- var feedbackOptions = {};
43411
+ const feedbackOptions = {};
43210
43412
  feedbackOptions.user = globalPendo._.pick(options.visitor, 'id', 'full_name', 'firstName', 'lastName', 'email', 'tags', 'custom_allowed_products');
43211
43413
  globalPendo._.extend(feedbackOptions.user, { allowed_products: [{ id: feedbackAllowedProductId }] });
43212
43414
  feedbackOptions.account = globalPendo._.pick(options.account, 'id', 'name', 'monthly_value', 'is_paying', 'tags');
@@ -48741,32 +48943,31 @@ var n;
48741
48943
  }(n || (n = {}));
48742
48944
  return record; }
48743
48945
 
48744
- var SessionRecorderBuffer = /** @class */ (function () {
48745
- function SessionRecorderBuffer(interval, maxCount) {
48746
- if (maxCount === void 0) { maxCount = Infinity; }
48946
+ class SessionRecorderBuffer {
48947
+ constructor(interval, maxCount = Infinity) {
48747
48948
  this.data = [];
48748
48949
  this.sequenceNumber = 0;
48749
48950
  this.interval = interval;
48750
48951
  this.maxCount = maxCount;
48751
48952
  this.doubledMaxCount = maxCount * 2;
48752
48953
  }
48753
- SessionRecorderBuffer.prototype.isEmpty = function () {
48954
+ isEmpty() {
48754
48955
  return this.data.length === 0;
48755
- };
48756
- SessionRecorderBuffer.prototype.count = function () {
48956
+ }
48957
+ count() {
48757
48958
  return this.data.length;
48758
- };
48759
- SessionRecorderBuffer.prototype.clear = function () {
48959
+ }
48960
+ clear() {
48760
48961
  this.data.length = 0;
48761
- };
48762
- SessionRecorderBuffer.prototype.clearSequence = function () {
48962
+ }
48963
+ clearSequence() {
48763
48964
  this.sequenceNumber = 0;
48764
- };
48765
- SessionRecorderBuffer.prototype.push = function (event) {
48965
+ }
48966
+ push(event) {
48766
48967
  this.data.push(event);
48767
48968
  this.checkRateLimit();
48768
- };
48769
- SessionRecorderBuffer.prototype.pack = function (envelope, _) {
48969
+ }
48970
+ pack(envelope, _) {
48770
48971
  var eventsToSend = this.data.splice(0, this.maxCount);
48771
48972
  envelope.recordingPayload = eventsToSend;
48772
48973
  envelope.sequence = this.sequenceNumber;
@@ -48774,8 +48975,8 @@ var SessionRecorderBuffer = /** @class */ (function () {
48774
48975
  if (eventsToSend.length) {
48775
48976
  envelope.browserTime = eventsToSend[0].timestamp;
48776
48977
  }
48777
- envelope.recordingPayloadMetadata = _.map(eventsToSend, function (event) {
48778
- var metadata = _.pick(event, 'type', 'timestamp');
48978
+ envelope.recordingPayloadMetadata = _.map(eventsToSend, event => {
48979
+ const metadata = _.pick(event, 'type', 'timestamp');
48779
48980
  if (event.data) {
48780
48981
  metadata.data = _.pick(event.data, 'source', 'type', 'x', 'y', 'id', 'height', 'width', 'href');
48781
48982
  }
@@ -48783,30 +48984,18 @@ var SessionRecorderBuffer = /** @class */ (function () {
48783
48984
  });
48784
48985
  this.sequenceNumber += eventsToSend.length;
48785
48986
  return envelope;
48786
- };
48787
- SessionRecorderBuffer.prototype.checkRateLimit = function () {
48788
- var length = this.data.length;
48987
+ }
48988
+ checkRateLimit() {
48989
+ const length = this.data.length;
48789
48990
  if (length >= this.doubledMaxCount && length % this.maxCount === 0) {
48790
- var elapsed = this.data[length - 1].timestamp - this.data[length - this.doubledMaxCount].timestamp;
48991
+ const elapsed = this.data[length - 1].timestamp - this.data[length - this.doubledMaxCount].timestamp;
48791
48992
  if (elapsed <= this.interval && this.onRateLimit) {
48792
48993
  this.onRateLimit();
48793
48994
  }
48794
48995
  }
48795
- };
48796
- return SessionRecorderBuffer;
48797
- }());
48996
+ }
48997
+ }
48798
48998
 
48799
- var __assign = function() {
48800
- __assign = Object.assign || function __assign(t) {
48801
- for (var s, i = 1, n = arguments.length; i < n; i++) {
48802
- s = arguments[i];
48803
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
48804
- }
48805
- return t;
48806
- };
48807
- return __assign.apply(this, arguments);
48808
- };
48809
-
48810
48999
  function __rest(s, e) {
48811
49000
  var t = {};
48812
49001
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -48829,52 +49018,24 @@ function __awaiter(thisArg, _arguments, P, generator) {
48829
49018
  });
48830
49019
  }
48831
49020
 
48832
- function __generator(thisArg, body) {
48833
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
48834
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
48835
- function verb(n) { return function (v) { return step([n, v]); }; }
48836
- function step(op) {
48837
- if (f) throw new TypeError("Generator is already executing.");
48838
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
48839
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
48840
- if (y = 0, t) op = [op[0] & 2, t.value];
48841
- switch (op[0]) {
48842
- case 0: case 1: t = op; break;
48843
- case 4: _.label++; return { value: op[1], done: false };
48844
- case 5: _.label++; y = op[1]; op = [0]; continue;
48845
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
48846
- default:
48847
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
48848
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
48849
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
48850
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
48851
- if (t[2]) _.ops.pop();
48852
- _.trys.pop(); continue;
48853
- }
48854
- op = body.call(thisArg, _);
48855
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
48856
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
48857
- }
48858
- }
48859
-
48860
49021
  typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
48861
49022
  var e = new Error(message);
48862
49023
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
48863
49024
  };
48864
49025
 
48865
- var RECORDING_CONFIG_WORKERURL$1 = 'recording.workerUrl';
48866
- var MAX_SIZE = 2000000;
48867
- var RESOURCE_CACHING$1 = 'resourceCaching';
48868
- var Transport = /** @class */ (function () {
48869
- function Transport(WorkerClass, pendo, api) {
49026
+ const RECORDING_CONFIG_WORKERURL$1 = 'recording.workerUrl';
49027
+ const MAX_SIZE = 2000000;
49028
+ const RESOURCE_CACHING$1 = 'resourceCaching';
49029
+ class Transport {
49030
+ constructor(WorkerClass, pendo, api) {
48870
49031
  this.WorkerClass = WorkerClass;
48871
49032
  this.pendo = pendo;
48872
49033
  this.api = api;
48873
49034
  this.maxSize = MAX_SIZE;
48874
- this.lockID = "worker-lock-".concat(this.pendo.randomString(16));
49035
+ this.lockID = `worker-lock-${this.pendo.randomString(16)}`;
48875
49036
  this.isResourceCachingEnabled = this.api.ConfigReader.get(RESOURCE_CACHING$1);
48876
49037
  }
48877
- Transport.prototype.start = function (config) {
49038
+ start(config) {
48878
49039
  if (config.disableWorker)
48879
49040
  return;
48880
49041
  if (!this.worker) {
@@ -48884,7 +49045,7 @@ var Transport = /** @class */ (function () {
48884
49045
  this.worker = config.workerOverride;
48885
49046
  }
48886
49047
  else {
48887
- var workerUrl = this.api.ConfigReader.get(RECORDING_CONFIG_WORKERURL$1);
49048
+ const workerUrl = this.api.ConfigReader.get(RECORDING_CONFIG_WORKERURL$1);
48888
49049
  this.usesSelfHostedWorker = workerUrl != null;
48889
49050
  this.worker = workerUrl ? new Worker(workerUrl) : new this.WorkerClass();
48890
49051
  }
@@ -48898,35 +49059,34 @@ var Transport = /** @class */ (function () {
48898
49059
  this.worker = null;
48899
49060
  }
48900
49061
  }
48901
- };
48902
- Transport.prototype.stop = function () {
49062
+ }
49063
+ stop() {
48903
49064
  if (this.worker) {
48904
49065
  this.worker.terminate();
48905
49066
  delete this.worker;
48906
49067
  }
48907
- };
48908
- Transport.prototype.send = function (envelope, isUnload, failureCount) {
48909
- if (failureCount === void 0) { failureCount = 0; }
48910
- var url = envelope.url;
48911
- var payload = envelope.payload;
49068
+ }
49069
+ send(envelope, isUnload, failureCount = 0) {
49070
+ let { url } = envelope;
49071
+ const { payload } = envelope;
48912
49072
  if (failureCount > 0) {
48913
- url = "".concat(url, "&rt=").concat(failureCount);
49073
+ url = `${url}&rt=${failureCount}`;
48914
49074
  }
48915
49075
  if (this.worker && !isUnload && payload) {
48916
- var deferred_1 = {};
48917
- deferred_1.promise = new Promise$2(function (resolve, reject) {
48918
- deferred_1.resolve = resolve;
48919
- deferred_1.reject = reject;
49076
+ const deferred = {};
49077
+ deferred.promise = new Promise$2((resolve, reject) => {
49078
+ deferred.resolve = resolve;
49079
+ deferred.reject = reject;
48920
49080
  });
48921
- this.workerResponse = deferred_1;
48922
- this.worker.postMessage({ url: url, payload: payload, shouldCacheResources: this.isResourceCachingEnabled });
48923
- return deferred_1.promise;
49081
+ this.workerResponse = deferred;
49082
+ this.worker.postMessage({ url, payload, shouldCacheResources: this.isResourceCachingEnabled });
49083
+ return deferred.promise;
48924
49084
  }
48925
49085
  else {
48926
49086
  if (!envelope.body) {
48927
- var strPayload = JSON.stringify(payload);
49087
+ const strPayload = JSON.stringify(payload);
48928
49088
  if (strPayload.length > this.maxSize) {
48929
- var error = new Error('maximum recording payload size exceeded');
49089
+ const error = new Error('maximum recording payload size exceeded');
48930
49090
  error.reason = 'HEAVY_EVENT';
48931
49091
  error.context = {
48932
49092
  size: strPayload.length,
@@ -48937,14 +49097,14 @@ var Transport = /** @class */ (function () {
48937
49097
  envelope.body = this.pendo.compress(strPayload, 'binary');
48938
49098
  delete envelope.payload;
48939
49099
  }
48940
- url = "".concat(url, "&ct=").concat(new Date().getTime());
49100
+ url = `${url}&ct=${new Date().getTime()}`;
48941
49101
  return this.post(url, {
48942
49102
  keepalive: isUnload,
48943
49103
  body: envelope.body
48944
49104
  });
48945
49105
  }
48946
- };
48947
- Transport.prototype.post = function (url, options) {
49106
+ }
49107
+ post(url, options) {
48948
49108
  options.method = 'POST';
48949
49109
  if (options.keepalive && this.api.transmit.fetchKeepalive.supported()) {
48950
49110
  return this.api.transmit.fetchKeepalive(url, options);
@@ -48956,57 +49116,46 @@ var Transport = /** @class */ (function () {
48956
49116
  else {
48957
49117
  return this.pendo.ajax.post(url, options.body);
48958
49118
  }
48959
- };
48960
- Transport.prototype._onMessage = function (messageEvent) {
48961
- return __awaiter(this, void 0, void 0, function () {
48962
- return __generator(this, function (_a) {
48963
- switch (_a.label) {
48964
- case 0:
48965
- if (!(messageEvent.data && messageEvent.data.ready)) return [3 /*break*/, 2];
48966
- // When the lock is released, we can assume the worker was terminated or closed
48967
- return [4 /*yield*/, navigator.locks.request(this.lockID, function () { })];
48968
- case 1:
48969
- // When the lock is released, we can assume the worker was terminated or closed
48970
- _a.sent();
48971
- this.onWorkerMessage({ type: 'workerDied' });
48972
- _a.label = 2;
48973
- case 2:
48974
- // handle non-POST request responses from worker
48975
- if (messageEvent.data && messageEvent.data.type) {
48976
- this.onWorkerMessage(messageEvent.data);
48977
- return [2 /*return*/];
48978
- }
48979
- // handle POST request response from worker
48980
- if (messageEvent.data && messageEvent.data.error) {
48981
- if ((messageEvent.data.status && messageEvent.data.status < 500) ||
48982
- messageEvent.data.sequence == null) {
48983
- this.api.log.critical('Failed to send recording data from web worker', { error: messageEvent.data.error });
48984
- }
48985
- if (this.workerResponse) {
48986
- this.workerResponse.reject();
48987
- this.workerResponse = null;
48988
- }
48989
- }
48990
- if (this.workerResponse) {
48991
- this.workerResponse.resolve();
48992
- this.workerResponse = null;
48993
- }
48994
- return [2 /*return*/];
49119
+ }
49120
+ _onMessage(messageEvent) {
49121
+ return __awaiter(this, void 0, void 0, function* () {
49122
+ if (messageEvent.data && messageEvent.data.ready && navigator.locks) {
49123
+ // When the lock is released, we can assume the worker was terminated or closed
49124
+ yield navigator.locks.request(this.lockID, () => { });
49125
+ this.onWorkerMessage({ type: 'workerDied' });
49126
+ }
49127
+ // handle non-POST request responses from worker
49128
+ if (messageEvent.data && messageEvent.data.type) {
49129
+ this.onWorkerMessage(messageEvent.data);
49130
+ return;
49131
+ }
49132
+ // handle POST request response from worker
49133
+ if (messageEvent.data && messageEvent.data.error) {
49134
+ if ((messageEvent.data.status && messageEvent.data.status < 500) ||
49135
+ messageEvent.data.sequence == null) {
49136
+ this.api.log.critical('Failed to send recording data from web worker', { error: messageEvent.data.error });
48995
49137
  }
48996
- });
49138
+ if (this.workerResponse) {
49139
+ this.workerResponse.reject();
49140
+ this.workerResponse = null;
49141
+ }
49142
+ }
49143
+ if (this.workerResponse) {
49144
+ this.workerResponse.resolve();
49145
+ this.workerResponse = null;
49146
+ }
48997
49147
  });
48998
- };
48999
- Transport.prototype._onError = function () {
49148
+ }
49149
+ _onError() {
49000
49150
  if (this.onError) {
49001
49151
  this.onError();
49002
49152
  }
49003
- };
49004
- return Transport;
49005
- }());
49153
+ }
49154
+ }
49006
49155
 
49007
- var ELEMENT_NODE = 1;
49008
- var INPUT_MASK = '*'.repeat(10);
49009
- var NUMBER_INPUT_MASK = '0'.repeat(10);
49156
+ const ELEMENT_NODE = 1;
49157
+ const INPUT_MASK = '*'.repeat(10);
49158
+ const NUMBER_INPUT_MASK = '0'.repeat(10);
49010
49159
  function isElementNode(node) {
49011
49160
  if (!node)
49012
49161
  return false;
@@ -49015,12 +49164,10 @@ function isElementNode(node) {
49015
49164
  return true;
49016
49165
  }
49017
49166
  function getParent(elem) {
49018
- var isElementShadowRoot = typeof window.ShadowRoot !== 'undefined' && elem instanceof window.ShadowRoot && elem.host;
49167
+ const isElementShadowRoot = typeof window.ShadowRoot !== 'undefined' && elem instanceof window.ShadowRoot && elem.host;
49019
49168
  return isElementShadowRoot ? elem.host : elem.parentNode;
49020
49169
  }
49021
- function distanceToMatch(node, selector, limit, distance) {
49022
- if (limit === void 0) { limit = Infinity; }
49023
- if (distance === void 0) { distance = 0; }
49170
+ function distanceToMatch(node, selector, limit = Infinity, distance = 0) {
49024
49171
  if (distance > limit)
49025
49172
  return -1;
49026
49173
  if (!node)
@@ -49034,13 +49181,13 @@ function distanceToMatch(node, selector, limit, distance) {
49034
49181
  return distanceToMatch(getParent(node), selector, limit, distance + 1);
49035
49182
  }
49036
49183
  function shouldMask(node, options) {
49037
- var maskAllText = options.maskAllText, maskTextSelector = options.maskTextSelector, unmaskTextSelector = options.unmaskTextSelector;
49184
+ const { maskAllText, maskTextSelector, unmaskTextSelector } = options;
49038
49185
  try {
49039
- var el = isElementNode(node) ? node : node.parentElement;
49186
+ const el = isElementNode(node) ? node : node.parentElement;
49040
49187
  if (el === null)
49041
49188
  return false;
49042
- var maskDistance = -1;
49043
- var unmaskDistance = -1;
49189
+ let maskDistance = -1;
49190
+ let unmaskDistance = -1;
49044
49191
  if (maskAllText) {
49045
49192
  unmaskDistance = distanceToMatch(el, unmaskTextSelector);
49046
49193
  if (unmaskDistance < 0) {
@@ -49073,8 +49220,8 @@ function isNumberInput(element) {
49073
49220
  }
49074
49221
  function shouldMaskInput(element, maskInputOptions) {
49075
49222
  if (maskInputOptions && isElementNode(element)) {
49076
- var tagName = (element.tagName || '').toLowerCase();
49077
- var type = (element.type || '').toLowerCase();
49223
+ const tagName = (element.tagName || '').toLowerCase();
49224
+ const type = (element.type || '').toLowerCase();
49078
49225
  if (maskInputOptions[tagName] || maskInputOptions[type]) {
49079
49226
  return true;
49080
49227
  }
@@ -50561,12 +50708,12 @@ var WorkerFactory = /*#__PURE__*/createInlineWorkerFactory(/* rollup-plugin-web-
50561
50708
  }
50562
50709
  }
50563
50710
 
50564
- var ONE_HUNDRED_MB_IN_BYTES = 100 * 1024 * 1024;
50711
+ const ONE_HUNDRED_MB_IN_BYTES = 100 * 1024 * 1024;
50565
50712
  function matchHostedResources(recordingEvent, stringifiedRecordingPayload) {
50566
- var fontURLRegex = /https:\/\/[^"\\\s]+?\.(woff2?|ttf|otf|eot)(\?[^"\\\s]*)?\b/g;
50567
- var matches = stringifiedRecordingPayload.match(fontURLRegex);
50713
+ const fontURLRegex = /https:\/\/[^"\\\s]+?\.(woff2?|ttf|otf|eot)(\?[^"\\\s]*)?\b/g;
50714
+ const matches = stringifiedRecordingPayload.match(fontURLRegex);
50568
50715
  // de-duplicate matches
50569
- var hostedResources = matches ? Array.from(new Set(matches)) : [];
50716
+ const hostedResources = matches ? Array.from(new Set(matches)) : [];
50570
50717
  return {
50571
50718
  type: 'recording',
50572
50719
  visitorId: recordingEvent.visitorId,
@@ -50581,75 +50728,77 @@ var WorkerFactory = /*#__PURE__*/createInlineWorkerFactory(/* rollup-plugin-web-
50581
50728
  recordingPayloadMetadata: [],
50582
50729
  sequence: 0,
50583
50730
  recordingPayloadCount: 0,
50584
- hostedResources: hostedResources
50731
+ hostedResources
50585
50732
  };
50586
50733
  }
50587
50734
  // keep in mind changes here may need addressing in the extension worker proxy as well
50588
50735
  self.onmessage = function (e) {
50589
50736
  try {
50590
50737
  if (e.data.type === 'init' && e.data.lockID) {
50591
- navigator.locks.request(e.data.lockID, function () {
50592
- postMessage({ ready: true });
50593
- // This unresolved promise keeps the lock held with the worker until the worker is
50594
- // terminated at which point the lock is released.
50595
- return new Promise$2(function () { });
50596
- });
50738
+ if (navigator.locks) {
50739
+ navigator.locks.request(e.data.lockID, () => {
50740
+ postMessage({ ready: true });
50741
+ // This unresolved promise keeps the lock held with the worker until the worker is
50742
+ // terminated at which point the lock is released.
50743
+ return new Promise$2(() => { });
50744
+ });
50745
+ }
50597
50746
  return;
50598
50747
  }
50599
50748
  if (e.data.url && e.data.payload) {
50600
- var _a = e.data, url = _a.url, payload = _a.payload, shouldCacheResources = _a.shouldCacheResources;
50749
+ let { url, payload, shouldCacheResources } = e.data;
50601
50750
  if (Object.keys(payload).length === 0) {
50602
50751
  postMessage({
50603
50752
  type: 'emptyPayload'
50604
50753
  });
50605
50754
  }
50606
- var sequence_1 = payload.sequence;
50607
- var stringifiedRecordingPayload = JSON.stringify(payload.recordingPayload);
50755
+ const { sequence } = payload;
50756
+ const stringifiedRecordingPayload = JSON.stringify(payload.recordingPayload);
50608
50757
  // calculate and post back the recording payload size before the payload is compressed
50609
- var recordingPayloadSize = new TextEncoder().encode(stringifiedRecordingPayload).length;
50610
- var exceedsPayloadSizeLimit = recordingPayloadSize >= ONE_HUNDRED_MB_IN_BYTES;
50758
+ const recordingPayloadSize = new TextEncoder().encode(stringifiedRecordingPayload).length;
50759
+ const exceedsPayloadSizeLimit = recordingPayloadSize >= ONE_HUNDRED_MB_IN_BYTES;
50611
50760
  postMessage({
50612
50761
  type: 'recordingPayloadSize',
50613
- recordingPayloadSize: recordingPayloadSize,
50614
- exceedsPayloadSizeLimit: exceedsPayloadSizeLimit
50762
+ recordingPayloadSize,
50763
+ exceedsPayloadSizeLimit
50615
50764
  });
50616
50765
  // don't attempt to send the payload if it exceeds the allowed limit
50617
50766
  if (exceedsPayloadSizeLimit)
50618
50767
  return;
50619
50768
  if (shouldCacheResources) {
50620
- var hostedResourcesEvent = matchHostedResources(payload, stringifiedRecordingPayload);
50769
+ const hostedResourcesEvent = matchHostedResources(payload, stringifiedRecordingPayload);
50621
50770
  if (hostedResourcesEvent.hostedResources.length) {
50622
50771
  postMessage({
50623
50772
  type: 'hostedResources',
50624
- hostedResourcesEvent: hostedResourcesEvent
50773
+ hostedResourcesEvent
50625
50774
  });
50626
50775
  }
50627
50776
  }
50628
50777
  payload.recordingSize = recordingPayloadSize;
50629
- var body = compress(payload, 'binary');
50778
+ const body = compress(payload, 'binary');
50630
50779
  // we want to calculate ct (current time) as close as we can to the actual POST request
50631
50780
  // so that it's as accurate as possible
50632
- url = "".concat(url, "&ct=").concat(new Date().getTime());
50781
+ url = `${url}&ct=${new Date().getTime()}`;
50633
50782
  fetch(url, {
50634
50783
  method: 'POST',
50635
- body: body
50784
+ body
50636
50785
  }).then(function (response) {
50637
50786
  if (response.status < 200 || response.status >= 300) {
50638
50787
  postMessage({
50639
- error: new Error("received status code ".concat(response.status, ": ").concat(response.statusText)),
50788
+ error: new Error(`received status code ${response.status}: ${response.statusText}`),
50640
50789
  status: response.status,
50641
- sequence: sequence_1
50790
+ sequence
50642
50791
  });
50643
50792
  }
50644
50793
  else {
50645
50794
  postMessage({
50646
- sequence: sequence_1
50795
+ sequence
50647
50796
  });
50648
50797
  }
50649
- })["catch"](function (e) {
50798
+ }).catch(function (e) {
50650
50799
  postMessage({
50651
50800
  error: e,
50652
- sequence: sequence_1
50801
+ sequence
50653
50802
  });
50654
50803
  });
50655
50804
  }
@@ -50684,12 +50833,12 @@ function createReplayPlugin() {
50684
50833
  * limit of number of keys in an object
50685
50834
  * if an object contains more keys than this limit, we would call its toString function directly
50686
50835
  */
50687
- var NUM_OF_KEYS_LIMIT = 50;
50836
+ const NUM_OF_KEYS_LIMIT = 50;
50688
50837
  /**
50689
50838
  * limit number of depth in an object
50690
50839
  * if an object is too deep, toString process may cause browser OOM
50691
50840
  */
50692
- var DEPTH_OF_LIMIT = 4;
50841
+ const DEPTH_OF_LIMIT = 4;
50693
50842
  /**
50694
50843
  * serialize an HTML element by creating a shallow clone of it with text content
50695
50844
  * and return the resulting outerHTML string (without the subtree)
@@ -50700,8 +50849,8 @@ function serializeHTML(node) {
50700
50849
  if (!node || node.nodeType !== node.ELEMENT_NODE) {
50701
50850
  return '';
50702
50851
  }
50703
- var nodeClone = node.cloneNode(false);
50704
- var textContent = node.textContent;
50852
+ const nodeClone = node.cloneNode(false);
50853
+ const { textContent } = node;
50705
50854
  if (textContent) {
50706
50855
  nodeClone.textContent = textContent;
50707
50856
  }
@@ -50715,7 +50864,7 @@ function isObject(obj) {
50715
50864
  return false;
50716
50865
  if (typeof obj !== 'object')
50717
50866
  return false;
50718
- var proto = Object.getPrototypeOf(obj);
50867
+ const proto = Object.getPrototypeOf(obj);
50719
50868
  return proto === Object.prototype || proto === null;
50720
50869
  }
50721
50870
  /**
@@ -50724,11 +50873,11 @@ function isObject(obj) {
50724
50873
  function isObjTooDeep(obj, limit) {
50725
50874
  if (limit === 0)
50726
50875
  return true;
50727
- var keys = Object.keys(obj);
50876
+ const keys = Object.keys(obj);
50728
50877
  if (keys.length === 0)
50729
50878
  return false;
50730
- return keys.some(function (key) {
50731
- var value = obj[key];
50879
+ return keys.some(key => {
50880
+ const value = obj[key];
50732
50881
  return isObject(value) && isObjTooDeep(value, limit - 1);
50733
50882
  });
50734
50883
  }
@@ -50744,7 +50893,7 @@ function shouldIgnore(_obj) {
50744
50893
  return false;
50745
50894
  }
50746
50895
  // out of keys limit
50747
- var keys = Object.keys(_obj);
50896
+ const keys = Object.keys(_obj);
50748
50897
  if (keys.length > NUM_OF_KEYS_LIMIT) {
50749
50898
  return true;
50750
50899
  }
@@ -50776,7 +50925,7 @@ function stringify(arg) {
50776
50925
  return value.toString ? value.toString() : '[object Object]';
50777
50926
  }
50778
50927
  if (value instanceof ArrayBuffer)
50779
- return "ArrayBuffer { byteLength: ".concat(value.byteLength, " }");
50928
+ return `ArrayBuffer { byteLength: ${value.byteLength} }`;
50780
50929
  if (value instanceof Error)
50781
50930
  return value.name + ': ' + value.message;
50782
50931
  if (value instanceof Node) {
@@ -50784,10 +50933,10 @@ function stringify(arg) {
50784
50933
  }
50785
50934
  // Handle events
50786
50935
  if (value instanceof Event) {
50787
- var eventResult = {};
50936
+ const eventResult = {};
50788
50937
  // eslint-disable-next-line guard-for-in
50789
- for (var eventKey in value) {
50790
- var eventValue = value[eventKey];
50938
+ for (const eventKey in value) {
50939
+ const eventValue = value[eventKey];
50791
50940
  eventResult[eventKey] = Array.isArray(eventValue) && eventValue[0] instanceof HTMLElement
50792
50941
  ? serializeHTML(eventValue[0])
50793
50942
  : eventValue;
@@ -50798,31 +50947,30 @@ function stringify(arg) {
50798
50947
  });
50799
50948
  }
50800
50949
 
50801
- var StackFrame = /** @class */ (function () {
50802
- function StackFrame(obj) {
50950
+ class StackFrame {
50951
+ constructor(obj) {
50803
50952
  this.fileName = obj.fileName || '';
50804
50953
  this.functionName = obj.functionName || '';
50805
50954
  this.lineNumber = obj.lineNumber;
50806
50955
  this.columnNumber = obj.columnNumber;
50807
50956
  }
50808
- StackFrame.prototype.toString = function () {
50809
- var _a = this, fileName = _a.fileName, functionName = _a.functionName, _b = _a.lineNumber, lineNumber = _b === void 0 ? '' : _b, _c = _a.columnNumber, columnNumber = _c === void 0 ? '' : _c;
50957
+ toString() {
50958
+ const { fileName, functionName, lineNumber = '', columnNumber = '' } = this;
50810
50959
  return functionName
50811
- ? "".concat(functionName, " (").concat(fileName, ":").concat(lineNumber, ":").concat(columnNumber, ")")
50812
- : "".concat(fileName, ":").concat(lineNumber, ":").concat(columnNumber);
50813
- };
50814
- return StackFrame;
50815
- }());
50816
- var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
50817
- var CHROME_EDGE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
50818
- var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;
50819
- var LOCATION_REGEXP = /(.+?)(?::(\d+))?(?::(\d+))?$/;
50820
- var DEFAULT_NUM_FRAMES_TO_SKIP = 5;
50821
- var ErrorStackParser = {
50960
+ ? `${functionName} (${fileName}:${lineNumber}:${columnNumber})`
50961
+ : `${fileName}:${lineNumber}:${columnNumber}`;
50962
+ }
50963
+ }
50964
+ const FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
50965
+ const CHROME_EDGE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
50966
+ const SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;
50967
+ const LOCATION_REGEXP = /(.+?)(?::(\d+))?(?::(\d+))?$/;
50968
+ const DEFAULT_NUM_FRAMES_TO_SKIP = 5;
50969
+ const ErrorStackParser = {
50822
50970
  /**
50823
50971
  * Given an Error object, extract the most information from it.
50824
50972
  */
50825
- parse: function (error, maxFramesToSave) {
50973
+ parse(error, maxFramesToSave) {
50826
50974
  if (!(error === null || error === void 0 ? void 0 : error.stack))
50827
50975
  return [];
50828
50976
  // Chrome, Edge, Opera ≥15
@@ -50836,25 +50984,24 @@ var ErrorStackParser = {
50836
50984
  return [];
50837
50985
  },
50838
50986
  // Separate line and column numbers from a string of the form: (URI:Line:Column)
50839
- extractLocation: function (urlLike) {
50987
+ extractLocation(urlLike) {
50840
50988
  // Fail-fast but return locations like "(native)"
50841
50989
  if (urlLike.indexOf(':') === -1) {
50842
50990
  return [urlLike];
50843
50991
  }
50844
- var parts = LOCATION_REGEXP.exec(urlLike.replace(/[()]/g, ''));
50992
+ const parts = LOCATION_REGEXP.exec(urlLike.replace(/[()]/g, ''));
50845
50993
  if (!parts)
50846
- throw new Error("Cannot parse given url: ".concat(urlLike));
50994
+ throw new Error(`Cannot parse given url: ${urlLike}`);
50847
50995
  return [parts[1], parts[2] || undefined, parts[3] || undefined];
50848
50996
  },
50849
- parseHelper: function (_a, error, maxFramesToSave, callback) {
50850
- var regex = _a.regex, includeMatchedLine = _a.includeMatchedLine;
50851
- var lines = error.stack.split('\n');
50852
- var frames = [];
50853
- var validFramesFound = 0;
50854
- for (var i = 0; i < lines.length; i++) {
50855
- var line = lines[i];
50856
- var lineMatchesRegex = regex.test(line);
50857
- var shouldSkipLine = (includeMatchedLine && !lineMatchesRegex) || // if line doesn't match regex and we want matched lines, skip it
50997
+ parseHelper({ regex, includeMatchedLine }, error, maxFramesToSave, callback) {
50998
+ const lines = error.stack.split('\n');
50999
+ const frames = [];
51000
+ let validFramesFound = 0;
51001
+ for (let i = 0; i < lines.length; i++) {
51002
+ const line = lines[i];
51003
+ const lineMatchesRegex = regex.test(line);
51004
+ const shouldSkipLine = (includeMatchedLine && !lineMatchesRegex) || // if line doesn't match regex and we want matched lines, skip it
50858
51005
  (!includeMatchedLine && lineMatchesRegex); // if line does match regex but we don't want matched lines, skip it
50859
51006
  if (shouldSkipLine)
50860
51007
  continue;
@@ -50869,12 +51016,11 @@ var ErrorStackParser = {
50869
51016
  }
50870
51017
  return frames;
50871
51018
  },
50872
- parseChromiumStack: function (error, maxFramesToSave) {
50873
- var _this = this;
50874
- return this.parseHelper({ regex: CHROME_EDGE_STACK_REGEXP, includeMatchedLine: true }, error, maxFramesToSave, function (line, frames) {
50875
- var sanitizedLine;
51019
+ parseChromiumStack(error, maxFramesToSave) {
51020
+ return this.parseHelper({ regex: CHROME_EDGE_STACK_REGEXP, includeMatchedLine: true }, error, maxFramesToSave, (line, frames) => {
51021
+ let sanitizedLine;
50876
51022
  if (line.indexOf('(eval ') > -1) {
50877
- var processedLine = line
51023
+ const processedLine = line
50878
51024
  .replace(/eval code/g, 'eval')
50879
51025
  .replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
50880
51026
  sanitizedLine = processedLine.replace(/^\s+/, '').replace(/\(eval code/g, '(');
@@ -50884,7 +51030,7 @@ var ErrorStackParser = {
50884
51030
  }
50885
51031
  // capture and preserve the parenthesized location "(/foo/my bar.js:12:87)"
50886
51032
  // in case it has spaces in it, as the string is split on \s+ later on
50887
- var location;
51033
+ let location;
50888
51034
  if (sanitizedLine.indexOf('(') > -1 && sanitizedLine.indexOf('):') > -1) {
50889
51035
  location = sanitizedLine.match(/ (\((.+):(\d+):(\d+)\)$)/);
50890
51036
  }
@@ -50892,23 +51038,22 @@ var ErrorStackParser = {
50892
51038
  sanitizedLine = location
50893
51039
  ? sanitizedLine.replace(location[0], '')
50894
51040
  : sanitizedLine;
50895
- var tokens = sanitizedLine.split(/\s+/).slice(1);
51041
+ const tokens = sanitizedLine.split(/\s+/).slice(1);
50896
51042
  // if a location was matched, pass it to extractLocation() otherwise pop the last token
50897
- var locationParts = _this.extractLocation(location ? location[1] : tokens.pop() || '');
50898
- var functionName = tokens.join(' ') || undefined;
50899
- var fileName = (locationParts[0] === 'eval' || locationParts[0] === '<anonymous>') ? undefined : locationParts[0];
51043
+ const locationParts = this.extractLocation(location ? location[1] : tokens.pop() || '');
51044
+ const functionName = tokens.join(' ') || undefined;
51045
+ const fileName = (locationParts[0] === 'eval' || locationParts[0] === '<anonymous>') ? undefined : locationParts[0];
50900
51046
  frames.push(new StackFrame({
50901
- functionName: functionName,
50902
- fileName: fileName,
51047
+ functionName,
51048
+ fileName,
50903
51049
  lineNumber: locationParts[1],
50904
51050
  columnNumber: locationParts[2]
50905
51051
  }));
50906
51052
  });
50907
51053
  },
50908
- parseFirefoxSafariStack: function (error, maxFramesToSave) {
50909
- var _this = this;
50910
- return this.parseHelper({ regex: SAFARI_NATIVE_CODE_REGEXP, includeMatchedLine: false }, error, maxFramesToSave, function (line, frames) {
50911
- var processedLine = line;
51054
+ parseFirefoxSafariStack(error, maxFramesToSave) {
51055
+ return this.parseHelper({ regex: SAFARI_NATIVE_CODE_REGEXP, includeMatchedLine: false }, error, maxFramesToSave, (line, frames) => {
51056
+ let processedLine = line;
50912
51057
  // Throw away eval information until we implement stacktrace.js/stackframe#8
50913
51058
  if (processedLine.indexOf(' > eval') > -1) {
50914
51059
  processedLine = processedLine.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1');
@@ -50920,12 +51065,12 @@ var ErrorStackParser = {
50920
51065
  }));
50921
51066
  return;
50922
51067
  }
50923
- var functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/;
50924
- var matches = processedLine.match(functionNameRegex);
50925
- var functionName = matches && matches[1] ? matches[1] : undefined;
50926
- var locationParts = _this.extractLocation(processedLine.replace(functionNameRegex, ''));
51068
+ const functionNameRegex = /((.*".+"[^@]*)?[^@]*)(?:@)/;
51069
+ const matches = processedLine.match(functionNameRegex);
51070
+ const functionName = matches && matches[1] ? matches[1] : undefined;
51071
+ const locationParts = this.extractLocation(processedLine.replace(functionNameRegex, ''));
50927
51072
  frames.push(new StackFrame({
50928
- functionName: functionName,
51073
+ functionName,
50929
51074
  fileName: locationParts[0],
50930
51075
  lineNumber: locationParts[1],
50931
51076
  columnNumber: locationParts[2]
@@ -50960,7 +51105,7 @@ function includes(str, substring) {
50960
51105
  function getResourceType(blockedURI, directive) {
50961
51106
  if (!directive || typeof directive !== 'string')
50962
51107
  return 'resource';
50963
- var d = directive.toLowerCase();
51108
+ const d = directive.toLowerCase();
50964
51109
  if (blockedURI === 'inline') {
50965
51110
  if (includes(d, 'script-src-attr')) {
50966
51111
  return 'inline event handler';
@@ -51019,12 +51164,11 @@ function getResourceType(blockedURI, directive) {
51019
51164
  function getDirective(policy, directiveName) {
51020
51165
  if (!policy || !directiveName)
51021
51166
  return '';
51022
- var needle = directiveName.toLowerCase();
51023
- for (var _i = 0, _a = policy.split(';'); _i < _a.length; _i++) {
51024
- var directive = _a[_i];
51025
- var trimmed = directive.trim();
51026
- var lower = trimmed.toLowerCase();
51027
- if (lower === needle || lower.startsWith("".concat(needle, " "))) {
51167
+ const needle = directiveName.toLowerCase();
51168
+ for (const directive of policy.split(';')) {
51169
+ const trimmed = directive.trim();
51170
+ const lower = trimmed.toLowerCase();
51171
+ if (lower === needle || lower.startsWith(`${needle} `)) {
51028
51172
  return trimmed;
51029
51173
  }
51030
51174
  }
@@ -51046,7 +51190,7 @@ function getDirective(policy, directiveName) {
51046
51190
  function getArticle(phrase) {
51047
51191
  if (!phrase || typeof phrase !== 'string')
51048
51192
  return 'A';
51049
- var c = phrase.trim().charAt(0).toLowerCase();
51193
+ const c = phrase.trim().charAt(0).toLowerCase();
51050
51194
  return includes('aeiou', c) ? 'An' : 'A';
51051
51195
  }
51052
51196
  /**
@@ -51089,47 +51233,46 @@ function createCspViolationMessage(blockedURI, directive, isReportOnly, original
51089
51233
  return 'Content Security Policy: Unknown violation occurred.';
51090
51234
  }
51091
51235
  try {
51092
- var reportOnlyText = isReportOnly ? ' (Report-Only)' : '';
51236
+ const reportOnlyText = isReportOnly ? ' (Report-Only)' : '';
51093
51237
  // special case for frame-ancestors since it doesn't fit our template at all
51094
51238
  if ((directive === null || directive === void 0 ? void 0 : directive.toLowerCase()) === 'frame-ancestors') {
51095
- return "Content Security Policy".concat(reportOnlyText, ": The display of ").concat(blockedURI, " in a frame was blocked because an ancestor violates your site's frame-ancestors policy.\nCurrent CSP: \"").concat(originalPolicy, "\".");
51239
+ return `Content Security Policy${reportOnlyText}: The display of ${blockedURI} in a frame was blocked because an ancestor violates your site's frame-ancestors policy.\nCurrent CSP: "${originalPolicy}".`;
51096
51240
  }
51097
- var resourceType = getResourceType(blockedURI, directive);
51098
- var article = getArticle(resourceType);
51099
- var source = formatBlockedUri(blockedURI);
51100
- var directiveValue = getDirective(originalPolicy, directive);
51101
- var policyDisplay = directiveValue || directive;
51102
- var resourceDescription = "".concat(article, " ").concat(resourceType).concat(source ? " from ".concat(source) : '');
51103
- return "Content Security Policy".concat(reportOnlyText, ": ").concat(resourceDescription, " was blocked by your site's `").concat(policyDisplay, "` policy.\nCurrent CSP: \"").concat(originalPolicy, "\".");
51241
+ const resourceType = getResourceType(blockedURI, directive);
51242
+ const article = getArticle(resourceType);
51243
+ const source = formatBlockedUri(blockedURI);
51244
+ const directiveValue = getDirective(originalPolicy, directive);
51245
+ const policyDisplay = directiveValue || directive;
51246
+ const resourceDescription = `${article} ${resourceType}${source ? ` from ${source}` : ''}`;
51247
+ return `Content Security Policy${reportOnlyText}: ${resourceDescription} was blocked by your site's \`${policyDisplay}\` policy.\nCurrent CSP: "${originalPolicy}".`;
51104
51248
  }
51105
51249
  catch (error) {
51106
- return "Content Security Policy: Error formatting violation message: ".concat(error.message);
51250
+ return `Content Security Policy: Error formatting violation message: ${error.message}`;
51107
51251
  }
51108
51252
  }
51109
51253
 
51110
- var MAX_LENGTH = 1000;
51111
- var PII_PATTERN = {
51254
+ const MAX_LENGTH = 1000;
51255
+ const PII_PATTERN = {
51112
51256
  ip: /\b(?:\d{1,3}\.){3}\d{1,3}\b/g,
51113
51257
  ssn: /\b\d{3}-\d{2}-\d{4}\b/g,
51114
51258
  creditCard: /\b(?:\d[ -]?){12,18}\d\b/g,
51115
51259
  httpsUrls: /https:\/\/[^\s]+/g,
51116
51260
  email: /[\w._+-]+@[\w.-]+\.\w+/g
51117
51261
  };
51118
- var PII_REPLACEMENT = '*'.repeat(10);
51119
- var JSON_PII_KEYS = ['password', 'email', 'key', 'token', 'auth', 'authentication', 'phone', 'address', 'ssn'];
51120
- var UNABLE_TO_DISPLAY_BODY = '[Unable to display body: detected PII could not be redacted]';
51121
- var joinedKeys = JSON_PII_KEYS.join('|');
51122
- var keyPattern = "\"([^\"]*(?:".concat(joinedKeys, ")[^\"]*)\"");
51262
+ const PII_REPLACEMENT = '*'.repeat(10);
51263
+ const JSON_PII_KEYS = ['password', 'email', 'key', 'token', 'auth', 'authentication', 'phone', 'address', 'ssn'];
51264
+ const UNABLE_TO_DISPLAY_BODY = '[Unable to display body: detected PII could not be redacted]';
51265
+ const joinedKeys = JSON_PII_KEYS.join('|');
51266
+ const keyPattern = `"([^"]*(?:${joinedKeys})[^"]*)"`;
51123
51267
  // only scrub strings, numbers, and booleans
51124
- var acceptedValues = '("([^"\\\\]*(?:\\\\.[^"\\\\]*)*")|(\\d+)|(true|false))';
51268
+ const acceptedValues = '("([^"\\\\]*(?:\\\\.[^"\\\\]*)*")|(\\d+)|(true|false))';
51125
51269
  /**
51126
51270
  * Truncates a string to the max length
51127
51271
  * @access private
51128
51272
  * @param {String} string
51129
51273
  * @returns {String}
51130
51274
  */
51131
- function truncate(string, includeEllipsis) {
51132
- if (includeEllipsis === void 0) { includeEllipsis = false; }
51275
+ function truncate(string, includeEllipsis = false) {
51133
51276
  if (string.length <= MAX_LENGTH)
51134
51277
  return string;
51135
51278
  if (includeEllipsis) {
@@ -51146,7 +51289,7 @@ function truncate(string, includeEllipsis) {
51146
51289
  * @returns {String}
51147
51290
  */
51148
51291
  function generateLogKey(methodName, message, stackTrace) {
51149
- return "".concat(methodName, "|").concat(message, "|").concat(stackTrace);
51292
+ return `${methodName}|${message}|${stackTrace}`;
51150
51293
  }
51151
51294
  /**
51152
51295
  * Checks if a string has 2 or more digits, a https URL, or an email address
@@ -51163,13 +51306,12 @@ function mightContainPII(string) {
51163
51306
  * @param {String} string
51164
51307
  * @returns {String}
51165
51308
  */
51166
- function scrubPII(_a) {
51167
- var string = _a.string, _ = _a._;
51309
+ function scrubPII({ string, _ }) {
51168
51310
  if (!string || typeof string !== 'string')
51169
51311
  return string;
51170
51312
  if (!mightContainPII(string))
51171
51313
  return string;
51172
- return _.reduce(_.values(PII_PATTERN), function (str, pattern) { return str.replace(pattern, PII_REPLACEMENT); }, string);
51314
+ return _.reduce(_.values(PII_PATTERN), (str, pattern) => str.replace(pattern, PII_REPLACEMENT), string);
51173
51315
  }
51174
51316
  /**
51175
51317
  * Scrub PII from a stringified JSON object
@@ -51178,14 +51320,12 @@ function scrubPII(_a) {
51178
51320
  * @returns {String}
51179
51321
  */
51180
51322
  function scrubJsonPII(string) {
51181
- var fullScrubRegex = new RegExp("".concat(keyPattern, "\\s*:\\s*[\\{\\[]"), 'i');
51323
+ const fullScrubRegex = new RegExp(`${keyPattern}\\s*:\\s*[\\{\\[]`, 'i');
51182
51324
  if (fullScrubRegex.test(string)) {
51183
51325
  return UNABLE_TO_DISPLAY_BODY;
51184
51326
  }
51185
- var keyValueScrubRegex = new RegExp("".concat(keyPattern, "\\s*:\\s*").concat(acceptedValues), 'gi');
51186
- return string.replace(keyValueScrubRegex, function (match, key) {
51187
- return "\"".concat(key, "\":\"").concat(PII_REPLACEMENT, "\"");
51188
- });
51327
+ const keyValueScrubRegex = new RegExp(`${keyPattern}\\s*:\\s*${acceptedValues}`, 'gi');
51328
+ return string.replace(keyValueScrubRegex, (match, key) => `"${key}":"${PII_REPLACEMENT}"`);
51189
51329
  }
51190
51330
  /**
51191
51331
  * Checks if a string is a JSON object
@@ -51197,7 +51337,7 @@ function scrubJsonPII(string) {
51197
51337
  function mightContainJson(string, contentType) {
51198
51338
  if (!string || typeof string !== 'string')
51199
51339
  return false;
51200
- var firstChar = string.charAt(0);
51340
+ const firstChar = string.charAt(0);
51201
51341
  if (contentType && contentType.indexOf('application/json') !== -1) {
51202
51342
  return true;
51203
51343
  }
@@ -51210,20 +51350,19 @@ function mightContainJson(string, contentType) {
51210
51350
  * @param {String} contentType
51211
51351
  * @returns {String}
51212
51352
  */
51213
- function maskSensitiveFields(_a) {
51214
- var string = _a.string, contentType = _a.contentType, _ = _a._;
51353
+ function maskSensitiveFields({ string, contentType, _ }) {
51215
51354
  if (!string || typeof string !== 'string')
51216
51355
  return string;
51217
51356
  if (mightContainJson(string, contentType)) {
51218
51357
  string = scrubJsonPII(string);
51219
51358
  }
51220
51359
  if (mightContainPII(string)) {
51221
- string = scrubPII({ string: string, _: _ });
51360
+ string = scrubPII({ string, _ });
51222
51361
  }
51223
51362
  return string;
51224
51363
  }
51225
51364
 
51226
- var DEV_LOG_TYPE = 'devlog';
51365
+ const DEV_LOG_TYPE = 'devlog';
51227
51366
  function createDevLogEnvelope(pluginAPI, globalPendo) {
51228
51367
  return {
51229
51368
  browser_time: pluginAPI.util.getNow(),
@@ -51234,12 +51373,12 @@ function createDevLogEnvelope(pluginAPI, globalPendo) {
51234
51373
  };
51235
51374
  }
51236
51375
 
51237
- var TOKEN_MAX_SIZE = 100;
51238
- var TOKEN_REFILL_RATE = 10;
51239
- var TOKEN_REFRESH_INTERVAL = 1000;
51240
- var MAX_UNCOMPRESSED_SIZE = 125000; // 125KB
51241
- var DevlogBuffer = /** @class */ (function () {
51242
- function DevlogBuffer(pendo, pluginAPI) {
51376
+ const TOKEN_MAX_SIZE = 100;
51377
+ const TOKEN_REFILL_RATE = 10;
51378
+ const TOKEN_REFRESH_INTERVAL = 1000;
51379
+ const MAX_UNCOMPRESSED_SIZE = 125000; // 125KB
51380
+ class DevlogBuffer {
51381
+ constructor(pendo, pluginAPI) {
51243
51382
  this.pendo = pendo;
51244
51383
  this.pluginAPI = pluginAPI;
51245
51384
  this.events = [];
@@ -51250,36 +51389,36 @@ var DevlogBuffer = /** @class */ (function () {
51250
51389
  this.lastRefillTime = this.pluginAPI.util.getNow();
51251
51390
  this.nextRefillTime = this.lastRefillTime + TOKEN_REFRESH_INTERVAL;
51252
51391
  }
51253
- DevlogBuffer.prototype.isEmpty = function () {
51392
+ isEmpty() {
51254
51393
  return this.events.length === 0 && this.payloads.length === 0;
51255
- };
51256
- DevlogBuffer.prototype.refillTokens = function () {
51257
- var now = this.pluginAPI.util.getNow();
51394
+ }
51395
+ refillTokens() {
51396
+ const now = this.pluginAPI.util.getNow();
51258
51397
  if (now >= this.nextRefillTime) {
51259
- var timeSinceLastRefill = now - this.lastRefillTime;
51260
- var secondsSinceLastRefill = Math.floor(timeSinceLastRefill / TOKEN_REFRESH_INTERVAL);
51261
- var tokensToRefill = secondsSinceLastRefill * TOKEN_REFILL_RATE;
51398
+ const timeSinceLastRefill = now - this.lastRefillTime;
51399
+ const secondsSinceLastRefill = Math.floor(timeSinceLastRefill / TOKEN_REFRESH_INTERVAL);
51400
+ const tokensToRefill = secondsSinceLastRefill * TOKEN_REFILL_RATE;
51262
51401
  this.tokens = Math.min(this.tokens + tokensToRefill, TOKEN_MAX_SIZE);
51263
51402
  this.lastRefillTime = now;
51264
51403
  this.nextRefillTime = now + TOKEN_REFRESH_INTERVAL;
51265
51404
  }
51266
- };
51267
- DevlogBuffer.prototype.clear = function () {
51405
+ }
51406
+ clear() {
51268
51407
  this.events = [];
51269
51408
  this.lastEvent = null;
51270
51409
  this.uncompressedSize = 0;
51271
- };
51272
- DevlogBuffer.prototype.hasTokenAvailable = function () {
51410
+ }
51411
+ hasTokenAvailable() {
51273
51412
  this.refillTokens();
51274
51413
  return this.tokens > 0;
51275
- };
51276
- DevlogBuffer.prototype.estimateEventSize = function (event) {
51414
+ }
51415
+ estimateEventSize(event) {
51277
51416
  return JSON.stringify(event).length;
51278
- };
51279
- DevlogBuffer.prototype.push = function (event) {
51417
+ }
51418
+ push(event) {
51280
51419
  if (!this.hasTokenAvailable())
51281
51420
  return false;
51282
- var eventSize = this.estimateEventSize(event);
51421
+ const eventSize = this.estimateEventSize(event);
51283
51422
  if (this.uncompressedSize + eventSize > MAX_UNCOMPRESSED_SIZE) {
51284
51423
  this.compressCurrentChunk();
51285
51424
  }
@@ -51288,55 +51427,54 @@ var DevlogBuffer = /** @class */ (function () {
51288
51427
  this.events.push(event);
51289
51428
  this.tokens = Math.max(this.tokens - 1, 0);
51290
51429
  return true;
51291
- };
51292
- DevlogBuffer.prototype.compressCurrentChunk = function () {
51430
+ }
51431
+ compressCurrentChunk() {
51293
51432
  if (this.events.length === 0)
51294
51433
  return;
51295
- var jzb = this.pendo.compress(this.events);
51434
+ const jzb = this.pendo.compress(this.events);
51296
51435
  this.payloads.push(jzb);
51297
51436
  this.clear();
51298
- };
51299
- DevlogBuffer.prototype.generateUrl = function () {
51300
- var queryParams = {
51437
+ }
51438
+ generateUrl() {
51439
+ const queryParams = {
51301
51440
  v: this.pendo.VERSION,
51302
51441
  ct: this.pluginAPI.util.getNow()
51303
51442
  };
51304
51443
  return this.pluginAPI.transmit.buildBaseDataUrl(DEV_LOG_TYPE, this.pendo.apiKey, queryParams);
51305
- };
51306
- DevlogBuffer.prototype.pack = function () {
51444
+ }
51445
+ pack() {
51307
51446
  if (this.isEmpty())
51308
51447
  return;
51309
- var url = this.generateUrl();
51448
+ const url = this.generateUrl();
51310
51449
  this.compressCurrentChunk();
51311
- var payloads = this.pendo._.map(this.payloads, function (jzb) { return ({
51312
- jzb: jzb,
51313
- url: url
51314
- }); });
51450
+ const payloads = this.pendo._.map(this.payloads, (jzb) => ({
51451
+ jzb,
51452
+ url
51453
+ }));
51315
51454
  this.payloads = [];
51316
51455
  return payloads;
51317
- };
51318
- return DevlogBuffer;
51319
- }());
51456
+ }
51457
+ }
51320
51458
 
51321
- var DevlogTransport = /** @class */ (function () {
51322
- function DevlogTransport(globalPendo, pluginAPI) {
51459
+ class DevlogTransport {
51460
+ constructor(globalPendo, pluginAPI) {
51323
51461
  this.pendo = globalPendo;
51324
51462
  this.pluginAPI = pluginAPI;
51325
51463
  }
51326
- DevlogTransport.prototype.buildGetUrl = function (baseUrl, jzb) {
51327
- var params = {};
51464
+ buildGetUrl(baseUrl, jzb) {
51465
+ const params = {};
51328
51466
  if (this.pluginAPI.agent.treatAsAdoptPartner()) {
51329
51467
  this.pluginAPI.agent.addAccountIdParams(params, this.pendo.get_account_id(), this.pluginAPI.ConfigReader.get('oemAccountId'));
51330
51468
  }
51331
- var jwtOptions = this.pluginAPI.agent.getJwtInfoCopy();
51469
+ const jwtOptions = this.pluginAPI.agent.getJwtInfoCopy();
51332
51470
  if (!this.pendo._.isEmpty(jwtOptions)) {
51333
51471
  this.pendo._.extend(params, jwtOptions);
51334
51472
  }
51335
51473
  params.jzb = jzb;
51336
- var queryString = this.pendo._.map(params, function (value, key) { return "".concat(key, "=").concat(value); }).join('&');
51337
- return "".concat(baseUrl).concat(baseUrl.indexOf('?') !== -1 ? '&' : '?').concat(queryString);
51338
- };
51339
- DevlogTransport.prototype.get = function (url, options) {
51474
+ const queryString = this.pendo._.map(params, (value, key) => `${key}=${value}`).join('&');
51475
+ return `${baseUrl}${baseUrl.indexOf('?') !== -1 ? '&' : '?'}${queryString}`;
51476
+ }
51477
+ get(url, options) {
51340
51478
  options.method = 'GET';
51341
51479
  if (this.pluginAPI.transmit.fetchKeepalive.supported()) {
51342
51480
  return this.pluginAPI.transmit.fetchKeepalive(url, options);
@@ -51344,90 +51482,86 @@ var DevlogTransport = /** @class */ (function () {
51344
51482
  else {
51345
51483
  return this.pendo.ajax.get(url);
51346
51484
  }
51347
- };
51348
- DevlogTransport.prototype.sendRequestWithGet = function (_a) {
51349
- var url = _a.url, jzb = _a.jzb;
51350
- var getUrl = this.buildGetUrl(url, jzb);
51485
+ }
51486
+ sendRequestWithGet({ url, jzb }) {
51487
+ const getUrl = this.buildGetUrl(url, jzb);
51351
51488
  return this.get(getUrl, {
51352
51489
  headers: {
51353
51490
  'Content-Type': 'application/octet-stream'
51354
51491
  }
51355
51492
  });
51356
- };
51357
- DevlogTransport.prototype.post = function (url, options) {
51493
+ }
51494
+ post(url, options) {
51358
51495
  options.method = 'POST';
51359
51496
  if (options.keepalive && this.pluginAPI.transmit.fetchKeepalive.supported()) {
51360
51497
  return this.pluginAPI.transmit.fetchKeepalive(url, options);
51361
51498
  }
51362
51499
  else if (options.keepalive && this.pluginAPI.transmit.sendBeacon.supported()) {
51363
- var result = this.pluginAPI.transmit.sendBeacon(url, new Blob([options.body]));
51500
+ const result = this.pluginAPI.transmit.sendBeacon(url, new Blob([options.body]));
51364
51501
  return result ? Promise$2.resolve() : Promise$2.reject(new Error('sendBeacon failed to send devlog data'));
51365
51502
  }
51366
51503
  else {
51367
51504
  return this.pendo.ajax.post(url, options.body);
51368
51505
  }
51369
- };
51370
- DevlogTransport.prototype.sendRequestWithPost = function (_a, isUnload) {
51371
- var url = _a.url, jzb = _a.jzb;
51372
- var jwtOptions = this.pluginAPI.agent.getJwtInfoCopy();
51373
- var bodyPayload = {
51506
+ }
51507
+ sendRequestWithPost({ url, jzb }, isUnload) {
51508
+ const jwtOptions = this.pluginAPI.agent.getJwtInfoCopy();
51509
+ const bodyPayload = {
51374
51510
  events: jzb,
51375
51511
  browser_time: this.pluginAPI.util.getNow()
51376
51512
  };
51377
51513
  if (this.pluginAPI.agent.treatAsAdoptPartner()) {
51378
51514
  this.pluginAPI.agent.addAccountIdParams(bodyPayload, this.pendo.get_account_id(), this.pluginAPI.ConfigReader.get('oemAccountId'));
51379
51515
  }
51380
- var body = JSON.stringify(this.pendo._.extend(bodyPayload, jwtOptions));
51516
+ const body = JSON.stringify(this.pendo._.extend(bodyPayload, jwtOptions));
51381
51517
  return this.post(url, {
51382
- body: body,
51518
+ body,
51383
51519
  headers: {
51384
51520
  'Content-Type': 'application/json'
51385
51521
  },
51386
51522
  keepalive: isUnload
51387
51523
  });
51388
- };
51389
- DevlogTransport.prototype.sendRequest = function (_a, isUnload) {
51390
- var url = _a.url, jzb = _a.jzb;
51391
- var compressedLength = jzb.length;
51524
+ }
51525
+ sendRequest({ url, jzb }, isUnload) {
51526
+ const compressedLength = jzb.length;
51392
51527
  if (compressedLength <= this.pluginAPI.constants.ENCODED_EVENT_MAX_LENGTH && !this.pluginAPI.ConfigReader.get('sendEventsWithPostOnly')) {
51393
- return this.sendRequestWithGet({ url: url, jzb: jzb });
51528
+ return this.sendRequestWithGet({ url, jzb });
51394
51529
  }
51395
- return this.sendRequestWithPost({ url: url, jzb: jzb }, isUnload);
51396
- };
51397
- return DevlogTransport;
51398
- }());
51530
+ return this.sendRequestWithPost({ url, jzb }, isUnload);
51531
+ }
51532
+ }
51399
51533
 
51400
51534
  function ConsoleCapture() {
51401
- var pluginAPI;
51402
- var _;
51403
- var globalPendo;
51404
- var buffer;
51405
- var sendQueue;
51406
- var sendInterval;
51407
- var transport;
51408
- var isPtmPaused;
51409
- var isCapturingConsoleLogs = false;
51410
- var CAPTURE_CONSOLE_CONFIG = 'captureConsoleLogs';
51411
- var CONSOLE_METHODS = ['log', 'warn', 'error', 'info'];
51412
- var DEV_LOG_SUB_TYPE = 'console';
51535
+ let pluginAPI;
51536
+ let _;
51537
+ let globalPendo;
51538
+ let buffer;
51539
+ let sendQueue;
51540
+ let sendInterval;
51541
+ let transport;
51542
+ let isPtmPaused;
51543
+ let isCapturingConsoleLogs = false;
51544
+ const CAPTURE_CONSOLE_CONFIG = 'captureConsoleLogs';
51545
+ const CONSOLE_METHODS = ['log', 'warn', 'error', 'info'];
51546
+ const DEV_LOG_SUB_TYPE = 'console';
51413
51547
  // deduplicate logs
51414
- var lastLogKey = '';
51548
+ let lastLogKey = '';
51415
51549
  return {
51416
51550
  name: 'ConsoleCapture',
51417
- initialize: initialize,
51418
- teardown: teardown,
51419
- addIntercepts: addIntercepts,
51420
- createConsoleEvent: createConsoleEvent,
51421
- captureStackTrace: captureStackTrace,
51422
- send: send,
51423
- setCaptureState: setCaptureState,
51424
- recordingStarted: recordingStarted,
51425
- recordingStopped: recordingStopped,
51426
- onAppHidden: onAppHidden,
51427
- onAppUnloaded: onAppUnloaded,
51428
- onPtmPaused: onPtmPaused,
51429
- onPtmUnpaused: onPtmUnpaused,
51430
- securityPolicyViolationFn: securityPolicyViolationFn,
51551
+ initialize,
51552
+ teardown,
51553
+ addIntercepts,
51554
+ createConsoleEvent,
51555
+ captureStackTrace,
51556
+ send,
51557
+ setCaptureState,
51558
+ recordingStarted,
51559
+ recordingStopped,
51560
+ onAppHidden,
51561
+ onAppUnloaded,
51562
+ onPtmPaused,
51563
+ onPtmUnpaused,
51564
+ securityPolicyViolationFn,
51431
51565
  get isCapturingConsoleLogs() {
51432
51566
  return isCapturingConsoleLogs;
51433
51567
  },
@@ -51444,16 +51578,16 @@ function ConsoleCapture() {
51444
51578
  function initialize(pendo, PluginAPI) {
51445
51579
  _ = pendo._;
51446
51580
  pluginAPI = PluginAPI;
51447
- var ConfigReader = pluginAPI.ConfigReader;
51581
+ const { ConfigReader } = pluginAPI;
51448
51582
  ConfigReader.addOption(CAPTURE_CONSOLE_CONFIG, [ConfigReader.sources.PENDO_CONFIG_SRC], false);
51449
- var captureConsoleEnabled = ConfigReader.get(CAPTURE_CONSOLE_CONFIG);
51583
+ const captureConsoleEnabled = ConfigReader.get(CAPTURE_CONSOLE_CONFIG);
51450
51584
  if (!captureConsoleEnabled)
51451
51585
  return;
51452
51586
  globalPendo = pendo;
51453
51587
  buffer = new DevlogBuffer(pendo, pluginAPI);
51454
51588
  transport = new DevlogTransport(pendo, pluginAPI);
51455
51589
  sendQueue = new pluginAPI.SendQueue(transport.sendRequest.bind(transport));
51456
- sendInterval = setInterval(function () {
51590
+ sendInterval = setInterval(() => {
51457
51591
  if (!sendQueue.failed()) {
51458
51592
  send();
51459
51593
  }
@@ -51479,19 +51613,17 @@ function ConsoleCapture() {
51479
51613
  function onPtmUnpaused() {
51480
51614
  isPtmPaused = false;
51481
51615
  if (!buffer.isEmpty()) {
51482
- for (var _i = 0, _a = buffer.events; _i < _a.length; _i++) {
51483
- var event_1 = _a[_i];
51484
- pluginAPI.Events.eventCaptured.trigger(event_1);
51616
+ for (const event of buffer.events) {
51617
+ pluginAPI.Events.eventCaptured.trigger(event);
51485
51618
  }
51486
51619
  send();
51487
51620
  }
51488
51621
  }
51489
- function setCaptureState(_a) {
51490
- var _b = _a === void 0 ? {} : _a, _c = _b.shouldCapture, shouldCapture = _c === void 0 ? false : _c, _d = _b.reason, reason = _d === void 0 ? '' : _d;
51622
+ function setCaptureState({ shouldCapture = false, reason = '' } = {}) {
51491
51623
  if (shouldCapture === isCapturingConsoleLogs)
51492
51624
  return;
51493
51625
  isCapturingConsoleLogs = shouldCapture;
51494
- pluginAPI.log.info("[ConsoleCapture] Console log capture ".concat(shouldCapture ? 'started' : 'stopped').concat(reason ? ": ".concat(reason) : ''));
51626
+ pluginAPI.log.info(`[ConsoleCapture] Console log capture ${shouldCapture ? 'started' : 'stopped'}${reason ? `: ${reason}` : ''}`);
51495
51627
  }
51496
51628
  function recordingStarted() {
51497
51629
  setCaptureState({ shouldCapture: true, reason: 'recording started' });
@@ -51511,12 +51643,12 @@ function ConsoleCapture() {
51511
51643
  }
51512
51644
  function addIntercepts() {
51513
51645
  _.each(CONSOLE_METHODS, function (methodName) {
51514
- var originalMethod = console[methodName];
51646
+ const originalMethod = console[methodName];
51515
51647
  if (!originalMethod)
51516
51648
  return;
51517
51649
  console[methodName] = _.wrap(originalMethod, function (originalFn) {
51518
51650
  // slice 1 to omit originalFn
51519
- var args = _.toArray(arguments).slice(1);
51651
+ const args = _.toArray(arguments).slice(1);
51520
51652
  originalFn.apply(console, args);
51521
51653
  createConsoleEvent(args, methodName);
51522
51654
  });
@@ -51528,10 +51660,10 @@ function ConsoleCapture() {
51528
51660
  function securityPolicyViolationFn(evt) {
51529
51661
  if (!evt || typeof evt !== 'object')
51530
51662
  return;
51531
- var blockedURI = evt.blockedURI, violatedDirective = evt.violatedDirective, effectiveDirective = evt.effectiveDirective, disposition = evt.disposition, originalPolicy = evt.originalPolicy;
51532
- var directive = violatedDirective || effectiveDirective;
51533
- var isReportOnly = disposition === 'report';
51534
- var message = createCspViolationMessage(blockedURI, directive, isReportOnly, originalPolicy);
51663
+ const { blockedURI, violatedDirective, effectiveDirective, disposition, originalPolicy } = evt;
51664
+ const directive = violatedDirective || effectiveDirective;
51665
+ const isReportOnly = disposition === 'report';
51666
+ const message = createCspViolationMessage(blockedURI, directive, isReportOnly, originalPolicy);
51535
51667
  if (isReportOnly) {
51536
51668
  createConsoleEvent([message], 'warn', { skipStackTrace: true, skipScrubPII: true });
51537
51669
  }
@@ -51539,13 +51671,12 @@ function ConsoleCapture() {
51539
51671
  createConsoleEvent([message], 'error', { skipStackTrace: true, skipScrubPII: true });
51540
51672
  }
51541
51673
  }
51542
- function createConsoleEvent(args, methodName, _a) {
51543
- var _b = _a === void 0 ? {} : _a, _c = _b.skipStackTrace, skipStackTrace = _c === void 0 ? false : _c, _d = _b.skipScrubPII, skipScrubPII = _d === void 0 ? false : _d;
51674
+ function createConsoleEvent(args, methodName, { skipStackTrace = false, skipScrubPII = false } = {}) {
51544
51675
  if (!isCapturingConsoleLogs || !args || args.length === 0 || !_.contains(CONSOLE_METHODS, methodName))
51545
51676
  return;
51546
51677
  // stringify args
51547
- var message = _.compact(_.map(args, function (arg) {
51548
- var stringifiedArg;
51678
+ let message = _.compact(_.map(args, arg => {
51679
+ let stringifiedArg;
51549
51680
  try {
51550
51681
  stringifiedArg = stringify(arg);
51551
51682
  }
@@ -51557,22 +51688,22 @@ function ConsoleCapture() {
51557
51688
  if (!message)
51558
51689
  return;
51559
51690
  // capture stack trace
51560
- var stackTrace = '';
51691
+ let stackTrace = '';
51561
51692
  if (!skipStackTrace) {
51562
- var maxStackFrames = methodName === 'error' ? 4 : 1;
51693
+ const maxStackFrames = methodName === 'error' ? 4 : 1;
51563
51694
  stackTrace = captureStackTrace(maxStackFrames);
51564
51695
  }
51565
51696
  // truncate message and stack trace
51566
51697
  message = truncate(message);
51567
51698
  stackTrace = truncate(stackTrace);
51568
51699
  // de-duplicate log
51569
- var logKey = generateLogKey(methodName, message, stackTrace);
51700
+ const logKey = generateLogKey(methodName, message, stackTrace);
51570
51701
  if (isExistingDuplicateLog(logKey)) {
51571
51702
  buffer.lastEvent.devLogCount++;
51572
51703
  return;
51573
51704
  }
51574
- var devLogEnvelope = createDevLogEnvelope(pluginAPI, globalPendo);
51575
- var consoleEvent = __assign(__assign({}, devLogEnvelope), { subType: DEV_LOG_SUB_TYPE, devLogLevel: methodName === 'log' ? 'info' : methodName, devLogMessage: skipScrubPII ? message : scrubPII({ string: message, _: _ }), devLogTrace: stackTrace, devLogCount: 1 });
51705
+ const devLogEnvelope = createDevLogEnvelope(pluginAPI, globalPendo);
51706
+ const consoleEvent = Object.assign(Object.assign({}, devLogEnvelope), { subType: DEV_LOG_SUB_TYPE, devLogLevel: methodName === 'log' ? 'info' : methodName, devLogMessage: skipScrubPII ? message : scrubPII({ string: message, _ }), devLogTrace: stackTrace, devLogCount: 1 });
51576
51707
  if (!buffer.hasTokenAvailable())
51577
51708
  return consoleEvent;
51578
51709
  if (!isPtmPaused) {
@@ -51584,8 +51715,8 @@ function ConsoleCapture() {
51584
51715
  }
51585
51716
  function captureStackTrace(maxStackFrames) {
51586
51717
  try {
51587
- var stackFrames = ErrorStackParser.parse(new Error(), maxStackFrames);
51588
- return _.map(stackFrames, function (frame) { return frame.toString(); }).join('\n');
51718
+ const stackFrames = ErrorStackParser.parse(new Error(), maxStackFrames);
51719
+ return _.map(stackFrames, frame => frame.toString()).join('\n');
51589
51720
  }
51590
51721
  catch (error) {
51591
51722
  return '';
@@ -51597,22 +51728,21 @@ function ConsoleCapture() {
51597
51728
  function updateLastLog(logKey) {
51598
51729
  lastLogKey = logKey;
51599
51730
  }
51600
- function send(_a) {
51601
- var _b = _a === void 0 ? {} : _a, _c = _b.unload, unload = _c === void 0 ? false : _c, _d = _b.hidden, hidden = _d === void 0 ? false : _d;
51731
+ function send({ unload = false, hidden = false } = {}) {
51602
51732
  if (!buffer || buffer.isEmpty())
51603
51733
  return;
51604
51734
  if (!globalPendo.isSendingEvents()) {
51605
51735
  buffer.clear();
51606
51736
  return;
51607
51737
  }
51608
- var payloads = buffer.pack();
51738
+ const payloads = buffer.pack();
51609
51739
  if (!payloads || payloads.length === 0)
51610
51740
  return;
51611
51741
  if (unload || hidden) {
51612
51742
  sendQueue.drain(payloads, unload);
51613
51743
  }
51614
51744
  else {
51615
- sendQueue.push.apply(sendQueue, payloads);
51745
+ sendQueue.push(...payloads);
51616
51746
  }
51617
51747
  }
51618
51748
  function teardown() {
@@ -51636,7 +51766,7 @@ function ConsoleCapture() {
51636
51766
  _.each(CONSOLE_METHODS, function (methodName) {
51637
51767
  if (!console[methodName])
51638
51768
  return _.noop;
51639
- var unwrap = console[methodName]._pendoUnwrap;
51769
+ const unwrap = console[methodName]._pendoUnwrap;
51640
51770
  if (_.isFunction(unwrap)) {
51641
51771
  unwrap();
51642
51772
  }
@@ -52042,20 +52172,18 @@ function NetworkCapture() {
52042
52172
  }
52043
52173
  }
52044
52174
 
52045
- var PREDICT_STEP_REGEX = /\$\$predict\$\$/;
52046
- var DRAG_THRESHOLD = 5;
52047
- var STYLE_ID = 'pendo-predict-plugin-styles';
52048
- var PREDICT_BASE_URL = 'https://predict.pendo.io';
52049
- var GUIDE_BUTTON_IDENTIFIER = 'button:contains("token")';
52050
- var pluginVersion = '1.0.1';
52051
- var $ = function (id) { return document.getElementById(id); };
52052
- var createElement = function (tag, attrs, parent) {
52053
- if (attrs === void 0) { attrs = {}; }
52054
- if (parent === void 0) { parent = null; }
52055
- var el = document.createElement(tag);
52056
- var entries = Object.entries(attrs);
52057
- for (var i = 0; i < entries.length; i++) {
52058
- var _a = entries[i], key = _a[0], value = _a[1];
52175
+ const PREDICT_STEP_REGEX = /\$\$predict\$\$/;
52176
+ const DRAG_THRESHOLD = 5;
52177
+ const STYLE_ID = 'pendo-predict-plugin-styles';
52178
+ const PREDICT_BASE_URL = 'https://predict.pendo.io';
52179
+ const GUIDE_BUTTON_IDENTIFIER = 'button:contains("token")';
52180
+ const pluginVersion = '1.0.1';
52181
+ const $ = (id) => document.getElementById(id);
52182
+ const createElement = (tag, attrs = {}, parent = null) => {
52183
+ const el = document.createElement(tag);
52184
+ const entries = Object.entries(attrs);
52185
+ for (let i = 0; i < entries.length; i++) {
52186
+ const [key, value] = entries[i];
52059
52187
  if (key === 'className')
52060
52188
  el.className = value;
52061
52189
  else if (key === 'innerHTML')
@@ -52067,28 +52195,69 @@ var createElement = function (tag, attrs, parent) {
52067
52195
  parent.appendChild(el);
52068
52196
  return el;
52069
52197
  };
52070
- var injectStyles = function (pendoContainerId, log) {
52071
- if (log === void 0) { log = function () { }; }
52072
- var styleId = "".concat(STYLE_ID, "-").concat(pendoContainerId);
52198
+ const injectStyles = (pendoContainerId, log = () => { }) => {
52199
+ const styleId = `${STYLE_ID}-${pendoContainerId}`;
52073
52200
  if ($(styleId)) {
52074
- log("[predict] style already exists, skipping: ".concat(styleId));
52201
+ log(`[predict] style already exists, skipping: ${styleId}`);
52075
52202
  return;
52076
52203
  }
52077
- log("[predict] injecting styles: ".concat(styleId));
52204
+ log(`[predict] injecting styles: ${styleId}`);
52078
52205
  createElement('style', {
52079
52206
  id: styleId,
52080
- textContent: "\n #".concat(pendoContainerId, " {\n display: none !important;\n }\n .frame-explanation {\n aspect-ratio: 16/9; overflow: hidden; min-height: 300px;\n width: 100vw; height: 100vh; background: transparent;\n position: fixed; bottom: 0; right: 0; z-index: 999999; border: none;\n visibility: hidden; opacity: 0; pointer-events: none;\n transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;\n display: none;\n }\n .frame-explanation.is-visible {\n visibility: visible; opacity: 1; pointer-events: auto;\n transition: opacity 0.1s ease-out, visibility 0s linear 0s;\n }\n .frame-explanation.is-exists {\n display: block !important;\n }\n .floating-modal-container {\n position: fixed; top: 20px; right: 20px; z-index: 500000;\n visibility: hidden; opacity: 0; pointer-events: none;\n transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;\n border-radius: 8px; box-shadow: 0px 4px 12px 0px rgba(0,0,0,0.15);\n overflow: hidden; width: 384px; height: 176px;\n }\n .floating-modal-container.is-visible {\n visibility: visible; opacity: 1; pointer-events: auto;\n transition: opacity 0.1s ease-out, visibility 0s linear 0s;\n }\n .floating-modal-container.is-dragging { will-change: left, top; }\n .floating-modal-drag-handle {\n position: absolute; left: 50%; transform: translateX(-50%);\n top: 5px; width: calc(100% - 46px); min-width: 166px; height: 17px;\n z-index: 9999; transition: left 0.2s ease, right 0.2s ease;\n display: flex; justify-content: center; align-items: center;\n }\n .floating-modal-drag-handle svg g { fill: #A0A0A0; }\n .floating-modal-drag-handle:hover { cursor: grab; }\n .floating-modal-drag-handle:hover svg g { fill: #1f2937; }\n .floating-modal-drag-handle.is-dragging { cursor: grabbing; }\n .floating-modal-drag-handle.is-collapsed { top: 0px; }\n .frame-floating-modal { width: 100%; height: 100%; background: white; border: none; display: block; }\n ")
52207
+ textContent: `
52208
+ #${pendoContainerId} {
52209
+ display: none !important;
52210
+ }
52211
+ .frame-explanation {
52212
+ aspect-ratio: 16/9; overflow: hidden; min-height: 300px;
52213
+ width: 100vw; height: 100vh; background: transparent;
52214
+ position: fixed; bottom: 0; right: 0; z-index: 999999; border: none;
52215
+ visibility: hidden; opacity: 0; pointer-events: none;
52216
+ transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;
52217
+ display: none;
52218
+ }
52219
+ .frame-explanation.is-visible {
52220
+ visibility: visible; opacity: 1; pointer-events: auto;
52221
+ transition: opacity 0.1s ease-out, visibility 0s linear 0s;
52222
+ }
52223
+ .frame-explanation.is-exists {
52224
+ display: block !important;
52225
+ }
52226
+ .floating-modal-container {
52227
+ position: fixed; top: 20px; right: 20px; z-index: 500000;
52228
+ visibility: hidden; opacity: 0; pointer-events: none;
52229
+ transition: opacity 0.1s ease-out, visibility 0s linear 0.1s;
52230
+ border-radius: 8px; box-shadow: 0px 4px 12px 0px rgba(0,0,0,0.15);
52231
+ overflow: hidden; width: 384px; height: 176px;
52232
+ }
52233
+ .floating-modal-container.is-visible {
52234
+ visibility: visible; opacity: 1; pointer-events: auto;
52235
+ transition: opacity 0.1s ease-out, visibility 0s linear 0s;
52236
+ }
52237
+ .floating-modal-container.is-dragging { will-change: left, top; }
52238
+ .floating-modal-drag-handle {
52239
+ position: absolute; left: 50%; transform: translateX(-50%);
52240
+ top: 5px; width: calc(100% - 46px); min-width: 166px; height: 17px;
52241
+ z-index: 9999; transition: left 0.2s ease, right 0.2s ease;
52242
+ display: flex; justify-content: center; align-items: center;
52243
+ }
52244
+ .floating-modal-drag-handle svg g { fill: #A0A0A0; }
52245
+ .floating-modal-drag-handle:hover { cursor: grab; }
52246
+ .floating-modal-drag-handle:hover svg g { fill: #1f2937; }
52247
+ .floating-modal-drag-handle.is-dragging { cursor: grabbing; }
52248
+ .floating-modal-drag-handle.is-collapsed { top: 0px; }
52249
+ .frame-floating-modal { width: 100%; height: 100%; background: white; border: none; display: block; }
52250
+ `
52081
52251
  }, document.head);
52082
52252
  };
52083
- var getRecordIdFromUrl = function (recordRegex, log) {
52253
+ const getRecordIdFromUrl = (recordRegex, log = () => { }) => {
52084
52254
  var _a;
52085
- if (log === void 0) { log = function () { }; }
52086
- var match = window.location.href.match(recordRegex);
52087
- var recordId = (_a = match === null || match === void 0 ? void 0 : match[1]) !== null && _a !== void 0 ? _a : null;
52088
- log("[predict] recordId found: ".concat(recordId));
52255
+ const match = window.location.href.match(recordRegex);
52256
+ const recordId = (_a = match === null || match === void 0 ? void 0 : match[1]) !== null && _a !== void 0 ? _a : null;
52257
+ log(`[predict] recordId found: ${recordId}`);
52089
52258
  return recordId;
52090
52259
  };
52091
- var safeStringify = function (value, fallback) {
52260
+ const safeStringify = (value, fallback) => {
52092
52261
  try {
52093
52262
  return JSON.stringify(value);
52094
52263
  }
@@ -52096,22 +52265,21 @@ var safeStringify = function (value, fallback) {
52096
52265
  return fallback !== null && fallback !== void 0 ? fallback : '';
52097
52266
  }
52098
52267
  };
52099
- var safeParse = function (value, fallback, log) {
52100
- if (log === void 0) { log = function () { }; }
52268
+ const safeParse = (value, fallback, log = () => { }) => {
52101
52269
  try {
52102
52270
  return JSON.parse(value);
52103
52271
  }
52104
52272
  catch (error) {
52105
- log("[predict] JSON parse error: ".concat(error));
52273
+ log(`[predict] JSON parse error: ${error}`);
52106
52274
  return fallback;
52107
52275
  }
52108
52276
  };
52109
- var buildQueryParams = function (params) {
52110
- var urlParams = new URLSearchParams();
52111
- var entries = Object.entries(params);
52277
+ const buildQueryParams = (params) => {
52278
+ const urlParams = new URLSearchParams();
52279
+ const entries = Object.entries(params);
52112
52280
  urlParams.set('pluginVersion', pluginVersion);
52113
- for (var i = 0; i < entries.length; i++) {
52114
- var _a = entries[i], key = _a[0], value = _a[1];
52281
+ for (let i = 0; i < entries.length; i++) {
52282
+ const [key, value] = entries[i];
52115
52283
  if (value != null) {
52116
52284
  urlParams.set(key, typeof value === 'object' ? safeStringify(value) : String(value));
52117
52285
  }
@@ -52119,17 +52287,17 @@ var buildQueryParams = function (params) {
52119
52287
  return urlParams.toString();
52120
52288
  };
52121
52289
  // ----- Drag & Drop -----
52122
- var setupDragAndDrop = function (handle, container) {
52123
- var isDragging = false;
52124
- var hasMoved = false;
52125
- var isCollapsed = false;
52126
- var startX = 0;
52127
- var startY = 0;
52128
- var initialLeft = 0;
52129
- var initialTop = 0;
52130
- var rafId = null;
52131
- var iframe = container.querySelector('iframe');
52132
- var onMouseDown = function (e) {
52290
+ const setupDragAndDrop = (handle, container) => {
52291
+ let isDragging = false;
52292
+ let hasMoved = false;
52293
+ let isCollapsed = false;
52294
+ let startX = 0;
52295
+ let startY = 0;
52296
+ let initialLeft = 0;
52297
+ let initialTop = 0;
52298
+ let rafId = null;
52299
+ const iframe = container.querySelector('iframe');
52300
+ const onMouseDown = (e) => {
52133
52301
  if (e.button !== 0)
52134
52302
  return;
52135
52303
  e.preventDefault();
@@ -52139,35 +52307,35 @@ var setupDragAndDrop = function (handle, container) {
52139
52307
  container.classList.add('is-dragging');
52140
52308
  if (iframe)
52141
52309
  iframe.style.pointerEvents = 'none';
52142
- var rect = container.getBoundingClientRect();
52310
+ const rect = container.getBoundingClientRect();
52143
52311
  initialLeft = rect.left;
52144
52312
  initialTop = rect.top;
52145
- container.style.left = "".concat(initialLeft, "px");
52313
+ container.style.left = `${initialLeft}px`;
52146
52314
  container.style.right = 'auto';
52147
52315
  startX = e.clientX;
52148
52316
  startY = e.clientY;
52149
52317
  document.addEventListener('mousemove', onMouseMove);
52150
52318
  document.addEventListener('mouseup', onMouseUp);
52151
52319
  };
52152
- var onMouseMove = function (e) {
52320
+ const onMouseMove = (e) => {
52153
52321
  if (!isDragging)
52154
52322
  return;
52155
- var deltaX = e.clientX - startX;
52156
- var deltaY = e.clientY - startY;
52323
+ const deltaX = e.clientX - startX;
52324
+ const deltaY = e.clientY - startY;
52157
52325
  if (Math.abs(deltaX) > DRAG_THRESHOLD || Math.abs(deltaY) > DRAG_THRESHOLD) {
52158
52326
  hasMoved = true;
52159
52327
  }
52160
52328
  if (rafId)
52161
52329
  cancelAnimationFrame(rafId);
52162
- rafId = requestAnimationFrame(function () {
52163
- var rect = container.getBoundingClientRect();
52164
- var newLeft = Math.max(0, Math.min(initialLeft + deltaX, window.innerWidth - rect.width));
52165
- var newTop = Math.max(0, Math.min(initialTop + deltaY, window.innerHeight - rect.height));
52166
- container.style.left = "".concat(newLeft, "px");
52167
- container.style.top = "".concat(newTop, "px");
52330
+ rafId = requestAnimationFrame(() => {
52331
+ const rect = container.getBoundingClientRect();
52332
+ const newLeft = Math.max(0, Math.min(initialLeft + deltaX, window.innerWidth - rect.width));
52333
+ const newTop = Math.max(0, Math.min(initialTop + deltaY, window.innerHeight - rect.height));
52334
+ container.style.left = `${newLeft}px`;
52335
+ container.style.top = `${newTop}px`;
52168
52336
  });
52169
52337
  };
52170
- var onMouseUp = function (e) {
52338
+ const onMouseUp = (e) => {
52171
52339
  var _a;
52172
52340
  if (!isDragging)
52173
52341
  return;
@@ -52185,12 +52353,12 @@ var setupDragAndDrop = function (handle, container) {
52185
52353
  (_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage({ type: 'TRIGGER_EXPAND' }, PREDICT_BASE_URL);
52186
52354
  }
52187
52355
  };
52188
- handle.setCollapsedState = function (collapsed) {
52356
+ handle.setCollapsedState = (collapsed) => {
52189
52357
  isCollapsed = collapsed;
52190
52358
  handle.classList.toggle('is-collapsed', collapsed);
52191
52359
  };
52192
52360
  handle.addEventListener('mousedown', onMouseDown);
52193
- handle.cleanup = function () {
52361
+ handle.cleanup = () => {
52194
52362
  handle.removeEventListener('mousedown', onMouseDown);
52195
52363
  document.removeEventListener('mousemove', onMouseMove);
52196
52364
  document.removeEventListener('mouseup', onMouseUp);
@@ -52200,13 +52368,12 @@ var setupDragAndDrop = function (handle, container) {
52200
52368
  return handle;
52201
52369
  };
52202
52370
  // ----- Explanation Iframe Creation -----
52203
- var createExplanationIframe = function (_a) {
52204
- var _b;
52205
- var analysisId = _a.analysisId, recordId = _a.recordId, configuration = _a.configuration;
52206
- var frameId = "frameExplanation-".concat(analysisId);
52207
- (_b = $(frameId)) === null || _b === void 0 ? void 0 : _b.remove();
52208
- var base = "".concat(PREDICT_BASE_URL, "/external/analysis/").concat(analysisId, "/prediction/drilldown/").concat(recordId);
52209
- var params = buildQueryParams(configuration);
52371
+ const createExplanationIframe = ({ analysisId, recordId, configuration }) => {
52372
+ var _a;
52373
+ const frameId = `frameExplanation-${analysisId}`;
52374
+ (_a = $(frameId)) === null || _a === void 0 ? void 0 : _a.remove();
52375
+ const base = `${PREDICT_BASE_URL}/external/analysis/${analysisId}/prediction/drilldown/${recordId}`;
52376
+ const params = buildQueryParams(configuration);
52210
52377
  createElement('iframe', {
52211
52378
  id: frameId,
52212
52379
  className: 'frame-explanation',
@@ -52214,24 +52381,28 @@ var createExplanationIframe = function (_a) {
52214
52381
  loading: 'lazy',
52215
52382
  referrerPolicy: 'strict-origin-when-cross-origin',
52216
52383
  allowFullscreen: true,
52217
- src: "".concat(base, "?").concat(params)
52384
+ src: `${base}?${params}`
52218
52385
  }, document.body);
52219
52386
  };
52220
52387
  // ----- Floating Modal Creation -----
52221
- var createFloatingModal = function (_a) {
52222
- var _b;
52223
- var recordId = _a.recordId, configuration = _a.configuration;
52224
- var flatIds = (_b = configuration.analysisIds) === null || _b === void 0 ? void 0 : _b.flat(Infinity);
52225
- for (var i = 0; i < flatIds.length; i++) {
52226
- createExplanationIframe({ analysisId: flatIds[i], recordId: recordId, configuration: configuration });
52227
- }
52228
- var container = createElement('div', { id: 'floatingModalContainer', className: 'floating-modal-container' }, document.body);
52229
- var dragHandle = createElement('div', {
52388
+ const createFloatingModal = ({ recordId, configuration }) => {
52389
+ var _a;
52390
+ const flatIds = (_a = configuration.analysisIds) === null || _a === void 0 ? void 0 : _a.flat(Infinity);
52391
+ for (let i = 0; i < flatIds.length; i++) {
52392
+ createExplanationIframe({ analysisId: flatIds[i], recordId, configuration });
52393
+ }
52394
+ const container = createElement('div', { id: 'floatingModalContainer', className: 'floating-modal-container' }, document.body);
52395
+ const dragHandle = createElement('div', {
52230
52396
  className: 'floating-modal-drag-handle',
52231
- innerHTML: "<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\">\n <g fill=\"#EBEBEB\">\n <circle cx=\"3.33\" cy=\"6\" r=\"1.5\"/><circle cx=\"8\" cy=\"6\" r=\"1.5\"/><circle cx=\"12.67\" cy=\"6\" r=\"1.5\"/>\n <circle cx=\"3.33\" cy=\"10\" r=\"1.5\"/><circle cx=\"8\" cy=\"10\" r=\"1.5\"/><circle cx=\"12.67\" cy=\"10\" r=\"1.5\"/>\n </g>\n </svg>"
52397
+ innerHTML: `<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
52398
+ <g fill="#EBEBEB">
52399
+ <circle cx="3.33" cy="6" r="1.5"/><circle cx="8" cy="6" r="1.5"/><circle cx="12.67" cy="6" r="1.5"/>
52400
+ <circle cx="3.33" cy="10" r="1.5"/><circle cx="8" cy="10" r="1.5"/><circle cx="12.67" cy="10" r="1.5"/>
52401
+ </g>
52402
+ </svg>`
52232
52403
  }, container);
52233
- var baseUrl = "".concat(PREDICT_BASE_URL, "/external/analysis/prediction/summary/").concat(recordId);
52234
- var params = buildQueryParams(configuration);
52404
+ const baseUrl = `${PREDICT_BASE_URL}/external/analysis/prediction/summary/${recordId}`;
52405
+ const params = buildQueryParams(configuration);
52235
52406
  createElement('iframe', {
52236
52407
  id: 'frameFloatingModal',
52237
52408
  className: 'frame-floating-modal',
@@ -52239,136 +52410,133 @@ var createFloatingModal = function (_a) {
52239
52410
  referrerPolicy: 'strict-origin-when-cross-origin',
52240
52411
  allowFullscreen: true,
52241
52412
  title: 'Floating Modal',
52242
- src: "".concat(baseUrl, "?").concat(params)
52413
+ src: `${baseUrl}?${params}`
52243
52414
  }, container);
52244
52415
  container.dragHandle = setupDragAndDrop(dragHandle, container);
52245
- return function () {
52416
+ return () => {
52246
52417
  var _a, _b;
52247
52418
  (_b = (_a = container.dragHandle) === null || _a === void 0 ? void 0 : _a.cleanup) === null || _b === void 0 ? void 0 : _b.call(_a);
52248
52419
  container.remove();
52249
- for (var i = 0; i < flatIds.length; i++) {
52250
- var frame = $("frameExplanation-".concat(flatIds[i]));
52420
+ for (let i = 0; i < flatIds.length; i++) {
52421
+ const frame = $(`frameExplanation-${flatIds[i]}`);
52251
52422
  if (frame)
52252
52423
  frame.remove();
52253
52424
  }
52254
52425
  };
52255
52426
  };
52256
- var setupMessageListener = function (_a) {
52257
- var token = _a.token, forceAccountId = _a.forceAccountId, cleanup = _a.cleanup, pendo = _a.pendo;
52258
- var messageHandler = function (_a) {
52259
- var _b;
52260
- var origin = _a.origin, data = _a.data;
52427
+ const setupMessageListener = ({ token, forceAccountId, cleanup, pendo }) => {
52428
+ const messageHandler = ({ origin, data }) => {
52429
+ var _a;
52261
52430
  if (origin !== PREDICT_BASE_URL || !data || typeof data !== 'object')
52262
52431
  return;
52263
- var _c = data, type = _c.type, analysisId = _c.analysisId, height = _c.height, width = _c.width;
52264
- var explanationFrame = $("frameExplanation-".concat(analysisId));
52265
- var floatingModal = $('floatingModalContainer');
52266
- var setFloatingModalSize = function () {
52432
+ const { type, analysisId, height, width } = data;
52433
+ const explanationFrame = $(`frameExplanation-${analysisId}`);
52434
+ const floatingModal = $('floatingModalContainer');
52435
+ const setFloatingModalSize = () => {
52267
52436
  if (floatingModal) {
52268
- floatingModal.style.height = "".concat(height, "px");
52269
- floatingModal.style.width = "".concat(width, "px");
52437
+ floatingModal.style.height = `${height}px`;
52438
+ floatingModal.style.width = `${width}px`;
52270
52439
  }
52271
52440
  };
52272
- var setFloatingModalCollapsedState = function (collapsed) {
52441
+ const setFloatingModalCollapsedState = (collapsed) => {
52273
52442
  var _a, _b;
52274
52443
  if (floatingModal)
52275
52444
  (_b = (_a = floatingModal.dragHandle) === null || _a === void 0 ? void 0 : _a.setCollapsedState) === null || _b === void 0 ? void 0 : _b.call(_a, collapsed);
52276
52445
  };
52277
- var actions = {
52278
- MODAL_INITIALIZED: function () {
52446
+ const actions = {
52447
+ MODAL_INITIALIZED: () => {
52279
52448
  var _a, _b, _c;
52280
- var iframe = $('frameFloatingModal');
52449
+ const iframe = $('frameFloatingModal');
52281
52450
  if (iframe) {
52282
- var idToken = null;
52283
- var extensionAPIKeys = null;
52284
- var retrieveIDPToken = pendo.getConfigValue('retrieveIDPToken');
52451
+ let idToken = null;
52452
+ let extensionAPIKeys = null;
52453
+ const retrieveIDPToken = pendo.getConfigValue('retrieveIDPToken');
52285
52454
  if (pendo._.isFunction(retrieveIDPToken)) {
52286
- var result = retrieveIDPToken();
52455
+ const result = retrieveIDPToken();
52287
52456
  if (result) {
52288
52457
  idToken = result.idToken;
52289
52458
  extensionAPIKeys = result.extensionAPIKeys;
52290
52459
  }
52291
52460
  }
52292
- var visitorId = (_a = pendo === null || pendo === void 0 ? void 0 : pendo.getVisitorId) === null || _a === void 0 ? void 0 : _a.call(pendo);
52293
- var accountId = forceAccountId !== null && forceAccountId !== void 0 ? forceAccountId : (_b = pendo === null || pendo === void 0 ? void 0 : pendo.getAccountId) === null || _b === void 0 ? void 0 : _b.call(pendo);
52294
- (_c = iframe.contentWindow) === null || _c === void 0 ? void 0 : _c.postMessage({ type: 'TOKEN_RECEIVED', token: token, idToken: idToken, extensionAPIKeys: extensionAPIKeys, visitorId: visitorId, accountId: accountId }, PREDICT_BASE_URL);
52461
+ const visitorId = (_a = pendo === null || pendo === void 0 ? void 0 : pendo.getVisitorId) === null || _a === void 0 ? void 0 : _a.call(pendo);
52462
+ const accountId = forceAccountId !== null && forceAccountId !== void 0 ? forceAccountId : (_b = pendo === null || pendo === void 0 ? void 0 : pendo.getAccountId) === null || _b === void 0 ? void 0 : _b.call(pendo);
52463
+ (_c = iframe.contentWindow) === null || _c === void 0 ? void 0 : _c.postMessage({ type: 'TOKEN_RECEIVED', token, idToken, extensionAPIKeys, visitorId, accountId }, PREDICT_BASE_URL);
52295
52464
  }
52296
52465
  },
52297
- OPEN_EXPLANATION: function () {
52466
+ OPEN_EXPLANATION: () => {
52298
52467
  var _a;
52299
52468
  explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.classList.add('is-visible');
52300
52469
  (_a = explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(data, PREDICT_BASE_URL);
52301
52470
  },
52302
- CLOSE_EXPLANATION: function () { return explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.classList.remove('is-visible'); },
52303
- AUTH_ERROR_EXPLANATION: function () {
52471
+ CLOSE_EXPLANATION: () => explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.classList.remove('is-visible'),
52472
+ AUTH_ERROR_EXPLANATION: () => {
52304
52473
  explanationFrame === null || explanationFrame === void 0 ? void 0 : explanationFrame.classList.remove('is-visible');
52305
- var iframe = $('frameFloatingModal');
52474
+ const iframe = $('frameFloatingModal');
52306
52475
  // eslint-disable-next-line no-self-assign
52307
52476
  if (iframe)
52308
52477
  iframe.src = iframe.src;
52309
52478
  },
52310
- DATA_READY: function () {
52479
+ DATA_READY: () => {
52311
52480
  floatingModal === null || floatingModal === void 0 ? void 0 : floatingModal.classList.add('is-visible');
52312
52481
  setFloatingModalSize();
52313
52482
  // Use analysisIds from the message data if available, otherwise use all IDs
52314
- var idsToShow = data.analysisIds || [];
52315
- for (var i = 0; i < idsToShow.length; i++) {
52316
- var frame = $("frameExplanation-".concat(idsToShow[i]));
52483
+ const idsToShow = data.analysisIds || [];
52484
+ for (let i = 0; i < idsToShow.length; i++) {
52485
+ const frame = $(`frameExplanation-${idsToShow[i]}`);
52317
52486
  if (frame)
52318
52487
  frame.classList.add('is-exists');
52319
52488
  }
52320
52489
  },
52321
- AUTH_ERROR: function () {
52490
+ AUTH_ERROR: () => {
52322
52491
  floatingModal === null || floatingModal === void 0 ? void 0 : floatingModal.classList.add('is-visible');
52323
52492
  setFloatingModalSize();
52324
52493
  },
52325
52494
  CLOSE_FLOATING_MODAL: cleanup,
52326
- EXPAND_FLOATING_MODAL: function () {
52495
+ EXPAND_FLOATING_MODAL: () => {
52327
52496
  setFloatingModalSize();
52328
52497
  setFloatingModalCollapsedState(false);
52329
52498
  },
52330
- COLLAPSE_FLOATING_MODAL: function () {
52499
+ COLLAPSE_FLOATING_MODAL: () => {
52331
52500
  setFloatingModalSize();
52332
52501
  setFloatingModalCollapsedState(true);
52333
52502
  }
52334
52503
  };
52335
52504
  if (type && type in actions) {
52336
- (_b = actions === null || actions === void 0 ? void 0 : actions[type]) === null || _b === void 0 ? void 0 : _b.call(actions);
52505
+ (_a = actions === null || actions === void 0 ? void 0 : actions[type]) === null || _a === void 0 ? void 0 : _a.call(actions);
52337
52506
  }
52338
52507
  };
52339
52508
  window.addEventListener('message', messageHandler);
52340
- return function () { return window.removeEventListener('message', messageHandler); };
52509
+ return () => window.removeEventListener('message', messageHandler);
52341
52510
  };
52342
- var predictGuidesScript = function (_a) {
52343
- var _b;
52344
- var step = _a.step, pendo = _a.pendo, cleanupArray = _a.cleanupArray, cleanup = _a.cleanup, log = _a.log;
52511
+ const predictGuidesScript = ({ step, pendo, cleanupArray, cleanup, log }) => {
52512
+ var _a;
52345
52513
  log('[predict] initializing');
52346
52514
  // Before anything else, inject styles so that the guide will be hidden
52347
- var pendoContainerId = step === null || step === void 0 ? void 0 : step.containerId;
52515
+ const pendoContainerId = step === null || step === void 0 ? void 0 : step.containerId;
52348
52516
  injectStyles(pendoContainerId, log);
52349
52517
  if (cleanupArray.length > 0) {
52350
52518
  log('[predict] cleanupArray is not empty');
52351
52519
  return;
52352
52520
  }
52353
52521
  // ----- Extract Configuration -----
52354
- var guideButton = (_b = step.guideElement.find(GUIDE_BUTTON_IDENTIFIER)) === null || _b === void 0 ? void 0 : _b[0];
52522
+ const guideButton = (_a = step.guideElement.find(GUIDE_BUTTON_IDENTIFIER)) === null || _a === void 0 ? void 0 : _a[0];
52355
52523
  if (!guideButton) {
52356
52524
  log('[predict] no guide button found, aborting');
52357
52525
  return;
52358
52526
  }
52359
- var _c = safeParse(guideButton.textContent, {}, log), token = _c.token, configuration = __rest(_c, ["token"]);
52527
+ const _b = safeParse(guideButton.textContent, {}, log), { token } = _b, configuration = __rest(_b, ["token"]);
52360
52528
  if (!configuration || !token) {
52361
52529
  log('[predict] no configuration found, aborting');
52362
52530
  return;
52363
52531
  }
52364
- var recordRegex = new RegExp("/".concat(configuration.recordRegexName, "/([a-zA-Z0-9]+)(?:/|$)"));
52365
- var recordId = getRecordIdFromUrl(recordRegex, log);
52532
+ const recordRegex = new RegExp(`/${configuration.recordRegexName}/([a-zA-Z0-9]+)(?:/|$)`);
52533
+ const recordId = getRecordIdFromUrl(recordRegex, log);
52366
52534
  if (!recordId) {
52367
52535
  log('[predict] no recordId found in URL, aborting');
52368
52536
  return;
52369
52537
  }
52370
- cleanupArray.push(setupMessageListener({ token: token, forceAccountId: configuration === null || configuration === void 0 ? void 0 : configuration.forceAccountId, cleanup: cleanup, pendo: pendo }));
52371
- cleanupArray.push(createFloatingModal({ recordId: recordId, configuration: configuration }));
52538
+ cleanupArray.push(setupMessageListener({ token, forceAccountId: configuration === null || configuration === void 0 ? void 0 : configuration.forceAccountId, cleanup, pendo }));
52539
+ cleanupArray.push(createFloatingModal({ recordId, configuration }));
52372
52540
  };
52373
52541
 
52374
52542
  const PredictGuides = () => {