@posthog/rrweb 0.0.32 → 0.0.35

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.
@@ -1,16 +1,4 @@
1
- (function (g, f) {
2
- if ("object" == typeof exports && "object" == typeof module) {
3
- module.exports = f();
4
- } else if ("function" == typeof define && define.amd) {
5
- define("rrweb", [], f);
6
- } else if ("object" == typeof exports) {
7
- exports["rrweb"] = f();
8
- } else {
9
- g["rrweb"] = f();
10
- }
11
- }(this, () => {
12
- var exports = {};
13
- var module = { exports };
1
+ (function (g, f) {if ("object" == typeof exports && "object" == typeof module) {module.exports = f();} else if ("function" == typeof define && define.amd) {define("rrweb", [], f);} else if ("object" == typeof exports) {exports["rrweb"] = f();} else {g["rrweb"] = f();}}(typeof self !== 'undefined' ? self : typeof globalThis !== 'undefined' ? globalThis : this, () => {var exports = {};var module = { exports };
14
2
  "use strict";
15
3
  var __defProp = Object.defineProperty;
16
4
  var __defProps = Object.defineProperties;
@@ -938,6 +926,7 @@ function hrefFrom(n2) {
938
926
  return n2.href;
939
927
  }
940
928
  function serializeElementNode(n2, options) {
929
+ var _a2, _b;
941
930
  const {
942
931
  doc,
943
932
  blockClass,
@@ -1111,11 +1100,13 @@ function serializeElementNode(n2, options) {
1111
1100
  }
1112
1101
  }
1113
1102
  if (needBlock) {
1114
- const { width, height } = n2.getBoundingClientRect();
1103
+ const { width, height, left, top } = n2.getBoundingClientRect();
1115
1104
  attributes = {
1116
1105
  class: attributes.class,
1117
1106
  rr_width: `${width}px`,
1118
- rr_height: `${height}px`
1107
+ rr_height: `${height}px`,
1108
+ rr_left: `${Math.floor(left + (((_a2 = doc.defaultView) == null ? void 0 : _a2.scrollX) || 0))}px`,
1109
+ rr_top: `${Math.floor(top + (((_b = doc.defaultView) == null ? void 0 : _b.scrollY) || 0))}px`
1119
1110
  };
1120
1111
  }
1121
1112
  if (tagName === "iframe" && !keepIframeSrcFn(attributes.src)) {
@@ -1520,7 +1511,7 @@ function getDefaultExportFromCjs$1(x) {
1520
1511
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1521
1512
  }
1522
1513
  function getAugmentedNamespace$1(n2) {
1523
- if (n2.__esModule) return n2;
1514
+ if (Object.prototype.hasOwnProperty.call(n2, "__esModule")) return n2;
1524
1515
  var f2 = n2.default;
1525
1516
  if (typeof f2 == "function") {
1526
1517
  var a2 = function a3() {
@@ -2039,6 +2030,9 @@ function requireNode$1() {
2039
2030
  return offset;
2040
2031
  }
2041
2032
  class Node2 {
2033
+ get proxyOf() {
2034
+ return this;
2035
+ }
2042
2036
  constructor(defaults = {}) {
2043
2037
  this.raws = {};
2044
2038
  this[isClean] = false;
@@ -2157,7 +2151,7 @@ function requireNode$1() {
2157
2151
  let index2 = this.parent.index(this);
2158
2152
  return this.parent.nodes[index2 + 1];
2159
2153
  }
2160
- positionBy(opts) {
2154
+ positionBy(opts = {}) {
2161
2155
  let pos = this.source.start;
2162
2156
  if (opts.index) {
2163
2157
  pos = this.positionInside(opts.index);
@@ -2186,27 +2180,38 @@ function requireNode$1() {
2186
2180
  column += 1;
2187
2181
  }
2188
2182
  }
2189
- return { column, line };
2183
+ return { column, line, offset: end };
2190
2184
  }
2191
2185
  prev() {
2192
2186
  if (!this.parent) return void 0;
2193
2187
  let index2 = this.parent.index(this);
2194
2188
  return this.parent.nodes[index2 - 1];
2195
2189
  }
2196
- rangeBy(opts) {
2190
+ rangeBy(opts = {}) {
2191
+ let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
2197
2192
  let start = {
2198
2193
  column: this.source.start.column,
2199
- line: this.source.start.line
2194
+ line: this.source.start.line,
2195
+ offset: sourceOffset(inputString, this.source.start)
2200
2196
  };
2201
2197
  let end = this.source.end ? {
2202
2198
  column: this.source.end.column + 1,
2203
- line: this.source.end.line
2199
+ line: this.source.end.line,
2200
+ offset: typeof this.source.end.offset === "number" ? (
2201
+ // `source.end.offset` is exclusive, so we don't need to add 1
2202
+ this.source.end.offset
2203
+ ) : (
2204
+ // Since line/column in this.source.end is inclusive,
2205
+ // the `sourceOffset(... , this.source.end)` returns an inclusive offset.
2206
+ // So, we add 1 to convert it to exclusive.
2207
+ sourceOffset(inputString, this.source.end) + 1
2208
+ )
2204
2209
  } : {
2205
2210
  column: start.column + 1,
2206
- line: start.line
2211
+ line: start.line,
2212
+ offset: start.offset + 1
2207
2213
  };
2208
2214
  if (opts.word) {
2209
- let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
2210
2215
  let stringRepresentation = inputString.slice(
2211
2216
  sourceOffset(inputString, this.source.start),
2212
2217
  sourceOffset(inputString, this.source.end)
@@ -2214,15 +2219,14 @@ function requireNode$1() {
2214
2219
  let index2 = stringRepresentation.indexOf(opts.word);
2215
2220
  if (index2 !== -1) {
2216
2221
  start = this.positionInside(index2);
2217
- end = this.positionInside(
2218
- index2 + opts.word.length
2219
- );
2222
+ end = this.positionInside(index2 + opts.word.length);
2220
2223
  }
2221
2224
  } else {
2222
2225
  if (opts.start) {
2223
2226
  start = {
2224
2227
  column: opts.start.column,
2225
- line: opts.start.line
2228
+ line: opts.start.line,
2229
+ offset: sourceOffset(inputString, opts.start)
2226
2230
  };
2227
2231
  } else if (opts.index) {
2228
2232
  start = this.positionInside(opts.index);
@@ -2230,7 +2234,8 @@ function requireNode$1() {
2230
2234
  if (opts.end) {
2231
2235
  end = {
2232
2236
  column: opts.end.column,
2233
- line: opts.end.line
2237
+ line: opts.end.line,
2238
+ offset: sourceOffset(inputString, opts.end)
2234
2239
  };
2235
2240
  } else if (typeof opts.endIndex === "number") {
2236
2241
  end = this.positionInside(opts.endIndex);
@@ -2239,7 +2244,11 @@ function requireNode$1() {
2239
2244
  }
2240
2245
  }
2241
2246
  if (end.line < start.line || end.line === start.line && end.column <= start.column) {
2242
- end = { column: start.column + 1, line: start.line };
2247
+ end = {
2248
+ column: start.column + 1,
2249
+ line: start.line,
2250
+ offset: start.offset + 1
2251
+ };
2243
2252
  }
2244
2253
  return { end, start };
2245
2254
  }
@@ -2303,6 +2312,7 @@ function requireNode$1() {
2303
2312
  } else if (typeof value === "object" && value.toJSON) {
2304
2313
  fixed[name] = value.toJSON(null, inputs);
2305
2314
  } else if (name === "source") {
2315
+ if (value == null) continue;
2306
2316
  let inputId = inputs.get(value.input);
2307
2317
  if (inputId == null) {
2308
2318
  inputId = inputsNextIndex;
@@ -2337,14 +2347,11 @@ function requireNode$1() {
2337
2347
  });
2338
2348
  return result2;
2339
2349
  }
2340
- warn(result2, text, opts) {
2350
+ warn(result2, text, opts = {}) {
2341
2351
  let data = { node: this };
2342
2352
  for (let i2 in opts) data[i2] = opts[i2];
2343
2353
  return result2.warn(text, data);
2344
2354
  }
2345
- get proxyOf() {
2346
- return this;
2347
- }
2348
2355
  }
2349
2356
  node$1 = Node2;
2350
2357
  Node2.default = Node2;
@@ -2373,6 +2380,9 @@ function requireDeclaration$1() {
2373
2380
  hasRequiredDeclaration$1 = 1;
2374
2381
  let Node2 = requireNode$1();
2375
2382
  class Declaration extends Node2 {
2383
+ get variable() {
2384
+ return this.prop.startsWith("--") || this.prop[0] === "$";
2385
+ }
2376
2386
  constructor(defaults) {
2377
2387
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
2378
2388
  defaults = __spreadProps(__spreadValues({}, defaults), { value: String(defaults.value) });
@@ -2380,9 +2390,6 @@ function requireDeclaration$1() {
2380
2390
  super(defaults);
2381
2391
  this.type = "decl";
2382
2392
  }
2383
- get variable() {
2384
- return this.prop.startsWith("--") || this.prop[0] === "$";
2385
- }
2386
2393
  }
2387
2394
  declaration$1 = Declaration;
2388
2395
  Declaration.default = Declaration;
@@ -2414,6 +2421,14 @@ function requireContainer$1() {
2414
2421
  }
2415
2422
  }
2416
2423
  class Container extends Node2 {
2424
+ get first() {
2425
+ if (!this.proxyOf.nodes) return void 0;
2426
+ return this.proxyOf.nodes[0];
2427
+ }
2428
+ get last() {
2429
+ if (!this.proxyOf.nodes) return void 0;
2430
+ return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
2431
+ }
2417
2432
  append(...children) {
2418
2433
  for (let child of children) {
2419
2434
  let nodes = this.normalize(child, this.last);
@@ -2726,14 +2741,6 @@ function requireContainer$1() {
2726
2741
  }
2727
2742
  });
2728
2743
  }
2729
- get first() {
2730
- if (!this.proxyOf.nodes) return void 0;
2731
- return this.proxyOf.nodes[0];
2732
- }
2733
- get last() {
2734
- if (!this.proxyOf.nodes) return void 0;
2735
- return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
2736
- }
2737
2744
  }
2738
2745
  Container.registerParse = (dependant) => {
2739
2746
  parse = dependant;
@@ -2983,10 +2990,25 @@ function requireInput$1() {
2983
2990
  let CssSyntaxError = requireCssSyntaxError$1();
2984
2991
  let PreviousMap = requirePreviousMap$1();
2985
2992
  let terminalHighlight = require$$2$1;
2986
- let fromOffsetCache = Symbol("fromOffsetCache");
2993
+ let lineToIndexCache = Symbol("lineToIndexCache");
2987
2994
  let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
2988
2995
  let pathAvailable = Boolean(resolve && isAbsolute);
2996
+ function getLineToIndex(input2) {
2997
+ if (input2[lineToIndexCache]) return input2[lineToIndexCache];
2998
+ let lines = input2.css.split("\n");
2999
+ let lineToIndex = new Array(lines.length);
3000
+ let prevIndex = 0;
3001
+ for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
3002
+ lineToIndex[i2] = prevIndex;
3003
+ prevIndex += lines[i2].length + 1;
3004
+ }
3005
+ input2[lineToIndexCache] = lineToIndex;
3006
+ return lineToIndex;
3007
+ }
2989
3008
  class Input {
3009
+ get from() {
3010
+ return this.file || this.id;
3011
+ }
2990
3012
  constructor(css, opts = {}) {
2991
3013
  if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) {
2992
3014
  throw new Error(`PostCSS received ${css} instead of CSS string`);
@@ -3021,30 +3043,37 @@ function requireInput$1() {
3021
3043
  if (this.map) this.map.file = this.from;
3022
3044
  }
3023
3045
  error(message, line, column, opts = {}) {
3024
- let endColumn, endLine, result2;
3046
+ let endColumn, endLine, endOffset, offset, result2;
3025
3047
  if (line && typeof line === "object") {
3026
3048
  let start = line;
3027
3049
  let end = column;
3028
3050
  if (typeof start.offset === "number") {
3029
- let pos = this.fromOffset(start.offset);
3051
+ offset = start.offset;
3052
+ let pos = this.fromOffset(offset);
3030
3053
  line = pos.line;
3031
3054
  column = pos.col;
3032
3055
  } else {
3033
3056
  line = start.line;
3034
3057
  column = start.column;
3058
+ offset = this.fromLineAndColumn(line, column);
3035
3059
  }
3036
3060
  if (typeof end.offset === "number") {
3037
- let pos = this.fromOffset(end.offset);
3061
+ endOffset = end.offset;
3062
+ let pos = this.fromOffset(endOffset);
3038
3063
  endLine = pos.line;
3039
3064
  endColumn = pos.col;
3040
3065
  } else {
3041
3066
  endLine = end.line;
3042
3067
  endColumn = end.column;
3068
+ endOffset = this.fromLineAndColumn(end.line, end.column);
3043
3069
  }
3044
3070
  } else if (!column) {
3045
- let pos = this.fromOffset(line);
3071
+ offset = line;
3072
+ let pos = this.fromOffset(offset);
3046
3073
  line = pos.line;
3047
3074
  column = pos.col;
3075
+ } else {
3076
+ offset = this.fromLineAndColumn(line, column);
3048
3077
  }
3049
3078
  let origin = this.origin(line, column, endLine, endColumn);
3050
3079
  if (origin) {
@@ -3066,7 +3095,7 @@ function requireInput$1() {
3066
3095
  opts.plugin
3067
3096
  );
3068
3097
  }
3069
- result2.input = { column, endColumn, endLine, line, source: this.css };
3098
+ result2.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css };
3070
3099
  if (this.file) {
3071
3100
  if (pathToFileURL) {
3072
3101
  result2.input.url = pathToFileURL(this.file).toString();
@@ -3075,21 +3104,14 @@ function requireInput$1() {
3075
3104
  }
3076
3105
  return result2;
3077
3106
  }
3107
+ fromLineAndColumn(line, column) {
3108
+ let lineToIndex = getLineToIndex(this);
3109
+ let index2 = lineToIndex[line - 1];
3110
+ return index2 + column - 1;
3111
+ }
3078
3112
  fromOffset(offset) {
3079
- let lastLine, lineToIndex;
3080
- if (!this[fromOffsetCache]) {
3081
- let lines = this.css.split("\n");
3082
- lineToIndex = new Array(lines.length);
3083
- let prevIndex = 0;
3084
- for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
3085
- lineToIndex[i2] = prevIndex;
3086
- prevIndex += lines[i2].length + 1;
3087
- }
3088
- this[fromOffsetCache] = lineToIndex;
3089
- } else {
3090
- lineToIndex = this[fromOffsetCache];
3091
- }
3092
- lastLine = lineToIndex[lineToIndex.length - 1];
3113
+ let lineToIndex = getLineToIndex(this);
3114
+ let lastLine = lineToIndex[lineToIndex.length - 1];
3093
3115
  let min = 0;
3094
3116
  if (offset >= lastLine) {
3095
3117
  min = lineToIndex.length - 1;
@@ -3170,9 +3192,6 @@ function requireInput$1() {
3170
3192
  }
3171
3193
  return json;
3172
3194
  }
3173
- get from() {
3174
- return this.file || this.id;
3175
- }
3176
3195
  }
3177
3196
  input$1 = Input;
3178
3197
  Input.default = Input;
@@ -3298,11 +3317,6 @@ function requireRule$1() {
3298
3317
  let Container = requireContainer$1();
3299
3318
  let list = requireList$1();
3300
3319
  class Rule extends Container {
3301
- constructor(defaults) {
3302
- super(defaults);
3303
- this.type = "rule";
3304
- if (!this.nodes) this.nodes = [];
3305
- }
3306
3320
  get selectors() {
3307
3321
  return list.comma(this.selector);
3308
3322
  }
@@ -3311,6 +3325,11 @@ function requireRule$1() {
3311
3325
  let sep = match ? match[0] : "," + this.raw("between", "beforeOpen");
3312
3326
  this.selector = values.join(sep);
3313
3327
  }
3328
+ constructor(defaults) {
3329
+ super(defaults);
3330
+ this.type = "rule";
3331
+ if (!this.nodes) this.nodes = [];
3332
+ }
3314
3333
  }
3315
3334
  rule$1 = Rule;
3316
3335
  Rule.default = Rule;
@@ -4209,6 +4228,8 @@ function requireParser$1() {
4209
4228
  if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) {
4210
4229
  prev.raws.ownSemicolon = this.spaces;
4211
4230
  this.spaces = "";
4231
+ prev.source.end = this.getPosition(token[2]);
4232
+ prev.source.end.offset += prev.raws.ownSemicolon.length;
4212
4233
  }
4213
4234
  }
4214
4235
  }
@@ -4420,7 +4441,7 @@ function requireParser$1() {
4420
4441
  }
4421
4442
  unknownWord(tokens) {
4422
4443
  throw this.input.error(
4423
- "Unknown word",
4444
+ "Unknown word " + tokens[0][1],
4424
4445
  { offset: tokens[0][2] },
4425
4446
  { offset: tokens[0][2] + tokens[0][1].length }
4426
4447
  );
@@ -4513,12 +4534,15 @@ function requireResult$1() {
4513
4534
  hasRequiredResult$1 = 1;
4514
4535
  let Warning = requireWarning$1();
4515
4536
  class Result {
4537
+ get content() {
4538
+ return this.css;
4539
+ }
4516
4540
  constructor(processor2, root2, opts) {
4517
4541
  this.processor = processor2;
4518
4542
  this.messages = [];
4519
4543
  this.root = root2;
4520
4544
  this.opts = opts;
4521
- this.css = void 0;
4545
+ this.css = "";
4522
4546
  this.map = void 0;
4523
4547
  }
4524
4548
  toString() {
@@ -4537,9 +4561,6 @@ function requireResult$1() {
4537
4561
  warnings() {
4538
4562
  return this.messages.filter((i2) => i2.type === "warning");
4539
4563
  }
4540
- get content() {
4541
- return this.css;
4542
- }
4543
4564
  }
4544
4565
  result$1 = Result;
4545
4566
  Result.default = Result;
@@ -4658,6 +4679,30 @@ function requireLazyResult$1() {
4658
4679
  }
4659
4680
  let postcss2 = {};
4660
4681
  class LazyResult {
4682
+ get content() {
4683
+ return this.stringify().content;
4684
+ }
4685
+ get css() {
4686
+ return this.stringify().css;
4687
+ }
4688
+ get map() {
4689
+ return this.stringify().map;
4690
+ }
4691
+ get messages() {
4692
+ return this.sync().messages;
4693
+ }
4694
+ get opts() {
4695
+ return this.result.opts;
4696
+ }
4697
+ get processor() {
4698
+ return this.result.processor;
4699
+ }
4700
+ get root() {
4701
+ return this.sync().root;
4702
+ }
4703
+ get [Symbol.toStringTag]() {
4704
+ return "LazyResult";
4705
+ }
4661
4706
  constructor(processor2, css, opts) {
4662
4707
  this.stringified = false;
4663
4708
  this.processed = false;
@@ -5000,30 +5045,6 @@ function requireLazyResult$1() {
5000
5045
  warnings() {
5001
5046
  return this.sync().warnings();
5002
5047
  }
5003
- get content() {
5004
- return this.stringify().content;
5005
- }
5006
- get css() {
5007
- return this.stringify().css;
5008
- }
5009
- get map() {
5010
- return this.stringify().map;
5011
- }
5012
- get messages() {
5013
- return this.sync().messages;
5014
- }
5015
- get opts() {
5016
- return this.result.opts;
5017
- }
5018
- get processor() {
5019
- return this.result.processor;
5020
- }
5021
- get root() {
5022
- return this.sync().root;
5023
- }
5024
- get [Symbol.toStringTag]() {
5025
- return "LazyResult";
5026
- }
5027
5048
  }
5028
5049
  LazyResult.registerPostcss = (dependant) => {
5029
5050
  postcss2 = dependant;
@@ -5045,6 +5066,45 @@ function requireNoWorkResult$1() {
5045
5066
  let stringify = requireStringify$1();
5046
5067
  let warnOnce2 = requireWarnOnce$1();
5047
5068
  class NoWorkResult {
5069
+ get content() {
5070
+ return this.result.css;
5071
+ }
5072
+ get css() {
5073
+ return this.result.css;
5074
+ }
5075
+ get map() {
5076
+ return this.result.map;
5077
+ }
5078
+ get messages() {
5079
+ return [];
5080
+ }
5081
+ get opts() {
5082
+ return this.result.opts;
5083
+ }
5084
+ get processor() {
5085
+ return this.result.processor;
5086
+ }
5087
+ get root() {
5088
+ if (this._root) {
5089
+ return this._root;
5090
+ }
5091
+ let root2;
5092
+ let parser2 = parse;
5093
+ try {
5094
+ root2 = parser2(this._css, this._opts);
5095
+ } catch (error) {
5096
+ this.error = error;
5097
+ }
5098
+ if (this.error) {
5099
+ throw this.error;
5100
+ } else {
5101
+ this._root = root2;
5102
+ return root2;
5103
+ }
5104
+ }
5105
+ get [Symbol.toStringTag]() {
5106
+ return "NoWorkResult";
5107
+ }
5048
5108
  constructor(processor2, css, opts) {
5049
5109
  css = css.toString();
5050
5110
  this.stringified = false;
@@ -5106,45 +5166,6 @@ function requireNoWorkResult$1() {
5106
5166
  warnings() {
5107
5167
  return [];
5108
5168
  }
5109
- get content() {
5110
- return this.result.css;
5111
- }
5112
- get css() {
5113
- return this.result.css;
5114
- }
5115
- get map() {
5116
- return this.result.map;
5117
- }
5118
- get messages() {
5119
- return [];
5120
- }
5121
- get opts() {
5122
- return this.result.opts;
5123
- }
5124
- get processor() {
5125
- return this.result.processor;
5126
- }
5127
- get root() {
5128
- if (this._root) {
5129
- return this._root;
5130
- }
5131
- let root2;
5132
- let parser2 = parse;
5133
- try {
5134
- root2 = parser2(this._css, this._opts);
5135
- } catch (error) {
5136
- this.error = error;
5137
- }
5138
- if (this.error) {
5139
- throw this.error;
5140
- } else {
5141
- this._root = root2;
5142
- return root2;
5143
- }
5144
- }
5145
- get [Symbol.toStringTag]() {
5146
- return "NoWorkResult";
5147
- }
5148
5169
  }
5149
5170
  noWorkResult$1 = NoWorkResult;
5150
5171
  NoWorkResult.default = NoWorkResult;
@@ -5161,7 +5182,7 @@ function requireProcessor$1() {
5161
5182
  let Root = requireRoot$1();
5162
5183
  class Processor {
5163
5184
  constructor(plugins = []) {
5164
- this.version = "8.5.1";
5185
+ this.version = "8.5.6";
5165
5186
  this.plugins = this.normalize(plugins);
5166
5187
  }
5167
5188
  normalize(plugins) {
@@ -5617,6 +5638,12 @@ function buildNode(n2, options) {
5617
5638
  node2.style.setProperty("width", value.toString());
5618
5639
  } else if (name === "rr_height") {
5619
5640
  node2.style.setProperty("height", value.toString());
5641
+ } else if (name === "rr_left") {
5642
+ node2.style.setProperty("left", value.toString());
5643
+ node2.style.setProperty("position", "absolute");
5644
+ } else if (name === "rr_top") {
5645
+ node2.style.setProperty("top", value.toString());
5646
+ node2.style.setProperty("position", "absolute");
5620
5647
  } else if (name === "rr_mediaCurrentTime" && typeof value === "number") {
5621
5648
  node2.currentTime = value;
5622
5649
  } else if (name === "rr_mediaState") {
@@ -5876,7 +5903,7 @@ function getDefaultExportFromCjs(x) {
5876
5903
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
5877
5904
  }
5878
5905
  function getAugmentedNamespace(n2) {
5879
- if (n2.__esModule) return n2;
5906
+ if (Object.prototype.hasOwnProperty.call(n2, "__esModule")) return n2;
5880
5907
  var f2 = n2.default;
5881
5908
  if (typeof f2 == "function") {
5882
5909
  var a2 = function a3() {
@@ -6395,6 +6422,9 @@ function requireNode() {
6395
6422
  return offset;
6396
6423
  }
6397
6424
  class Node2 {
6425
+ get proxyOf() {
6426
+ return this;
6427
+ }
6398
6428
  constructor(defaults = {}) {
6399
6429
  this.raws = {};
6400
6430
  this[isClean] = false;
@@ -6513,7 +6543,7 @@ function requireNode() {
6513
6543
  let index2 = this.parent.index(this);
6514
6544
  return this.parent.nodes[index2 + 1];
6515
6545
  }
6516
- positionBy(opts) {
6546
+ positionBy(opts = {}) {
6517
6547
  let pos = this.source.start;
6518
6548
  if (opts.index) {
6519
6549
  pos = this.positionInside(opts.index);
@@ -6542,27 +6572,38 @@ function requireNode() {
6542
6572
  column += 1;
6543
6573
  }
6544
6574
  }
6545
- return { column, line };
6575
+ return { column, line, offset: end };
6546
6576
  }
6547
6577
  prev() {
6548
6578
  if (!this.parent) return void 0;
6549
6579
  let index2 = this.parent.index(this);
6550
6580
  return this.parent.nodes[index2 - 1];
6551
6581
  }
6552
- rangeBy(opts) {
6582
+ rangeBy(opts = {}) {
6583
+ let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
6553
6584
  let start = {
6554
6585
  column: this.source.start.column,
6555
- line: this.source.start.line
6586
+ line: this.source.start.line,
6587
+ offset: sourceOffset(inputString, this.source.start)
6556
6588
  };
6557
6589
  let end = this.source.end ? {
6558
6590
  column: this.source.end.column + 1,
6559
- line: this.source.end.line
6591
+ line: this.source.end.line,
6592
+ offset: typeof this.source.end.offset === "number" ? (
6593
+ // `source.end.offset` is exclusive, so we don't need to add 1
6594
+ this.source.end.offset
6595
+ ) : (
6596
+ // Since line/column in this.source.end is inclusive,
6597
+ // the `sourceOffset(... , this.source.end)` returns an inclusive offset.
6598
+ // So, we add 1 to convert it to exclusive.
6599
+ sourceOffset(inputString, this.source.end) + 1
6600
+ )
6560
6601
  } : {
6561
6602
  column: start.column + 1,
6562
- line: start.line
6603
+ line: start.line,
6604
+ offset: start.offset + 1
6563
6605
  };
6564
6606
  if (opts.word) {
6565
- let inputString = "document" in this.source.input ? this.source.input.document : this.source.input.css;
6566
6607
  let stringRepresentation = inputString.slice(
6567
6608
  sourceOffset(inputString, this.source.start),
6568
6609
  sourceOffset(inputString, this.source.end)
@@ -6570,15 +6611,14 @@ function requireNode() {
6570
6611
  let index2 = stringRepresentation.indexOf(opts.word);
6571
6612
  if (index2 !== -1) {
6572
6613
  start = this.positionInside(index2);
6573
- end = this.positionInside(
6574
- index2 + opts.word.length
6575
- );
6614
+ end = this.positionInside(index2 + opts.word.length);
6576
6615
  }
6577
6616
  } else {
6578
6617
  if (opts.start) {
6579
6618
  start = {
6580
6619
  column: opts.start.column,
6581
- line: opts.start.line
6620
+ line: opts.start.line,
6621
+ offset: sourceOffset(inputString, opts.start)
6582
6622
  };
6583
6623
  } else if (opts.index) {
6584
6624
  start = this.positionInside(opts.index);
@@ -6586,7 +6626,8 @@ function requireNode() {
6586
6626
  if (opts.end) {
6587
6627
  end = {
6588
6628
  column: opts.end.column,
6589
- line: opts.end.line
6629
+ line: opts.end.line,
6630
+ offset: sourceOffset(inputString, opts.end)
6590
6631
  };
6591
6632
  } else if (typeof opts.endIndex === "number") {
6592
6633
  end = this.positionInside(opts.endIndex);
@@ -6595,7 +6636,11 @@ function requireNode() {
6595
6636
  }
6596
6637
  }
6597
6638
  if (end.line < start.line || end.line === start.line && end.column <= start.column) {
6598
- end = { column: start.column + 1, line: start.line };
6639
+ end = {
6640
+ column: start.column + 1,
6641
+ line: start.line,
6642
+ offset: start.offset + 1
6643
+ };
6599
6644
  }
6600
6645
  return { end, start };
6601
6646
  }
@@ -6659,6 +6704,7 @@ function requireNode() {
6659
6704
  } else if (typeof value === "object" && value.toJSON) {
6660
6705
  fixed[name] = value.toJSON(null, inputs);
6661
6706
  } else if (name === "source") {
6707
+ if (value == null) continue;
6662
6708
  let inputId = inputs.get(value.input);
6663
6709
  if (inputId == null) {
6664
6710
  inputId = inputsNextIndex;
@@ -6693,14 +6739,11 @@ function requireNode() {
6693
6739
  });
6694
6740
  return result2;
6695
6741
  }
6696
- warn(result2, text, opts) {
6742
+ warn(result2, text, opts = {}) {
6697
6743
  let data = { node: this };
6698
6744
  for (let i2 in opts) data[i2] = opts[i2];
6699
6745
  return result2.warn(text, data);
6700
6746
  }
6701
- get proxyOf() {
6702
- return this;
6703
- }
6704
6747
  }
6705
6748
  node = Node2;
6706
6749
  Node2.default = Node2;
@@ -6729,6 +6772,9 @@ function requireDeclaration() {
6729
6772
  hasRequiredDeclaration = 1;
6730
6773
  let Node2 = requireNode();
6731
6774
  class Declaration extends Node2 {
6775
+ get variable() {
6776
+ return this.prop.startsWith("--") || this.prop[0] === "$";
6777
+ }
6732
6778
  constructor(defaults) {
6733
6779
  if (defaults && typeof defaults.value !== "undefined" && typeof defaults.value !== "string") {
6734
6780
  defaults = __spreadProps(__spreadValues({}, defaults), { value: String(defaults.value) });
@@ -6736,9 +6782,6 @@ function requireDeclaration() {
6736
6782
  super(defaults);
6737
6783
  this.type = "decl";
6738
6784
  }
6739
- get variable() {
6740
- return this.prop.startsWith("--") || this.prop[0] === "$";
6741
- }
6742
6785
  }
6743
6786
  declaration = Declaration;
6744
6787
  Declaration.default = Declaration;
@@ -6770,6 +6813,14 @@ function requireContainer() {
6770
6813
  }
6771
6814
  }
6772
6815
  class Container extends Node2 {
6816
+ get first() {
6817
+ if (!this.proxyOf.nodes) return void 0;
6818
+ return this.proxyOf.nodes[0];
6819
+ }
6820
+ get last() {
6821
+ if (!this.proxyOf.nodes) return void 0;
6822
+ return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
6823
+ }
6773
6824
  append(...children) {
6774
6825
  for (let child of children) {
6775
6826
  let nodes = this.normalize(child, this.last);
@@ -7082,14 +7133,6 @@ function requireContainer() {
7082
7133
  }
7083
7134
  });
7084
7135
  }
7085
- get first() {
7086
- if (!this.proxyOf.nodes) return void 0;
7087
- return this.proxyOf.nodes[0];
7088
- }
7089
- get last() {
7090
- if (!this.proxyOf.nodes) return void 0;
7091
- return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
7092
- }
7093
7136
  }
7094
7137
  Container.registerParse = (dependant) => {
7095
7138
  parse = dependant;
@@ -7339,10 +7382,25 @@ function requireInput() {
7339
7382
  let CssSyntaxError = requireCssSyntaxError();
7340
7383
  let PreviousMap = requirePreviousMap();
7341
7384
  let terminalHighlight = require$$2;
7342
- let fromOffsetCache = Symbol("fromOffsetCache");
7385
+ let lineToIndexCache = Symbol("lineToIndexCache");
7343
7386
  let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
7344
7387
  let pathAvailable = Boolean(resolve && isAbsolute);
7388
+ function getLineToIndex(input2) {
7389
+ if (input2[lineToIndexCache]) return input2[lineToIndexCache];
7390
+ let lines = input2.css.split("\n");
7391
+ let lineToIndex = new Array(lines.length);
7392
+ let prevIndex = 0;
7393
+ for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
7394
+ lineToIndex[i2] = prevIndex;
7395
+ prevIndex += lines[i2].length + 1;
7396
+ }
7397
+ input2[lineToIndexCache] = lineToIndex;
7398
+ return lineToIndex;
7399
+ }
7345
7400
  class Input {
7401
+ get from() {
7402
+ return this.file || this.id;
7403
+ }
7346
7404
  constructor(css, opts = {}) {
7347
7405
  if (css === null || typeof css === "undefined" || typeof css === "object" && !css.toString) {
7348
7406
  throw new Error(`PostCSS received ${css} instead of CSS string`);
@@ -7377,30 +7435,37 @@ function requireInput() {
7377
7435
  if (this.map) this.map.file = this.from;
7378
7436
  }
7379
7437
  error(message, line, column, opts = {}) {
7380
- let endColumn, endLine, result2;
7438
+ let endColumn, endLine, endOffset, offset, result2;
7381
7439
  if (line && typeof line === "object") {
7382
7440
  let start = line;
7383
7441
  let end = column;
7384
7442
  if (typeof start.offset === "number") {
7385
- let pos = this.fromOffset(start.offset);
7443
+ offset = start.offset;
7444
+ let pos = this.fromOffset(offset);
7386
7445
  line = pos.line;
7387
7446
  column = pos.col;
7388
7447
  } else {
7389
7448
  line = start.line;
7390
7449
  column = start.column;
7450
+ offset = this.fromLineAndColumn(line, column);
7391
7451
  }
7392
7452
  if (typeof end.offset === "number") {
7393
- let pos = this.fromOffset(end.offset);
7453
+ endOffset = end.offset;
7454
+ let pos = this.fromOffset(endOffset);
7394
7455
  endLine = pos.line;
7395
7456
  endColumn = pos.col;
7396
7457
  } else {
7397
7458
  endLine = end.line;
7398
7459
  endColumn = end.column;
7460
+ endOffset = this.fromLineAndColumn(end.line, end.column);
7399
7461
  }
7400
7462
  } else if (!column) {
7401
- let pos = this.fromOffset(line);
7463
+ offset = line;
7464
+ let pos = this.fromOffset(offset);
7402
7465
  line = pos.line;
7403
7466
  column = pos.col;
7467
+ } else {
7468
+ offset = this.fromLineAndColumn(line, column);
7404
7469
  }
7405
7470
  let origin = this.origin(line, column, endLine, endColumn);
7406
7471
  if (origin) {
@@ -7422,7 +7487,7 @@ function requireInput() {
7422
7487
  opts.plugin
7423
7488
  );
7424
7489
  }
7425
- result2.input = { column, endColumn, endLine, line, source: this.css };
7490
+ result2.input = { column, endColumn, endLine, endOffset, line, offset, source: this.css };
7426
7491
  if (this.file) {
7427
7492
  if (pathToFileURL) {
7428
7493
  result2.input.url = pathToFileURL(this.file).toString();
@@ -7431,21 +7496,14 @@ function requireInput() {
7431
7496
  }
7432
7497
  return result2;
7433
7498
  }
7499
+ fromLineAndColumn(line, column) {
7500
+ let lineToIndex = getLineToIndex(this);
7501
+ let index2 = lineToIndex[line - 1];
7502
+ return index2 + column - 1;
7503
+ }
7434
7504
  fromOffset(offset) {
7435
- let lastLine, lineToIndex;
7436
- if (!this[fromOffsetCache]) {
7437
- let lines = this.css.split("\n");
7438
- lineToIndex = new Array(lines.length);
7439
- let prevIndex = 0;
7440
- for (let i2 = 0, l2 = lines.length; i2 < l2; i2++) {
7441
- lineToIndex[i2] = prevIndex;
7442
- prevIndex += lines[i2].length + 1;
7443
- }
7444
- this[fromOffsetCache] = lineToIndex;
7445
- } else {
7446
- lineToIndex = this[fromOffsetCache];
7447
- }
7448
- lastLine = lineToIndex[lineToIndex.length - 1];
7505
+ let lineToIndex = getLineToIndex(this);
7506
+ let lastLine = lineToIndex[lineToIndex.length - 1];
7449
7507
  let min = 0;
7450
7508
  if (offset >= lastLine) {
7451
7509
  min = lineToIndex.length - 1;
@@ -7526,9 +7584,6 @@ function requireInput() {
7526
7584
  }
7527
7585
  return json;
7528
7586
  }
7529
- get from() {
7530
- return this.file || this.id;
7531
- }
7532
7587
  }
7533
7588
  input = Input;
7534
7589
  Input.default = Input;
@@ -7654,11 +7709,6 @@ function requireRule() {
7654
7709
  let Container = requireContainer();
7655
7710
  let list = requireList();
7656
7711
  class Rule extends Container {
7657
- constructor(defaults) {
7658
- super(defaults);
7659
- this.type = "rule";
7660
- if (!this.nodes) this.nodes = [];
7661
- }
7662
7712
  get selectors() {
7663
7713
  return list.comma(this.selector);
7664
7714
  }
@@ -7667,6 +7717,11 @@ function requireRule() {
7667
7717
  let sep = match ? match[0] : "," + this.raw("between", "beforeOpen");
7668
7718
  this.selector = values.join(sep);
7669
7719
  }
7720
+ constructor(defaults) {
7721
+ super(defaults);
7722
+ this.type = "rule";
7723
+ if (!this.nodes) this.nodes = [];
7724
+ }
7670
7725
  }
7671
7726
  rule = Rule;
7672
7727
  Rule.default = Rule;
@@ -8565,6 +8620,8 @@ function requireParser() {
8565
8620
  if (prev && prev.type === "rule" && !prev.raws.ownSemicolon) {
8566
8621
  prev.raws.ownSemicolon = this.spaces;
8567
8622
  this.spaces = "";
8623
+ prev.source.end = this.getPosition(token[2]);
8624
+ prev.source.end.offset += prev.raws.ownSemicolon.length;
8568
8625
  }
8569
8626
  }
8570
8627
  }
@@ -8776,7 +8833,7 @@ function requireParser() {
8776
8833
  }
8777
8834
  unknownWord(tokens) {
8778
8835
  throw this.input.error(
8779
- "Unknown word",
8836
+ "Unknown word " + tokens[0][1],
8780
8837
  { offset: tokens[0][2] },
8781
8838
  { offset: tokens[0][2] + tokens[0][1].length }
8782
8839
  );
@@ -8869,12 +8926,15 @@ function requireResult() {
8869
8926
  hasRequiredResult = 1;
8870
8927
  let Warning = requireWarning();
8871
8928
  class Result {
8929
+ get content() {
8930
+ return this.css;
8931
+ }
8872
8932
  constructor(processor2, root2, opts) {
8873
8933
  this.processor = processor2;
8874
8934
  this.messages = [];
8875
8935
  this.root = root2;
8876
8936
  this.opts = opts;
8877
- this.css = void 0;
8937
+ this.css = "";
8878
8938
  this.map = void 0;
8879
8939
  }
8880
8940
  toString() {
@@ -8893,9 +8953,6 @@ function requireResult() {
8893
8953
  warnings() {
8894
8954
  return this.messages.filter((i2) => i2.type === "warning");
8895
8955
  }
8896
- get content() {
8897
- return this.css;
8898
- }
8899
8956
  }
8900
8957
  result = Result;
8901
8958
  Result.default = Result;
@@ -9014,6 +9071,30 @@ function requireLazyResult() {
9014
9071
  }
9015
9072
  let postcss2 = {};
9016
9073
  class LazyResult {
9074
+ get content() {
9075
+ return this.stringify().content;
9076
+ }
9077
+ get css() {
9078
+ return this.stringify().css;
9079
+ }
9080
+ get map() {
9081
+ return this.stringify().map;
9082
+ }
9083
+ get messages() {
9084
+ return this.sync().messages;
9085
+ }
9086
+ get opts() {
9087
+ return this.result.opts;
9088
+ }
9089
+ get processor() {
9090
+ return this.result.processor;
9091
+ }
9092
+ get root() {
9093
+ return this.sync().root;
9094
+ }
9095
+ get [Symbol.toStringTag]() {
9096
+ return "LazyResult";
9097
+ }
9017
9098
  constructor(processor2, css, opts) {
9018
9099
  this.stringified = false;
9019
9100
  this.processed = false;
@@ -9356,30 +9437,6 @@ function requireLazyResult() {
9356
9437
  warnings() {
9357
9438
  return this.sync().warnings();
9358
9439
  }
9359
- get content() {
9360
- return this.stringify().content;
9361
- }
9362
- get css() {
9363
- return this.stringify().css;
9364
- }
9365
- get map() {
9366
- return this.stringify().map;
9367
- }
9368
- get messages() {
9369
- return this.sync().messages;
9370
- }
9371
- get opts() {
9372
- return this.result.opts;
9373
- }
9374
- get processor() {
9375
- return this.result.processor;
9376
- }
9377
- get root() {
9378
- return this.sync().root;
9379
- }
9380
- get [Symbol.toStringTag]() {
9381
- return "LazyResult";
9382
- }
9383
9440
  }
9384
9441
  LazyResult.registerPostcss = (dependant) => {
9385
9442
  postcss2 = dependant;
@@ -9401,6 +9458,45 @@ function requireNoWorkResult() {
9401
9458
  let stringify = requireStringify();
9402
9459
  let warnOnce2 = requireWarnOnce();
9403
9460
  class NoWorkResult {
9461
+ get content() {
9462
+ return this.result.css;
9463
+ }
9464
+ get css() {
9465
+ return this.result.css;
9466
+ }
9467
+ get map() {
9468
+ return this.result.map;
9469
+ }
9470
+ get messages() {
9471
+ return [];
9472
+ }
9473
+ get opts() {
9474
+ return this.result.opts;
9475
+ }
9476
+ get processor() {
9477
+ return this.result.processor;
9478
+ }
9479
+ get root() {
9480
+ if (this._root) {
9481
+ return this._root;
9482
+ }
9483
+ let root2;
9484
+ let parser2 = parse;
9485
+ try {
9486
+ root2 = parser2(this._css, this._opts);
9487
+ } catch (error) {
9488
+ this.error = error;
9489
+ }
9490
+ if (this.error) {
9491
+ throw this.error;
9492
+ } else {
9493
+ this._root = root2;
9494
+ return root2;
9495
+ }
9496
+ }
9497
+ get [Symbol.toStringTag]() {
9498
+ return "NoWorkResult";
9499
+ }
9404
9500
  constructor(processor2, css, opts) {
9405
9501
  css = css.toString();
9406
9502
  this.stringified = false;
@@ -9462,45 +9558,6 @@ function requireNoWorkResult() {
9462
9558
  warnings() {
9463
9559
  return [];
9464
9560
  }
9465
- get content() {
9466
- return this.result.css;
9467
- }
9468
- get css() {
9469
- return this.result.css;
9470
- }
9471
- get map() {
9472
- return this.result.map;
9473
- }
9474
- get messages() {
9475
- return [];
9476
- }
9477
- get opts() {
9478
- return this.result.opts;
9479
- }
9480
- get processor() {
9481
- return this.result.processor;
9482
- }
9483
- get root() {
9484
- if (this._root) {
9485
- return this._root;
9486
- }
9487
- let root2;
9488
- let parser2 = parse;
9489
- try {
9490
- root2 = parser2(this._css, this._opts);
9491
- } catch (error) {
9492
- this.error = error;
9493
- }
9494
- if (this.error) {
9495
- throw this.error;
9496
- } else {
9497
- this._root = root2;
9498
- return root2;
9499
- }
9500
- }
9501
- get [Symbol.toStringTag]() {
9502
- return "NoWorkResult";
9503
- }
9504
9561
  }
9505
9562
  noWorkResult = NoWorkResult;
9506
9563
  NoWorkResult.default = NoWorkResult;
@@ -9517,7 +9574,7 @@ function requireProcessor() {
9517
9574
  let Root = requireRoot();
9518
9575
  class Processor {
9519
9576
  constructor(plugins = []) {
9520
- this.version = "8.5.1";
9577
+ this.version = "8.5.6";
9521
9578
  this.plugins = this.normalize(plugins);
9522
9579
  }
9523
9580
  normalize(plugins) {
@@ -10486,7 +10543,6 @@ function diffAfterUpdatingChildren(oldTree, newTree, replayer) {
10486
10543
  );
10487
10544
  break;
10488
10545
  }
10489
- // Props of style elements have to be updated after all children are updated. Otherwise the props can be overwritten by textContent.
10490
10546
  case "STYLE": {
10491
10547
  const styleSheet = oldElement.sheet;
10492
10548
  styleSheet && newTree.rules.forEach(
@@ -10913,7 +10969,6 @@ function buildFromNode(node2, rrdom, domMirror, parentRRNode) {
10913
10969
  case NodeType$2.COMMENT_NODE:
10914
10970
  rrNode = rrdom.createComment(node2.textContent || "");
10915
10971
  break;
10916
- // if node is a shadow root
10917
10972
  case NodeType$2.DOCUMENT_FRAGMENT_NODE:
10918
10973
  rrNode = parentRRNode.attachShadow({ mode: "open" });
10919
10974
  break;
@@ -13065,7 +13120,11 @@ function initFontObserver({ fontCb, doc }) {
13065
13120
  const fontMap = /* @__PURE__ */ new WeakMap();
13066
13121
  const originalFontFace = win.FontFace;
13067
13122
  win.FontFace = function FontFace2(family, source, descriptors) {
13068
- const fontFace = new originalFontFace(family, source, descriptors);
13123
+ const fontFace = new originalFontFace(
13124
+ family,
13125
+ source,
13126
+ descriptors
13127
+ );
13069
13128
  fontMap.set(fontFace, {
13070
13129
  family,
13071
13130
  buffer: typeof source !== "string",
@@ -13400,6 +13459,7 @@ class IframeManager {
13400
13459
  __publicField(this, "recordCrossOriginIframes");
13401
13460
  __publicField(this, "messageHandler");
13402
13461
  __publicField(this, "nestedIframeListeners", /* @__PURE__ */ new Map());
13462
+ __publicField(this, "attachedIframes", /* @__PURE__ */ new Map());
13403
13463
  this.mutationCb = options.mutationCb;
13404
13464
  this.wrappedEmit = options.wrappedEmit;
13405
13465
  this.stylesheetManager = options.stylesheetManager;
@@ -13426,12 +13486,18 @@ class IframeManager {
13426
13486
  removeLoadListener() {
13427
13487
  this.loadListener = void 0;
13428
13488
  }
13489
+ trackIframeContent(iframeEl, content) {
13490
+ const iframeId = this.mirror.getId(iframeEl);
13491
+ this.attachedIframes.set(iframeId, { element: iframeEl, content });
13492
+ return iframeId;
13493
+ }
13429
13494
  attachIframe(iframeEl, childSn) {
13430
13495
  var _a2;
13496
+ const iframeId = this.trackIframeContent(iframeEl, childSn);
13431
13497
  this.mutationCb({
13432
13498
  adds: [
13433
13499
  {
13434
- parentId: this.mirror.getId(iframeEl),
13500
+ parentId: iframeId,
13435
13501
  nextId: null,
13436
13502
  node: childSn
13437
13503
  }
@@ -13483,6 +13549,7 @@ class IframeManager {
13483
13549
  const rootId = e2.data.node.id;
13484
13550
  this.crossOriginIframeRootIdMap.set(iframeEl, rootId);
13485
13551
  this.patchRootIdOnNode(e2.data.node, rootId);
13552
+ this.trackIframeContent(iframeEl, e2.data.node);
13486
13553
  return {
13487
13554
  timestamp: e2.timestamp,
13488
13555
  type: EventType.IncrementalSnapshot,
@@ -13625,6 +13692,38 @@ class IframeManager {
13625
13692
  });
13626
13693
  }
13627
13694
  }
13695
+ removeIframeById(iframeId) {
13696
+ const entry = this.attachedIframes.get(iframeId);
13697
+ if (!entry) return;
13698
+ const win = entry.element.contentWindow;
13699
+ if (win && this.nestedIframeListeners.has(win)) {
13700
+ const handler = this.nestedIframeListeners.get(win);
13701
+ win.removeEventListener("message", handler);
13702
+ this.nestedIframeListeners.delete(win);
13703
+ }
13704
+ this.attachedIframes.delete(iframeId);
13705
+ }
13706
+ reattachIframes() {
13707
+ this.attachedIframes.forEach(({ content }, iframeId) => {
13708
+ if (!this.mirror.has(iframeId)) {
13709
+ this.attachedIframes.delete(iframeId);
13710
+ return;
13711
+ }
13712
+ this.mutationCb({
13713
+ adds: [
13714
+ {
13715
+ parentId: iframeId,
13716
+ nextId: null,
13717
+ node: content
13718
+ }
13719
+ ],
13720
+ removes: [],
13721
+ texts: [],
13722
+ attributes: [],
13723
+ isAttachIframe: true
13724
+ });
13725
+ });
13726
+ }
13628
13727
  destroy() {
13629
13728
  if (this.recordCrossOriginIframes) {
13630
13729
  window.removeEventListener("message", this.messageHandler);
@@ -13635,6 +13734,7 @@ class IframeManager {
13635
13734
  this.nestedIframeListeners.clear();
13636
13735
  this.crossOriginIframeMirror.reset();
13637
13736
  this.crossOriginIframeStyleMirror.reset();
13737
+ this.attachedIframes.clear();
13638
13738
  }
13639
13739
  }
13640
13740
  class ShadowDomManager {
@@ -14584,6 +14684,11 @@ function record(options = {}) {
14584
14684
  }
14585
14685
  };
14586
14686
  const wrappedMutationEmit = (m) => {
14687
+ if (recordCrossOriginIframes && m.removes) {
14688
+ m.removes.forEach(({ id }) => {
14689
+ iframeManager.removeIframeById(id);
14690
+ });
14691
+ }
14587
14692
  wrappedEmit({
14588
14693
  type: EventType.IncrementalSnapshot,
14589
14694
  data: __spreadValues({
@@ -14730,6 +14835,9 @@ function record(options = {}) {
14730
14835
  isCheckout
14731
14836
  );
14732
14837
  mutationBuffers.forEach((buf) => buf.unlock());
14838
+ if (recordCrossOriginIframes) {
14839
+ iframeManager.reattachIframes();
14840
+ }
14733
14841
  if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)
14734
14842
  stylesheetManager.adoptStyleSheets(
14735
14843
  document.adoptedStyleSheets,
@@ -17838,7 +17946,7 @@ exports.freezePage = freezePage;
17838
17946
  exports.record = record;
17839
17947
  exports.takeFullSnapshot = takeFullSnapshot;
17840
17948
  exports.utils = utils;
17841
- if (typeof module.exports == "object" && typeof exports == "object") {
17949
+ ;if (typeof module.exports == "object" && typeof exports == "object") {
17842
17950
  var __cp = (to, from, except, desc) => {
17843
17951
  if ((from && typeof from === "object") || typeof from === "function") {
17844
17952
  for (let key of Object.getOwnPropertyNames(from)) {