@posthog/rrweb-player 0.0.48 → 0.0.50

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.
@@ -10830,14 +10830,14 @@ function hasShadowRoot(n2) {
10830
10830
  return Boolean(index.shadowRoot(n2));
10831
10831
  }
10832
10832
  function getNestedRule(rules2, position2) {
10833
- const rule2 = rules2[position2[0]];
10833
+ const rule2 = rules2 == null ? void 0 : rules2[position2[0]];
10834
+ if (!rule2) {
10835
+ return null;
10836
+ }
10834
10837
  if (position2.length === 1) {
10835
10838
  return rule2;
10836
10839
  } else {
10837
- return getNestedRule(
10838
- rule2.cssRules[position2[1]].cssRules,
10839
- position2.slice(2)
10840
- );
10840
+ return getNestedRule(rule2.cssRules, position2.slice(1));
10841
10841
  }
10842
10842
  }
10843
10843
  function getPositionsAndIndex(nestedIndex) {
@@ -13541,18 +13541,23 @@ class Replayer {
13541
13541
  const newSn = mirror2.getMeta(
13542
13542
  target
13543
13543
  );
13544
+ const newNode = buildNodeWithSN(
13545
+ __spreadProps(__spreadValues({}, newSn), {
13546
+ attributes: __spreadValues(__spreadValues({}, newSn.attributes), mutation.attributes)
13547
+ }),
13548
+ {
13549
+ doc: target.ownerDocument,
13550
+ // can be Document or RRDocument
13551
+ mirror: mirror2,
13552
+ skipChild: true,
13553
+ hackCss: true,
13554
+ cache: this.cache
13555
+ }
13556
+ );
13544
13557
  Object.assign(
13545
13558
  newSn.attributes,
13546
13559
  mutation.attributes
13547
13560
  );
13548
- const newNode = buildNodeWithSN(newSn, {
13549
- doc: target.ownerDocument,
13550
- // can be Document or RRDocument
13551
- mirror: mirror2,
13552
- skipChild: true,
13553
- hackCss: true,
13554
- cache: this.cache
13555
- });
13556
13561
  const siblingNode = target.nextSibling;
13557
13562
  const parentNode2 = target.parentNode;
13558
13563
  if (newNode && parentNode2) {
@@ -13702,7 +13707,7 @@ class Replayer {
13702
13707
  if (Array.isArray(nestedIndex)) {
13703
13708
  const { positions, index: index2 } = getPositionsAndIndex(nestedIndex);
13704
13709
  const nestedRule = getNestedRule(styleSheet.cssRules, positions);
13705
- nestedRule.insertRule(rule2, index2);
13710
+ nestedRule == null ? void 0 : nestedRule.insertRule(rule2, index2);
13706
13711
  } else {
13707
13712
  const index2 = nestedIndex === void 0 ? void 0 : Math.min(nestedIndex, styleSheet.cssRules.length);
13708
13713
  styleSheet == null ? void 0 : styleSheet.insertRule(rule2, index2);
@@ -13715,19 +13720,19 @@ class Replayer {
13715
13720
  if (Array.isArray(nestedIndex)) {
13716
13721
  const { positions, index: index2 } = getPositionsAndIndex(nestedIndex);
13717
13722
  const nestedRule = getNestedRule(styleSheet.cssRules, positions);
13718
- nestedRule.deleteRule(index2 || 0);
13723
+ nestedRule == null ? void 0 : nestedRule.deleteRule(index2 || 0);
13719
13724
  } else {
13720
13725
  styleSheet == null ? void 0 : styleSheet.deleteRule(nestedIndex);
13721
13726
  }
13722
13727
  } catch (e2) {
13723
13728
  }
13724
13729
  });
13725
- if (data.replace)
13730
+ if (typeof data.replace === "string")
13726
13731
  try {
13727
13732
  void ((_c = styleSheet.replace) == null ? void 0 : _c.call(styleSheet, data.replace));
13728
13733
  } catch (e2) {
13729
13734
  }
13730
- if (data.replaceSync)
13735
+ if (typeof data.replaceSync === "string")
13731
13736
  try {
13732
13737
  (_d = styleSheet.replaceSync) == null ? void 0 : _d.call(styleSheet, data.replaceSync);
13733
13738
  } catch (e2) {