@webdecoy/client 0.11.0 → 0.12.0
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/index.js +27 -26
- package/dist/index.mjs +27 -26
- package/dist/webdecoy.global.js +11 -11
- package/package.json +2 -5
package/dist/index.js
CHANGED
|
@@ -565,7 +565,6 @@ var EnvironmentalCollector = class {
|
|
|
565
565
|
}
|
|
566
566
|
_detectPlaywright() {
|
|
567
567
|
try {
|
|
568
|
-
const w = window;
|
|
569
568
|
const signals = [];
|
|
570
569
|
const pwKeys = Object.getOwnPropertyNames(window).filter(
|
|
571
570
|
(k) => k.startsWith("__pw") || k.startsWith("__playwright")
|
|
@@ -577,13 +576,12 @@ var EnvironmentalCollector = class {
|
|
|
577
576
|
signals.push("webdriver_deleted");
|
|
578
577
|
}
|
|
579
578
|
return { detected: signals.length > 0, signals };
|
|
580
|
-
} catch
|
|
579
|
+
} catch {
|
|
581
580
|
return { detected: false, signals: [] };
|
|
582
581
|
}
|
|
583
582
|
}
|
|
584
583
|
_detectCDP() {
|
|
585
584
|
try {
|
|
586
|
-
const w = window;
|
|
587
585
|
const signals = [];
|
|
588
586
|
const cdcKeys = Object.keys(window).filter((k) => k.startsWith("cdc_"));
|
|
589
587
|
if (cdcKeys.length > 0) {
|
|
@@ -606,13 +604,13 @@ var EnvironmentalCollector = class {
|
|
|
606
604
|
signals.push("webdriver_getter_modified");
|
|
607
605
|
}
|
|
608
606
|
}
|
|
609
|
-
} catch
|
|
607
|
+
} catch {
|
|
610
608
|
}
|
|
611
609
|
return {
|
|
612
610
|
detected: signals.length > 0,
|
|
613
611
|
signals
|
|
614
612
|
};
|
|
615
|
-
} catch
|
|
613
|
+
} catch {
|
|
616
614
|
return { detected: false, signals: [] };
|
|
617
615
|
}
|
|
618
616
|
}
|
|
@@ -637,7 +635,7 @@ var EnvironmentalCollector = class {
|
|
|
637
635
|
hash = hash & hash;
|
|
638
636
|
}
|
|
639
637
|
return { hash: hash.toString(16), dataLength: dataUrl.length, supported: true };
|
|
640
|
-
} catch
|
|
638
|
+
} catch {
|
|
641
639
|
return { error: true, supported: false };
|
|
642
640
|
}
|
|
643
641
|
}
|
|
@@ -659,7 +657,7 @@ var EnvironmentalCollector = class {
|
|
|
659
657
|
shadingVersion: gl.getParameter(gl.SHADING_LANGUAGE_VERSION),
|
|
660
658
|
suspiciousRenderer
|
|
661
659
|
};
|
|
662
|
-
} catch
|
|
660
|
+
} catch {
|
|
663
661
|
return { supported: false, error: true };
|
|
664
662
|
}
|
|
665
663
|
}
|
|
@@ -677,7 +675,7 @@ var EnvironmentalCollector = class {
|
|
|
677
675
|
};
|
|
678
676
|
audioCtx.close();
|
|
679
677
|
return info;
|
|
680
|
-
} catch
|
|
678
|
+
} catch {
|
|
681
679
|
return { supported: false, error: true };
|
|
682
680
|
}
|
|
683
681
|
}
|
|
@@ -718,7 +716,7 @@ var EnvironmentalCollector = class {
|
|
|
718
716
|
} catch {
|
|
719
717
|
}
|
|
720
718
|
return { supported: true, patched, patchedCount: patched.length };
|
|
721
|
-
} catch
|
|
719
|
+
} catch {
|
|
722
720
|
return { supported: false };
|
|
723
721
|
}
|
|
724
722
|
}
|
|
@@ -768,10 +766,12 @@ var EnvironmentalCollector = class {
|
|
|
768
766
|
_measureJSExecution() {
|
|
769
767
|
const results = {};
|
|
770
768
|
let start = performance.now();
|
|
769
|
+
let mathSink = 0;
|
|
771
770
|
for (let i = 0; i < 1e3; i++) {
|
|
772
|
-
Math.sqrt(i) * Math.sin(i);
|
|
771
|
+
mathSink += Math.sqrt(i) * Math.sin(i);
|
|
773
772
|
}
|
|
774
773
|
results.mathOps = performance.now() - start;
|
|
774
|
+
results.mathSink = mathSink;
|
|
775
775
|
start = performance.now();
|
|
776
776
|
const arr = [];
|
|
777
777
|
for (let i = 0; i < 1e3; i++) arr.push(i);
|
|
@@ -781,6 +781,7 @@ var EnvironmentalCollector = class {
|
|
|
781
781
|
let str = "";
|
|
782
782
|
for (let i = 0; i < 100; i++) str += "a";
|
|
783
783
|
results.stringOps = performance.now() - start;
|
|
784
|
+
results.stringLen = str.length;
|
|
784
785
|
return results;
|
|
785
786
|
}
|
|
786
787
|
async measureRAFConsistency() {
|
|
@@ -846,7 +847,7 @@ var EnvironmentalCollector = class {
|
|
|
846
847
|
tanLarge: results.tan,
|
|
847
848
|
supported: true
|
|
848
849
|
};
|
|
849
|
-
} catch
|
|
850
|
+
} catch {
|
|
850
851
|
return { supported: false, error: true };
|
|
851
852
|
}
|
|
852
853
|
}
|
|
@@ -858,7 +859,7 @@ var EnvironmentalCollector = class {
|
|
|
858
859
|
try {
|
|
859
860
|
const errors = {};
|
|
860
861
|
try {
|
|
861
|
-
null.foo;
|
|
862
|
+
void null.foo;
|
|
862
863
|
} catch (e) {
|
|
863
864
|
errors.typeError = e.message;
|
|
864
865
|
}
|
|
@@ -889,7 +890,7 @@ var EnvironmentalCollector = class {
|
|
|
889
890
|
typeError: errors.typeError,
|
|
890
891
|
supported: true
|
|
891
892
|
};
|
|
892
|
-
} catch
|
|
893
|
+
} catch {
|
|
893
894
|
return { supported: false, error: true };
|
|
894
895
|
}
|
|
895
896
|
}
|
|
@@ -937,7 +938,7 @@ var EnvironmentalCollector = class {
|
|
|
937
938
|
rangeWidth: rangeRect.width,
|
|
938
939
|
supported: true
|
|
939
940
|
};
|
|
940
|
-
} catch
|
|
941
|
+
} catch {
|
|
941
942
|
return { supported: false, error: true };
|
|
942
943
|
}
|
|
943
944
|
}
|
|
@@ -967,7 +968,7 @@ var EnvironmentalCollector = class {
|
|
|
967
968
|
forcedColors: window.matchMedia("(forced-colors: active)").matches
|
|
968
969
|
};
|
|
969
970
|
return { ...queries, supported: true };
|
|
970
|
-
} catch
|
|
971
|
+
} catch {
|
|
971
972
|
return { supported: false, error: true };
|
|
972
973
|
}
|
|
973
974
|
}
|
|
@@ -990,7 +991,7 @@ var EnvironmentalCollector = class {
|
|
|
990
991
|
hasMIDI: "requestMIDIAccess" in navigator,
|
|
991
992
|
supported: true
|
|
992
993
|
};
|
|
993
|
-
} catch
|
|
994
|
+
} catch {
|
|
994
995
|
return { supported: false, error: true };
|
|
995
996
|
}
|
|
996
997
|
}
|
|
@@ -1077,7 +1078,7 @@ var EnvironmentalCollector = class {
|
|
|
1077
1078
|
hasDejaVuSans: detectedFonts.includes("DejaVu Sans"),
|
|
1078
1079
|
supported: true
|
|
1079
1080
|
};
|
|
1080
|
-
} catch
|
|
1081
|
+
} catch {
|
|
1081
1082
|
return { supported: false, error: true };
|
|
1082
1083
|
}
|
|
1083
1084
|
}
|
|
@@ -1125,7 +1126,7 @@ var EnvironmentalCollector = class {
|
|
|
1125
1126
|
hasAppleVoices: voices.some((v) => v.name.includes("Samantha") || v.name.includes("Alex")),
|
|
1126
1127
|
supported: true
|
|
1127
1128
|
};
|
|
1128
|
-
} catch
|
|
1129
|
+
} catch {
|
|
1129
1130
|
return { supported: false, error: true };
|
|
1130
1131
|
}
|
|
1131
1132
|
}
|
|
@@ -1152,7 +1153,7 @@ var EnvironmentalCollector = class {
|
|
|
1152
1153
|
// Headless browsers typically have 0 devices
|
|
1153
1154
|
totalDevices: devices.length
|
|
1154
1155
|
};
|
|
1155
|
-
} catch
|
|
1156
|
+
} catch {
|
|
1156
1157
|
info.mediaDevices = { supported: false, error: true };
|
|
1157
1158
|
}
|
|
1158
1159
|
}
|
|
@@ -1181,11 +1182,11 @@ var EnvironmentalCollector = class {
|
|
|
1181
1182
|
info.localIPs = Array.from(localIPs);
|
|
1182
1183
|
info.hasLocalIP = localIPs.size > 0;
|
|
1183
1184
|
pc.close();
|
|
1184
|
-
} catch
|
|
1185
|
+
} catch {
|
|
1185
1186
|
info.localIPError = true;
|
|
1186
1187
|
}
|
|
1187
1188
|
return info;
|
|
1188
|
-
} catch
|
|
1189
|
+
} catch {
|
|
1189
1190
|
return { supported: false, error: true };
|
|
1190
1191
|
}
|
|
1191
1192
|
}
|
|
@@ -1254,7 +1255,7 @@ var EnvironmentalCollector = class {
|
|
|
1254
1255
|
mismatches,
|
|
1255
1256
|
mismatchCount: mismatches.length
|
|
1256
1257
|
};
|
|
1257
|
-
} catch
|
|
1258
|
+
} catch {
|
|
1258
1259
|
return { supported: false, error: true };
|
|
1259
1260
|
}
|
|
1260
1261
|
}
|
|
@@ -1425,11 +1426,11 @@ var FormAnalyzer = class {
|
|
|
1425
1426
|
}
|
|
1426
1427
|
}
|
|
1427
1428
|
_interceptFormSubmit() {
|
|
1428
|
-
const
|
|
1429
|
+
const record = (form) => this._recordProgrammaticSubmit(form);
|
|
1429
1430
|
const originalSubmit = HTMLFormElement.prototype.submit;
|
|
1430
|
-
HTMLFormElement.prototype.submit = function() {
|
|
1431
|
-
|
|
1432
|
-
return originalSubmit.apply(this,
|
|
1431
|
+
HTMLFormElement.prototype.submit = function(...args) {
|
|
1432
|
+
record(this);
|
|
1433
|
+
return originalSubmit.apply(this, args);
|
|
1433
1434
|
};
|
|
1434
1435
|
}
|
|
1435
1436
|
_recordProgrammaticSubmit(_form) {
|
package/dist/index.mjs
CHANGED
|
@@ -520,7 +520,6 @@ var EnvironmentalCollector = class {
|
|
|
520
520
|
}
|
|
521
521
|
_detectPlaywright() {
|
|
522
522
|
try {
|
|
523
|
-
const w = window;
|
|
524
523
|
const signals = [];
|
|
525
524
|
const pwKeys = Object.getOwnPropertyNames(window).filter(
|
|
526
525
|
(k) => k.startsWith("__pw") || k.startsWith("__playwright")
|
|
@@ -532,13 +531,12 @@ var EnvironmentalCollector = class {
|
|
|
532
531
|
signals.push("webdriver_deleted");
|
|
533
532
|
}
|
|
534
533
|
return { detected: signals.length > 0, signals };
|
|
535
|
-
} catch
|
|
534
|
+
} catch {
|
|
536
535
|
return { detected: false, signals: [] };
|
|
537
536
|
}
|
|
538
537
|
}
|
|
539
538
|
_detectCDP() {
|
|
540
539
|
try {
|
|
541
|
-
const w = window;
|
|
542
540
|
const signals = [];
|
|
543
541
|
const cdcKeys = Object.keys(window).filter((k) => k.startsWith("cdc_"));
|
|
544
542
|
if (cdcKeys.length > 0) {
|
|
@@ -561,13 +559,13 @@ var EnvironmentalCollector = class {
|
|
|
561
559
|
signals.push("webdriver_getter_modified");
|
|
562
560
|
}
|
|
563
561
|
}
|
|
564
|
-
} catch
|
|
562
|
+
} catch {
|
|
565
563
|
}
|
|
566
564
|
return {
|
|
567
565
|
detected: signals.length > 0,
|
|
568
566
|
signals
|
|
569
567
|
};
|
|
570
|
-
} catch
|
|
568
|
+
} catch {
|
|
571
569
|
return { detected: false, signals: [] };
|
|
572
570
|
}
|
|
573
571
|
}
|
|
@@ -592,7 +590,7 @@ var EnvironmentalCollector = class {
|
|
|
592
590
|
hash = hash & hash;
|
|
593
591
|
}
|
|
594
592
|
return { hash: hash.toString(16), dataLength: dataUrl.length, supported: true };
|
|
595
|
-
} catch
|
|
593
|
+
} catch {
|
|
596
594
|
return { error: true, supported: false };
|
|
597
595
|
}
|
|
598
596
|
}
|
|
@@ -614,7 +612,7 @@ var EnvironmentalCollector = class {
|
|
|
614
612
|
shadingVersion: gl.getParameter(gl.SHADING_LANGUAGE_VERSION),
|
|
615
613
|
suspiciousRenderer
|
|
616
614
|
};
|
|
617
|
-
} catch
|
|
615
|
+
} catch {
|
|
618
616
|
return { supported: false, error: true };
|
|
619
617
|
}
|
|
620
618
|
}
|
|
@@ -632,7 +630,7 @@ var EnvironmentalCollector = class {
|
|
|
632
630
|
};
|
|
633
631
|
audioCtx.close();
|
|
634
632
|
return info;
|
|
635
|
-
} catch
|
|
633
|
+
} catch {
|
|
636
634
|
return { supported: false, error: true };
|
|
637
635
|
}
|
|
638
636
|
}
|
|
@@ -673,7 +671,7 @@ var EnvironmentalCollector = class {
|
|
|
673
671
|
} catch {
|
|
674
672
|
}
|
|
675
673
|
return { supported: true, patched, patchedCount: patched.length };
|
|
676
|
-
} catch
|
|
674
|
+
} catch {
|
|
677
675
|
return { supported: false };
|
|
678
676
|
}
|
|
679
677
|
}
|
|
@@ -723,10 +721,12 @@ var EnvironmentalCollector = class {
|
|
|
723
721
|
_measureJSExecution() {
|
|
724
722
|
const results = {};
|
|
725
723
|
let start = performance.now();
|
|
724
|
+
let mathSink = 0;
|
|
726
725
|
for (let i = 0; i < 1e3; i++) {
|
|
727
|
-
Math.sqrt(i) * Math.sin(i);
|
|
726
|
+
mathSink += Math.sqrt(i) * Math.sin(i);
|
|
728
727
|
}
|
|
729
728
|
results.mathOps = performance.now() - start;
|
|
729
|
+
results.mathSink = mathSink;
|
|
730
730
|
start = performance.now();
|
|
731
731
|
const arr = [];
|
|
732
732
|
for (let i = 0; i < 1e3; i++) arr.push(i);
|
|
@@ -736,6 +736,7 @@ var EnvironmentalCollector = class {
|
|
|
736
736
|
let str = "";
|
|
737
737
|
for (let i = 0; i < 100; i++) str += "a";
|
|
738
738
|
results.stringOps = performance.now() - start;
|
|
739
|
+
results.stringLen = str.length;
|
|
739
740
|
return results;
|
|
740
741
|
}
|
|
741
742
|
async measureRAFConsistency() {
|
|
@@ -801,7 +802,7 @@ var EnvironmentalCollector = class {
|
|
|
801
802
|
tanLarge: results.tan,
|
|
802
803
|
supported: true
|
|
803
804
|
};
|
|
804
|
-
} catch
|
|
805
|
+
} catch {
|
|
805
806
|
return { supported: false, error: true };
|
|
806
807
|
}
|
|
807
808
|
}
|
|
@@ -813,7 +814,7 @@ var EnvironmentalCollector = class {
|
|
|
813
814
|
try {
|
|
814
815
|
const errors = {};
|
|
815
816
|
try {
|
|
816
|
-
null.foo;
|
|
817
|
+
void null.foo;
|
|
817
818
|
} catch (e) {
|
|
818
819
|
errors.typeError = e.message;
|
|
819
820
|
}
|
|
@@ -844,7 +845,7 @@ var EnvironmentalCollector = class {
|
|
|
844
845
|
typeError: errors.typeError,
|
|
845
846
|
supported: true
|
|
846
847
|
};
|
|
847
|
-
} catch
|
|
848
|
+
} catch {
|
|
848
849
|
return { supported: false, error: true };
|
|
849
850
|
}
|
|
850
851
|
}
|
|
@@ -892,7 +893,7 @@ var EnvironmentalCollector = class {
|
|
|
892
893
|
rangeWidth: rangeRect.width,
|
|
893
894
|
supported: true
|
|
894
895
|
};
|
|
895
|
-
} catch
|
|
896
|
+
} catch {
|
|
896
897
|
return { supported: false, error: true };
|
|
897
898
|
}
|
|
898
899
|
}
|
|
@@ -922,7 +923,7 @@ var EnvironmentalCollector = class {
|
|
|
922
923
|
forcedColors: window.matchMedia("(forced-colors: active)").matches
|
|
923
924
|
};
|
|
924
925
|
return { ...queries, supported: true };
|
|
925
|
-
} catch
|
|
926
|
+
} catch {
|
|
926
927
|
return { supported: false, error: true };
|
|
927
928
|
}
|
|
928
929
|
}
|
|
@@ -945,7 +946,7 @@ var EnvironmentalCollector = class {
|
|
|
945
946
|
hasMIDI: "requestMIDIAccess" in navigator,
|
|
946
947
|
supported: true
|
|
947
948
|
};
|
|
948
|
-
} catch
|
|
949
|
+
} catch {
|
|
949
950
|
return { supported: false, error: true };
|
|
950
951
|
}
|
|
951
952
|
}
|
|
@@ -1032,7 +1033,7 @@ var EnvironmentalCollector = class {
|
|
|
1032
1033
|
hasDejaVuSans: detectedFonts.includes("DejaVu Sans"),
|
|
1033
1034
|
supported: true
|
|
1034
1035
|
};
|
|
1035
|
-
} catch
|
|
1036
|
+
} catch {
|
|
1036
1037
|
return { supported: false, error: true };
|
|
1037
1038
|
}
|
|
1038
1039
|
}
|
|
@@ -1080,7 +1081,7 @@ var EnvironmentalCollector = class {
|
|
|
1080
1081
|
hasAppleVoices: voices.some((v) => v.name.includes("Samantha") || v.name.includes("Alex")),
|
|
1081
1082
|
supported: true
|
|
1082
1083
|
};
|
|
1083
|
-
} catch
|
|
1084
|
+
} catch {
|
|
1084
1085
|
return { supported: false, error: true };
|
|
1085
1086
|
}
|
|
1086
1087
|
}
|
|
@@ -1107,7 +1108,7 @@ var EnvironmentalCollector = class {
|
|
|
1107
1108
|
// Headless browsers typically have 0 devices
|
|
1108
1109
|
totalDevices: devices.length
|
|
1109
1110
|
};
|
|
1110
|
-
} catch
|
|
1111
|
+
} catch {
|
|
1111
1112
|
info.mediaDevices = { supported: false, error: true };
|
|
1112
1113
|
}
|
|
1113
1114
|
}
|
|
@@ -1136,11 +1137,11 @@ var EnvironmentalCollector = class {
|
|
|
1136
1137
|
info.localIPs = Array.from(localIPs);
|
|
1137
1138
|
info.hasLocalIP = localIPs.size > 0;
|
|
1138
1139
|
pc.close();
|
|
1139
|
-
} catch
|
|
1140
|
+
} catch {
|
|
1140
1141
|
info.localIPError = true;
|
|
1141
1142
|
}
|
|
1142
1143
|
return info;
|
|
1143
|
-
} catch
|
|
1144
|
+
} catch {
|
|
1144
1145
|
return { supported: false, error: true };
|
|
1145
1146
|
}
|
|
1146
1147
|
}
|
|
@@ -1209,7 +1210,7 @@ var EnvironmentalCollector = class {
|
|
|
1209
1210
|
mismatches,
|
|
1210
1211
|
mismatchCount: mismatches.length
|
|
1211
1212
|
};
|
|
1212
|
-
} catch
|
|
1213
|
+
} catch {
|
|
1213
1214
|
return { supported: false, error: true };
|
|
1214
1215
|
}
|
|
1215
1216
|
}
|
|
@@ -1380,11 +1381,11 @@ var FormAnalyzer = class {
|
|
|
1380
1381
|
}
|
|
1381
1382
|
}
|
|
1382
1383
|
_interceptFormSubmit() {
|
|
1383
|
-
const
|
|
1384
|
+
const record = (form) => this._recordProgrammaticSubmit(form);
|
|
1384
1385
|
const originalSubmit = HTMLFormElement.prototype.submit;
|
|
1385
|
-
HTMLFormElement.prototype.submit = function() {
|
|
1386
|
-
|
|
1387
|
-
return originalSubmit.apply(this,
|
|
1386
|
+
HTMLFormElement.prototype.submit = function(...args) {
|
|
1387
|
+
record(this);
|
|
1388
|
+
return originalSubmit.apply(this, args);
|
|
1388
1389
|
};
|
|
1389
1390
|
}
|
|
1390
1391
|
_recordProgrammaticSubmit(_form) {
|
package/dist/webdecoy.global.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var WebDecoyCaptchaBundle=(()=>{var H=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ie=Object.prototype.hasOwnProperty;var re=(c,t)=>{for(var e in t)H(c,e,{get:t[e],enumerable:!0})},se=(c,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of oe(t))!ie.call(c,o)&&o!==e&&H(c,o,{get:()=>t[o],enumerable:!(n=ne(t,o))||n.enumerable});return c};var ae=c=>se(H({},"__esModule",{value:!0}),c);var ye={};re(ye,{WebDecoyCaptcha:()=>W});var E=class{constructor(){this.mousePositions=[],this.mouseVelocities=[],this.mouseAccelerations=[],this.scrollEvents=[],this.keyEvents=[],this.touchEvents=[],this.touchMultiTouchSeen=!1,this.touchIdentifiers=new Set,this.pointerPoints=[],this.focusEvents=[],this.clickData=null,this.startTime=Date.now(),this.lastMousePos=null,this.lastMouseTime=null,this.lastVelocity=null,this.eventDeltas=[]}recordMouseMove(t){let e=performance.now(),n={x:t.clientX,y:t.clientY,t:e};if(this.mousePositions.push(n),this.lastMousePos&&this.lastMouseTime){let o=e-this.lastMouseTime;if(o>0){let i=t.clientX-this.lastMousePos.x,r=t.clientY-this.lastMousePos.y,a=Math.sqrt(i*i+r*r)/o;if(this.mouseVelocities.push({v:a,t:e}),this.eventDeltas.push(o),this.lastVelocity!==null){let l=(a-this.lastVelocity)/o;this.mouseAccelerations.push({a:l,t:e})}this.lastVelocity=a}}this.lastMousePos={x:t.clientX,y:t.clientY},this.lastMouseTime=e,this.mousePositions.length>500&&(this.mousePositions.shift(),this.mouseVelocities.length>500&&this.mouseVelocities.shift(),this.mouseAccelerations.length>500&&this.mouseAccelerations.shift())}recordMouseDown(t){this.clickData={x:t.clientX,y:t.clientY,button:t.button,downTime:performance.now()}}recordMouseUp(t){this.clickData&&(this.clickData.upTime=performance.now(),this.clickData.holdDuration=this.clickData.upTime-this.clickData.downTime)}recordScroll(t){this.scrollEvents.push({x:window.scrollX,y:window.scrollY,t:performance.now()}),this.scrollEvents.length>100&&this.scrollEvents.shift()}recordKeyEvent(t){this.keyEvents.push({type:t.type,keyLength:t.key?t.key.length:0,t:performance.now()})}recordTouch(t){let e=t.touches&&t.touches.length?t.touches:t.changedTouches;if(!e||e.length===0)return;e.length>1&&(this.touchMultiTouchSeen=!0);let n=e[0];typeof n.identifier=="number"&&this.touchIdentifiers.add(n.identifier),this.touchEvents.push({x:n.clientX,y:n.clientY,t:performance.now(),force:typeof n.force=="number"?n.force:0,radiusX:typeof n.radiusX=="number"?n.radiusX:0,radiusY:typeof n.radiusY=="number"?n.radiusY:0,rotationAngle:typeof n.rotationAngle=="number"?n.rotationAngle:0,identifier:typeof n.identifier=="number"?n.identifier:-1,touchCount:e.length}),this.touchEvents.length>500&&this.touchEvents.shift()}recordPointer(t){this.pointerPoints.push({x:t.clientX,y:t.clientY,t:performance.now(),type:t.type,pressure:typeof t.pressure=="number"?t.pressure:0,tiltX:typeof t.tiltX=="number"?t.tiltX:0,tiltY:typeof t.tiltY=="number"?t.tiltY:0,tangentialPressure:typeof t.tangentialPressure=="number"?t.tangentialPressure:0,pointerType:t.pointerType||"unknown"}),this.pointerPoints.length>500&&this.pointerPoints.shift()}recordFocus(t){var e;this.focusEvents.push({type:t.type,target:(e=t.target)==null?void 0:e.tagName,t:performance.now()})}analyze(){let t=this.mousePositions,e=this.mouseVelocities,n=this.mouseAccelerations;if(t.length<10)return this._getEmptyAnalysis();let o=0,i=0;e.length>0&&(o=e.reduce((v,d)=>v+d.v,0)/e.length,i=e.reduce((v,d)=>v+Math.pow(d.v-o,2),0)/e.length);let r=0,s=0;if(n.length>0){r=n.reduce((m,v)=>m+v.a,0)/n.length;for(let m=1;m<n.length;m++)Math.sign(n[m].a)!==Math.sign(n[m-1].a)&&s++}let a=this._detectMicroTremor(t),l=this._calculateStraightLineRatio(t),u=0;for(let m=1;m<t.length;m++){let v=Math.abs(t[m].x-t[m-1].x),d=Math.abs(t[m].y-t[m-1].y);v<3&&d<3&&(v>0||d>0)&&u++}let h=this._countDirectionChanges(t),f=this._variance(this.eventDeltas),g=t.length>1?t.length/((t[t.length-1].t-t[0].t)/1e3):0,w=0;for(let m=1;m<t.length;m++){let v=t[m].x-t[m-1].x,d=t[m].y-t[m-1].y;w+=Math.sqrt(v*v+d*d)}let _=this._analyzeTouchPoints(this.touchEvents),S=this._analyzePointerPoints(this.pointerPoints);return{totalPoints:t.length,trajectoryLength:w,avgVelocity:o,velocityVariance:i,avgAcceleration:r,accelerationChanges:s,microTremorScore:a,straightLineRatio:l,microMovements:u,directionChanges:h,eventDeltas:this.eventDeltas.slice(-50),eventDeltaVariance:f,mouseEventRate:g,scrollEvents:this.scrollEvents.length,keyEvents:this.keyEvents.length,touchEvents:this.touchEvents.length,focusEvents:this.focusEvents.length,clickData:this.clickData,interactionDuration:Date.now()-this.startTime,..._,...S}}_analyzeTouchPoints(t){if(!t||t.length===0)return{touchTotalPoints:0,touchTrajectoryLength:0,touchAvgVelocity:0,touchVelocityVariance:0,touchMicroTremorScore:0,touchStraightLineRatio:0,touchDirectionChanges:0,touchForceMin:0,touchForceMax:0,touchForceVariance:0,touchRadiusMin:0,touchRadiusMax:0,touchRadiusVariance:0,touchMultiTouchSeen:this.touchMultiTouchSeen,touchUniqueIdentifiers:this.touchIdentifiers.size,touchForceAllZero:!1,touchForceAllOne:!1};let e=0,n=[];for(let l=1;l<t.length;l++){let u=t[l].x-t[l-1].x,h=t[l].y-t[l-1].y,f=Math.sqrt(u*u+h*h);e+=f;let g=t[l].t-t[l-1].t;g>0&&n.push(f/g)}let o=n.length>0?n.reduce((l,u)=>l+u,0)/n.length:0,i=t.map(l=>l.force),r=t.map(l=>Math.max(l.radiusX||0,l.radiusY||0)),s=i.length>0&&i.every(l=>l===0),a=i.length>0&&i.every(l=>l===1);return{touchTotalPoints:t.length,touchTrajectoryLength:e,touchAvgVelocity:o,touchVelocityVariance:this._variance(n),touchMicroTremorScore:this._detectMicroTremor(t),touchStraightLineRatio:this._calculateStraightLineRatio(t),touchDirectionChanges:this._countDirectionChanges(t),touchForceMin:i.length>0?Math.min(...i):0,touchForceMax:i.length>0?Math.max(...i):0,touchForceVariance:this._variance(i),touchRadiusMin:r.length>0?Math.min(...r):0,touchRadiusMax:r.length>0?Math.max(...r):0,touchRadiusVariance:this._variance(r),touchMultiTouchSeen:this.touchMultiTouchSeen,touchUniqueIdentifiers:this.touchIdentifiers.size,touchForceAllZero:s,touchForceAllOne:a}}_analyzePointerPoints(t){if(!t||t.length===0)return{pointerEvents:0,pointerAvgPressure:0,pointerPressureVariance:0,pointerMaxTilt:0,pointerHasNonMouseType:!1,pointerTypes:[]};let e=t.map(r=>r.pressure),n=e.length>0?e.reduce((r,s)=>r+s,0)/e.length:0,o=0,i=new Set;for(let r of t){let s=Math.abs(r.tiltX||0)+Math.abs(r.tiltY||0);s>o&&(o=s),r.pointerType&&i.add(r.pointerType)}return{pointerEvents:t.length,pointerAvgPressure:n,pointerPressureVariance:this._variance(e),pointerMaxTilt:o,pointerHasNonMouseType:Array.from(i).some(r=>r!=="mouse"&&r!=="unknown"),pointerTypes:Array.from(i)}}analyzeClick(t,e,n){let o=this.mousePositions;if(o.length<5)return this._getEmptyClickAnalysis();let i=o.slice(-20),r=n.left+n.width/2,s=n.top+n.height/2,a=Math.sqrt(Math.pow(t-r,2)+Math.pow(e-s,2)),l=0,u=0;for(let d=1;d<o.length;d++){let p=Math.sqrt(Math.pow(o[d].x-o[d-1].x,2)+Math.pow(o[d].y-o[d-1].y,2));u+=p,o[d].x>=n.left&&o[d].x<=n.right&&o[d].y>=n.top&&o[d].y<=n.bottom||(l+=p)}let h=u>0?l/u:0,f=0,g=!1,w=!1;for(let d of i){let p=d.x>=n.left&&d.x<=n.right&&d.y>=n.top&&d.y<=n.bottom;g&&!p&&(w=!0),w&&p&&(f++,w=!1),g=p}let _=0;for(let d=i.length-1;d>=0;d--){let p=i[d],I=p.x>=n.left&&p.x<=n.right&&p.y>=n.top&&p.y<=n.bottom;if(I&&d<i.length-1)_=i[i.length-1].t-p.t;else if(!I)break}let S=Math.sqrt(Math.pow(i[i.length-1].x-i[0].x,2)+Math.pow(i[i.length-1].y-i[0].y,2)),m=0;for(let d=1;d<i.length;d++)m+=Math.sqrt(Math.pow(i[d].x-i[d-1].x,2)+Math.pow(i[d].y-i[d-1].y,2));let v=m>0?S/m:1;return{clickPrecision:a,explorationRatio:h,overshootCorrections:f,hoverTime:_,approachDirectness:v,approachPoints:i.length}}_detectMicroTremor(t){if(t.length<20)return .5;let e=5,n=0;for(let i=e;i<t.length-e;i++){let r=0,s=0;for(let l=i-e;l<=i+e;l++)r+=t[l].x,s+=t[l].y;r/=e*2+1,s/=e*2+1;let a=Math.sqrt(Math.pow(t[i].x-r,2)+Math.pow(t[i].y-s,2));n+=a}let o=n/(t.length-e*2);return Math.min(1,o/2)}_calculateStraightLineRatio(t){if(t.length<3)return 0;let e=0,n=0;for(let o=2;o<t.length;o++){let i=t[o-2],r=t[o-1],s=t[o],a=Math.atan2(r.y-i.y,r.x-i.x),l=Math.atan2(s.y-r.y,s.x-r.x),u=Math.abs(l-a);n++,u<.1&&e++}return n>0?e/n:0}_countDirectionChanges(t){let e=0;for(let n=2;n<t.length;n++){let o=Math.atan2(t[n-1].y-t[n-2].y,t[n-1].x-t[n-2].x),i=Math.atan2(t[n].y-t[n-1].y,t[n].x-t[n-1].x);Math.abs(i-o)>Math.PI/6&&e++}return e}_variance(t){if(t.length===0)return 0;let e=t.reduce((n,o)=>n+o,0)/t.length;return t.reduce((n,o)=>n+Math.pow(o-e,2),0)/t.length}_getEmptyAnalysis(){return{totalPoints:0,trajectoryLength:0,avgVelocity:0,velocityVariance:0,avgAcceleration:0,accelerationChanges:0,microTremorScore:.5,straightLineRatio:0,microMovements:0,directionChanges:0,eventDeltas:[],eventDeltaVariance:0,mouseEventRate:0,scrollEvents:this.scrollEvents.length,keyEvents:this.keyEvents.length,touchEvents:this.touchEvents.length,focusEvents:this.focusEvents.length,clickData:this.clickData,interactionDuration:Date.now()-this.startTime,...this._analyzeTouchPoints(this.touchEvents),...this._analyzePointerPoints(this.pointerPoints)}}_getEmptyClickAnalysis(){return{clickPrecision:0,explorationRatio:0,overshootCorrections:0,hoverTime:0,approachDirectness:1,approachPoints:0}}};var b=class{collect(){return{webdriver:this._detectWebdriver(),automationFlags:this._getAutomationFlags(),cdp:this._detectCDP(),playwright:this._detectPlaywright(),canvasHash:this._getCanvasHash(),webglInfo:this._getWebGLInfo(),audioInfo:this._getAudioInfo(),headlessIndicators:this._getHeadlessIndicators(),screen:this._getScreenInfo(),navigator:this._getNavigatorInfo(),jsExecutionTime:this._measureJSExecution(),mathFingerprint:this._getMathFingerprint(),errorFingerprint:this._getErrorFingerprint(),domRectFingerprint:this._getDOMRectFingerprint(),cssMediaQueries:this._getCSSMediaQueries(),permissionsInfo:this._getPermissionsInfo(),fontsInfo:this._getFontsInfo(),lieDetection:this._getLieDetection()}}async collectAsync(){let[t,e,n]=await Promise.all([this._getSpeechInfo(),this._getWebRTCInfo(),this._checkWorkerConsistency()]);return{speechInfo:t,webrtcInfo:e,workerConsistency:n}}_detectWebdriver(){let t=navigator,e=window;return!!(t.webdriver||e.document.__webdriver_evaluate||e.document.__selenium_evaluate||e.document.__webdriver_script_fn||e.document.__webdriver_script_func||e.document.__webdriver_script_function||e.document.$cdc_asdjflasutopfhvcZLmcfl_||e.document.$wdc_||e._Selenium_IDE_Recorder||e._phantom||e.__nightmare||e.callPhantom||e._phantom)}_getAutomationFlags(){let t=navigator,e=window;return{webdriver:!!t.webdriver,domAutomation:!!e.domAutomation,domAutomationController:!!e.domAutomationController,_selenium:!!e._selenium,__webdriver_script_fn:!!e.__webdriver_script_fn,__driver_evaluate:!!e.__driver_evaluate,__webdriver_evaluate:!!e.__webdriver_evaluate,__fxdriver_evaluate:!!e.__fxdriver_evaluate,__driver_unwrapped:!!e.__driver_unwrapped,__webdriver_unwrapped:!!e.__webdriver_unwrapped,__fxdriver_unwrapped:!!e.__fxdriver_unwrapped,_Selenium_IDE_Recorder:!!e._Selenium_IDE_Recorder,calledSelenium:!!e.calledSelenium,$chrome_asyncScriptInfo:!!e.$chrome_asyncScriptInfo,$cdc_asdjflasutopfhvcZLmcfl_:!!e.$cdc_asdjflasutopfhvcZLmcfl_,_phantom:!!e._phantom,callPhantom:!!e.callPhantom,__nightmare:!!e.__nightmare,__lastWatirAlert:!!e.__lastWatirAlert,__lastWatirConfirm:!!e.__lastWatirConfirm,__lastWatirPrompt:!!e.__lastWatirPrompt,plugins:navigator.plugins?navigator.plugins.length:0,languages:navigator.languages&&navigator.languages.length>0,mimeTypes:navigator.mimeTypes?navigator.mimeTypes.length:0,cookieEnabled:navigator.cookieEnabled,doNotTrack:navigator.doNotTrack,chrome:!!e.chrome,chromeRuntime:!!(e.chrome&&e.chrome.runtime&&e.chrome.runtime.id),permissionsAPI:!!navigator.permissions}}_detectPlaywright(){try{let t=window,e=[];Object.getOwnPropertyNames(window).filter(r=>r.startsWith("__pw")||r.startsWith("__playwright")).length>0&&e.push("playwright_globals");let o=Object.getPrototypeOf(navigator);return Object.getOwnPropertyDescriptor(o,"webdriver")||e.push("webdriver_deleted"),{detected:e.length>0,signals:e}}catch{return{detected:!1,signals:[]}}}_detectCDP(){try{let t=window,e=[];Object.keys(window).filter(o=>o.startsWith("cdc_")).length>0&&e.push("chromedriver_cdc"),"__webdriver_evaluate"in window&&e.push("selenium_evaluate"),"__driver_evaluate"in window&&e.push("selenium_driver_evaluate"),"__webdriver_unwrapped"in window&&e.push("selenium_unwrapped"),"__driver_unwrapped"in window&&e.push("selenium_driver_unwrapped"),"__selenium_evaluate"in window&&e.push("selenium_direct"),"__fxdriver_evaluate"in window&&e.push("firefox_driver"),"__fxdriver_unwrapped"in window&&e.push("firefox_driver_unwrapped"),"__puppeteer_evaluation_script__"in window&&e.push("puppeteer_eval"),document.__webdriver_script_fn&&e.push("cdp_script_injection");try{let o=Object.getOwnPropertyDescriptor(navigator,"webdriver");o&&typeof o.get=="function"&&o.get.toString().indexOf("[native code]")===-1&&e.push("webdriver_getter_modified")}catch{}return{detected:e.length>0,signals:e}}catch{return{detected:!1,signals:[]}}}_getCanvasHash(){try{let t=document.createElement("canvas");t.width=200,t.height=50;let e=t.getContext("2d");e.textBaseline="top",e.font="14px Arial",e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.fillText("FCaptcha",2,15),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillText("FCaptcha",4,17);let n=t.toDataURL(),o=0;for(let i=0;i<n.length;i++)o=(o<<5)-o+n.charCodeAt(i),o=o&o;return{hash:o.toString(16),dataLength:n.length,supported:!0}}catch{return{error:!0,supported:!1}}}_getWebGLInfo(){try{let t=document.createElement("canvas"),e=t.getContext("webgl")||t.getContext("experimental-webgl");if(!e)return{supported:!1};let n=e.getExtension("WEBGL_debug_renderer_info"),o=n?e.getParameter(n.UNMASKED_VENDOR_WEBGL):"unknown",i=n?e.getParameter(n.UNMASKED_RENDERER_WEBGL):"unknown",r=i.toLowerCase(),s=r.includes("swiftshader")||r.includes("llvmpipe")||r.includes("softpipe")||r.includes("virtualbox")||r.includes("vmware");return{supported:!0,vendor:o,renderer:i,version:e.getParameter(e.VERSION),shadingVersion:e.getParameter(e.SHADING_LANGUAGE_VERSION),suspiciousRenderer:s}}catch{return{supported:!1,error:!0}}}_getAudioInfo(){try{let t=window,e=t.AudioContext||t.webkitAudioContext;if(!e)return{supported:!1};let n=new e,o={supported:!0,sampleRate:n.sampleRate,state:n.state,baseLatency:n.baseLatency};return n.close(),o}catch{return{supported:!1,error:!0}}}_getLieDetection(){try{let t=window,e=[],n=i=>{try{return typeof i=="function"&&i.toString().indexOf("[native code]")===-1}catch{return!1}},o=(i,r)=>{n(i)&&e.push(r)};o(Function.prototype.toString,"Function.prototype.toString"),o(navigator.permissions&&navigator.permissions.query,"navigator.permissions.query"),o(t.Notification&&t.Notification.requestPermission,"Notification.requestPermission"),o(t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.toDataURL,"HTMLCanvasElement.toDataURL"),o(t.WebGLRenderingContext&&t.WebGLRenderingContext.prototype.getParameter,"WebGLRenderingContext.getParameter"),o(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices,"mediaDevices.enumerateDevices");try{let i=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(navigator),"webdriver")||Object.getOwnPropertyDescriptor(navigator,"webdriver");i&&typeof i.get=="function"&&i.get.toString().indexOf("[native code]")===-1&&e.push("navigator.webdriver getter")}catch{}return{supported:!0,patched:e,patchedCount:e.length}}catch{return{supported:!1}}}_getHeadlessIndicators(){let t=navigator;return{hasOuterDimensions:window.outerWidth>0&&window.outerHeight>0,innerEqualsOuter:window.innerWidth===window.outerWidth&&window.innerHeight===window.outerHeight,screenColorDepth:window.screen.colorDepth,screenPixelDepth:window.screen.pixelDepth,connectionType:t.connection?t.connection.type:"unknown",connectionRtt:t.connection?t.connection.rtt:-1,notificationPermission:typeof Notification!="undefined"?Notification.permission:"unsupported",hasBattery:"getBattery"in navigator,hasCredentials:"credentials"in navigator,hasMediaDevices:"mediaDevices"in navigator}}_getScreenInfo(){return{width:screen.width,height:screen.height,colorDepth:screen.colorDepth,pixelRatio:window.devicePixelRatio,availWidth:screen.availWidth,availHeight:screen.availHeight,innerWidth:window.innerWidth,innerHeight:window.innerHeight}}_getNavigatorInfo(){var e;let t=navigator;return{language:navigator.language,languageCount:((e=navigator.languages)==null?void 0:e.length)||0,platform:navigator.platform,hardwareConcurrency:navigator.hardwareConcurrency,deviceMemory:t.deviceMemory,maxTouchPoints:navigator.maxTouchPoints||0,vendor:navigator.vendor,userAgent:navigator.userAgent,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timezoneOffset:new Date().getTimezoneOffset()}}_measureJSExecution(){let t={},e=performance.now();for(let i=0;i<1e3;i++)Math.sqrt(i)*Math.sin(i);t.mathOps=performance.now()-e,e=performance.now();let n=[];for(let i=0;i<1e3;i++)n.push(i);t.arrayOps=performance.now()-e,t.arrayLen=n.length,e=performance.now();let o="";for(let i=0;i<100;i++)o+="a";return t.stringOps=performance.now()-e,t}async measureRAFConsistency(){return new Promise(t=>{let e=[],n=0,o=10;function i(r){if(e.push(r),n++,n<o)requestAnimationFrame(i);else{let s=[];for(let u=1;u<e.length;u++)s.push(e[u]-e[u-1]);let a=s.reduce((u,h)=>u+h,0)/s.length,l=s.reduce((u,h)=>u+Math.pow(h-a,2),0)/s.length;t({avgFrameTime:a,frameTimeVariance:l,frames:o})}}requestAnimationFrame(i)})}_getMathFingerprint(){try{let t={acos:Math.acos(.123456789),acosh:Math.acosh(1e308),asin:Math.asin(.123456789),asinh:Math.asinh(1),atanh:Math.atanh(.5),cbrt:Math.cbrt(100),cosh:Math.cosh(1),expm1:Math.expm1(1),log1p:Math.log1p(10),sinh:Math.sinh(1),tan:Math.tan(-1e308),tanh:Math.tanh(1),pow:Math.pow(Math.PI,-100),sin:Math.sin(Math.PI)},e=Object.values(t).map(o=>String(o)).join(","),n=0;for(let o=0;o<e.length;o++)n=(n<<5)-n+e.charCodeAt(o),n=n&n;return{hash:n.toString(16),sinPi:t.sin,tanLarge:t.tan,supported:!0}}catch{return{supported:!1,error:!0}}}_getErrorFingerprint(){try{let t={};try{null.foo}catch(o){t.typeError=o.message}try{[].length=-1}catch(o){t.rangeError=o.message}try{decodeURIComponent("%")}catch(o){t.uriError=o.message}try{({}).undefinedMethod()}catch(o){t.refTypeError=o.message}let e=Object.values(t).join("|"),n=0;for(let o=0;o<e.length;o++)n=(n<<5)-n+e.charCodeAt(o),n=n&n;return{hash:n.toString(16),typeError:t.typeError,supported:!0}}catch{return{supported:!1,error:!0}}}_getDOMRectFingerprint(){try{let t=document.createElement("div");t.style.cssText="position:absolute;left:-9999px;font-size:16px;font-family:Arial,sans-serif;";let e=document.createElement("span");e.textContent="FCaptcha Test String 123",t.appendChild(e);let n=document.createElement("span");n.style.cssText="letter-spacing:1px;word-spacing:2px;",n.textContent="WWWW 0000",t.appendChild(n),document.body.appendChild(t);let o=e.getBoundingClientRect(),i=n.getBoundingClientRect(),r=document.createRange();r.selectNode(e);let s=r.getBoundingClientRect();document.body.removeChild(t);let l=[o.width,o.height,o.x,o.y,i.width,i.height,s.width,s.height].map(h=>h.toFixed(6)).join(","),u=0;for(let h=0;h<l.length;h++)u=(u<<5)-u+l.charCodeAt(h),u=u&u;return{hash:u.toString(16),rectAWidth:o.width,rectBWidth:i.width,rangeWidth:s.width,supported:!0}}catch{return{supported:!1,error:!0}}}_getCSSMediaQueries(){try{return{...{prefersColorScheme:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",prefersReducedMotion:window.matchMedia("(prefers-reduced-motion: reduce)").matches,prefersReducedTransparency:window.matchMedia("(prefers-reduced-transparency: reduce)").matches,prefersContrast:window.matchMedia("(prefers-contrast: more)").matches?"more":window.matchMedia("(prefers-contrast: less)").matches?"less":"no-preference",anyHover:window.matchMedia("(any-hover: hover)").matches,anyPointer:window.matchMedia("(any-pointer: fine)").matches?"fine":window.matchMedia("(any-pointer: coarse)").matches?"coarse":"none",hover:window.matchMedia("(hover: hover)").matches,pointer:window.matchMedia("(pointer: fine)").matches?"fine":window.matchMedia("(pointer: coarse)").matches?"coarse":"none",colorGamut:window.matchMedia("(color-gamut: p3)").matches?"p3":window.matchMedia("(color-gamut: srgb)").matches?"srgb":"none",displayMode:window.matchMedia("(display-mode: standalone)").matches?"standalone":window.matchMedia("(display-mode: fullscreen)").matches?"fullscreen":"browser",orientation:window.matchMedia("(orientation: portrait)").matches?"portrait":"landscape",dynamicRange:window.matchMedia("(dynamic-range: high)").matches?"high":"standard",forcedColors:window.matchMedia("(forced-colors: active)").matches},supported:!0}}catch{return{supported:!1,error:!0}}}_getPermissionsInfo(){try{return{hasPermissionsAPI:"permissions"in navigator,hasClipboard:"clipboard"in navigator,hasShare:"share"in navigator,hasCredentials:"credentials"in navigator,hasBluetooth:"bluetooth"in navigator,hasUsb:"usb"in navigator,hasSerial:"serial"in navigator,hasHid:"hid"in navigator,hasXR:"xr"in navigator,hasGeolocation:"geolocation"in navigator,hasMIDI:"requestMIDIAccess"in navigator,supported:!0}}catch{return{supported:!1,error:!0}}}_getFontsInfo(){try{let t=["monospace","sans-serif","serif"],e=["Arial","Helvetica","Times New Roman","Courier New","Georgia","Verdana","Trebuchet MS","Comic Sans MS","Impact","Lucida Console","Menlo","Monaco","SF Pro","Helvetica Neue","Segoe UI","Consolas","Calibri","Cambria","DejaVu Sans","Liberation Sans","Ubuntu","Cantarell","MS Gothic","Meiryo","SimHei","Microsoft YaHei"],n=document.createElement("canvas");n.width=400,n.height=40;let o=n.getContext("2d"),i="mmMWWLLiiff00",r="72px",s={};for(let h of t)o.font=r+" "+h,s[h]=o.measureText(i).width;let a=[];for(let h of e){let f=!1;for(let g of t)if(o.font=r+' "'+h+'", '+g,o.measureText(i).width!==s[g]){f=!0;break}f&&a.push(h)}let l=a.join(","),u=0;for(let h=0;h<l.length;h++)u=(u<<5)-u+l.charCodeAt(h),u=u&u;return{hash:u.toString(16),count:a.length,hasArial:a.includes("Arial"),hasTimesNewRoman:a.includes("Times New Roman"),hasSegoeUI:a.includes("Segoe UI"),hasSFPro:a.includes("SF Pro"),hasDejaVuSans:a.includes("DejaVu Sans"),supported:!0}}catch{return{supported:!1,error:!0}}}async _getSpeechInfo(){try{if(!("speechSynthesis"in window))return{supported:!1};let e=await new Promise(a=>{let l=speechSynthesis.getVoices();if(l.length>0){a(l);return}let u=setTimeout(()=>a([]),1e3);speechSynthesis.onvoiceschanged=()=>{clearTimeout(u),a(speechSynthesis.getVoices())}}),n=e.filter(a=>a.localService),o=e.find(a=>a.default),i=[...new Set(e.map(a=>a.lang))],r=e.map(a=>a.name).sort().join(","),s=0;for(let a=0;a<r.length;a++)s=(s<<5)-s+r.charCodeAt(a),s=s&s;return{hash:s.toString(16),totalVoices:e.length,localVoices:n.length,languages:i.length,defaultVoiceLang:(o==null?void 0:o.lang)||null,hasGoogleVoices:e.some(a=>a.name.includes("Google")),hasMicrosoftVoices:e.some(a=>a.name.includes("Microsoft")),hasAppleVoices:e.some(a=>a.name.includes("Samantha")||a.name.includes("Alex")),supported:!0}}catch{return{supported:!1,error:!0}}}async _getWebRTCInfo(){try{let t={supported:"RTCPeerConnection"in window,mediaDevices:{supported:!1},localIPs:[]};if(!t.supported)return t;if(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)try{let e=await navigator.mediaDevices.enumerateDevices();t.mediaDevices={supported:!0,audioInputs:e.filter(n=>n.kind==="audioinput").length,audioOutputs:e.filter(n=>n.kind==="audiooutput").length,videoInputs:e.filter(n=>n.kind==="videoinput").length,totalDevices:e.length}}catch{t.mediaDevices={supported:!1,error:!0}}try{let e=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]}),n=new Set;e.onicecandidate=o=>{if(o.candidate){let i=o.candidate.candidate,r=/([0-9]{1,3}\.){3}[0-9]{1,3}/g,s=i.match(r);s&&s.forEach(a=>{(a.startsWith("192.168.")||a.startsWith("10.")||a.startsWith("172.")||a.startsWith("169.254."))&&n.add(a)})}},e.createDataChannel(""),await e.createOffer().then(o=>e.setLocalDescription(o)),await new Promise(o=>setTimeout(o,500)),t.localIPs=Array.from(n),t.hasLocalIP=n.size>0,e.close()}catch{t.localIPError=!0}return t}catch{return{supported:!1,error:!0}}}async _checkWorkerConsistency(){try{if(typeof Worker=="undefined")return{supported:!1};let t=navigator,e=`
|
|
1
|
+
"use strict";var WebDecoyCaptchaBundle=(()=>{var H=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var ie=Object.prototype.hasOwnProperty;var re=(c,e)=>{for(var t in e)H(c,t,{get:e[t],enumerable:!0})},se=(c,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of oe(e))!ie.call(c,o)&&o!==t&&H(c,o,{get:()=>e[o],enumerable:!(n=ne(e,o))||n.enumerable});return c};var ae=c=>se(H({},"__esModule",{value:!0}),c);var ye={};re(ye,{WebDecoyCaptcha:()=>W});var E=class{constructor(){this.mousePositions=[],this.mouseVelocities=[],this.mouseAccelerations=[],this.scrollEvents=[],this.keyEvents=[],this.touchEvents=[],this.touchMultiTouchSeen=!1,this.touchIdentifiers=new Set,this.pointerPoints=[],this.focusEvents=[],this.clickData=null,this.startTime=Date.now(),this.lastMousePos=null,this.lastMouseTime=null,this.lastVelocity=null,this.eventDeltas=[]}recordMouseMove(e){let t=performance.now(),n={x:e.clientX,y:e.clientY,t};if(this.mousePositions.push(n),this.lastMousePos&&this.lastMouseTime){let o=t-this.lastMouseTime;if(o>0){let r=e.clientX-this.lastMousePos.x,i=e.clientY-this.lastMousePos.y,a=Math.sqrt(r*r+i*i)/o;if(this.mouseVelocities.push({v:a,t}),this.eventDeltas.push(o),this.lastVelocity!==null){let l=(a-this.lastVelocity)/o;this.mouseAccelerations.push({a:l,t})}this.lastVelocity=a}}this.lastMousePos={x:e.clientX,y:e.clientY},this.lastMouseTime=t,this.mousePositions.length>500&&(this.mousePositions.shift(),this.mouseVelocities.length>500&&this.mouseVelocities.shift(),this.mouseAccelerations.length>500&&this.mouseAccelerations.shift())}recordMouseDown(e){this.clickData={x:e.clientX,y:e.clientY,button:e.button,downTime:performance.now()}}recordMouseUp(e){this.clickData&&(this.clickData.upTime=performance.now(),this.clickData.holdDuration=this.clickData.upTime-this.clickData.downTime)}recordScroll(e){this.scrollEvents.push({x:window.scrollX,y:window.scrollY,t:performance.now()}),this.scrollEvents.length>100&&this.scrollEvents.shift()}recordKeyEvent(e){this.keyEvents.push({type:e.type,keyLength:e.key?e.key.length:0,t:performance.now()})}recordTouch(e){let t=e.touches&&e.touches.length?e.touches:e.changedTouches;if(!t||t.length===0)return;t.length>1&&(this.touchMultiTouchSeen=!0);let n=t[0];typeof n.identifier=="number"&&this.touchIdentifiers.add(n.identifier),this.touchEvents.push({x:n.clientX,y:n.clientY,t:performance.now(),force:typeof n.force=="number"?n.force:0,radiusX:typeof n.radiusX=="number"?n.radiusX:0,radiusY:typeof n.radiusY=="number"?n.radiusY:0,rotationAngle:typeof n.rotationAngle=="number"?n.rotationAngle:0,identifier:typeof n.identifier=="number"?n.identifier:-1,touchCount:t.length}),this.touchEvents.length>500&&this.touchEvents.shift()}recordPointer(e){this.pointerPoints.push({x:e.clientX,y:e.clientY,t:performance.now(),type:e.type,pressure:typeof e.pressure=="number"?e.pressure:0,tiltX:typeof e.tiltX=="number"?e.tiltX:0,tiltY:typeof e.tiltY=="number"?e.tiltY:0,tangentialPressure:typeof e.tangentialPressure=="number"?e.tangentialPressure:0,pointerType:e.pointerType||"unknown"}),this.pointerPoints.length>500&&this.pointerPoints.shift()}recordFocus(e){var t;this.focusEvents.push({type:e.type,target:(t=e.target)==null?void 0:t.tagName,t:performance.now()})}analyze(){let e=this.mousePositions,t=this.mouseVelocities,n=this.mouseAccelerations;if(e.length<10)return this._getEmptyAnalysis();let o=0,r=0;t.length>0&&(o=t.reduce((v,d)=>v+d.v,0)/t.length,r=t.reduce((v,d)=>v+Math.pow(d.v-o,2),0)/t.length);let i=0,s=0;if(n.length>0){i=n.reduce((m,v)=>m+v.a,0)/n.length;for(let m=1;m<n.length;m++)Math.sign(n[m].a)!==Math.sign(n[m-1].a)&&s++}let a=this._detectMicroTremor(e),l=this._calculateStraightLineRatio(e),u=0;for(let m=1;m<e.length;m++){let v=Math.abs(e[m].x-e[m-1].x),d=Math.abs(e[m].y-e[m-1].y);v<3&&d<3&&(v>0||d>0)&&u++}let h=this._countDirectionChanges(e),f=this._variance(this.eventDeltas),g=e.length>1?e.length/((e[e.length-1].t-e[0].t)/1e3):0,w=0;for(let m=1;m<e.length;m++){let v=e[m].x-e[m-1].x,d=e[m].y-e[m-1].y;w+=Math.sqrt(v*v+d*d)}let _=this._analyzeTouchPoints(this.touchEvents),S=this._analyzePointerPoints(this.pointerPoints);return{totalPoints:e.length,trajectoryLength:w,avgVelocity:o,velocityVariance:r,avgAcceleration:i,accelerationChanges:s,microTremorScore:a,straightLineRatio:l,microMovements:u,directionChanges:h,eventDeltas:this.eventDeltas.slice(-50),eventDeltaVariance:f,mouseEventRate:g,scrollEvents:this.scrollEvents.length,keyEvents:this.keyEvents.length,touchEvents:this.touchEvents.length,focusEvents:this.focusEvents.length,clickData:this.clickData,interactionDuration:Date.now()-this.startTime,..._,...S}}_analyzeTouchPoints(e){if(!e||e.length===0)return{touchTotalPoints:0,touchTrajectoryLength:0,touchAvgVelocity:0,touchVelocityVariance:0,touchMicroTremorScore:0,touchStraightLineRatio:0,touchDirectionChanges:0,touchForceMin:0,touchForceMax:0,touchForceVariance:0,touchRadiusMin:0,touchRadiusMax:0,touchRadiusVariance:0,touchMultiTouchSeen:this.touchMultiTouchSeen,touchUniqueIdentifiers:this.touchIdentifiers.size,touchForceAllZero:!1,touchForceAllOne:!1};let t=0,n=[];for(let l=1;l<e.length;l++){let u=e[l].x-e[l-1].x,h=e[l].y-e[l-1].y,f=Math.sqrt(u*u+h*h);t+=f;let g=e[l].t-e[l-1].t;g>0&&n.push(f/g)}let o=n.length>0?n.reduce((l,u)=>l+u,0)/n.length:0,r=e.map(l=>l.force),i=e.map(l=>Math.max(l.radiusX||0,l.radiusY||0)),s=r.length>0&&r.every(l=>l===0),a=r.length>0&&r.every(l=>l===1);return{touchTotalPoints:e.length,touchTrajectoryLength:t,touchAvgVelocity:o,touchVelocityVariance:this._variance(n),touchMicroTremorScore:this._detectMicroTremor(e),touchStraightLineRatio:this._calculateStraightLineRatio(e),touchDirectionChanges:this._countDirectionChanges(e),touchForceMin:r.length>0?Math.min(...r):0,touchForceMax:r.length>0?Math.max(...r):0,touchForceVariance:this._variance(r),touchRadiusMin:i.length>0?Math.min(...i):0,touchRadiusMax:i.length>0?Math.max(...i):0,touchRadiusVariance:this._variance(i),touchMultiTouchSeen:this.touchMultiTouchSeen,touchUniqueIdentifiers:this.touchIdentifiers.size,touchForceAllZero:s,touchForceAllOne:a}}_analyzePointerPoints(e){if(!e||e.length===0)return{pointerEvents:0,pointerAvgPressure:0,pointerPressureVariance:0,pointerMaxTilt:0,pointerHasNonMouseType:!1,pointerTypes:[]};let t=e.map(i=>i.pressure),n=t.length>0?t.reduce((i,s)=>i+s,0)/t.length:0,o=0,r=new Set;for(let i of e){let s=Math.abs(i.tiltX||0)+Math.abs(i.tiltY||0);s>o&&(o=s),i.pointerType&&r.add(i.pointerType)}return{pointerEvents:e.length,pointerAvgPressure:n,pointerPressureVariance:this._variance(t),pointerMaxTilt:o,pointerHasNonMouseType:Array.from(r).some(i=>i!=="mouse"&&i!=="unknown"),pointerTypes:Array.from(r)}}analyzeClick(e,t,n){let o=this.mousePositions;if(o.length<5)return this._getEmptyClickAnalysis();let r=o.slice(-20),i=n.left+n.width/2,s=n.top+n.height/2,a=Math.sqrt(Math.pow(e-i,2)+Math.pow(t-s,2)),l=0,u=0;for(let d=1;d<o.length;d++){let p=Math.sqrt(Math.pow(o[d].x-o[d-1].x,2)+Math.pow(o[d].y-o[d-1].y,2));u+=p,o[d].x>=n.left&&o[d].x<=n.right&&o[d].y>=n.top&&o[d].y<=n.bottom||(l+=p)}let h=u>0?l/u:0,f=0,g=!1,w=!1;for(let d of r){let p=d.x>=n.left&&d.x<=n.right&&d.y>=n.top&&d.y<=n.bottom;g&&!p&&(w=!0),w&&p&&(f++,w=!1),g=p}let _=0;for(let d=r.length-1;d>=0;d--){let p=r[d],I=p.x>=n.left&&p.x<=n.right&&p.y>=n.top&&p.y<=n.bottom;if(I&&d<r.length-1)_=r[r.length-1].t-p.t;else if(!I)break}let S=Math.sqrt(Math.pow(r[r.length-1].x-r[0].x,2)+Math.pow(r[r.length-1].y-r[0].y,2)),m=0;for(let d=1;d<r.length;d++)m+=Math.sqrt(Math.pow(r[d].x-r[d-1].x,2)+Math.pow(r[d].y-r[d-1].y,2));let v=m>0?S/m:1;return{clickPrecision:a,explorationRatio:h,overshootCorrections:f,hoverTime:_,approachDirectness:v,approachPoints:r.length}}_detectMicroTremor(e){if(e.length<20)return .5;let t=5,n=0;for(let r=t;r<e.length-t;r++){let i=0,s=0;for(let l=r-t;l<=r+t;l++)i+=e[l].x,s+=e[l].y;i/=t*2+1,s/=t*2+1;let a=Math.sqrt(Math.pow(e[r].x-i,2)+Math.pow(e[r].y-s,2));n+=a}let o=n/(e.length-t*2);return Math.min(1,o/2)}_calculateStraightLineRatio(e){if(e.length<3)return 0;let t=0,n=0;for(let o=2;o<e.length;o++){let r=e[o-2],i=e[o-1],s=e[o],a=Math.atan2(i.y-r.y,i.x-r.x),l=Math.atan2(s.y-i.y,s.x-i.x),u=Math.abs(l-a);n++,u<.1&&t++}return n>0?t/n:0}_countDirectionChanges(e){let t=0;for(let n=2;n<e.length;n++){let o=Math.atan2(e[n-1].y-e[n-2].y,e[n-1].x-e[n-2].x),r=Math.atan2(e[n].y-e[n-1].y,e[n].x-e[n-1].x);Math.abs(r-o)>Math.PI/6&&t++}return t}_variance(e){if(e.length===0)return 0;let t=e.reduce((n,o)=>n+o,0)/e.length;return e.reduce((n,o)=>n+Math.pow(o-t,2),0)/e.length}_getEmptyAnalysis(){return{totalPoints:0,trajectoryLength:0,avgVelocity:0,velocityVariance:0,avgAcceleration:0,accelerationChanges:0,microTremorScore:.5,straightLineRatio:0,microMovements:0,directionChanges:0,eventDeltas:[],eventDeltaVariance:0,mouseEventRate:0,scrollEvents:this.scrollEvents.length,keyEvents:this.keyEvents.length,touchEvents:this.touchEvents.length,focusEvents:this.focusEvents.length,clickData:this.clickData,interactionDuration:Date.now()-this.startTime,...this._analyzeTouchPoints(this.touchEvents),...this._analyzePointerPoints(this.pointerPoints)}}_getEmptyClickAnalysis(){return{clickPrecision:0,explorationRatio:0,overshootCorrections:0,hoverTime:0,approachDirectness:1,approachPoints:0}}};var b=class{collect(){return{webdriver:this._detectWebdriver(),automationFlags:this._getAutomationFlags(),cdp:this._detectCDP(),playwright:this._detectPlaywright(),canvasHash:this._getCanvasHash(),webglInfo:this._getWebGLInfo(),audioInfo:this._getAudioInfo(),headlessIndicators:this._getHeadlessIndicators(),screen:this._getScreenInfo(),navigator:this._getNavigatorInfo(),jsExecutionTime:this._measureJSExecution(),mathFingerprint:this._getMathFingerprint(),errorFingerprint:this._getErrorFingerprint(),domRectFingerprint:this._getDOMRectFingerprint(),cssMediaQueries:this._getCSSMediaQueries(),permissionsInfo:this._getPermissionsInfo(),fontsInfo:this._getFontsInfo(),lieDetection:this._getLieDetection()}}async collectAsync(){let[e,t,n]=await Promise.all([this._getSpeechInfo(),this._getWebRTCInfo(),this._checkWorkerConsistency()]);return{speechInfo:e,webrtcInfo:t,workerConsistency:n}}_detectWebdriver(){let e=navigator,t=window;return!!(e.webdriver||t.document.__webdriver_evaluate||t.document.__selenium_evaluate||t.document.__webdriver_script_fn||t.document.__webdriver_script_func||t.document.__webdriver_script_function||t.document.$cdc_asdjflasutopfhvcZLmcfl_||t.document.$wdc_||t._Selenium_IDE_Recorder||t._phantom||t.__nightmare||t.callPhantom||t._phantom)}_getAutomationFlags(){let e=navigator,t=window;return{webdriver:!!e.webdriver,domAutomation:!!t.domAutomation,domAutomationController:!!t.domAutomationController,_selenium:!!t._selenium,__webdriver_script_fn:!!t.__webdriver_script_fn,__driver_evaluate:!!t.__driver_evaluate,__webdriver_evaluate:!!t.__webdriver_evaluate,__fxdriver_evaluate:!!t.__fxdriver_evaluate,__driver_unwrapped:!!t.__driver_unwrapped,__webdriver_unwrapped:!!t.__webdriver_unwrapped,__fxdriver_unwrapped:!!t.__fxdriver_unwrapped,_Selenium_IDE_Recorder:!!t._Selenium_IDE_Recorder,calledSelenium:!!t.calledSelenium,$chrome_asyncScriptInfo:!!t.$chrome_asyncScriptInfo,$cdc_asdjflasutopfhvcZLmcfl_:!!t.$cdc_asdjflasutopfhvcZLmcfl_,_phantom:!!t._phantom,callPhantom:!!t.callPhantom,__nightmare:!!t.__nightmare,__lastWatirAlert:!!t.__lastWatirAlert,__lastWatirConfirm:!!t.__lastWatirConfirm,__lastWatirPrompt:!!t.__lastWatirPrompt,plugins:navigator.plugins?navigator.plugins.length:0,languages:navigator.languages&&navigator.languages.length>0,mimeTypes:navigator.mimeTypes?navigator.mimeTypes.length:0,cookieEnabled:navigator.cookieEnabled,doNotTrack:navigator.doNotTrack,chrome:!!t.chrome,chromeRuntime:!!(t.chrome&&t.chrome.runtime&&t.chrome.runtime.id),permissionsAPI:!!navigator.permissions}}_detectPlaywright(){try{let e=[];Object.getOwnPropertyNames(window).filter(r=>r.startsWith("__pw")||r.startsWith("__playwright")).length>0&&e.push("playwright_globals");let n=Object.getPrototypeOf(navigator);return Object.getOwnPropertyDescriptor(n,"webdriver")||e.push("webdriver_deleted"),{detected:e.length>0,signals:e}}catch{return{detected:!1,signals:[]}}}_detectCDP(){try{let e=[];Object.keys(window).filter(n=>n.startsWith("cdc_")).length>0&&e.push("chromedriver_cdc"),"__webdriver_evaluate"in window&&e.push("selenium_evaluate"),"__driver_evaluate"in window&&e.push("selenium_driver_evaluate"),"__webdriver_unwrapped"in window&&e.push("selenium_unwrapped"),"__driver_unwrapped"in window&&e.push("selenium_driver_unwrapped"),"__selenium_evaluate"in window&&e.push("selenium_direct"),"__fxdriver_evaluate"in window&&e.push("firefox_driver"),"__fxdriver_unwrapped"in window&&e.push("firefox_driver_unwrapped"),"__puppeteer_evaluation_script__"in window&&e.push("puppeteer_eval"),document.__webdriver_script_fn&&e.push("cdp_script_injection");try{let n=Object.getOwnPropertyDescriptor(navigator,"webdriver");n&&typeof n.get=="function"&&n.get.toString().indexOf("[native code]")===-1&&e.push("webdriver_getter_modified")}catch{}return{detected:e.length>0,signals:e}}catch{return{detected:!1,signals:[]}}}_getCanvasHash(){try{let e=document.createElement("canvas");e.width=200,e.height=50;let t=e.getContext("2d");t.textBaseline="top",t.font="14px Arial",t.fillStyle="#f60",t.fillRect(125,1,62,20),t.fillStyle="#069",t.fillText("FCaptcha",2,15),t.fillStyle="rgba(102, 204, 0, 0.7)",t.fillText("FCaptcha",4,17);let n=e.toDataURL(),o=0;for(let r=0;r<n.length;r++)o=(o<<5)-o+n.charCodeAt(r),o=o&o;return{hash:o.toString(16),dataLength:n.length,supported:!0}}catch{return{error:!0,supported:!1}}}_getWebGLInfo(){try{let e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return{supported:!1};let n=t.getExtension("WEBGL_debug_renderer_info"),o=n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):"unknown",r=n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):"unknown",i=r.toLowerCase(),s=i.includes("swiftshader")||i.includes("llvmpipe")||i.includes("softpipe")||i.includes("virtualbox")||i.includes("vmware");return{supported:!0,vendor:o,renderer:r,version:t.getParameter(t.VERSION),shadingVersion:t.getParameter(t.SHADING_LANGUAGE_VERSION),suspiciousRenderer:s}}catch{return{supported:!1,error:!0}}}_getAudioInfo(){try{let e=window,t=e.AudioContext||e.webkitAudioContext;if(!t)return{supported:!1};let n=new t,o={supported:!0,sampleRate:n.sampleRate,state:n.state,baseLatency:n.baseLatency};return n.close(),o}catch{return{supported:!1,error:!0}}}_getLieDetection(){try{let e=window,t=[],n=r=>{try{return typeof r=="function"&&r.toString().indexOf("[native code]")===-1}catch{return!1}},o=(r,i)=>{n(r)&&t.push(i)};o(Function.prototype.toString,"Function.prototype.toString"),o(navigator.permissions&&navigator.permissions.query,"navigator.permissions.query"),o(e.Notification&&e.Notification.requestPermission,"Notification.requestPermission"),o(e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype.toDataURL,"HTMLCanvasElement.toDataURL"),o(e.WebGLRenderingContext&&e.WebGLRenderingContext.prototype.getParameter,"WebGLRenderingContext.getParameter"),o(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices,"mediaDevices.enumerateDevices");try{let r=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(navigator),"webdriver")||Object.getOwnPropertyDescriptor(navigator,"webdriver");r&&typeof r.get=="function"&&r.get.toString().indexOf("[native code]")===-1&&t.push("navigator.webdriver getter")}catch{}return{supported:!0,patched:t,patchedCount:t.length}}catch{return{supported:!1}}}_getHeadlessIndicators(){let e=navigator;return{hasOuterDimensions:window.outerWidth>0&&window.outerHeight>0,innerEqualsOuter:window.innerWidth===window.outerWidth&&window.innerHeight===window.outerHeight,screenColorDepth:window.screen.colorDepth,screenPixelDepth:window.screen.pixelDepth,connectionType:e.connection?e.connection.type:"unknown",connectionRtt:e.connection?e.connection.rtt:-1,notificationPermission:typeof Notification!="undefined"?Notification.permission:"unsupported",hasBattery:"getBattery"in navigator,hasCredentials:"credentials"in navigator,hasMediaDevices:"mediaDevices"in navigator}}_getScreenInfo(){return{width:screen.width,height:screen.height,colorDepth:screen.colorDepth,pixelRatio:window.devicePixelRatio,availWidth:screen.availWidth,availHeight:screen.availHeight,innerWidth:window.innerWidth,innerHeight:window.innerHeight}}_getNavigatorInfo(){var t;let e=navigator;return{language:navigator.language,languageCount:((t=navigator.languages)==null?void 0:t.length)||0,platform:navigator.platform,hardwareConcurrency:navigator.hardwareConcurrency,deviceMemory:e.deviceMemory,maxTouchPoints:navigator.maxTouchPoints||0,vendor:navigator.vendor,userAgent:navigator.userAgent,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timezoneOffset:new Date().getTimezoneOffset()}}_measureJSExecution(){let e={},t=performance.now(),n=0;for(let i=0;i<1e3;i++)n+=Math.sqrt(i)*Math.sin(i);e.mathOps=performance.now()-t,e.mathSink=n,t=performance.now();let o=[];for(let i=0;i<1e3;i++)o.push(i);e.arrayOps=performance.now()-t,e.arrayLen=o.length,t=performance.now();let r="";for(let i=0;i<100;i++)r+="a";return e.stringOps=performance.now()-t,e.stringLen=r.length,e}async measureRAFConsistency(){return new Promise(e=>{let t=[],n=0,o=10;function r(i){if(t.push(i),n++,n<o)requestAnimationFrame(r);else{let s=[];for(let u=1;u<t.length;u++)s.push(t[u]-t[u-1]);let a=s.reduce((u,h)=>u+h,0)/s.length,l=s.reduce((u,h)=>u+Math.pow(h-a,2),0)/s.length;e({avgFrameTime:a,frameTimeVariance:l,frames:o})}}requestAnimationFrame(r)})}_getMathFingerprint(){try{let e={acos:Math.acos(.123456789),acosh:Math.acosh(1e308),asin:Math.asin(.123456789),asinh:Math.asinh(1),atanh:Math.atanh(.5),cbrt:Math.cbrt(100),cosh:Math.cosh(1),expm1:Math.expm1(1),log1p:Math.log1p(10),sinh:Math.sinh(1),tan:Math.tan(-1e308),tanh:Math.tanh(1),pow:Math.pow(Math.PI,-100),sin:Math.sin(Math.PI)},t=Object.values(e).map(o=>String(o)).join(","),n=0;for(let o=0;o<t.length;o++)n=(n<<5)-n+t.charCodeAt(o),n=n&n;return{hash:n.toString(16),sinPi:e.sin,tanLarge:e.tan,supported:!0}}catch{return{supported:!1,error:!0}}}_getErrorFingerprint(){try{let e={};try{null.foo}catch(o){e.typeError=o.message}try{[].length=-1}catch(o){e.rangeError=o.message}try{decodeURIComponent("%")}catch(o){e.uriError=o.message}try{({}).undefinedMethod()}catch(o){e.refTypeError=o.message}let t=Object.values(e).join("|"),n=0;for(let o=0;o<t.length;o++)n=(n<<5)-n+t.charCodeAt(o),n=n&n;return{hash:n.toString(16),typeError:e.typeError,supported:!0}}catch{return{supported:!1,error:!0}}}_getDOMRectFingerprint(){try{let e=document.createElement("div");e.style.cssText="position:absolute;left:-9999px;font-size:16px;font-family:Arial,sans-serif;";let t=document.createElement("span");t.textContent="FCaptcha Test String 123",e.appendChild(t);let n=document.createElement("span");n.style.cssText="letter-spacing:1px;word-spacing:2px;",n.textContent="WWWW 0000",e.appendChild(n),document.body.appendChild(e);let o=t.getBoundingClientRect(),r=n.getBoundingClientRect(),i=document.createRange();i.selectNode(t);let s=i.getBoundingClientRect();document.body.removeChild(e);let l=[o.width,o.height,o.x,o.y,r.width,r.height,s.width,s.height].map(h=>h.toFixed(6)).join(","),u=0;for(let h=0;h<l.length;h++)u=(u<<5)-u+l.charCodeAt(h),u=u&u;return{hash:u.toString(16),rectAWidth:o.width,rectBWidth:r.width,rangeWidth:s.width,supported:!0}}catch{return{supported:!1,error:!0}}}_getCSSMediaQueries(){try{return{...{prefersColorScheme:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",prefersReducedMotion:window.matchMedia("(prefers-reduced-motion: reduce)").matches,prefersReducedTransparency:window.matchMedia("(prefers-reduced-transparency: reduce)").matches,prefersContrast:window.matchMedia("(prefers-contrast: more)").matches?"more":window.matchMedia("(prefers-contrast: less)").matches?"less":"no-preference",anyHover:window.matchMedia("(any-hover: hover)").matches,anyPointer:window.matchMedia("(any-pointer: fine)").matches?"fine":window.matchMedia("(any-pointer: coarse)").matches?"coarse":"none",hover:window.matchMedia("(hover: hover)").matches,pointer:window.matchMedia("(pointer: fine)").matches?"fine":window.matchMedia("(pointer: coarse)").matches?"coarse":"none",colorGamut:window.matchMedia("(color-gamut: p3)").matches?"p3":window.matchMedia("(color-gamut: srgb)").matches?"srgb":"none",displayMode:window.matchMedia("(display-mode: standalone)").matches?"standalone":window.matchMedia("(display-mode: fullscreen)").matches?"fullscreen":"browser",orientation:window.matchMedia("(orientation: portrait)").matches?"portrait":"landscape",dynamicRange:window.matchMedia("(dynamic-range: high)").matches?"high":"standard",forcedColors:window.matchMedia("(forced-colors: active)").matches},supported:!0}}catch{return{supported:!1,error:!0}}}_getPermissionsInfo(){try{return{hasPermissionsAPI:"permissions"in navigator,hasClipboard:"clipboard"in navigator,hasShare:"share"in navigator,hasCredentials:"credentials"in navigator,hasBluetooth:"bluetooth"in navigator,hasUsb:"usb"in navigator,hasSerial:"serial"in navigator,hasHid:"hid"in navigator,hasXR:"xr"in navigator,hasGeolocation:"geolocation"in navigator,hasMIDI:"requestMIDIAccess"in navigator,supported:!0}}catch{return{supported:!1,error:!0}}}_getFontsInfo(){try{let e=["monospace","sans-serif","serif"],t=["Arial","Helvetica","Times New Roman","Courier New","Georgia","Verdana","Trebuchet MS","Comic Sans MS","Impact","Lucida Console","Menlo","Monaco","SF Pro","Helvetica Neue","Segoe UI","Consolas","Calibri","Cambria","DejaVu Sans","Liberation Sans","Ubuntu","Cantarell","MS Gothic","Meiryo","SimHei","Microsoft YaHei"],n=document.createElement("canvas");n.width=400,n.height=40;let o=n.getContext("2d"),r="mmMWWLLiiff00",i="72px",s={};for(let h of e)o.font=i+" "+h,s[h]=o.measureText(r).width;let a=[];for(let h of t){let f=!1;for(let g of e)if(o.font=i+' "'+h+'", '+g,o.measureText(r).width!==s[g]){f=!0;break}f&&a.push(h)}let l=a.join(","),u=0;for(let h=0;h<l.length;h++)u=(u<<5)-u+l.charCodeAt(h),u=u&u;return{hash:u.toString(16),count:a.length,hasArial:a.includes("Arial"),hasTimesNewRoman:a.includes("Times New Roman"),hasSegoeUI:a.includes("Segoe UI"),hasSFPro:a.includes("SF Pro"),hasDejaVuSans:a.includes("DejaVu Sans"),supported:!0}}catch{return{supported:!1,error:!0}}}async _getSpeechInfo(){try{if(!("speechSynthesis"in window))return{supported:!1};let t=await new Promise(a=>{let l=speechSynthesis.getVoices();if(l.length>0){a(l);return}let u=setTimeout(()=>a([]),1e3);speechSynthesis.onvoiceschanged=()=>{clearTimeout(u),a(speechSynthesis.getVoices())}}),n=t.filter(a=>a.localService),o=t.find(a=>a.default),r=[...new Set(t.map(a=>a.lang))],i=t.map(a=>a.name).sort().join(","),s=0;for(let a=0;a<i.length;a++)s=(s<<5)-s+i.charCodeAt(a),s=s&s;return{hash:s.toString(16),totalVoices:t.length,localVoices:n.length,languages:r.length,defaultVoiceLang:(o==null?void 0:o.lang)||null,hasGoogleVoices:t.some(a=>a.name.includes("Google")),hasMicrosoftVoices:t.some(a=>a.name.includes("Microsoft")),hasAppleVoices:t.some(a=>a.name.includes("Samantha")||a.name.includes("Alex")),supported:!0}}catch{return{supported:!1,error:!0}}}async _getWebRTCInfo(){try{let e={supported:"RTCPeerConnection"in window,mediaDevices:{supported:!1},localIPs:[]};if(!e.supported)return e;if(navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)try{let t=await navigator.mediaDevices.enumerateDevices();e.mediaDevices={supported:!0,audioInputs:t.filter(n=>n.kind==="audioinput").length,audioOutputs:t.filter(n=>n.kind==="audiooutput").length,videoInputs:t.filter(n=>n.kind==="videoinput").length,totalDevices:t.length}}catch{e.mediaDevices={supported:!1,error:!0}}try{let t=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]}),n=new Set;t.onicecandidate=o=>{if(o.candidate){let r=o.candidate.candidate,i=/([0-9]{1,3}\.){3}[0-9]{1,3}/g,s=r.match(i);s&&s.forEach(a=>{(a.startsWith("192.168.")||a.startsWith("10.")||a.startsWith("172.")||a.startsWith("169.254."))&&n.add(a)})}},t.createDataChannel(""),await t.createOffer().then(o=>t.setLocalDescription(o)),await new Promise(o=>setTimeout(o,500)),e.localIPs=Array.from(n),e.hasLocalIP=n.size>0,t.close()}catch{e.localIPError=!0}return e}catch{return{supported:!1,error:!0}}}async _checkWorkerConsistency(){try{if(typeof Worker=="undefined")return{supported:!1};let e=navigator,t=`
|
|
2
2
|
self.onmessage = function() {
|
|
3
3
|
const data = {
|
|
4
4
|
userAgent: navigator.userAgent,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
};
|
|
13
13
|
self.postMessage(data);
|
|
14
14
|
};
|
|
15
|
-
`,n=new Blob([
|
|
15
|
+
`,n=new Blob([t],{type:"application/javascript"}),o=new Worker(URL.createObjectURL(n)),r=await new Promise((a,l)=>{let u=setTimeout(()=>l(new Error("timeout")),2e3);o.onmessage=h=>{clearTimeout(u),a(h.data)},o.onerror=()=>{clearTimeout(u),l(new Error("worker error"))},o.postMessage("collect")});o.terminate();let i={userAgent:navigator.userAgent,language:navigator.language,languages:navigator.languages?Array.from(navigator.languages):[],platform:navigator.platform,hardwareConcurrency:navigator.hardwareConcurrency,deviceMemory:e.deviceMemory,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timezoneOffset:new Date().getTimezoneOffset()},s=[];return r.userAgent!==i.userAgent&&s.push("userAgent"),r.language!==i.language&&s.push("language"),r.platform!==i.platform&&s.push("platform"),r.hardwareConcurrency!==i.hardwareConcurrency&&s.push("hardwareConcurrency"),r.deviceMemory!==i.deviceMemory&&s.push("deviceMemory"),r.timezone!==i.timezone&&s.push("timezone"),r.timezoneOffset!==i.timezoneOffset&&s.push("timezoneOffset"),JSON.stringify(r.languages)!==JSON.stringify(i.languages)&&s.push("languages"),{supported:!0,consistent:s.length===0,mismatches:s,mismatchCount:s.length}}catch{return{supported:!1,error:!0}}}};var T=class{constructor(){this.motionEvents=[],this.orientationEvents=[],this._motionHandler=e=>this._recordMotion(e),this._orientationHandler=e=>this._recordOrientation(e),this._attached=!1}attach(){if(!this._attached){this._attached=!0;try{window.addEventListener("devicemotion",this._motionHandler,{passive:!0}),window.addEventListener("deviceorientation",this._orientationHandler,{passive:!0})}catch{}}}detach(){if(this._attached){this._attached=!1;try{window.removeEventListener("devicemotion",this._motionHandler),window.removeEventListener("deviceorientation",this._orientationHandler)}catch{}}}_recordMotion(e){let t=e.accelerationIncludingGravity||e.acceleration||{};this.motionEvents.push({x:typeof t.x=="number"?t.x:0,y:typeof t.y=="number"?t.y:0,z:typeof t.z=="number"?t.z:0,t:performance.now()}),this.motionEvents.length>300&&this.motionEvents.shift()}_recordOrientation(e){this.orientationEvents.push({alpha:typeof e.alpha=="number"?e.alpha:0,beta:typeof e.beta=="number"?e.beta:0,gamma:typeof e.gamma=="number"?e.gamma:0,t:performance.now()}),this.orientationEvents.length>300&&this.orientationEvents.shift()}analyze(){let e=this.motionEvents,t=this.orientationEvents,n=0,o=0;if(e.length>1){let i=e.map(s=>Math.sqrt(s.x*s.x+s.y*s.y+s.z*s.z));o=i.reduce((s,a)=>s+a,0)/i.length,n=i.reduce((s,a)=>s+(a-o)*(a-o),0)/i.length}let r=0;if(t.length>1){let i=t.map(a=>Math.abs(a.beta)+Math.abs(a.gamma)),s=i.reduce((a,l)=>a+l,0)/i.length;r=i.reduce((a,l)=>a+(l-s)*(l-s),0)/i.length}return{motionEventCount:e.length,motionAccelAvg:o,motionAccelVariance:n,orientationEventCount:t.length,orientationVariance:r,hasSensorSupport:typeof window.DeviceMotionEvent!="undefined"}}};var K=class{constructor(){this.pageLoadTime=performance.now(),this.firstInteractionTime=null,this.lastInteractionTime=null,this.totalEvents=0,this.eventLog=[],this.textareaStats=new Map,this.submitData=null,this._setupListeners()}_setupListeners(){["mousedown","keydown","touchstart","scroll"].forEach(t=>{document.addEventListener(t,n=>this._recordInteraction(n),{passive:!0})}),document.addEventListener("keydown",t=>this._recordTextareaKey(t),{passive:!0}),document.addEventListener("keyup",t=>this._recordTextareaKey(t),{passive:!0}),document.addEventListener("submit",t=>this._recordSubmit(t),{capture:!0}),this._interceptFormSubmit()}_recordInteraction(e){var n;let t=performance.now();this.firstInteractionTime===null&&(this.firstInteractionTime=t),this.lastInteractionTime=t,this.totalEvents++,this.eventLog.push({type:e.type,time:t,target:((n=e.target)==null?void 0:n.tagName)||"unknown"}),this.eventLog.length>50&&this.eventLog.shift()}_recordTextareaKey(e){let t=e.target;if((t==null?void 0:t.tagName)!=="TEXTAREA")return;let n=t.id||t.name||"unnamed";this.textareaStats.has(n)||this.textareaStats.set(n,{keydowns:[],keyups:[],intervals:[],lastKeyTime:null,inputWithoutKey:0,pasteCount:0,dwellTimes:[],rollovers:0,activeKeyCount:0,pendingKeydowns:[]});let o=this.textareaStats.get(n),r=performance.now(),i=["Shift","Control","Alt","Meta","CapsLock","NumLock","ScrollLock"].includes(e.key);if(e.type==="keydown")o.keydowns.push(r),o.lastKeyTime!==null&&o.intervals.push(r-o.lastKeyTime),o.lastKeyTime=r,!i&&!e.repeat&&(o.activeKeyCount>0&&o.rollovers++,o.activeKeyCount++,o.pendingKeydowns.push(r)),o.keydowns.length>200&&o.keydowns.shift(),o.intervals.length>200&&o.intervals.shift();else if(e.type==="keyup"&&(o.keyups.push(r),o.keyups.length>200&&o.keyups.shift(),!i&&o.activeKeyCount>0&&(o.activeKeyCount--,o.pendingKeydowns.length>0))){let s=o.pendingKeydowns.shift(),a=r-s;a>0&&a<2e3&&(o.dwellTimes.push(a),o.dwellTimes.length>100&&o.dwellTimes.shift())}}_interceptFormSubmit(){let e=n=>this._recordProgrammaticSubmit(n),t=HTMLFormElement.prototype.submit;HTMLFormElement.prototype.submit=function(...n){return e(this),t.apply(this,n)}}_recordProgrammaticSubmit(e){let t=performance.now();this.submitData={method:"programmatic",time:t,timeSincePageLoad:t-this.pageLoadTime,timeSinceFirstInteraction:this.firstInteractionTime?t-this.firstInteractionTime:null,timeSinceLastInteraction:this.lastInteractionTime?t-this.lastInteractionTime:null,eventsBeforeSubmit:this.totalEvents,hadTriggerEvent:!1}}_recordSubmit(e){let t=performance.now(),n=this.eventLog.slice(-5),o=n.find(s=>s.type==="keydown"&&t-s.time<100),r=n.find(s=>s.type==="mousedown"&&t-s.time<100),i="unknown";o?i="keyboard":r?i="mouse":this.submitData||(i="programmatic_click"),(!this.submitData||this.submitData.method==="programmatic")&&(this.submitData={method:i,time:t,timeSincePageLoad:t-this.pageLoadTime,timeSinceFirstInteraction:this.firstInteractionTime?t-this.firstInteractionTime:null,timeSinceLastInteraction:this.lastInteractionTime?t-this.lastInteractionTime:null,eventsBeforeSubmit:this.totalEvents,hadTriggerEvent:i==="keyboard"||i==="mouse"})}analyze(){let e=performance.now(),t={};return this.textareaStats.forEach((o,r)=>{let i=o.intervals,s=0,a=0;i.length>0&&(s=i.reduce((l,u)=>l+u,0)/i.length,a=i.reduce((l,u)=>l+Math.pow(u-s,2),0)/i.length),t[r]={keyCount:o.keydowns.length,avgKeyInterval:s,keyIntervalVariance:a,keydownUpRatio:o.keyups.length>0?o.keydowns.length/o.keyups.length:0,pasteCount:o.pasteCount,intervals:o.intervals.slice(-100),dwellTimes:o.dwellTimes.slice(-100),rollovers:o.rollovers}}),document.querySelectorAll("textarea").forEach(o=>{let r=o.id||o.name||"unnamed",i=(o.value||"").length;i>0&&(t[r]?(t[r].contentLength=i,t[r].noKeyboardEvents=t[r].keyCount===0):t[r]={keyCount:0,avgKeyInterval:0,keyIntervalVariance:0,keydownUpRatio:0,pasteCount:0,contentLength:i,noKeyboardEvents:!0})}),{pageLoadToFirstInteraction:this.firstInteractionTime?this.firstInteractionTime-this.pageLoadTime:null,pageLoadToNow:e-this.pageLoadTime,totalInteractionEvents:this.totalEvents,submit:this.submitData||{method:"none",eventsBeforeSubmit:this.totalEvents,hadTriggerEvent:!1},textareaKeyboard:Object.keys(t).length>0?t:null}}recordPaste(e){let t=e.target;if((t==null?void 0:t.tagName)!=="TEXTAREA")return;let n=t.id||t.name||"unnamed";this.textareaStats.has(n)&&this.textareaStats.get(n).pasteCount++}},O=null;function P(){return O||(O=new K,document.addEventListener("paste",c=>O.recordPaste(c),{passive:!0})),O}typeof document!="undefined"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>P()):P());async function M(c){let e=new TextEncoder().encode(c),t=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map(n=>n.toString(16).padStart(2,"0")).join("")}var C=class{constructor(){this.firstInteractionTime=null;this.powResult=null;this.pageLoadTime=performance.now()}recordFirstInteraction(){this.firstInteractionTime||(this.firstInteractionTime=performance.now())}async performProofOfWork(e=4){let t=`${Date.now()}:${Math.random().toString(36).slice(2)}`,n="0".repeat(e),o=performance.now(),r=0,i=0;for(;;){let s=await M(`${t}:${r}`);if(i++,s.startsWith(n))return this.powResult={prefix:t,nonce:r,hash:s,iterations:i,duration:performance.now()-o,difficulty:e},this.powResult;r++,i%1e3===0&&await new Promise(a=>setTimeout(a,0))}}collect(e){let t={};if(performance.timing){let n=performance.timing;t.dnsLookup=n.domainLookupEnd-n.domainLookupStart,t.tcpConnection=n.connectEnd-n.connectStart,t.serverResponse=n.responseEnd-n.requestStart,t.domLoad=n.domContentLoadedEventEnd-n.navigationStart,t.fullLoad=n.loadEventEnd-n.navigationStart}return{pageLoadToFirstInteraction:this.firstInteractionTime?this.firstInteractionTime-this.pageLoadTime:null,firstInteractionToClick:this.firstInteractionTime&&e?e-this.firstInteractionTime:null,totalSessionTime:performance.now()-this.pageLoadTime,performanceTiming:t,pow:this.powResult}}};var N=null,j="/__webdecoy";function x(){return N}function F(c){N=c}function L(){return j}function B(c){j=c.replace(/\/$/,"")}var R=class{constructor(){this.workers=[];this.challenge=null;this.solution=null;this.solving=!1;this.solvePromise=null;this.startTime=null}_createWorker(){let e=`
|
|
16
16
|
async function sha256(message) {
|
|
17
17
|
const msgBuffer = new TextEncoder().encode(message);
|
|
18
18
|
const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer);
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
`,
|
|
58
|
-
<div class="webdecoy-widget ${
|
|
57
|
+
`,t=new Blob([e],{type:"application/javascript"});return new Worker(URL.createObjectURL(t))}_threadCount(){let e=typeof navigator!="undefined"&&navigator.hardwareConcurrency||1;return Math.max(1,Math.floor(e/2))}_terminateWorkers(){for(let e of this.workers)try{e.terminate()}catch{}this.workers=[]}async fetchChallenge(e){let t=x();if(!t)return this._generateLocalChallenge();try{let n=await fetch(`${t}${L()}/challenge?siteKey=${encodeURIComponent(e||"default")}`);return n.ok?(this.challenge=await n.json(),this.challenge):(console.warn(`PoW challenge fetch failed (status ${n.status}), using local challenge`),this._generateLocalChallenge())}catch(n){return console.warn("PoW challenge fetch failed, using local challenge:",n),this._generateLocalChallenge()}}_generateLocalChallenge(){let e=Math.random().toString(36).slice(2)+Date.now().toString(36);return this.challenge={challengeId:e,prefix:`${e}:${Date.now()}:4`,difficulty:4,expiresAt:Date.now()+3e5,local:!0},this.challenge}async startSolving(e){return this._solve(e,null)}async solveWithSignalsHash(e,t){return this._solve(e,t)}async _solve(e,t){if(this.solving&&this.solvePromise)return this.solvePromise;this.challenge||await this.fetchChallenge(e);let n=this.challenge;return this.solving=!0,this.startTime=performance.now(),this.solvePromise=new Promise((o,r)=>{let i=this._threadCount(),s=!1,a=(l,u)=>{s||(s=!0,this.solving=!1,this._terminateWorkers(),l(u))};for(let l=0;l<i;l++){let u=this._createWorker();u.onmessage=h=>{h.data.found&&(this.solution={challengeId:n.challengeId,nonce:h.data.nonce,hash:h.data.hash,iterations:h.data.iterations,duration:h.data.duration,difficulty:n.difficulty,signalsHash:t||null,local:n.local||!1},a(o,this.solution))},u.onerror=h=>{a(r,h)},u.postMessage({prefix:n.prefix,difficulty:n.difficulty,signalsHash:t||null,startNonce:l,stride:i,batchSize:5e3}),this.workers.push(u)}}),this.solvePromise}async getSolution(e){return this.solution?this.solution:this.solving&&this.solvePromise?this.solvePromise:this.startSolving(e)}reset(){this._terminateWorkers(),this.challenge=null,this.solution=null,this.solving=!1,this.solvePromise=null}},z=null;function $(){return z||(z=new R),z}var D=class{constructor(e,t){this.token=null;this.verified=!1;let n=typeof e=="string"?document.getElementById(e):e;if(!n)throw new Error("WebDecoy captcha: container element not found");this.container=n,this.options=Object.assign({siteKey:null,theme:"light",size:"normal",callback:null,errorCallback:null,expiredCallback:null,powDifficulty:4},t),this.id="webdecoy_"+Math.random().toString(36).slice(2,11),this.behavioral=new E,this.environmental=new b,this.temporal=new C,this.sensor=new T,this.powManager=$(),this._init()}_init(){this._createWidget(),this._attachListeners(),this._fetchChallenge()}async _fetchChallenge(){try{await this.powManager.fetchChallenge(this.options.siteKey)}catch(e){console.warn("PoW challenge fetch failed:",e)}}_createWidget(){let e=this.options.theme==="dark";this.container.innerHTML=`
|
|
58
|
+
<div class="webdecoy-widget ${e?"webdecoy-dark":""}" id="${this.id}">
|
|
59
59
|
<style>
|
|
60
60
|
.webdecoy-widget {
|
|
61
61
|
font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
|
|
62
|
-
background: ${
|
|
63
|
-
border: 1px solid ${
|
|
62
|
+
background: ${e?"#1e1e1e":"#fafafa"};
|
|
63
|
+
border: 1px solid ${e?"#424242":"#d3d3d3"};
|
|
64
64
|
border-radius: 6px;
|
|
65
65
|
padding: 12px 16px;
|
|
66
66
|
display: inline-flex;
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
}
|
|
73
73
|
.webdecoy-checkbox {
|
|
74
74
|
width: 24px; height: 24px;
|
|
75
|
-
border: 2px solid ${
|
|
75
|
+
border: 2px solid ${e?"#555":"#c1c1c1"};
|
|
76
76
|
border-radius: 4px; cursor: pointer;
|
|
77
77
|
display: flex; align-items: center; justify-content: center;
|
|
78
|
-
background: ${
|
|
78
|
+
background: ${e?"#252525":"#fff"};
|
|
79
79
|
transition: all 0.15s ease; flex-shrink: 0;
|
|
80
80
|
}
|
|
81
81
|
.webdecoy-checkbox:hover { border-color: #00bcd4; }
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
.webdecoy-checkbox.failed { background: #f44336; border-color: #f44336; }
|
|
85
85
|
.webdecoy-spinner {
|
|
86
86
|
width: 16px; height: 16px;
|
|
87
|
-
border: 2px solid ${
|
|
87
|
+
border: 2px solid ${e?"#555":"#e0e0e0"};
|
|
88
88
|
border-top-color: #00bcd4; border-radius: 50%;
|
|
89
89
|
animation: webdecoy-spin 0.8s linear infinite;
|
|
90
90
|
}
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
.webdecoy-checkbox.verified .webdecoy-checkmark { display: block; }
|
|
94
94
|
.webdecoy-x { display: none; color: white; font-size: 14px; font-weight: bold; }
|
|
95
95
|
.webdecoy-checkbox.failed .webdecoy-x { display: block; }
|
|
96
|
-
.webdecoy-label { color: ${
|
|
96
|
+
.webdecoy-label { color: ${e?"#e0e0e0":"#555"}; font-size: 14px; flex-grow: 1; }
|
|
97
97
|
.webdecoy-branding { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
|
|
98
98
|
.webdecoy-brand { font-size: 11px; font-weight: 600; color: #ff2a6d; letter-spacing: 0.5px; }
|
|
99
99
|
</style>
|
|
@@ -107,4 +107,4 @@
|
|
|
107
107
|
<span class="webdecoy-brand">WebDecoy</span>
|
|
108
108
|
</div>
|
|
109
109
|
</div>
|
|
110
|
-
`,this.checkbox=this.container.querySelector(".webdecoy-checkbox"),this.spinner=this.container.querySelector(".webdecoy-spinner"),this.label=this.container.querySelector(".webdecoy-label")}_attachListeners(){document.addEventListener("mousemove",e=>this.behavioral.recordMouseMove(e),{passive:!0}),document.addEventListener("mousedown",e=>this.behavioral.recordMouseDown(e),{passive:!0}),document.addEventListener("mouseup",e=>this.behavioral.recordMouseUp(e),{passive:!0}),document.addEventListener("scroll",e=>this.behavioral.recordScroll(e),{passive:!0}),document.addEventListener("keydown",e=>this.behavioral.recordKeyEvent(e),{passive:!0}),document.addEventListener("keyup",e=>this.behavioral.recordKeyEvent(e),{passive:!0}),document.addEventListener("touchstart",e=>this.behavioral.recordTouch(e),{passive:!0}),document.addEventListener("touchmove",e=>this.behavioral.recordTouch(e),{passive:!0}),document.addEventListener("pointermove",e=>this.behavioral.recordPointer(e),{passive:!0}),document.addEventListener("pointerdown",e=>this.behavioral.recordPointer(e),{passive:!0}),document.addEventListener("pointerup",e=>this.behavioral.recordPointer(e),{passive:!0}),document.addEventListener("focus",e=>this.behavioral.recordFocus(e),{passive:!0,capture:!0}),document.addEventListener("blur",e=>this.behavioral.recordFocus(e),{passive:!0,capture:!0}),this.sensor.attach();let t=()=>this.temporal.recordFirstInteraction();document.addEventListener("mousemove",t,{once:!0}),document.addEventListener("touchstart",t,{once:!0}),document.addEventListener("keydown",t,{once:!0}),this.checkbox.addEventListener("click",e=>{this._handleClick(e)}),this.checkbox.addEventListener("keydown",e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this._handleClick(e))})}async _handleClick(t){var o,i,r;if(this.verified||this.checkbox.classList.contains("loading"))return;let e=performance.now(),n=this.checkbox.getBoundingClientRect();this.checkbox.classList.add("loading"),this.spinner.style.display="block",this.label.textContent="Verifying...";try{let s=this.behavioral.analyze(),a="clientX"in t?t.clientX:n.left,l="clientY"in t?t.clientY:n.top,u=this.behavioral.analyzeClick(a,l,n),h=this.environmental.collect(),[f,g]=await Promise.all([this.environmental.measureRAFConsistency(),this.environmental.collectAsync()]),w=this.temporal.collect(e),_=P().analyze(),S=this.sensor.analyze(),m={behavioral:{...s,...u},environmental:{...h,rafConsistency:f,...g,sensor:S},temporal:w,formAnalysis:_,meta:{widgetId:this.id,siteKey:this.options.siteKey,challengeNonce:((o=this.powManager.challenge)==null?void 0:o.nonce)||null,timestamp:Date.now(),userAgent:navigator.userAgent,screenSize:`${screen.width}x${screen.height}`,viewportSize:`${window.innerWidth}x${window.innerHeight}`,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}},v=JSON.stringify(m),d=await M(v),p=await this.powManager.solveWithSignalsHash(this.options.siteKey,d),I={duration:p.duration,iterations:p.iterations,difficulty:p.difficulty},V=await this._verify(m,p,v,d,I);V.success?this._showSuccess((i=V.token)!=null?i:""):this._showFailure((r=V.message)!=null?r:void 0)}catch(s){console.error("WebDecoy captcha error:",s),this._showFailure("Verification failed. Please try again.")}}async _verify(t,e,n,o,i){let r=x();if(!r)return this._clientSideVerify(t);try{return await(await fetch(r+L()+"/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteKey:this.options.siteKey,signals:t,signalsJson:n||null,powSolution:e?{challengeId:e.challengeId,nonce:e.nonce,hash:e.hash,signalsHash:o||null}:null,powTiming:i||null})})).json()}catch{return console.warn("Server unavailable, using client-side verification"),this._clientSideVerify(t)}}_clientSideVerify(t){let e=0,n=t.behavioral,o=t.environmental,i=t.temporal,r=(n.touchEvents||0)>=3,s=(n.keyEvents||0)>0&&n.totalPoints===0;n.totalPoints<5&&n.trajectoryLength<10&&!r&&!s?e+=.35:n.totalPoints<10&&!r&&!s&&n.trajectoryLength<30&&(e+=.15),n.microTremorScore<.2&&(e+=.12),n.velocityVariance<.03&&(e+=.1),n.explorationRatio<.05&&(e+=.08),n.overshootCorrections===0&&n.trajectoryLength>100&&(e+=.05),n.clickPrecision<2&&(e+=.05),n.straightLineRatio>.8&&(e+=.08),n.microMovements<5&&n.totalPoints>50&&(e+=.06),o.webdriver&&(e+=.25),o.automationFlags&&o.automationFlags.plugins===0&&(e+=.05),o.webglInfo&&o.webglInfo.suspiciousRenderer&&(e+=.1),o.headlessIndicators&&!o.headlessIndicators.hasOuterDimensions&&(e+=.12),o.headlessIndicators&&o.headlessIndicators.innerEqualsOuter&&(e+=.05),i.pow&&i.pow.duration<50&&(e+=.1),n.eventDeltaVariance<3&&(e+=.08),n.interactionDuration<300&&(e+=.07);let a=e<.5;return{success:a,score:e,token:a?btoa(JSON.stringify({timestamp:Date.now(),score:e,id:this.id})):null,message:a?null:"Verification failed"}}_showSuccess(t){this.verified=!0,this.token=t,this.checkbox.classList.remove("loading"),this.checkbox.classList.add("verified"),this.checkbox.setAttribute("aria-checked","true"),this.spinner.style.display="none",this.label.textContent="Verified",this.options.callback&&this.options.callback(t),this.container.dispatchEvent(new CustomEvent("webdecoy:verified",{detail:{token:t}}))}_showFailure(t){this.checkbox.classList.remove("loading"),this.checkbox.classList.add("failed"),this.spinner.style.display="none",this.label.textContent=t||"Verification failed",this.options.errorCallback&&this.options.errorCallback(t),setTimeout(()=>{this.checkbox.classList.remove("failed"),this.label.textContent="I'm not a robot"},3e3)}getToken(){return this.token}reset(){this.verified=!1,this.token=null,this.behavioral=new E,this.temporal=new C,this.sensor&&this.sensor.detach(),this.sensor=new T,this.sensor.attach(),this.powManager.reset(),this.checkbox.classList.remove("verified","failed","loading"),this.checkbox.setAttribute("aria-checked","false"),this.spinner.style.display="none",this.label.textContent="I'm not a robot",this._fetchChallenge()}};var A=class{constructor(t){this.lastScore=null;this.listeners=[];this.options=Object.assign({siteKey:null,serverUrl:null,minCollectionTime:2e3,autoScore:!0,scoreThreshold:.5,powDifficulty:3},t),this.id="webdecoy_inv_"+Math.random().toString(36).slice(2,11),this.behavioral=new E,this.environmental=new b,this.temporal=new C,this.sensor=new T,this.powManager=new R,this.startTime=Date.now(),this._init()}_init(){this._attachListeners();let t=()=>this.temporal.recordFirstInteraction();document.addEventListener("mousemove",t,{once:!0}),document.addEventListener("touchstart",t,{once:!0}),document.addEventListener("keydown",t,{once:!0}),document.addEventListener("scroll",t,{once:!0}),this.options.autoScore&&this._attachToForms(),this._fetchChallenge()}async _fetchChallenge(){try{await this.powManager.fetchChallenge(this.options.siteKey)}catch(t){console.warn("PoW challenge fetch failed:",t)}}_attachListeners(){let t={mousemove:e=>this.behavioral.recordMouseMove(e),mousedown:e=>this.behavioral.recordMouseDown(e),mouseup:e=>this.behavioral.recordMouseUp(e),scroll:e=>this.behavioral.recordScroll(e),keydown:e=>this.behavioral.recordKeyEvent(e),keyup:e=>this.behavioral.recordKeyEvent(e),touchmove:e=>this.behavioral.recordTouch(e),touchstart:e=>this.behavioral.recordTouch(e),pointermove:e=>this.behavioral.recordPointer(e),pointerdown:e=>this.behavioral.recordPointer(e),pointerup:e=>this.behavioral.recordPointer(e),focus:e=>this.behavioral.recordFocus(e),blur:e=>this.behavioral.recordFocus(e)};for(let[e,n]of Object.entries(t)){let o=e==="focus"||e==="blur"?{passive:!0,capture:!0}:{passive:!0};document.addEventListener(e,n,o),this.listeners.push({event:e,handler:n,opts:o})}this.sensor.attach()}_attachToForms(){document.addEventListener("submit",async t=>{let e=t.target;if(e.dataset.webdecoyIgnore)return;let n=e.querySelector('input[name="webdecoy_token"]');if(n||(n=document.createElement("input"),n.type="hidden",n.name="webdecoy_token",e.appendChild(n)),!this.lastScore||Date.now()-this.lastScore.timestamp>6e4){t.preventDefault();try{let o=await this.execute(e.dataset.webdecoyAction||"form_submit");n.value=o.token||"",o.success?e.submit():document.dispatchEvent(new CustomEvent("webdecoy:blocked",{detail:{score:o.score,form:e}}))}catch(o){console.error("WebDecoy captcha error:",o),e.submit()}}else n.value=this.lastScore.token||""})}async execute(t=""){var S;let e=Date.now()-this.startTime;e<this.options.minCollectionTime&&await new Promise(m=>setTimeout(m,this.options.minCollectionTime-e));let n=this.behavioral.analyze(),o=this.environmental.collect(),i=this.temporal.collect(Date.now()),[r,s]=await Promise.all([this.environmental.measureRAFConsistency(),this.environmental.collectAsync()]),a=P().analyze(),l=this.sensor.analyze(),u={behavioral:n,environmental:{...o,rafConsistency:r,...s,sensor:l},temporal:i,formAnalysis:a,meta:{sessionId:this.id,siteKey:this.options.siteKey,action:t,challengeNonce:((S=this.powManager.challenge)==null?void 0:S.nonce)||null,timestamp:Date.now(),userAgent:navigator.userAgent,screenSize:`${screen.width}x${screen.height}`,viewportSize:`${window.innerWidth}x${window.innerHeight}`,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,sessionDuration:Date.now()-this.startTime,invisible:!0}},h=JSON.stringify(u),f=await M(h),g=await this.powManager.solveWithSignalsHash(this.options.siteKey,f),w={duration:g.duration,iterations:g.iterations,difficulty:g.difficulty},_=await this._score(u,t,g,h,f,w);return this.lastScore={..._,timestamp:Date.now()},_}async _score(t,e,n,o,i,r){let s=this.options.serverUrl||x();if(!s)return this._clientSideScore(t);try{return await(await fetch(s+L()+"/score",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteKey:this.options.siteKey,signals:t,signalsJson:o||null,action:e,powSolution:n?{challengeId:n.challengeId,nonce:n.nonce,hash:n.hash,signalsHash:i||null}:null,powTiming:r||null})})).json()}catch{return console.warn("WebDecoy server unavailable, using client-side scoring"),this._clientSideScore(t)}}_clientSideScore(t){let e=0,n=t.behavioral,o=t.environmental,i=t.temporal,r=t.meta,s=(n.touchEvents||0)>=3,a=(n.keyEvents||0)>0&&n.totalPoints===0;n.totalPoints<5&&n.trajectoryLength<10&&!s&&!a?e+=.35:n.totalPoints<10&&!s&&!a&&n.trajectoryLength<30&&(e+=.15),n.microTremorScore<.2&&(e+=.12),n.velocityVariance<.03&&(e+=.1),n.totalPoints<10&&r.sessionDuration>5e3&&(e+=.08),n.scrollEvents===0&&n.keyEvents===0&&r.sessionDuration>1e4&&(e+=.06),n.eventDeltaVariance<3&&(e+=.08),n.straightLineRatio>.8&&(e+=.08),o.webdriver&&(e+=.25),o.automationFlags&&o.automationFlags.plugins===0&&(e+=.06),o.headlessIndicators&&!o.headlessIndicators.hasOuterDimensions&&(e+=.12),o.webglInfo&&o.webglInfo.suspiciousRenderer&&(e+=.1),i.pow&&i.pow.duration<30&&(e+=.1),r.sessionDuration<500&&(e+=.12),r.sessionDuration<1e3&&n.totalPoints<5&&(e+=.15);let l=e<this.options.scoreThreshold;return{success:l,score:Math.min(1,e),action:r.action,token:l?btoa(JSON.stringify({timestamp:Date.now(),score:e,action:r.action,id:this.id})):null}}getScore(){return this.lastScore}destroy(){for(let{event:t,handler:e,opts:n}of this.listeners)document.removeEventListener(t,e,n);this.listeners=[],this.powManager&&this.powManager.reset()}};var W={widgets:new Map,get serverUrl(){return x()},set serverUrl(c){F(c)},configure(c){c.serverUrl&&F(c.serverUrl),c.basePath&&B(c.basePath)},render(c,t){let e=new D(c,t);return this.widgets.set(e.id,e),e.id},getResponse(c){let t=this.widgets.get(c);return t&&t instanceof D?t.getToken():null},reset(c){let t=this.widgets.get(c);t instanceof D&&t.reset()},invisible(c){let t=new A(c);return this.widgets.set(t.id,t),t},async execute(c,t={}){let e=new A({siteKey:c,serverUrl:x(),minCollectionTime:t.minTime||1e3,autoScore:!1,powDifficulty:t.powDifficulty||3}),n=await e.execute(t.action||"");return e.destroy(),n},getSignals(){return{environmental:new b().collect()}},autoInit(){document.querySelectorAll("[data-webdecoy]").forEach(c=>{let t=c.dataset.sitekey||c.dataset.webdecoy,e=c.dataset.theme||"light",n=c.dataset.endpoint,o=c.dataset.callback,i=o?window[o]:void 0;n&&F(n),this.render(c,{siteKey:t,theme:e,callback:i!=null?i:null})})}};var ce=24,le=8,ue=750,he=1500;function y(c){return typeof c=="number"&&Number.isFinite(c)?c:0}function q(c){let t=c.mousePositions;return!t||t.length<2?0:Math.max(0,Math.round(t[t.length-1].t-t[0].t))}function X(c){let t=c.mousePositions.length>=ce&&q(c)>=ue,e=c.touchEvents.length>=le;return t||e}function de(c){if(!X(c))return null;let t=c.analyze(),e=c.clickData;return{samples:y(t.totalPoints),duration_ms:q(c),tremor:y(t.microTremorScore),straight_ratio:y(t.straightLineRatio),velocity_var:y(t.velocityVariance),delta_var:y(t.eventDeltaVariance),dir_changes:y(t.directionChanges),micro_moves:y(t.microMovements),hold_ms:y(e==null?void 0:e.holdDuration),touch_points:y(t.touchTotalPoints),touch_force_var:y(t.touchForceVariance),pointer_nonmouse:t.pointerHasNonMouseType===!0,scrolls:y(t.scrollEvents),keys:y(t.keyEvents)}}function Y(c){if(typeof document=="undefined")return()=>{};let t=new E,e=null,n=!1,o={mousemove:s=>t.recordMouseMove(s),mousedown:s=>t.recordMouseDown(s),mouseup:s=>t.recordMouseUp(s),scroll:s=>t.recordScroll(s),keydown:s=>t.recordKeyEvent(s),touchstart:s=>t.recordTouch(s),touchmove:s=>t.recordTouch(s),pointerdown:s=>t.recordPointer(s)},i=()=>{if(!n){n=!0,e&&clearTimeout(e);for(let[s,a]of Object.entries(o))document.removeEventListener(s,a)}},r=()=>{n||e||X(t)&&(e=setTimeout(()=>{e=null;let s=de(t);i(),s&&c(s)},he))};for(let[s,a]of Object.entries(o)){let l=u=>{a(u),r()};o[s]=l,document.addEventListener(s,l,{passive:!0})}return i}var J="wd_clearance",me="wdfp1",ge="https://ingest.webdecoy.com";async function Z(c){let t=c.canvasHash,e=t&&t.supported?String(t.hash):"na",n=c.webglInfo,o=n&&n.supported?String(n.renderer)+"~"+String(n.vendor):"na",i=`${screen.width}x${screen.height}x${screen.colorDepth}`,r="na";try{r=Intl.DateTimeFormat().resolvedOptions().timeZone||"na"}catch{}let s=navigator.platform||"na",a=navigator.language||"na";return M([me,e,o,i,r,s,a].join("|"))}async function Q(c,t,e,n,o){try{let r=await(await fetch(c.replace(/\/$/,"")+"/api/v1/clearance",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({aid:t,fp:e,scope:n,ua:navigator.userAgent,webdriver:navigator.webdriver===!0,headless:/HeadlessChrome/.test(navigator.userAgent),...o?{behavior:o}:{}})})).json();if(r.granted&&r.token)return{token:r.token,expiresIn:r.expires_in||1800}}catch{}return null}function pe(c){for(let t of document.cookie.split(";")){let e=t.indexOf("=");if(!(e<0)&&t.slice(0,e).trim()===c)return t.slice(e+1).trim()||null}return null}function ee(c,t){document.cookie=`${J}=${c}; path=/; secure; samesite=lax; max-age=${t}`}function ve(c){let t=window.requestIdleCallback;typeof t=="function"?t(c):setTimeout(c,1200)}var G=!1;function fe(c,t,e){G||(G=!0,Y(n=>{(async()=>{try{let o=new b,i=await Z({canvasHash:o._getCanvasHash(),webglInfo:o._getWebGLInfo()}),r=await Q(c,t,i,e,n);r&&ee(r.token,r.expiresIn)}catch{}})()}))}function U(c){if(!c.siteKey||typeof document=="undefined")return;let t=c.ingestUrl||ge,e=c.scope||"",n=async()=>{if(pe(J))return;let o=new b,i=await Z({canvasHash:o._getCanvasHash(),webglInfo:o._getWebGLInfo()}),r=await Q(t,c.siteKey,i,e);if(r){ee(r.token,r.expiresIn);let s=Math.max(6e4,(r.expiresIn-120)*1e3);setTimeout(()=>U(c),s)}};ve(()=>{n()}),c.behavior!==!1&&fe(t,c.siteKey,e)}var k=document.currentScript;window.WebDecoyCaptcha=W;document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>W.autoInit()):W.autoInit();var te=k==null?void 0:k.getAttribute("data-site-key");te&&U({siteKey:te,ingestUrl:(k==null?void 0:k.getAttribute("data-ingest"))||void 0,scope:(k==null?void 0:k.getAttribute("data-scope"))||void 0});return ae(ye);})();
|
|
110
|
+
`,this.checkbox=this.container.querySelector(".webdecoy-checkbox"),this.spinner=this.container.querySelector(".webdecoy-spinner"),this.label=this.container.querySelector(".webdecoy-label")}_attachListeners(){document.addEventListener("mousemove",t=>this.behavioral.recordMouseMove(t),{passive:!0}),document.addEventListener("mousedown",t=>this.behavioral.recordMouseDown(t),{passive:!0}),document.addEventListener("mouseup",t=>this.behavioral.recordMouseUp(t),{passive:!0}),document.addEventListener("scroll",t=>this.behavioral.recordScroll(t),{passive:!0}),document.addEventListener("keydown",t=>this.behavioral.recordKeyEvent(t),{passive:!0}),document.addEventListener("keyup",t=>this.behavioral.recordKeyEvent(t),{passive:!0}),document.addEventListener("touchstart",t=>this.behavioral.recordTouch(t),{passive:!0}),document.addEventListener("touchmove",t=>this.behavioral.recordTouch(t),{passive:!0}),document.addEventListener("pointermove",t=>this.behavioral.recordPointer(t),{passive:!0}),document.addEventListener("pointerdown",t=>this.behavioral.recordPointer(t),{passive:!0}),document.addEventListener("pointerup",t=>this.behavioral.recordPointer(t),{passive:!0}),document.addEventListener("focus",t=>this.behavioral.recordFocus(t),{passive:!0,capture:!0}),document.addEventListener("blur",t=>this.behavioral.recordFocus(t),{passive:!0,capture:!0}),this.sensor.attach();let e=()=>this.temporal.recordFirstInteraction();document.addEventListener("mousemove",e,{once:!0}),document.addEventListener("touchstart",e,{once:!0}),document.addEventListener("keydown",e,{once:!0}),this.checkbox.addEventListener("click",t=>{this._handleClick(t)}),this.checkbox.addEventListener("keydown",t=>{(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),this._handleClick(t))})}async _handleClick(e){var o,r,i;if(this.verified||this.checkbox.classList.contains("loading"))return;let t=performance.now(),n=this.checkbox.getBoundingClientRect();this.checkbox.classList.add("loading"),this.spinner.style.display="block",this.label.textContent="Verifying...";try{let s=this.behavioral.analyze(),a="clientX"in e?e.clientX:n.left,l="clientY"in e?e.clientY:n.top,u=this.behavioral.analyzeClick(a,l,n),h=this.environmental.collect(),[f,g]=await Promise.all([this.environmental.measureRAFConsistency(),this.environmental.collectAsync()]),w=this.temporal.collect(t),_=P().analyze(),S=this.sensor.analyze(),m={behavioral:{...s,...u},environmental:{...h,rafConsistency:f,...g,sensor:S},temporal:w,formAnalysis:_,meta:{widgetId:this.id,siteKey:this.options.siteKey,challengeNonce:((o=this.powManager.challenge)==null?void 0:o.nonce)||null,timestamp:Date.now(),userAgent:navigator.userAgent,screenSize:`${screen.width}x${screen.height}`,viewportSize:`${window.innerWidth}x${window.innerHeight}`,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}},v=JSON.stringify(m),d=await M(v),p=await this.powManager.solveWithSignalsHash(this.options.siteKey,d),I={duration:p.duration,iterations:p.iterations,difficulty:p.difficulty},V=await this._verify(m,p,v,d,I);V.success?this._showSuccess((r=V.token)!=null?r:""):this._showFailure((i=V.message)!=null?i:void 0)}catch(s){console.error("WebDecoy captcha error:",s),this._showFailure("Verification failed. Please try again.")}}async _verify(e,t,n,o,r){let i=x();if(!i)return this._clientSideVerify(e);try{return await(await fetch(i+L()+"/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteKey:this.options.siteKey,signals:e,signalsJson:n||null,powSolution:t?{challengeId:t.challengeId,nonce:t.nonce,hash:t.hash,signalsHash:o||null}:null,powTiming:r||null})})).json()}catch{return console.warn("Server unavailable, using client-side verification"),this._clientSideVerify(e)}}_clientSideVerify(e){let t=0,n=e.behavioral,o=e.environmental,r=e.temporal,i=(n.touchEvents||0)>=3,s=(n.keyEvents||0)>0&&n.totalPoints===0;n.totalPoints<5&&n.trajectoryLength<10&&!i&&!s?t+=.35:n.totalPoints<10&&!i&&!s&&n.trajectoryLength<30&&(t+=.15),n.microTremorScore<.2&&(t+=.12),n.velocityVariance<.03&&(t+=.1),n.explorationRatio<.05&&(t+=.08),n.overshootCorrections===0&&n.trajectoryLength>100&&(t+=.05),n.clickPrecision<2&&(t+=.05),n.straightLineRatio>.8&&(t+=.08),n.microMovements<5&&n.totalPoints>50&&(t+=.06),o.webdriver&&(t+=.25),o.automationFlags&&o.automationFlags.plugins===0&&(t+=.05),o.webglInfo&&o.webglInfo.suspiciousRenderer&&(t+=.1),o.headlessIndicators&&!o.headlessIndicators.hasOuterDimensions&&(t+=.12),o.headlessIndicators&&o.headlessIndicators.innerEqualsOuter&&(t+=.05),r.pow&&r.pow.duration<50&&(t+=.1),n.eventDeltaVariance<3&&(t+=.08),n.interactionDuration<300&&(t+=.07);let a=t<.5;return{success:a,score:t,token:a?btoa(JSON.stringify({timestamp:Date.now(),score:t,id:this.id})):null,message:a?null:"Verification failed"}}_showSuccess(e){this.verified=!0,this.token=e,this.checkbox.classList.remove("loading"),this.checkbox.classList.add("verified"),this.checkbox.setAttribute("aria-checked","true"),this.spinner.style.display="none",this.label.textContent="Verified",this.options.callback&&this.options.callback(e),this.container.dispatchEvent(new CustomEvent("webdecoy:verified",{detail:{token:e}}))}_showFailure(e){this.checkbox.classList.remove("loading"),this.checkbox.classList.add("failed"),this.spinner.style.display="none",this.label.textContent=e||"Verification failed",this.options.errorCallback&&this.options.errorCallback(e),setTimeout(()=>{this.checkbox.classList.remove("failed"),this.label.textContent="I'm not a robot"},3e3)}getToken(){return this.token}reset(){this.verified=!1,this.token=null,this.behavioral=new E,this.temporal=new C,this.sensor&&this.sensor.detach(),this.sensor=new T,this.sensor.attach(),this.powManager.reset(),this.checkbox.classList.remove("verified","failed","loading"),this.checkbox.setAttribute("aria-checked","false"),this.spinner.style.display="none",this.label.textContent="I'm not a robot",this._fetchChallenge()}};var A=class{constructor(e){this.lastScore=null;this.listeners=[];this.options=Object.assign({siteKey:null,serverUrl:null,minCollectionTime:2e3,autoScore:!0,scoreThreshold:.5,powDifficulty:3},e),this.id="webdecoy_inv_"+Math.random().toString(36).slice(2,11),this.behavioral=new E,this.environmental=new b,this.temporal=new C,this.sensor=new T,this.powManager=new R,this.startTime=Date.now(),this._init()}_init(){this._attachListeners();let e=()=>this.temporal.recordFirstInteraction();document.addEventListener("mousemove",e,{once:!0}),document.addEventListener("touchstart",e,{once:!0}),document.addEventListener("keydown",e,{once:!0}),document.addEventListener("scroll",e,{once:!0}),this.options.autoScore&&this._attachToForms(),this._fetchChallenge()}async _fetchChallenge(){try{await this.powManager.fetchChallenge(this.options.siteKey)}catch(e){console.warn("PoW challenge fetch failed:",e)}}_attachListeners(){let e={mousemove:t=>this.behavioral.recordMouseMove(t),mousedown:t=>this.behavioral.recordMouseDown(t),mouseup:t=>this.behavioral.recordMouseUp(t),scroll:t=>this.behavioral.recordScroll(t),keydown:t=>this.behavioral.recordKeyEvent(t),keyup:t=>this.behavioral.recordKeyEvent(t),touchmove:t=>this.behavioral.recordTouch(t),touchstart:t=>this.behavioral.recordTouch(t),pointermove:t=>this.behavioral.recordPointer(t),pointerdown:t=>this.behavioral.recordPointer(t),pointerup:t=>this.behavioral.recordPointer(t),focus:t=>this.behavioral.recordFocus(t),blur:t=>this.behavioral.recordFocus(t)};for(let[t,n]of Object.entries(e)){let o=t==="focus"||t==="blur"?{passive:!0,capture:!0}:{passive:!0};document.addEventListener(t,n,o),this.listeners.push({event:t,handler:n,opts:o})}this.sensor.attach()}_attachToForms(){document.addEventListener("submit",async e=>{let t=e.target;if(t.dataset.webdecoyIgnore)return;let n=t.querySelector('input[name="webdecoy_token"]');if(n||(n=document.createElement("input"),n.type="hidden",n.name="webdecoy_token",t.appendChild(n)),!this.lastScore||Date.now()-this.lastScore.timestamp>6e4){e.preventDefault();try{let o=await this.execute(t.dataset.webdecoyAction||"form_submit");n.value=o.token||"",o.success?t.submit():document.dispatchEvent(new CustomEvent("webdecoy:blocked",{detail:{score:o.score,form:t}}))}catch(o){console.error("WebDecoy captcha error:",o),t.submit()}}else n.value=this.lastScore.token||""})}async execute(e=""){var S;let t=Date.now()-this.startTime;t<this.options.minCollectionTime&&await new Promise(m=>setTimeout(m,this.options.minCollectionTime-t));let n=this.behavioral.analyze(),o=this.environmental.collect(),r=this.temporal.collect(Date.now()),[i,s]=await Promise.all([this.environmental.measureRAFConsistency(),this.environmental.collectAsync()]),a=P().analyze(),l=this.sensor.analyze(),u={behavioral:n,environmental:{...o,rafConsistency:i,...s,sensor:l},temporal:r,formAnalysis:a,meta:{sessionId:this.id,siteKey:this.options.siteKey,action:e,challengeNonce:((S=this.powManager.challenge)==null?void 0:S.nonce)||null,timestamp:Date.now(),userAgent:navigator.userAgent,screenSize:`${screen.width}x${screen.height}`,viewportSize:`${window.innerWidth}x${window.innerHeight}`,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,sessionDuration:Date.now()-this.startTime,invisible:!0}},h=JSON.stringify(u),f=await M(h),g=await this.powManager.solveWithSignalsHash(this.options.siteKey,f),w={duration:g.duration,iterations:g.iterations,difficulty:g.difficulty},_=await this._score(u,e,g,h,f,w);return this.lastScore={..._,timestamp:Date.now()},_}async _score(e,t,n,o,r,i){let s=this.options.serverUrl||x();if(!s)return this._clientSideScore(e);try{return await(await fetch(s+L()+"/score",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteKey:this.options.siteKey,signals:e,signalsJson:o||null,action:t,powSolution:n?{challengeId:n.challengeId,nonce:n.nonce,hash:n.hash,signalsHash:r||null}:null,powTiming:i||null})})).json()}catch{return console.warn("WebDecoy server unavailable, using client-side scoring"),this._clientSideScore(e)}}_clientSideScore(e){let t=0,n=e.behavioral,o=e.environmental,r=e.temporal,i=e.meta,s=(n.touchEvents||0)>=3,a=(n.keyEvents||0)>0&&n.totalPoints===0;n.totalPoints<5&&n.trajectoryLength<10&&!s&&!a?t+=.35:n.totalPoints<10&&!s&&!a&&n.trajectoryLength<30&&(t+=.15),n.microTremorScore<.2&&(t+=.12),n.velocityVariance<.03&&(t+=.1),n.totalPoints<10&&i.sessionDuration>5e3&&(t+=.08),n.scrollEvents===0&&n.keyEvents===0&&i.sessionDuration>1e4&&(t+=.06),n.eventDeltaVariance<3&&(t+=.08),n.straightLineRatio>.8&&(t+=.08),o.webdriver&&(t+=.25),o.automationFlags&&o.automationFlags.plugins===0&&(t+=.06),o.headlessIndicators&&!o.headlessIndicators.hasOuterDimensions&&(t+=.12),o.webglInfo&&o.webglInfo.suspiciousRenderer&&(t+=.1),r.pow&&r.pow.duration<30&&(t+=.1),i.sessionDuration<500&&(t+=.12),i.sessionDuration<1e3&&n.totalPoints<5&&(t+=.15);let l=t<this.options.scoreThreshold;return{success:l,score:Math.min(1,t),action:i.action,token:l?btoa(JSON.stringify({timestamp:Date.now(),score:t,action:i.action,id:this.id})):null}}getScore(){return this.lastScore}destroy(){for(let{event:e,handler:t,opts:n}of this.listeners)document.removeEventListener(e,t,n);this.listeners=[],this.powManager&&this.powManager.reset()}};var W={widgets:new Map,get serverUrl(){return x()},set serverUrl(c){F(c)},configure(c){c.serverUrl&&F(c.serverUrl),c.basePath&&B(c.basePath)},render(c,e){let t=new D(c,e);return this.widgets.set(t.id,t),t.id},getResponse(c){let e=this.widgets.get(c);return e&&e instanceof D?e.getToken():null},reset(c){let e=this.widgets.get(c);e instanceof D&&e.reset()},invisible(c){let e=new A(c);return this.widgets.set(e.id,e),e},async execute(c,e={}){let t=new A({siteKey:c,serverUrl:x(),minCollectionTime:e.minTime||1e3,autoScore:!1,powDifficulty:e.powDifficulty||3}),n=await t.execute(e.action||"");return t.destroy(),n},getSignals(){return{environmental:new b().collect()}},autoInit(){document.querySelectorAll("[data-webdecoy]").forEach(c=>{let e=c.dataset.sitekey||c.dataset.webdecoy,t=c.dataset.theme||"light",n=c.dataset.endpoint,o=c.dataset.callback,r=o?window[o]:void 0;n&&F(n),this.render(c,{siteKey:e,theme:t,callback:r!=null?r:null})})}};var ce=24,le=8,ue=750,he=1500;function y(c){return typeof c=="number"&&Number.isFinite(c)?c:0}function q(c){let e=c.mousePositions;return!e||e.length<2?0:Math.max(0,Math.round(e[e.length-1].t-e[0].t))}function X(c){let e=c.mousePositions.length>=ce&&q(c)>=ue,t=c.touchEvents.length>=le;return e||t}function de(c){if(!X(c))return null;let e=c.analyze(),t=c.clickData;return{samples:y(e.totalPoints),duration_ms:q(c),tremor:y(e.microTremorScore),straight_ratio:y(e.straightLineRatio),velocity_var:y(e.velocityVariance),delta_var:y(e.eventDeltaVariance),dir_changes:y(e.directionChanges),micro_moves:y(e.microMovements),hold_ms:y(t==null?void 0:t.holdDuration),touch_points:y(e.touchTotalPoints),touch_force_var:y(e.touchForceVariance),pointer_nonmouse:e.pointerHasNonMouseType===!0,scrolls:y(e.scrollEvents),keys:y(e.keyEvents)}}function Y(c){if(typeof document=="undefined")return()=>{};let e=new E,t=null,n=!1,o={mousemove:s=>e.recordMouseMove(s),mousedown:s=>e.recordMouseDown(s),mouseup:s=>e.recordMouseUp(s),scroll:s=>e.recordScroll(s),keydown:s=>e.recordKeyEvent(s),touchstart:s=>e.recordTouch(s),touchmove:s=>e.recordTouch(s),pointerdown:s=>e.recordPointer(s)},r=()=>{if(!n){n=!0,t&&clearTimeout(t);for(let[s,a]of Object.entries(o))document.removeEventListener(s,a)}},i=()=>{n||t||X(e)&&(t=setTimeout(()=>{t=null;let s=de(e);r(),s&&c(s)},he))};for(let[s,a]of Object.entries(o)){let l=u=>{a(u),i()};o[s]=l,document.addEventListener(s,l,{passive:!0})}return r}var J="wd_clearance",me="wdfp1",ge="https://ingest.webdecoy.com";async function Z(c){let e=c.canvasHash,t=e&&e.supported?String(e.hash):"na",n=c.webglInfo,o=n&&n.supported?String(n.renderer)+"~"+String(n.vendor):"na",r=`${screen.width}x${screen.height}x${screen.colorDepth}`,i="na";try{i=Intl.DateTimeFormat().resolvedOptions().timeZone||"na"}catch{}let s=navigator.platform||"na",a=navigator.language||"na";return M([me,t,o,r,i,s,a].join("|"))}async function Q(c,e,t,n,o){try{let i=await(await fetch(c.replace(/\/$/,"")+"/api/v1/clearance",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({aid:e,fp:t,scope:n,ua:navigator.userAgent,webdriver:navigator.webdriver===!0,headless:/HeadlessChrome/.test(navigator.userAgent),...o?{behavior:o}:{}})})).json();if(i.granted&&i.token)return{token:i.token,expiresIn:i.expires_in||1800}}catch{}return null}function pe(c){for(let e of document.cookie.split(";")){let t=e.indexOf("=");if(!(t<0)&&e.slice(0,t).trim()===c)return e.slice(t+1).trim()||null}return null}function ee(c,e){document.cookie=`${J}=${c}; path=/; secure; samesite=lax; max-age=${e}`}function ve(c){let e=window.requestIdleCallback;typeof e=="function"?e(c):setTimeout(c,1200)}var G=!1;function fe(c,e,t){G||(G=!0,Y(n=>{(async()=>{try{let o=new b,r=await Z({canvasHash:o._getCanvasHash(),webglInfo:o._getWebGLInfo()}),i=await Q(c,e,r,t,n);i&&ee(i.token,i.expiresIn)}catch{}})()}))}function U(c){if(!c.siteKey||typeof document=="undefined")return;let e=c.ingestUrl||ge,t=c.scope||"",n=async()=>{if(pe(J))return;let o=new b,r=await Z({canvasHash:o._getCanvasHash(),webglInfo:o._getWebGLInfo()}),i=await Q(e,c.siteKey,r,t);if(i){ee(i.token,i.expiresIn);let s=Math.max(6e4,(i.expiresIn-120)*1e3);setTimeout(()=>U(c),s)}};ve(()=>{n()}),c.behavior!==!1&&fe(e,c.siteKey,t)}var k=document.currentScript;window.WebDecoyCaptcha=W;document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>W.autoInit()):W.autoInit();var te=k==null?void 0:k.getAttribute("data-site-key");te&&U({siteKey:te,ingestUrl:(k==null?void 0:k.getAttribute("data-ingest"))||void 0,scope:(k==null?void 0:k.getAttribute("data-scope"))||void 0});return ae(ye);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webdecoy/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Web Decoy browser widget - signal collection, proof-of-work, and captcha UI",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"build": "tsup",
|
|
22
22
|
"dev": "tsup --watch",
|
|
23
23
|
"test": "jest",
|
|
24
|
-
"lint": "eslint src
|
|
24
|
+
"lint": "eslint src --max-warnings 25",
|
|
25
25
|
"clean": "rm -rf dist"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
@@ -46,9 +46,6 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/jest": "^29.5.11",
|
|
48
48
|
"@types/node": "^20.11.0",
|
|
49
|
-
"@typescript-eslint/eslint-plugin": "^6.18.1",
|
|
50
|
-
"@typescript-eslint/parser": "^6.18.1",
|
|
51
|
-
"eslint": "^8.56.0",
|
|
52
49
|
"jest": "^29.7.0",
|
|
53
50
|
"jest-environment-jsdom": "^29.7.0",
|
|
54
51
|
"ts-jest": "^29.1.1",
|