@pendo/agent 2.311.1 → 2.312.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.
@@ -3924,8 +3924,8 @@ let SERVER = '';
3924
3924
  let ASSET_HOST = '';
3925
3925
  let ASSET_PATH = '';
3926
3926
  let DESIGNER_SERVER = '';
3927
- let VERSION = '2.311.1_';
3928
- let PACKAGE_VERSION = '2.311.1';
3927
+ let VERSION = '2.312.0_';
3928
+ let PACKAGE_VERSION = '2.312.0';
3929
3929
  let LOADER = 'xhr';
3930
3930
  /* eslint-enable web-sdk-eslint-rules/no-gulp-env-references */
3931
3931
  /**
@@ -11609,7 +11609,7 @@ function isTrustedOrigin(host) {
11609
11609
  return true;
11610
11610
  // Domains that Pendo owns, will be swapped in by build patches
11611
11611
  const patterns = [
11612
- /^https:\/\/(adopt\.)?((us1)\.)?(app|via|adopt|cdn)(\.(au|eu|gov|hsbc|jpn))?\.pendo\.io$/,
11612
+ /^https:\/\/(adopt\.)?((us1)\.)?(app|via|adopt|cdn|oem)(\.(au|eu|gov|hsbc|jpn))?\.pendo\.io$/,
11613
11613
  /^https:\/\/([0-9]{8}t[0-9]{4}-dot-)pendo-(au|eu|govramp|hsbc|io|jp-prod|us1)\.appspot\.com$/,
11614
11614
  /^https:\/\/hotfix-(ops|app)-([0-9]+-dot-)pendo-(au|eu|govramp|hsbc|io|jp-prod|us1)\.appspot\.com$/,
11615
11615
  /^https:\/\/pendo-(au|eu|govramp|hsbc|io|jp-prod|us1)-static\.storage\.googleapis\.com$/,
@@ -16077,6 +16077,8 @@ var BuildingBlockTemplates = (function () {
16077
16077
  var moduleStep = announcementsModule.steps[0];
16078
16078
  if (moduleStep) {
16079
16079
  syncColorMode(moduleStep, false);
16080
+ // Propagate dark mode state to announcement step for button styling CSS rules
16081
+ announcementStep.isDarkMode = moduleStep.isDarkMode;
16080
16082
  if (moduleStep.isDarkMode) {
16081
16083
  // Only apply overrides if we have actual color values to apply
16082
16084
  var hasValidOverrides = darkModeOverrides.guideBackground ||
@@ -18555,53 +18557,48 @@ function attachImgLoadHandlers(curNode, step) {
18555
18557
  recalculateGuideHeightOnImgLoad(dom(curNode), step);
18556
18558
  }
18557
18559
  }
18560
+ function imageNodeHandler(step) {
18561
+ var containerJSON = {};
18562
+ if (!step.containerId && step.domJson) {
18563
+ containerJSON = findGuideContainerJSON(step.domJson);
18564
+ }
18565
+ var containerId = step.containerId || (containerJSON.props && containerJSON.props.id) || '';
18566
+ var guideContainer = containerId ? dom(`#${containerId}`, step.guideElement)[0] : containerId;
18567
+ if (step && step.attributes && step.attributes.imgCount) {
18568
+ step.attributes.imgCount--;
18569
+ if (guideContainer && step.attributes.imgCount <= 0) {
18570
+ recalculateGuideWidth(containerId, step.guideElement);
18571
+ adjustGuideContentWidth(containerId, step.guideElement);
18572
+ FlexboxPolyfill.flexAllThings(containerId, step);
18573
+ var guide = step.getGuide();
18574
+ // calling recalculateGuideHeight with an announcement guide or Announcements Module breaks announcements display
18575
+ // in resource center
18576
+ if (!_.get(guide, 'attributes.isAnnouncement') && _.get(guide, 'attributes.resourceCenter.moduleId') !== 'AnnouncementsModule') {
18577
+ recalculateGuideHeight(containerId, step.guideElement);
18578
+ // In case a scrollbar exists, we should adjust content and flexAllThings again. APP-74827.
18579
+ var domContainer = guideContainer.children.item('pendo-guide-container');
18580
+ var containerHasOverflow = domContainer && domContainer.style && domContainer.style.overflow === 'auto';
18581
+ if (containerHasOverflow) {
18582
+ adjustGuideContentWidth(containerId, step.guideElement);
18583
+ FlexboxPolyfill.flexAllThings(step.containerId, step);
18584
+ }
18585
+ }
18586
+ BuildingBlockTooltips.positionStepForGuide(step, step.domJson, guideContainer);
18587
+ guideContainer.style.visibility = 'visible';
18588
+ guideContainer.parentNode.style.visibility = 'visible';
18589
+ dom.event.dispatch(guideContainer, {
18590
+ type: 'imagesLoaded'
18591
+ });
18592
+ }
18593
+ }
18594
+ }
18558
18595
  function recalculateGuideHeightOnImgLoad(node, step) {
18559
18596
  node.on('load', function () {
18560
- var containerJSON = {};
18561
- if (!step.containerId && step.domJson) {
18562
- containerJSON = findGuideContainerJSON(step.domJson);
18563
- }
18564
- var containerId = step.containerId || (containerJSON.props && containerJSON.props.id) || '';
18565
- var guideContainer = containerId ? dom('#' + containerId, step.guideElement)[0] : containerId;
18566
- if (step && step.attributes && step.attributes.imgCount) {
18567
- step.attributes.imgCount--;
18568
- if (guideContainer && step.attributes.imgCount <= 0) {
18569
- recalculateGuideWidth(containerId, step.guideElement);
18570
- adjustGuideContentWidth(containerId, step.guideElement);
18571
- FlexboxPolyfill.flexAllThings(containerId, step);
18572
- var guide = step.getGuide();
18573
- // calling recalculateGuideHeight with an announcement guide or Announcements Module breaks announcements display
18574
- // in resource center
18575
- if (!_.get(guide, 'attributes.isAnnouncement') && _.get(guide, 'attributes.resourceCenter.moduleId') !== 'AnnouncementsModule') {
18576
- recalculateGuideHeight(containerId, step.guideElement);
18577
- // In case a scrollbar exists, we should adjust content and flexAllThings again. APP-74827.
18578
- var domContainer = guideContainer.children.item('pendo-guide-container');
18579
- var containerHasOverflow = domContainer && domContainer.style && domContainer.style.overflow === 'auto';
18580
- if (containerHasOverflow) {
18581
- adjustGuideContentWidth(containerId, step.guideElement);
18582
- FlexboxPolyfill.flexAllThings(step.containerId, step);
18583
- }
18584
- }
18585
- BuildingBlockTooltips.positionStepForGuide(step, step.domJson, guideContainer);
18586
- guideContainer.style.visibility = 'visible';
18587
- guideContainer.parentNode.style.visibility = 'visible';
18588
- dom.event.dispatch(guideContainer, {
18589
- type: 'imagesLoaded'
18590
- });
18591
- }
18592
- }
18597
+ imageNodeHandler(step);
18593
18598
  });
18594
- // For now, we'll just automatically show the guide if an image errors.
18595
18599
  node.on('error', function () {
18596
- var guideContainer = dom('#' + step.containerId, step.guideElement)[0];
18597
- if (!guideContainer) {
18598
- log.info('Failed to find guideContainer for id: ' + step.containerId);
18599
- return;
18600
- }
18601
- BuildingBlockTooltips.positionStepForGuide(step, step.domJson, guideContainer);
18602
- guideContainer.style.visibility = 'visible';
18603
- guideContainer.parentNode.style.visibility = 'visible';
18604
- FlexboxPolyfill.flexAllThings(step.containerId, step);
18600
+ log.info(`Error loading image (${node[0].src}) for guide step id "${step.id}" in guide id "${step.guideId}".`);
18601
+ imageNodeHandler(step);
18605
18602
  });
18606
18603
  }
18607
18604
  function bindActionToNode(node, actionObject, step) {
@@ -40128,7 +40125,8 @@ class PromptPlugin {
40128
40125
  this.loadConfig(this.configName)
40129
40126
  .then(config => this.onConfigLoaded(config)).catch(() => { });
40130
40127
  // Listen for URL changes to re-evaluate page rules
40131
- (_a = this.api.Events.urlChanged) === null || _a === void 0 ? void 0 : _a.on(() => {
40128
+ // Listening on guidesLoaded since normalizedUrl comes back from the guides playload
40129
+ (_a = this.api.Events.guidesLoaded) === null || _a === void 0 ? void 0 : _a.on(() => {
40132
40130
  this.reEvaluatePageRules();
40133
40131
  });
40134
40132
  }
@@ -40962,7 +40960,7 @@ const RequiredQuestions = {
40962
40960
  });
40963
40961
  }
40964
40962
  });
40965
- step.attachEvent(step.guideElement.find('#pendo-guide-container')[0], 'click', function (event) {
40963
+ step.attachEvent(step.guideElement.find('[id^="pendo-guide-container"]')[0], 'click', function (event) {
40966
40964
  if (!event.target.classList.contains('_pendo-button')) {
40967
40965
  evaluateRequiredQuestions(requiredQuestions);
40968
40966
  }
@@ -41062,7 +41060,7 @@ const RequiredQuestions = {
41062
41060
  attributes: true,
41063
41061
  childList: true,
41064
41062
  characterData: true,
41065
- subtree: false
41063
+ subtree: true
41066
41064
  };
41067
41065
  const MutationObserver = getZoneSafeMethod$1(pendo._, 'MutationObserver');
41068
41066
  const observer = new MutationObserver(applyRequiredIndicators);
@@ -44818,6 +44816,22 @@ function querySelectorAll(n2, selectors) {
44818
44816
  function mutationObserverCtor() {
44819
44817
  return getUntaintedPrototype("MutationObserver").constructor;
44820
44818
  }
44819
+ function getUntaintedProxy() {
44820
+ var _a2, _b;
44821
+ let Proxy3 = window.Proxy;
44822
+ try {
44823
+ if (typeof window.Proxy !== "function" || !((_a2 = window.Proxy) == null ? void 0 : _a2.toString().includes("[native code]"))) {
44824
+ const cleanFrame = document.createElement("iframe");
44825
+ cleanFrame.style.display = "none";
44826
+ document.documentElement.appendChild(cleanFrame);
44827
+ Proxy3 = ((_b = cleanFrame.contentWindow) == null ? void 0 : _b.Proxy) || window.Proxy;
44828
+ document.documentElement.removeChild(cleanFrame);
44829
+ }
44830
+ } catch (err) {
44831
+ console.debug("Unable to get untainted Proxy from iframe", err);
44832
+ }
44833
+ return Proxy3;
44834
+ }
44821
44835
  function patch(source, name, replacement) {
44822
44836
  try {
44823
44837
  if (!(name in source)) {
@@ -44897,7 +44911,8 @@ let _mirror = {
44897
44911
  }
44898
44912
  };
44899
44913
  if (typeof window !== "undefined" && window.Proxy && window.Reflect) {
44900
- _mirror = new Proxy(_mirror, {
44914
+ const Proxy3 = getUntaintedProxy();
44915
+ _mirror = new Proxy3(_mirror, {
44901
44916
  get(target, prop, receiver) {
44902
44917
  if (prop === "map") {
44903
44918
  console.error(DEPARTED_MIRROR_ACCESS_WARNING);
@@ -45858,6 +45873,7 @@ const callbackWrapper = (cb) => {
45858
45873
  return rrwebWrapped;
45859
45874
  };
45860
45875
  const mutationBuffers = [];
45876
+ const Proxy2 = getUntaintedProxy();
45861
45877
  function getEventTarget(event) {
45862
45878
  try {
45863
45879
  if ("composedPath" in event) {
@@ -46251,6 +46267,7 @@ function getNestedCSSRulePositions(rule) {
46251
46267
  );
46252
46268
  const index2 = rules2.indexOf(childRule);
46253
46269
  pos.unshift(index2);
46270
+ return recurse(childRule.parentRule, pos);
46254
46271
  } else if (childRule.parentStyleSheet) {
46255
46272
  const rules2 = Array.from(childRule.parentStyleSheet.cssRules);
46256
46273
  const index2 = rules2.indexOf(childRule);
@@ -46276,7 +46293,7 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
46276
46293
  };
46277
46294
  }
46278
46295
  const insertRule = win.CSSStyleSheet.prototype.insertRule;
46279
- win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, {
46296
+ win.CSSStyleSheet.prototype.insertRule = new Proxy2(insertRule, {
46280
46297
  apply: callbackWrapper(
46281
46298
  (target, thisArg, argumentsList) => {
46282
46299
  const [rule, index2] = argumentsList;
@@ -46301,7 +46318,7 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
46301
46318
  return win.CSSStyleSheet.prototype.insertRule.apply(this, [rule, index2]);
46302
46319
  };
46303
46320
  const deleteRule = win.CSSStyleSheet.prototype.deleteRule;
46304
- win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, {
46321
+ win.CSSStyleSheet.prototype.deleteRule = new Proxy2(deleteRule, {
46305
46322
  apply: callbackWrapper(
46306
46323
  (target, thisArg, argumentsList) => {
46307
46324
  const [index2] = argumentsList;
@@ -46327,7 +46344,7 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
46327
46344
  let replace;
46328
46345
  if (win.CSSStyleSheet.prototype.replace) {
46329
46346
  replace = win.CSSStyleSheet.prototype.replace;
46330
- win.CSSStyleSheet.prototype.replace = new Proxy(replace, {
46347
+ win.CSSStyleSheet.prototype.replace = new Proxy2(replace, {
46331
46348
  apply: callbackWrapper(
46332
46349
  (target, thisArg, argumentsList) => {
46333
46350
  const [text] = argumentsList;
@@ -46351,7 +46368,7 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
46351
46368
  let replaceSync;
46352
46369
  if (win.CSSStyleSheet.prototype.replaceSync) {
46353
46370
  replaceSync = win.CSSStyleSheet.prototype.replaceSync;
46354
- win.CSSStyleSheet.prototype.replaceSync = new Proxy(replaceSync, {
46371
+ win.CSSStyleSheet.prototype.replaceSync = new Proxy2(replaceSync, {
46355
46372
  apply: callbackWrapper(
46356
46373
  (target, thisArg, argumentsList) => {
46357
46374
  const [text] = argumentsList;
@@ -46394,7 +46411,7 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
46394
46411
  // eslint-disable-next-line @typescript-eslint/unbound-method
46395
46412
  deleteRule: type.prototype.deleteRule
46396
46413
  };
46397
- type.prototype.insertRule = new Proxy(
46414
+ type.prototype.insertRule = new Proxy2(
46398
46415
  unmodifiedFunctions[typeKey].insertRule,
46399
46416
  {
46400
46417
  apply: callbackWrapper(
@@ -46426,7 +46443,7 @@ function initStyleSheetObserver({ styleSheetRuleCb, mirror: mirror2, stylesheetM
46426
46443
  )
46427
46444
  }
46428
46445
  );
46429
- type.prototype.deleteRule = new Proxy(
46446
+ type.prototype.deleteRule = new Proxy2(
46430
46447
  unmodifiedFunctions[typeKey].deleteRule,
46431
46448
  {
46432
46449
  apply: callbackWrapper(
@@ -46516,7 +46533,7 @@ function initStyleDeclarationObserver({
46516
46533
  stylesheetManager
46517
46534
  }, { win }) {
46518
46535
  const setProperty = win.CSSStyleDeclaration.prototype.setProperty;
46519
- win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, {
46536
+ win.CSSStyleDeclaration.prototype.setProperty = new Proxy2(setProperty, {
46520
46537
  apply: callbackWrapper(
46521
46538
  (target, thisArg, argumentsList) => {
46522
46539
  var _a2;
@@ -46547,7 +46564,7 @@ function initStyleDeclarationObserver({
46547
46564
  )
46548
46565
  });
46549
46566
  const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty;
46550
- win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, {
46567
+ win.CSSStyleDeclaration.prototype.removeProperty = new Proxy2(removeProperty, {
46551
46568
  apply: callbackWrapper(
46552
46569
  (target, thisArg, argumentsList) => {
46553
46570
  var _a2;
@@ -58520,10 +58537,11 @@ const createElement = (tag, attrs = {}, parent = null) => {
58520
58537
  return el;
58521
58538
  };
58522
58539
  const injectStyles = (pendoContainerId) => {
58523
- if ($(STYLE_ID))
58540
+ const styleId = `${STYLE_ID}-${pendoContainerId}`;
58541
+ if ($(styleId))
58524
58542
  return;
58525
58543
  createElement('style', {
58526
- id: STYLE_ID,
58544
+ id: styleId,
58527
58545
  textContent: `
58528
58546
  #${pendoContainerId} {
58529
58547
  display: none !important;