@appsurify-testmap/rrweb-all 2.1.3-alpha.3 → 3.1.1-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-all.cjs +1475 -217
- package/dist/rrweb-all.cjs.map +1 -1
- package/dist/rrweb-all.js +1475 -217
- package/dist/rrweb-all.js.map +1 -1
- package/dist/rrweb-all.umd.cjs +1513 -223
- package/dist/rrweb-all.umd.cjs.map +3 -3
- package/dist/rrweb-all.umd.min.cjs +34 -34
- package/dist/rrweb-all.umd.min.cjs.map +3 -3
- package/package.json +4 -4
package/dist/rrweb-all.cjs
CHANGED
|
@@ -300,6 +300,7 @@ function stringifyRule(rule2, sheetHref) {
|
|
|
300
300
|
return importStringified;
|
|
301
301
|
} else {
|
|
302
302
|
let ruleStringified = rule2.cssText;
|
|
303
|
+
if (rule2.type === CSSRule.KEYFRAMES_RULE || rule2.type === CSSRule.KEYFRAME_RULE) ;
|
|
303
304
|
if (isCSSStyleRule(rule2) && rule2.selectorText.includes(":")) {
|
|
304
305
|
ruleStringified = fixSafariColons(ruleStringified);
|
|
305
306
|
}
|
|
@@ -522,19 +523,19 @@ function splitCssText(cssText, style, _testNoPxNorm = false) {
|
|
|
522
523
|
_testNoPxNorm
|
|
523
524
|
);
|
|
524
525
|
const jLimit = 100;
|
|
525
|
-
let
|
|
526
|
-
for (;
|
|
526
|
+
let j2 = 3;
|
|
527
|
+
for (; j2 < textContentNorm.length; j2++) {
|
|
527
528
|
if (
|
|
528
529
|
// keep consuming css identifiers (to get a decent chunk more quickly)
|
|
529
|
-
textContentNorm[
|
|
530
|
-
textContentNorm.indexOf(textContentNorm.substring(0,
|
|
530
|
+
textContentNorm[j2].match(/[a-zA-Z0-9]/) || // substring needs to be unique to this section
|
|
531
|
+
textContentNorm.indexOf(textContentNorm.substring(0, j2), 1) !== -1
|
|
531
532
|
) {
|
|
532
533
|
continue;
|
|
533
534
|
}
|
|
534
535
|
break;
|
|
535
536
|
}
|
|
536
|
-
for (;
|
|
537
|
-
let startSubstring = textContentNorm.substring(0,
|
|
537
|
+
for (; j2 < textContentNorm.length; j2++) {
|
|
538
|
+
let startSubstring = textContentNorm.substring(0, j2);
|
|
538
539
|
let cssNormSplits = cssTextNorm.split(startSubstring);
|
|
539
540
|
let splitNorm = -1;
|
|
540
541
|
if (cssNormSplits.length === 2) {
|
|
@@ -551,11 +552,11 @@ function splitCssText(cssText, style, _testNoPxNorm = false) {
|
|
|
551
552
|
splits.push(cssText);
|
|
552
553
|
return splits;
|
|
553
554
|
}
|
|
554
|
-
|
|
555
|
-
} else if (
|
|
555
|
+
j2 = jLimit + 1;
|
|
556
|
+
} else if (j2 === textContentNorm.length - 1) {
|
|
556
557
|
splitNorm = cssTextNorm.indexOf(startSubstring);
|
|
557
558
|
}
|
|
558
|
-
if (cssNormSplits.length >= 2 &&
|
|
559
|
+
if (cssNormSplits.length >= 2 && j2 > jLimit) {
|
|
559
560
|
const prevTextContent = childNodes2[i2 - 1].textContent;
|
|
560
561
|
if (prevTextContent && typeof prevTextContent === "string") {
|
|
561
562
|
const prevMinLength = normalizeCssString(prevTextContent).length;
|
|
@@ -566,29 +567,29 @@ function splitCssText(cssText, style, _testNoPxNorm = false) {
|
|
|
566
567
|
}
|
|
567
568
|
}
|
|
568
569
|
if (splitNorm !== -1) {
|
|
569
|
-
let
|
|
570
|
-
for (;
|
|
570
|
+
let k2 = Math.floor(splitNorm / normFactor);
|
|
571
|
+
for (; k2 > 0 && k2 < cssText.length; ) {
|
|
571
572
|
iterCount += 1;
|
|
572
573
|
if (iterCount > 50 * childNodes2.length) {
|
|
573
574
|
splits.push(cssText);
|
|
574
575
|
return splits;
|
|
575
576
|
}
|
|
576
577
|
const normPart = normalizeCssString(
|
|
577
|
-
cssText.substring(0,
|
|
578
|
+
cssText.substring(0, k2),
|
|
578
579
|
_testNoPxNorm
|
|
579
580
|
);
|
|
580
581
|
if (normPart.length === splitNorm) {
|
|
581
|
-
splits.push(cssText.substring(0,
|
|
582
|
-
cssText = cssText.substring(
|
|
582
|
+
splits.push(cssText.substring(0, k2));
|
|
583
|
+
cssText = cssText.substring(k2);
|
|
583
584
|
cssTextNorm = cssTextNorm.substring(splitNorm);
|
|
584
585
|
break;
|
|
585
586
|
} else if (normPart.length < splitNorm) {
|
|
586
|
-
|
|
587
|
+
k2 += Math.max(
|
|
587
588
|
1,
|
|
588
589
|
Math.floor((splitNorm - normPart.length) / normFactor)
|
|
589
590
|
);
|
|
590
591
|
} else {
|
|
591
|
-
|
|
592
|
+
k2 -= Math.max(
|
|
592
593
|
1,
|
|
593
594
|
Math.floor((normPart.length - splitNorm) * normFactor)
|
|
594
595
|
);
|
|
@@ -606,96 +607,6 @@ function splitCssText(cssText, style, _testNoPxNorm = false) {
|
|
|
606
607
|
function markCssSplits(cssText, style) {
|
|
607
608
|
return splitCssText(cssText, style).join("/* rr_split */");
|
|
608
609
|
}
|
|
609
|
-
function isSelectorUnique(selector, target) {
|
|
610
|
-
try {
|
|
611
|
-
const matches = document.querySelectorAll(selector);
|
|
612
|
-
return matches.length === 1 && matches[0] === target;
|
|
613
|
-
} catch {
|
|
614
|
-
return false;
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
function buildSelector(node2) {
|
|
618
|
-
if (!(node2 instanceof Element)) return null;
|
|
619
|
-
if (node2.id) {
|
|
620
|
-
return `#${CSS.escape(node2.id)}`;
|
|
621
|
-
}
|
|
622
|
-
const parts = [];
|
|
623
|
-
const tag = node2.tagName.toLowerCase();
|
|
624
|
-
if (node2.classList.length) {
|
|
625
|
-
parts.push(...Array.from(node2.classList).map((cls) => `.${CSS.escape(cls)}`));
|
|
626
|
-
}
|
|
627
|
-
Array.from(node2.attributes).forEach((attr) => {
|
|
628
|
-
if (attr.name.startsWith("data-")) {
|
|
629
|
-
parts.push(`[${attr.name}="${CSS.escape(attr.value)}"]`);
|
|
630
|
-
}
|
|
631
|
-
});
|
|
632
|
-
const shortSelector = `${tag}${parts.join("")}`;
|
|
633
|
-
if (isSelectorUnique(shortSelector, node2)) {
|
|
634
|
-
return shortSelector;
|
|
635
|
-
}
|
|
636
|
-
const pathParts = [];
|
|
637
|
-
let current = node2;
|
|
638
|
-
while (current && current.nodeType === Node.ELEMENT_NODE) {
|
|
639
|
-
const parent = current.parentElement;
|
|
640
|
-
const tagName = current.tagName.toLowerCase();
|
|
641
|
-
let nth = "";
|
|
642
|
-
if (parent) {
|
|
643
|
-
const siblings = Array.from(parent.children).filter(
|
|
644
|
-
(el) => el.tagName.toLowerCase() === tagName
|
|
645
|
-
);
|
|
646
|
-
if (siblings.length > 1) {
|
|
647
|
-
nth = `:nth-of-type(${siblings.indexOf(current) + 1})`;
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
pathParts.unshift(`${tagName}${nth}`);
|
|
651
|
-
current = parent;
|
|
652
|
-
}
|
|
653
|
-
return pathParts.join(" > ") || null;
|
|
654
|
-
}
|
|
655
|
-
function buildXPath(node2) {
|
|
656
|
-
switch (node2.nodeType) {
|
|
657
|
-
case Node.DOCUMENT_NODE:
|
|
658
|
-
return "/";
|
|
659
|
-
case Node.DOCUMENT_TYPE_NODE:
|
|
660
|
-
return "/html/doctype";
|
|
661
|
-
case Node.ELEMENT_NODE: {
|
|
662
|
-
const element = node2;
|
|
663
|
-
if (element.id) {
|
|
664
|
-
return `//*[@id="${CSS.escape(element.id)}"]`;
|
|
665
|
-
}
|
|
666
|
-
if (element.tagName.toLowerCase() === "html") return "/html";
|
|
667
|
-
if (element === document.head) return "/html/head";
|
|
668
|
-
if (element === document.body) return "/html/body";
|
|
669
|
-
const parent = element.parentNode;
|
|
670
|
-
if (!parent) return "";
|
|
671
|
-
const tag = element.tagName.toLowerCase();
|
|
672
|
-
const siblings = Array.from(parent.children).filter(
|
|
673
|
-
(el) => el.tagName.toLowerCase() === tag
|
|
674
|
-
);
|
|
675
|
-
const index2 = siblings.length > 1 ? `[${siblings.indexOf(element) + 1}]` : "";
|
|
676
|
-
return `${buildXPath(parent)}/${tag}${index2}`;
|
|
677
|
-
}
|
|
678
|
-
case Node.TEXT_NODE:
|
|
679
|
-
case Node.CDATA_SECTION_NODE:
|
|
680
|
-
case Node.COMMENT_NODE: {
|
|
681
|
-
const parent = node2.parentNode;
|
|
682
|
-
if (!parent) return "";
|
|
683
|
-
const typeMap = {
|
|
684
|
-
[Node.TEXT_NODE]: "text()",
|
|
685
|
-
[Node.CDATA_SECTION_NODE]: "text()",
|
|
686
|
-
// CDATA ≡ text() в XPath
|
|
687
|
-
[Node.COMMENT_NODE]: "comment()"
|
|
688
|
-
};
|
|
689
|
-
const sameTypeSiblings = Array.from(parent.childNodes).filter(
|
|
690
|
-
(sibling) => sibling.nodeType === node2.nodeType
|
|
691
|
-
);
|
|
692
|
-
const index2 = sameTypeSiblings.length > 1 ? `[${sameTypeSiblings.indexOf(node2)}]` : "";
|
|
693
|
-
return `${buildXPath(parent)}/${typeMap[node2.nodeType]}${index2}`;
|
|
694
|
-
}
|
|
695
|
-
default:
|
|
696
|
-
return "";
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
610
|
function isTextVisible(n2) {
|
|
700
611
|
var _a2;
|
|
701
612
|
const parent = index$1.parentNode(n2);
|
|
@@ -828,6 +739,1274 @@ try {
|
|
|
828
739
|
}
|
|
829
740
|
} catch (error) {
|
|
830
741
|
}
|
|
742
|
+
const L = {
|
|
743
|
+
ANCHOR: 0.4,
|
|
744
|
+
PATH: 0.3,
|
|
745
|
+
TARGET: 0.2,
|
|
746
|
+
UNIQUENESS: 0.1
|
|
747
|
+
}, I = {
|
|
748
|
+
SEMANTIC_TAG: 0.5,
|
|
749
|
+
ROLE: 0.3,
|
|
750
|
+
ARIA_LABEL: 0.1,
|
|
751
|
+
STABLE_ID: 0.1,
|
|
752
|
+
TEST_MARKER: 0.05,
|
|
753
|
+
DEPTH_PENALTY_THRESHOLD: 5,
|
|
754
|
+
DEPTH_PENALTY_FACTOR: 0.05,
|
|
755
|
+
DEGRADED_SCORE: 0.3
|
|
756
|
+
}, ct = {
|
|
757
|
+
MIN_CONFIDENCE_FOR_SKIP: 0.7
|
|
758
|
+
}, X = [
|
|
759
|
+
"form",
|
|
760
|
+
"main",
|
|
761
|
+
"nav",
|
|
762
|
+
"section",
|
|
763
|
+
"article",
|
|
764
|
+
"footer",
|
|
765
|
+
"header"
|
|
766
|
+
], K = [
|
|
767
|
+
"form",
|
|
768
|
+
"navigation",
|
|
769
|
+
"main",
|
|
770
|
+
"region",
|
|
771
|
+
"contentinfo",
|
|
772
|
+
"complementary",
|
|
773
|
+
"banner",
|
|
774
|
+
"search"
|
|
775
|
+
], lt = [
|
|
776
|
+
// HTML5 Semantic
|
|
777
|
+
"article",
|
|
778
|
+
"aside",
|
|
779
|
+
"details",
|
|
780
|
+
"figcaption",
|
|
781
|
+
"figure",
|
|
782
|
+
"footer",
|
|
783
|
+
"header",
|
|
784
|
+
"main",
|
|
785
|
+
"mark",
|
|
786
|
+
"nav",
|
|
787
|
+
"section",
|
|
788
|
+
"summary",
|
|
789
|
+
"time",
|
|
790
|
+
// Form elements
|
|
791
|
+
"button",
|
|
792
|
+
"datalist",
|
|
793
|
+
"fieldset",
|
|
794
|
+
"form",
|
|
795
|
+
"input",
|
|
796
|
+
"label",
|
|
797
|
+
"legend",
|
|
798
|
+
"meter",
|
|
799
|
+
"optgroup",
|
|
800
|
+
"option",
|
|
801
|
+
"output",
|
|
802
|
+
"progress",
|
|
803
|
+
"select",
|
|
804
|
+
"textarea",
|
|
805
|
+
// Interactive
|
|
806
|
+
"a",
|
|
807
|
+
"audio",
|
|
808
|
+
"video",
|
|
809
|
+
"canvas",
|
|
810
|
+
"dialog",
|
|
811
|
+
"menu",
|
|
812
|
+
// Text content
|
|
813
|
+
"blockquote",
|
|
814
|
+
"dd",
|
|
815
|
+
"dl",
|
|
816
|
+
"dt",
|
|
817
|
+
"hr",
|
|
818
|
+
"li",
|
|
819
|
+
"ol",
|
|
820
|
+
"ul",
|
|
821
|
+
"p",
|
|
822
|
+
"pre",
|
|
823
|
+
"h1",
|
|
824
|
+
"h2",
|
|
825
|
+
"h3",
|
|
826
|
+
"h4",
|
|
827
|
+
"h5",
|
|
828
|
+
"h6",
|
|
829
|
+
// Table
|
|
830
|
+
"caption",
|
|
831
|
+
"col",
|
|
832
|
+
"colgroup",
|
|
833
|
+
"table",
|
|
834
|
+
"tbody",
|
|
835
|
+
"td",
|
|
836
|
+
"tfoot",
|
|
837
|
+
"th",
|
|
838
|
+
"thead",
|
|
839
|
+
"tr",
|
|
840
|
+
// SVG
|
|
841
|
+
"svg",
|
|
842
|
+
"path",
|
|
843
|
+
"circle",
|
|
844
|
+
"rect",
|
|
845
|
+
"line",
|
|
846
|
+
"polyline",
|
|
847
|
+
"polygon",
|
|
848
|
+
"ellipse",
|
|
849
|
+
"g",
|
|
850
|
+
"text",
|
|
851
|
+
"use"
|
|
852
|
+
], w = {
|
|
853
|
+
// Test attributes (highest priority)
|
|
854
|
+
"data-testid": 100,
|
|
855
|
+
"data-qa": 99,
|
|
856
|
+
"data-cy": 98,
|
|
857
|
+
"data-test": 97,
|
|
858
|
+
"data-test-id": 96,
|
|
859
|
+
// ARIA (accessibility semantics)
|
|
860
|
+
"aria-label": 90,
|
|
861
|
+
"aria-labelledby": 85,
|
|
862
|
+
"aria-describedby": 80,
|
|
863
|
+
// Semantic HTML attributes
|
|
864
|
+
name: 75,
|
|
865
|
+
href: 70,
|
|
866
|
+
// for <a>
|
|
867
|
+
src: 70,
|
|
868
|
+
// for <img>, <script>, etc.
|
|
869
|
+
type: 65,
|
|
870
|
+
role: 60,
|
|
871
|
+
alt: 55,
|
|
872
|
+
title: 50,
|
|
873
|
+
for: 45,
|
|
874
|
+
placeholder: 40,
|
|
875
|
+
// Any data-* attribute (if not above)
|
|
876
|
+
"data-*": 30,
|
|
877
|
+
// Any aria-* attribute (if not above)
|
|
878
|
+
"aria-*": 25
|
|
879
|
+
}, B = /* @__PURE__ */ new Set([
|
|
880
|
+
"id",
|
|
881
|
+
// handled separately
|
|
882
|
+
"class",
|
|
883
|
+
// handled separately
|
|
884
|
+
"style",
|
|
885
|
+
// unstable
|
|
886
|
+
"xmlns",
|
|
887
|
+
// service attribute for SVG
|
|
888
|
+
"tabindex",
|
|
889
|
+
// can change
|
|
890
|
+
"contenteditable"
|
|
891
|
+
]), ut = {
|
|
892
|
+
maxPathDepth: 10,
|
|
893
|
+
enableSvgFingerprint: true,
|
|
894
|
+
confidenceThreshold: 0.1,
|
|
895
|
+
fallbackToBody: true,
|
|
896
|
+
includeUtilityClasses: false,
|
|
897
|
+
source: "dom-dsl"
|
|
898
|
+
};
|
|
899
|
+
function D(n2) {
|
|
900
|
+
return !!(/^[a-z]+-\d+$/i.test(n2) || /^[a-z]+(-[a-z]+)+-\d+$/i.test(n2) || /^[a-z]+(_[a-z]+)*_\d+$/i.test(n2) || /^\d+$/.test(n2) || /^:[a-z0-9]+:$/i.test(n2) || /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i.test(n2) || /^[a-z]{1,3}[A-Za-z0-9]{8,}$/.test(n2) && (/\d/.test(n2) || /[A-Z]/.test(n2)) || /^radix-/.test(n2) || /^mui-\d+$/.test(n2));
|
|
901
|
+
}
|
|
902
|
+
const G = /* @__PURE__ */ new Set([
|
|
903
|
+
"aria-labelledby",
|
|
904
|
+
"aria-describedby",
|
|
905
|
+
"aria-controls",
|
|
906
|
+
"aria-owns",
|
|
907
|
+
"aria-activedescendant",
|
|
908
|
+
"for",
|
|
909
|
+
"form",
|
|
910
|
+
"list",
|
|
911
|
+
"headers",
|
|
912
|
+
"aria-details",
|
|
913
|
+
"aria-errormessage",
|
|
914
|
+
"aria-flowto"
|
|
915
|
+
]);
|
|
916
|
+
function V(n2) {
|
|
917
|
+
return n2.trim().split(/\s+/).some((e2) => D(e2));
|
|
918
|
+
}
|
|
919
|
+
class ft {
|
|
920
|
+
constructor(t2, e2) {
|
|
921
|
+
this.maxDepth = t2.maxPathDepth ?? 10, this.cache = e2;
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Finds the best anchor element for the target
|
|
925
|
+
* @param target - Target element to find anchor for
|
|
926
|
+
* @returns Anchor result or null if not found
|
|
927
|
+
*/
|
|
928
|
+
findAnchor(t2) {
|
|
929
|
+
if (this.cache) {
|
|
930
|
+
const i2 = this.cache.getAnchor(t2);
|
|
931
|
+
if (i2 !== void 0)
|
|
932
|
+
return i2;
|
|
933
|
+
}
|
|
934
|
+
let e2 = t2.parentElement, s2 = 0, r2 = null;
|
|
935
|
+
for (; e2 && s2 < this.maxDepth; ) {
|
|
936
|
+
if (e2.tagName.toLowerCase() === "body")
|
|
937
|
+
return r2 || {
|
|
938
|
+
element: e2,
|
|
939
|
+
score: I.DEGRADED_SCORE,
|
|
940
|
+
tier: "C",
|
|
941
|
+
depth: s2
|
|
942
|
+
};
|
|
943
|
+
const i2 = this.scoreAnchor(e2);
|
|
944
|
+
if (i2 > 0) {
|
|
945
|
+
const o2 = this.applyDepthPenalty(i2, s2), l2 = this.getTier(e2), u2 = { element: e2, score: o2, tier: l2, depth: s2 };
|
|
946
|
+
if (l2 === "A")
|
|
947
|
+
return u2;
|
|
948
|
+
(!r2 || o2 > r2.score) && (r2 = u2);
|
|
949
|
+
}
|
|
950
|
+
e2 = e2.parentElement, s2++;
|
|
951
|
+
}
|
|
952
|
+
const a2 = r2;
|
|
953
|
+
return this.cache && this.cache.setAnchor(t2, a2), a2;
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* Scores an element as anchor candidate (without depth penalty)
|
|
957
|
+
* @param element - Element to score
|
|
958
|
+
* @returns Raw score from 0 to 1
|
|
959
|
+
*/
|
|
960
|
+
scoreAnchor(t2) {
|
|
961
|
+
let e2 = 0;
|
|
962
|
+
const s2 = t2.tagName.toLowerCase();
|
|
963
|
+
X.includes(s2) && (e2 += I.SEMANTIC_TAG);
|
|
964
|
+
const r2 = t2.getAttribute("role");
|
|
965
|
+
r2 && K.includes(r2) && (e2 += I.ROLE), (t2.hasAttribute("aria-label") || t2.hasAttribute("aria-labelledby")) && (e2 += I.ARIA_LABEL);
|
|
966
|
+
const a2 = t2.id;
|
|
967
|
+
return a2 && !D(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);
|
|
968
|
+
}
|
|
969
|
+
/**
|
|
970
|
+
* Applies depth penalty to score
|
|
971
|
+
* Following SPECIFICATION.md §7: depthPenalty = (depth - threshold) * factor
|
|
972
|
+
*/
|
|
973
|
+
applyDepthPenalty(t2, e2) {
|
|
974
|
+
if (e2 <= I.DEPTH_PENALTY_THRESHOLD)
|
|
975
|
+
return t2;
|
|
976
|
+
const s2 = (e2 - I.DEPTH_PENALTY_THRESHOLD) * I.DEPTH_PENALTY_FACTOR;
|
|
977
|
+
return Math.max(0, t2 - s2);
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* Determines the tier of an anchor element
|
|
981
|
+
*/
|
|
982
|
+
getTier(t2) {
|
|
983
|
+
const e2 = t2.tagName.toLowerCase();
|
|
984
|
+
if (X.includes(e2))
|
|
985
|
+
return "A";
|
|
986
|
+
const s2 = t2.getAttribute("role");
|
|
987
|
+
return s2 && K.includes(s2) ? "B" : "C";
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
const gt = [
|
|
991
|
+
// CSS-in-JS
|
|
992
|
+
/^css-[a-z0-9]+$/i,
|
|
993
|
+
/^sc-[a-z0-9]+-\d+$/i,
|
|
994
|
+
/^[a-z]{5,8}$/i,
|
|
995
|
+
// Short generated classes (abcdef)
|
|
996
|
+
// Material-UI / MUI
|
|
997
|
+
/^Mui[A-Z]\w+-\w+-\w+/,
|
|
998
|
+
/^makeStyles-\w+-\d+$/,
|
|
999
|
+
// JSS
|
|
1000
|
+
/^jss\d+$/,
|
|
1001
|
+
// Emotion / Linaria
|
|
1002
|
+
/^(emotion|linaria)-[a-z0-9]+/i,
|
|
1003
|
+
// Component libraries with hashes
|
|
1004
|
+
/^(chakra|tw-|ant-)[a-z0-9]+-\w+/i,
|
|
1005
|
+
// Hash-based (hashes in classes)
|
|
1006
|
+
/-[a-f0-9]{6,}$/i,
|
|
1007
|
+
/^_[a-z0-9]{5,}$/i,
|
|
1008
|
+
/\d{5,}/
|
|
1009
|
+
// 5+ digits in a row
|
|
1010
|
+
], pt = [
|
|
1011
|
+
// === FIX 4: Tailwind arbitrary values and variants (highest priority) ===
|
|
1012
|
+
/^\[/,
|
|
1013
|
+
// Any arbitrary value or variant starting with [ (e.g., [&_svg]:..., [mask-type:luminance])
|
|
1014
|
+
// === FIX 4: Pseudo-class variants (must be before specific patterns) ===
|
|
1015
|
+
/^(first|last|odd|even|only|first-of-type|last-of-type|only-of-type):/,
|
|
1016
|
+
// first:, last:, etc.
|
|
1017
|
+
/^(hover|focus|active|disabled|enabled|checked|indeterminate|default|required|valid|invalid|in-range|out-of-range|placeholder-shown|autofill|read-only):/,
|
|
1018
|
+
// State pseudo-classes
|
|
1019
|
+
/^(focus-within|focus-visible|visited|target|open):/,
|
|
1020
|
+
// Advanced pseudo-classes
|
|
1021
|
+
// === FIX 4: Responsive variants (must be before specific patterns) ===
|
|
1022
|
+
/^(sm|md|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl):/,
|
|
1023
|
+
// === FIX 4: Dark mode and directional variants ===
|
|
1024
|
+
/^dark:/,
|
|
1025
|
+
/^(rtl|ltr):/,
|
|
1026
|
+
// === FIX 4: Group and peer variants ===
|
|
1027
|
+
/^(group|peer)(-hover|-focus|-active)?:/,
|
|
1028
|
+
// === FIX 4: Tailwind utilities with fraction values ===
|
|
1029
|
+
/\/([\d.]+|full|auto|screen)$/,
|
|
1030
|
+
// /50, /100, /full, /auto, /screen
|
|
1031
|
+
// === FIX 4: Positioning utilities ===
|
|
1032
|
+
/^(inset|top|right|bottom|left)(-|$)/,
|
|
1033
|
+
// inset-0, top-0, left-0
|
|
1034
|
+
// === Layout & Display ===
|
|
1035
|
+
/^(flex|inline-flex|grid|block|inline|inline-block|hidden|visible)$/,
|
|
1036
|
+
/^(absolute|relative|fixed|sticky|static)$/,
|
|
1037
|
+
// === Flexbox & Grid ===
|
|
1038
|
+
/^(items|justify|content|self|place)-/,
|
|
1039
|
+
/^flex-(row|col|wrap|nowrap|1|auto|initial|none)/,
|
|
1040
|
+
/^grid-(cols|rows|flow)/,
|
|
1041
|
+
// === Spacing (Tailwind) ===
|
|
1042
|
+
/^(gap|space)-/,
|
|
1043
|
+
/^[mp][trblxy]?-(\d+|auto|px)$/,
|
|
1044
|
+
// === Negative Tailwind utilities (margins, positioning, transforms) ===
|
|
1045
|
+
/^-[mp][trblxy]?-\d+$/,
|
|
1046
|
+
// -m-4, -mt-2, -mx-4, -px-4, -py-2
|
|
1047
|
+
/^-(top|right|bottom|left|inset)-\d+$/,
|
|
1048
|
+
// -top-4, -bottom-6, -left-6, -inset-0
|
|
1049
|
+
/^-z-\d+$/,
|
|
1050
|
+
// -z-10, -z-20
|
|
1051
|
+
/^-space-[xy]-\d+$/,
|
|
1052
|
+
// -space-x-2, -space-y-4
|
|
1053
|
+
/^-translate-[xy]-\d+$/,
|
|
1054
|
+
// -translate-x-4, -translate-y-2
|
|
1055
|
+
/^-rotate-\d+$/,
|
|
1056
|
+
// -rotate-45, -rotate-90
|
|
1057
|
+
/^-scale-\d+$/,
|
|
1058
|
+
// -scale-50, -scale-75
|
|
1059
|
+
/^-skew-[xy]-\d+$/,
|
|
1060
|
+
// -skew-x-12, -skew-y-6
|
|
1061
|
+
// === Sizing ===
|
|
1062
|
+
/^(w|h|min-w|min-h|max-w|max-h|size)-/,
|
|
1063
|
+
// === Colors & Styling ===
|
|
1064
|
+
// Note: text-* can be semantic (text-muted, text-primary) or utility (text-center, text-lg)
|
|
1065
|
+
// More specific patterns for utility text-* classes
|
|
1066
|
+
/^text-(center|left|right|justify|start|end|xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/,
|
|
1067
|
+
/^text-(uppercase|lowercase|capitalize|normal-case|underline|line-through|no-underline)$/,
|
|
1068
|
+
/^text-(truncate|ellipsis|clip)$/,
|
|
1069
|
+
/^(bg|border|ring|shadow|outline)-/,
|
|
1070
|
+
/^rounded(-|$)/,
|
|
1071
|
+
// === Typography ===
|
|
1072
|
+
/^(font|leading|tracking|whitespace|break|truncate)-/,
|
|
1073
|
+
/^(uppercase|lowercase|capitalize|normal-case)$/,
|
|
1074
|
+
// === Transform & Animation (IMPORTANT!) ===
|
|
1075
|
+
/^(transform|transition|duration|delay|ease|animate)-/,
|
|
1076
|
+
/^(scale|rotate|translate|skew)-/,
|
|
1077
|
+
/^transform$/,
|
|
1078
|
+
/^backdrop-blur-/,
|
|
1079
|
+
/^motion-/,
|
|
1080
|
+
// Framer Motion
|
|
1081
|
+
/^(fade|slide|zoom|bounce|pulse|spin|ping)-/,
|
|
1082
|
+
// animations
|
|
1083
|
+
// === Overflow & Scrolling ===
|
|
1084
|
+
/^(overflow|overscroll|scroll)-/,
|
|
1085
|
+
/^object-(contain|cover|fill|none|scale-down)$/,
|
|
1086
|
+
// === Interactivity ===
|
|
1087
|
+
/^(cursor|pointer-events|select|resize)-/,
|
|
1088
|
+
// === Visibility & Opacity ===
|
|
1089
|
+
/^(opacity|z)-/,
|
|
1090
|
+
/^(visible|invisible|collapse)$/,
|
|
1091
|
+
// === Bootstrap utilities ===
|
|
1092
|
+
/^d-(none|inline|inline-block|block|grid|table|flex)$/,
|
|
1093
|
+
/^(float|clearfix|text)-(left|right|center|justify|start|end)$/,
|
|
1094
|
+
/^(m|p)[trblxy]?-[0-5]$/,
|
|
1095
|
+
/^(w|h)-(25|50|75|100|auto)$/,
|
|
1096
|
+
// Note: btn-* classes are semantic (component classes), not utility
|
|
1097
|
+
// /^btn-(primary|secondary|success|danger|warning|info|light|dark|link)$/,
|
|
1098
|
+
/^btn-(sm|lg|block)$/,
|
|
1099
|
+
// Only size modifiers are utility
|
|
1100
|
+
/^text-(muted|primary|success|danger|warning|info|light|dark|white)$/,
|
|
1101
|
+
/^bg-(primary|secondary|success|danger|warning|info|light|dark|white|transparent)$/,
|
|
1102
|
+
/^border(-top|-bottom|-left|-right)?(-0)?$/,
|
|
1103
|
+
/^rounded(-top|-bottom|-left|-right|-circle|-pill|-0)?$/,
|
|
1104
|
+
/^shadow(-sm|-lg|-none)?$/,
|
|
1105
|
+
/^(align|justify|order|flex)-(start|end|center|between|around|fill|grow|shrink)$/,
|
|
1106
|
+
/^col(-sm|-md|-lg|-xl)?(-\d+|-auto)?$/,
|
|
1107
|
+
/^row(-cols)?(-\d+)?$/,
|
|
1108
|
+
/^g[xy]?-[0-5]$/,
|
|
1109
|
+
/^(show|hide|invisible|visible)$/,
|
|
1110
|
+
/^(position|top|bottom|start|end)-(static|relative|absolute|fixed|sticky|-\d+)$/,
|
|
1111
|
+
// === Common utility patterns ===
|
|
1112
|
+
/^(row|col)$/,
|
|
1113
|
+
/^clearfix$/,
|
|
1114
|
+
/^pull-(left|right)$/,
|
|
1115
|
+
/^float-(left|right|none)$/
|
|
1116
|
+
];
|
|
1117
|
+
function _(n2) {
|
|
1118
|
+
return gt.some((t2) => t2.test(n2));
|
|
1119
|
+
}
|
|
1120
|
+
function q(n2) {
|
|
1121
|
+
return n2.length <= 2 || /^\d/.test(n2) ? true : pt.some((t2) => t2.test(n2));
|
|
1122
|
+
}
|
|
1123
|
+
function St(n2) {
|
|
1124
|
+
return !_(n2) && !q(n2);
|
|
1125
|
+
}
|
|
1126
|
+
function N(n2) {
|
|
1127
|
+
return n2.filter((t2) => St(t2));
|
|
1128
|
+
}
|
|
1129
|
+
function At(n2) {
|
|
1130
|
+
const t2 = [], e2 = [];
|
|
1131
|
+
for (const s2 of n2)
|
|
1132
|
+
q(s2) || _(s2) ? e2.push(s2) : t2.push(s2);
|
|
1133
|
+
return { semantic: t2, utility: e2 };
|
|
1134
|
+
}
|
|
1135
|
+
function J(n2) {
|
|
1136
|
+
return q(n2) || _(n2);
|
|
1137
|
+
}
|
|
1138
|
+
const tt = (n2) => n2.replace(/([#:.[\]@])/g, "\\$1");
|
|
1139
|
+
class xt {
|
|
1140
|
+
constructor(t2, e2) {
|
|
1141
|
+
this.maxDepth = t2.maxPathDepth ?? 10, this.cache = e2;
|
|
1142
|
+
}
|
|
1143
|
+
/**
|
|
1144
|
+
* Builds path from anchor to target (excluding both)
|
|
1145
|
+
* @param anchor - Anchor element (start)
|
|
1146
|
+
* @param target - Target element (end)
|
|
1147
|
+
* @param extractor - Semantic extractor instance
|
|
1148
|
+
* @returns Path build result with nodes and degradation info
|
|
1149
|
+
*/
|
|
1150
|
+
buildPath(t2, e2, s2) {
|
|
1151
|
+
const r2 = [];
|
|
1152
|
+
let a2 = e2.parentElement;
|
|
1153
|
+
for (; a2 && a2 !== t2 && r2.length < this.maxDepth; )
|
|
1154
|
+
r2.unshift(a2), a2 = a2.parentElement;
|
|
1155
|
+
const i2 = r2.length >= this.maxDepth && a2 !== t2;
|
|
1156
|
+
let o2 = this.filterNoise(r2);
|
|
1157
|
+
return o2 = this.ensureUniqueness(r2, o2, t2, e2, s2), {
|
|
1158
|
+
path: o2.map((u2) => {
|
|
1159
|
+
const d = u2.parentElement;
|
|
1160
|
+
let c2;
|
|
1161
|
+
if (d) {
|
|
1162
|
+
const g = Array.from(d.children).indexOf(u2);
|
|
1163
|
+
g !== -1 && (c2 = g + 1);
|
|
1164
|
+
}
|
|
1165
|
+
return {
|
|
1166
|
+
tag: u2.tagName.toLowerCase(),
|
|
1167
|
+
semantics: s2.extract(u2),
|
|
1168
|
+
score: s2.scoreElement(u2),
|
|
1169
|
+
nthChild: c2
|
|
1170
|
+
};
|
|
1171
|
+
}),
|
|
1172
|
+
degraded: i2,
|
|
1173
|
+
degradationReason: i2 ? "path-depth-overflow" : void 0
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
/**
|
|
1177
|
+
* Legacy method for backward compatibility
|
|
1178
|
+
*/
|
|
1179
|
+
buildPathNodes(t2, e2, s2) {
|
|
1180
|
+
return this.buildPath(t2, e2, s2).path;
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* Ensures path uniqueness by adding nodes if needed
|
|
1184
|
+
* Following SPECIFICATION.md §8 Disambiguation Algorithm
|
|
1185
|
+
*/
|
|
1186
|
+
ensureUniqueness(t2, e2, s2, r2, a2) {
|
|
1187
|
+
const i2 = this.buildTestSelector(s2, e2, r2);
|
|
1188
|
+
try {
|
|
1189
|
+
const o2 = r2.ownerDocument;
|
|
1190
|
+
if (!o2) return e2;
|
|
1191
|
+
let l2;
|
|
1192
|
+
if (this.cache) {
|
|
1193
|
+
const d = this.cache.getSelectorResults(i2);
|
|
1194
|
+
d !== void 0 ? l2 = d : (l2 = Array.from(o2.querySelectorAll(i2)), this.cache.setSelectorResults(i2, l2));
|
|
1195
|
+
} else
|
|
1196
|
+
l2 = o2.querySelectorAll(i2);
|
|
1197
|
+
if (l2.length <= 1)
|
|
1198
|
+
return e2;
|
|
1199
|
+
const u2 = t2.filter((d) => !e2.includes(d));
|
|
1200
|
+
for (const d of u2) {
|
|
1201
|
+
if (a2.scoreElement(d) < ct.MIN_CONFIDENCE_FOR_SKIP)
|
|
1202
|
+
continue;
|
|
1203
|
+
const h = this.insertNodeInOrder(e2, d, t2), g = this.buildTestSelector(s2, h, r2);
|
|
1204
|
+
try {
|
|
1205
|
+
let f2;
|
|
1206
|
+
if (this.cache) {
|
|
1207
|
+
const p = this.cache.getSelectorResults(g);
|
|
1208
|
+
p !== void 0 ? f2 = p : (f2 = Array.from(o2.querySelectorAll(g)), this.cache.setSelectorResults(g, f2));
|
|
1209
|
+
} else
|
|
1210
|
+
f2 = o2.querySelectorAll(g);
|
|
1211
|
+
if (f2.length === 1)
|
|
1212
|
+
return h;
|
|
1213
|
+
f2.length < l2.length && (e2 = h);
|
|
1214
|
+
} catch {
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
return e2;
|
|
1218
|
+
} catch {
|
|
1219
|
+
return e2;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* Inserts node into path maintaining original order
|
|
1224
|
+
*/
|
|
1225
|
+
insertNodeInOrder(t2, e2, s2) {
|
|
1226
|
+
const r2 = s2.indexOf(e2), a2 = [...t2];
|
|
1227
|
+
let i2 = 0;
|
|
1228
|
+
for (let o2 = 0; o2 < a2.length && !(s2.indexOf(a2[o2]) > r2); o2++)
|
|
1229
|
+
i2 = o2 + 1;
|
|
1230
|
+
return a2.splice(i2, 0, e2), a2;
|
|
1231
|
+
}
|
|
1232
|
+
/**
|
|
1233
|
+
* Builds a test CSS selector from path
|
|
1234
|
+
*/
|
|
1235
|
+
buildTestSelector(t2, e2, s2) {
|
|
1236
|
+
const r2 = [];
|
|
1237
|
+
r2.push(this.elementToSelector(t2));
|
|
1238
|
+
for (const a2 of e2)
|
|
1239
|
+
r2.push(this.elementToSelector(a2));
|
|
1240
|
+
return r2.push(this.elementToSelector(s2)), r2.join(" ");
|
|
1241
|
+
}
|
|
1242
|
+
/**
|
|
1243
|
+
* Converts element to basic CSS selector
|
|
1244
|
+
*/
|
|
1245
|
+
elementToSelector(t2) {
|
|
1246
|
+
let e2 = t2.tagName.toLowerCase();
|
|
1247
|
+
t2.id && !D(t2.id) && (e2 += `#${tt(t2.id)}`);
|
|
1248
|
+
for (const s2 of Array.from(t2.classList))
|
|
1249
|
+
J(s2) || (e2 += `.${tt(s2)}`);
|
|
1250
|
+
return e2;
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* Filters out noise/layout elements
|
|
1254
|
+
*/
|
|
1255
|
+
filterNoise(t2) {
|
|
1256
|
+
return t2.filter((e2) => this.shouldInclude(e2));
|
|
1257
|
+
}
|
|
1258
|
+
/**
|
|
1259
|
+
* Determines if element should be included in path
|
|
1260
|
+
*/
|
|
1261
|
+
shouldInclude(t2) {
|
|
1262
|
+
const e2 = t2.tagName.toLowerCase();
|
|
1263
|
+
return lt.includes(e2) ? true : e2 === "div" || e2 === "span" ? this.hasSemanticFeatures(t2) : false;
|
|
1264
|
+
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Checks if element has meaningful semantic features
|
|
1267
|
+
*/
|
|
1268
|
+
hasSemanticFeatures(t2) {
|
|
1269
|
+
if (t2.hasAttribute("role")) return true;
|
|
1270
|
+
for (const s2 of Array.from(t2.attributes))
|
|
1271
|
+
if (s2.name.startsWith("aria-")) return true;
|
|
1272
|
+
if (t2.classList.length > 0) {
|
|
1273
|
+
for (const s2 of Array.from(t2.classList))
|
|
1274
|
+
if (!J(s2)) return true;
|
|
1275
|
+
}
|
|
1276
|
+
if (t2.hasAttribute("data-testid") || t2.hasAttribute("data-qa") || t2.hasAttribute("data-test"))
|
|
1277
|
+
return true;
|
|
1278
|
+
const e2 = t2.id;
|
|
1279
|
+
return !!(e2 && !D(e2));
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
function Q(n2) {
|
|
1283
|
+
return n2 ? n2.trim().replace(/[\n\t\r]/g, " ").replace(/\s+/g, " ") : "";
|
|
1284
|
+
}
|
|
1285
|
+
const Ct = {
|
|
1286
|
+
preserveQueryForAbsolute: true,
|
|
1287
|
+
removeDynamicHashes: true
|
|
1288
|
+
};
|
|
1289
|
+
function Tt(n2) {
|
|
1290
|
+
return n2 ? [
|
|
1291
|
+
/\d{5,}/,
|
|
1292
|
+
// 5+ digits
|
|
1293
|
+
/[a-f0-9]{8,}/i,
|
|
1294
|
+
// hex hash 8+ characters
|
|
1295
|
+
/(session|token|temp|random|timestamp|nonce|cache)/i,
|
|
1296
|
+
// dynamic words
|
|
1297
|
+
/^\d+$/,
|
|
1298
|
+
// only digits
|
|
1299
|
+
/^[a-f0-9-]{32,}$/i
|
|
1300
|
+
// UUID-like
|
|
1301
|
+
].some((e2) => e2.test(n2)) : false;
|
|
1302
|
+
}
|
|
1303
|
+
function Et(n2, t2) {
|
|
1304
|
+
if (!n2) return n2;
|
|
1305
|
+
const e2 = n2.startsWith("http://") || n2.startsWith("https://"), [s2, r2] = n2.split("#"), [a2, i2] = s2.split("?");
|
|
1306
|
+
let o2 = a2;
|
|
1307
|
+
return e2 && t2.preserveQueryForAbsolute && i2 && (o2 += `?${i2}`), r2 && (t2.removeDynamicHashes && Tt(r2) || (o2 += `#${r2}`)), o2;
|
|
1308
|
+
}
|
|
1309
|
+
function k(n2, t2, e2 = {}) {
|
|
1310
|
+
if (!t2) return t2;
|
|
1311
|
+
const s2 = { ...Ct, ...e2 };
|
|
1312
|
+
return n2 === "href" || n2 === "src" ? Et(t2, s2) : t2;
|
|
1313
|
+
}
|
|
1314
|
+
const wt = [
|
|
1315
|
+
"role",
|
|
1316
|
+
"aria-label",
|
|
1317
|
+
"aria-labelledby",
|
|
1318
|
+
"aria-describedby",
|
|
1319
|
+
"aria-controls",
|
|
1320
|
+
"aria-owns",
|
|
1321
|
+
"aria-level",
|
|
1322
|
+
"aria-posinset",
|
|
1323
|
+
"aria-setsize",
|
|
1324
|
+
"aria-haspopup"
|
|
1325
|
+
], vt = [
|
|
1326
|
+
"aria-selected",
|
|
1327
|
+
"aria-checked",
|
|
1328
|
+
"aria-pressed",
|
|
1329
|
+
"aria-expanded",
|
|
1330
|
+
"aria-hidden",
|
|
1331
|
+
"aria-disabled",
|
|
1332
|
+
"aria-current",
|
|
1333
|
+
"aria-busy",
|
|
1334
|
+
"aria-invalid",
|
|
1335
|
+
"aria-grabbed",
|
|
1336
|
+
"aria-live",
|
|
1337
|
+
"aria-atomic"
|
|
1338
|
+
], $t = [
|
|
1339
|
+
"data-state",
|
|
1340
|
+
"data-active",
|
|
1341
|
+
"data-inactive",
|
|
1342
|
+
"data-selected",
|
|
1343
|
+
"data-open",
|
|
1344
|
+
"data-closed",
|
|
1345
|
+
"data-visible",
|
|
1346
|
+
"data-hidden",
|
|
1347
|
+
"data-disabled",
|
|
1348
|
+
"data-enabled",
|
|
1349
|
+
"data-loading",
|
|
1350
|
+
"data-error",
|
|
1351
|
+
"data-success",
|
|
1352
|
+
"data-highlighted",
|
|
1353
|
+
"data-focused",
|
|
1354
|
+
"data-hover",
|
|
1355
|
+
"data-orientation",
|
|
1356
|
+
"data-theme"
|
|
1357
|
+
], Mt = [
|
|
1358
|
+
"data-radix-",
|
|
1359
|
+
"data-headlessui-",
|
|
1360
|
+
"data-reach-",
|
|
1361
|
+
"data-mui-",
|
|
1362
|
+
"data-chakra-",
|
|
1363
|
+
"data-mantine-",
|
|
1364
|
+
"data-tw-"
|
|
1365
|
+
], It = [
|
|
1366
|
+
"data-testid",
|
|
1367
|
+
"data-test-id",
|
|
1368
|
+
"data-test",
|
|
1369
|
+
"data-cy",
|
|
1370
|
+
"data-qa",
|
|
1371
|
+
"data-automation-id",
|
|
1372
|
+
"data-id",
|
|
1373
|
+
"data-component",
|
|
1374
|
+
"data-entity-id",
|
|
1375
|
+
"data-product-id",
|
|
1376
|
+
"data-user-id"
|
|
1377
|
+
], Rt = [
|
|
1378
|
+
"id",
|
|
1379
|
+
"name",
|
|
1380
|
+
"type",
|
|
1381
|
+
"placeholder",
|
|
1382
|
+
"title",
|
|
1383
|
+
"for",
|
|
1384
|
+
"alt",
|
|
1385
|
+
"href"
|
|
1386
|
+
], Nt = [
|
|
1387
|
+
"disabled",
|
|
1388
|
+
"checked",
|
|
1389
|
+
"selected",
|
|
1390
|
+
"hidden",
|
|
1391
|
+
"readonly",
|
|
1392
|
+
"required",
|
|
1393
|
+
"value"
|
|
1394
|
+
], Dt = [
|
|
1395
|
+
/^radix-/,
|
|
1396
|
+
/^headlessui-/,
|
|
1397
|
+
/^mui-/,
|
|
1398
|
+
/:\w+:/
|
|
1399
|
+
// matches :ru:, :r1:, etc.
|
|
1400
|
+
];
|
|
1401
|
+
function Ht(n2, t2) {
|
|
1402
|
+
return wt.includes(n2) ? true : vt.includes(n2) || $t.includes(n2) || Mt.some((e2) => n2.startsWith(e2)) ? false : It.includes(n2) || n2.startsWith("data-") && n2.endsWith("-id") ? true : n2 === "id" ? !Dt.some((e2) => e2.test(t2)) : Rt.includes(n2) ? true : Nt.includes(n2) ? false : !!n2.startsWith("data-");
|
|
1403
|
+
}
|
|
1404
|
+
class Pt {
|
|
1405
|
+
constructor(t2, e2) {
|
|
1406
|
+
this.includeUtilityClasses = t2.includeUtilityClasses ?? false, this.cache = e2;
|
|
1407
|
+
}
|
|
1408
|
+
/**
|
|
1409
|
+
* Extracts semantic features from element
|
|
1410
|
+
* @param element - DOM element to extract from
|
|
1411
|
+
* @returns Semantic features object
|
|
1412
|
+
*/
|
|
1413
|
+
extract(t2) {
|
|
1414
|
+
if (this.cache) {
|
|
1415
|
+
const i2 = this.cache.getSemantics(t2);
|
|
1416
|
+
if (i2 !== void 0)
|
|
1417
|
+
return i2;
|
|
1418
|
+
}
|
|
1419
|
+
const e2 = {}, s2 = t2.id;
|
|
1420
|
+
if (s2 && !D(s2) && (e2.id = s2), t2.classList.length > 0) {
|
|
1421
|
+
const i2 = Array.from(t2.classList);
|
|
1422
|
+
if (this.includeUtilityClasses)
|
|
1423
|
+
e2.classes = i2;
|
|
1424
|
+
else {
|
|
1425
|
+
const { semantic: o2 } = At(i2);
|
|
1426
|
+
o2.length > 0 && (e2.classes = o2);
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
const r2 = this.extractAttributes(t2);
|
|
1430
|
+
Object.keys(r2).length > 0 && (e2.attributes = r2);
|
|
1431
|
+
const a2 = t2.getAttribute("role");
|
|
1432
|
+
if (a2 && (e2.role = a2), this.shouldExtractText(t2)) {
|
|
1433
|
+
const i2 = this.extractText(t2);
|
|
1434
|
+
i2 && (e2.text = i2);
|
|
1435
|
+
}
|
|
1436
|
+
return this.cache && this.cache.setSemantics(t2, e2), e2;
|
|
1437
|
+
}
|
|
1438
|
+
/**
|
|
1439
|
+
* Scores element based on semantic richness
|
|
1440
|
+
* @param element - Element to score
|
|
1441
|
+
* @returns Score from 0 to 1
|
|
1442
|
+
*/
|
|
1443
|
+
scoreElement(t2) {
|
|
1444
|
+
let e2 = 0.5;
|
|
1445
|
+
const s2 = this.extract(t2);
|
|
1446
|
+
return s2.id && (e2 += 0.15), s2.classes && s2.classes.length > 0 && (e2 += 0.1), s2.attributes && Object.keys(s2.attributes).length > 0 && (e2 += 0.1), s2.role && (e2 += 0.1), s2.text && (e2 += 0.05), Math.min(e2, 1);
|
|
1447
|
+
}
|
|
1448
|
+
/**
|
|
1449
|
+
* Checks if attribute should be ignored
|
|
1450
|
+
* @param attrName - Attribute name
|
|
1451
|
+
* @returns True if should be ignored
|
|
1452
|
+
*/
|
|
1453
|
+
shouldIgnoreAttribute(t2) {
|
|
1454
|
+
return !!(B.has(t2) || t2.startsWith("on") || t2.startsWith("ng-") || t2.startsWith("_ng") || t2.startsWith("data-reactid") || t2.startsWith("data-react") || t2.startsWith("data-v-"));
|
|
1455
|
+
}
|
|
1456
|
+
/**
|
|
1457
|
+
* Gets attribute priority
|
|
1458
|
+
* @param attrName - Attribute name
|
|
1459
|
+
* @returns Priority number (higher = more priority)
|
|
1460
|
+
*/
|
|
1461
|
+
getAttributePriority(t2) {
|
|
1462
|
+
return w[t2] !== void 0 ? w[t2] : t2.startsWith("data-") ? w["data-*"] : t2.startsWith("aria-") ? w["aria-*"] : 0;
|
|
1463
|
+
}
|
|
1464
|
+
/**
|
|
1465
|
+
* Checks if attribute value is dynamic (should be ignored)
|
|
1466
|
+
* @param value - Attribute value
|
|
1467
|
+
* @returns True if value is dynamic
|
|
1468
|
+
*/
|
|
1469
|
+
isDynamicValue(t2) {
|
|
1470
|
+
return [
|
|
1471
|
+
/^[a-f0-9]{32,}$/i,
|
|
1472
|
+
// Long hashes
|
|
1473
|
+
/^\d{10,}$/,
|
|
1474
|
+
// Timestamp
|
|
1475
|
+
/^(undefined|null|\[object)/,
|
|
1476
|
+
// JS artifacts
|
|
1477
|
+
/^{{.*}}$/
|
|
1478
|
+
// Template literals
|
|
1479
|
+
].some((s2) => s2.test(t2));
|
|
1480
|
+
}
|
|
1481
|
+
/**
|
|
1482
|
+
* Extracts relevant semantic attributes from element
|
|
1483
|
+
* Iterates through all attributes and filters by priority
|
|
1484
|
+
*/
|
|
1485
|
+
extractAttributes(t2) {
|
|
1486
|
+
const e2 = {};
|
|
1487
|
+
for (const s2 of Array.from(t2.attributes)) {
|
|
1488
|
+
const r2 = s2.name;
|
|
1489
|
+
if (this.shouldIgnoreAttribute(r2) || !Ht(r2, s2.value) || G.has(r2) && V(s2.value) || this.getAttributePriority(r2) === 0) continue;
|
|
1490
|
+
const i2 = r2 === "href" || r2 === "src" ? k(r2, s2.value) : s2.value;
|
|
1491
|
+
!i2 || i2.trim() === "" || this.isDynamicValue(i2) || (e2[r2] = i2);
|
|
1492
|
+
}
|
|
1493
|
+
return e2;
|
|
1494
|
+
}
|
|
1495
|
+
/**
|
|
1496
|
+
* Extracts and normalizes text content
|
|
1497
|
+
*/
|
|
1498
|
+
extractText(t2) {
|
|
1499
|
+
const e2 = this.getDirectTextContent(t2);
|
|
1500
|
+
if (!e2) return null;
|
|
1501
|
+
const s2 = Q(e2);
|
|
1502
|
+
if (!s2) return null;
|
|
1503
|
+
const r2 = 100, a2 = e2.length > r2 ? e2.slice(0, r2) + "..." : e2, i2 = s2.length > r2 ? s2.slice(0, r2) + "..." : s2;
|
|
1504
|
+
return {
|
|
1505
|
+
raw: a2,
|
|
1506
|
+
normalized: i2
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
/**
|
|
1510
|
+
* Gets direct text content excluding child elements
|
|
1511
|
+
*/
|
|
1512
|
+
getDirectTextContent(t2) {
|
|
1513
|
+
const e2 = [];
|
|
1514
|
+
for (const s2 of Array.from(t2.childNodes))
|
|
1515
|
+
if (s2.nodeType === Node.TEXT_NODE && s2.textContent) {
|
|
1516
|
+
const r2 = s2.textContent.trim();
|
|
1517
|
+
r2 && e2.push(r2);
|
|
1518
|
+
}
|
|
1519
|
+
return e2.length > 0 ? e2.join(" ") : t2.textContent ?? null;
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* Determines if text should be extracted for this element
|
|
1523
|
+
*/
|
|
1524
|
+
shouldExtractText(t2) {
|
|
1525
|
+
const e2 = t2.tagName.toLowerCase();
|
|
1526
|
+
return [
|
|
1527
|
+
"button",
|
|
1528
|
+
"a",
|
|
1529
|
+
"label",
|
|
1530
|
+
"h1",
|
|
1531
|
+
"h2",
|
|
1532
|
+
"h3",
|
|
1533
|
+
"h4",
|
|
1534
|
+
"h5",
|
|
1535
|
+
"h6",
|
|
1536
|
+
"p",
|
|
1537
|
+
"span",
|
|
1538
|
+
"li",
|
|
1539
|
+
"th",
|
|
1540
|
+
"td",
|
|
1541
|
+
"dt",
|
|
1542
|
+
"dd",
|
|
1543
|
+
"legend",
|
|
1544
|
+
"figcaption",
|
|
1545
|
+
"summary"
|
|
1546
|
+
].includes(e2);
|
|
1547
|
+
}
|
|
1548
|
+
}
|
|
1549
|
+
class kt {
|
|
1550
|
+
/**
|
|
1551
|
+
* Generates fingerprint for SVG element
|
|
1552
|
+
* @param element - SVG element to fingerprint
|
|
1553
|
+
* @returns SVG fingerprint object
|
|
1554
|
+
*/
|
|
1555
|
+
fingerprint(t2) {
|
|
1556
|
+
const e2 = t2.tagName.toLowerCase(), s2 = this.getShape(e2), r2 = {
|
|
1557
|
+
shape: s2,
|
|
1558
|
+
hasAnimation: this.hasAnimation(t2)
|
|
1559
|
+
};
|
|
1560
|
+
if (s2 === "path") {
|
|
1561
|
+
const o2 = t2.getAttribute("d");
|
|
1562
|
+
o2 && (r2.dHash = this.computePathHash(o2));
|
|
1563
|
+
} else ["circle", "rect", "ellipse", "line"].includes(s2) && (r2.geomHash = this.computeGeomHash(t2, s2));
|
|
1564
|
+
const a2 = t2.getAttribute("role");
|
|
1565
|
+
a2 && (r2.role = a2);
|
|
1566
|
+
const i2 = t2.querySelector("title");
|
|
1567
|
+
return (i2 == null ? void 0 : i2.textContent) && (r2.titleText = i2.textContent.trim()), r2;
|
|
1568
|
+
}
|
|
1569
|
+
/**
|
|
1570
|
+
* Computes hash from path data (first N commands)
|
|
1571
|
+
* @param d - SVG path d attribute value
|
|
1572
|
+
* @returns Hash string
|
|
1573
|
+
*/
|
|
1574
|
+
computePathHash(t2) {
|
|
1575
|
+
const e2 = this.normalizePathData(t2);
|
|
1576
|
+
return this.simpleHash(e2);
|
|
1577
|
+
}
|
|
1578
|
+
/**
|
|
1579
|
+
* Gets the shape type from tag name
|
|
1580
|
+
*/
|
|
1581
|
+
getShape(t2) {
|
|
1582
|
+
return [
|
|
1583
|
+
"path",
|
|
1584
|
+
"circle",
|
|
1585
|
+
"rect",
|
|
1586
|
+
"line",
|
|
1587
|
+
"polyline",
|
|
1588
|
+
"polygon",
|
|
1589
|
+
"ellipse",
|
|
1590
|
+
"g",
|
|
1591
|
+
"text",
|
|
1592
|
+
"use",
|
|
1593
|
+
"svg"
|
|
1594
|
+
].find((s2) => s2 === t2) ?? "path";
|
|
1595
|
+
}
|
|
1596
|
+
/**
|
|
1597
|
+
* Normalizes path data for consistent hashing
|
|
1598
|
+
*/
|
|
1599
|
+
normalizePathData(t2) {
|
|
1600
|
+
return (t2.match(/[MLHVCSQTAZ][^MLHVCSQTAZ]*/gi) ?? []).slice(0, 5).map((r2) => r2.trim().replace(/(-?\d+\.?\d*)/g, (a2) => parseFloat(a2).toFixed(1))).join(" ");
|
|
1601
|
+
}
|
|
1602
|
+
/**
|
|
1603
|
+
* Computes geometry hash for non-path shapes
|
|
1604
|
+
*/
|
|
1605
|
+
computeGeomHash(t2, e2) {
|
|
1606
|
+
const s2 = [];
|
|
1607
|
+
switch (e2) {
|
|
1608
|
+
case "circle":
|
|
1609
|
+
s2.push(`r=${t2.getAttribute("r") ?? "0"}`);
|
|
1610
|
+
break;
|
|
1611
|
+
case "rect":
|
|
1612
|
+
{
|
|
1613
|
+
const r2 = parseFloat(t2.getAttribute("width") ?? "0"), a2 = parseFloat(t2.getAttribute("height") ?? "0");
|
|
1614
|
+
r2 > 0 && a2 > 0 && s2.push(`ratio=${(r2 / a2).toFixed(2)}`);
|
|
1615
|
+
}
|
|
1616
|
+
break;
|
|
1617
|
+
case "ellipse":
|
|
1618
|
+
{
|
|
1619
|
+
const r2 = parseFloat(t2.getAttribute("rx") ?? "0"), a2 = parseFloat(t2.getAttribute("ry") ?? "0");
|
|
1620
|
+
r2 > 0 && a2 > 0 && s2.push(`ratio=${(r2 / a2).toFixed(2)}`);
|
|
1621
|
+
}
|
|
1622
|
+
break;
|
|
1623
|
+
case "line":
|
|
1624
|
+
{
|
|
1625
|
+
const r2 = parseFloat(t2.getAttribute("x1") ?? "0"), a2 = parseFloat(t2.getAttribute("y1") ?? "0"), i2 = parseFloat(t2.getAttribute("x2") ?? "0"), o2 = parseFloat(t2.getAttribute("y2") ?? "0"), l2 = Math.atan2(o2 - a2, i2 - r2);
|
|
1626
|
+
s2.push(`angle=${l2.toFixed(2)}`);
|
|
1627
|
+
}
|
|
1628
|
+
break;
|
|
1629
|
+
}
|
|
1630
|
+
return this.simpleHash(s2.join(";"));
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* Detects animations on SVG element
|
|
1634
|
+
*/
|
|
1635
|
+
hasAnimation(t2) {
|
|
1636
|
+
if (t2.querySelector("animate, animateTransform, animateMotion"))
|
|
1637
|
+
return true;
|
|
1638
|
+
const e2 = t2.ownerDocument;
|
|
1639
|
+
if (e2 == null ? void 0 : e2.defaultView)
|
|
1640
|
+
try {
|
|
1641
|
+
const s2 = e2.defaultView.getComputedStyle(t2);
|
|
1642
|
+
if (s2.animationName !== "none" || s2.transitionProperty !== "all" && s2.transitionProperty !== "none")
|
|
1643
|
+
return true;
|
|
1644
|
+
} catch {
|
|
1645
|
+
}
|
|
1646
|
+
return false;
|
|
1647
|
+
}
|
|
1648
|
+
/**
|
|
1649
|
+
* Simple hash function for fingerprinting (not cryptographic)
|
|
1650
|
+
*/
|
|
1651
|
+
simpleHash(t2) {
|
|
1652
|
+
let e2 = 0;
|
|
1653
|
+
for (let s2 = 0; s2 < t2.length; s2++) {
|
|
1654
|
+
const r2 = t2.charCodeAt(s2);
|
|
1655
|
+
e2 = (e2 << 5) - e2 + r2, e2 = e2 & e2;
|
|
1656
|
+
}
|
|
1657
|
+
return Math.abs(e2).toString(16).padStart(8, "0");
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
function _t(n2, t2 = 0) {
|
|
1661
|
+
const e2 = n2.anchor.score, s2 = n2.path.length > 0 ? n2.path.reduce((o2, l2) => o2 + l2.score, 0) / n2.path.length : 0.5, r2 = n2.target.score, a2 = e2 * L.ANCHOR + s2 * L.PATH + r2 * L.TARGET + t2 * L.UNIQUENESS, i2 = n2.anchor.degraded ? 0.2 : 0;
|
|
1662
|
+
return Math.max(0, Math.min(1, a2 - i2));
|
|
1663
|
+
}
|
|
1664
|
+
class qt {
|
|
1665
|
+
constructor(t2) {
|
|
1666
|
+
this.cache = /* @__PURE__ */ new Map(), this.maxSize = t2;
|
|
1667
|
+
}
|
|
1668
|
+
get(t2) {
|
|
1669
|
+
const e2 = this.cache.get(t2);
|
|
1670
|
+
if (e2 !== void 0)
|
|
1671
|
+
return this.cache.delete(t2), this.cache.set(t2, e2), e2;
|
|
1672
|
+
}
|
|
1673
|
+
set(t2, e2) {
|
|
1674
|
+
if (this.cache.has(t2))
|
|
1675
|
+
this.cache.delete(t2);
|
|
1676
|
+
else if (this.cache.size >= this.maxSize) {
|
|
1677
|
+
const s2 = this.cache.keys().next().value;
|
|
1678
|
+
s2 !== void 0 && this.cache.delete(s2);
|
|
1679
|
+
}
|
|
1680
|
+
this.cache.set(t2, e2);
|
|
1681
|
+
}
|
|
1682
|
+
has(t2) {
|
|
1683
|
+
return this.cache.has(t2);
|
|
1684
|
+
}
|
|
1685
|
+
delete(t2) {
|
|
1686
|
+
this.cache.delete(t2);
|
|
1687
|
+
}
|
|
1688
|
+
clear() {
|
|
1689
|
+
this.cache.clear();
|
|
1690
|
+
}
|
|
1691
|
+
get size() {
|
|
1692
|
+
return this.cache.size;
|
|
1693
|
+
}
|
|
1694
|
+
}
|
|
1695
|
+
class Lt {
|
|
1696
|
+
constructor(t2 = {}) {
|
|
1697
|
+
this.eidCache = /* @__PURE__ */ new WeakMap(), this.selectorResultCache = new qt(
|
|
1698
|
+
t2.maxSelectorCacheSize ?? 1e3
|
|
1699
|
+
), this.anchorCache = /* @__PURE__ */ new WeakMap(), this.semanticsCache = /* @__PURE__ */ new WeakMap(), this.stats = {
|
|
1700
|
+
eidHits: 0,
|
|
1701
|
+
eidMisses: 0,
|
|
1702
|
+
selectorHits: 0,
|
|
1703
|
+
selectorMisses: 0,
|
|
1704
|
+
anchorHits: 0,
|
|
1705
|
+
anchorMisses: 0,
|
|
1706
|
+
semanticsHits: 0,
|
|
1707
|
+
semanticsMisses: 0,
|
|
1708
|
+
selectorCacheSize: 0,
|
|
1709
|
+
maxSelectorCacheSize: t2.maxSelectorCacheSize ?? 1e3
|
|
1710
|
+
};
|
|
1711
|
+
}
|
|
1712
|
+
/**
|
|
1713
|
+
* Get cached EID for element
|
|
1714
|
+
*/
|
|
1715
|
+
getEID(t2) {
|
|
1716
|
+
const e2 = this.eidCache.get(t2);
|
|
1717
|
+
if (e2 !== void 0)
|
|
1718
|
+
return this.stats.eidHits++, e2;
|
|
1719
|
+
this.stats.eidMisses++;
|
|
1720
|
+
}
|
|
1721
|
+
/**
|
|
1722
|
+
* Cache EID for element
|
|
1723
|
+
*/
|
|
1724
|
+
setEID(t2, e2) {
|
|
1725
|
+
this.eidCache.set(t2, e2);
|
|
1726
|
+
}
|
|
1727
|
+
/**
|
|
1728
|
+
* Get cached selector results
|
|
1729
|
+
*/
|
|
1730
|
+
getSelectorResults(t2) {
|
|
1731
|
+
const e2 = this.selectorResultCache.get(t2);
|
|
1732
|
+
if (e2 !== void 0)
|
|
1733
|
+
return this.stats.selectorHits++, this.stats.selectorCacheSize = this.selectorResultCache.size, e2;
|
|
1734
|
+
this.stats.selectorMisses++, this.stats.selectorCacheSize = this.selectorResultCache.size;
|
|
1735
|
+
}
|
|
1736
|
+
/**
|
|
1737
|
+
* Cache selector results
|
|
1738
|
+
*/
|
|
1739
|
+
setSelectorResults(t2, e2) {
|
|
1740
|
+
this.selectorResultCache.set(t2, e2), this.stats.selectorCacheSize = this.selectorResultCache.size;
|
|
1741
|
+
}
|
|
1742
|
+
/**
|
|
1743
|
+
* Get cached anchor result
|
|
1744
|
+
*/
|
|
1745
|
+
getAnchor(t2) {
|
|
1746
|
+
if (this.anchorCache.has(t2))
|
|
1747
|
+
return this.stats.anchorHits++, this.anchorCache.get(t2);
|
|
1748
|
+
this.stats.anchorMisses++;
|
|
1749
|
+
}
|
|
1750
|
+
/**
|
|
1751
|
+
* Cache anchor result
|
|
1752
|
+
*/
|
|
1753
|
+
setAnchor(t2, e2) {
|
|
1754
|
+
this.anchorCache.set(t2, e2);
|
|
1755
|
+
}
|
|
1756
|
+
/**
|
|
1757
|
+
* Get cached semantics
|
|
1758
|
+
*/
|
|
1759
|
+
getSemantics(t2) {
|
|
1760
|
+
const e2 = this.semanticsCache.get(t2);
|
|
1761
|
+
if (e2 !== void 0)
|
|
1762
|
+
return this.stats.semanticsHits++, e2;
|
|
1763
|
+
this.stats.semanticsMisses++;
|
|
1764
|
+
}
|
|
1765
|
+
/**
|
|
1766
|
+
* Cache semantics
|
|
1767
|
+
*/
|
|
1768
|
+
setSemantics(t2, e2) {
|
|
1769
|
+
this.semanticsCache.set(t2, e2);
|
|
1770
|
+
}
|
|
1771
|
+
/**
|
|
1772
|
+
* Clear all caches
|
|
1773
|
+
*/
|
|
1774
|
+
clear() {
|
|
1775
|
+
this.selectorResultCache.clear(), this.stats.selectorCacheSize = 0, this.stats = {
|
|
1776
|
+
eidHits: 0,
|
|
1777
|
+
eidMisses: 0,
|
|
1778
|
+
selectorHits: 0,
|
|
1779
|
+
selectorMisses: 0,
|
|
1780
|
+
anchorHits: 0,
|
|
1781
|
+
anchorMisses: 0,
|
|
1782
|
+
semanticsHits: 0,
|
|
1783
|
+
semanticsMisses: 0,
|
|
1784
|
+
selectorCacheSize: 0,
|
|
1785
|
+
maxSelectorCacheSize: this.stats.maxSelectorCacheSize
|
|
1786
|
+
};
|
|
1787
|
+
}
|
|
1788
|
+
/**
|
|
1789
|
+
* Invalidate cache for a specific element
|
|
1790
|
+
* Note: WeakMaps don't support deletion, but we can clear selector cache
|
|
1791
|
+
* if needed. This method is mainly for future extensibility.
|
|
1792
|
+
*/
|
|
1793
|
+
invalidateElement(t2) {
|
|
1794
|
+
}
|
|
1795
|
+
/**
|
|
1796
|
+
* Invalidate a specific selector from cache
|
|
1797
|
+
*/
|
|
1798
|
+
invalidateSelector(t2) {
|
|
1799
|
+
this.selectorResultCache.delete(t2), this.stats.selectorCacheSize = this.selectorResultCache.size;
|
|
1800
|
+
}
|
|
1801
|
+
/**
|
|
1802
|
+
* Get cache statistics
|
|
1803
|
+
*/
|
|
1804
|
+
getStats() {
|
|
1805
|
+
return {
|
|
1806
|
+
...this.stats,
|
|
1807
|
+
selectorCacheSize: this.selectorResultCache.size
|
|
1808
|
+
};
|
|
1809
|
+
}
|
|
1810
|
+
/**
|
|
1811
|
+
* Get cache hit rate for EID cache
|
|
1812
|
+
*/
|
|
1813
|
+
getEIDHitRate() {
|
|
1814
|
+
const t2 = this.stats.eidHits + this.stats.eidMisses;
|
|
1815
|
+
return t2 > 0 ? this.stats.eidHits / t2 : 0;
|
|
1816
|
+
}
|
|
1817
|
+
/**
|
|
1818
|
+
* Get cache hit rate for selector cache
|
|
1819
|
+
*/
|
|
1820
|
+
getSelectorHitRate() {
|
|
1821
|
+
const t2 = this.stats.selectorHits + this.stats.selectorMisses;
|
|
1822
|
+
return t2 > 0 ? this.stats.selectorHits / t2 : 0;
|
|
1823
|
+
}
|
|
1824
|
+
/**
|
|
1825
|
+
* Get cache hit rate for anchor cache
|
|
1826
|
+
*/
|
|
1827
|
+
getAnchorHitRate() {
|
|
1828
|
+
const t2 = this.stats.anchorHits + this.stats.anchorMisses;
|
|
1829
|
+
return t2 > 0 ? this.stats.anchorHits / t2 : 0;
|
|
1830
|
+
}
|
|
1831
|
+
/**
|
|
1832
|
+
* Get cache hit rate for semantics cache
|
|
1833
|
+
*/
|
|
1834
|
+
getSemanticsHitRate() {
|
|
1835
|
+
const t2 = this.stats.semanticsHits + this.stats.semanticsMisses;
|
|
1836
|
+
return t2 > 0 ? this.stats.semanticsHits / t2 : 0;
|
|
1837
|
+
}
|
|
1838
|
+
/**
|
|
1839
|
+
* Get overall cache hit rate
|
|
1840
|
+
*/
|
|
1841
|
+
getOverallHitRate() {
|
|
1842
|
+
const t2 = this.stats.eidHits + this.stats.selectorHits + this.stats.anchorHits + this.stats.semanticsHits, e2 = this.stats.eidMisses + this.stats.selectorMisses + this.stats.anchorMisses + this.stats.semanticsMisses, s2 = t2 + e2;
|
|
1843
|
+
return s2 > 0 ? t2 / s2 : 0;
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
function Ot(n2) {
|
|
1847
|
+
return new Lt(n2);
|
|
1848
|
+
}
|
|
1849
|
+
let O = null;
|
|
1850
|
+
function Z() {
|
|
1851
|
+
return O || (O = Ot()), O;
|
|
1852
|
+
}
|
|
1853
|
+
function Y(n2, t2 = {}) {
|
|
1854
|
+
var _a2;
|
|
1855
|
+
if (!n2 || !n2.ownerDocument || !n2.isConnected)
|
|
1856
|
+
return null;
|
|
1857
|
+
const e2 = { ...ut, ...t2 }, s2 = e2.cache ?? Z(), r2 = s2.getEID(n2);
|
|
1858
|
+
if (r2 !== void 0)
|
|
1859
|
+
return r2;
|
|
1860
|
+
const a2 = new ft(e2, s2), i2 = new xt(e2, s2), o2 = new Pt(e2, s2), l2 = new kt(), u2 = a2.findAnchor(n2);
|
|
1861
|
+
if (!u2 && !e2.fallbackToBody)
|
|
1862
|
+
return null;
|
|
1863
|
+
const d = (u2 == null ? void 0 : u2.element) ?? ((_a2 = n2.ownerDocument) == null ? void 0 : _a2.body) ?? null;
|
|
1864
|
+
if (!d) return null;
|
|
1865
|
+
const c2 = !u2 || u2.tier === "C", h = d.tagName.toLowerCase(), g = d.parentElement;
|
|
1866
|
+
let f2;
|
|
1867
|
+
if (g && h !== "body" && h !== "html") {
|
|
1868
|
+
const T = Array.from(g.children).indexOf(d);
|
|
1869
|
+
T !== -1 && (f2 = T + 1);
|
|
1870
|
+
}
|
|
1871
|
+
const p = o2.extract(d), m = {
|
|
1872
|
+
tag: d.tagName.toLowerCase(),
|
|
1873
|
+
semantics: p,
|
|
1874
|
+
score: (u2 == null ? void 0 : u2.score) ?? I.DEGRADED_SCORE,
|
|
1875
|
+
degraded: c2,
|
|
1876
|
+
nthChild: f2
|
|
1877
|
+
}, b = i2.buildPath(d, n2, o2), y = o2.extract(n2);
|
|
1878
|
+
e2.enableSvgFingerprint && zt(n2) && (y.svg = l2.fingerprint(n2));
|
|
1879
|
+
const v2 = n2.parentElement;
|
|
1880
|
+
let A;
|
|
1881
|
+
if (v2) {
|
|
1882
|
+
const T = Array.from(v2.children).indexOf(n2);
|
|
1883
|
+
T !== -1 && (A = T + 1);
|
|
1884
|
+
}
|
|
1885
|
+
const S = {
|
|
1886
|
+
tag: n2.tagName.toLowerCase(),
|
|
1887
|
+
semantics: y,
|
|
1888
|
+
score: o2.scoreElement(n2),
|
|
1889
|
+
nthChild: A
|
|
1890
|
+
}, $ = [], M = {
|
|
1891
|
+
onMultiple: "best-score",
|
|
1892
|
+
onMissing: "anchor-only",
|
|
1893
|
+
maxDepth: 3
|
|
1894
|
+
}, H = m.degraded || b.degraded, E = Ut(m.degraded, b), x2 = {
|
|
1895
|
+
version: "1.0",
|
|
1896
|
+
anchor: m,
|
|
1897
|
+
path: b.path,
|
|
1898
|
+
target: S,
|
|
1899
|
+
constraints: $,
|
|
1900
|
+
fallback: M,
|
|
1901
|
+
meta: {
|
|
1902
|
+
confidence: 0,
|
|
1903
|
+
// Calculated below
|
|
1904
|
+
generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1905
|
+
generator: "dom-eid@1.0",
|
|
1906
|
+
source: e2.source,
|
|
1907
|
+
degraded: H,
|
|
1908
|
+
degradationReason: E
|
|
1909
|
+
}
|
|
1910
|
+
};
|
|
1911
|
+
return x2.meta.confidence = _t(x2), x2.meta.confidence < e2.confidenceThreshold ? null : (s2.setEID(n2, x2), x2);
|
|
1912
|
+
}
|
|
1913
|
+
function zt(n2) {
|
|
1914
|
+
return n2.namespaceURI === "http://www.w3.org/2000/svg" || n2.tagName.toLowerCase() === "svg" || n2 instanceof SVGElement;
|
|
1915
|
+
}
|
|
1916
|
+
function Ut(n2, t2) {
|
|
1917
|
+
if (n2 && t2.degraded)
|
|
1918
|
+
return "anchor-and-path-degraded";
|
|
1919
|
+
if (n2)
|
|
1920
|
+
return "no-semantic-anchor";
|
|
1921
|
+
if (t2.degraded)
|
|
1922
|
+
return t2.degradationReason;
|
|
1923
|
+
}
|
|
1924
|
+
const rt = {
|
|
1925
|
+
maxClasses: 2,
|
|
1926
|
+
maxAttributes: 5,
|
|
1927
|
+
includeText: true,
|
|
1928
|
+
maxTextLength: 50,
|
|
1929
|
+
simplifyTarget: true,
|
|
1930
|
+
includeConstraints: true
|
|
1931
|
+
};
|
|
1932
|
+
function et(n2) {
|
|
1933
|
+
return n2 === "id" ? 101 : w[n2] !== void 0 ? w[n2] : n2.startsWith("data-") ? w["data-*"] : n2.startsWith("aria-") ? w["aria-*"] : 0;
|
|
1934
|
+
}
|
|
1935
|
+
function Vt(n2) {
|
|
1936
|
+
return ["id", "data-testid", "data-qa", "data-cy", "href", "text", "role"].includes(n2);
|
|
1937
|
+
}
|
|
1938
|
+
function Qt(n2) {
|
|
1939
|
+
return !!(/@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/.test(n2) || /(\+?\d{1,3}[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}/.test(n2) || /\d{4}[-\s]?\d{4}[-\s]?\d{4}[-\s]?\d{4}/.test(n2));
|
|
1940
|
+
}
|
|
1941
|
+
function Zt(n2, t2) {
|
|
1942
|
+
const e2 = { ...rt, ...t2 }, s2 = `v${n2.version}`, r2 = U(n2.anchor, false, e2), a2 = n2.path.length > 0 ? n2.path.map((l2) => U(l2, false, e2)).join(" > ") + " > " : "", i2 = U(n2.target, true, e2), o2 = e2.includeConstraints ? Xt(n2) : "";
|
|
1943
|
+
return `${s2}: ${r2} :: ${a2}${i2}${o2}`;
|
|
1944
|
+
}
|
|
1945
|
+
function U(n2, t2 = false, e2 = rt) {
|
|
1946
|
+
const { tag: s2, semantics: r2 } = n2;
|
|
1947
|
+
let a2 = s2;
|
|
1948
|
+
const i2 = [], o2 = { ...r2.attributes };
|
|
1949
|
+
r2.id && (o2.id = r2.id), r2.role && !o2.role && (o2.role = r2.role);
|
|
1950
|
+
const l2 = Object.entries(o2).map(([c2, h]) => {
|
|
1951
|
+
const g = et(c2), f2 = c2 === "href" || c2 === "src" ? k(c2, h) : h;
|
|
1952
|
+
return { name: c2, value: f2, priority: g };
|
|
1953
|
+
}).filter((c2) => c2.name !== "id" && c2.name !== "class" && B.has(c2.name) || G.has(c2.name) && V(c2.value) ? false : c2.priority > 0 || c2.name === "role" || c2.name === "id");
|
|
1954
|
+
l2.sort((c2, h) => h.priority - c2.priority);
|
|
1955
|
+
const u2 = l2.slice(0, e2.maxAttributes);
|
|
1956
|
+
u2.sort((c2, h) => c2.name.localeCompare(h.name));
|
|
1957
|
+
for (const { name: c2, value: h } of u2)
|
|
1958
|
+
i2.push(`${c2}="${j(h)}"`);
|
|
1959
|
+
if (e2.includeText && r2.text && !Qt(r2.text.normalized)) {
|
|
1960
|
+
const c2 = r2.text.normalized;
|
|
1961
|
+
c2.length > 0 && c2.length <= e2.maxTextLength && i2.push(`text="${j(c2)}"`);
|
|
1962
|
+
}
|
|
1963
|
+
let d = i2;
|
|
1964
|
+
if (i2.length > 0 && (t2 && e2.simplifyTarget && r2.id && (d = i2.filter((c2) => {
|
|
1965
|
+
const h = c2.split("=")[0];
|
|
1966
|
+
return et(h) >= 60 || h === "text" || h === "id" || h === "role";
|
|
1967
|
+
})), d.length > 0 && d.sort((c2, h) => c2.localeCompare(h))), r2.classes && r2.classes.length > 0) {
|
|
1968
|
+
const c2 = N(r2.classes), h = !!r2.id || i2.some(
|
|
1969
|
+
(f2) => f2.startsWith("href=") || f2.startsWith("data-testid=") || f2.startsWith("text=") || f2.startsWith("role=")
|
|
1970
|
+
);
|
|
1971
|
+
if (!(t2 && e2.simplifyTarget && h) && c2.length > 0) {
|
|
1972
|
+
const f2 = c2.sort().slice(0, e2.maxClasses);
|
|
1973
|
+
a2 += f2.map((p) => `.${p}`).join("");
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
if (d.length > 0 && (a2 += `[${d.join(",")}]`), "nthChild" in n2 && n2.nthChild) {
|
|
1977
|
+
const c2 = !!r2.id || r2.attributes && Object.keys(r2.attributes).some(Vt);
|
|
1978
|
+
t2 && e2.simplifyTarget && c2 || (a2 += `#${n2.nthChild}`);
|
|
1979
|
+
}
|
|
1980
|
+
return a2;
|
|
1981
|
+
}
|
|
1982
|
+
function Xt(n2) {
|
|
1983
|
+
if (!n2.constraints || n2.constraints.length === 0)
|
|
1984
|
+
return "";
|
|
1985
|
+
const t2 = [];
|
|
1986
|
+
for (const e2 of n2.constraints)
|
|
1987
|
+
switch (e2.type) {
|
|
1988
|
+
case "uniqueness":
|
|
1989
|
+
t2.push("unique=true");
|
|
1990
|
+
break;
|
|
1991
|
+
case "position":
|
|
1992
|
+
e2.params && e2.params.strategy && t2.push(`pos=${e2.params.strategy}`);
|
|
1993
|
+
break;
|
|
1994
|
+
case "text-proximity":
|
|
1995
|
+
if (e2.params && e2.params.reference) {
|
|
1996
|
+
const s2 = j(String(e2.params.reference));
|
|
1997
|
+
t2.push(`text="${s2}"`);
|
|
1998
|
+
}
|
|
1999
|
+
break;
|
|
2000
|
+
}
|
|
2001
|
+
return t2.length === 0 ? "" : ` {${t2.join(",")}}`;
|
|
2002
|
+
}
|
|
2003
|
+
function j(n2) {
|
|
2004
|
+
return n2.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/>/g, "\\>").replace(/:/g, "\\:");
|
|
2005
|
+
}
|
|
2006
|
+
function le(n2, t2, e2) {
|
|
2007
|
+
const s2 = Y(n2, t2);
|
|
2008
|
+
return s2 ? Zt(s2, e2) : null;
|
|
2009
|
+
}
|
|
831
2010
|
let _id = 1;
|
|
832
2011
|
const tagNameRegex = new RegExp("[^a-z0-9-_:]");
|
|
833
2012
|
const IGNORED_NODE = -2;
|
|
@@ -949,6 +2128,7 @@ function ignoreAttribute(tagName, name, _value) {
|
|
|
949
2128
|
return (tagName === "video" || tagName === "audio") && name === "autoplay";
|
|
950
2129
|
}
|
|
951
2130
|
function isExcludeAttribute(name, exclude) {
|
|
2131
|
+
if (!exclude) return false;
|
|
952
2132
|
return typeof exclude === "string" ? name.includes(exclude) : exclude.test(name);
|
|
953
2133
|
}
|
|
954
2134
|
function _isBlockedElement(element, blockClass, blockSelector) {
|
|
@@ -1445,7 +2625,8 @@ function serializeNodeWithId(n2, options) {
|
|
|
1445
2625
|
stylesheetLoadTimeout = 5e3,
|
|
1446
2626
|
keepIframeSrcFn = () => false,
|
|
1447
2627
|
newlyAddedElement = false,
|
|
1448
|
-
cssCaptured = false
|
|
2628
|
+
cssCaptured = false,
|
|
2629
|
+
selectorOptions
|
|
1449
2630
|
} = options;
|
|
1450
2631
|
let { needsMask } = options;
|
|
1451
2632
|
let { preserveWhiteSpace = true } = options;
|
|
@@ -1490,11 +2671,20 @@ function serializeNodeWithId(n2, options) {
|
|
|
1490
2671
|
}
|
|
1491
2672
|
const serializedNode = Object.assign(_serializedNode, { id });
|
|
1492
2673
|
if (isElement(n2) || n2.nodeType === Node.TEXT_NODE) {
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
2674
|
+
if (isElement(n2) && selectorOptions !== null && selectorOptions !== void 0) {
|
|
2675
|
+
try {
|
|
2676
|
+
const seqlGeneratorOptions = {
|
|
2677
|
+
maxPathDepth: selectorOptions.maxPathDepth,
|
|
2678
|
+
enableSvgFingerprint: selectorOptions.enableSvgFingerprint,
|
|
2679
|
+
confidenceThreshold: selectorOptions.confidenceThreshold,
|
|
2680
|
+
fallbackToBody: selectorOptions.fallbackToBody
|
|
2681
|
+
};
|
|
2682
|
+
const selector = le(n2, seqlGeneratorOptions);
|
|
2683
|
+
if (selector) {
|
|
2684
|
+
serializedNode.selector = selector;
|
|
2685
|
+
}
|
|
2686
|
+
} catch (error) {
|
|
2687
|
+
console.warn("Failed to generate SEQL selector:", error);
|
|
1498
2688
|
}
|
|
1499
2689
|
}
|
|
1500
2690
|
if (n2.nodeType === Node.TEXT_NODE) {
|
|
@@ -1549,7 +2739,8 @@ function serializeNodeWithId(n2, options) {
|
|
|
1549
2739
|
onStylesheetLoad,
|
|
1550
2740
|
stylesheetLoadTimeout,
|
|
1551
2741
|
keepIframeSrcFn,
|
|
1552
|
-
cssCaptured: false
|
|
2742
|
+
cssCaptured: false,
|
|
2743
|
+
selectorOptions
|
|
1553
2744
|
};
|
|
1554
2745
|
if (serializedNode.type === NodeType$3.Element && serializedNode.tagName === "textarea" && serializedNode.attributes.value !== void 0) ;
|
|
1555
2746
|
else {
|
|
@@ -1608,7 +2799,8 @@ function serializeNodeWithId(n2, options) {
|
|
|
1608
2799
|
iframeLoadTimeout,
|
|
1609
2800
|
onStylesheetLoad,
|
|
1610
2801
|
stylesheetLoadTimeout,
|
|
1611
|
-
keepIframeSrcFn
|
|
2802
|
+
keepIframeSrcFn,
|
|
2803
|
+
selectorOptions
|
|
1612
2804
|
});
|
|
1613
2805
|
if (serializedIframeNode) {
|
|
1614
2806
|
onIframeLoad(
|
|
@@ -1650,7 +2842,8 @@ function serializeNodeWithId(n2, options) {
|
|
|
1650
2842
|
iframeLoadTimeout,
|
|
1651
2843
|
onStylesheetLoad,
|
|
1652
2844
|
stylesheetLoadTimeout,
|
|
1653
|
-
keepIframeSrcFn
|
|
2845
|
+
keepIframeSrcFn,
|
|
2846
|
+
selectorOptions
|
|
1654
2847
|
});
|
|
1655
2848
|
if (serializedLinkNode) {
|
|
1656
2849
|
onStylesheetLoad(
|
|
@@ -1687,7 +2880,8 @@ function snapshot(n2, options) {
|
|
|
1687
2880
|
iframeLoadTimeout,
|
|
1688
2881
|
onStylesheetLoad,
|
|
1689
2882
|
stylesheetLoadTimeout,
|
|
1690
|
-
keepIframeSrcFn = () => false
|
|
2883
|
+
keepIframeSrcFn = () => false,
|
|
2884
|
+
selector
|
|
1691
2885
|
} = options || {};
|
|
1692
2886
|
const maskInputOptions = maskAllInputs === true ? {
|
|
1693
2887
|
color: true,
|
|
@@ -1725,6 +2919,22 @@ function snapshot(n2, options) {
|
|
|
1725
2919
|
headMetaVerification: true
|
|
1726
2920
|
}
|
|
1727
2921
|
) : slimDOM === false ? {} : slimDOM;
|
|
2922
|
+
const selectorOptions = selector === false ? null : selector === true ? {
|
|
2923
|
+
maxPathDepth: 10,
|
|
2924
|
+
enableSvgFingerprint: true,
|
|
2925
|
+
confidenceThreshold: 0.3,
|
|
2926
|
+
fallbackToBody: true
|
|
2927
|
+
} : selector === void 0 ? {
|
|
2928
|
+
maxPathDepth: 10,
|
|
2929
|
+
enableSvgFingerprint: true,
|
|
2930
|
+
confidenceThreshold: 0.3,
|
|
2931
|
+
fallbackToBody: true
|
|
2932
|
+
} : {
|
|
2933
|
+
maxPathDepth: selector.maxPathDepth ?? 10,
|
|
2934
|
+
enableSvgFingerprint: selector.enableSvgFingerprint ?? true,
|
|
2935
|
+
confidenceThreshold: selector.confidenceThreshold ?? 0.3,
|
|
2936
|
+
fallbackToBody: selector.fallbackToBody ?? true
|
|
2937
|
+
};
|
|
1728
2938
|
return serializeNodeWithId(n2, {
|
|
1729
2939
|
doc: n2,
|
|
1730
2940
|
mirror: mirror2,
|
|
@@ -1749,7 +2959,8 @@ function snapshot(n2, options) {
|
|
|
1749
2959
|
onStylesheetLoad,
|
|
1750
2960
|
stylesheetLoadTimeout,
|
|
1751
2961
|
keepIframeSrcFn,
|
|
1752
|
-
newlyAddedElement: false
|
|
2962
|
+
newlyAddedElement: false,
|
|
2963
|
+
selectorOptions
|
|
1753
2964
|
});
|
|
1754
2965
|
}
|
|
1755
2966
|
const MEDIA_SELECTOR = /(max|min)-device-(width|height)/;
|
|
@@ -1786,6 +2997,33 @@ const pseudoClassPlugin = {
|
|
|
1786
2997
|
};
|
|
1787
2998
|
}
|
|
1788
2999
|
};
|
|
3000
|
+
const animationFillModePlugin = {
|
|
3001
|
+
postcssPlugin: "postcss-animation-fill-mode",
|
|
3002
|
+
prepare: function() {
|
|
3003
|
+
return {
|
|
3004
|
+
Rule: function(rule2) {
|
|
3005
|
+
let hasAnimation = false;
|
|
3006
|
+
let hasAnimationFillMode = false;
|
|
3007
|
+
let animationDeclaration = null;
|
|
3008
|
+
rule2.walkDecls((decl) => {
|
|
3009
|
+
if (decl.prop === "animation") {
|
|
3010
|
+
hasAnimation = true;
|
|
3011
|
+
animationDeclaration = decl;
|
|
3012
|
+
}
|
|
3013
|
+
if (decl.prop === "animation-fill-mode") {
|
|
3014
|
+
hasAnimationFillMode = true;
|
|
3015
|
+
}
|
|
3016
|
+
});
|
|
3017
|
+
if (hasAnimation && !hasAnimationFillMode && animationDeclaration) {
|
|
3018
|
+
rule2.insertAfter(animationDeclaration, {
|
|
3019
|
+
prop: "animation-fill-mode",
|
|
3020
|
+
value: "forwards"
|
|
3021
|
+
});
|
|
3022
|
+
}
|
|
3023
|
+
}
|
|
3024
|
+
};
|
|
3025
|
+
}
|
|
3026
|
+
};
|
|
1789
3027
|
function getDefaultExportFromCjs$1(x2) {
|
|
1790
3028
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
1791
3029
|
}
|
|
@@ -1802,12 +3040,12 @@ function getAugmentedNamespace$1(n2) {
|
|
|
1802
3040
|
a2.prototype = f2.prototype;
|
|
1803
3041
|
} else a2 = {};
|
|
1804
3042
|
Object.defineProperty(a2, "__esModule", { value: true });
|
|
1805
|
-
Object.keys(n2).forEach(function(
|
|
1806
|
-
var d = Object.getOwnPropertyDescriptor(n2,
|
|
1807
|
-
Object.defineProperty(a2,
|
|
3043
|
+
Object.keys(n2).forEach(function(k2) {
|
|
3044
|
+
var d = Object.getOwnPropertyDescriptor(n2, k2);
|
|
3045
|
+
Object.defineProperty(a2, k2, d.get ? d : {
|
|
1808
3046
|
enumerable: true,
|
|
1809
3047
|
get: function() {
|
|
1810
|
-
return n2[
|
|
3048
|
+
return n2[k2];
|
|
1811
3049
|
}
|
|
1812
3050
|
});
|
|
1813
3051
|
});
|
|
@@ -2231,7 +3469,7 @@ function cloneNode$1(obj, parent) {
|
|
|
2231
3469
|
} else if (i2 === "source") {
|
|
2232
3470
|
cloned[i2] = value;
|
|
2233
3471
|
} else if (Array.isArray(value)) {
|
|
2234
|
-
cloned[i2] = value.map((
|
|
3472
|
+
cloned[i2] = value.map((j2) => cloneNode$1(j2, cloned));
|
|
2235
3473
|
} else {
|
|
2236
3474
|
if (type === "object" && value !== null) value = cloneNode$1(value);
|
|
2237
3475
|
cloned[i2] = value;
|
|
@@ -2466,7 +3704,7 @@ let Node$5$1 = class Node2 {
|
|
|
2466
3704
|
}
|
|
2467
3705
|
return result2;
|
|
2468
3706
|
}
|
|
2469
|
-
toJSON(
|
|
3707
|
+
toJSON(_2, inputs) {
|
|
2470
3708
|
let fixed = {};
|
|
2471
3709
|
let emitInputs = inputs == null;
|
|
2472
3710
|
inputs = inputs || /* @__PURE__ */ new Map();
|
|
@@ -4111,8 +5349,8 @@ let Parser$1$1 = class Parser {
|
|
|
4111
5349
|
if (colon === false) return;
|
|
4112
5350
|
let founded = 0;
|
|
4113
5351
|
let token;
|
|
4114
|
-
for (let
|
|
4115
|
-
token = tokens[
|
|
5352
|
+
for (let j2 = colon - 1; j2 >= 0; j2--) {
|
|
5353
|
+
token = tokens[j2];
|
|
4116
5354
|
if (token[0] !== "space") {
|
|
4117
5355
|
founded += 1;
|
|
4118
5356
|
if (founded === 2) break;
|
|
@@ -4230,8 +5468,8 @@ let Parser$1$1 = class Parser {
|
|
|
4230
5468
|
} else if (token[1].toLowerCase() === "important") {
|
|
4231
5469
|
let cache = tokens.slice(0);
|
|
4232
5470
|
let str = "";
|
|
4233
|
-
for (let
|
|
4234
|
-
let type = cache[
|
|
5471
|
+
for (let j2 = i2; j2 > 0; j2--) {
|
|
5472
|
+
let type = cache[j2][0];
|
|
4235
5473
|
if (str.trim().indexOf("!") === 0 && type !== "space") {
|
|
4236
5474
|
break;
|
|
4237
5475
|
}
|
|
@@ -5389,7 +6627,8 @@ function adaptCssForReplay(cssText, cache) {
|
|
|
5389
6627
|
try {
|
|
5390
6628
|
const ast = postcss$1$1([
|
|
5391
6629
|
mediaSelectorPlugin,
|
|
5392
|
-
pseudoClassPlugin
|
|
6630
|
+
pseudoClassPlugin,
|
|
6631
|
+
animationFillModePlugin
|
|
5393
6632
|
]).process(cssText);
|
|
5394
6633
|
result2 = ast.css;
|
|
5395
6634
|
} catch (error) {
|
|
@@ -5914,12 +7153,12 @@ function getAugmentedNamespace(n2) {
|
|
|
5914
7153
|
a2.prototype = f2.prototype;
|
|
5915
7154
|
} else a2 = {};
|
|
5916
7155
|
Object.defineProperty(a2, "__esModule", { value: true });
|
|
5917
|
-
Object.keys(n2).forEach(function(
|
|
5918
|
-
var d = Object.getOwnPropertyDescriptor(n2,
|
|
5919
|
-
Object.defineProperty(a2,
|
|
7156
|
+
Object.keys(n2).forEach(function(k2) {
|
|
7157
|
+
var d = Object.getOwnPropertyDescriptor(n2, k2);
|
|
7158
|
+
Object.defineProperty(a2, k2, d.get ? d : {
|
|
5920
7159
|
enumerable: true,
|
|
5921
7160
|
get: function() {
|
|
5922
|
-
return n2[
|
|
7161
|
+
return n2[k2];
|
|
5923
7162
|
}
|
|
5924
7163
|
});
|
|
5925
7164
|
});
|
|
@@ -6343,7 +7582,7 @@ function cloneNode(obj, parent) {
|
|
|
6343
7582
|
} else if (i2 === "source") {
|
|
6344
7583
|
cloned[i2] = value;
|
|
6345
7584
|
} else if (Array.isArray(value)) {
|
|
6346
|
-
cloned[i2] = value.map((
|
|
7585
|
+
cloned[i2] = value.map((j2) => cloneNode(j2, cloned));
|
|
6347
7586
|
} else {
|
|
6348
7587
|
if (type === "object" && value !== null) value = cloneNode(value);
|
|
6349
7588
|
cloned[i2] = value;
|
|
@@ -6578,7 +7817,7 @@ let Node$5 = class Node22 {
|
|
|
6578
7817
|
}
|
|
6579
7818
|
return result2;
|
|
6580
7819
|
}
|
|
6581
|
-
toJSON(
|
|
7820
|
+
toJSON(_2, inputs) {
|
|
6582
7821
|
let fixed = {};
|
|
6583
7822
|
let emitInputs = inputs == null;
|
|
6584
7823
|
inputs = inputs || /* @__PURE__ */ new Map();
|
|
@@ -8223,8 +9462,8 @@ let Parser$1 = class Parser2 {
|
|
|
8223
9462
|
if (colon === false) return;
|
|
8224
9463
|
let founded = 0;
|
|
8225
9464
|
let token;
|
|
8226
|
-
for (let
|
|
8227
|
-
token = tokens[
|
|
9465
|
+
for (let j2 = colon - 1; j2 >= 0; j2--) {
|
|
9466
|
+
token = tokens[j2];
|
|
8228
9467
|
if (token[0] !== "space") {
|
|
8229
9468
|
founded += 1;
|
|
8230
9469
|
if (founded === 2) break;
|
|
@@ -8342,8 +9581,8 @@ let Parser$1 = class Parser2 {
|
|
|
8342
9581
|
} else if (token[1].toLowerCase() === "important") {
|
|
8343
9582
|
let cache = tokens.slice(0);
|
|
8344
9583
|
let str = "";
|
|
8345
|
-
for (let
|
|
8346
|
-
let type = cache[
|
|
9584
|
+
for (let j2 = i2; j2 > 0; j2--) {
|
|
9585
|
+
let type = cache[j2][0];
|
|
8347
9586
|
if (str.trim().indexOf("!") === 0 && type !== "space") {
|
|
8348
9587
|
break;
|
|
8349
9588
|
}
|
|
@@ -9483,7 +10722,7 @@ const camelizeRE = /-([a-z])/g;
|
|
|
9483
10722
|
const CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9-]+$/;
|
|
9484
10723
|
const camelize = (str) => {
|
|
9485
10724
|
if (CUSTOM_PROPERTY_REGEX.test(str)) return str;
|
|
9486
|
-
return str.replace(camelizeRE, (
|
|
10725
|
+
return str.replace(camelizeRE, (_2, c2) => c2 ? c2.toUpperCase() : "");
|
|
9487
10726
|
};
|
|
9488
10727
|
const hyphenateRE = /\B([A-Z])/g;
|
|
9489
10728
|
const hyphenate = (str) => {
|
|
@@ -14516,7 +15755,7 @@ class VisibilityManager {
|
|
|
14516
15755
|
}
|
|
14517
15756
|
}
|
|
14518
15757
|
}
|
|
14519
|
-
const version$1 = "
|
|
15758
|
+
const version$1 = "3.1.1-alpha.1";
|
|
14520
15759
|
let wrappedEmit;
|
|
14521
15760
|
let takeFullSnapshot$1;
|
|
14522
15761
|
let canvasManager;
|
|
@@ -14678,13 +15917,27 @@ function record(options = {}) {
|
|
|
14678
15917
|
}
|
|
14679
15918
|
return e2;
|
|
14680
15919
|
};
|
|
15920
|
+
let lastMetaHref = null;
|
|
15921
|
+
let navSnapshotInProgress = false;
|
|
14681
15922
|
wrappedEmit = (r2, isCheckout) => {
|
|
14682
|
-
var _a2;
|
|
15923
|
+
var _a2, _b2;
|
|
14683
15924
|
const e2 = r2;
|
|
14684
15925
|
e2.timestamp = nowTimestamp();
|
|
15926
|
+
let navTriggeredFS = false;
|
|
14685
15927
|
if (((_a2 = mutationBuffers[0]) == null ? void 0 : _a2.isFrozen()) && e2.type !== EventType.FullSnapshot && !(e2.type === EventType.IncrementalSnapshot && e2.data.source === IncrementalSource.Mutation)) {
|
|
14686
15928
|
mutationBuffers.forEach((buf) => buf.unfreeze());
|
|
14687
15929
|
}
|
|
15930
|
+
if (!navSnapshotInProgress && e2.type !== EventType.Meta && e2.type !== EventType.FullSnapshot && lastMetaHref && window.location.href !== lastMetaHref) {
|
|
15931
|
+
navSnapshotInProgress = true;
|
|
15932
|
+
try {
|
|
15933
|
+
recentVisibilityChanges = 0;
|
|
15934
|
+
incrementalSnapshotCount = 0;
|
|
15935
|
+
navTriggeredFS = true;
|
|
15936
|
+
takeFullSnapshot$1(true);
|
|
15937
|
+
} finally {
|
|
15938
|
+
navSnapshotInProgress = false;
|
|
15939
|
+
}
|
|
15940
|
+
}
|
|
14688
15941
|
if (inEmittingFrame) {
|
|
14689
15942
|
emit == null ? void 0 : emit(eventProcessor(e2), isCheckout);
|
|
14690
15943
|
} else if (passEmitsToParent) {
|
|
@@ -14696,6 +15949,9 @@ function record(options = {}) {
|
|
|
14696
15949
|
};
|
|
14697
15950
|
window.parent.postMessage(message, "*");
|
|
14698
15951
|
}
|
|
15952
|
+
if (e2.type === EventType.Meta) {
|
|
15953
|
+
lastMetaHref = ((_b2 = e2.data) == null ? void 0 : _b2.href) || window.location.href;
|
|
15954
|
+
}
|
|
14699
15955
|
if (e2.type === EventType.FullSnapshot) {
|
|
14700
15956
|
lastFullSnapshotEvent = e2;
|
|
14701
15957
|
incrementalSnapshotCount = 0;
|
|
@@ -14704,14 +15960,16 @@ function record(options = {}) {
|
|
|
14704
15960
|
return;
|
|
14705
15961
|
}
|
|
14706
15962
|
incrementalSnapshotCount++;
|
|
14707
|
-
|
|
14708
|
-
|
|
14709
|
-
|
|
14710
|
-
|
|
14711
|
-
if (exceedVisibility) {
|
|
14712
|
-
|
|
15963
|
+
if (!navTriggeredFS) {
|
|
15964
|
+
const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;
|
|
15965
|
+
const exceedTime = checkoutEveryNms && e2.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;
|
|
15966
|
+
const exceedVisibility = checkoutEveryNvm && recentVisibilityChanges >= checkoutEveryNvm;
|
|
15967
|
+
if (exceedCount || exceedTime || exceedVisibility) {
|
|
15968
|
+
if (exceedVisibility) {
|
|
15969
|
+
recentVisibilityChanges = 0;
|
|
15970
|
+
}
|
|
15971
|
+
takeFullSnapshot$1(true);
|
|
14713
15972
|
}
|
|
14714
|
-
takeFullSnapshot$1(true);
|
|
14715
15973
|
}
|
|
14716
15974
|
}
|
|
14717
15975
|
};
|
|
@@ -15150,30 +16408,30 @@ const mittProxy = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
|
|
|
15150
16408
|
__proto__: null,
|
|
15151
16409
|
default: mitt$1
|
|
15152
16410
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
15153
|
-
function polyfill(
|
|
15154
|
-
if ("scrollBehavior" in d.documentElement.style &&
|
|
16411
|
+
function polyfill(w2 = window, d = document) {
|
|
16412
|
+
if ("scrollBehavior" in d.documentElement.style && w2.__forceSmoothScrollPolyfill__ !== true) {
|
|
15155
16413
|
return;
|
|
15156
16414
|
}
|
|
15157
|
-
const Element2 =
|
|
16415
|
+
const Element2 = w2.HTMLElement || w2.Element;
|
|
15158
16416
|
const SCROLL_TIME = 468;
|
|
15159
16417
|
const original = {
|
|
15160
|
-
scroll:
|
|
15161
|
-
scrollBy:
|
|
16418
|
+
scroll: w2.scroll || w2.scrollTo,
|
|
16419
|
+
scrollBy: w2.scrollBy,
|
|
15162
16420
|
elementScroll: Element2.prototype.scroll || scrollElement,
|
|
15163
16421
|
scrollIntoView: Element2.prototype.scrollIntoView
|
|
15164
16422
|
};
|
|
15165
|
-
const now =
|
|
16423
|
+
const now = w2.performance && w2.performance.now ? w2.performance.now.bind(w2.performance) : Date.now;
|
|
15166
16424
|
function isMicrosoftBrowser(userAgent) {
|
|
15167
16425
|
const userAgentPatterns = ["MSIE ", "Trident/", "Edge/"];
|
|
15168
16426
|
return new RegExp(userAgentPatterns.join("|")).test(userAgent);
|
|
15169
16427
|
}
|
|
15170
|
-
const ROUNDING_TOLERANCE = isMicrosoftBrowser(
|
|
16428
|
+
const ROUNDING_TOLERANCE = isMicrosoftBrowser(w2.navigator.userAgent) ? 1 : 0;
|
|
15171
16429
|
function scrollElement(x2, y) {
|
|
15172
16430
|
this.scrollLeft = x2;
|
|
15173
16431
|
this.scrollTop = y;
|
|
15174
16432
|
}
|
|
15175
|
-
function ease(
|
|
15176
|
-
return 0.5 * (1 - Math.cos(Math.PI *
|
|
16433
|
+
function ease(k2) {
|
|
16434
|
+
return 0.5 * (1 - Math.cos(Math.PI * k2));
|
|
15177
16435
|
}
|
|
15178
16436
|
function shouldBailOut(firstArg) {
|
|
15179
16437
|
if (firstArg === null || typeof firstArg !== "object" || firstArg.behavior === void 0 || firstArg.behavior === "auto" || firstArg.behavior === "instant") {
|
|
@@ -15195,7 +16453,7 @@ function polyfill(w = window, d = document) {
|
|
|
15195
16453
|
}
|
|
15196
16454
|
}
|
|
15197
16455
|
function canOverflow(el, axis) {
|
|
15198
|
-
const overflowValue =
|
|
16456
|
+
const overflowValue = w2.getComputedStyle(el, null)["overflow" + axis];
|
|
15199
16457
|
return overflowValue === "auto" || overflowValue === "scroll";
|
|
15200
16458
|
}
|
|
15201
16459
|
function isScrollable(el) {
|
|
@@ -15221,7 +16479,7 @@ function polyfill(w = window, d = document) {
|
|
|
15221
16479
|
currentY = context.startY + (context.y - context.startY) * value;
|
|
15222
16480
|
context.method.call(context.scrollable, currentX, currentY);
|
|
15223
16481
|
if (currentX !== context.x || currentY !== context.y) {
|
|
15224
|
-
|
|
16482
|
+
w2.requestAnimationFrame(step.bind(w2, context));
|
|
15225
16483
|
}
|
|
15226
16484
|
}
|
|
15227
16485
|
function smoothScroll(el, x2, y) {
|
|
@@ -15231,9 +16489,9 @@ function polyfill(w = window, d = document) {
|
|
|
15231
16489
|
let method;
|
|
15232
16490
|
const startTime = now();
|
|
15233
16491
|
if (el === d.body) {
|
|
15234
|
-
scrollable =
|
|
15235
|
-
startX =
|
|
15236
|
-
startY =
|
|
16492
|
+
scrollable = w2;
|
|
16493
|
+
startX = w2.scrollX || w2.pageXOffset;
|
|
16494
|
+
startY = w2.scrollY || w2.pageYOffset;
|
|
15237
16495
|
method = original.scroll;
|
|
15238
16496
|
} else {
|
|
15239
16497
|
scrollable = el;
|
|
@@ -15251,43 +16509,43 @@ function polyfill(w = window, d = document) {
|
|
|
15251
16509
|
y
|
|
15252
16510
|
});
|
|
15253
16511
|
}
|
|
15254
|
-
|
|
16512
|
+
w2.scroll = w2.scrollTo = function() {
|
|
15255
16513
|
if (arguments[0] === void 0) {
|
|
15256
16514
|
return;
|
|
15257
16515
|
}
|
|
15258
16516
|
if (shouldBailOut(arguments[0]) === true) {
|
|
15259
16517
|
original.scroll.call(
|
|
15260
|
-
|
|
15261
|
-
arguments[0].left !== void 0 ? arguments[0].left : typeof arguments[0] !== "object" ? arguments[0] :
|
|
16518
|
+
w2,
|
|
16519
|
+
arguments[0].left !== void 0 ? arguments[0].left : typeof arguments[0] !== "object" ? arguments[0] : w2.scrollX || w2.pageXOffset,
|
|
15262
16520
|
// use top prop, second argument if present or fallback to scrollY
|
|
15263
|
-
arguments[0].top !== void 0 ? arguments[0].top : arguments[1] !== void 0 ? arguments[1] :
|
|
16521
|
+
arguments[0].top !== void 0 ? arguments[0].top : arguments[1] !== void 0 ? arguments[1] : w2.scrollY || w2.pageYOffset
|
|
15264
16522
|
);
|
|
15265
16523
|
return;
|
|
15266
16524
|
}
|
|
15267
16525
|
smoothScroll.call(
|
|
15268
|
-
|
|
16526
|
+
w2,
|
|
15269
16527
|
d.body,
|
|
15270
|
-
arguments[0].left !== void 0 ? ~~arguments[0].left :
|
|
15271
|
-
arguments[0].top !== void 0 ? ~~arguments[0].top :
|
|
16528
|
+
arguments[0].left !== void 0 ? ~~arguments[0].left : w2.scrollX || w2.pageXOffset,
|
|
16529
|
+
arguments[0].top !== void 0 ? ~~arguments[0].top : w2.scrollY || w2.pageYOffset
|
|
15272
16530
|
);
|
|
15273
16531
|
};
|
|
15274
|
-
|
|
16532
|
+
w2.scrollBy = function() {
|
|
15275
16533
|
if (arguments[0] === void 0) {
|
|
15276
16534
|
return;
|
|
15277
16535
|
}
|
|
15278
16536
|
if (shouldBailOut(arguments[0])) {
|
|
15279
16537
|
original.scrollBy.call(
|
|
15280
|
-
|
|
16538
|
+
w2,
|
|
15281
16539
|
arguments[0].left !== void 0 ? arguments[0].left : typeof arguments[0] !== "object" ? arguments[0] : 0,
|
|
15282
16540
|
arguments[0].top !== void 0 ? arguments[0].top : arguments[1] !== void 0 ? arguments[1] : 0
|
|
15283
16541
|
);
|
|
15284
16542
|
return;
|
|
15285
16543
|
}
|
|
15286
16544
|
smoothScroll.call(
|
|
15287
|
-
|
|
16545
|
+
w2,
|
|
15288
16546
|
d.body,
|
|
15289
|
-
~~arguments[0].left + (
|
|
15290
|
-
~~arguments[0].top + (
|
|
16547
|
+
~~arguments[0].left + (w2.scrollX || w2.pageXOffset),
|
|
16548
|
+
~~arguments[0].top + (w2.scrollY || w2.pageYOffset)
|
|
15291
16549
|
);
|
|
15292
16550
|
};
|
|
15293
16551
|
Element2.prototype.scroll = Element2.prototype.scrollTo = function() {
|
|
@@ -15352,15 +16610,15 @@ function polyfill(w = window, d = document) {
|
|
|
15352
16610
|
scrollableParent.scrollLeft + clientRects.left - parentRects.left,
|
|
15353
16611
|
scrollableParent.scrollTop + clientRects.top - parentRects.top
|
|
15354
16612
|
);
|
|
15355
|
-
if (
|
|
15356
|
-
|
|
16613
|
+
if (w2.getComputedStyle(scrollableParent).position !== "fixed") {
|
|
16614
|
+
w2.scrollBy({
|
|
15357
16615
|
left: parentRects.left,
|
|
15358
16616
|
top: parentRects.top,
|
|
15359
16617
|
behavior: "smooth"
|
|
15360
16618
|
});
|
|
15361
16619
|
}
|
|
15362
16620
|
} else {
|
|
15363
|
-
|
|
16621
|
+
w2.scrollBy({
|
|
15364
16622
|
left: clientRects.left,
|
|
15365
16623
|
top: clientRects.top,
|
|
15366
16624
|
behavior: "smooth"
|
|
@@ -15546,16 +16804,16 @@ function s(n2, o2) {
|
|
|
15546
16804
|
}(m), b = h.next(); !b.done; b = h.next()) {
|
|
15547
16805
|
var S = b.value;
|
|
15548
16806
|
if (void 0 === S) return c(p, g);
|
|
15549
|
-
var
|
|
16807
|
+
var w2 = "string" == typeof S ? { target: S } : S, j2 = w2.target, E = w2.actions, R = void 0 === E ? [] : E, N2 = w2.cond, O2 = void 0 === N2 ? function() {
|
|
15550
16808
|
return true;
|
|
15551
|
-
} :
|
|
15552
|
-
if (
|
|
15553
|
-
var
|
|
16809
|
+
} : N2, _2 = void 0 === j2, k2 = null != j2 ? j2 : p, T = n2.states[k2];
|
|
16810
|
+
if (O2(g, d)) {
|
|
16811
|
+
var q2 = t(f((_2 ? r(R) : [].concat(x2.exit, R, T.entry).filter(function(t2) {
|
|
15554
16812
|
return t2;
|
|
15555
16813
|
})).map(function(t2) {
|
|
15556
16814
|
return i$2(t2, y._options.actions);
|
|
15557
|
-
}), g, d), 3), z =
|
|
15558
|
-
return { value: C, context: A, actions: z, changed:
|
|
16815
|
+
}), g, d), 3), z = q2[0], A = q2[1], B2 = q2[2], C = null != j2 ? j2 : p;
|
|
16816
|
+
return { value: C, context: A, actions: z, changed: j2 !== p || z.length > 0 || B2, matches: a(C) };
|
|
15559
16817
|
}
|
|
15560
16818
|
}
|
|
15561
16819
|
} catch (t2) {
|
|
@@ -18007,7 +19265,7 @@ class Replayer {
|
|
|
18007
19265
|
this.config.logger.log(REPLAY_CONSOLE_PREFIX, ...args);
|
|
18008
19266
|
}
|
|
18009
19267
|
}
|
|
18010
|
-
const version = "
|
|
19268
|
+
const version = "3.1.1-alpha.1";
|
|
18011
19269
|
const { getVersion } = record;
|
|
18012
19270
|
const { isRecording } = record;
|
|
18013
19271
|
const { flushCustomEventQueue } = record;
|
|
@@ -18094,8 +19352,8 @@ var freb = function(eb, start) {
|
|
|
18094
19352
|
}
|
|
18095
19353
|
var r2 = new u32(b[30]);
|
|
18096
19354
|
for (var i = 1; i < 30; ++i) {
|
|
18097
|
-
for (var
|
|
18098
|
-
r2[
|
|
19355
|
+
for (var j2 = b[i]; j2 < b[i + 1]; ++j2) {
|
|
19356
|
+
r2[j2] = j2 - b[i] << 5 | i;
|
|
18099
19357
|
}
|
|
18100
19358
|
}
|
|
18101
19359
|
return [b, r2];
|
|
@@ -18116,9 +19374,9 @@ var hMap = function(cd, mb, r2) {
|
|
|
18116
19374
|
var l2 = new u16(mb);
|
|
18117
19375
|
for (; i < s2; ++i)
|
|
18118
19376
|
++l2[cd[i] - 1];
|
|
18119
|
-
var
|
|
19377
|
+
var le2 = new u16(mb);
|
|
18120
19378
|
for (i = 0; i < mb; ++i) {
|
|
18121
|
-
|
|
19379
|
+
le2[i] = le2[i - 1] + l2[i - 1] << 1;
|
|
18122
19380
|
}
|
|
18123
19381
|
var co;
|
|
18124
19382
|
if (r2) {
|
|
@@ -18128,7 +19386,7 @@ var hMap = function(cd, mb, r2) {
|
|
|
18128
19386
|
if (cd[i]) {
|
|
18129
19387
|
var sv = i << 4 | cd[i];
|
|
18130
19388
|
var r_1 = mb - cd[i];
|
|
18131
|
-
var v2 =
|
|
19389
|
+
var v2 = le2[cd[i] - 1]++ << r_1;
|
|
18132
19390
|
for (var m = v2 | (1 << r_1) - 1; v2 <= m; ++v2) {
|
|
18133
19391
|
co[rev[v2] >>> rvb] = sv;
|
|
18134
19392
|
}
|
|
@@ -18137,7 +19395,7 @@ var hMap = function(cd, mb, r2) {
|
|
|
18137
19395
|
} else {
|
|
18138
19396
|
co = new u16(s2);
|
|
18139
19397
|
for (i = 0; i < s2; ++i)
|
|
18140
|
-
co[i] = rev[
|
|
19398
|
+
co[i] = rev[le2[cd[i] - 1]++] >>> 15 - cd[i];
|
|
18141
19399
|
}
|
|
18142
19400
|
return co;
|
|
18143
19401
|
};
|
|
@@ -18250,10 +19508,10 @@ var inflt = function(dat, buf, st) {
|
|
|
18250
19508
|
ldt[i++] = c2;
|
|
18251
19509
|
}
|
|
18252
19510
|
}
|
|
18253
|
-
var
|
|
18254
|
-
lbt = max(
|
|
19511
|
+
var lt2 = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);
|
|
19512
|
+
lbt = max(lt2);
|
|
18255
19513
|
dbt = max(dt);
|
|
18256
|
-
lm = hMap(
|
|
19514
|
+
lm = hMap(lt2, lbt, 1);
|
|
18257
19515
|
dm = hMap(dt, dbt, 1);
|
|
18258
19516
|
} else
|
|
18259
19517
|
throw "invalid block type";
|
|
@@ -18400,7 +19658,7 @@ var lc = function(c2) {
|
|
|
18400
19658
|
;
|
|
18401
19659
|
var cl = new u16(++s2);
|
|
18402
19660
|
var cli = 0, cln = c2[0], cls = 1;
|
|
18403
|
-
var
|
|
19661
|
+
var w2 = function(v2) {
|
|
18404
19662
|
cl[cli++] = v2;
|
|
18405
19663
|
};
|
|
18406
19664
|
for (var i = 1; i <= s2; ++i) {
|
|
@@ -18409,20 +19667,20 @@ var lc = function(c2) {
|
|
|
18409
19667
|
else {
|
|
18410
19668
|
if (!cln && cls > 2) {
|
|
18411
19669
|
for (; cls > 138; cls -= 138)
|
|
18412
|
-
|
|
19670
|
+
w2(32754);
|
|
18413
19671
|
if (cls > 2) {
|
|
18414
|
-
|
|
19672
|
+
w2(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305);
|
|
18415
19673
|
cls = 0;
|
|
18416
19674
|
}
|
|
18417
19675
|
} else if (cls > 3) {
|
|
18418
|
-
|
|
19676
|
+
w2(cln), --cls;
|
|
18419
19677
|
for (; cls > 6; cls -= 6)
|
|
18420
|
-
|
|
19678
|
+
w2(8304);
|
|
18421
19679
|
if (cls > 2)
|
|
18422
|
-
|
|
19680
|
+
w2(cls - 3 << 5 | 8208), cls = 0;
|
|
18423
19681
|
}
|
|
18424
19682
|
while (cls--)
|
|
18425
|
-
|
|
19683
|
+
w2(cln);
|
|
18426
19684
|
cls = 1;
|
|
18427
19685
|
cln = c2[i];
|
|
18428
19686
|
}
|
|
@@ -18513,16 +19771,16 @@ var deo = /* @__PURE__ */ new u32([65540, 131080, 131088, 131104, 262176, 104870
|
|
|
18513
19771
|
var dflt = function(dat, lvl, plvl, pre, post, lst) {
|
|
18514
19772
|
var s2 = dat.length;
|
|
18515
19773
|
var o2 = new u8(pre + s2 + 5 * (1 + Math.floor(s2 / 7e3)) + post);
|
|
18516
|
-
var
|
|
19774
|
+
var w2 = o2.subarray(pre, o2.length - post);
|
|
18517
19775
|
var pos = 0;
|
|
18518
19776
|
if (!lvl || s2 < 8) {
|
|
18519
19777
|
for (var i = 0; i <= s2; i += 65535) {
|
|
18520
19778
|
var e2 = i + 65535;
|
|
18521
19779
|
if (e2 < s2) {
|
|
18522
|
-
pos = wfblk(
|
|
19780
|
+
pos = wfblk(w2, pos, dat.subarray(i, e2));
|
|
18523
19781
|
} else {
|
|
18524
|
-
|
|
18525
|
-
pos = wfblk(
|
|
19782
|
+
w2[i] = lst;
|
|
19783
|
+
pos = wfblk(w2, pos, dat.subarray(i, s2));
|
|
18526
19784
|
}
|
|
18527
19785
|
}
|
|
18528
19786
|
} else {
|
|
@@ -18546,12 +19804,12 @@ var dflt = function(dat, lvl, plvl, pre, post, lst) {
|
|
|
18546
19804
|
if (wi <= i) {
|
|
18547
19805
|
var rem = s2 - i;
|
|
18548
19806
|
if ((lc_1 > 7e3 || li > 24576) && rem > 423) {
|
|
18549
|
-
pos = wblk(dat,
|
|
19807
|
+
pos = wblk(dat, w2, 0, syms, lf, df, eb, li, bs, i - bs, pos);
|
|
18550
19808
|
li = lc_1 = eb = 0, bs = i;
|
|
18551
|
-
for (var
|
|
18552
|
-
lf[
|
|
18553
|
-
for (var
|
|
18554
|
-
df[
|
|
19809
|
+
for (var j2 = 0; j2 < 286; ++j2)
|
|
19810
|
+
lf[j2] = 0;
|
|
19811
|
+
for (var j2 = 0; j2 < 30; ++j2)
|
|
19812
|
+
df[j2] = 0;
|
|
18555
19813
|
}
|
|
18556
19814
|
var l2 = 2, d = 0, ch_1 = c2, dif = imod - pimod & 32767;
|
|
18557
19815
|
if (rem > 2 && hv == hsh(i - dif)) {
|
|
@@ -18569,8 +19827,8 @@ var dflt = function(dat, lvl, plvl, pre, post, lst) {
|
|
|
18569
19827
|
break;
|
|
18570
19828
|
var mmd = Math.min(dif, nl - 2);
|
|
18571
19829
|
var md = 0;
|
|
18572
|
-
for (var
|
|
18573
|
-
var ti = i - dif +
|
|
19830
|
+
for (var j2 = 0; j2 < mmd; ++j2) {
|
|
19831
|
+
var ti = i - dif + j2 + 32768 & 32767;
|
|
18574
19832
|
var pti = prev[ti];
|
|
18575
19833
|
var cd = ti - pti + 32768 & 32767;
|
|
18576
19834
|
if (cd > md)
|
|
@@ -18596,7 +19854,7 @@ var dflt = function(dat, lvl, plvl, pre, post, lst) {
|
|
|
18596
19854
|
}
|
|
18597
19855
|
}
|
|
18598
19856
|
}
|
|
18599
|
-
pos = wblk(dat,
|
|
19857
|
+
pos = wblk(dat, w2, lst, syms, lf, df, eb, li, bs, i - bs, pos);
|
|
18600
19858
|
}
|
|
18601
19859
|
return slc(o2, 0, pre + shft(pos) + post);
|
|
18602
19860
|
};
|
|
@@ -18654,7 +19912,7 @@ function strToU8(str, latin1) {
|
|
|
18654
19912
|
return new TextEncoder().encode(str);
|
|
18655
19913
|
var ar = new u8(str.length + (str.length >>> 1));
|
|
18656
19914
|
var ai = 0;
|
|
18657
|
-
var
|
|
19915
|
+
var w2 = function(v2) {
|
|
18658
19916
|
ar[ai++] = v2;
|
|
18659
19917
|
};
|
|
18660
19918
|
for (var i = 0; i < l2; ++i) {
|
|
@@ -18665,13 +19923,13 @@ function strToU8(str, latin1) {
|
|
|
18665
19923
|
}
|
|
18666
19924
|
var c2 = str.charCodeAt(i);
|
|
18667
19925
|
if (c2 < 128 || latin1)
|
|
18668
|
-
|
|
19926
|
+
w2(c2);
|
|
18669
19927
|
else if (c2 < 2048)
|
|
18670
|
-
|
|
19928
|
+
w2(192 | c2 >>> 6), w2(128 | c2 & 63);
|
|
18671
19929
|
else if (c2 > 55295 && c2 < 57344)
|
|
18672
|
-
c2 = 65536 + (c2 & 1023 << 10) | str.charCodeAt(++i) & 1023,
|
|
19930
|
+
c2 = 65536 + (c2 & 1023 << 10) | str.charCodeAt(++i) & 1023, w2(240 | c2 >>> 18), w2(128 | c2 >>> 12 & 63), w2(128 | c2 >>> 6 & 63), w2(128 | c2 & 63);
|
|
18673
19931
|
else
|
|
18674
|
-
|
|
19932
|
+
w2(224 | c2 >>> 12), w2(128 | c2 >>> 6 & 63), w2(128 | c2 & 63);
|
|
18675
19933
|
}
|
|
18676
19934
|
return slc(ar, 0, ai);
|
|
18677
19935
|
}
|