@pendo/agent 2.339.1 → 2.340.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dom.esm.js CHANGED
@@ -7529,12 +7529,49 @@ function applyMatrix2dRect(matrix2d, rect) {
7529
7529
  return transformedRect;
7530
7530
  }
7531
7531
 
7532
- var VERSION = '2.339.1_';
7532
+ var VERSION = '2.340.0_';
7533
7533
 
7534
7534
  var decodeURIComponent = _.isFunction(globalScope.decodeURIComponent) ? globalScope.decodeURIComponent : _.identity;
7535
7535
 
7536
7536
  var encodeURIComponent = _.isFunction(globalScope.encodeURIComponent) ? globalScope.encodeURIComponent : _.identity;
7537
7537
 
7538
+ var _a;
7539
+ /** Key used to lookup the analytics events in the consent collection policy. */
7540
+ var ANALYTICS = 'analytics';
7541
+ /** Key used to lookup the guide analytics events in the consent collection policy. */
7542
+ var GUIDE_ANALYTICS = 'guideAnalytics';
7543
+ /** Key used to lookup the text collection mode in the consent collection policy. */
7544
+ var TEXT_COLLECTION = 'textCollection';
7545
+ var TEXT_COLLECTION_LEVELS = ['none', 'whitelist', 'all'];
7546
+ function moreTextPermissive(a, b) {
7547
+ return TEXT_COLLECTION_LEVELS.indexOf(b) > TEXT_COLLECTION_LEVELS.indexOf(a) ? b : a;
7548
+ }
7549
+ function unionArrays(a, b) {
7550
+ return _.union(a, b);
7551
+ }
7552
+ // How a granted tier's value for a product combines with what's been resolved so far.
7553
+ // `initial` doubles as what an ungranted tier contributes -- an unlisted product falls
7554
+ // back to DEFAULT_RESOLVER, the plain "any granted tier turns it on" boolean rule.
7555
+ (_a = {},
7556
+ _a[TEXT_COLLECTION] = { initial: TEXT_COLLECTION_LEVELS[0], combine: moreTextPermissive },
7557
+ _a[ANALYTICS] = { initial: [], combine: unionArrays },
7558
+ _a[GUIDE_ANALYTICS] = { initial: [], combine: unionArrays },
7559
+ _a);
7560
+ /**
7561
+ * A product is enabled unless a tier has explicitly resolved it to false -- with no cookie
7562
+ * consent configured at all, or a product no tier ever mentions, there's nothing to deny.
7563
+ *
7564
+ * @access private
7565
+ * @param {string} product
7566
+ * @returns {boolean}
7567
+ */
7568
+ function isProductEnabled(product) {
7569
+ return true;
7570
+ }
7571
+ function isTrackingConsentDenied() {
7572
+ return !isProductEnabled();
7573
+ }
7574
+
7538
7575
  var allowKeys = function () {
7539
7576
  var allowKeys = ConfigReader.get('storage.allowKeys') || '*';
7540
7577
  return _.isArray(allowKeys) ? _.indexBy(allowKeys) : allowKeys;
@@ -7611,9 +7648,11 @@ var cookieDomain;
7611
7648
  var allowLocalStorageOnly = function () {
7612
7649
  return ConfigReader.get('localStorageOnly');
7613
7650
  };
7614
- // This config setting really describes any persistence at all.
7651
+ /*
7652
+ * This config setting really describes any persistence at all.
7653
+ */
7615
7654
  var storageIsDisabled = function () {
7616
- return !!ConfigReader.get('disableCookies');
7655
+ return !!ConfigReader.get('disableCookies') || isTrackingConsentDenied();
7617
7656
  };
7618
7657
  var getCookie = function (name) {
7619
7658
  var result;
@@ -8458,6 +8497,8 @@ Eventable.clear = function (events) {
8458
8497
  new EventType('ptm:paused', [LIFECYCLE]),
8459
8498
  new EventType('recording:unpaused', [LIFECYCLE]),
8460
8499
  new EventType('recording:paused', [LIFECYCLE]),
8500
+ new EventType('consent:changed', [LIFECYCLE]),
8501
+ new EventType('identifyRequested', [DEBUG, LIFECYCLE]),
8461
8502
  new EventType('childFrameJoined', [FRAMES]),
8462
8503
  new EventType('tabIdChanged:self', [DEBUG, LIFECYCLE])
8463
8504
  ];
@@ -9514,6 +9555,9 @@ function isElementVisible(element, overflowPattern) {
9514
9555
  function scrollElementIntoParentRect(element, scrollParent) {
9515
9556
  var clientRect = getClientRect(element);
9516
9557
  var scrollRect = getClientRect(scrollParent);
9558
+ // A fixed element should already be visible so no need to scroll to it.
9559
+ if (clientRect.fixed && !scrollRect.fixed)
9560
+ return;
9517
9561
  var yScrollAmount = 0;
9518
9562
  var xScrollAmount = 0;
9519
9563
  var diff;