@appsurify-testmap/rrweb 3.6.0-alpha.1 → 3.11.0-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.
package/dist/rrweb.cjs CHANGED
@@ -781,7 +781,7 @@ try {
781
781
  }
782
782
  } catch (error) {
783
783
  }
784
- const U$1 = {
784
+ const z$1 = {
785
785
  ANCHOR: 0.4,
786
786
  PATH: 0.3,
787
787
  TARGET: 0.2,
@@ -795,9 +795,9 @@ const U$1 = {
795
795
  DEPTH_PENALTY_THRESHOLD: 5,
796
796
  DEPTH_PENALTY_FACTOR: 0.05,
797
797
  DEGRADED_SCORE: 0.3
798
- }, gt$1 = {
798
+ }, bt$1 = {
799
799
  MIN_CONFIDENCE_FOR_SKIP: 0.7
800
- }, K$1 = [
800
+ }, tt$1 = [
801
801
  "form",
802
802
  "main",
803
803
  "nav",
@@ -805,7 +805,7 @@ const U$1 = {
805
805
  "article",
806
806
  "footer",
807
807
  "header"
808
- ], J$1 = [
808
+ ], et$1 = [
809
809
  "form",
810
810
  "navigation",
811
811
  "main",
@@ -814,7 +814,7 @@ const U$1 = {
814
814
  "complementary",
815
815
  "banner",
816
816
  "search"
817
- ], mt$1 = [
817
+ ], St$1 = [
818
818
  // HTML5 Semantic
819
819
  "article",
820
820
  "aside",
@@ -918,7 +918,7 @@ const U$1 = {
918
918
  "data-*": 30,
919
919
  // Any aria-* attribute (if not above)
920
920
  "aria-*": 25
921
- }, V$1 = /* @__PURE__ */ new Set([
921
+ }, Y$1 = /* @__PURE__ */ new Set([
922
922
  "id",
923
923
  // handled separately
924
924
  "class",
@@ -930,7 +930,7 @@ const U$1 = {
930
930
  "tabindex",
931
931
  // can change
932
932
  "contenteditable"
933
- ]), bt$1 = {
933
+ ]), At$1 = {
934
934
  maxPathDepth: 10,
935
935
  enableSvgFingerprint: true,
936
936
  confidenceThreshold: 0,
@@ -938,7 +938,7 @@ const U$1 = {
938
938
  includeUtilityClasses: false,
939
939
  source: "dom-dsl"
940
940
  };
941
- function P$1(r2) {
941
+ function L$1(r2) {
942
942
  if (/^[a-z]+-\d+$/i.test(r2) || /^[a-z]+(-[a-z]+)+-\d+$/i.test(r2) || /^[a-z]+(_[a-z]+)*_\d+$/i.test(r2) || /^\d+$/.test(r2) || /^:[a-z0-9]+:$/i.test(r2) || /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(r2))
943
943
  return true;
944
944
  if (/^[a-z]{1,3}[A-Za-z0-9]{8,}$/.test(r2)) {
@@ -948,7 +948,7 @@ function P$1(r2) {
948
948
  }
949
949
  return !!(/^radix-/.test(r2) || /^mui-\d+$/.test(r2));
950
950
  }
951
- const Q$1 = /* @__PURE__ */ new Set([
951
+ const Z$1 = /* @__PURE__ */ new Set([
952
952
  "aria-labelledby",
953
953
  "aria-describedby",
954
954
  "aria-controls",
@@ -962,10 +962,10 @@ const Q$1 = /* @__PURE__ */ new Set([
962
962
  "aria-errormessage",
963
963
  "aria-flowto"
964
964
  ]);
965
- function Y$1(r2) {
966
- return r2.trim().split(/\s+/).some((e2) => P$1(e2));
965
+ function K$1(r2) {
966
+ return r2.trim().split(/\s+/).some((e2) => L$1(e2));
967
967
  }
968
- let St$1 = class St {
968
+ let Ct$1 = class Ct {
969
969
  constructor(t2, e2) {
970
970
  this.maxDepth = t2.maxPathDepth ?? 10, this.cache = e2;
971
971
  }
@@ -998,25 +998,25 @@ let St$1 = class St {
998
998
  if (e2 === "head" || this.isInsideHead(t2)) {
999
999
  const c2 = s2 == null ? void 0 : s2.documentElement;
1000
1000
  if (c2) {
1001
- const u2 = {
1001
+ const l2 = {
1002
1002
  element: c2,
1003
1003
  score: 1,
1004
1004
  tier: "A",
1005
1005
  depth: 0
1006
1006
  };
1007
- return this.cacheResult(t2, u2), u2;
1007
+ return this.cacheResult(t2, l2), l2;
1008
1008
  }
1009
1009
  }
1010
1010
  if (e2 === "body") {
1011
1011
  const c2 = s2 == null ? void 0 : s2.documentElement;
1012
1012
  if (c2) {
1013
- const u2 = {
1013
+ const l2 = {
1014
1014
  element: c2,
1015
1015
  score: 1,
1016
1016
  tier: "A",
1017
1017
  depth: 0
1018
1018
  };
1019
- return this.cacheResult(t2, u2), u2;
1019
+ return this.cacheResult(t2, l2), l2;
1020
1020
  }
1021
1021
  }
1022
1022
  let n2 = t2.parentElement, a2 = 0, i2 = null;
@@ -1030,10 +1030,10 @@ let St$1 = class St {
1030
1030
  };
1031
1031
  const c2 = this.scoreAnchor(n2);
1032
1032
  if (c2 > 0) {
1033
- const u2 = this.applyDepthPenalty(c2, a2), d = this.getTier(n2), l2 = { element: n2, score: u2, tier: d, depth: a2 };
1034
- if (d === "A")
1035
- return l2;
1036
- (!i2 || u2 > i2.score) && (i2 = l2);
1033
+ const l2 = this.applyDepthPenalty(c2, a2), f2 = this.getTier(n2), h = { element: n2, score: l2, tier: f2, depth: a2 };
1034
+ if (f2 === "A")
1035
+ return h;
1036
+ (!i2 || l2 > i2.score) && (i2 = h);
1037
1037
  }
1038
1038
  n2 = n2.parentElement, a2++;
1039
1039
  }
@@ -1048,11 +1048,11 @@ let St$1 = class St {
1048
1048
  scoreAnchor(t2) {
1049
1049
  let e2 = 0;
1050
1050
  const s2 = t2.tagName.toLowerCase();
1051
- K$1.includes(s2) && (e2 += I$1.SEMANTIC_TAG);
1051
+ tt$1.includes(s2) && (e2 += I$1.SEMANTIC_TAG);
1052
1052
  const n2 = t2.getAttribute("role");
1053
- n2 && J$1.includes(n2) && (e2 += I$1.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I$1.ARIA_LABEL);
1053
+ n2 && et$1.includes(n2) && (e2 += I$1.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I$1.ARIA_LABEL);
1054
1054
  const a2 = t2.id;
1055
- return a2 && !P$1(a2) && (e2 += I$1.STABLE_ID), (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test")) && (e2 += I$1.TEST_MARKER), Math.min(e2, 1);
1055
+ return a2 && !L$1(a2) && (e2 += I$1.STABLE_ID), (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test")) && (e2 += I$1.TEST_MARKER), Math.min(e2, 1);
1056
1056
  }
1057
1057
  /**
1058
1058
  * Applies depth penalty to score
@@ -1069,10 +1069,10 @@ let St$1 = class St {
1069
1069
  */
1070
1070
  getTier(t2) {
1071
1071
  const e2 = t2.tagName.toLowerCase();
1072
- if (K$1.includes(e2))
1072
+ if (tt$1.includes(e2))
1073
1073
  return "A";
1074
1074
  const s2 = t2.getAttribute("role");
1075
- return s2 && J$1.includes(s2) ? "B" : "C";
1075
+ return s2 && et$1.includes(s2) ? "B" : "C";
1076
1076
  }
1077
1077
  /**
1078
1078
  * Checks if element is inside <head> section.
@@ -1105,7 +1105,7 @@ let St$1 = class St {
1105
1105
  this.cache && this.cache.setAnchor(t2, e2);
1106
1106
  }
1107
1107
  };
1108
- const At$1 = [
1108
+ const Tt$1 = [
1109
1109
  // CSS-in-JS
1110
1110
  /^css-[a-z0-9]+$/i,
1111
1111
  /^sc-[a-z0-9]+-\d+$/i,
@@ -1125,7 +1125,7 @@ const At$1 = [
1125
1125
  /^_[a-z0-9]{5,}$/i,
1126
1126
  /\d{5,}/
1127
1127
  // 5+ digits in a row
1128
- ], xt$1 = [
1128
+ ], Et$1 = [
1129
1129
  // === FIX 4: Tailwind arbitrary values and variants (highest priority) ===
1130
1130
  /^\[/,
1131
1131
  // Any arbitrary value or variant starting with [ (e.g., [&_svg]:..., [mask-type:luminance])
@@ -1237,29 +1237,81 @@ const At$1 = [
1237
1237
  /^pull-(left|right)$/,
1238
1238
  /^float-(left|right|none)$/
1239
1239
  ];
1240
- function O$1(r2) {
1241
- return At$1.some((t2) => t2.test(r2));
1240
+ function q$1(r2) {
1241
+ return Tt$1.some((t2) => t2.test(r2));
1242
1242
  }
1243
- function _$1(r2) {
1244
- return r2.length <= 2 || /^\d/.test(r2) ? true : xt$1.some((t2) => t2.test(r2));
1243
+ function U$1(r2) {
1244
+ return r2.length <= 2 || /^\d/.test(r2) ? true : Et$1.some((t2) => t2.test(r2));
1245
1245
  }
1246
- function Et$1(r2) {
1247
- return !O$1(r2) && !_$1(r2);
1246
+ function $t$1(r2) {
1247
+ return !q$1(r2) && !U$1(r2);
1248
1248
  }
1249
1249
  function M$1(r2) {
1250
- return r2.filter((t2) => Et$1(t2));
1250
+ return r2.filter((t2) => $t$1(t2));
1251
1251
  }
1252
- function vt$1(r2) {
1252
+ function It$1(r2) {
1253
1253
  const t2 = [], e2 = [];
1254
1254
  for (const s2 of r2)
1255
- _$1(s2) || O$1(s2) ? e2.push(s2) : t2.push(s2);
1255
+ U$1(s2) || q$1(s2) ? e2.push(s2) : t2.push(s2);
1256
1256
  return { semantic: t2, utility: e2 };
1257
1257
  }
1258
- function tt$1(r2) {
1259
- return _$1(r2) || O$1(r2);
1258
+ function st$1(r2) {
1259
+ return U$1(r2) || q$1(r2);
1260
+ }
1261
+ const Rt$1 = /* @__PURE__ */ new Set([
1262
+ "tr",
1263
+ "td",
1264
+ "th",
1265
+ "thead",
1266
+ "tbody",
1267
+ "tfoot"
1268
+ ]), Dt$1 = /* @__PURE__ */ new Set([
1269
+ "data-testid",
1270
+ "data-qa",
1271
+ "data-cy",
1272
+ "data-test",
1273
+ "aria-label",
1274
+ "name",
1275
+ "href"
1276
+ ]);
1277
+ function Mt$1(r2) {
1278
+ if (r2.id) return true;
1279
+ if (r2.attributes) {
1280
+ for (const t2 of Object.keys(r2.attributes))
1281
+ if (Dt$1.has(t2)) return true;
1282
+ }
1283
+ return false;
1284
+ }
1285
+ function Lt$1(r2, t2, e2) {
1286
+ var _a2;
1287
+ const s2 = r2.parentElement;
1288
+ if (!s2) return true;
1289
+ for (const n2 of Array.from(s2.children)) {
1290
+ if (n2 === r2 || n2.tagName.toLowerCase() !== t2) continue;
1291
+ if ((((_a2 = n2.textContent) == null ? void 0 : _a2.trim()) ?? "") === e2) return false;
1292
+ }
1293
+ return true;
1294
+ }
1295
+ function _$1(r2, t2, e2) {
1296
+ var _a2;
1297
+ if (Rt$1.has(r2)) return true;
1298
+ if (Mt$1(t2)) return false;
1299
+ if (e2) {
1300
+ const s2 = e2.parentElement;
1301
+ if (s2) {
1302
+ const n2 = (_a2 = t2.text) == null ? void 0 : _a2.normalized;
1303
+ if (n2 && Lt$1(e2, r2, n2))
1304
+ return false;
1305
+ if (Array.from(s2.children).some(
1306
+ (i2) => i2 !== e2 && i2.tagName.toLowerCase() === r2
1307
+ )) return true;
1308
+ }
1309
+ return false;
1310
+ }
1311
+ return true;
1260
1312
  }
1261
- const et$1 = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
1262
- let $t$1 = class $t {
1313
+ const rt$1 = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
1314
+ let Pt$1 = class Pt {
1263
1315
  constructor(t2, e2) {
1264
1316
  this.maxDepth = t2.maxPathDepth ?? 10, this.cache = e2;
1265
1317
  }
@@ -1294,19 +1346,22 @@ let $t$1 = class $t {
1294
1346
  degraded: true,
1295
1347
  degradationReason: "target-not-descendant-of-anchor"
1296
1348
  };
1297
- let u2 = this.filterNoise(i2);
1298
- return u2 = this.ensureUniqueness(i2, u2, t2, e2, s2), {
1299
- path: u2.map((l2) => {
1300
- const h = l2.parentElement;
1349
+ let l2 = this.filterNoise(i2);
1350
+ return l2 = this.ensureUniqueness(i2, l2, t2, e2, s2), {
1351
+ path: l2.map((h) => {
1352
+ const d = h.tagName.toLowerCase(), u2 = s2.extract(h);
1301
1353
  let g;
1302
- if (h) {
1303
- const m = Array.from(h.children).indexOf(l2);
1304
- m !== -1 && (g = m + 1);
1354
+ if (_$1(d, u2, h)) {
1355
+ const m = h.parentElement;
1356
+ if (m) {
1357
+ const b = Array.from(m.children).indexOf(h);
1358
+ b !== -1 && (g = b + 1);
1359
+ }
1305
1360
  }
1306
1361
  return {
1307
- tag: l2.tagName.toLowerCase(),
1308
- semantics: s2.extract(l2),
1309
- score: s2.scoreElement(l2),
1362
+ tag: d,
1363
+ semantics: u2,
1364
+ score: s2.scoreElement(h),
1310
1365
  nthChild: g
1311
1366
  };
1312
1367
  }),
@@ -1331,27 +1386,27 @@ let $t$1 = class $t {
1331
1386
  if (!o2) return e2;
1332
1387
  let c2;
1333
1388
  if (this.cache) {
1334
- const d = this.cache.getSelectorResults(i2);
1335
- d !== void 0 ? c2 = d : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
1389
+ const f2 = this.cache.getSelectorResults(i2);
1390
+ f2 !== void 0 ? c2 = f2 : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
1336
1391
  } else
1337
1392
  c2 = o2.querySelectorAll(i2);
1338
1393
  if (c2.length <= 1)
1339
1394
  return e2;
1340
- const u2 = t2.filter((d) => !e2.includes(d));
1341
- for (const d of u2) {
1342
- if (a2.scoreElement(d) < gt$1.MIN_CONFIDENCE_FOR_SKIP)
1395
+ const l2 = t2.filter((f2) => !e2.includes(f2));
1396
+ for (const f2 of l2) {
1397
+ if (a2.scoreElement(f2) < bt$1.MIN_CONFIDENCE_FOR_SKIP)
1343
1398
  continue;
1344
- const h = this.insertNodeInOrder(e2, d, t2), g = this.buildTestSelector(s2, h, n2);
1399
+ const d = this.insertNodeInOrder(e2, f2, t2), u2 = this.buildTestSelector(s2, d, n2);
1345
1400
  try {
1346
- let f2;
1401
+ let g;
1347
1402
  if (this.cache) {
1348
- const m = this.cache.getSelectorResults(g);
1349
- m !== void 0 ? f2 = m : (f2 = Array.from(o2.querySelectorAll(g)), this.cache.setSelectorResults(g, f2));
1403
+ const m = this.cache.getSelectorResults(u2);
1404
+ m !== void 0 ? g = m : (g = Array.from(o2.querySelectorAll(u2)), this.cache.setSelectorResults(u2, g));
1350
1405
  } else
1351
- f2 = o2.querySelectorAll(g);
1352
- if (f2.length === 1)
1353
- return h;
1354
- f2.length < c2.length && (e2 = h);
1406
+ g = o2.querySelectorAll(u2);
1407
+ if (g.length === 1)
1408
+ return d;
1409
+ g.length < c2.length && (e2 = d);
1355
1410
  } catch {
1356
1411
  }
1357
1412
  }
@@ -1385,9 +1440,9 @@ let $t$1 = class $t {
1385
1440
  */
1386
1441
  elementToSelector(t2) {
1387
1442
  let e2 = t2.tagName.toLowerCase();
1388
- t2.id && !P$1(t2.id) && (e2 += `#${et$1(t2.id)}`);
1443
+ t2.id && !L$1(t2.id) && (e2 += `#${rt$1(t2.id)}`);
1389
1444
  for (const s2 of Array.from(t2.classList))
1390
- tt$1(s2) || (e2 += `.${et$1(s2)}`);
1445
+ st$1(s2) || (e2 += `.${rt$1(s2)}`);
1391
1446
  return e2;
1392
1447
  }
1393
1448
  /**
@@ -1401,7 +1456,7 @@ let $t$1 = class $t {
1401
1456
  */
1402
1457
  shouldInclude(t2) {
1403
1458
  const e2 = t2.tagName.toLowerCase();
1404
- return mt$1.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
1459
+ return St$1.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
1405
1460
  }
1406
1461
  /**
1407
1462
  * Checks if element has meaningful semantic features
@@ -1412,12 +1467,12 @@ let $t$1 = class $t {
1412
1467
  if (s2.name.startsWith("aria-")) return true;
1413
1468
  if (t2.classList.length > 0) {
1414
1469
  for (const s2 of Array.from(t2.classList))
1415
- if (!tt$1(s2)) return true;
1470
+ if (!st$1(s2)) return true;
1416
1471
  }
1417
1472
  if (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test"))
1418
1473
  return true;
1419
1474
  const e2 = t2.id;
1420
- return !!(e2 && !P$1(e2));
1475
+ return !!(e2 && !L$1(e2));
1421
1476
  }
1422
1477
  /**
1423
1478
  * Checks if element is inside <head> section.
@@ -1464,31 +1519,34 @@ let $t$1 = class $t {
1464
1519
  degradationReason: "head-not-found-in-path"
1465
1520
  } : {
1466
1521
  path: n2.map((c2) => {
1467
- const u2 = c2.parentElement;
1468
- let d;
1469
- if (u2) {
1470
- const h = Array.from(u2.children).indexOf(c2);
1471
- h !== -1 && (d = h + 1);
1522
+ const l2 = c2.tagName.toLowerCase(), f2 = s2.extract(c2);
1523
+ let h;
1524
+ if (_$1(l2, f2, c2)) {
1525
+ const d = c2.parentElement;
1526
+ if (d) {
1527
+ const g = Array.from(d.children).indexOf(c2);
1528
+ g !== -1 && (h = g + 1);
1529
+ }
1472
1530
  }
1473
1531
  return {
1474
- tag: c2.tagName.toLowerCase(),
1475
- semantics: s2.extract(c2),
1532
+ tag: l2,
1533
+ semantics: f2,
1476
1534
  score: s2.scoreElement(c2),
1477
- nthChild: d
1535
+ nthChild: h
1478
1536
  };
1479
1537
  }),
1480
1538
  degraded: false
1481
1539
  };
1482
1540
  }
1483
1541
  };
1484
- function F$1(r2) {
1542
+ function j$1(r2) {
1485
1543
  return r2 ? r2.trim().replace(/[\n\t\r]/g, " ").replace(/\s+/g, " ") : "";
1486
1544
  }
1487
- const Nt$1 = {
1545
+ const Ht$1 = {
1488
1546
  preserveQueryForAbsolute: true,
1489
1547
  removeDynamicHashes: true
1490
1548
  };
1491
- function It$1(r2) {
1549
+ function kt$1(r2) {
1492
1550
  return r2 ? [
1493
1551
  /\d{5,}/,
1494
1552
  // 5+ digits
@@ -1502,18 +1560,18 @@ function It$1(r2) {
1502
1560
  // UUID-like
1503
1561
  ].some((e2) => e2.test(r2)) : false;
1504
1562
  }
1505
- function Rt$1(r2, t2) {
1563
+ function _t$1(r2, t2) {
1506
1564
  if (!r2) return r2;
1507
1565
  const e2 = r2.startsWith("http://") || r2.startsWith("https://"), [s2, n2] = r2.split("#"), [a2, i2] = s2.split("?");
1508
1566
  let o2 = a2;
1509
- return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && It$1(n2) || (o2 += `#${n2}`)), o2;
1567
+ return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && kt$1(n2) || (o2 += `#${n2}`)), o2;
1510
1568
  }
1511
1569
  function D$1(r2, t2, e2 = {}) {
1512
1570
  if (!t2) return t2;
1513
- const s2 = { ...Nt$1, ...e2 };
1514
- return r2 === "href" || r2 === "src" ? Rt$1(t2, s2) : t2;
1571
+ const s2 = { ...Ht$1, ...e2 };
1572
+ return r2 === "href" || r2 === "src" ? _t$1(t2, s2) : t2;
1515
1573
  }
1516
- const Dt$1 = [
1574
+ const Ot$1 = [
1517
1575
  "role",
1518
1576
  "aria-label",
1519
1577
  "aria-labelledby",
@@ -1524,7 +1582,7 @@ const Dt$1 = [
1524
1582
  "aria-posinset",
1525
1583
  "aria-setsize",
1526
1584
  "aria-haspopup"
1527
- ], Mt$1 = [
1585
+ ], qt$1 = [
1528
1586
  "aria-selected",
1529
1587
  "aria-checked",
1530
1588
  "aria-pressed",
@@ -1537,7 +1595,7 @@ const Dt$1 = [
1537
1595
  "aria-grabbed",
1538
1596
  "aria-live",
1539
1597
  "aria-atomic"
1540
- ], Pt$1 = [
1598
+ ], Ut$1 = [
1541
1599
  "data-state",
1542
1600
  "data-active",
1543
1601
  "data-inactive",
@@ -1556,7 +1614,7 @@ const Dt$1 = [
1556
1614
  "data-hover",
1557
1615
  "data-orientation",
1558
1616
  "data-theme"
1559
- ], Ht$1 = [
1617
+ ], zt$1 = [
1560
1618
  "data-radix-",
1561
1619
  "data-headlessui-",
1562
1620
  "data-reach-",
@@ -1564,7 +1622,7 @@ const Dt$1 = [
1564
1622
  "data-chakra-",
1565
1623
  "data-mantine-",
1566
1624
  "data-tw-"
1567
- ], Lt$1 = [
1625
+ ], Ft$1 = [
1568
1626
  "data-testid",
1569
1627
  "data-test-id",
1570
1628
  "data-test",
@@ -1576,7 +1634,7 @@ const Dt$1 = [
1576
1634
  "data-entity-id",
1577
1635
  "data-product-id",
1578
1636
  "data-user-id"
1579
- ], kt$1 = [
1637
+ ], jt$1 = [
1580
1638
  // Google Analytics / GTM
1581
1639
  "data-ga",
1582
1640
  "data-gtm",
@@ -1612,7 +1670,7 @@ const Dt$1 = [
1612
1670
  "data-conversion",
1613
1671
  "data-segment",
1614
1672
  "data-analytics"
1615
- ], qt$1 = [
1673
+ ], Wt$1 = [
1616
1674
  "data-category",
1617
1675
  // Google Analytics category
1618
1676
  "data-action",
@@ -1621,7 +1679,7 @@ const Dt$1 = [
1621
1679
  // Google Analytics label
1622
1680
  "data-value"
1623
1681
  // Google Analytics value
1624
- ], Ot$1 = [
1682
+ ], Bt$1 = [
1625
1683
  "id",
1626
1684
  "name",
1627
1685
  "type",
@@ -1630,7 +1688,7 @@ const Dt$1 = [
1630
1688
  "for",
1631
1689
  "alt",
1632
1690
  "href"
1633
- ], _t$1 = [
1691
+ ], Gt$1 = [
1634
1692
  "disabled",
1635
1693
  "checked",
1636
1694
  "selected",
@@ -1638,17 +1696,17 @@ const Dt$1 = [
1638
1696
  "readonly",
1639
1697
  "required",
1640
1698
  "value"
1641
- ], Ut$1 = [
1699
+ ], Vt$1 = [
1642
1700
  /^radix-/,
1643
1701
  /^headlessui-/,
1644
1702
  /^mui-/,
1645
1703
  /:\w+:/
1646
1704
  // matches :ru:, :r1:, etc.
1647
1705
  ];
1648
- function zt$1(r2, t2) {
1649
- return Dt$1.includes(r2) ? true : Mt$1.includes(r2) || Pt$1.includes(r2) || Ht$1.some((e2) => r2.startsWith(e2)) ? false : Lt$1.includes(r2) ? true : kt$1.some((e2) => r2.startsWith(e2)) || qt$1.includes(r2) ? false : r2.startsWith("data-") && r2.endsWith("-id") ? true : r2 === "id" ? !Ut$1.some((e2) => e2.test(t2)) : Ot$1.includes(r2) ? true : _t$1.includes(r2) ? false : !!r2.startsWith("data-");
1706
+ function Qt$1(r2, t2) {
1707
+ return Ot$1.includes(r2) ? true : qt$1.includes(r2) || Ut$1.includes(r2) || zt$1.some((e2) => r2.startsWith(e2)) ? false : Ft$1.includes(r2) ? true : jt$1.some((e2) => r2.startsWith(e2)) || Wt$1.includes(r2) ? false : r2.startsWith("data-") && r2.endsWith("-id") ? true : r2 === "id" ? !Vt$1.some((e2) => e2.test(t2)) : Bt$1.includes(r2) ? true : Gt$1.includes(r2) ? false : !!r2.startsWith("data-");
1650
1708
  }
1651
- let st$1 = class st {
1709
+ let nt$1 = class nt {
1652
1710
  constructor(t2, e2) {
1653
1711
  this.includeUtilityClasses = t2.includeUtilityClasses ?? false, this.cache = e2;
1654
1712
  }
@@ -1664,12 +1722,12 @@ let st$1 = class st {
1664
1722
  return i2;
1665
1723
  }
1666
1724
  const e2 = {}, s2 = t2.id;
1667
- if (s2 && !P$1(s2) && (e2.id = s2), t2.classList.length > 0) {
1725
+ if (s2 && !L$1(s2) && (e2.id = s2), t2.classList.length > 0) {
1668
1726
  const i2 = Array.from(t2.classList);
1669
1727
  if (this.includeUtilityClasses)
1670
1728
  e2.classes = i2;
1671
1729
  else {
1672
- const { semantic: o2 } = vt$1(i2);
1730
+ const { semantic: o2 } = It$1(i2);
1673
1731
  o2.length > 0 && (e2.classes = o2);
1674
1732
  }
1675
1733
  }
@@ -1698,7 +1756,7 @@ let st$1 = class st {
1698
1756
  * @returns True if should be ignored
1699
1757
  */
1700
1758
  shouldIgnoreAttribute(t2) {
1701
- return !!(V$1.has(t2) || t2.startsWith("on") || t2.startsWith("ng-") || t2.startsWith("_ng") || t2.startsWith("data-reactid") || t2.startsWith("data-react") || t2.startsWith("data-v-"));
1759
+ return !!(Y$1.has(t2) || t2.startsWith("on") || t2.startsWith("ng-") || t2.startsWith("_ng") || t2.startsWith("data-reactid") || t2.startsWith("data-react") || t2.startsWith("data-v-"));
1702
1760
  }
1703
1761
  /**
1704
1762
  * Gets attribute priority
@@ -1733,7 +1791,7 @@ let st$1 = class st {
1733
1791
  const e2 = {};
1734
1792
  for (const s2 of Array.from(t2.attributes)) {
1735
1793
  const n2 = s2.name;
1736
- if (this.shouldIgnoreAttribute(n2) || !zt$1(n2, s2.value) || Q$1.has(n2) && Y$1(s2.value) || this.getAttributePriority(n2) === 0) continue;
1794
+ if (this.shouldIgnoreAttribute(n2) || !Qt$1(n2, s2.value) || Z$1.has(n2) && K$1(s2.value) || this.getAttributePriority(n2) === 0) continue;
1737
1795
  const i2 = n2 === "href" || n2 === "src" ? D$1(n2, s2.value) : s2.value;
1738
1796
  !i2 || i2.trim() === "" || this.isDynamicValue(i2) || (e2[n2] = i2);
1739
1797
  }
@@ -1745,7 +1803,7 @@ let st$1 = class st {
1745
1803
  extractText(t2) {
1746
1804
  const e2 = this.getDirectTextContent(t2);
1747
1805
  if (!e2) return null;
1748
- const s2 = F$1(e2);
1806
+ const s2 = j$1(e2);
1749
1807
  if (!s2) return null;
1750
1808
  const n2 = 100, a2 = e2.length > n2 ? e2.slice(0, n2) + "..." : e2, i2 = s2.length > n2 ? s2.slice(0, n2) + "..." : s2;
1751
1809
  return {
@@ -1793,7 +1851,7 @@ let st$1 = class st {
1793
1851
  ].includes(e2);
1794
1852
  }
1795
1853
  };
1796
- let Ft$1 = class Ft {
1854
+ let Yt$1 = class Yt {
1797
1855
  /**
1798
1856
  * Generates fingerprint for SVG element
1799
1857
  * @param element - SVG element to fingerprint
@@ -1904,11 +1962,11 @@ let Ft$1 = class Ft {
1904
1962
  return Math.abs(e2).toString(16).padStart(8, "0");
1905
1963
  }
1906
1964
  };
1907
- function jt$1(r2, t2 = 0) {
1908
- const e2 = r2.anchor.score, s2 = r2.path.length > 0 ? r2.path.reduce((o2, c2) => o2 + c2.score, 0) / r2.path.length : 0.5, n2 = r2.target.score, a2 = e2 * U$1.ANCHOR + s2 * U$1.PATH + n2 * U$1.TARGET + t2 * U$1.UNIQUENESS, i2 = r2.anchor.degraded ? 0.2 : 0;
1965
+ function Zt$1(r2, t2 = 0) {
1966
+ const e2 = r2.anchor.score, s2 = r2.path.length > 0 ? r2.path.reduce((o2, c2) => o2 + c2.score, 0) / r2.path.length : 0.5, n2 = r2.target.score, a2 = e2 * z$1.ANCHOR + s2 * z$1.PATH + n2 * z$1.TARGET + t2 * z$1.UNIQUENESS, i2 = r2.anchor.degraded ? 0.2 : 0;
1909
1967
  return Math.max(0, Math.min(1, a2 - i2));
1910
1968
  }
1911
- let Wt$1 = class Wt {
1969
+ let Kt$1 = class Kt {
1912
1970
  constructor(t2) {
1913
1971
  this.cache = /* @__PURE__ */ new Map(), this.maxSize = t2;
1914
1972
  }
@@ -1939,9 +1997,9 @@ let Wt$1 = class Wt {
1939
1997
  return this.cache.size;
1940
1998
  }
1941
1999
  };
1942
- let Bt$1 = class Bt {
2000
+ let Xt$1 = class Xt {
1943
2001
  constructor(t2 = {}) {
1944
- this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Wt$1(
2002
+ this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Kt$1(
1945
2003
  t2.maxSelectorCacheSize ?? 1e3
1946
2004
  ), this.anchorCache = /* @__PURE__ */ new WeakMap(), this.semanticsCache = /* @__PURE__ */ new WeakMap(), this.stats = {
1947
2005
  eidHits: 0,
@@ -2090,12 +2148,12 @@ let Bt$1 = class Bt {
2090
2148
  return s2 > 0 ? t2 / s2 : 0;
2091
2149
  }
2092
2150
  };
2093
- function Gt$1(r2) {
2094
- return new Bt$1(r2);
2151
+ function Jt$1(r2) {
2152
+ return new Xt$1(r2);
2095
2153
  }
2096
- let z$1 = null;
2097
- function Z$1() {
2098
- return z$1 || (z$1 = Gt$1()), z$1;
2154
+ let F$1 = null;
2155
+ function X$1() {
2156
+ return F$1 || (F$1 = Jt$1()), F$1;
2099
2157
  }
2100
2158
  function k$1(r2) {
2101
2159
  if (r2.ownerDocument)
@@ -2113,7 +2171,7 @@ function k$1(r2) {
2113
2171
  3. You are working with a document node instead of an element`
2114
2172
  );
2115
2173
  }
2116
- function Vt$1(r2, t2) {
2174
+ function te$1(r2, t2) {
2117
2175
  if (!t2)
2118
2176
  return;
2119
2177
  const e2 = k$1(r2), s2 = t2 instanceof Document ? t2 : k$1(t2);
@@ -2128,64 +2186,65 @@ Common causes:
2128
2186
  Solution: Ensure element and root parameter are from the same document context.`
2129
2187
  );
2130
2188
  }
2131
- function X$1(r2, t2 = {}) {
2189
+ function J$1(r2, t2 = {}) {
2132
2190
  var _a2;
2133
2191
  if (!r2 || !r2.ownerDocument || !r2.isConnected)
2134
2192
  return null;
2135
- const e2 = { ...bt$1, ...t2 };
2193
+ const e2 = { ...At$1, ...t2 };
2136
2194
  if (e2.root)
2137
2195
  try {
2138
- Vt$1(r2, e2.root);
2196
+ te$1(r2, e2.root);
2139
2197
  } catch (x2) {
2140
2198
  return console.error("Cross-document generation detected:", x2), null;
2141
2199
  }
2142
- const s2 = e2.cache ?? Z$1(), n2 = s2.getEID(r2);
2200
+ const s2 = e2.cache ?? X$1(), n2 = s2.getEID(r2);
2143
2201
  if (n2 !== void 0)
2144
2202
  return n2;
2145
- if (r2.tagName.toLowerCase() === "html") {
2146
- const x2 = new st$1(e2, s2), y = Zt$1(r2, e2, x2);
2203
+ const a2 = r2.tagName.toLowerCase();
2204
+ if (a2 === "html") {
2205
+ const x2 = new nt$1(e2, s2), y = re$1(r2, e2, x2);
2147
2206
  return s2.setEID(r2, y), y;
2148
2207
  }
2149
- const i2 = new St$1(e2, s2), o2 = new $t$1(e2, s2), c2 = new st$1(e2, s2), u2 = new Ft$1(), d = i2.findAnchor(r2);
2150
- if (!d && !e2.fallbackToBody)
2208
+ const i2 = new Ct$1(e2, s2), o2 = new Pt$1(e2, s2), c2 = new nt$1(e2, s2), l2 = new Yt$1(), f2 = i2.findAnchor(r2);
2209
+ if (!f2 && !e2.fallbackToBody)
2151
2210
  return null;
2152
- const l2 = (d == null ? void 0 : d.element) ?? ((_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) ?? null;
2153
- if (!l2) return null;
2154
- const h = !d || d.tier === "C", g = l2.tagName.toLowerCase(), f2 = l2.parentElement;
2155
- let m;
2156
- if (f2 && g !== "body" && g !== "html") {
2157
- const y = Array.from(f2.children).indexOf(l2);
2158
- y !== -1 && (m = y + 1);
2159
- }
2160
- const p = c2.extract(l2), b = {
2161
- tag: l2.tagName.toLowerCase(),
2162
- semantics: p,
2163
- score: (d == null ? void 0 : d.score) ?? I$1.DEGRADED_SCORE,
2164
- degraded: h,
2165
- nthChild: m
2166
- }, S = o2.buildPath(l2, r2, c2), E = c2.extract(r2);
2167
- e2.enableSvgFingerprint && Qt$1(r2) && (E.svg = u2.fingerprint(r2));
2211
+ const h = (f2 == null ? void 0 : f2.element) ?? ((_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) ?? null;
2212
+ if (!h) return null;
2213
+ const d = !f2 || f2.tier === "C", u2 = h.tagName.toLowerCase(), g = c2.extract(h), m = h.parentElement;
2214
+ let p;
2215
+ if (m && u2 !== "body" && u2 !== "html" && _$1(u2, g, h)) {
2216
+ const y = Array.from(m.children).indexOf(h);
2217
+ y !== -1 && (p = y + 1);
2218
+ }
2219
+ const b = {
2220
+ tag: h.tagName.toLowerCase(),
2221
+ semantics: g,
2222
+ score: (f2 == null ? void 0 : f2.score) ?? I$1.DEGRADED_SCORE,
2223
+ degraded: d,
2224
+ nthChild: p
2225
+ }, S = o2.buildPath(h, r2, c2), T = c2.extract(r2);
2226
+ e2.enableSvgFingerprint && ee$1(r2) && (T.svg = l2.fingerprint(r2));
2168
2227
  const C = r2.parentElement;
2169
2228
  let A;
2170
- if (C) {
2229
+ if (C && _$1(a2, T, r2)) {
2171
2230
  const y = Array.from(C.children).indexOf(r2);
2172
2231
  y !== -1 && (A = y + 1);
2173
2232
  }
2174
2233
  const v2 = {
2175
2234
  tag: r2.tagName.toLowerCase(),
2176
- semantics: E,
2235
+ semantics: T,
2177
2236
  score: c2.scoreElement(r2),
2178
2237
  nthChild: A
2179
- }, H = [], $ = {
2238
+ }, P = [], $ = {
2180
2239
  onMultiple: "best-score",
2181
2240
  onMissing: "anchor-only",
2182
2241
  maxDepth: 3
2183
- }, T = b.degraded || S.degraded, R = Yt$1(b.degraded, S), N = {
2242
+ }, E = b.degraded || S.degraded, R = se$1(b.degraded, S), N = {
2184
2243
  version: "1.0",
2185
2244
  anchor: b,
2186
2245
  path: S.path,
2187
2246
  target: v2,
2188
- constraints: H,
2247
+ constraints: P,
2189
2248
  fallback: $,
2190
2249
  meta: {
2191
2250
  confidence: 0,
@@ -2193,16 +2252,16 @@ function X$1(r2, t2 = {}) {
2193
2252
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
2194
2253
  generator: "dom-eid@1.0",
2195
2254
  source: e2.source,
2196
- degraded: T,
2255
+ degraded: E,
2197
2256
  degradationReason: R
2198
2257
  }
2199
2258
  };
2200
- return N.meta.confidence = jt$1(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
2259
+ return N.meta.confidence = Zt$1(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
2201
2260
  }
2202
- function Qt$1(r2) {
2261
+ function ee$1(r2) {
2203
2262
  return r2.namespaceURI === "http://www.w3.org/2000/svg" || r2.tagName.toLowerCase() === "svg" || r2 instanceof SVGElement;
2204
2263
  }
2205
- function Yt$1(r2, t2) {
2264
+ function se$1(r2, t2) {
2206
2265
  if (r2 && t2.degraded)
2207
2266
  return "anchor-and-path-degraded";
2208
2267
  if (r2)
@@ -2210,7 +2269,7 @@ function Yt$1(r2, t2) {
2210
2269
  if (t2.degraded)
2211
2270
  return t2.degradationReason;
2212
2271
  }
2213
- function Zt$1(r2, t2, e2, s2) {
2272
+ function re$1(r2, t2, e2, s2) {
2214
2273
  const a2 = {
2215
2274
  tag: "html",
2216
2275
  semantics: e2.extract(r2),
@@ -2239,91 +2298,119 @@ function Zt$1(r2, t2, e2, s2) {
2239
2298
  }
2240
2299
  };
2241
2300
  }
2242
- const ct$1 = {
2301
+ const ht$2 = {
2302
+ id: "i",
2303
+ "data-testid": "tid",
2304
+ "data-qa": "qa",
2305
+ "data-cy": "cy",
2306
+ "data-test": "dt",
2307
+ "aria-label": "al",
2308
+ "aria-labelledby": "alb",
2309
+ "aria-describedby": "adb",
2310
+ name: "n",
2311
+ href: "h",
2312
+ src: "s",
2313
+ type: "t",
2314
+ role: "r",
2315
+ alt: "at",
2316
+ title: "tt",
2317
+ for: "f",
2318
+ placeholder: "ph",
2319
+ text: "x"
2320
+ }, G$1 = Object.fromEntries(
2321
+ Object.entries(ht$2).map(([r2, t2]) => [t2, r2])
2322
+ ), ut$1 = {
2243
2323
  maxClasses: 2,
2244
2324
  maxAttributes: 5,
2245
2325
  includeText: true,
2246
2326
  maxTextLength: 50,
2247
2327
  simplifyTarget: true,
2248
- includeConstraints: true
2328
+ includeConstraints: true,
2329
+ format: "compact"
2249
2330
  };
2250
- function it$1(r2) {
2331
+ function ct$1(r2) {
2251
2332
  return r2 === "id" ? 101 : w$1[r2] !== void 0 ? w$1[r2] : r2.startsWith("data-") ? w$1["data-*"] : r2.startsWith("aria-") ? w$1["aria-*"] : 0;
2252
2333
  }
2253
- function ae$1(r2) {
2334
+ function de$1(r2) {
2254
2335
  return ["id", "data-testid", "data-qa", "data-cy", "href", "text", "role"].includes(r2);
2255
2336
  }
2256
- function ie$1(r2) {
2337
+ function fe$1(r2) {
2257
2338
  return !!(/@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/.test(r2) || /(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}/.test(r2) || /\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}/.test(r2));
2258
2339
  }
2259
- function oe$1(r2, t2) {
2260
- const e2 = { ...ct$1, ...t2 }, s2 = `v${r2.version}`, n2 = j$1(r2.anchor, false, e2), a2 = r2.path.length > 0 ? r2.path.map((c2) => j$1(c2, false, e2)).join(" > ") + " > " : "", i2 = j$1(r2.target, true, e2), o2 = e2.includeConstraints ? le$1(r2) : "";
2261
- return `${s2}: ${n2} :: ${a2}${i2}${o2}`;
2262
- }
2263
- function j$1(r2, t2 = false, e2 = ct$1) {
2264
- const { tag: s2, semantics: n2 } = r2;
2265
- let a2 = s2;
2266
- const i2 = [], o2 = { ...n2.attributes };
2267
- n2.id && (o2.id = n2.id), n2.role && !o2.role && (o2.role = n2.role);
2268
- const c2 = Object.entries(o2).map(([l2, h]) => {
2269
- const g = it$1(l2), f2 = l2 === "href" || l2 === "src" ? D$1(l2, h) : h;
2270
- return { name: l2, value: f2, priority: g };
2271
- }).filter((l2) => l2.name !== "id" && l2.name !== "class" && V$1.has(l2.name) || Q$1.has(l2.name) && Y$1(l2.value) ? false : l2.priority > 0 || l2.name === "role" || l2.name === "id");
2272
- c2.sort((l2, h) => h.priority - l2.priority);
2273
- const u2 = c2.slice(0, e2.maxAttributes);
2274
- u2.sort((l2, h) => l2.name.localeCompare(h.name));
2275
- for (const { name: l2, value: h } of u2)
2276
- i2.push(`${l2}="${B$1(h)}"`);
2277
- if (e2.includeText && n2.text && !ie$1(n2.text.normalized)) {
2278
- const l2 = n2.text.normalized;
2279
- l2.length > 0 && l2.length <= e2.maxTextLength && i2.push(`text="${B$1(l2)}"`);
2280
- }
2281
- let d = i2;
2282
- if (i2.length > 0 && (t2 && e2.simplifyTarget && n2.id && (d = i2.filter((l2) => {
2283
- const h = l2.split("=")[0];
2284
- return it$1(h) >= 60 || h === "text" || h === "id" || h === "role";
2285
- })), d.length > 0 && d.sort((l2, h) => l2.localeCompare(h))), n2.classes && n2.classes.length > 0) {
2286
- const l2 = M$1(n2.classes), h = !!n2.id || i2.some(
2287
- (f2) => f2.startsWith("href=") || f2.startsWith("data-testid=") || f2.startsWith("text=") || f2.startsWith("role=")
2288
- );
2289
- if (!(t2 && e2.simplifyTarget && h) && l2.length > 0) {
2290
- const f2 = l2.sort().slice(0, e2.maxClasses);
2291
- a2 += f2.map((m) => `.${m}`).join("");
2340
+ function ge$1(r2, t2) {
2341
+ const e2 = { ...ut$1, ...t2 }, s2 = e2.format === "compact", n2 = s2 ? "v1" : `v${r2.version}`, a2 = s2 ? ":" : ": ", i2 = s2 ? "::" : " :: ", o2 = s2 ? ">" : " > ", c2 = e2.includeText && r2.target.semantics.text ? r2.target.semantics.text.normalized : void 0, l2 = W$1(r2.anchor, false, e2), f2 = r2.path.length > 0 ? r2.path.map((u2) => W$1(u2, false, e2, c2)).join(o2) + o2 : "", h = W$1(r2.target, true, e2), d = e2.includeConstraints ? pe$1(r2, e2) : "";
2342
+ return `${n2}${a2}${l2}${i2}${f2}${h}${d}`;
2343
+ }
2344
+ function W$1(r2, t2 = false, e2 = ut$1, s2) {
2345
+ const { tag: n2, semantics: a2 } = r2, i2 = e2.format === "compact";
2346
+ let o2 = n2;
2347
+ const c2 = [], l2 = { ...a2.attributes };
2348
+ a2.id && (l2.id = a2.id), a2.role && !l2.role && (l2.role = a2.role);
2349
+ const f2 = Object.entries(l2).map(([u2, g]) => {
2350
+ const m = ct$1(u2), p = u2 === "href" || u2 === "src" ? D$1(u2, g) : g;
2351
+ return { name: u2, value: p, priority: m };
2352
+ }).filter((u2) => u2.name !== "id" && u2.name !== "class" && Y$1.has(u2.name) || Z$1.has(u2.name) && K$1(u2.value) ? false : u2.priority > 0 || u2.name === "role" || u2.name === "id");
2353
+ f2.sort((u2, g) => g.priority - u2.priority);
2354
+ const h = f2.slice(0, e2.maxAttributes);
2355
+ h.sort((u2, g) => u2.name.localeCompare(g.name));
2356
+ for (const { name: u2, value: g } of h) {
2357
+ const m = i2 ? ht$2[u2] ?? u2 : u2;
2358
+ c2.push(`${m}="${V$1(g)}"`);
2359
+ }
2360
+ if (e2.includeText && a2.text && !fe$1(a2.text.normalized)) {
2361
+ const u2 = a2.text.normalized;
2362
+ if (u2.length > 0 && u2.length <= e2.maxTextLength && !(!t2 && s2 !== void 0 && u2 === s2)) {
2363
+ const m = i2 ? "x" : "text";
2364
+ c2.push(`${m}="${V$1(u2)}"`);
2365
+ }
2366
+ }
2367
+ let d = c2;
2368
+ if (c2.length > 0 && t2 && e2.simplifyTarget && a2.id && (d = c2.filter((u2) => {
2369
+ const g = u2.split("=")[0], m = G$1[g] ?? g;
2370
+ return ct$1(m) >= 60 || m === "text" || m === "id" || m === "role";
2371
+ })), a2.classes && a2.classes.length > 0) {
2372
+ const u2 = M$1(a2.classes), g = !!a2.id || c2.some((p) => {
2373
+ const b = p.split("=")[0], S = G$1[b] ?? b;
2374
+ return S === "href" || S === "data-testid" || S === "text" || S === "role";
2375
+ });
2376
+ if (!(t2 && e2.simplifyTarget && g) && u2.length > 0) {
2377
+ const p = u2.sort().slice(0, e2.maxClasses);
2378
+ o2 += p.map((b) => `.${b}`).join("");
2292
2379
  }
2293
2380
  }
2294
- if (d.length > 0 && (a2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
2295
- const l2 = !!n2.id || n2.attributes && Object.keys(n2.attributes).some(ae$1);
2296
- t2 && e2.simplifyTarget && l2 || (a2 += `#${r2.nthChild}`);
2381
+ if (d.length > 0 && (o2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
2382
+ const u2 = !!a2.id || a2.attributes && Object.keys(a2.attributes).some(de$1);
2383
+ t2 && e2.simplifyTarget && u2 || (o2 += `#${r2.nthChild}`);
2297
2384
  }
2298
- return a2;
2385
+ return o2;
2299
2386
  }
2300
- function le$1(r2) {
2387
+ function pe$1(r2, t2) {
2301
2388
  if (!r2.constraints || r2.constraints.length === 0)
2302
2389
  return "";
2303
- const t2 = [];
2304
- for (const e2 of r2.constraints)
2305
- switch (e2.type) {
2390
+ const e2 = [];
2391
+ for (const n2 of r2.constraints)
2392
+ switch (n2.type) {
2306
2393
  case "uniqueness":
2307
- t2.push("unique=true");
2394
+ e2.push("unique=true");
2308
2395
  break;
2309
2396
  case "position":
2310
- e2.params && e2.params.strategy && t2.push(`pos=${e2.params.strategy}`);
2397
+ n2.params && n2.params.strategy && e2.push(`pos=${n2.params.strategy}`);
2311
2398
  break;
2312
2399
  case "text-proximity":
2313
- if (e2.params && e2.params.reference) {
2314
- const s2 = B$1(String(e2.params.reference));
2315
- t2.push(`text="${s2}"`);
2400
+ if (n2.params && n2.params.reference) {
2401
+ const a2 = V$1(String(n2.params.reference));
2402
+ e2.push(`text="${a2}"`);
2316
2403
  }
2317
2404
  break;
2318
2405
  }
2319
- return t2.length === 0 ? "" : ` {${t2.join(",")}}`;
2406
+ return e2.length === 0 ? "" : `${t2.format === "verbose" ? " " : ""}{${e2.join(",")}}`;
2320
2407
  }
2321
- function B$1(r2) {
2408
+ function V$1(r2) {
2322
2409
  return r2.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/>/g, "\\>").replace(/:/g, "\\:");
2323
2410
  }
2324
- function xe$1(r2, t2, e2) {
2325
- const s2 = X$1(r2, t2);
2326
- return s2 ? oe$1(s2, e2) : null;
2411
+ function Ne$1(r2, t2, e2) {
2412
+ const s2 = J$1(r2, t2);
2413
+ return s2 ? ge$1(s2, e2) : null;
2327
2414
  }
2328
2415
  let _id = 1;
2329
2416
  const tagNameRegex = new RegExp("[^a-z0-9-_:]");
@@ -2996,7 +3083,7 @@ function serializeNodeWithId(n2, options) {
2996
3083
  enableSvgFingerprint: selectorOptions.enableSvgFingerprint,
2997
3084
  fallbackToBody: selectorOptions.fallbackToBody
2998
3085
  };
2999
- const selector = xe$1(n2, seqlGeneratorOptions);
3086
+ const selector = Ne$1(n2, seqlGeneratorOptions);
3000
3087
  if (selector) {
3001
3088
  serializedNode.selector = selector;
3002
3089
  }
@@ -7573,6 +7660,29 @@ try {
7573
7660
  }
7574
7661
  } catch (error) {
7575
7662
  }
7663
+ const ht$1 = {
7664
+ id: "i",
7665
+ "data-testid": "tid",
7666
+ "data-qa": "qa",
7667
+ "data-cy": "cy",
7668
+ "data-test": "dt",
7669
+ "aria-label": "al",
7670
+ "aria-labelledby": "alb",
7671
+ "aria-describedby": "adb",
7672
+ name: "n",
7673
+ href: "h",
7674
+ src: "s",
7675
+ type: "t",
7676
+ role: "r",
7677
+ alt: "at",
7678
+ title: "tt",
7679
+ for: "f",
7680
+ placeholder: "ph",
7681
+ text: "x"
7682
+ };
7683
+ Object.fromEntries(
7684
+ Object.entries(ht$1).map(([r2, t2]) => [t2, r2])
7685
+ );
7576
7686
  function getDefaultExportFromCjs(x2) {
7577
7687
  return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
7578
7688
  }
@@ -13185,7 +13295,7 @@ var NodeType = /* @__PURE__ */ ((NodeType2) => {
13185
13295
  NodeType2[NodeType2["Comment"] = 5] = "Comment";
13186
13296
  return NodeType2;
13187
13297
  })(NodeType || {});
13188
- const U = {
13298
+ const z = {
13189
13299
  ANCHOR: 0.4,
13190
13300
  PATH: 0.3,
13191
13301
  TARGET: 0.2,
@@ -13199,9 +13309,9 @@ const U = {
13199
13309
  DEPTH_PENALTY_THRESHOLD: 5,
13200
13310
  DEPTH_PENALTY_FACTOR: 0.05,
13201
13311
  DEGRADED_SCORE: 0.3
13202
- }, gt = {
13312
+ }, bt = {
13203
13313
  MIN_CONFIDENCE_FOR_SKIP: 0.7
13204
- }, K = [
13314
+ }, tt = [
13205
13315
  "form",
13206
13316
  "main",
13207
13317
  "nav",
@@ -13209,7 +13319,7 @@ const U = {
13209
13319
  "article",
13210
13320
  "footer",
13211
13321
  "header"
13212
- ], J = [
13322
+ ], et = [
13213
13323
  "form",
13214
13324
  "navigation",
13215
13325
  "main",
@@ -13218,7 +13328,7 @@ const U = {
13218
13328
  "complementary",
13219
13329
  "banner",
13220
13330
  "search"
13221
- ], mt = [
13331
+ ], St = [
13222
13332
  // HTML5 Semantic
13223
13333
  "article",
13224
13334
  "aside",
@@ -13322,7 +13432,7 @@ const U = {
13322
13432
  "data-*": 30,
13323
13433
  // Any aria-* attribute (if not above)
13324
13434
  "aria-*": 25
13325
- }, V = /* @__PURE__ */ new Set([
13435
+ }, Y = /* @__PURE__ */ new Set([
13326
13436
  "id",
13327
13437
  // handled separately
13328
13438
  "class",
@@ -13334,7 +13444,7 @@ const U = {
13334
13444
  "tabindex",
13335
13445
  // can change
13336
13446
  "contenteditable"
13337
- ]), bt = {
13447
+ ]), At = {
13338
13448
  maxPathDepth: 10,
13339
13449
  enableSvgFingerprint: true,
13340
13450
  confidenceThreshold: 0,
@@ -13342,7 +13452,7 @@ const U = {
13342
13452
  includeUtilityClasses: false,
13343
13453
  source: "dom-dsl"
13344
13454
  };
13345
- function P(r2) {
13455
+ function L(r2) {
13346
13456
  if (/^[a-z]+-\d+$/i.test(r2) || /^[a-z]+(-[a-z]+)+-\d+$/i.test(r2) || /^[a-z]+(_[a-z]+)*_\d+$/i.test(r2) || /^\d+$/.test(r2) || /^:[a-z0-9]+:$/i.test(r2) || /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(r2))
13347
13457
  return true;
13348
13458
  if (/^[a-z]{1,3}[A-Za-z0-9]{8,}$/.test(r2)) {
@@ -13352,7 +13462,7 @@ function P(r2) {
13352
13462
  }
13353
13463
  return !!(/^radix-/.test(r2) || /^mui-\d+$/.test(r2));
13354
13464
  }
13355
- const Q = /* @__PURE__ */ new Set([
13465
+ const Z = /* @__PURE__ */ new Set([
13356
13466
  "aria-labelledby",
13357
13467
  "aria-describedby",
13358
13468
  "aria-controls",
@@ -13366,10 +13476,10 @@ const Q = /* @__PURE__ */ new Set([
13366
13476
  "aria-errormessage",
13367
13477
  "aria-flowto"
13368
13478
  ]);
13369
- function Y(r2) {
13370
- return r2.trim().split(/\s+/).some((e2) => P(e2));
13479
+ function K(r2) {
13480
+ return r2.trim().split(/\s+/).some((e2) => L(e2));
13371
13481
  }
13372
- class St2 {
13482
+ class Ct2 {
13373
13483
  constructor(t2, e2) {
13374
13484
  this.maxDepth = t2.maxPathDepth ?? 10, this.cache = e2;
13375
13485
  }
@@ -13402,25 +13512,25 @@ class St2 {
13402
13512
  if (e2 === "head" || this.isInsideHead(t2)) {
13403
13513
  const c2 = s2 == null ? void 0 : s2.documentElement;
13404
13514
  if (c2) {
13405
- const u2 = {
13515
+ const l2 = {
13406
13516
  element: c2,
13407
13517
  score: 1,
13408
13518
  tier: "A",
13409
13519
  depth: 0
13410
13520
  };
13411
- return this.cacheResult(t2, u2), u2;
13521
+ return this.cacheResult(t2, l2), l2;
13412
13522
  }
13413
13523
  }
13414
13524
  if (e2 === "body") {
13415
13525
  const c2 = s2 == null ? void 0 : s2.documentElement;
13416
13526
  if (c2) {
13417
- const u2 = {
13527
+ const l2 = {
13418
13528
  element: c2,
13419
13529
  score: 1,
13420
13530
  tier: "A",
13421
13531
  depth: 0
13422
13532
  };
13423
- return this.cacheResult(t2, u2), u2;
13533
+ return this.cacheResult(t2, l2), l2;
13424
13534
  }
13425
13535
  }
13426
13536
  let n2 = t2.parentElement, a2 = 0, i2 = null;
@@ -13434,10 +13544,10 @@ class St2 {
13434
13544
  };
13435
13545
  const c2 = this.scoreAnchor(n2);
13436
13546
  if (c2 > 0) {
13437
- const u2 = this.applyDepthPenalty(c2, a2), d = this.getTier(n2), l2 = { element: n2, score: u2, tier: d, depth: a2 };
13438
- if (d === "A")
13439
- return l2;
13440
- (!i2 || u2 > i2.score) && (i2 = l2);
13547
+ const l2 = this.applyDepthPenalty(c2, a2), f2 = this.getTier(n2), h = { element: n2, score: l2, tier: f2, depth: a2 };
13548
+ if (f2 === "A")
13549
+ return h;
13550
+ (!i2 || l2 > i2.score) && (i2 = h);
13441
13551
  }
13442
13552
  n2 = n2.parentElement, a2++;
13443
13553
  }
@@ -13452,11 +13562,11 @@ class St2 {
13452
13562
  scoreAnchor(t2) {
13453
13563
  let e2 = 0;
13454
13564
  const s2 = t2.tagName.toLowerCase();
13455
- K.includes(s2) && (e2 += I.SEMANTIC_TAG);
13565
+ tt.includes(s2) && (e2 += I.SEMANTIC_TAG);
13456
13566
  const n2 = t2.getAttribute("role");
13457
- n2 && J.includes(n2) && (e2 += I.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I.ARIA_LABEL);
13567
+ n2 && et.includes(n2) && (e2 += I.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I.ARIA_LABEL);
13458
13568
  const a2 = t2.id;
13459
- return a2 && !P(a2) && (e2 += I.STABLE_ID), (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test")) && (e2 += I.TEST_MARKER), Math.min(e2, 1);
13569
+ return a2 && !L(a2) && (e2 += I.STABLE_ID), (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test")) && (e2 += I.TEST_MARKER), Math.min(e2, 1);
13460
13570
  }
13461
13571
  /**
13462
13572
  * Applies depth penalty to score
@@ -13473,10 +13583,10 @@ class St2 {
13473
13583
  */
13474
13584
  getTier(t2) {
13475
13585
  const e2 = t2.tagName.toLowerCase();
13476
- if (K.includes(e2))
13586
+ if (tt.includes(e2))
13477
13587
  return "A";
13478
13588
  const s2 = t2.getAttribute("role");
13479
- return s2 && J.includes(s2) ? "B" : "C";
13589
+ return s2 && et.includes(s2) ? "B" : "C";
13480
13590
  }
13481
13591
  /**
13482
13592
  * Checks if element is inside <head> section.
@@ -13509,7 +13619,7 @@ class St2 {
13509
13619
  this.cache && this.cache.setAnchor(t2, e2);
13510
13620
  }
13511
13621
  }
13512
- const At = [
13622
+ const Tt = [
13513
13623
  // CSS-in-JS
13514
13624
  /^css-[a-z0-9]+$/i,
13515
13625
  /^sc-[a-z0-9]+-\d+$/i,
@@ -13529,7 +13639,7 @@ const At = [
13529
13639
  /^_[a-z0-9]{5,}$/i,
13530
13640
  /\d{5,}/
13531
13641
  // 5+ digits in a row
13532
- ], xt = [
13642
+ ], Et = [
13533
13643
  // === FIX 4: Tailwind arbitrary values and variants (highest priority) ===
13534
13644
  /^\[/,
13535
13645
  // Any arbitrary value or variant starting with [ (e.g., [&_svg]:..., [mask-type:luminance])
@@ -13641,29 +13751,81 @@ const At = [
13641
13751
  /^pull-(left|right)$/,
13642
13752
  /^float-(left|right|none)$/
13643
13753
  ];
13644
- function O(r2) {
13645
- return At.some((t2) => t2.test(r2));
13754
+ function q(r2) {
13755
+ return Tt.some((t2) => t2.test(r2));
13646
13756
  }
13647
- function _(r2) {
13648
- return r2.length <= 2 || /^\d/.test(r2) ? true : xt.some((t2) => t2.test(r2));
13757
+ function U(r2) {
13758
+ return r2.length <= 2 || /^\d/.test(r2) ? true : Et.some((t2) => t2.test(r2));
13649
13759
  }
13650
- function Et(r2) {
13651
- return !O(r2) && !_(r2);
13760
+ function $t(r2) {
13761
+ return !q(r2) && !U(r2);
13652
13762
  }
13653
13763
  function M(r2) {
13654
- return r2.filter((t2) => Et(t2));
13764
+ return r2.filter((t2) => $t(t2));
13655
13765
  }
13656
- function vt(r2) {
13766
+ function It(r2) {
13657
13767
  const t2 = [], e2 = [];
13658
13768
  for (const s2 of r2)
13659
- _(s2) || O(s2) ? e2.push(s2) : t2.push(s2);
13769
+ U(s2) || q(s2) ? e2.push(s2) : t2.push(s2);
13660
13770
  return { semantic: t2, utility: e2 };
13661
13771
  }
13662
- function tt(r2) {
13663
- return _(r2) || O(r2);
13772
+ function st(r2) {
13773
+ return U(r2) || q(r2);
13774
+ }
13775
+ const Rt = /* @__PURE__ */ new Set([
13776
+ "tr",
13777
+ "td",
13778
+ "th",
13779
+ "thead",
13780
+ "tbody",
13781
+ "tfoot"
13782
+ ]), Dt = /* @__PURE__ */ new Set([
13783
+ "data-testid",
13784
+ "data-qa",
13785
+ "data-cy",
13786
+ "data-test",
13787
+ "aria-label",
13788
+ "name",
13789
+ "href"
13790
+ ]);
13791
+ function Mt(r2) {
13792
+ if (r2.id) return true;
13793
+ if (r2.attributes) {
13794
+ for (const t2 of Object.keys(r2.attributes))
13795
+ if (Dt.has(t2)) return true;
13796
+ }
13797
+ return false;
13798
+ }
13799
+ function Lt(r2, t2, e2) {
13800
+ var _a2;
13801
+ const s2 = r2.parentElement;
13802
+ if (!s2) return true;
13803
+ for (const n2 of Array.from(s2.children)) {
13804
+ if (n2 === r2 || n2.tagName.toLowerCase() !== t2) continue;
13805
+ if ((((_a2 = n2.textContent) == null ? void 0 : _a2.trim()) ?? "") === e2) return false;
13806
+ }
13807
+ return true;
13808
+ }
13809
+ function _(r2, t2, e2) {
13810
+ var _a2;
13811
+ if (Rt.has(r2)) return true;
13812
+ if (Mt(t2)) return false;
13813
+ if (e2) {
13814
+ const s2 = e2.parentElement;
13815
+ if (s2) {
13816
+ const n2 = (_a2 = t2.text) == null ? void 0 : _a2.normalized;
13817
+ if (n2 && Lt(e2, r2, n2))
13818
+ return false;
13819
+ if (Array.from(s2.children).some(
13820
+ (i2) => i2 !== e2 && i2.tagName.toLowerCase() === r2
13821
+ )) return true;
13822
+ }
13823
+ return false;
13824
+ }
13825
+ return true;
13664
13826
  }
13665
- const et = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
13666
- class $t2 {
13827
+ const rt = (r2) => r2.replace(/([#:.[\]@])/g, "\\$1");
13828
+ class Pt2 {
13667
13829
  constructor(t2, e2) {
13668
13830
  this.maxDepth = t2.maxPathDepth ?? 10, this.cache = e2;
13669
13831
  }
@@ -13698,19 +13860,22 @@ class $t2 {
13698
13860
  degraded: true,
13699
13861
  degradationReason: "target-not-descendant-of-anchor"
13700
13862
  };
13701
- let u2 = this.filterNoise(i2);
13702
- return u2 = this.ensureUniqueness(i2, u2, t2, e2, s2), {
13703
- path: u2.map((l2) => {
13704
- const h = l2.parentElement;
13863
+ let l2 = this.filterNoise(i2);
13864
+ return l2 = this.ensureUniqueness(i2, l2, t2, e2, s2), {
13865
+ path: l2.map((h) => {
13866
+ const d = h.tagName.toLowerCase(), u2 = s2.extract(h);
13705
13867
  let g;
13706
- if (h) {
13707
- const m = Array.from(h.children).indexOf(l2);
13708
- m !== -1 && (g = m + 1);
13868
+ if (_(d, u2, h)) {
13869
+ const m = h.parentElement;
13870
+ if (m) {
13871
+ const b = Array.from(m.children).indexOf(h);
13872
+ b !== -1 && (g = b + 1);
13873
+ }
13709
13874
  }
13710
13875
  return {
13711
- tag: l2.tagName.toLowerCase(),
13712
- semantics: s2.extract(l2),
13713
- score: s2.scoreElement(l2),
13876
+ tag: d,
13877
+ semantics: u2,
13878
+ score: s2.scoreElement(h),
13714
13879
  nthChild: g
13715
13880
  };
13716
13881
  }),
@@ -13735,27 +13900,27 @@ class $t2 {
13735
13900
  if (!o2) return e2;
13736
13901
  let c2;
13737
13902
  if (this.cache) {
13738
- const d = this.cache.getSelectorResults(i2);
13739
- d !== void 0 ? c2 = d : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
13903
+ const f2 = this.cache.getSelectorResults(i2);
13904
+ f2 !== void 0 ? c2 = f2 : (c2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, c2));
13740
13905
  } else
13741
13906
  c2 = o2.querySelectorAll(i2);
13742
13907
  if (c2.length <= 1)
13743
13908
  return e2;
13744
- const u2 = t2.filter((d) => !e2.includes(d));
13745
- for (const d of u2) {
13746
- if (a2.scoreElement(d) < gt.MIN_CONFIDENCE_FOR_SKIP)
13909
+ const l2 = t2.filter((f2) => !e2.includes(f2));
13910
+ for (const f2 of l2) {
13911
+ if (a2.scoreElement(f2) < bt.MIN_CONFIDENCE_FOR_SKIP)
13747
13912
  continue;
13748
- const h = this.insertNodeInOrder(e2, d, t2), g = this.buildTestSelector(s2, h, n2);
13913
+ const d = this.insertNodeInOrder(e2, f2, t2), u2 = this.buildTestSelector(s2, d, n2);
13749
13914
  try {
13750
- let f2;
13915
+ let g;
13751
13916
  if (this.cache) {
13752
- const m = this.cache.getSelectorResults(g);
13753
- m !== void 0 ? f2 = m : (f2 = Array.from(o2.querySelectorAll(g)), this.cache.setSelectorResults(g, f2));
13917
+ const m = this.cache.getSelectorResults(u2);
13918
+ m !== void 0 ? g = m : (g = Array.from(o2.querySelectorAll(u2)), this.cache.setSelectorResults(u2, g));
13754
13919
  } else
13755
- f2 = o2.querySelectorAll(g);
13756
- if (f2.length === 1)
13757
- return h;
13758
- f2.length < c2.length && (e2 = h);
13920
+ g = o2.querySelectorAll(u2);
13921
+ if (g.length === 1)
13922
+ return d;
13923
+ g.length < c2.length && (e2 = d);
13759
13924
  } catch {
13760
13925
  }
13761
13926
  }
@@ -13789,9 +13954,9 @@ class $t2 {
13789
13954
  */
13790
13955
  elementToSelector(t2) {
13791
13956
  let e2 = t2.tagName.toLowerCase();
13792
- t2.id && !P(t2.id) && (e2 += `#${et(t2.id)}`);
13957
+ t2.id && !L(t2.id) && (e2 += `#${rt(t2.id)}`);
13793
13958
  for (const s2 of Array.from(t2.classList))
13794
- tt(s2) || (e2 += `.${et(s2)}`);
13959
+ st(s2) || (e2 += `.${rt(s2)}`);
13795
13960
  return e2;
13796
13961
  }
13797
13962
  /**
@@ -13805,7 +13970,7 @@ class $t2 {
13805
13970
  */
13806
13971
  shouldInclude(t2) {
13807
13972
  const e2 = t2.tagName.toLowerCase();
13808
- return mt.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
13973
+ return St.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
13809
13974
  }
13810
13975
  /**
13811
13976
  * Checks if element has meaningful semantic features
@@ -13816,12 +13981,12 @@ class $t2 {
13816
13981
  if (s2.name.startsWith("aria-")) return true;
13817
13982
  if (t2.classList.length > 0) {
13818
13983
  for (const s2 of Array.from(t2.classList))
13819
- if (!tt(s2)) return true;
13984
+ if (!st(s2)) return true;
13820
13985
  }
13821
13986
  if (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test"))
13822
13987
  return true;
13823
13988
  const e2 = t2.id;
13824
- return !!(e2 && !P(e2));
13989
+ return !!(e2 && !L(e2));
13825
13990
  }
13826
13991
  /**
13827
13992
  * Checks if element is inside <head> section.
@@ -13868,31 +14033,34 @@ class $t2 {
13868
14033
  degradationReason: "head-not-found-in-path"
13869
14034
  } : {
13870
14035
  path: n2.map((c2) => {
13871
- const u2 = c2.parentElement;
13872
- let d;
13873
- if (u2) {
13874
- const h = Array.from(u2.children).indexOf(c2);
13875
- h !== -1 && (d = h + 1);
14036
+ const l2 = c2.tagName.toLowerCase(), f2 = s2.extract(c2);
14037
+ let h;
14038
+ if (_(l2, f2, c2)) {
14039
+ const d = c2.parentElement;
14040
+ if (d) {
14041
+ const g = Array.from(d.children).indexOf(c2);
14042
+ g !== -1 && (h = g + 1);
14043
+ }
13876
14044
  }
13877
14045
  return {
13878
- tag: c2.tagName.toLowerCase(),
13879
- semantics: s2.extract(c2),
14046
+ tag: l2,
14047
+ semantics: f2,
13880
14048
  score: s2.scoreElement(c2),
13881
- nthChild: d
14049
+ nthChild: h
13882
14050
  };
13883
14051
  }),
13884
14052
  degraded: false
13885
14053
  };
13886
14054
  }
13887
14055
  }
13888
- function F(r2) {
14056
+ function j(r2) {
13889
14057
  return r2 ? r2.trim().replace(/[\n\t\r]/g, " ").replace(/\s+/g, " ") : "";
13890
14058
  }
13891
- const Nt = {
14059
+ const Ht = {
13892
14060
  preserveQueryForAbsolute: true,
13893
14061
  removeDynamicHashes: true
13894
14062
  };
13895
- function It(r2) {
14063
+ function kt(r2) {
13896
14064
  return r2 ? [
13897
14065
  /\d{5,}/,
13898
14066
  // 5+ digits
@@ -13906,18 +14074,18 @@ function It(r2) {
13906
14074
  // UUID-like
13907
14075
  ].some((e2) => e2.test(r2)) : false;
13908
14076
  }
13909
- function Rt(r2, t2) {
14077
+ function _t(r2, t2) {
13910
14078
  if (!r2) return r2;
13911
14079
  const e2 = r2.startsWith("http://") || r2.startsWith("https://"), [s2, n2] = r2.split("#"), [a2, i2] = s2.split("?");
13912
14080
  let o2 = a2;
13913
- return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && It(n2) || (o2 += `#${n2}`)), o2;
14081
+ return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), n2 && (t2.removeDynamicHashes && kt(n2) || (o2 += `#${n2}`)), o2;
13914
14082
  }
13915
14083
  function D(r2, t2, e2 = {}) {
13916
14084
  if (!t2) return t2;
13917
- const s2 = { ...Nt, ...e2 };
13918
- return r2 === "href" || r2 === "src" ? Rt(t2, s2) : t2;
14085
+ const s2 = { ...Ht, ...e2 };
14086
+ return r2 === "href" || r2 === "src" ? _t(t2, s2) : t2;
13919
14087
  }
13920
- const Dt = [
14088
+ const Ot = [
13921
14089
  "role",
13922
14090
  "aria-label",
13923
14091
  "aria-labelledby",
@@ -13928,7 +14096,7 @@ const Dt = [
13928
14096
  "aria-posinset",
13929
14097
  "aria-setsize",
13930
14098
  "aria-haspopup"
13931
- ], Mt = [
14099
+ ], qt = [
13932
14100
  "aria-selected",
13933
14101
  "aria-checked",
13934
14102
  "aria-pressed",
@@ -13941,7 +14109,7 @@ const Dt = [
13941
14109
  "aria-grabbed",
13942
14110
  "aria-live",
13943
14111
  "aria-atomic"
13944
- ], Pt = [
14112
+ ], Ut = [
13945
14113
  "data-state",
13946
14114
  "data-active",
13947
14115
  "data-inactive",
@@ -13960,7 +14128,7 @@ const Dt = [
13960
14128
  "data-hover",
13961
14129
  "data-orientation",
13962
14130
  "data-theme"
13963
- ], Ht = [
14131
+ ], zt = [
13964
14132
  "data-radix-",
13965
14133
  "data-headlessui-",
13966
14134
  "data-reach-",
@@ -13968,7 +14136,7 @@ const Dt = [
13968
14136
  "data-chakra-",
13969
14137
  "data-mantine-",
13970
14138
  "data-tw-"
13971
- ], Lt = [
14139
+ ], Ft = [
13972
14140
  "data-testid",
13973
14141
  "data-test-id",
13974
14142
  "data-test",
@@ -13980,7 +14148,7 @@ const Dt = [
13980
14148
  "data-entity-id",
13981
14149
  "data-product-id",
13982
14150
  "data-user-id"
13983
- ], kt = [
14151
+ ], jt = [
13984
14152
  // Google Analytics / GTM
13985
14153
  "data-ga",
13986
14154
  "data-gtm",
@@ -14016,7 +14184,7 @@ const Dt = [
14016
14184
  "data-conversion",
14017
14185
  "data-segment",
14018
14186
  "data-analytics"
14019
- ], qt = [
14187
+ ], Wt = [
14020
14188
  "data-category",
14021
14189
  // Google Analytics category
14022
14190
  "data-action",
@@ -14025,7 +14193,7 @@ const Dt = [
14025
14193
  // Google Analytics label
14026
14194
  "data-value"
14027
14195
  // Google Analytics value
14028
- ], Ot = [
14196
+ ], Bt = [
14029
14197
  "id",
14030
14198
  "name",
14031
14199
  "type",
@@ -14034,7 +14202,7 @@ const Dt = [
14034
14202
  "for",
14035
14203
  "alt",
14036
14204
  "href"
14037
- ], _t = [
14205
+ ], Gt = [
14038
14206
  "disabled",
14039
14207
  "checked",
14040
14208
  "selected",
@@ -14042,17 +14210,17 @@ const Dt = [
14042
14210
  "readonly",
14043
14211
  "required",
14044
14212
  "value"
14045
- ], Ut = [
14213
+ ], Vt = [
14046
14214
  /^radix-/,
14047
14215
  /^headlessui-/,
14048
14216
  /^mui-/,
14049
14217
  /:\w+:/
14050
14218
  // matches :ru:, :r1:, etc.
14051
14219
  ];
14052
- function zt(r2, t2) {
14053
- return Dt.includes(r2) ? true : Mt.includes(r2) || Pt.includes(r2) || Ht.some((e2) => r2.startsWith(e2)) ? false : Lt.includes(r2) ? true : kt.some((e2) => r2.startsWith(e2)) || qt.includes(r2) ? false : r2.startsWith("data-") && r2.endsWith("-id") ? true : r2 === "id" ? !Ut.some((e2) => e2.test(t2)) : Ot.includes(r2) ? true : _t.includes(r2) ? false : !!r2.startsWith("data-");
14220
+ function Qt(r2, t2) {
14221
+ return Ot.includes(r2) ? true : qt.includes(r2) || Ut.includes(r2) || zt.some((e2) => r2.startsWith(e2)) ? false : Ft.includes(r2) ? true : jt.some((e2) => r2.startsWith(e2)) || Wt.includes(r2) ? false : r2.startsWith("data-") && r2.endsWith("-id") ? true : r2 === "id" ? !Vt.some((e2) => e2.test(t2)) : Bt.includes(r2) ? true : Gt.includes(r2) ? false : !!r2.startsWith("data-");
14054
14222
  }
14055
- class st2 {
14223
+ class nt2 {
14056
14224
  constructor(t2, e2) {
14057
14225
  this.includeUtilityClasses = t2.includeUtilityClasses ?? false, this.cache = e2;
14058
14226
  }
@@ -14068,12 +14236,12 @@ class st2 {
14068
14236
  return i2;
14069
14237
  }
14070
14238
  const e2 = {}, s2 = t2.id;
14071
- if (s2 && !P(s2) && (e2.id = s2), t2.classList.length > 0) {
14239
+ if (s2 && !L(s2) && (e2.id = s2), t2.classList.length > 0) {
14072
14240
  const i2 = Array.from(t2.classList);
14073
14241
  if (this.includeUtilityClasses)
14074
14242
  e2.classes = i2;
14075
14243
  else {
14076
- const { semantic: o2 } = vt(i2);
14244
+ const { semantic: o2 } = It(i2);
14077
14245
  o2.length > 0 && (e2.classes = o2);
14078
14246
  }
14079
14247
  }
@@ -14102,7 +14270,7 @@ class st2 {
14102
14270
  * @returns True if should be ignored
14103
14271
  */
14104
14272
  shouldIgnoreAttribute(t2) {
14105
- return !!(V.has(t2) || t2.startsWith("on") || t2.startsWith("ng-") || t2.startsWith("_ng") || t2.startsWith("data-reactid") || t2.startsWith("data-react") || t2.startsWith("data-v-"));
14273
+ return !!(Y.has(t2) || t2.startsWith("on") || t2.startsWith("ng-") || t2.startsWith("_ng") || t2.startsWith("data-reactid") || t2.startsWith("data-react") || t2.startsWith("data-v-"));
14106
14274
  }
14107
14275
  /**
14108
14276
  * Gets attribute priority
@@ -14137,7 +14305,7 @@ class st2 {
14137
14305
  const e2 = {};
14138
14306
  for (const s2 of Array.from(t2.attributes)) {
14139
14307
  const n2 = s2.name;
14140
- if (this.shouldIgnoreAttribute(n2) || !zt(n2, s2.value) || Q.has(n2) && Y(s2.value) || this.getAttributePriority(n2) === 0) continue;
14308
+ if (this.shouldIgnoreAttribute(n2) || !Qt(n2, s2.value) || Z.has(n2) && K(s2.value) || this.getAttributePriority(n2) === 0) continue;
14141
14309
  const i2 = n2 === "href" || n2 === "src" ? D(n2, s2.value) : s2.value;
14142
14310
  !i2 || i2.trim() === "" || this.isDynamicValue(i2) || (e2[n2] = i2);
14143
14311
  }
@@ -14149,7 +14317,7 @@ class st2 {
14149
14317
  extractText(t2) {
14150
14318
  const e2 = this.getDirectTextContent(t2);
14151
14319
  if (!e2) return null;
14152
- const s2 = F(e2);
14320
+ const s2 = j(e2);
14153
14321
  if (!s2) return null;
14154
14322
  const n2 = 100, a2 = e2.length > n2 ? e2.slice(0, n2) + "..." : e2, i2 = s2.length > n2 ? s2.slice(0, n2) + "..." : s2;
14155
14323
  return {
@@ -14197,7 +14365,7 @@ class st2 {
14197
14365
  ].includes(e2);
14198
14366
  }
14199
14367
  }
14200
- class Ft2 {
14368
+ class Yt2 {
14201
14369
  /**
14202
14370
  * Generates fingerprint for SVG element
14203
14371
  * @param element - SVG element to fingerprint
@@ -14308,11 +14476,11 @@ class Ft2 {
14308
14476
  return Math.abs(e2).toString(16).padStart(8, "0");
14309
14477
  }
14310
14478
  }
14311
- function jt(r2, t2 = 0) {
14312
- const e2 = r2.anchor.score, s2 = r2.path.length > 0 ? r2.path.reduce((o2, c2) => o2 + c2.score, 0) / r2.path.length : 0.5, n2 = r2.target.score, a2 = e2 * U.ANCHOR + s2 * U.PATH + n2 * U.TARGET + t2 * U.UNIQUENESS, i2 = r2.anchor.degraded ? 0.2 : 0;
14479
+ function Zt(r2, t2 = 0) {
14480
+ const e2 = r2.anchor.score, s2 = r2.path.length > 0 ? r2.path.reduce((o2, c2) => o2 + c2.score, 0) / r2.path.length : 0.5, n2 = r2.target.score, a2 = e2 * z.ANCHOR + s2 * z.PATH + n2 * z.TARGET + t2 * z.UNIQUENESS, i2 = r2.anchor.degraded ? 0.2 : 0;
14313
14481
  return Math.max(0, Math.min(1, a2 - i2));
14314
14482
  }
14315
- class Wt2 {
14483
+ class Kt2 {
14316
14484
  constructor(t2) {
14317
14485
  this.cache = /* @__PURE__ */ new Map(), this.maxSize = t2;
14318
14486
  }
@@ -14343,9 +14511,9 @@ class Wt2 {
14343
14511
  return this.cache.size;
14344
14512
  }
14345
14513
  }
14346
- class Bt2 {
14514
+ class Xt2 {
14347
14515
  constructor(t2 = {}) {
14348
- this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Wt2(
14516
+ this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new Kt2(
14349
14517
  t2.maxSelectorCacheSize ?? 1e3
14350
14518
  ), this.anchorCache = /* @__PURE__ */ new WeakMap(), this.semanticsCache = /* @__PURE__ */ new WeakMap(), this.stats = {
14351
14519
  eidHits: 0,
@@ -14494,12 +14662,12 @@ class Bt2 {
14494
14662
  return s2 > 0 ? t2 / s2 : 0;
14495
14663
  }
14496
14664
  }
14497
- function Gt(r2) {
14498
- return new Bt2(r2);
14665
+ function Jt(r2) {
14666
+ return new Xt2(r2);
14499
14667
  }
14500
- let z = null;
14501
- function Z() {
14502
- return z || (z = Gt()), z;
14668
+ let F = null;
14669
+ function X() {
14670
+ return F || (F = Jt()), F;
14503
14671
  }
14504
14672
  function k(r2) {
14505
14673
  if (r2.ownerDocument)
@@ -14517,7 +14685,7 @@ function k(r2) {
14517
14685
  3. You are working with a document node instead of an element`
14518
14686
  );
14519
14687
  }
14520
- function Vt(r2, t2) {
14688
+ function te(r2, t2) {
14521
14689
  if (!t2)
14522
14690
  return;
14523
14691
  const e2 = k(r2), s2 = t2 instanceof Document ? t2 : k(t2);
@@ -14532,64 +14700,65 @@ Common causes:
14532
14700
  Solution: Ensure element and root parameter are from the same document context.`
14533
14701
  );
14534
14702
  }
14535
- function X(r2, t2 = {}) {
14703
+ function J(r2, t2 = {}) {
14536
14704
  var _a2;
14537
14705
  if (!r2 || !r2.ownerDocument || !r2.isConnected)
14538
14706
  return null;
14539
- const e2 = { ...bt, ...t2 };
14707
+ const e2 = { ...At, ...t2 };
14540
14708
  if (e2.root)
14541
14709
  try {
14542
- Vt(r2, e2.root);
14710
+ te(r2, e2.root);
14543
14711
  } catch (x2) {
14544
14712
  return console.error("Cross-document generation detected:", x2), null;
14545
14713
  }
14546
- const s2 = e2.cache ?? Z(), n2 = s2.getEID(r2);
14714
+ const s2 = e2.cache ?? X(), n2 = s2.getEID(r2);
14547
14715
  if (n2 !== void 0)
14548
14716
  return n2;
14549
- if (r2.tagName.toLowerCase() === "html") {
14550
- const x2 = new st2(e2, s2), y = Zt(r2, e2, x2);
14717
+ const a2 = r2.tagName.toLowerCase();
14718
+ if (a2 === "html") {
14719
+ const x2 = new nt2(e2, s2), y = re(r2, e2, x2);
14551
14720
  return s2.setEID(r2, y), y;
14552
14721
  }
14553
- const i2 = new St2(e2, s2), o2 = new $t2(e2, s2), c2 = new st2(e2, s2), u2 = new Ft2(), d = i2.findAnchor(r2);
14554
- if (!d && !e2.fallbackToBody)
14722
+ const i2 = new Ct2(e2, s2), o2 = new Pt2(e2, s2), c2 = new nt2(e2, s2), l2 = new Yt2(), f2 = i2.findAnchor(r2);
14723
+ if (!f2 && !e2.fallbackToBody)
14555
14724
  return null;
14556
- const l2 = (d == null ? void 0 : d.element) ?? ((_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) ?? null;
14557
- if (!l2) return null;
14558
- const h = !d || d.tier === "C", g = l2.tagName.toLowerCase(), f2 = l2.parentElement;
14559
- let m;
14560
- if (f2 && g !== "body" && g !== "html") {
14561
- const y = Array.from(f2.children).indexOf(l2);
14562
- y !== -1 && (m = y + 1);
14563
- }
14564
- const p = c2.extract(l2), b = {
14565
- tag: l2.tagName.toLowerCase(),
14566
- semantics: p,
14567
- score: (d == null ? void 0 : d.score) ?? I.DEGRADED_SCORE,
14568
- degraded: h,
14569
- nthChild: m
14570
- }, S = o2.buildPath(l2, r2, c2), E = c2.extract(r2);
14571
- e2.enableSvgFingerprint && Qt(r2) && (E.svg = u2.fingerprint(r2));
14725
+ const h = (f2 == null ? void 0 : f2.element) ?? ((_a2 = r2.ownerDocument) == null ? void 0 : _a2.body) ?? null;
14726
+ if (!h) return null;
14727
+ const d = !f2 || f2.tier === "C", u2 = h.tagName.toLowerCase(), g = c2.extract(h), m = h.parentElement;
14728
+ let p;
14729
+ if (m && u2 !== "body" && u2 !== "html" && _(u2, g, h)) {
14730
+ const y = Array.from(m.children).indexOf(h);
14731
+ y !== -1 && (p = y + 1);
14732
+ }
14733
+ const b = {
14734
+ tag: h.tagName.toLowerCase(),
14735
+ semantics: g,
14736
+ score: (f2 == null ? void 0 : f2.score) ?? I.DEGRADED_SCORE,
14737
+ degraded: d,
14738
+ nthChild: p
14739
+ }, S = o2.buildPath(h, r2, c2), T = c2.extract(r2);
14740
+ e2.enableSvgFingerprint && ee(r2) && (T.svg = l2.fingerprint(r2));
14572
14741
  const C = r2.parentElement;
14573
14742
  let A;
14574
- if (C) {
14743
+ if (C && _(a2, T, r2)) {
14575
14744
  const y = Array.from(C.children).indexOf(r2);
14576
14745
  y !== -1 && (A = y + 1);
14577
14746
  }
14578
14747
  const v2 = {
14579
14748
  tag: r2.tagName.toLowerCase(),
14580
- semantics: E,
14749
+ semantics: T,
14581
14750
  score: c2.scoreElement(r2),
14582
14751
  nthChild: A
14583
- }, H = [], $ = {
14752
+ }, P = [], $ = {
14584
14753
  onMultiple: "best-score",
14585
14754
  onMissing: "anchor-only",
14586
14755
  maxDepth: 3
14587
- }, T = b.degraded || S.degraded, R = Yt(b.degraded, S), N = {
14756
+ }, E = b.degraded || S.degraded, R = se(b.degraded, S), N = {
14588
14757
  version: "1.0",
14589
14758
  anchor: b,
14590
14759
  path: S.path,
14591
14760
  target: v2,
14592
- constraints: H,
14761
+ constraints: P,
14593
14762
  fallback: $,
14594
14763
  meta: {
14595
14764
  confidence: 0,
@@ -14597,16 +14766,16 @@ function X(r2, t2 = {}) {
14597
14766
  generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
14598
14767
  generator: "dom-eid@1.0",
14599
14768
  source: e2.source,
14600
- degraded: T,
14769
+ degraded: E,
14601
14770
  degradationReason: R
14602
14771
  }
14603
14772
  };
14604
- return N.meta.confidence = jt(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
14773
+ return N.meta.confidence = Zt(N), N.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(r2, N), N);
14605
14774
  }
14606
- function Qt(r2) {
14775
+ function ee(r2) {
14607
14776
  return r2.namespaceURI === "http://www.w3.org/2000/svg" || r2.tagName.toLowerCase() === "svg" || r2 instanceof SVGElement;
14608
14777
  }
14609
- function Yt(r2, t2) {
14778
+ function se(r2, t2) {
14610
14779
  if (r2 && t2.degraded)
14611
14780
  return "anchor-and-path-degraded";
14612
14781
  if (r2)
@@ -14614,7 +14783,7 @@ function Yt(r2, t2) {
14614
14783
  if (t2.degraded)
14615
14784
  return t2.degradationReason;
14616
14785
  }
14617
- function Zt(r2, t2, e2, s2) {
14786
+ function re(r2, t2, e2, s2) {
14618
14787
  const a2 = {
14619
14788
  tag: "html",
14620
14789
  semantics: e2.extract(r2),
@@ -14643,91 +14812,119 @@ function Zt(r2, t2, e2, s2) {
14643
14812
  }
14644
14813
  };
14645
14814
  }
14646
- const ct = {
14815
+ const ht = {
14816
+ id: "i",
14817
+ "data-testid": "tid",
14818
+ "data-qa": "qa",
14819
+ "data-cy": "cy",
14820
+ "data-test": "dt",
14821
+ "aria-label": "al",
14822
+ "aria-labelledby": "alb",
14823
+ "aria-describedby": "adb",
14824
+ name: "n",
14825
+ href: "h",
14826
+ src: "s",
14827
+ type: "t",
14828
+ role: "r",
14829
+ alt: "at",
14830
+ title: "tt",
14831
+ for: "f",
14832
+ placeholder: "ph",
14833
+ text: "x"
14834
+ }, G = Object.fromEntries(
14835
+ Object.entries(ht).map(([r2, t2]) => [t2, r2])
14836
+ ), ut = {
14647
14837
  maxClasses: 2,
14648
14838
  maxAttributes: 5,
14649
14839
  includeText: true,
14650
14840
  maxTextLength: 50,
14651
14841
  simplifyTarget: true,
14652
- includeConstraints: true
14842
+ includeConstraints: true,
14843
+ format: "compact"
14653
14844
  };
14654
- function it(r2) {
14845
+ function ct(r2) {
14655
14846
  return r2 === "id" ? 101 : w[r2] !== void 0 ? w[r2] : r2.startsWith("data-") ? w["data-*"] : r2.startsWith("aria-") ? w["aria-*"] : 0;
14656
14847
  }
14657
- function ae(r2) {
14848
+ function de(r2) {
14658
14849
  return ["id", "data-testid", "data-qa", "data-cy", "href", "text", "role"].includes(r2);
14659
14850
  }
14660
- function ie(r2) {
14851
+ function fe(r2) {
14661
14852
  return !!(/@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/.test(r2) || /(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}/.test(r2) || /\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}/.test(r2));
14662
14853
  }
14663
- function oe(r2, t2) {
14664
- const e2 = { ...ct, ...t2 }, s2 = `v${r2.version}`, n2 = j(r2.anchor, false, e2), a2 = r2.path.length > 0 ? r2.path.map((c2) => j(c2, false, e2)).join(" > ") + " > " : "", i2 = j(r2.target, true, e2), o2 = e2.includeConstraints ? le(r2) : "";
14665
- return `${s2}: ${n2} :: ${a2}${i2}${o2}`;
14666
- }
14667
- function j(r2, t2 = false, e2 = ct) {
14668
- const { tag: s2, semantics: n2 } = r2;
14669
- let a2 = s2;
14670
- const i2 = [], o2 = { ...n2.attributes };
14671
- n2.id && (o2.id = n2.id), n2.role && !o2.role && (o2.role = n2.role);
14672
- const c2 = Object.entries(o2).map(([l2, h]) => {
14673
- const g = it(l2), f2 = l2 === "href" || l2 === "src" ? D(l2, h) : h;
14674
- return { name: l2, value: f2, priority: g };
14675
- }).filter((l2) => l2.name !== "id" && l2.name !== "class" && V.has(l2.name) || Q.has(l2.name) && Y(l2.value) ? false : l2.priority > 0 || l2.name === "role" || l2.name === "id");
14676
- c2.sort((l2, h) => h.priority - l2.priority);
14677
- const u2 = c2.slice(0, e2.maxAttributes);
14678
- u2.sort((l2, h) => l2.name.localeCompare(h.name));
14679
- for (const { name: l2, value: h } of u2)
14680
- i2.push(`${l2}="${B(h)}"`);
14681
- if (e2.includeText && n2.text && !ie(n2.text.normalized)) {
14682
- const l2 = n2.text.normalized;
14683
- l2.length > 0 && l2.length <= e2.maxTextLength && i2.push(`text="${B(l2)}"`);
14684
- }
14685
- let d = i2;
14686
- if (i2.length > 0 && (t2 && e2.simplifyTarget && n2.id && (d = i2.filter((l2) => {
14687
- const h = l2.split("=")[0];
14688
- return it(h) >= 60 || h === "text" || h === "id" || h === "role";
14689
- })), d.length > 0 && d.sort((l2, h) => l2.localeCompare(h))), n2.classes && n2.classes.length > 0) {
14690
- const l2 = M(n2.classes), h = !!n2.id || i2.some(
14691
- (f2) => f2.startsWith("href=") || f2.startsWith("data-testid=") || f2.startsWith("text=") || f2.startsWith("role=")
14692
- );
14693
- if (!(t2 && e2.simplifyTarget && h) && l2.length > 0) {
14694
- const f2 = l2.sort().slice(0, e2.maxClasses);
14695
- a2 += f2.map((m) => `.${m}`).join("");
14854
+ function ge(r2, t2) {
14855
+ const e2 = { ...ut, ...t2 }, s2 = e2.format === "compact", n2 = s2 ? "v1" : `v${r2.version}`, a2 = s2 ? ":" : ": ", i2 = s2 ? "::" : " :: ", o2 = s2 ? ">" : " > ", c2 = e2.includeText && r2.target.semantics.text ? r2.target.semantics.text.normalized : void 0, l2 = W(r2.anchor, false, e2), f2 = r2.path.length > 0 ? r2.path.map((u2) => W(u2, false, e2, c2)).join(o2) + o2 : "", h = W(r2.target, true, e2), d = e2.includeConstraints ? pe(r2, e2) : "";
14856
+ return `${n2}${a2}${l2}${i2}${f2}${h}${d}`;
14857
+ }
14858
+ function W(r2, t2 = false, e2 = ut, s2) {
14859
+ const { tag: n2, semantics: a2 } = r2, i2 = e2.format === "compact";
14860
+ let o2 = n2;
14861
+ const c2 = [], l2 = { ...a2.attributes };
14862
+ a2.id && (l2.id = a2.id), a2.role && !l2.role && (l2.role = a2.role);
14863
+ const f2 = Object.entries(l2).map(([u2, g]) => {
14864
+ const m = ct(u2), p = u2 === "href" || u2 === "src" ? D(u2, g) : g;
14865
+ return { name: u2, value: p, priority: m };
14866
+ }).filter((u2) => u2.name !== "id" && u2.name !== "class" && Y.has(u2.name) || Z.has(u2.name) && K(u2.value) ? false : u2.priority > 0 || u2.name === "role" || u2.name === "id");
14867
+ f2.sort((u2, g) => g.priority - u2.priority);
14868
+ const h = f2.slice(0, e2.maxAttributes);
14869
+ h.sort((u2, g) => u2.name.localeCompare(g.name));
14870
+ for (const { name: u2, value: g } of h) {
14871
+ const m = i2 ? ht[u2] ?? u2 : u2;
14872
+ c2.push(`${m}="${V(g)}"`);
14873
+ }
14874
+ if (e2.includeText && a2.text && !fe(a2.text.normalized)) {
14875
+ const u2 = a2.text.normalized;
14876
+ if (u2.length > 0 && u2.length <= e2.maxTextLength && !(!t2 && s2 !== void 0 && u2 === s2)) {
14877
+ const m = i2 ? "x" : "text";
14878
+ c2.push(`${m}="${V(u2)}"`);
14879
+ }
14880
+ }
14881
+ let d = c2;
14882
+ if (c2.length > 0 && t2 && e2.simplifyTarget && a2.id && (d = c2.filter((u2) => {
14883
+ const g = u2.split("=")[0], m = G[g] ?? g;
14884
+ return ct(m) >= 60 || m === "text" || m === "id" || m === "role";
14885
+ })), a2.classes && a2.classes.length > 0) {
14886
+ const u2 = M(a2.classes), g = !!a2.id || c2.some((p) => {
14887
+ const b = p.split("=")[0], S = G[b] ?? b;
14888
+ return S === "href" || S === "data-testid" || S === "text" || S === "role";
14889
+ });
14890
+ if (!(t2 && e2.simplifyTarget && g) && u2.length > 0) {
14891
+ const p = u2.sort().slice(0, e2.maxClasses);
14892
+ o2 += p.map((b) => `.${b}`).join("");
14696
14893
  }
14697
14894
  }
14698
- if (d.length > 0 && (a2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
14699
- const l2 = !!n2.id || n2.attributes && Object.keys(n2.attributes).some(ae);
14700
- t2 && e2.simplifyTarget && l2 || (a2 += `#${r2.nthChild}`);
14895
+ if (d.length > 0 && (o2 += `[${d.join(",")}]`), "nthChild" in r2 && r2.nthChild) {
14896
+ const u2 = !!a2.id || a2.attributes && Object.keys(a2.attributes).some(de);
14897
+ t2 && e2.simplifyTarget && u2 || (o2 += `#${r2.nthChild}`);
14701
14898
  }
14702
- return a2;
14899
+ return o2;
14703
14900
  }
14704
- function le(r2) {
14901
+ function pe(r2, t2) {
14705
14902
  if (!r2.constraints || r2.constraints.length === 0)
14706
14903
  return "";
14707
- const t2 = [];
14708
- for (const e2 of r2.constraints)
14709
- switch (e2.type) {
14904
+ const e2 = [];
14905
+ for (const n2 of r2.constraints)
14906
+ switch (n2.type) {
14710
14907
  case "uniqueness":
14711
- t2.push("unique=true");
14908
+ e2.push("unique=true");
14712
14909
  break;
14713
14910
  case "position":
14714
- e2.params && e2.params.strategy && t2.push(`pos=${e2.params.strategy}`);
14911
+ n2.params && n2.params.strategy && e2.push(`pos=${n2.params.strategy}`);
14715
14912
  break;
14716
14913
  case "text-proximity":
14717
- if (e2.params && e2.params.reference) {
14718
- const s2 = B(String(e2.params.reference));
14719
- t2.push(`text="${s2}"`);
14914
+ if (n2.params && n2.params.reference) {
14915
+ const a2 = V(String(n2.params.reference));
14916
+ e2.push(`text="${a2}"`);
14720
14917
  }
14721
14918
  break;
14722
14919
  }
14723
- return t2.length === 0 ? "" : ` {${t2.join(",")}}`;
14920
+ return e2.length === 0 ? "" : `${t2.format === "verbose" ? " " : ""}{${e2.join(",")}}`;
14724
14921
  }
14725
- function B(r2) {
14922
+ function V(r2) {
14726
14923
  return r2.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/>/g, "\\>").replace(/:/g, "\\:");
14727
14924
  }
14728
- function xe(r2, t2, e2) {
14729
- const s2 = X(r2, t2);
14730
- return s2 ? oe(s2, e2) : null;
14925
+ function Ne(r2, t2, e2) {
14926
+ const s2 = J(r2, t2);
14927
+ return s2 ? ge(s2, e2) : null;
14731
14928
  }
14732
14929
  const defaultSelectorOptions = {
14733
14930
  maxPathDepth: 10,
@@ -14773,7 +14970,7 @@ function resolveNodeSelector(node2, mirror2, selectorOptions, options) {
14773
14970
  fallbackToBody: selectorOptions.fallbackToBody
14774
14971
  };
14775
14972
  try {
14776
- const selector = xe(element, seqlOptions);
14973
+ const selector = Ne(element, seqlOptions);
14777
14974
  if (selector) {
14778
14975
  if (elementMeta) {
14779
14976
  elementMeta.selector = selector;
@@ -15922,7 +16119,8 @@ function initInputObserver({
15922
16119
  maskInputOptions,
15923
16120
  maskInputFn,
15924
16121
  sampling,
15925
- userTriggeredOnInput
16122
+ userTriggeredOnInput,
16123
+ trustSyntheticInput
15926
16124
  }) {
15927
16125
  function eventHandler(event) {
15928
16126
  let target = getEventTarget(event);
@@ -15972,34 +16170,53 @@ function initInputObserver({
15972
16170
  function cbWithDedup(target, v2) {
15973
16171
  const lastInputValue = lastInputValueMap.get(target);
15974
16172
  const el = target;
15975
- const hasPlaceholder = el.hasAttribute("placeholder");
15976
- const isEmpty = el.value === "";
15977
- const isDefaultEmpty = typeof el.defaultValue === "string" ? el.defaultValue === "" : true;
15978
- const isNonUser = !v2.userTriggered;
15979
- const isRepeatEmpty = !lastInputValue || lastInputValue.text === "";
15980
- const isLikelyPhantom = hasPlaceholder && isEmpty && isDefaultEmpty && isRepeatEmpty && isNonUser && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
15981
- const isRenderDrivenTextInput = el.tagName === "INPUT" && el.type === "text" && !v2.userTriggered && v2.text === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder");
15982
- const isValueFromDefault = !v2.userTriggered && el.value === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder") && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
15983
- const isPhantomCheckbox = el.type === "checkbox" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
15984
- const isPhantomRadio = el.type === "radio" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
15985
- if (isLikelyPhantom || isRenderDrivenTextInput || isValueFromDefault || isPhantomCheckbox || isPhantomRadio) {
15986
- console.debug(
15987
- `[${nowTimestamp()}] [rrweb:record/observer] ⛔ phantom input ignored`,
15988
- {
15989
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
15990
- node: index.describeNode(el),
15991
- tag: el.tagName,
15992
- nodeType: el.nodeType,
15993
- attribute: el.attributes,
15994
- value: el.value,
15995
- isLikelyPhantom,
15996
- isRenderDrivenTextInput,
15997
- isValueFromDefault,
15998
- isPhantomCheckbox,
15999
- isPhantomRadio
16000
- }
16001
- );
16002
- return;
16173
+ if (trustSyntheticInput) {
16174
+ const isInitialEmpty = !v2.userTriggered && el.value === "" && !v2.isChecked && !lastInputValue;
16175
+ const isSelectDefaultSelection = el.tagName === "SELECT" && !v2.userTriggered && !lastInputValue && el.selectedIndex === 0;
16176
+ if (isInitialEmpty || isSelectDefaultSelection) {
16177
+ console.debug(
16178
+ `[${nowTimestamp()}] [rrweb:record/observer] phantom input ignored (trust mode)`,
16179
+ {
16180
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
16181
+ node: index.describeNode(el),
16182
+ tag: el.tagName,
16183
+ value: el.value,
16184
+ isInitialEmpty,
16185
+ isSelectDefaultSelection
16186
+ }
16187
+ );
16188
+ return;
16189
+ }
16190
+ } else {
16191
+ const hasPlaceholder = el.hasAttribute("placeholder");
16192
+ const isEmpty = el.value === "";
16193
+ const isDefaultEmpty = typeof el.defaultValue === "string" ? el.defaultValue === "" : true;
16194
+ const isNonUser = !v2.userTriggered;
16195
+ const isRepeatEmpty = !lastInputValue || lastInputValue.text === "";
16196
+ const isLikelyPhantom = hasPlaceholder && isEmpty && isDefaultEmpty && isRepeatEmpty && isNonUser && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
16197
+ const isRenderDrivenTextInput = el.tagName === "INPUT" && el.type === "text" && !v2.userTriggered && v2.text === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder");
16198
+ const isValueFromDefault = !v2.userTriggered && el.value === el.defaultValue && !lastInputValue && el.hasAttribute("placeholder") && !v2.isChecked && el.type !== "hidden" && INPUT_TAGS.includes(el.tagName);
16199
+ const isPhantomCheckbox = el.type === "checkbox" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
16200
+ const isPhantomRadio = el.type === "radio" && !v2.userTriggered && !v2.isChecked && !lastInputValue;
16201
+ if (isLikelyPhantom || isRenderDrivenTextInput || isValueFromDefault || isPhantomCheckbox || isPhantomRadio) {
16202
+ console.debug(
16203
+ `[${nowTimestamp()}] [rrweb:record/observer] ⛔ phantom input ignored`,
16204
+ {
16205
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
16206
+ node: index.describeNode(el),
16207
+ tag: el.tagName,
16208
+ nodeType: el.nodeType,
16209
+ attribute: el.attributes,
16210
+ value: el.value,
16211
+ isLikelyPhantom,
16212
+ isRenderDrivenTextInput,
16213
+ isValueFromDefault,
16214
+ isPhantomCheckbox,
16215
+ isPhantomRadio
16216
+ }
16217
+ );
16218
+ return;
16219
+ }
16003
16220
  }
16004
16221
  if (!lastInputValue || lastInputValue.text !== v2.text || lastInputValue.isChecked !== v2.isChecked) {
16005
16222
  lastInputValueMap.set(target, v2);
@@ -18050,8 +18267,15 @@ class NavigationManager {
18050
18267
  handleNavigation(data) {
18051
18268
  if (this.disabled) return;
18052
18269
  if (this.locked) return;
18053
- this.cancelTimers();
18054
- this.disconnectSettlingObserver();
18270
+ if (this.pendingNavigation) {
18271
+ this.cancelTimers();
18272
+ this.disconnectSettlingObserver();
18273
+ this.pendingNavigation = null;
18274
+ this.onSnapshot(true);
18275
+ } else {
18276
+ this.cancelTimers();
18277
+ this.disconnectSettlingObserver();
18278
+ }
18055
18279
  this.pendingNavigation = data;
18056
18280
  if (this.frozen) {
18057
18281
  return;
@@ -18258,7 +18482,7 @@ class ProcessedNodeManager {
18258
18482
  destroy() {
18259
18483
  }
18260
18484
  }
18261
- const version$1 = "3.6.0-alpha.1";
18485
+ const version$1 = "3.11.0-alpha.1";
18262
18486
  let wrappedEmit;
18263
18487
  let takeFullSnapshot$1;
18264
18488
  let canvasManager;
@@ -18307,6 +18531,7 @@ function record(options = {}) {
18307
18531
  recordAfter = options.recordAfter === "DOMContentLoaded" ? options.recordAfter : "load",
18308
18532
  flushCustomEvent = options.flushCustomEvent !== void 0 ? options.flushCustomEvent : "after",
18309
18533
  userTriggeredOnInput = false,
18534
+ trustSyntheticInput = false,
18310
18535
  collectFonts = false,
18311
18536
  inlineImages = false,
18312
18537
  plugins,
@@ -18846,6 +19071,7 @@ function record(options = {}) {
18846
19071
  recordCanvas,
18847
19072
  inlineImages,
18848
19073
  userTriggeredOnInput,
19074
+ trustSyntheticInput,
18849
19075
  collectFonts,
18850
19076
  doc,
18851
19077
  maskInputFn,
@@ -18922,6 +19148,43 @@ function record(options = {}) {
18922
19148
  );
18923
19149
  }
18924
19150
  return () => {
19151
+ if (recording) {
19152
+ const activeEl = document.activeElement;
19153
+ if (activeEl && INPUT_TAGS.includes(activeEl.tagName)) {
19154
+ const inputEl = activeEl;
19155
+ const id = mirror.getId(inputEl);
19156
+ if (id !== -1) {
19157
+ const lastValue = lastInputValueMap.get(inputEl);
19158
+ let text = inputEl.value;
19159
+ let isChecked = false;
19160
+ const type = getInputType(inputEl) || "";
19161
+ if (type === "radio" || type === "checkbox") {
19162
+ isChecked = inputEl.checked;
19163
+ } else if (maskInputOptions[inputEl.tagName.toLowerCase()] || maskInputOptions[type]) {
19164
+ text = maskInputValue({
19165
+ element: inputEl,
19166
+ maskInputOptions,
19167
+ tagName: inputEl.tagName,
19168
+ type,
19169
+ value: text,
19170
+ maskInputFn
19171
+ });
19172
+ }
19173
+ if (!lastValue || lastValue.text !== text || lastValue.isChecked !== isChecked) {
19174
+ const inputData = userTriggeredOnInput ? { text, isChecked, userTriggered: false } : { text, isChecked };
19175
+ lastInputValueMap.set(inputEl, inputData);
19176
+ wrappedEmit({
19177
+ type: EventType.IncrementalSnapshot,
19178
+ data: {
19179
+ source: IncrementalSource.Input,
19180
+ ...inputData,
19181
+ id
19182
+ }
19183
+ });
19184
+ }
19185
+ }
19186
+ }
19187
+ }
18925
19188
  if (checkoutDebounceTimer) {
18926
19189
  clearTimeout(checkoutDebounceTimer);
18927
19190
  checkoutDebounceTimer = null;
@@ -19384,16 +19647,16 @@ function s(n2, o2) {
19384
19647
  }(m), b = h.next(); !b.done; b = h.next()) {
19385
19648
  var S = b.value;
19386
19649
  if (void 0 === S) return c(p, g);
19387
- var w2 = "string" == typeof S ? { target: S } : S, j2 = w2.target, E = w2.actions, R = void 0 === E ? [] : E, N = w2.cond, O2 = void 0 === N ? function() {
19650
+ var w2 = "string" == typeof S ? { target: S } : S, j2 = w2.target, E = w2.actions, R = void 0 === E ? [] : E, N = w2.cond, O = void 0 === N ? function() {
19388
19651
  return true;
19389
19652
  } : N, _2 = void 0 === j2, k2 = null != j2 ? j2 : p, T = n2.states[k2];
19390
- if (O2(g, d)) {
19391
- var q = t(f((_2 ? r(R) : [].concat(x2.exit, R, T.entry).filter(function(t2) {
19653
+ if (O(g, d)) {
19654
+ var q2 = t(f((_2 ? r(R) : [].concat(x2.exit, R, T.entry).filter(function(t2) {
19392
19655
  return t2;
19393
19656
  })).map(function(t2) {
19394
19657
  return i(t2, y._options.actions);
19395
- }), g, d), 3), z2 = q[0], A = q[1], B2 = q[2], C = null != j2 ? j2 : p;
19396
- return { value: C, context: A, actions: z2, changed: j2 !== p || z2.length > 0 || B2, matches: a(C) };
19658
+ }), g, d), 3), z2 = q2[0], A = q2[1], B = q2[2], C = null != j2 ? j2 : p;
19659
+ return { value: C, context: A, actions: z2, changed: j2 !== p || z2.length > 0 || B, matches: a(C) };
19397
19660
  }
19398
19661
  }
19399
19662
  } catch (t2) {
@@ -21861,7 +22124,7 @@ class Replayer {
21861
22124
  this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
21862
22125
  }
21863
22126
  }
21864
- const version = "3.6.0-alpha.1";
22127
+ const version = "3.11.0-alpha.1";
21865
22128
  const { getVersion } = record;
21866
22129
  const { isRecording } = record;
21867
22130
  const { flushCustomEventQueue } = record;