@appsurify-testmap/rrweb-all 2.1.2-alpha.2 → 2.1.3-alpha.1

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.
@@ -14351,6 +14351,7 @@ class VisibilityManager {
14351
14351
  __publicField(this, "mirror");
14352
14352
  __publicField(this, "mutationCb");
14353
14353
  __publicField(this, "rafId", null);
14354
+ __publicField(this, "intervalId", null);
14354
14355
  __publicField(this, "rafThrottle");
14355
14356
  __publicField(this, "lastFlushTime", 0);
14356
14357
  __publicField(this, "elements", /* @__PURE__ */ new Set());
@@ -14383,7 +14384,7 @@ class VisibilityManager {
14383
14384
  this.throttle = Number((visibilitySampling == null ? void 0 : visibilitySampling.throttle) ?? 100);
14384
14385
  this.threshold = Number((visibilitySampling == null ? void 0 : visibilitySampling.threshold) ?? 0.5);
14385
14386
  this.sensitivity = Number((visibilitySampling == null ? void 0 : visibilitySampling.sensitivity) ?? 0.05);
14386
- this.rafThrottle = Number((visibilitySampling == null ? void 0 : visibilitySampling.rafThrottle) ?? 100);
14387
+ this.rafThrottle = Number((visibilitySampling == null ? void 0 : visibilitySampling.rafThrottle) ?? 50);
14387
14388
  doc.querySelectorAll("*").forEach((el) => this.observe(el));
14388
14389
  const mo = new MutationObserver((mutations) => {
14389
14390
  mutations.forEach((m) => {
@@ -14405,14 +14406,25 @@ class VisibilityManager {
14405
14406
  }
14406
14407
  startPendingFlushLoop() {
14407
14408
  if (this.disabled) return;
14408
- const loop = (timestamp) => {
14409
- if (timestamp - this.lastFlushTime >= this.rafThrottle) {
14410
- this.lastFlushTime = timestamp;
14411
- this.flushPendingVisibilityMutations();
14412
- }
14409
+ if (typeof requestAnimationFrame === "function") {
14410
+ const loop = (timestamp) => {
14411
+ if (timestamp - this.lastFlushTime >= this.rafThrottle) {
14412
+ this.lastFlushTime = timestamp;
14413
+ this.flushPendingVisibilityMutations();
14414
+ }
14415
+ this.rafId = requestAnimationFrame(loop);
14416
+ };
14413
14417
  this.rafId = requestAnimationFrame(loop);
14414
- };
14415
- this.rafId = requestAnimationFrame(loop);
14418
+ } else {
14419
+ const loop = () => {
14420
+ const now = performance.now();
14421
+ if (now - this.lastFlushTime >= this.rafThrottle) {
14422
+ this.lastFlushTime = now;
14423
+ this.flushPendingVisibilityMutations();
14424
+ }
14425
+ };
14426
+ this.intervalId = setInterval(loop, this.rafThrottle);
14427
+ }
14416
14428
  }
14417
14429
  flushPendingVisibilityMutations() {
14418
14430
  if (this.disabled) return;
@@ -14482,6 +14494,7 @@ class VisibilityManager {
14482
14494
  }
14483
14495
  unfreeze() {
14484
14496
  this.frozen = false;
14497
+ this.flushPendingVisibilityMutations();
14485
14498
  }
14486
14499
  lock() {
14487
14500
  this.locked = true;
@@ -14493,10 +14506,17 @@ class VisibilityManager {
14493
14506
  this.elements.clear();
14494
14507
  this.previousState.clear();
14495
14508
  this.pending.clear();
14496
- if (this.rafId) cancelAnimationFrame(this.rafId);
14509
+ if (this.rafId) {
14510
+ cancelAnimationFrame(this.rafId);
14511
+ this.rafId = null;
14512
+ }
14513
+ if (this.intervalId) {
14514
+ clearInterval(this.intervalId);
14515
+ this.intervalId = null;
14516
+ }
14497
14517
  }
14498
14518
  }
14499
- const version$1 = "2.1.2-alpha.2";
14519
+ const version$1 = "2.1.3-alpha.1";
14500
14520
  let wrappedEmit;
14501
14521
  let takeFullSnapshot$1;
14502
14522
  let canvasManager;
@@ -17987,7 +18007,7 @@ class Replayer {
17987
18007
  this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
17988
18008
  }
17989
18009
  }
17990
- const version = "2.1.2-alpha.2";
18010
+ const version = "2.1.3-alpha.1";
17991
18011
  const { getVersion } = record;
17992
18012
  const { isRecording } = record;
17993
18013
  const { flushCustomEventQueue } = record;