@posthog/rrweb-player 0.0.22 → 0.0.24

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.
@@ -12824,16 +12824,6 @@ class Replayer {
12824
12824
  ...this.legacy_missingNodeRetryMap
12825
12825
  };
12826
12826
  const queue = [];
12827
- const nextNotInDOM = (mutation) => {
12828
- let next = null;
12829
- if (mutation.nextId) {
12830
- next = mirror2.getNode(mutation.nextId);
12831
- }
12832
- if (mutation.nextId !== null && mutation.nextId !== void 0 && mutation.nextId !== -1 && !next) {
12833
- return true;
12834
- }
12835
- return false;
12836
- };
12837
12827
  const appendNode = (mutation) => {
12838
12828
  var _a2, _b2;
12839
12829
  if (!this.iframe.contentDocument) {
@@ -12846,7 +12836,10 @@ class Replayer {
12846
12836
  if (mutation.node.type === NodeType.Document) {
12847
12837
  return this.newDocumentQueue.push(mutation);
12848
12838
  }
12849
- return queue.push(mutation);
12839
+ const parentIdInCurrentBatch = d.adds.some(
12840
+ (add) => add.node.id === mutation.parentId
12841
+ );
12842
+ return parentIdInCurrentBatch ? queue.push(mutation) : void 0;
12850
12843
  }
12851
12844
  if (mutation.node.isShadow) {
12852
12845
  if (!hasShadowRoot(parent)) {
@@ -12862,9 +12855,6 @@ class Replayer {
12862
12855
  if (mutation.nextId) {
12863
12856
  next = mirror2.getNode(mutation.nextId);
12864
12857
  }
12865
- if (nextNotInDOM(mutation)) {
12866
- return queue.push(mutation);
12867
- }
12868
12858
  if (mutation.node.rootId && !mirror2.getNode(mutation.node.rootId)) {
12869
12859
  return;
12870
12860
  }
@@ -12970,11 +12960,11 @@ class Replayer {
12970
12960
  d.adds.forEach((mutation) => {
12971
12961
  appendNode(mutation);
12972
12962
  });
12973
- const startTime = Date.now();
12963
+ const startTime = performance.now();
12974
12964
  while (queue.length) {
12975
12965
  const resolveTrees = queueToResolveTrees(queue);
12976
12966
  queue.length = 0;
12977
- if (Date.now() - startTime > 500) {
12967
+ if (performance.now() - startTime > 150) {
12978
12968
  this.warn(
12979
12969
  "Timeout in the loop, please check the resolve tree data:",
12980
12970
  resolveTrees
@@ -13229,12 +13219,13 @@ class Replayer {
13229
13219
  }
13230
13220
  }
13231
13221
  applyStyleDeclaration(data, styleSheet) {
13222
+ var _a2, _b2;
13232
13223
  if (data.set) {
13233
13224
  const rule2 = getNestedRule(
13234
13225
  styleSheet.rules,
13235
13226
  data.index
13236
13227
  );
13237
- rule2.style.setProperty(
13228
+ (_a2 = rule2 == null ? void 0 : rule2.style) == null ? void 0 : _a2.setProperty(
13238
13229
  data.set.property,
13239
13230
  data.set.value,
13240
13231
  data.set.priority
@@ -13245,7 +13236,7 @@ class Replayer {
13245
13236
  styleSheet.rules,
13246
13237
  data.index
13247
13238
  );
13248
- rule2.style.removeProperty(data.remove.property);
13239
+ (_b2 = rule2 == null ? void 0 : rule2.style) == null ? void 0 : _b2.removeProperty(data.remove.property);
13249
13240
  }
13250
13241
  }
13251
13242
  applyAdoptedStyleSheet(data) {