wineater-bot 2.1.2 → 2.1.4
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/wineater-chatbot.mjs +875 -874
- package/dist/wineater-chatbot.umd.js +54 -42
- package/package.json +1 -1
- package/src/index.js +22 -10
- package/src/js/auto-open.js +4 -4
- package/src/js/styles.js +28 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const Ai = `
|
|
2
2
|
@font-face {
|
|
3
3
|
font-family: 'Poppins';
|
|
4
4
|
src: url('https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap');
|
|
@@ -10,7 +10,7 @@ const _i = `
|
|
|
10
10
|
bottom: 20px;
|
|
11
11
|
right: 20px;
|
|
12
12
|
font-family: 'Poppins', sans-serif; /* Use Poppins as the main font */
|
|
13
|
-
z-index:
|
|
13
|
+
z-index: 10000; /* Ensure chat is above other content */
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/* Styling the chat icon */
|
|
@@ -28,6 +28,7 @@ const _i = `
|
|
|
28
28
|
font-family: 'Poppins', sans-serif;
|
|
29
29
|
font-size: 16px; /* Увеличенный размер текста */
|
|
30
30
|
font-weight: bold;
|
|
31
|
+
box-sizing: border-box;
|
|
31
32
|
transition: transform 0.2s ease, box-shadow 0.2s ease; /* Анимация при наведении */
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -84,14 +85,18 @@ const _i = `
|
|
|
84
85
|
/* Chat window styles */
|
|
85
86
|
#chat-window {
|
|
86
87
|
position: fixed;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
88
|
+
bottom: 20px;
|
|
89
|
+
right: 20px;
|
|
90
|
+
width: 380px;
|
|
91
|
+
background-color: white;
|
|
92
|
+
border-radius: 24px;
|
|
93
|
+
border: 2px solid transparent;
|
|
94
|
+
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
|
|
95
|
+
display: none;
|
|
96
|
+
overflow: hidden;
|
|
97
|
+
background: linear-gradient(white, white) padding-box,
|
|
98
|
+
linear-gradient(90deg, #7B2BEB, #0044FF) border-box;
|
|
99
|
+
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
#chat-header {
|
|
@@ -360,10 +365,17 @@ border-top-left-radius: 4px;
|
|
|
360
365
|
}
|
|
361
366
|
|
|
362
367
|
.wine-item a {
|
|
363
|
-
color: #0044FF;
|
|
364
|
-
text-decoration:
|
|
365
|
-
font-size: 14px;
|
|
366
|
-
font-weight: 500;
|
|
368
|
+
color: #0044FF; /* Синий цвет ссылки */
|
|
369
|
+
text-decoration: underline; /* Подчеркивание для эффекта ссылки */
|
|
370
|
+
font-size: 14px; /* Размер текста */
|
|
371
|
+
font-weight: 500; /* Полужирный текст */
|
|
372
|
+
margin-top: 10px; /* Отступ сверху */
|
|
373
|
+
display: inline-block; /* Чтобы отступы работали корректно */
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.wine-item a:hover {
|
|
377
|
+
text-decoration: none; /* Убираем подчеркивание при наведении */
|
|
378
|
+
color: #002699; /* Более темный синий для интерактивного эффекта */
|
|
367
379
|
}
|
|
368
380
|
|
|
369
381
|
.wine-description {
|
|
@@ -387,7 +399,7 @@ border-bottom-right-radius: 15px;
|
|
|
387
399
|
|
|
388
400
|
/* Loader Styles */
|
|
389
401
|
.loader {
|
|
390
|
-
|
|
402
|
+
display: none;
|
|
391
403
|
width: 40px;
|
|
392
404
|
height: 40px;
|
|
393
405
|
margin: 20px auto;
|
|
@@ -423,7 +435,7 @@ border-bottom-right-radius: 15px;
|
|
|
423
435
|
justify-content: center;
|
|
424
436
|
align-items: center;
|
|
425
437
|
height: 0;
|
|
426
|
-
|
|
438
|
+
visibility: hidden;
|
|
427
439
|
background-color: white;
|
|
428
440
|
}
|
|
429
441
|
|
|
@@ -477,7 +489,7 @@ border-bottom-right-radius: 15px;
|
|
|
477
489
|
}
|
|
478
490
|
|
|
479
491
|
#message-container {
|
|
480
|
-
height: calc(100vh -
|
|
492
|
+
height: calc(100vh - 250px); /* Учитываем высоту header и input container */
|
|
481
493
|
max-height: none;
|
|
482
494
|
}
|
|
483
495
|
|
|
@@ -624,10 +636,10 @@ border-bottom-right-radius: 15px;
|
|
|
624
636
|
height: 80px;
|
|
625
637
|
}
|
|
626
638
|
}
|
|
627
|
-
`,
|
|
628
|
-
|
|
629
|
-
document.head.appendChild(
|
|
630
|
-
function
|
|
639
|
+
`, Vn = document.createElement("style");
|
|
640
|
+
Vn.textContent = Ai;
|
|
641
|
+
document.head.appendChild(Vn);
|
|
642
|
+
function Fi() {
|
|
631
643
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
|
|
632
644
|
const e = Math.random() * 16 | 0;
|
|
633
645
|
return (t === "x" ? e : e & 3 | 8).toString(16);
|
|
@@ -642,7 +654,7 @@ function mt(t, e, s) {
|
|
|
642
654
|
}
|
|
643
655
|
document.cookie = t + "=" + (e || "") + n + "; path=/; secure; samesite=strict";
|
|
644
656
|
}
|
|
645
|
-
function
|
|
657
|
+
function te(t) {
|
|
646
658
|
const e = t + "=", s = document.cookie.split(";");
|
|
647
659
|
for (let n = 0; n < s.length; n++) {
|
|
648
660
|
let i = s[n];
|
|
@@ -653,13 +665,13 @@ function se(t) {
|
|
|
653
665
|
}
|
|
654
666
|
return null;
|
|
655
667
|
}
|
|
656
|
-
function
|
|
668
|
+
function Mi(t) {
|
|
657
669
|
document.cookie = t + "=; Max-Age=-99999999;";
|
|
658
670
|
}
|
|
659
|
-
function
|
|
671
|
+
function Li() {
|
|
660
672
|
const t = "uniqueUserID";
|
|
661
|
-
let e =
|
|
662
|
-
return e || (e =
|
|
673
|
+
let e = te(t);
|
|
674
|
+
return e || (e = Fi(), mt(t, e, 365)), e;
|
|
663
675
|
}
|
|
664
676
|
function Ke(t, e) {
|
|
665
677
|
fetch("https://wineater-backend.vercel.app/proxy/track", {
|
|
@@ -677,29 +689,29 @@ function Ke(t, e) {
|
|
|
677
689
|
console.error("Mixpanel tracking error", i);
|
|
678
690
|
});
|
|
679
691
|
}
|
|
680
|
-
function
|
|
681
|
-
Ke("Chatbot Opened", { distinct_id:
|
|
692
|
+
function Gn() {
|
|
693
|
+
Ke("Chatbot Opened", { distinct_id: te("uniqueUserID"), client: te("chatbotToken") });
|
|
682
694
|
}
|
|
683
|
-
function
|
|
684
|
-
Ke("Chatbot Opened Auto", { distinct_id:
|
|
695
|
+
function Pi(t) {
|
|
696
|
+
Ke("Chatbot Opened Auto", { distinct_id: te("uniqueUserID"), url: t, client: te("chatbotToken") });
|
|
685
697
|
}
|
|
686
|
-
function
|
|
687
|
-
Ke("Chatbot Closed", { distinct_id:
|
|
698
|
+
function Kn() {
|
|
699
|
+
Ke("Chatbot Closed", { distinct_id: te("uniqueUserID"), client: te("chatbotToken") });
|
|
688
700
|
}
|
|
689
|
-
function
|
|
690
|
-
Ke("Message Sent", { distinct_id:
|
|
701
|
+
function Bi(t) {
|
|
702
|
+
Ke("Message Sent", { distinct_id: te("uniqueUserID"), message_content: t, client: te("chatbotToken") });
|
|
691
703
|
}
|
|
692
|
-
function
|
|
693
|
-
Ke("Products Got", { distinct_id:
|
|
704
|
+
function ji(t) {
|
|
705
|
+
Ke("Products Got", { distinct_id: te("uniqueUserID"), products: t, client: te("chatbotToken") });
|
|
694
706
|
}
|
|
695
|
-
function
|
|
696
|
-
Ke("Product Clicked", { distinct_id:
|
|
707
|
+
function Ui(t) {
|
|
708
|
+
Ke("Product Clicked", { distinct_id: te("uniqueUserID"), product_id: t, client: te("chatbotToken") });
|
|
697
709
|
}
|
|
698
710
|
var $e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
699
|
-
function
|
|
711
|
+
function Xn(t) {
|
|
700
712
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
701
713
|
}
|
|
702
|
-
var
|
|
714
|
+
var us = { exports: {} };
|
|
703
715
|
(function(t, e) {
|
|
704
716
|
(function(s, n) {
|
|
705
717
|
n(e);
|
|
@@ -711,33 +723,33 @@ var hs = { exports: {} };
|
|
|
711
723
|
return null;
|
|
712
724
|
}
|
|
713
725
|
}, getItem: function(v, f) {
|
|
714
|
-
var
|
|
726
|
+
var u = this;
|
|
715
727
|
return new Promise(function(m, g) {
|
|
716
728
|
try {
|
|
717
|
-
var S =
|
|
729
|
+
var S = u.getItemSync(v);
|
|
718
730
|
f == null || f(null, S), m(S);
|
|
719
731
|
} catch (x) {
|
|
720
732
|
f && f(x, null), g(x);
|
|
721
733
|
}
|
|
722
734
|
});
|
|
723
|
-
}, setItem: function(v, f,
|
|
735
|
+
}, setItem: function(v, f, u) {
|
|
724
736
|
return new Promise(function(m, g) {
|
|
725
737
|
try {
|
|
726
|
-
localStorage.setItem(v, f),
|
|
738
|
+
localStorage.setItem(v, f), u && u(null, f), m(f);
|
|
727
739
|
} catch (S) {
|
|
728
|
-
|
|
740
|
+
u && u(S, null), g(S);
|
|
729
741
|
}
|
|
730
742
|
});
|
|
731
743
|
} }, i = function() {
|
|
732
744
|
return i = Object.assign || function(v) {
|
|
733
|
-
for (var f,
|
|
734
|
-
for (var g in f = arguments[
|
|
745
|
+
for (var f, u = 1, m = arguments.length; u < m; u++)
|
|
746
|
+
for (var g in f = arguments[u])
|
|
735
747
|
Object.prototype.hasOwnProperty.call(f, g) && (v[g] = f[g]);
|
|
736
748
|
return v;
|
|
737
749
|
}, i.apply(this, arguments);
|
|
738
750
|
};
|
|
739
|
-
function r(v, f,
|
|
740
|
-
return new (
|
|
751
|
+
function r(v, f, u, m) {
|
|
752
|
+
return new (u || (u = Promise))(function(g, S) {
|
|
741
753
|
function x(z) {
|
|
742
754
|
try {
|
|
743
755
|
L(m.next(z));
|
|
@@ -754,7 +766,7 @@ var hs = { exports: {} };
|
|
|
754
766
|
}
|
|
755
767
|
function L(z) {
|
|
756
768
|
var _;
|
|
757
|
-
z.done ? g(z.value) : (_ = z.value, _ instanceof
|
|
769
|
+
z.done ? g(z.value) : (_ = z.value, _ instanceof u ? _ : new u(function($) {
|
|
758
770
|
$(_);
|
|
759
771
|
})).then(x, R);
|
|
760
772
|
}
|
|
@@ -762,7 +774,7 @@ var hs = { exports: {} };
|
|
|
762
774
|
});
|
|
763
775
|
}
|
|
764
776
|
function o(v, f) {
|
|
765
|
-
var
|
|
777
|
+
var u, m, g, S, x = { label: 0, sent: function() {
|
|
766
778
|
if (1 & g[0])
|
|
767
779
|
throw g[1];
|
|
768
780
|
return g[1];
|
|
@@ -773,11 +785,11 @@ var hs = { exports: {} };
|
|
|
773
785
|
function R(L) {
|
|
774
786
|
return function(z) {
|
|
775
787
|
return function(_) {
|
|
776
|
-
if (
|
|
788
|
+
if (u)
|
|
777
789
|
throw new TypeError("Generator is already executing.");
|
|
778
790
|
for (; x; )
|
|
779
791
|
try {
|
|
780
|
-
if (
|
|
792
|
+
if (u = 1, m && (g = 2 & _[0] ? m.return : _[0] ? m.throw || ((g = m.return) && g.call(m), 0) : m.next) && !(g = g.call(m, _[1])).done)
|
|
781
793
|
return g;
|
|
782
794
|
switch (m = 0, g && (_ = [2 & _[0], g.value]), _[0]) {
|
|
783
795
|
case 0:
|
|
@@ -816,7 +828,7 @@ var hs = { exports: {} };
|
|
|
816
828
|
} catch ($) {
|
|
817
829
|
_ = [6, $], m = 0;
|
|
818
830
|
} finally {
|
|
819
|
-
|
|
831
|
+
u = g = 0;
|
|
820
832
|
}
|
|
821
833
|
if (5 & _[0])
|
|
822
834
|
throw _[1];
|
|
@@ -825,68 +837,68 @@ var hs = { exports: {} };
|
|
|
825
837
|
};
|
|
826
838
|
}
|
|
827
839
|
}
|
|
828
|
-
function l(v, f,
|
|
829
|
-
if (
|
|
840
|
+
function l(v, f, u) {
|
|
841
|
+
if (u || arguments.length === 2)
|
|
830
842
|
for (var m, g = 0, S = f.length; g < S; g++)
|
|
831
843
|
!m && g in f || (m || (m = Array.prototype.slice.call(f, 0, g)), m[g] = f[g]);
|
|
832
844
|
return v.concat(m || Array.prototype.slice.call(f));
|
|
833
845
|
}
|
|
834
|
-
var a = function v(f,
|
|
835
|
-
if (f ===
|
|
846
|
+
var a = function v(f, u) {
|
|
847
|
+
if (f === u)
|
|
836
848
|
return !0;
|
|
837
|
-
if (f &&
|
|
838
|
-
if (f.constructor !==
|
|
849
|
+
if (f && u && typeof f == "object" && typeof u == "object") {
|
|
850
|
+
if (f.constructor !== u.constructor)
|
|
839
851
|
return !1;
|
|
840
852
|
var m, g, S;
|
|
841
853
|
if (Array.isArray(f)) {
|
|
842
|
-
if ((m = f.length) !=
|
|
854
|
+
if ((m = f.length) != u.length)
|
|
843
855
|
return !1;
|
|
844
856
|
for (g = m; g-- != 0; )
|
|
845
|
-
if (!v(f[g],
|
|
857
|
+
if (!v(f[g], u[g]))
|
|
846
858
|
return !1;
|
|
847
859
|
return !0;
|
|
848
860
|
}
|
|
849
861
|
if (f.constructor === RegExp)
|
|
850
|
-
return f.source ===
|
|
862
|
+
return f.source === u.source && f.flags === u.flags;
|
|
851
863
|
if (f.valueOf !== Object.prototype.valueOf)
|
|
852
|
-
return f.valueOf() ===
|
|
864
|
+
return f.valueOf() === u.valueOf();
|
|
853
865
|
if (f.toString !== Object.prototype.toString)
|
|
854
|
-
return f.toString() ===
|
|
855
|
-
if ((m = (S = Object.keys(f)).length) !== Object.keys(
|
|
866
|
+
return f.toString() === u.toString();
|
|
867
|
+
if ((m = (S = Object.keys(f)).length) !== Object.keys(u).length)
|
|
856
868
|
return !1;
|
|
857
869
|
for (g = m; g-- != 0; )
|
|
858
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
870
|
+
if (!Object.prototype.hasOwnProperty.call(u, S[g]))
|
|
859
871
|
return !1;
|
|
860
872
|
for (g = m; g-- != 0; ) {
|
|
861
873
|
var x = S[g];
|
|
862
|
-
if (!v(f[x],
|
|
874
|
+
if (!v(f[x], u[x]))
|
|
863
875
|
return !1;
|
|
864
876
|
}
|
|
865
877
|
return !0;
|
|
866
878
|
}
|
|
867
|
-
return f != f &&
|
|
879
|
+
return f != f && u != u;
|
|
868
880
|
};
|
|
869
|
-
function
|
|
870
|
-
var
|
|
881
|
+
function h(v, f) {
|
|
882
|
+
var u = Object.keys(f || {}).filter(function(m) {
|
|
871
883
|
var g = v == null ? void 0 : v[m], S = f == null ? void 0 : f[m];
|
|
872
884
|
return !a(g, S);
|
|
873
885
|
});
|
|
874
886
|
return Object.keys(v || {}).filter(function(m) {
|
|
875
|
-
Object.keys(f || {}).includes(m) ||
|
|
876
|
-
}), Object.keys(
|
|
887
|
+
Object.keys(f || {}).includes(m) || u.push(m);
|
|
888
|
+
}), Object.keys(u).length ? u : null;
|
|
877
889
|
}
|
|
878
890
|
var c, d;
|
|
879
|
-
function p(v, f,
|
|
891
|
+
function p(v, f, u) {
|
|
880
892
|
var m = "shortString", g = !0;
|
|
881
|
-
typeof
|
|
893
|
+
typeof u == "number" && (m = "javaDouble", g = !1), v[m] = v[m] || {}, v[m][f] = g ? u + "" : u;
|
|
882
894
|
}
|
|
883
895
|
function y(v) {
|
|
884
896
|
return !!v && typeof v == "object" && v.value !== void 0;
|
|
885
897
|
}
|
|
886
898
|
function w(v) {
|
|
887
899
|
return Object.fromEntries(Object.entries(v).map(function(f) {
|
|
888
|
-
var
|
|
889
|
-
return [
|
|
900
|
+
var u = f[0], m = f[1];
|
|
901
|
+
return [u, y(m) ? m : { value: m }];
|
|
890
902
|
}));
|
|
891
903
|
}
|
|
892
904
|
function b(v) {
|
|
@@ -897,185 +909,185 @@ var hs = { exports: {} };
|
|
|
897
909
|
})(c || (c = {}));
|
|
898
910
|
var T, D = null, B = "BULLET_TRAIN_DB", A = "BULLET_TRAIN_EVENT", k = "https://edge.api.flagsmith.com/api/v1/", O = "flagsmith_value_", N = "flagsmith_enabled_", F = "flagsmith_trait_", C = function() {
|
|
899
911
|
function v(f) {
|
|
900
|
-
var
|
|
912
|
+
var u = this;
|
|
901
913
|
this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
|
|
902
|
-
var m =
|
|
903
|
-
|
|
904
|
-
var x = "".concat(
|
|
914
|
+
var m = u, g = m.api, S = m.evaluationContext;
|
|
915
|
+
u.log("Get Flags"), u.isLoading = !0, u.loadingState.isFetching || u.setLoadingState(i(i({}, u.loadingState), { isFetching: !0 }));
|
|
916
|
+
var x = "".concat(u.getContext().identity), R = function(L) {
|
|
905
917
|
var z, _, $, Z;
|
|
906
|
-
if (L && x === "".concat(
|
|
907
|
-
var
|
|
908
|
-
|
|
909
|
-
var
|
|
910
|
-
ee = ee || [], (
|
|
911
|
-
|
|
918
|
+
if (L && x === "".concat(u.getContext().identity)) {
|
|
919
|
+
var oe = L.flags, ee = L.traits, se = L.identifier;
|
|
920
|
+
u.isLoading = !1;
|
|
921
|
+
var ae = {}, ce = {};
|
|
922
|
+
ee = ee || [], (oe = oe || []).forEach(function(K) {
|
|
923
|
+
ae[K.feature.name.toLowerCase().replace(/ /g, "_")] = { id: K.feature.id, enabled: K.enabled, value: K.feature_state_value };
|
|
912
924
|
}), ee.forEach(function(K) {
|
|
913
|
-
|
|
914
|
-
}),
|
|
915
|
-
var me = u
|
|
916
|
-
if ((
|
|
925
|
+
ce[K.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: K.transient, value: K.trait_value };
|
|
926
|
+
}), u.oldFlags = i({}, u.flags);
|
|
927
|
+
var me = h(u.oldFlags, ae), Xe = h((z = u.evaluationContext.identity) === null || z === void 0 ? void 0 : z.traits, ce);
|
|
928
|
+
if ((se || Object.keys(ce).length) && (u.evaluationContext.identity = { traits: ce }, se && (u.evaluationContext.identity.identifier = se)), u.flags = ae, u.updateStorage(), u._onChange(u.oldFlags, { isFromServer: !0, flagsChanged: me, traitsChanged: Xe }, u._loadedState(null, c.SERVER)), u.datadogRum)
|
|
917
929
|
try {
|
|
918
|
-
if (
|
|
930
|
+
if (u.datadogRum.trackTraits) {
|
|
919
931
|
var Je = {};
|
|
920
|
-
Object.keys(((_ =
|
|
921
|
-
Je[F + K] =
|
|
932
|
+
Object.keys(((_ = u.evaluationContext.identity) === null || _ === void 0 ? void 0 : _.traits) || {}).map(function(K) {
|
|
933
|
+
Je[F + K] = u.getTrait(K);
|
|
922
934
|
});
|
|
923
|
-
var Me = i(i(i({},
|
|
924
|
-
|
|
935
|
+
var Me = i(i(i({}, u.datadogRum.client.getUser()), { id: u.datadogRum.client.getUser().id || (($ = u.evaluationContext.identity) === null || $ === void 0 ? void 0 : $.identifier) }), Je);
|
|
936
|
+
u.log("Setting Datadog user", Me), u.datadogRum.client.setUser(Me);
|
|
925
937
|
}
|
|
926
938
|
} catch (K) {
|
|
927
939
|
console.error(K);
|
|
928
940
|
}
|
|
929
|
-
if (
|
|
941
|
+
if (u.dtrum)
|
|
930
942
|
try {
|
|
931
943
|
var ne = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
|
|
932
|
-
Object.keys(
|
|
933
|
-
p(ne, O + K,
|
|
934
|
-
}), Object.keys(((Z =
|
|
935
|
-
p(ne, F + K,
|
|
936
|
-
}),
|
|
944
|
+
Object.keys(u.flags).map(function(K) {
|
|
945
|
+
p(ne, O + K, u.getValue(K, { skipAnalytics: !0 })), p(ne, N + K, u.hasFeature(K, { skipAnalytics: !0 }));
|
|
946
|
+
}), Object.keys(((Z = u.evaluationContext.identity) === null || Z === void 0 ? void 0 : Z.traits) || {}).map(function(K) {
|
|
947
|
+
p(ne, F + K, u.getTrait(K));
|
|
948
|
+
}), u.log("Sending javaLongOrObject traits to dynatrace", ne.javaLongOrObject), u.log("Sending date traits to dynatrace", ne.date), u.log("Sending shortString traits to dynatrace", ne.shortString), u.log("Sending javaDouble to dynatrace", ne.javaDouble), u.dtrum.sendSessionProperties(ne.javaLongOrObject, ne.date, ne.shortString, ne.javaDouble);
|
|
937
949
|
} catch (K) {
|
|
938
950
|
console.error(K);
|
|
939
951
|
}
|
|
940
952
|
}
|
|
941
953
|
};
|
|
942
|
-
return S.identity ? Promise.all([S.identity.traits && Object.keys(S.identity.traits).length || !S.identity.identifier ?
|
|
954
|
+
return S.identity ? Promise.all([S.identity.traits && Object.keys(S.identity.traits).length || !S.identity.identifier ? u.getJSON(g + "identities/", "POST", JSON.stringify({ identifier: S.identity.identifier, transient: S.identity.transient, traits: Object.entries(S.identity.traits).map(function(L) {
|
|
943
955
|
var z = L[0], _ = L[1];
|
|
944
956
|
return { trait_key: z, trait_value: _ == null ? void 0 : _.value, transient: _ == null ? void 0 : _.transient };
|
|
945
957
|
}).filter(function(L) {
|
|
946
|
-
return L.trait_value !== void 0 || (
|
|
947
|
-
}) })) :
|
|
948
|
-
return
|
|
958
|
+
return L.trait_value !== void 0 || (u.log("Warning - attempted to set an undefined trait value for key", L.trait_key), !1);
|
|
959
|
+
}) })) : u.getJSON(g + "identities/?identifier=" + encodeURIComponent(S.identity.identifier) + (S.identity.transient ? "&transient=true" : ""))]).then(function(L) {
|
|
960
|
+
return u.evaluationContext.identity = i(i({}, u.evaluationContext.identity), { traits: {} }), R(L == null ? void 0 : L[0]);
|
|
949
961
|
}).catch(function(L) {
|
|
950
962
|
var z = L.message, _ = new Error(z);
|
|
951
963
|
return Promise.reject(_);
|
|
952
|
-
}) :
|
|
964
|
+
}) : u.getJSON(g + "flags/").then(function(L) {
|
|
953
965
|
return R({ flags: L, traits: void 0 });
|
|
954
966
|
});
|
|
955
967
|
}, this.analyticsFlags = function() {
|
|
956
|
-
var m =
|
|
957
|
-
if (
|
|
958
|
-
return
|
|
959
|
-
if (
|
|
960
|
-
var S =
|
|
961
|
-
|
|
968
|
+
var m = u.api;
|
|
969
|
+
if (u.evaluationEvent && u.evaluationContext.environment && u.evaluationEvent[u.evaluationContext.environment.apiKey])
|
|
970
|
+
return u.evaluationEvent && Object.getOwnPropertyNames(u.evaluationEvent).length !== 0 && Object.getOwnPropertyNames(u.evaluationEvent[u.evaluationContext.environment.apiKey]).length !== 0 ? u.getJSON(m + "analytics/flags/", "POST", JSON.stringify(u.evaluationEvent[u.evaluationContext.environment.apiKey])).then(function(g) {
|
|
971
|
+
if (u.evaluationContext.environment) {
|
|
972
|
+
var S = u.getState();
|
|
973
|
+
u.evaluationEvent || (u.evaluationEvent = {}), u.evaluationEvent[u.evaluationContext.environment.apiKey] = {}, u.setState(i(i({}, S), { evaluationEvent: u.evaluationEvent })), u.updateEventStorage();
|
|
962
974
|
}
|
|
963
975
|
}).catch(function(g) {
|
|
964
|
-
|
|
976
|
+
u.log("Exception fetching evaluationEvent", g);
|
|
965
977
|
}) : void 0;
|
|
966
978
|
}, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: c.NONE }, this.canUseStorage = !1, this.analyticsInterval = null, this.api = null, this.cacheFlags = !1, this.ts = null, this.enableAnalytics = !1, this.enableLogs = !1, this.evaluationContext = {}, this.evaluationEvent = null, this.flags = null, this.getFlagInterval = null, this.headers = null, this.initialised = !1, this.oldFlags = null, this.onChange = null, this.onError = null, this.ticks = null, this.timer = null, this.dtrum = null, this.withTraits = null, this.cacheOptions = { ttl: 0, skipAPI: !1, loadStale: !1 }, this.getValue = function(m, g, S) {
|
|
967
|
-
var x =
|
|
968
|
-
if (x && (R = x.value), g != null && g.skipAnalytics || S ||
|
|
979
|
+
var x = u.flags && u.flags[m.toLowerCase().replace(/ /g, "_")], R = null;
|
|
980
|
+
if (x && (R = x.value), g != null && g.skipAnalytics || S || u.evaluateFlag(m, "VALUE"), R === null && (g == null ? void 0 : g.fallback) !== void 0)
|
|
969
981
|
return g.fallback;
|
|
970
982
|
if (g != null && g.json)
|
|
971
983
|
try {
|
|
972
|
-
return R === null ? (
|
|
984
|
+
return R === null ? (u.log("Tried to parse null flag as JSON: " + m), null) : JSON.parse(R);
|
|
973
985
|
} catch {
|
|
974
986
|
return g.fallback;
|
|
975
987
|
}
|
|
976
988
|
return R;
|
|
977
989
|
}, this.getTrait = function(m) {
|
|
978
990
|
var g, S;
|
|
979
|
-
return ((g =
|
|
991
|
+
return ((g = u.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits) && ((S = u.evaluationContext.identity.traits[m.toLowerCase().replace(/ /g, "_")]) === null || S === void 0 ? void 0 : S.value);
|
|
980
992
|
}, this.getAllTraits = function() {
|
|
981
993
|
var m;
|
|
982
|
-
return Object.fromEntries(Object.entries(((m =
|
|
994
|
+
return Object.fromEntries(Object.entries(((m = u.evaluationContext.identity) === null || m === void 0 ? void 0 : m.traits) || {}).map(function(g) {
|
|
983
995
|
var S = g[0], x = g[1];
|
|
984
996
|
return [S, x == null ? void 0 : x.value];
|
|
985
997
|
}));
|
|
986
998
|
}, this.setContext = function(m) {
|
|
987
999
|
var g = b(m);
|
|
988
|
-
return
|
|
1000
|
+
return u.evaluationContext = i(i({}, g), { environment: g.environment || u.evaluationContext.environment }), u.initialised ? u.getFlags() : Promise.resolve();
|
|
989
1001
|
}, this.getContext = function() {
|
|
990
|
-
return
|
|
1002
|
+
return u.evaluationContext;
|
|
991
1003
|
}, this.updateContext = function(m) {
|
|
992
|
-
return
|
|
1004
|
+
return u.setContext(i(i({}, u.getContext()), m));
|
|
993
1005
|
}, this.setTrait = function(m, g) {
|
|
994
1006
|
var S;
|
|
995
|
-
if (
|
|
996
|
-
return
|
|
1007
|
+
if (u.api)
|
|
1008
|
+
return u.setContext(i(i({}, u.evaluationContext), { identity: i(i({}, u.evaluationContext.identity), { traits: i(i({}, (S = u.evaluationContext.identity) === null || S === void 0 ? void 0 : S.traits), w(Object.fromEntries([[m, g]]))) }) }));
|
|
997
1009
|
}, this.setTraits = function(m) {
|
|
998
1010
|
var g;
|
|
999
|
-
if (
|
|
1000
|
-
return
|
|
1011
|
+
if (u.api)
|
|
1012
|
+
return u.setContext(i(i({}, u.evaluationContext), { identity: i(i({}, u.evaluationContext.identity), { traits: i(i({}, (g = u.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits), Object.fromEntries(Object.entries(m).map(function(S) {
|
|
1001
1013
|
var x = S[0], R = S[1];
|
|
1002
1014
|
return [x, y(R) ? R : { value: R }];
|
|
1003
1015
|
}))) }) }));
|
|
1004
1016
|
console.error("Attempted to setTraits a user before calling flagsmith.init. Call flagsmith.init first, if you wish to prevent it sending a request for flags, call init with preventFetch:true.");
|
|
1005
1017
|
}, this.hasFeature = function(m, g) {
|
|
1006
|
-
var S = typeof g == "object", x =
|
|
1007
|
-
return !x && S && g.fallback !== void 0 ? R = g == null ? void 0 : g.fallback : x && x.enabled && (R = !0), (S && !g.skipAnalytics || !g) &&
|
|
1018
|
+
var S = typeof g == "object", x = u.flags && u.flags[m.toLowerCase().replace(/ /g, "_")], R = !1;
|
|
1019
|
+
return !x && S && g.fallback !== void 0 ? R = g == null ? void 0 : g.fallback : x && x.enabled && (R = !0), (S && !g.skipAnalytics || !g) && u.evaluateFlag(m, "ENABLED"), R;
|
|
1008
1020
|
}, this.getJSON = function(m, g, S) {
|
|
1009
|
-
var x, R =
|
|
1021
|
+
var x, R = u;
|
|
1010
1022
|
R.evaluationContext;
|
|
1011
1023
|
var L = R.headers, z = { method: g || "GET", body: S, cache: "no-cache", headers: {} };
|
|
1012
|
-
|
|
1013
|
-
var _ = "".concat((x =
|
|
1024
|
+
u.evaluationContext.environment && (z.headers["X-Environment-Key"] = u.evaluationContext.environment.apiKey), g && g !== "GET" && (z.headers["Content-Type"] = "application/json; charset=utf-8"), L && Object.assign(z.headers, L), d || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
|
|
1025
|
+
var _ = "".concat((x = u.evaluationContext.identity) === null || x === void 0 ? void 0 : x.identifier);
|
|
1014
1026
|
return d(m, z).then(function($) {
|
|
1015
|
-
var Z,
|
|
1027
|
+
var Z, oe, ee = "".concat((Z = u.evaluationContext.identity) === null || Z === void 0 ? void 0 : Z.identifier);
|
|
1016
1028
|
if (_ === ee) {
|
|
1017
|
-
var
|
|
1018
|
-
if (
|
|
1029
|
+
var se = (oe = $.headers) === null || oe === void 0 ? void 0 : oe.get("x-flagsmith-document-updated-at");
|
|
1030
|
+
if (se)
|
|
1019
1031
|
try {
|
|
1020
|
-
var
|
|
1021
|
-
if (isNaN(
|
|
1032
|
+
var ae = parseFloat(se);
|
|
1033
|
+
if (isNaN(ae))
|
|
1022
1034
|
return Promise.reject("Failed to parse x-flagsmith-document-updated-at");
|
|
1023
|
-
|
|
1024
|
-
} catch (
|
|
1025
|
-
|
|
1035
|
+
u.timestamp = ae;
|
|
1036
|
+
} catch (ce) {
|
|
1037
|
+
u.log(ce, "Failed to parse x-flagsmith-document-updated-at", se);
|
|
1026
1038
|
}
|
|
1027
|
-
return
|
|
1028
|
-
var me =
|
|
1039
|
+
return u.log("Fetch response: " + $.status + " " + (g || "GET") + 0 + m), $.text().then(function(ce) {
|
|
1040
|
+
var me = ce;
|
|
1029
1041
|
try {
|
|
1030
|
-
me = JSON.parse(
|
|
1042
|
+
me = JSON.parse(ce);
|
|
1031
1043
|
} catch {
|
|
1032
1044
|
}
|
|
1033
1045
|
return !me && $.status && (me = "API Response: ".concat($.status)), $.status && $.status >= 200 && $.status < 300 ? me : Promise.reject(new Error(me));
|
|
1034
1046
|
});
|
|
1035
1047
|
}
|
|
1036
|
-
|
|
1048
|
+
u.log("Received response with identity mismatch, ignoring response. Requested: ".concat(_, ", Current: ").concat(ee));
|
|
1037
1049
|
});
|
|
1038
1050
|
}, this.evaluateFlag = function(m, g) {
|
|
1039
|
-
if (
|
|
1040
|
-
if (!
|
|
1051
|
+
if (u.datadogRum && (u.datadogRum.client.addFeatureFlagEvaluation ? g === "VALUE" ? u.datadogRum.client.addFeatureFlagEvaluation(O + m, u.getValue(m, {}, !0)) : u.datadogRum.client.addFeatureFlagEvaluation(N + m, u.hasFeature(m, !0)) : console.error("Flagsmith: Your datadog RUM client does not support the function addFeatureFlagEvaluation, please update it.")), u.enableAnalytics) {
|
|
1052
|
+
if (!u.evaluationEvent || !u.evaluationContext.environment)
|
|
1041
1053
|
return;
|
|
1042
|
-
|
|
1054
|
+
u.evaluationEvent[u.evaluationContext.environment.apiKey] || (u.evaluationEvent[u.evaluationContext.environment.apiKey] = {}), u.evaluationEvent[u.evaluationContext.environment.apiKey][m] === void 0 && (u.evaluationEvent[u.evaluationContext.environment.apiKey][m] = 0), u.evaluationEvent[u.evaluationContext.environment.apiKey][m] += 1;
|
|
1043
1055
|
}
|
|
1044
|
-
|
|
1056
|
+
u.updateEventStorage();
|
|
1045
1057
|
}, this._onChange = function(m, g, S) {
|
|
1046
1058
|
var x, R;
|
|
1047
|
-
|
|
1059
|
+
u.setLoadingState(S), (x = u.onChange) === null || x === void 0 || x.call(u, m, g, u.loadingState), (R = u._trigger) === null || R === void 0 || R.call(u);
|
|
1048
1060
|
}, d = f.fetch ? f.fetch : typeof fetch < "u" ? fetch : $e == null ? void 0 : $e.fetch, this.canUseStorage = typeof window < "u" || !!f.browserlessStorage, this.log("Constructing flagsmith instance " + f), f.eventSource && (T = f.eventSource), f.AsyncStorage && (D = f.AsyncStorage);
|
|
1049
1061
|
}
|
|
1050
1062
|
return v.prototype.init = function(f) {
|
|
1051
|
-
var
|
|
1063
|
+
var u, m, g;
|
|
1052
1064
|
return r(this, void 0, void 0, function() {
|
|
1053
|
-
var S, x, R, L, z, _, $, Z,
|
|
1065
|
+
var S, x, R, L, z, _, $, Z, oe, ee, se, ae, ce, me, Xe, Je, Me, ne, K, Dt, Ye, zs, Qe, At, Ws, $s, Ft, qs, Mt, Ze, Le, Vs, ie = this;
|
|
1054
1066
|
return o(this, function(pe) {
|
|
1055
1067
|
switch (pe.label) {
|
|
1056
1068
|
case 0:
|
|
1057
1069
|
S = b(f.evaluationContext || this.evaluationContext), pe.label = 1;
|
|
1058
1070
|
case 1:
|
|
1059
|
-
if (pe.trys.push([1, 13, , 14]), x = f.environmentID, R = f.api, L = R === void 0 ? k : R, z = f.headers, _ = f.onChange, $ = f.cacheFlags, Z = f.datadogRum,
|
|
1071
|
+
if (pe.trys.push([1, 13, , 14]), x = f.environmentID, R = f.api, L = R === void 0 ? k : R, z = f.headers, _ = f.onChange, $ = f.cacheFlags, Z = f.datadogRum, oe = f.onError, ee = f.defaultFlags, se = f.fetch, ae = f.preventFetch, ce = f.enableLogs, me = f.enableDynatrace, Xe = f.enableAnalytics, Je = f.realtime, Me = f.eventSourceUrl, ne = Me === void 0 ? "https://realtime.flagsmith.com/" : Me, K = f.AsyncStorage, Dt = f.identity, Ye = f.traits, zs = f.state, Qe = f.cacheOptions, At = f.angularHttpClient, Ws = f._trigger, $s = f._triggerLoadingState, S.environment = x ? { apiKey: x } : S.environment, !S.environment || !S.environment.apiKey)
|
|
1060
1072
|
throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
|
|
1061
|
-
if (S.identity = Dt || Ye ? { identifier: Dt, traits: Ye ? Object.fromEntries(Object.entries(Ye).map(function(
|
|
1062
|
-
return [
|
|
1063
|
-
})) : {} } : S.identity, this.evaluationContext = S, this.api = L, this.headers = z, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = _, Ft = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Ws || this._trigger, this._triggerLoadingState = $s || this._triggerLoadingState, this.onError = function(
|
|
1064
|
-
ie.setLoadingState(i(i({}, ie.loadingState), { isFetching: !1, isLoading: !1, error:
|
|
1065
|
-
}, this.enableLogs =
|
|
1073
|
+
if (S.identity = Dt || Ye ? { identifier: Dt, traits: Ye ? Object.fromEntries(Object.entries(Ye).map(function(le) {
|
|
1074
|
+
return [le[0], { value: le[1] }];
|
|
1075
|
+
})) : {} } : S.identity, this.evaluationContext = S, this.api = L, this.headers = z, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = _, Ft = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Ws || this._trigger, this._triggerLoadingState = $s || this._triggerLoadingState, this.onError = function(le) {
|
|
1076
|
+
ie.setLoadingState(i(i({}, ie.loadingState), { isFetching: !1, isLoading: !1, error: le })), oe == null || oe(le);
|
|
1077
|
+
}, this.enableLogs = ce || !1, this.cacheOptions = Qe ? { skipAPI: !!Qe.skipAPI, ttl: Qe.ttl || 0, loadStale: !!Qe.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), se && (d = se), this.enableAnalytics = Xe || !1, this.flags = Object.assign({}, ee) || {}, this.datadogRum = Z || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = D !== void 0 && !!$, K && (D = K), Je && typeof window < "u" && this.setupRealtime(ne, S.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = i(i({}, this.loadingState), { isLoading: !1, source: c.DEFAULT_FLAGS })), this.setState(zs), this.log("Initialising with properties", f, this), me && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), At && (d = /* @__PURE__ */ function(le) {
|
|
1066
1078
|
return function(ve, ye) {
|
|
1067
1079
|
var Ee = ye.headers, J = ye.method, Pe = ye.body;
|
|
1068
1080
|
return new Promise(function(Re) {
|
|
1069
1081
|
switch (J) {
|
|
1070
1082
|
case "GET":
|
|
1071
|
-
return
|
|
1083
|
+
return le.get(ve, { headers: Ee }).subscribe(function(ke) {
|
|
1072
1084
|
Re({ ok: !0, text: function() {
|
|
1073
1085
|
return Promise.resolve(ke);
|
|
1074
1086
|
} });
|
|
1075
1087
|
});
|
|
1076
1088
|
case "POST":
|
|
1077
1089
|
case "PUT":
|
|
1078
|
-
return
|
|
1090
|
+
return le.post(ve, Pe, { headers: Ee }).subscribe(function(ke) {
|
|
1079
1091
|
Re({ ok: !0, text: function() {
|
|
1080
1092
|
return Promise.resolve(ke);
|
|
1081
1093
|
} });
|
|
@@ -1083,14 +1095,14 @@ var hs = { exports: {} };
|
|
|
1083
1095
|
}
|
|
1084
1096
|
});
|
|
1085
1097
|
};
|
|
1086
|
-
}(At)), D && this.canUseStorage && D.getItem(A).then(function(
|
|
1098
|
+
}(At)), D && this.canUseStorage && D.getItem(A).then(function(le) {
|
|
1087
1099
|
try {
|
|
1088
|
-
ie.evaluationEvent = JSON.parse(
|
|
1100
|
+
ie.evaluationEvent = JSON.parse(le) || {};
|
|
1089
1101
|
} catch {
|
|
1090
1102
|
ie.evaluationEvent = {};
|
|
1091
1103
|
}
|
|
1092
1104
|
ie.analyticsInterval = setInterval(ie.analyticsFlags, ie.ticks);
|
|
1093
|
-
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), D && this.canUseStorage && D.getItem(A, function(
|
|
1105
|
+
}), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), D && this.canUseStorage && D.getItem(A, function(le, ve) {
|
|
1094
1106
|
if (ve && ie.evaluationContext.environment) {
|
|
1095
1107
|
var ye = JSON.parse(ve);
|
|
1096
1108
|
if (ye[ie.evaluationContext.environment.apiKey]) {
|
|
@@ -1102,7 +1114,7 @@ var hs = { exports: {} };
|
|
|
1102
1114
|
return [3, 9];
|
|
1103
1115
|
if (!D || !this.canUseStorage)
|
|
1104
1116
|
return [3, 8];
|
|
1105
|
-
qs = function(
|
|
1117
|
+
qs = function(le, ve) {
|
|
1106
1118
|
return r(ie, void 0, void 0, function() {
|
|
1107
1119
|
var ye, Ee, J, Pe, Re, ke, Lt, Gs, Pt, Bt, jt, Ut, Ht, zt, Wt, $t, qt, Vt, Gt, Kt, Xt, Jt, Yt, Qt;
|
|
1108
1120
|
return o(this, function(Ce) {
|
|
@@ -1112,9 +1124,9 @@ var hs = { exports: {} };
|
|
|
1112
1124
|
return [3, 7];
|
|
1113
1125
|
ye = null, Ee = null, Ce.label = 1;
|
|
1114
1126
|
case 1:
|
|
1115
|
-
return Ce.trys.push([1, 5, , 6]), J = JSON.parse(ve), Pe = !1, Re = !1, J && J.api === this.api && ((Bt = (Pt = J.evaluationContext) === null || Pt === void 0 ? void 0 : Pt.environment) === null || Bt === void 0 ? void 0 : Bt.apiKey) === ((jt = this.evaluationContext.environment) === null || jt === void 0 ? void 0 : jt.apiKey) && (ke = !0, this.evaluationContext.identity && ((Ht = (Ut = J.evaluationContext) === null || Ut === void 0 ? void 0 : Ut.identity) === null || Ht === void 0 ? void 0 : Ht.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Wt = (zt = J.evaluationContext) === null || zt === void 0 ? void 0 : zt.identity) === null || Wt === void 0 ? void 0 : Wt.identifier) + " to " + this.evaluationContext.identity.identifier), ke = !1), this.cacheOptions.ttl && (!J.ts || (/* @__PURE__ */ new Date()).valueOf() - J.ts > this.cacheOptions.ttl) && (J.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + J.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - J.ts) + "ms"), ke = !1) : J.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + J.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - J.ts) + "ms"), Re = !0, ke = !0)), ke && (Pe = !0, Ee =
|
|
1127
|
+
return Ce.trys.push([1, 5, , 6]), J = JSON.parse(ve), Pe = !1, Re = !1, J && J.api === this.api && ((Bt = (Pt = J.evaluationContext) === null || Pt === void 0 ? void 0 : Pt.environment) === null || Bt === void 0 ? void 0 : Bt.apiKey) === ((jt = this.evaluationContext.environment) === null || jt === void 0 ? void 0 : jt.apiKey) && (ke = !0, this.evaluationContext.identity && ((Ht = (Ut = J.evaluationContext) === null || Ut === void 0 ? void 0 : Ut.identity) === null || Ht === void 0 ? void 0 : Ht.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Wt = (zt = J.evaluationContext) === null || zt === void 0 ? void 0 : zt.identity) === null || Wt === void 0 ? void 0 : Wt.identifier) + " to " + this.evaluationContext.identity.identifier), ke = !1), this.cacheOptions.ttl && (!J.ts || (/* @__PURE__ */ new Date()).valueOf() - J.ts > this.cacheOptions.ttl) && (J.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + J.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - J.ts) + "ms"), ke = !1) : J.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + J.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - J.ts) + "ms"), Re = !0, ke = !0)), ke && (Pe = !0, Ee = h(($t = this.evaluationContext.identity) === null || $t === void 0 ? void 0 : $t.traits, (Vt = (qt = J.evaluationContext) === null || qt === void 0 ? void 0 : qt.identity) === null || Vt === void 0 ? void 0 : Vt.traits), ye = h(this.flags, J.flags), this.setState(i(i({}, J), { evaluationContext: b(i(i({}, J.evaluationContext), { identity: !((Gt = J.evaluationContext) === null || Gt === void 0) && Gt.identity ? i(i({}, (Kt = J.evaluationContext) === null || Kt === void 0 ? void 0 : Kt.identity), { traits: i(i({}, ((Jt = (Xt = J.evaluationContext) === null || Xt === void 0 ? void 0 : Xt.identity) === null || Jt === void 0 ? void 0 : Jt.traits) || {}), Ye || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", J))), Pe ? (Lt = !ae && (!this.cacheOptions.skipAPI || Re), this._onChange(null, { isFromServer: !1, flagsChanged: ye, traitsChanged: Ee }, this._loadedState(null, c.CACHE, Lt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Pe && !Re && this.log("Skipping API, using cache"), Lt && this.getFlags(), [3, 4]) : [3, 2];
|
|
1116
1128
|
case 2:
|
|
1117
|
-
return
|
|
1129
|
+
return ae ? [3, 4] : [4, this.getFlags()];
|
|
1118
1130
|
case 3:
|
|
1119
1131
|
Ce.sent(), Ce.label = 4;
|
|
1120
1132
|
case 4:
|
|
@@ -1124,16 +1136,16 @@ var hs = { exports: {} };
|
|
|
1124
1136
|
case 6:
|
|
1125
1137
|
return [3, 10];
|
|
1126
1138
|
case 7:
|
|
1127
|
-
return
|
|
1139
|
+
return ae ? [3, 9] : [4, this.getFlags()];
|
|
1128
1140
|
case 8:
|
|
1129
1141
|
return Ce.sent(), [3, 10];
|
|
1130
1142
|
case 9:
|
|
1131
1143
|
if (ee)
|
|
1132
|
-
this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
1144
|
+
this._onChange(null, { isFromServer: !1, flagsChanged: h({}, this.flags), traitsChanged: h({}, (Yt = this.evaluationContext.identity) === null || Yt === void 0 ? void 0 : Yt.traits) }, this._loadedState(null, c.DEFAULT_FLAGS));
|
|
1133
1145
|
else {
|
|
1134
1146
|
if (!this.flags)
|
|
1135
1147
|
throw new Error(Ft);
|
|
1136
|
-
this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
1148
|
+
this._onChange(null, { isFromServer: !1, flagsChanged: h({}, this.flags), traitsChanged: h({}, (Qt = this.evaluationContext.identity) === null || Qt === void 0 ? void 0 : Qt.traits) }, this._loadedState(null, c.DEFAULT_FLAGS));
|
|
1137
1149
|
}
|
|
1138
1150
|
Ce.label = 10;
|
|
1139
1151
|
case 10:
|
|
@@ -1156,13 +1168,13 @@ var hs = { exports: {} };
|
|
|
1156
1168
|
case 8:
|
|
1157
1169
|
return [3, 12];
|
|
1158
1170
|
case 9:
|
|
1159
|
-
return
|
|
1171
|
+
return ae ? [3, 11] : [4, this.getFlags()];
|
|
1160
1172
|
case 10:
|
|
1161
1173
|
return pe.sent(), [3, 12];
|
|
1162
1174
|
case 11:
|
|
1163
1175
|
if (ee)
|
|
1164
|
-
this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
1165
|
-
else if (this.flags && (Ze = null, Object.keys(this.flags).length === 0 && (Ze = Ft), this._onChange(null, { isFromServer: !1, flagsChanged:
|
|
1176
|
+
this._onChange(null, { isFromServer: !1, flagsChanged: h({}, ee), traitsChanged: h({}, (u = S.identity) === null || u === void 0 ? void 0 : u.traits) }, this._loadedState(null, c.DEFAULT_FLAGS));
|
|
1177
|
+
else if (this.flags && (Ze = null, Object.keys(this.flags).length === 0 && (Ze = Ft), this._onChange(null, { isFromServer: !1, flagsChanged: h({}, this.flags), traitsChanged: h({}, (m = S.identity) === null || m === void 0 ? void 0 : m.traits) }, this._loadedState(Ze, c.DEFAULT_FLAGS)), Ze))
|
|
1166
1178
|
throw new Error(Ze);
|
|
1167
1179
|
pe.label = 12;
|
|
1168
1180
|
case 12:
|
|
@@ -1174,12 +1186,12 @@ var hs = { exports: {} };
|
|
|
1174
1186
|
}
|
|
1175
1187
|
});
|
|
1176
1188
|
});
|
|
1177
|
-
}, v.prototype._loadedState = function(f,
|
|
1178
|
-
return f === void 0 && (f = null), m === void 0 && (m = !1), { error: f, isFetching: m, isLoading: !1, source:
|
|
1189
|
+
}, v.prototype._loadedState = function(f, u, m) {
|
|
1190
|
+
return f === void 0 && (f = null), m === void 0 && (m = !1), { error: f, isFetching: m, isLoading: !1, source: u };
|
|
1179
1191
|
}, v.prototype.getAllFlags = function() {
|
|
1180
1192
|
return this.flags;
|
|
1181
|
-
}, v.prototype.identify = function(f,
|
|
1182
|
-
return this.evaluationContext.identity = { identifier: f, transient: m, traits: this.evaluationContext.identity && this.evaluationContext.identity.identifier == f ? this.evaluationContext.identity.traits : {} }, this.evaluationContext.identity.identifier = f, this.log("Identify: " + this.evaluationContext.identity.identifier),
|
|
1193
|
+
}, v.prototype.identify = function(f, u, m) {
|
|
1194
|
+
return this.evaluationContext.identity = { identifier: f, transient: m, traits: this.evaluationContext.identity && this.evaluationContext.identity.identifier == f ? this.evaluationContext.identity.traits : {} }, this.evaluationContext.identity.identifier = f, this.log("Identify: " + this.evaluationContext.identity.identifier), u && (this.evaluationContext.identity.traits = Object.fromEntries(Object.entries(u).map(function(g) {
|
|
1183
1195
|
var S = g[0], x = g[1];
|
|
1184
1196
|
return [S, y(x) ? x : { value: x }];
|
|
1185
1197
|
}))), this.initialised ? this.getFlags() : Promise.resolve();
|
|
@@ -1194,8 +1206,8 @@ var hs = { exports: {} };
|
|
|
1194
1206
|
}, v.prototype.stopListening = function() {
|
|
1195
1207
|
this.getFlagInterval && (clearInterval(this.getFlagInterval), this.getFlagInterval = null);
|
|
1196
1208
|
}, v.prototype.log = function() {
|
|
1197
|
-
for (var f = [],
|
|
1198
|
-
f[
|
|
1209
|
+
for (var f = [], u = 0; u < arguments.length; u++)
|
|
1210
|
+
f[u] = arguments[u];
|
|
1199
1211
|
this.enableLogs && console.log.apply(this, l(["FLAGSMITH:", (/* @__PURE__ */ new Date()).valueOf() - (this.timer || 0), "ms"], f, !0));
|
|
1200
1212
|
}, v.prototype.updateStorage = function() {
|
|
1201
1213
|
if (this.cacheFlags) {
|
|
@@ -1209,10 +1221,10 @@ var hs = { exports: {} };
|
|
|
1209
1221
|
D.setItem(A, f);
|
|
1210
1222
|
}
|
|
1211
1223
|
}, v.prototype.setLoadingState = function(f) {
|
|
1212
|
-
var
|
|
1213
|
-
a(f, this.loadingState) || (this.loadingState = i({}, f), this.log("Loading state changed", f), (
|
|
1214
|
-
}, v.prototype.setupRealtime = function(f,
|
|
1215
|
-
var m = this, g = f + "sse/environments/" +
|
|
1224
|
+
var u;
|
|
1225
|
+
a(f, this.loadingState) || (this.loadingState = i({}, f), this.log("Loading state changed", f), (u = this._triggerLoadingState) === null || u === void 0 || u.call(this));
|
|
1226
|
+
}, v.prototype.setupRealtime = function(f, u) {
|
|
1227
|
+
var m = this, g = f + "sse/environments/" + u + "/stream";
|
|
1216
1228
|
T ? this.eventSource || (this.log("Creating event source with url " + g), this.eventSource = new T(g), this.eventSource.addEventListener("environment_updated", function(S) {
|
|
1217
1229
|
var x;
|
|
1218
1230
|
try {
|
|
@@ -1225,37 +1237,37 @@ var hs = { exports: {} };
|
|
|
1225
1237
|
}, v;
|
|
1226
1238
|
}();
|
|
1227
1239
|
function E(v) {
|
|
1228
|
-
var f = v.fetch,
|
|
1229
|
-
return new C({ fetch: f, AsyncStorage:
|
|
1240
|
+
var f = v.fetch, u = v.AsyncStorage, m = v.eventSource;
|
|
1241
|
+
return new C({ fetch: f, AsyncStorage: u, eventSource: m });
|
|
1230
1242
|
}
|
|
1231
1243
|
var P, V = (P = function(v, f) {
|
|
1232
|
-
return P = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(
|
|
1233
|
-
|
|
1234
|
-
} || function(
|
|
1244
|
+
return P = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(u, m) {
|
|
1245
|
+
u.__proto__ = m;
|
|
1246
|
+
} || function(u, m) {
|
|
1235
1247
|
for (var g in m)
|
|
1236
|
-
Object.prototype.hasOwnProperty.call(m, g) && (
|
|
1248
|
+
Object.prototype.hasOwnProperty.call(m, g) && (u[g] = m[g]);
|
|
1237
1249
|
}, P(v, f);
|
|
1238
1250
|
}, function(v, f) {
|
|
1239
1251
|
if (typeof f != "function" && f !== null)
|
|
1240
1252
|
throw new TypeError("Class extends value " + String(f) + " is not a constructor or null");
|
|
1241
|
-
function
|
|
1253
|
+
function u() {
|
|
1242
1254
|
this.constructor = v;
|
|
1243
1255
|
}
|
|
1244
|
-
P(v, f), v.prototype = f === null ? Object.create(f) : (
|
|
1256
|
+
P(v, f), v.prototype = f === null ? Object.create(f) : (u.prototype = f.prototype, new u());
|
|
1245
1257
|
}), j = function(v) {
|
|
1246
|
-
var f = typeof Symbol == "function" && Symbol.iterator,
|
|
1247
|
-
if (
|
|
1248
|
-
return
|
|
1258
|
+
var f = typeof Symbol == "function" && Symbol.iterator, u = f && v[f], m = 0;
|
|
1259
|
+
if (u)
|
|
1260
|
+
return u.call(v);
|
|
1249
1261
|
if (v && typeof v.length == "number")
|
|
1250
1262
|
return { next: function() {
|
|
1251
1263
|
return v && m >= v.length && (v = void 0), { value: v && v[m++], done: !v };
|
|
1252
1264
|
} };
|
|
1253
1265
|
throw new TypeError(f ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
1254
1266
|
}, W = function(v, f) {
|
|
1255
|
-
var
|
|
1256
|
-
if (!
|
|
1267
|
+
var u = typeof Symbol == "function" && v[Symbol.iterator];
|
|
1268
|
+
if (!u)
|
|
1257
1269
|
return v;
|
|
1258
|
-
var m, g, S =
|
|
1270
|
+
var m, g, S = u.call(v), x = [];
|
|
1259
1271
|
try {
|
|
1260
1272
|
for (; (f === void 0 || f-- > 0) && !(m = S.next()).done; )
|
|
1261
1273
|
x.push(m.value);
|
|
@@ -1263,15 +1275,15 @@ var hs = { exports: {} };
|
|
|
1263
1275
|
g = { error: R };
|
|
1264
1276
|
} finally {
|
|
1265
1277
|
try {
|
|
1266
|
-
m && !m.done && (
|
|
1278
|
+
m && !m.done && (u = S.return) && u.call(S);
|
|
1267
1279
|
} finally {
|
|
1268
1280
|
if (g)
|
|
1269
1281
|
throw g.error;
|
|
1270
1282
|
}
|
|
1271
1283
|
}
|
|
1272
1284
|
return x;
|
|
1273
|
-
}, I = function(v, f,
|
|
1274
|
-
if (
|
|
1285
|
+
}, I = function(v, f, u) {
|
|
1286
|
+
if (u || arguments.length === 2)
|
|
1275
1287
|
for (var m, g = 0, S = f.length; g < S; g++)
|
|
1276
1288
|
!m && g in f || (m || (m = Array.prototype.slice.call(f, 0, g)), m[g] = f[g]);
|
|
1277
1289
|
return v.concat(m || Array.prototype.slice.call(f));
|
|
@@ -1282,9 +1294,9 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1282
1294
|
}
|
|
1283
1295
|
return V(f, v), f;
|
|
1284
1296
|
}(Error), q = function() {
|
|
1285
|
-
function v(f,
|
|
1297
|
+
function v(f, u) {
|
|
1286
1298
|
var m = this;
|
|
1287
|
-
if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration =
|
|
1299
|
+
if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = u != null ? Object.assign({}, u) : void 0, this.withCredentials = !1, this._eventSource = null, this._lastEventId = null, this._timer = null, this._listeners = { open: [], error: [], message: [] }, this.url = f.toString(), this.readyState = this.CONNECTING, this.max_retry_time = 3e3, this.eventSourceClass = globalThis.FlagsmithEventSource, this._configuration != null && (this._configuration.lastEventId && (this._lastEventId = this._configuration.lastEventId, delete this._configuration.lastEventId), this._configuration.max_retry_time && (this.max_retry_time = this._configuration.max_retry_time, delete this._configuration.max_retry_time), this._configuration.eventSourceClass && (this.eventSourceClass = this._configuration.eventSourceClass, delete this._configuration.eventSourceClass)), this.eventSourceClass == null || typeof this.eventSourceClass != "function")
|
|
1288
1300
|
throw new M();
|
|
1289
1301
|
this._onevent_wrapped = function(g) {
|
|
1290
1302
|
m._onevent(g);
|
|
@@ -1293,7 +1305,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1293
1305
|
return v.prototype.dispatchEvent = function(f) {
|
|
1294
1306
|
throw new Error("Method not implemented.");
|
|
1295
1307
|
}, v.prototype._start = function() {
|
|
1296
|
-
var f,
|
|
1308
|
+
var f, u, m = this, g = this.url;
|
|
1297
1309
|
this._lastEventId && (g.indexOf("?") === -1 ? g += "?" : g += "&", g += "lastEventId=" + encodeURIComponent(this._lastEventId)), this._eventSource = new this.eventSourceClass(g, this._configuration), this._eventSource.onopen = function(L) {
|
|
1298
1310
|
m._onopen(L);
|
|
1299
1311
|
}, this._eventSource.onerror = function(L) {
|
|
@@ -1310,7 +1322,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1310
1322
|
f = { error: L };
|
|
1311
1323
|
} finally {
|
|
1312
1324
|
try {
|
|
1313
|
-
x && !x.done && (
|
|
1325
|
+
x && !x.done && (u = S.return) && u.call(S);
|
|
1314
1326
|
} finally {
|
|
1315
1327
|
if (f)
|
|
1316
1328
|
throw f.error;
|
|
@@ -1319,16 +1331,16 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1319
1331
|
}, v.prototype._onopen = function(f) {
|
|
1320
1332
|
this.readyState === 0 && (this.readyState = 1, this.onopen(f));
|
|
1321
1333
|
}, v.prototype._onerror = function(f) {
|
|
1322
|
-
var
|
|
1334
|
+
var u = this;
|
|
1323
1335
|
if (this.readyState === 1 && (this.readyState = 0, this.onerror(f)), this._eventSource) {
|
|
1324
1336
|
this._eventSource.close(), this._eventSource = null;
|
|
1325
1337
|
var m = Math.round(this.max_retry_time * Math.random());
|
|
1326
1338
|
this._timer = setTimeout(function() {
|
|
1327
|
-
return
|
|
1339
|
+
return u._start();
|
|
1328
1340
|
}, m);
|
|
1329
1341
|
}
|
|
1330
1342
|
}, v.prototype._onevent = function(f) {
|
|
1331
|
-
var
|
|
1343
|
+
var u, m;
|
|
1332
1344
|
f && f.lastEventId && (this._lastEventId = f.lastEventId);
|
|
1333
1345
|
var g = this._listeners[f.type];
|
|
1334
1346
|
if (g != null)
|
|
@@ -1336,13 +1348,13 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1336
1348
|
for (var S = j(I([], W(g), !1)), x = S.next(); !x.done; x = S.next())
|
|
1337
1349
|
x.value.call(this, f);
|
|
1338
1350
|
} catch (R) {
|
|
1339
|
-
|
|
1351
|
+
u = { error: R };
|
|
1340
1352
|
} finally {
|
|
1341
1353
|
try {
|
|
1342
1354
|
x && !x.done && (m = S.return) && m.call(S);
|
|
1343
1355
|
} finally {
|
|
1344
|
-
if (
|
|
1345
|
-
throw
|
|
1356
|
+
if (u)
|
|
1357
|
+
throw u.error;
|
|
1346
1358
|
}
|
|
1347
1359
|
}
|
|
1348
1360
|
f.type === "message" && this.onmessage(f);
|
|
@@ -1351,20 +1363,20 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1351
1363
|
}, v.prototype.onmessage = function(f) {
|
|
1352
1364
|
}, v.prototype.close = function() {
|
|
1353
1365
|
this._timer && (clearTimeout(this._timer), this._timer = null), this._eventSource && (this._eventSource.close(), this._eventSource = null), this.readyState = 2;
|
|
1354
|
-
}, v.prototype.addEventListener = function(f,
|
|
1366
|
+
}, v.prototype.addEventListener = function(f, u, m) {
|
|
1355
1367
|
this._listeners[f] == null && (this._listeners[f] = [], this._eventSource != null && this._eventSource.addEventListener(f, this._onevent_wrapped));
|
|
1356
1368
|
var g = this._listeners[f];
|
|
1357
|
-
g.includes(
|
|
1358
|
-
}, v.prototype.removeEventListener = function(f,
|
|
1369
|
+
g.includes(u) || (this._listeners[f] = I(I([], W(g), !1), [u], !1));
|
|
1370
|
+
}, v.prototype.removeEventListener = function(f, u, m) {
|
|
1359
1371
|
var g = this._listeners[f];
|
|
1360
1372
|
this._listeners[f] = g.filter(function(S) {
|
|
1361
|
-
return S !==
|
|
1373
|
+
return S !== u;
|
|
1362
1374
|
});
|
|
1363
1375
|
}, v;
|
|
1364
1376
|
}();
|
|
1365
1377
|
globalThis.FlagsmithEventSource = typeof EventSource < "u" ? EventSource : null;
|
|
1366
1378
|
var G = function(v, f) {
|
|
1367
|
-
return f = f || {}, new Promise(function(
|
|
1379
|
+
return f = f || {}, new Promise(function(u, m) {
|
|
1368
1380
|
var g = new XMLHttpRequest(), S = [], x = [], R = {}, L = function() {
|
|
1369
1381
|
return { ok: (g.status / 100 | 0) == 2, statusText: g.statusText, status: g.status, url: g.responseURL, text: function() {
|
|
1370
1382
|
return Promise.resolve(g.responseText);
|
|
@@ -1385,7 +1397,7 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1385
1397
|
for (var z in g.open(f.method || "get", v, !0), g.onload = function() {
|
|
1386
1398
|
g.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(_, $, Z) {
|
|
1387
1399
|
S.push($ = $.toLowerCase()), x.push([$, Z]), R[$] = R[$] ? R[$] + "," + Z : Z;
|
|
1388
|
-
}),
|
|
1400
|
+
}), u(L());
|
|
1389
1401
|
}, g.onerror = m, g.withCredentials = f.credentials == "include", f.headers)
|
|
1390
1402
|
g.setRequestHeader(z, f.headers[z]);
|
|
1391
1403
|
g.send(f.body || null);
|
|
@@ -1395,22 +1407,22 @@ Consider loading an EventSource polyfill and making it available globally as Eve
|
|
|
1395
1407
|
return E({ AsyncStorage: n, fetch: G, eventSource: q });
|
|
1396
1408
|
}, s.default = H, Object.defineProperty(s, "__esModule", { value: !0 });
|
|
1397
1409
|
});
|
|
1398
|
-
})(
|
|
1399
|
-
var
|
|
1400
|
-
const
|
|
1401
|
-
var Ks = {},
|
|
1410
|
+
})(us, us.exports);
|
|
1411
|
+
var Hi = us.exports;
|
|
1412
|
+
const Jn = /* @__PURE__ */ Xn(Hi);
|
|
1413
|
+
var Ks = {}, zi = function(t, e, s, n, i) {
|
|
1402
1414
|
var r = new Worker(Ks[e] || (Ks[e] = URL.createObjectURL(new Blob([
|
|
1403
1415
|
t + ';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'
|
|
1404
1416
|
], { type: "text/javascript" }))));
|
|
1405
1417
|
return r.onmessage = function(o) {
|
|
1406
1418
|
var l = o.data, a = l.$e$;
|
|
1407
1419
|
if (a) {
|
|
1408
|
-
var
|
|
1409
|
-
|
|
1420
|
+
var h = new Error(a[0]);
|
|
1421
|
+
h.code = a[1], h.stack = a[2], i(h, null);
|
|
1410
1422
|
} else
|
|
1411
1423
|
i(null, l);
|
|
1412
1424
|
}, r.postMessage(s, n), r;
|
|
1413
|
-
}, fe = Uint8Array,
|
|
1425
|
+
}, fe = Uint8Array, re = Uint16Array, It = Int32Array, _t = new fe([
|
|
1414
1426
|
0,
|
|
1415
1427
|
0,
|
|
1416
1428
|
0,
|
|
@@ -1479,36 +1491,36 @@ var Ks = {}, Pi = function(t, e, s, n, i) {
|
|
|
1479
1491
|
/* unused */
|
|
1480
1492
|
0,
|
|
1481
1493
|
0
|
|
1482
|
-
]), ds = new fe([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]),
|
|
1483
|
-
for (var s = new
|
|
1494
|
+
]), ds = new fe([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Yn = function(t, e) {
|
|
1495
|
+
for (var s = new re(31), n = 0; n < 31; ++n)
|
|
1484
1496
|
s[n] = e += 1 << t[n - 1];
|
|
1485
1497
|
for (var i = new It(s[30]), n = 1; n < 30; ++n)
|
|
1486
1498
|
for (var r = s[n]; r < s[n + 1]; ++r)
|
|
1487
1499
|
i[r] = r - s[n] << 5 | n;
|
|
1488
1500
|
return { b: s, r: i };
|
|
1489
|
-
},
|
|
1490
|
-
|
|
1491
|
-
var
|
|
1501
|
+
}, Qn = Yn(_t, 2), Wi = Qn.b, vt = Qn.r;
|
|
1502
|
+
Wi[28] = 258, vt[258] = 28;
|
|
1503
|
+
var $i = Yn(Ot, 0), fs = $i.r, yt = new re(32768);
|
|
1492
1504
|
for (var X = 0; X < 32768; ++X) {
|
|
1493
1505
|
var Ie = (X & 43690) >> 1 | (X & 21845) << 1;
|
|
1494
1506
|
Ie = (Ie & 52428) >> 2 | (Ie & 13107) << 2, Ie = (Ie & 61680) >> 4 | (Ie & 3855) << 4, yt[X] = ((Ie & 65280) >> 8 | (Ie & 255) << 8) >> 1;
|
|
1495
1507
|
}
|
|
1496
1508
|
var qe = function(t, e, s) {
|
|
1497
|
-
for (var n = t.length, i = 0, r = new
|
|
1509
|
+
for (var n = t.length, i = 0, r = new re(e); i < n; ++i)
|
|
1498
1510
|
t[i] && ++r[t[i] - 1];
|
|
1499
|
-
var o = new
|
|
1511
|
+
var o = new re(e);
|
|
1500
1512
|
for (i = 1; i < e; ++i)
|
|
1501
1513
|
o[i] = o[i - 1] + r[i - 1] << 1;
|
|
1502
1514
|
var l;
|
|
1503
1515
|
if (s) {
|
|
1504
|
-
l = new
|
|
1516
|
+
l = new re(1 << e);
|
|
1505
1517
|
var a = 15 - e;
|
|
1506
1518
|
for (i = 0; i < n; ++i)
|
|
1507
1519
|
if (t[i])
|
|
1508
|
-
for (var
|
|
1509
|
-
l[yt[d] >> a] =
|
|
1520
|
+
for (var h = i << 4 | t[i], c = e - t[i], d = o[t[i] - 1]++ << c, p = d | (1 << c) - 1; d <= p; ++d)
|
|
1521
|
+
l[yt[d] >> a] = h;
|
|
1510
1522
|
} else
|
|
1511
|
-
for (l = new
|
|
1523
|
+
for (l = new re(n), i = 0; i < n; ++i)
|
|
1512
1524
|
t[i] && (l[i] = yt[o[t[i] - 1]++] >> 15 - t[i]);
|
|
1513
1525
|
return l;
|
|
1514
1526
|
}, Ne = new fe(288);
|
|
@@ -1523,11 +1535,11 @@ for (var X = 280; X < 288; ++X)
|
|
|
1523
1535
|
var nt = new fe(32);
|
|
1524
1536
|
for (var X = 0; X < 32; ++X)
|
|
1525
1537
|
nt[X] = 5;
|
|
1526
|
-
var
|
|
1538
|
+
var Zn = /* @__PURE__ */ qe(Ne, 9, 0), ei = /* @__PURE__ */ qe(nt, 5, 0), Os = function(t) {
|
|
1527
1539
|
return (t + 7) / 8 | 0;
|
|
1528
|
-
},
|
|
1540
|
+
}, ti = function(t, e, s) {
|
|
1529
1541
|
return (e == null || e < 0) && (e = 0), (s == null || s > t.length) && (s = t.length), new fe(t.subarray(e, s));
|
|
1530
|
-
},
|
|
1542
|
+
}, qi = [
|
|
1531
1543
|
"unexpected EOF",
|
|
1532
1544
|
"invalid block type",
|
|
1533
1545
|
"invalid length/literal",
|
|
@@ -1543,9 +1555,9 @@ var Kn = /* @__PURE__ */ qe(Ne, 9, 0), Xn = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1543
1555
|
"stream finishing",
|
|
1544
1556
|
"invalid zip data"
|
|
1545
1557
|
// determined by unknown compression method
|
|
1546
|
-
],
|
|
1547
|
-
var n = new Error(e ||
|
|
1548
|
-
if (n.code = t, Error.captureStackTrace && Error.captureStackTrace(n,
|
|
1558
|
+
], si = function(t, e, s) {
|
|
1559
|
+
var n = new Error(e || qi[t]);
|
|
1560
|
+
if (n.code = t, Error.captureStackTrace && Error.captureStackTrace(n, si), !s)
|
|
1549
1561
|
throw n;
|
|
1550
1562
|
return n;
|
|
1551
1563
|
}, be = function(t, e, s) {
|
|
@@ -1556,7 +1568,7 @@ var Kn = /* @__PURE__ */ qe(Ne, 9, 0), Xn = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1556
1568
|
s <<= e & 7;
|
|
1557
1569
|
var n = e / 8 | 0;
|
|
1558
1570
|
t[n] |= s, t[n + 1] |= s >> 8, t[n + 2] |= s >> 16;
|
|
1559
|
-
},
|
|
1571
|
+
}, ut = function(t, e) {
|
|
1560
1572
|
for (var s = [], n = 0; n < t.length; ++n)
|
|
1561
1573
|
t[n] && s.push({ s: n, f: t[n] });
|
|
1562
1574
|
var i = s.length, r = s.slice();
|
|
@@ -1569,12 +1581,12 @@ var Kn = /* @__PURE__ */ qe(Ne, 9, 0), Xn = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1569
1581
|
s.sort(function(O, N) {
|
|
1570
1582
|
return O.f - N.f;
|
|
1571
1583
|
}), s.push({ s: -1, f: 25001 });
|
|
1572
|
-
var l = s[0], a = s[1],
|
|
1584
|
+
var l = s[0], a = s[1], h = 0, c = 1, d = 2;
|
|
1573
1585
|
for (s[0] = { s: -1, f: l.f + a.f, l, r: a }; c != i - 1; )
|
|
1574
|
-
l = s[s[
|
|
1586
|
+
l = s[s[h].f < s[d].f ? h++ : d++], a = s[h != c && s[h].f < s[d].f ? h++ : d++], s[c++] = { s: -1, f: l.f + a.f, l, r: a };
|
|
1575
1587
|
for (var p = r[0].s, n = 1; n < i; ++n)
|
|
1576
1588
|
r[n].s > p && (p = r[n].s);
|
|
1577
|
-
var y = new
|
|
1589
|
+
var y = new re(p + 1), w = bt(s[c - 1], y, 0);
|
|
1578
1590
|
if (w > e) {
|
|
1579
1591
|
var n = 0, b = 0, T = w - e, D = 1 << T;
|
|
1580
1592
|
for (r.sort(function(N, F) {
|
|
@@ -1602,7 +1614,7 @@ var Kn = /* @__PURE__ */ qe(Ne, 9, 0), Xn = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1602
1614
|
}, ps = function(t) {
|
|
1603
1615
|
for (var e = t.length; e && !t[--e]; )
|
|
1604
1616
|
;
|
|
1605
|
-
for (var s = new
|
|
1617
|
+
for (var s = new re(++e), n = 0, i = t[0], r = 1, o = function(a) {
|
|
1606
1618
|
s[n++] = a;
|
|
1607
1619
|
}, l = 1; l <= e; ++l)
|
|
1608
1620
|
if (t[l] == i && l != e)
|
|
@@ -1632,17 +1644,17 @@ var Kn = /* @__PURE__ */ qe(Ne, 9, 0), Xn = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1632
1644
|
for (var r = 0; r < n; ++r)
|
|
1633
1645
|
t[i + r + 4] = s[r];
|
|
1634
1646
|
return (i + 4 + n) * 8;
|
|
1635
|
-
}, gs = function(t, e, s, n, i, r, o, l, a,
|
|
1647
|
+
}, gs = function(t, e, s, n, i, r, o, l, a, h, c) {
|
|
1636
1648
|
be(e, c++, s), ++i[256];
|
|
1637
|
-
for (var d =
|
|
1649
|
+
for (var d = ut(i, 15), p = d.t, y = d.l, w = ut(r, 15), b = w.t, T = w.l, D = ps(p), B = D.c, A = D.n, k = ps(b), O = k.c, N = k.n, F = new re(19), C = 0; C < B.length; ++C)
|
|
1638
1650
|
++F[B[C] & 31];
|
|
1639
1651
|
for (var C = 0; C < O.length; ++C)
|
|
1640
1652
|
++F[O[C] & 31];
|
|
1641
|
-
for (var E =
|
|
1653
|
+
for (var E = ut(F, 7), P = E.t, V = E.l, j = 19; j > 4 && !P[ds[j - 1]]; --j)
|
|
1642
1654
|
;
|
|
1643
|
-
var W =
|
|
1655
|
+
var W = h + 5 << 3, I = ze(i, Ne) + ze(r, nt) + o, M = ze(i, p) + ze(r, b) + o + 14 + 3 * j + ze(F, P) + 2 * F[16] + 3 * F[17] + 7 * F[18];
|
|
1644
1656
|
if (a >= 0 && W <= I && W <= M)
|
|
1645
|
-
return Ns(e, c, t.subarray(a, a +
|
|
1657
|
+
return Ns(e, c, t.subarray(a, a + h));
|
|
1646
1658
|
var q, G, H, v;
|
|
1647
1659
|
if (be(e, c, 1 + (M < I)), c += 2, M < I) {
|
|
1648
1660
|
q = qe(p, y, 0), G = p, H = qe(b, T, 0), v = b;
|
|
@@ -1651,13 +1663,13 @@ var Kn = /* @__PURE__ */ qe(Ne, 9, 0), Xn = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1651
1663
|
for (var C = 0; C < j; ++C)
|
|
1652
1664
|
be(e, c + 3 * C, P[ds[C]]);
|
|
1653
1665
|
c += 3 * j;
|
|
1654
|
-
for (var
|
|
1655
|
-
for (var g =
|
|
1666
|
+
for (var u = [B, O], m = 0; m < 2; ++m)
|
|
1667
|
+
for (var g = u[m], C = 0; C < g.length; ++C) {
|
|
1656
1668
|
var S = g[C] & 31;
|
|
1657
1669
|
be(e, c, f[S]), c += P[S], S > 15 && (be(e, c, g[C] >> 5 & 127), c += g[C] >> 12);
|
|
1658
1670
|
}
|
|
1659
1671
|
} else
|
|
1660
|
-
q =
|
|
1672
|
+
q = Zn, G = Ne, H = ei, v = nt;
|
|
1661
1673
|
for (var C = 0; C < l; ++C) {
|
|
1662
1674
|
var x = n[C];
|
|
1663
1675
|
if (x > 255) {
|
|
@@ -1669,72 +1681,72 @@ var Kn = /* @__PURE__ */ qe(Ne, 9, 0), Xn = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1669
1681
|
He(e, c, q[x]), c += G[x];
|
|
1670
1682
|
}
|
|
1671
1683
|
return He(e, c, q[256]), c + G[256];
|
|
1672
|
-
},
|
|
1673
|
-
var o = r.z || t.length, l = new fe(n + o + 5 * (1 + Math.ceil(o / 7e3)) + i), a = l.subarray(n, l.length - i),
|
|
1684
|
+
}, ni = /* @__PURE__ */ new It([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), Rs = /* @__PURE__ */ new fe(0), ii = function(t, e, s, n, i, r) {
|
|
1685
|
+
var o = r.z || t.length, l = new fe(n + o + 5 * (1 + Math.ceil(o / 7e3)) + i), a = l.subarray(n, l.length - i), h = r.l, c = (r.r || 0) & 7;
|
|
1674
1686
|
if (e) {
|
|
1675
1687
|
c && (a[0] = r.r >> 3);
|
|
1676
|
-
for (var d =
|
|
1677
|
-
return (t[
|
|
1678
|
-
}, k = new It(25e3), O = new
|
|
1688
|
+
for (var d = ni[e - 1], p = d >> 13, y = d & 8191, w = (1 << s) - 1, b = r.p || new re(32768), T = r.h || new re(w + 1), D = Math.ceil(s / 3), B = 2 * D, A = function(se) {
|
|
1689
|
+
return (t[se] ^ t[se + 1] << D ^ t[se + 2] << B) & w;
|
|
1690
|
+
}, k = new It(25e3), O = new re(288), N = new re(32), F = 0, C = 0, E = r.i || 0, P = 0, V = r.w || 0, j = 0; E + 2 < o; ++E) {
|
|
1679
1691
|
var W = A(E), I = E & 32767, M = T[W];
|
|
1680
1692
|
if (b[I] = M, T[W] = I, V <= E) {
|
|
1681
1693
|
var q = o - E;
|
|
1682
|
-
if ((F > 7e3 || P > 24576) && (q > 423 || !
|
|
1694
|
+
if ((F > 7e3 || P > 24576) && (q > 423 || !h)) {
|
|
1683
1695
|
c = gs(t, a, 0, k, O, N, C, P, j, E - j, c), P = F = C = 0, j = E;
|
|
1684
1696
|
for (var G = 0; G < 286; ++G)
|
|
1685
1697
|
O[G] = 0;
|
|
1686
1698
|
for (var G = 0; G < 30; ++G)
|
|
1687
1699
|
N[G] = 0;
|
|
1688
1700
|
}
|
|
1689
|
-
var H = 2, v = 0, f = y,
|
|
1690
|
-
if (q > 2 && W == A(E -
|
|
1691
|
-
for (var m = Math.min(p, q) - 1, g = Math.min(32767, E), S = Math.min(258, q);
|
|
1692
|
-
if (t[E + H] == t[E + H -
|
|
1693
|
-
for (var x = 0; x < S && t[E + x] == t[E + x -
|
|
1701
|
+
var H = 2, v = 0, f = y, u = I - M & 32767;
|
|
1702
|
+
if (q > 2 && W == A(E - u))
|
|
1703
|
+
for (var m = Math.min(p, q) - 1, g = Math.min(32767, E), S = Math.min(258, q); u <= g && --f && I != M; ) {
|
|
1704
|
+
if (t[E + H] == t[E + H - u]) {
|
|
1705
|
+
for (var x = 0; x < S && t[E + x] == t[E + x - u]; ++x)
|
|
1694
1706
|
;
|
|
1695
1707
|
if (x > H) {
|
|
1696
|
-
if (H = x, v =
|
|
1708
|
+
if (H = x, v = u, x > m)
|
|
1697
1709
|
break;
|
|
1698
|
-
for (var R = Math.min(
|
|
1699
|
-
var z = E -
|
|
1710
|
+
for (var R = Math.min(u, x - 2), L = 0, G = 0; G < R; ++G) {
|
|
1711
|
+
var z = E - u + G & 32767, _ = b[z], $ = z - _ & 32767;
|
|
1700
1712
|
$ > L && (L = $, M = z);
|
|
1701
1713
|
}
|
|
1702
1714
|
}
|
|
1703
1715
|
}
|
|
1704
|
-
I = M, M = b[I],
|
|
1716
|
+
I = M, M = b[I], u += I - M & 32767;
|
|
1705
1717
|
}
|
|
1706
1718
|
if (v) {
|
|
1707
1719
|
k[P++] = 268435456 | vt[H] << 18 | fs[v];
|
|
1708
|
-
var Z = vt[H] & 31,
|
|
1709
|
-
C += _t[Z] + Ot[
|
|
1720
|
+
var Z = vt[H] & 31, oe = fs[v] & 31;
|
|
1721
|
+
C += _t[Z] + Ot[oe], ++O[257 + Z], ++N[oe], V = E + H, ++F;
|
|
1710
1722
|
} else
|
|
1711
1723
|
k[P++] = t[E], ++O[t[E]];
|
|
1712
1724
|
}
|
|
1713
1725
|
}
|
|
1714
1726
|
for (E = Math.max(E, V); E < o; ++E)
|
|
1715
1727
|
k[P++] = t[E], ++O[t[E]];
|
|
1716
|
-
c = gs(t, a,
|
|
1728
|
+
c = gs(t, a, h, k, O, N, C, P, j, E - j, c), h || (r.r = c & 7 | a[c / 8 | 0] << 3, c -= 7, r.h = T, r.p = b, r.i = E, r.w = V);
|
|
1717
1729
|
} else {
|
|
1718
|
-
for (var E = r.w || 0; E < o +
|
|
1730
|
+
for (var E = r.w || 0; E < o + h; E += 65535) {
|
|
1719
1731
|
var ee = E + 65535;
|
|
1720
|
-
ee >= o && (a[c / 8 | 0] =
|
|
1732
|
+
ee >= o && (a[c / 8 | 0] = h, ee = o), c = Ns(a, c + 1, t.subarray(E, ee));
|
|
1721
1733
|
}
|
|
1722
1734
|
r.i = o;
|
|
1723
1735
|
}
|
|
1724
|
-
return
|
|
1725
|
-
},
|
|
1736
|
+
return ti(l, 0, n + Os(c) + i);
|
|
1737
|
+
}, ri = /* @__PURE__ */ function() {
|
|
1726
1738
|
for (var t = new Int32Array(256), e = 0; e < 256; ++e) {
|
|
1727
1739
|
for (var s = e, n = 9; --n; )
|
|
1728
1740
|
s = (s & 1 && -306674912) ^ s >>> 1;
|
|
1729
1741
|
t[e] = s;
|
|
1730
1742
|
}
|
|
1731
1743
|
return t;
|
|
1732
|
-
}(),
|
|
1744
|
+
}(), oi = function() {
|
|
1733
1745
|
var t = -1;
|
|
1734
1746
|
return {
|
|
1735
1747
|
p: function(e) {
|
|
1736
1748
|
for (var s = t, n = 0; n < e.length; ++n)
|
|
1737
|
-
s =
|
|
1749
|
+
s = ri[s & 255 ^ e[n]] ^ s >>> 8;
|
|
1738
1750
|
t = s;
|
|
1739
1751
|
},
|
|
1740
1752
|
d: function() {
|
|
@@ -1746,8 +1758,8 @@ var Kn = /* @__PURE__ */ qe(Ne, 9, 0), Xn = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1746
1758
|
var r = e.dictionary.subarray(-32768), o = new fe(r.length + t.length);
|
|
1747
1759
|
o.set(r), o.set(t, r.length), t = o, i.w = r.length;
|
|
1748
1760
|
}
|
|
1749
|
-
return
|
|
1750
|
-
},
|
|
1761
|
+
return ii(t, e.level == null ? 6 : e.level, e.mem == null ? i.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(t.length))) * 1.5) : 20 : 12 + e.mem, s, n, i);
|
|
1762
|
+
}, Vi = function(t, e) {
|
|
1751
1763
|
var s = {};
|
|
1752
1764
|
for (var n in t)
|
|
1753
1765
|
s[n] = t[n];
|
|
@@ -1759,43 +1771,43 @@ var Kn = /* @__PURE__ */ qe(Ne, 9, 0), Xn = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1759
1771
|
var l = n[o], a = r[o];
|
|
1760
1772
|
if (typeof l == "function") {
|
|
1761
1773
|
e += ";" + a + "=";
|
|
1762
|
-
var
|
|
1774
|
+
var h = l.toString();
|
|
1763
1775
|
if (l.prototype)
|
|
1764
|
-
if (
|
|
1765
|
-
var c =
|
|
1766
|
-
e +=
|
|
1776
|
+
if (h.indexOf("[native code]") != -1) {
|
|
1777
|
+
var c = h.indexOf(" ", 8) + 1;
|
|
1778
|
+
e += h.slice(c, h.indexOf("(", c));
|
|
1767
1779
|
} else {
|
|
1768
|
-
e +=
|
|
1780
|
+
e += h;
|
|
1769
1781
|
for (var d in l.prototype)
|
|
1770
1782
|
e += ";" + a + ".prototype." + d + "=" + l.prototype[d].toString();
|
|
1771
1783
|
}
|
|
1772
1784
|
else
|
|
1773
|
-
e +=
|
|
1785
|
+
e += h;
|
|
1774
1786
|
} else
|
|
1775
1787
|
s[a] = l;
|
|
1776
1788
|
}
|
|
1777
1789
|
return e;
|
|
1778
|
-
}, it = [],
|
|
1790
|
+
}, it = [], Gi = function(t) {
|
|
1779
1791
|
var e = [];
|
|
1780
1792
|
for (var s in t)
|
|
1781
1793
|
t[s].buffer && e.push((t[s] = new t[s].constructor(t[s])).buffer);
|
|
1782
1794
|
return e;
|
|
1783
|
-
},
|
|
1795
|
+
}, Ki = function(t, e, s, n) {
|
|
1784
1796
|
if (!it[s]) {
|
|
1785
1797
|
for (var i = "", r = {}, o = t.length - 1, l = 0; l < o; ++l)
|
|
1786
1798
|
i = Xs(t[l], i, r);
|
|
1787
1799
|
it[s] = { c: Xs(t[o], i, r), e: r };
|
|
1788
1800
|
}
|
|
1789
|
-
var a =
|
|
1790
|
-
return
|
|
1791
|
-
},
|
|
1792
|
-
return [fe,
|
|
1793
|
-
},
|
|
1794
|
-
return [
|
|
1795
|
-
},
|
|
1801
|
+
var a = Vi({}, it[s].e);
|
|
1802
|
+
return zi(it[s].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + e.toString() + "}", s, a, Gi(a), n);
|
|
1803
|
+
}, Xi = function() {
|
|
1804
|
+
return [fe, re, It, _t, Ot, ds, vt, fs, Zn, Ne, ei, nt, yt, ni, Rs, qe, be, He, ut, bt, ps, ze, Ns, gs, Os, ti, ii, Ds, Qi, ai];
|
|
1805
|
+
}, Ji = function() {
|
|
1806
|
+
return [ci, li, St, oi, ri];
|
|
1807
|
+
}, ai = function(t) {
|
|
1796
1808
|
return postMessage(t, [t.buffer]);
|
|
1797
|
-
},
|
|
1798
|
-
var o =
|
|
1809
|
+
}, Yi = function(t, e, s, n, i, r) {
|
|
1810
|
+
var o = Ki(s, n, i, function(l, a) {
|
|
1799
1811
|
o.terminate(), r(l, a);
|
|
1800
1812
|
});
|
|
1801
1813
|
return o.postMessage([t, e], e.consume ? [t.buffer] : []), function() {
|
|
@@ -1804,40 +1816,40 @@ var Kn = /* @__PURE__ */ qe(Ne, 9, 0), Xn = /* @__PURE__ */ qe(nt, 5, 0), Os = f
|
|
|
1804
1816
|
}, St = function(t, e, s) {
|
|
1805
1817
|
for (; s; ++e)
|
|
1806
1818
|
t[e] = s, s >>>= 8;
|
|
1807
|
-
},
|
|
1819
|
+
}, ci = function(t, e) {
|
|
1808
1820
|
var s = e.filename;
|
|
1809
1821
|
if (t[0] = 31, t[1] = 139, t[2] = 8, t[8] = e.level < 2 ? 4 : e.level == 9 ? 2 : 0, t[9] = 3, e.mtime != 0 && St(t, 4, Math.floor(new Date(e.mtime || Date.now()) / 1e3)), s) {
|
|
1810
1822
|
t[3] = 8;
|
|
1811
1823
|
for (var n = 0; n <= s.length; ++n)
|
|
1812
1824
|
t[n + 10] = s.charCodeAt(n);
|
|
1813
1825
|
}
|
|
1814
|
-
},
|
|
1826
|
+
}, li = function(t) {
|
|
1815
1827
|
return 10 + (t.filename ? t.filename.length + 1 : 0);
|
|
1816
1828
|
};
|
|
1817
|
-
function
|
|
1829
|
+
function Qi(t, e) {
|
|
1818
1830
|
return Ds(t, e || {}, 0, 0);
|
|
1819
1831
|
}
|
|
1820
|
-
function
|
|
1821
|
-
return s || (s = e, e = {}), typeof s != "function" &&
|
|
1822
|
-
|
|
1823
|
-
|
|
1832
|
+
function Zi(t, e, s) {
|
|
1833
|
+
return s || (s = e, e = {}), typeof s != "function" && si(7), Yi(t, e, [
|
|
1834
|
+
Xi,
|
|
1835
|
+
Ji,
|
|
1824
1836
|
function() {
|
|
1825
1837
|
return [Js];
|
|
1826
1838
|
}
|
|
1827
1839
|
], function(n) {
|
|
1828
|
-
return
|
|
1840
|
+
return ai(Js(n.data[0], n.data[1]));
|
|
1829
1841
|
}, 2, s);
|
|
1830
1842
|
}
|
|
1831
1843
|
function Js(t, e) {
|
|
1832
1844
|
e || (e = {});
|
|
1833
|
-
var s =
|
|
1845
|
+
var s = oi(), n = t.length;
|
|
1834
1846
|
s.p(t);
|
|
1835
|
-
var i = Ds(t, e,
|
|
1836
|
-
return
|
|
1847
|
+
var i = Ds(t, e, li(e), 8), r = i.length;
|
|
1848
|
+
return ci(i, e), St(i, r - 8, s.d()), St(i, r - 4, n), i;
|
|
1837
1849
|
}
|
|
1838
|
-
var
|
|
1850
|
+
var er = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), tr = 0;
|
|
1839
1851
|
try {
|
|
1840
|
-
|
|
1852
|
+
er.decode(Rs, { stream: !0 }), tr = 1;
|
|
1841
1853
|
} catch {
|
|
1842
1854
|
}
|
|
1843
1855
|
class Ys {
|
|
@@ -1849,7 +1861,7 @@ class Ys {
|
|
|
1849
1861
|
return this.backDict[e] || (s = !0, this.backDict[e] = this.idx++), [this.backDict[e], s];
|
|
1850
1862
|
}
|
|
1851
1863
|
}
|
|
1852
|
-
class
|
|
1864
|
+
class sr {
|
|
1853
1865
|
constructor(e, s) {
|
|
1854
1866
|
this.app = e, this.isDictDisabled = s, this.dict = new Ys();
|
|
1855
1867
|
}
|
|
@@ -1875,11 +1887,11 @@ class Yi {
|
|
|
1875
1887
|
this.dict = new Ys();
|
|
1876
1888
|
}
|
|
1877
1889
|
}
|
|
1878
|
-
class
|
|
1890
|
+
class nr {
|
|
1879
1891
|
constructor(e, s) {
|
|
1880
1892
|
this.app = e, this.startParams = s, this.conditions = [], this.hasStarted = !1, this.createConditionFromFilter = (n) => {
|
|
1881
1893
|
if (n.value.length) {
|
|
1882
|
-
const i =
|
|
1894
|
+
const i = ir(n);
|
|
1883
1895
|
if (i.type)
|
|
1884
1896
|
return i;
|
|
1885
1897
|
}
|
|
@@ -1898,15 +1910,15 @@ class Qi {
|
|
|
1898
1910
|
}), { conditions: i } = await n.json(), r = [];
|
|
1899
1911
|
i.forEach((o) => {
|
|
1900
1912
|
o.filters.forEach((a) => {
|
|
1901
|
-
let
|
|
1902
|
-
a.type === "fetch" ? (
|
|
1913
|
+
let h;
|
|
1914
|
+
a.type === "fetch" ? (h = {
|
|
1903
1915
|
type: "network_request",
|
|
1904
1916
|
subConditions: [],
|
|
1905
1917
|
name: o.name
|
|
1906
1918
|
}, a.filters.forEach((c) => {
|
|
1907
1919
|
const d = this.createConditionFromFilter(c);
|
|
1908
|
-
d &&
|
|
1909
|
-
})) :
|
|
1920
|
+
d && h.subConditions.push(d);
|
|
1921
|
+
})) : h = this.createConditionFromFilter(a), h && (h.type === "session_duration" && this.processDuration(h.value[0], o.name), r.push({ ...h, name: o.name }));
|
|
1910
1922
|
});
|
|
1911
1923
|
}), this.conditions = r;
|
|
1912
1924
|
} catch {
|
|
@@ -2022,7 +2034,7 @@ const Be = {
|
|
|
2022
2034
|
greaterOrEqual: (t, e) => t >= e,
|
|
2023
2035
|
lessOrEqual: (t, e) => t <= e,
|
|
2024
2036
|
lessThan: (t, e) => t < e
|
|
2025
|
-
},
|
|
2037
|
+
}, ir = (t) => {
|
|
2026
2038
|
const e = {
|
|
2027
2039
|
on: "is",
|
|
2028
2040
|
notOn: "isNot",
|
|
@@ -2130,7 +2142,7 @@ const Be = {
|
|
|
2130
2142
|
}
|
|
2131
2143
|
return n;
|
|
2132
2144
|
};
|
|
2133
|
-
class
|
|
2145
|
+
class rr {
|
|
2134
2146
|
constructor(e) {
|
|
2135
2147
|
this.app = e, this.flags = [], this.storageKey = "__openreplay_flags";
|
|
2136
2148
|
const s = this.app.sessionStorage.getItem(this.storageKey);
|
|
@@ -2175,8 +2187,8 @@ class er {
|
|
|
2175
2187
|
body: JSON.stringify(o)
|
|
2176
2188
|
});
|
|
2177
2189
|
if (a.status === 200) {
|
|
2178
|
-
const
|
|
2179
|
-
return this.handleFlags(
|
|
2190
|
+
const h = await a.json();
|
|
2191
|
+
return this.handleFlags(h.flags);
|
|
2180
2192
|
}
|
|
2181
2193
|
}
|
|
2182
2194
|
handleFlags(e) {
|
|
@@ -2201,7 +2213,7 @@ class er {
|
|
|
2201
2213
|
return e.filter((r) => i.findIndex((o) => o.key === r.key) === -1);
|
|
2202
2214
|
}
|
|
2203
2215
|
}
|
|
2204
|
-
const Qs = { htmlmasked: "hidden", masked: "obscured" }, xe = !(typeof window > "u"),
|
|
2216
|
+
const Qs = { htmlmasked: "hidden", masked: "obscured" }, xe = !(typeof window > "u"), or = xe && navigator.userAgent.match(/firefox|fxios/i), ar = 1e5;
|
|
2205
2217
|
let As = xe ? Date.now() - performance.now() : 0;
|
|
2206
2218
|
function Zt() {
|
|
2207
2219
|
As = Date.now() - performance.now();
|
|
@@ -2210,10 +2222,10 @@ function Ge() {
|
|
|
2210
2222
|
return As;
|
|
2211
2223
|
}
|
|
2212
2224
|
const ge = xe && performance.now ? () => Math.round(performance.now() + As) : () => Date.now(), es = "repeat" in String.prototype ? (t) => "*".repeat(t.length) : (t) => t.replace(/./g, "*");
|
|
2213
|
-
function
|
|
2225
|
+
function hi(t) {
|
|
2214
2226
|
return t.trim().replace(/\s+/g, " ");
|
|
2215
2227
|
}
|
|
2216
|
-
function
|
|
2228
|
+
function ui(t) {
|
|
2217
2229
|
return t.startsWith("https://") || t.startsWith("http://");
|
|
2218
2230
|
}
|
|
2219
2231
|
const wt = "https://docs.openreplay.com", Zs = {};
|
|
@@ -2233,7 +2245,7 @@ function Fe(t, e) {
|
|
|
2233
2245
|
"/installation/sanitize-data"
|
|
2234
2246
|
), !0) : !1;
|
|
2235
2247
|
}
|
|
2236
|
-
function
|
|
2248
|
+
function cr(t) {
|
|
2237
2249
|
try {
|
|
2238
2250
|
return !!t.contentDocument;
|
|
2239
2251
|
} catch {
|
|
@@ -2243,11 +2255,11 @@ function nr(t) {
|
|
|
2243
2255
|
function en(t) {
|
|
2244
2256
|
return t.toString(16).padStart(2, "0");
|
|
2245
2257
|
}
|
|
2246
|
-
function
|
|
2258
|
+
function lr(t) {
|
|
2247
2259
|
const e = new Uint8Array((t || 40) / 2), s = window.crypto || window.msCrypto;
|
|
2248
2260
|
return s ? (s.getRandomValues(e), Array.from(e, en).join("")) : Array.from({ length: t || 40 }, () => en(Math.floor(Math.random() * 16))).join("");
|
|
2249
2261
|
}
|
|
2250
|
-
function
|
|
2262
|
+
function hr() {
|
|
2251
2263
|
try {
|
|
2252
2264
|
return window.self && window.top && window.self !== window.top;
|
|
2253
2265
|
} catch {
|
|
@@ -2260,11 +2272,11 @@ function Ms(t) {
|
|
|
2260
2272
|
window.Zone.__symbol__(t)
|
|
2261
2273
|
) : t;
|
|
2262
2274
|
}
|
|
2263
|
-
function
|
|
2275
|
+
function di(t) {
|
|
2264
2276
|
const e = Ms("MutationObserver");
|
|
2265
2277
|
return new window[e](t);
|
|
2266
2278
|
}
|
|
2267
|
-
function
|
|
2279
|
+
function fi(t, e, s, n) {
|
|
2268
2280
|
const i = Ms("addEventListener");
|
|
2269
2281
|
try {
|
|
2270
2282
|
t[i](e, s, n);
|
|
@@ -2276,7 +2288,7 @@ function ci(t, e, s, n) {
|
|
|
2276
2288
|
);
|
|
2277
2289
|
}
|
|
2278
2290
|
}
|
|
2279
|
-
function
|
|
2291
|
+
function pi(t, e, s, n) {
|
|
2280
2292
|
const i = Ms("removeEventListener");
|
|
2281
2293
|
try {
|
|
2282
2294
|
t[i](e, s, n);
|
|
@@ -2288,7 +2300,7 @@ function li(t, e, s, n) {
|
|
|
2288
2300
|
);
|
|
2289
2301
|
}
|
|
2290
2302
|
}
|
|
2291
|
-
class
|
|
2303
|
+
class ur {
|
|
2292
2304
|
constructor() {
|
|
2293
2305
|
this.taskQueue = [], this.isRunning = !1;
|
|
2294
2306
|
}
|
|
@@ -2314,16 +2326,16 @@ class or {
|
|
|
2314
2326
|
e();
|
|
2315
2327
|
}
|
|
2316
2328
|
}
|
|
2317
|
-
const
|
|
2318
|
-
function
|
|
2319
|
-
|
|
2329
|
+
const dr = new ur();
|
|
2330
|
+
function fr(t) {
|
|
2331
|
+
dr.addTask(t);
|
|
2320
2332
|
}
|
|
2321
|
-
function
|
|
2333
|
+
function gi(t, e) {
|
|
2322
2334
|
const s = { ...t };
|
|
2323
2335
|
for (const n in e)
|
|
2324
2336
|
if (e.hasOwnProperty(n)) {
|
|
2325
2337
|
const i = e[n], r = t[n];
|
|
2326
|
-
typeof i == "object" && !Array.isArray(i) && i !== null ? s[n] =
|
|
2338
|
+
typeof i == "object" && !Array.isArray(i) && i !== null ? s[n] = gi(r || {}, i) : s[n] = i;
|
|
2327
2339
|
}
|
|
2328
2340
|
return s;
|
|
2329
2341
|
}
|
|
@@ -2333,26 +2345,26 @@ function De(t) {
|
|
|
2333
2345
|
t
|
|
2334
2346
|
];
|
|
2335
2347
|
}
|
|
2336
|
-
function
|
|
2348
|
+
function pr(t, e) {
|
|
2337
2349
|
return [
|
|
2338
2350
|
5,
|
|
2339
2351
|
t,
|
|
2340
2352
|
e
|
|
2341
2353
|
];
|
|
2342
2354
|
}
|
|
2343
|
-
function
|
|
2355
|
+
function gr(t, e) {
|
|
2344
2356
|
return [
|
|
2345
2357
|
6,
|
|
2346
2358
|
t,
|
|
2347
2359
|
e
|
|
2348
2360
|
];
|
|
2349
2361
|
}
|
|
2350
|
-
function
|
|
2362
|
+
function mr() {
|
|
2351
2363
|
return [
|
|
2352
2364
|
7
|
|
2353
2365
|
];
|
|
2354
2366
|
}
|
|
2355
|
-
function
|
|
2367
|
+
function vr(t, e, s, n, i) {
|
|
2356
2368
|
return [
|
|
2357
2369
|
8,
|
|
2358
2370
|
t,
|
|
@@ -2362,7 +2374,7 @@ function dr(t, e, s, n, i) {
|
|
|
2362
2374
|
i
|
|
2363
2375
|
];
|
|
2364
2376
|
}
|
|
2365
|
-
function
|
|
2377
|
+
function yr(t, e, s) {
|
|
2366
2378
|
return [
|
|
2367
2379
|
9,
|
|
2368
2380
|
t,
|
|
@@ -2370,7 +2382,7 @@ function fr(t, e, s) {
|
|
|
2370
2382
|
s
|
|
2371
2383
|
];
|
|
2372
2384
|
}
|
|
2373
|
-
function
|
|
2385
|
+
function br(t, e, s) {
|
|
2374
2386
|
return [
|
|
2375
2387
|
10,
|
|
2376
2388
|
t,
|
|
@@ -2378,7 +2390,7 @@ function pr(t, e, s) {
|
|
|
2378
2390
|
s
|
|
2379
2391
|
];
|
|
2380
2392
|
}
|
|
2381
|
-
function
|
|
2393
|
+
function Sr(t) {
|
|
2382
2394
|
return [
|
|
2383
2395
|
11,
|
|
2384
2396
|
t
|
|
@@ -2391,14 +2403,14 @@ function tn(t, e) {
|
|
|
2391
2403
|
e
|
|
2392
2404
|
];
|
|
2393
2405
|
}
|
|
2394
|
-
function
|
|
2406
|
+
function wr(t, e) {
|
|
2395
2407
|
return [
|
|
2396
2408
|
14,
|
|
2397
2409
|
t,
|
|
2398
2410
|
e
|
|
2399
2411
|
];
|
|
2400
2412
|
}
|
|
2401
|
-
function
|
|
2413
|
+
function xr(t, e, s) {
|
|
2402
2414
|
return [
|
|
2403
2415
|
16,
|
|
2404
2416
|
t,
|
|
@@ -2406,7 +2418,7 @@ function vr(t, e, s) {
|
|
|
2406
2418
|
s
|
|
2407
2419
|
];
|
|
2408
2420
|
}
|
|
2409
|
-
function
|
|
2421
|
+
function kr(t, e, s) {
|
|
2410
2422
|
return [
|
|
2411
2423
|
18,
|
|
2412
2424
|
t,
|
|
@@ -2414,28 +2426,28 @@ function yr(t, e, s) {
|
|
|
2414
2426
|
s
|
|
2415
2427
|
];
|
|
2416
2428
|
}
|
|
2417
|
-
function
|
|
2429
|
+
function Tr(t, e) {
|
|
2418
2430
|
return [
|
|
2419
2431
|
19,
|
|
2420
2432
|
t,
|
|
2421
2433
|
e
|
|
2422
2434
|
];
|
|
2423
2435
|
}
|
|
2424
|
-
function
|
|
2436
|
+
function Er(t, e) {
|
|
2425
2437
|
return [
|
|
2426
2438
|
20,
|
|
2427
2439
|
t,
|
|
2428
2440
|
e
|
|
2429
2441
|
];
|
|
2430
2442
|
}
|
|
2431
|
-
function
|
|
2443
|
+
function Cr(t, e) {
|
|
2432
2444
|
return [
|
|
2433
2445
|
22,
|
|
2434
2446
|
t,
|
|
2435
2447
|
e
|
|
2436
2448
|
];
|
|
2437
2449
|
}
|
|
2438
|
-
function
|
|
2450
|
+
function Ir(t, e, s, n, i, r, o, l, a) {
|
|
2439
2451
|
return [
|
|
2440
2452
|
23,
|
|
2441
2453
|
t,
|
|
@@ -2449,7 +2461,7 @@ function xr(t, e, s, n, i, r, o, l, a) {
|
|
|
2449
2461
|
a
|
|
2450
2462
|
];
|
|
2451
2463
|
}
|
|
2452
|
-
function
|
|
2464
|
+
function _r(t, e, s) {
|
|
2453
2465
|
return [
|
|
2454
2466
|
24,
|
|
2455
2467
|
t,
|
|
@@ -2457,20 +2469,20 @@ function kr(t, e, s) {
|
|
|
2457
2469
|
s
|
|
2458
2470
|
];
|
|
2459
2471
|
}
|
|
2460
|
-
function
|
|
2472
|
+
function Or(t, e) {
|
|
2461
2473
|
return [
|
|
2462
2474
|
27,
|
|
2463
2475
|
t,
|
|
2464
2476
|
e
|
|
2465
2477
|
];
|
|
2466
2478
|
}
|
|
2467
|
-
function
|
|
2479
|
+
function Nr(t) {
|
|
2468
2480
|
return [
|
|
2469
2481
|
28,
|
|
2470
2482
|
t
|
|
2471
2483
|
];
|
|
2472
2484
|
}
|
|
2473
|
-
function
|
|
2485
|
+
function Rr(t) {
|
|
2474
2486
|
return [
|
|
2475
2487
|
29,
|
|
2476
2488
|
t
|
|
@@ -2483,7 +2495,7 @@ function sn(t, e) {
|
|
|
2483
2495
|
e
|
|
2484
2496
|
];
|
|
2485
2497
|
}
|
|
2486
|
-
function
|
|
2498
|
+
function Dr(t, e, s, n) {
|
|
2487
2499
|
return [
|
|
2488
2500
|
49,
|
|
2489
2501
|
t,
|
|
@@ -2492,14 +2504,14 @@ function Ir(t, e, s, n) {
|
|
|
2492
2504
|
n
|
|
2493
2505
|
];
|
|
2494
2506
|
}
|
|
2495
|
-
function
|
|
2507
|
+
function Ar(t, e) {
|
|
2496
2508
|
return [
|
|
2497
2509
|
54,
|
|
2498
2510
|
t,
|
|
2499
2511
|
e
|
|
2500
2512
|
];
|
|
2501
2513
|
}
|
|
2502
|
-
function
|
|
2514
|
+
function Fr(t) {
|
|
2503
2515
|
return [
|
|
2504
2516
|
55,
|
|
2505
2517
|
t
|
|
@@ -2529,7 +2541,7 @@ function ms(t, e, s, n) {
|
|
|
2529
2541
|
n
|
|
2530
2542
|
];
|
|
2531
2543
|
}
|
|
2532
|
-
function
|
|
2544
|
+
function Mr(t, e, s) {
|
|
2533
2545
|
return [
|
|
2534
2546
|
61,
|
|
2535
2547
|
t,
|
|
@@ -2537,21 +2549,21 @@ function Nr(t, e, s) {
|
|
|
2537
2549
|
s
|
|
2538
2550
|
];
|
|
2539
2551
|
}
|
|
2540
|
-
function
|
|
2552
|
+
function Lr(t, e) {
|
|
2541
2553
|
return [
|
|
2542
2554
|
63,
|
|
2543
2555
|
t,
|
|
2544
2556
|
e
|
|
2545
2557
|
];
|
|
2546
2558
|
}
|
|
2547
|
-
function
|
|
2559
|
+
function Pr(t, e) {
|
|
2548
2560
|
return [
|
|
2549
2561
|
64,
|
|
2550
2562
|
t,
|
|
2551
2563
|
e
|
|
2552
2564
|
];
|
|
2553
2565
|
}
|
|
2554
|
-
function
|
|
2566
|
+
function Br(t, e, s, n, i, r) {
|
|
2555
2567
|
return [
|
|
2556
2568
|
68,
|
|
2557
2569
|
t,
|
|
@@ -2593,14 +2605,14 @@ function an(t, e) {
|
|
|
2593
2605
|
e
|
|
2594
2606
|
];
|
|
2595
2607
|
}
|
|
2596
|
-
function
|
|
2608
|
+
function mi(t, e) {
|
|
2597
2609
|
return [
|
|
2598
2610
|
76,
|
|
2599
2611
|
t,
|
|
2600
2612
|
e
|
|
2601
2613
|
];
|
|
2602
2614
|
}
|
|
2603
|
-
function
|
|
2615
|
+
function jr(t, e) {
|
|
2604
2616
|
return [
|
|
2605
2617
|
77,
|
|
2606
2618
|
t,
|
|
@@ -2630,7 +2642,7 @@ function xt(t, e, s, n, i, r, o, l, a) {
|
|
|
2630
2642
|
a
|
|
2631
2643
|
];
|
|
2632
2644
|
}
|
|
2633
|
-
function
|
|
2645
|
+
function Ur(t, e, s, n, i, r) {
|
|
2634
2646
|
return [
|
|
2635
2647
|
84,
|
|
2636
2648
|
t,
|
|
@@ -2641,7 +2653,7 @@ function Mr(t, e, s, n, i, r) {
|
|
|
2641
2653
|
r
|
|
2642
2654
|
];
|
|
2643
2655
|
}
|
|
2644
|
-
function
|
|
2656
|
+
function Hr(t, e, s, n, i, r) {
|
|
2645
2657
|
return [
|
|
2646
2658
|
112,
|
|
2647
2659
|
t,
|
|
@@ -2660,19 +2672,19 @@ function cn(t, e, s) {
|
|
|
2660
2672
|
s
|
|
2661
2673
|
];
|
|
2662
2674
|
}
|
|
2663
|
-
function
|
|
2675
|
+
function zr(t) {
|
|
2664
2676
|
return [
|
|
2665
2677
|
114,
|
|
2666
2678
|
t
|
|
2667
2679
|
];
|
|
2668
2680
|
}
|
|
2669
|
-
function
|
|
2681
|
+
function Wr(t) {
|
|
2670
2682
|
return [
|
|
2671
2683
|
115,
|
|
2672
2684
|
t
|
|
2673
2685
|
];
|
|
2674
2686
|
}
|
|
2675
|
-
function
|
|
2687
|
+
function vi(t, e, s, n, i, r, o, l, a, h) {
|
|
2676
2688
|
return [
|
|
2677
2689
|
116,
|
|
2678
2690
|
t,
|
|
@@ -2684,7 +2696,7 @@ function di(t, e, s, n, i, r, o, l, a, u) {
|
|
|
2684
2696
|
o,
|
|
2685
2697
|
l,
|
|
2686
2698
|
a,
|
|
2687
|
-
|
|
2699
|
+
h
|
|
2688
2700
|
];
|
|
2689
2701
|
}
|
|
2690
2702
|
function dt(t) {
|
|
@@ -2699,20 +2711,20 @@ function Ae(t) {
|
|
|
2699
2711
|
t
|
|
2700
2712
|
];
|
|
2701
2713
|
}
|
|
2702
|
-
function
|
|
2714
|
+
function $r(t, e) {
|
|
2703
2715
|
return [
|
|
2704
2716
|
119,
|
|
2705
2717
|
t,
|
|
2706
2718
|
e
|
|
2707
2719
|
];
|
|
2708
2720
|
}
|
|
2709
|
-
function
|
|
2721
|
+
function qr(t) {
|
|
2710
2722
|
return [
|
|
2711
2723
|
120,
|
|
2712
2724
|
t
|
|
2713
2725
|
];
|
|
2714
2726
|
}
|
|
2715
|
-
function
|
|
2727
|
+
function Vr(t, e, s, n) {
|
|
2716
2728
|
return [
|
|
2717
2729
|
122,
|
|
2718
2730
|
t,
|
|
@@ -2722,7 +2734,7 @@ function Hr(t, e, s, n) {
|
|
|
2722
2734
|
];
|
|
2723
2735
|
}
|
|
2724
2736
|
const Ss = xe && "performance" in window && "memory" in performance ? performance : { memory: {} }, ts = xe ? (navigator.deviceMemory || 0) * 1024 : 0, ss = Ss.memory.jsHeapSizeLimit || 0;
|
|
2725
|
-
function
|
|
2737
|
+
function Gr(t, e) {
|
|
2726
2738
|
if (!Object.assign({
|
|
2727
2739
|
capturePerformance: !0
|
|
2728
2740
|
}, e).capturePerformance)
|
|
@@ -2735,7 +2747,7 @@ function zr(t, e) {
|
|
|
2735
2747
|
i === void 0 || i === -1 || i++;
|
|
2736
2748
|
}, 0, !1);
|
|
2737
2749
|
const o = () => {
|
|
2738
|
-
n === void 0 || i === void 0 || (t.send(
|
|
2750
|
+
n === void 0 || i === void 0 || (t.send(Dr(n, i, Ss.memory.totalJSHeapSize || 0, Ss.memory.usedJSHeapSize || 0)), i = n = document.hidden ? -1 : 0);
|
|
2739
2751
|
};
|
|
2740
2752
|
t.attachStartCallback(() => {
|
|
2741
2753
|
i = n = -1, o(), r();
|
|
@@ -2744,7 +2756,7 @@ function zr(t, e) {
|
|
|
2744
2756
|
}), t.ticker.attach(o, 40, !1), document.hidden !== void 0 && t.attachEventListener(document, "visibilitychange", o, !1, !1);
|
|
2745
2757
|
}
|
|
2746
2758
|
const ln = "__or__watched_tags__";
|
|
2747
|
-
class
|
|
2759
|
+
class Kr {
|
|
2748
2760
|
constructor(e, s, n) {
|
|
2749
2761
|
this.sessionStorage = e, this.errLog = s, this.onTag = n, this.intervals = {}, this.tags = [];
|
|
2750
2762
|
const i = JSON.parse(e.getItem(ln) ?? "[]");
|
|
@@ -2791,7 +2803,7 @@ class Wr {
|
|
|
2791
2803
|
}), this.tags = [], this.intervals = {}, this.observer.disconnect();
|
|
2792
2804
|
}
|
|
2793
2805
|
}
|
|
2794
|
-
const
|
|
2806
|
+
const Xr = {
|
|
2795
2807
|
position: "fixed",
|
|
2796
2808
|
top: 0,
|
|
2797
2809
|
left: 0,
|
|
@@ -2803,7 +2815,7 @@ const $r = {
|
|
|
2803
2815
|
justifyContent: "center",
|
|
2804
2816
|
zIndex: 999999,
|
|
2805
2817
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"'
|
|
2806
|
-
},
|
|
2818
|
+
}, Jr = {
|
|
2807
2819
|
display: "flex",
|
|
2808
2820
|
flexDirection: "column",
|
|
2809
2821
|
gap: "2rem",
|
|
@@ -2824,14 +2836,14 @@ const $r = {
|
|
|
2824
2836
|
border: "1px solid #D9D9D9",
|
|
2825
2837
|
background: "rgba(255, 255, 255, 0.75)",
|
|
2826
2838
|
width: "22rem"
|
|
2827
|
-
},
|
|
2839
|
+
}, Yr = {
|
|
2828
2840
|
fontFamily: "Verdana, sans-serif",
|
|
2829
2841
|
fontSize: "1.25rem",
|
|
2830
2842
|
fontStyle: "normal",
|
|
2831
2843
|
fontWeight: "500",
|
|
2832
2844
|
lineHeight: "1.75rem",
|
|
2833
2845
|
color: "rgba(0, 0, 0, 0.85)"
|
|
2834
|
-
},
|
|
2846
|
+
}, Qr = {
|
|
2835
2847
|
borderTop: "1px solid rgba(0, 0, 0, 0.06)",
|
|
2836
2848
|
borderBottom: "1px solid rgba(0, 0, 0, 0.06)",
|
|
2837
2849
|
padding: "1.25rem 0rem",
|
|
@@ -2842,7 +2854,7 @@ const $r = {
|
|
|
2842
2854
|
fontWeight: "400",
|
|
2843
2855
|
lineHeight: "auto",
|
|
2844
2856
|
whiteSpace: "pre-wrap"
|
|
2845
|
-
},
|
|
2857
|
+
}, Zr = {
|
|
2846
2858
|
display: "flex",
|
|
2847
2859
|
padding: "0.4rem 0.9375rem",
|
|
2848
2860
|
justifyContent: "center",
|
|
@@ -2860,7 +2872,7 @@ const $r = {
|
|
|
2860
2872
|
fontWeight: "500",
|
|
2861
2873
|
lineHeight: "1.5rem",
|
|
2862
2874
|
cursor: "pointer"
|
|
2863
|
-
},
|
|
2875
|
+
}, hn = {
|
|
2864
2876
|
fontFamily: "Verdana, sans-serif",
|
|
2865
2877
|
fontSize: "13px",
|
|
2866
2878
|
fontWeight: "500",
|
|
@@ -2876,7 +2888,7 @@ const $r = {
|
|
|
2876
2888
|
gap: "0.625rem",
|
|
2877
2889
|
fontSize: "13px",
|
|
2878
2890
|
lineHeight: "auto"
|
|
2879
|
-
},
|
|
2891
|
+
}, eo = {
|
|
2880
2892
|
padding: "0.5rem",
|
|
2881
2893
|
gap: "0.5rem",
|
|
2882
2894
|
fontFamily: "Verdana, sans-serif",
|
|
@@ -2905,13 +2917,13 @@ const $r = {
|
|
|
2905
2917
|
fontStyle: "normal",
|
|
2906
2918
|
fontWeight: "400"
|
|
2907
2919
|
// lineHeight: '1.375rem',
|
|
2908
|
-
},
|
|
2920
|
+
}, to = {
|
|
2909
2921
|
...We,
|
|
2910
2922
|
display: "flex",
|
|
2911
2923
|
flexDirection: "column",
|
|
2912
2924
|
alignItems: "center",
|
|
2913
2925
|
gap: "0.625rem"
|
|
2914
|
-
},
|
|
2926
|
+
}, un = {
|
|
2915
2927
|
fontSize: "1.25rem",
|
|
2916
2928
|
fontWeight: "500",
|
|
2917
2929
|
cursor: "pointer",
|
|
@@ -2944,7 +2956,7 @@ const $r = {
|
|
|
2944
2956
|
fontWeight: "500",
|
|
2945
2957
|
fontSize: "13px!important",
|
|
2946
2958
|
lineHeight: "auto"
|
|
2947
|
-
},
|
|
2959
|
+
}, so = {
|
|
2948
2960
|
display: "flex",
|
|
2949
2961
|
justifyContent: "space-between",
|
|
2950
2962
|
alignItems: "center",
|
|
@@ -2962,7 +2974,7 @@ const $r = {
|
|
|
2962
2974
|
fontSize: "13px",
|
|
2963
2975
|
height: "24px",
|
|
2964
2976
|
width: "24px"
|
|
2965
|
-
},
|
|
2977
|
+
}, no = {
|
|
2966
2978
|
display: "flex",
|
|
2967
2979
|
flexDirection: "column",
|
|
2968
2980
|
alignItems: "center",
|
|
@@ -2986,10 +2998,10 @@ const $r = {
|
|
|
2986
2998
|
alignSelf: "stretch"
|
|
2987
2999
|
}, mn = {
|
|
2988
3000
|
fontWeight: "bold"
|
|
2989
|
-
},
|
|
3001
|
+
}, io = {
|
|
2990
3002
|
fontSize: "13px",
|
|
2991
3003
|
lineHeight: "auto"
|
|
2992
|
-
},
|
|
3004
|
+
}, yi = {
|
|
2993
3005
|
marginRight: "0.5rem",
|
|
2994
3006
|
cursor: "pointer",
|
|
2995
3007
|
color: "#394EFF",
|
|
@@ -2999,8 +3011,8 @@ const $r = {
|
|
|
2999
3011
|
fontStyle: "normal",
|
|
3000
3012
|
fontWeight: "500",
|
|
3001
3013
|
lineHeight: "auto"
|
|
3002
|
-
},
|
|
3003
|
-
...
|
|
3014
|
+
}, ro = {
|
|
3015
|
+
...yi,
|
|
3004
3016
|
display: "flex",
|
|
3005
3017
|
padding: "0.25rem 0.9375rem",
|
|
3006
3018
|
justifyContent: "center",
|
|
@@ -3008,13 +3020,13 @@ const $r = {
|
|
|
3008
3020
|
gap: "0.5rem",
|
|
3009
3021
|
borderRadius: "0.25rem",
|
|
3010
3022
|
border: "1px solid #394EFF"
|
|
3011
|
-
},
|
|
3023
|
+
}, oo = {
|
|
3012
3024
|
display: "flex",
|
|
3013
3025
|
justifyContent: "space-between",
|
|
3014
3026
|
alignItems: "center",
|
|
3015
3027
|
width: "100%",
|
|
3016
3028
|
boxSizing: "border-box"
|
|
3017
|
-
},
|
|
3029
|
+
}, ao = {
|
|
3018
3030
|
border: "4px solid rgba(255, 255, 255, 0.4)",
|
|
3019
3031
|
width: "16px",
|
|
3020
3032
|
height: "16px",
|
|
@@ -3025,7 +3037,7 @@ const $r = {
|
|
|
3025
3037
|
Standard: { width: 1280, height: 720 },
|
|
3026
3038
|
High: { width: 1920, height: 1080 }
|
|
3027
3039
|
};
|
|
3028
|
-
class
|
|
3040
|
+
class co {
|
|
3029
3041
|
constructor(e) {
|
|
3030
3042
|
this.app = e, this.mediaRecorder = null, this.recordedChunks = [], this.stream = null, this.recStartTs = null;
|
|
3031
3043
|
}
|
|
@@ -3084,16 +3096,16 @@ class no {
|
|
|
3084
3096
|
(e = this.mediaRecorder) == null || e.stop(), (s = this.stream) == null || s.getTracks().forEach((n) => n.stop());
|
|
3085
3097
|
}
|
|
3086
3098
|
}
|
|
3087
|
-
function
|
|
3099
|
+
function lo(t, e) {
|
|
3088
3100
|
e.onmousedown = function(s) {
|
|
3089
3101
|
const n = t.getBoundingClientRect(), i = s.clientX - n.left, r = s.clientY - n.top;
|
|
3090
3102
|
t.style.position = "fixed", t.style.zIndex = 99999999999999, o(s.pageX, s.pageY);
|
|
3091
|
-
function o(
|
|
3092
|
-
let d =
|
|
3103
|
+
function o(h, c) {
|
|
3104
|
+
let d = h - i, p = c - r;
|
|
3093
3105
|
d <= 5 && (d = 5), p <= 5 && (p = 5), d >= window.innerWidth - n.width && (d = window.innerWidth - n.width), p >= window.innerHeight - n.height && (p = window.innerHeight - n.height), t.style.left = `${d}px`, t.style.top = `${p}px`;
|
|
3094
3106
|
}
|
|
3095
|
-
function l(
|
|
3096
|
-
o(
|
|
3107
|
+
function l(h) {
|
|
3108
|
+
o(h.pageX, h.pageY);
|
|
3097
3109
|
}
|
|
3098
3110
|
document.addEventListener("mousemove", l);
|
|
3099
3111
|
const a = () => {
|
|
@@ -3104,7 +3116,7 @@ function io(t, e) {
|
|
|
3104
3116
|
return !1;
|
|
3105
3117
|
};
|
|
3106
3118
|
}
|
|
3107
|
-
function
|
|
3119
|
+
function ho() {
|
|
3108
3120
|
const t = document.createElement("div");
|
|
3109
3121
|
t.className = "grid";
|
|
3110
3122
|
for (let e = 0; e < 16; e++) {
|
|
@@ -3124,7 +3136,7 @@ function ro() {
|
|
|
3124
3136
|
cursor: "grab"
|
|
3125
3137
|
}), t;
|
|
3126
3138
|
}
|
|
3127
|
-
function
|
|
3139
|
+
function uo() {
|
|
3128
3140
|
const t = document.createElement("div");
|
|
3129
3141
|
Object.assign(t.style, {
|
|
3130
3142
|
width: "0",
|
|
@@ -3145,26 +3157,26 @@ function oo() {
|
|
|
3145
3157
|
transform: "rotate(180deg)"
|
|
3146
3158
|
}), e;
|
|
3147
3159
|
}
|
|
3148
|
-
function
|
|
3160
|
+
function fo() {
|
|
3149
3161
|
const t = document.createElement("style");
|
|
3150
3162
|
t.type = "text/css", t.innerText = `@keyframes spin {
|
|
3151
3163
|
0% { transform: rotate(0deg); }
|
|
3152
3164
|
100% { transform: rotate(360deg); }
|
|
3153
3165
|
}`, document.head.appendChild(t);
|
|
3154
3166
|
}
|
|
3155
|
-
function
|
|
3156
|
-
|
|
3167
|
+
function po() {
|
|
3168
|
+
fo();
|
|
3157
3169
|
const t = document.createElement("div");
|
|
3158
|
-
return t.classList.add("spinner"), Object.assign(t.style,
|
|
3170
|
+
return t.classList.add("spinner"), Object.assign(t.style, ao), t;
|
|
3159
3171
|
}
|
|
3160
3172
|
function U(t, e, s, n, i) {
|
|
3161
3173
|
const r = document.createElement(t);
|
|
3162
3174
|
return r.className = e, Object.assign(r.style, s), n && (r.textContent = n), i && (r.id = i), r;
|
|
3163
3175
|
}
|
|
3164
|
-
const ft = "or_uxt_test_start", ws = "or_uxt_task_index", xs = "or_uxt_session_id",
|
|
3165
|
-
class
|
|
3166
|
-
constructor(e, s, n, i, r, o, l, a,
|
|
3167
|
-
this.ingestPoint = e, this.getTimestamp = s, this.token = n, this.testId = i, this.storageKey = r, this.setStorageKey = o, this.removeStorageKey = l, this.getStorageKey = a, this.getSessionId =
|
|
3176
|
+
const ft = "or_uxt_test_start", ws = "or_uxt_task_index", xs = "or_uxt_session_id", go = "or_uxt_test_id";
|
|
3177
|
+
class mo {
|
|
3178
|
+
constructor(e, s, n, i, r, o, l, a, h) {
|
|
3179
|
+
this.ingestPoint = e, this.getTimestamp = s, this.token = n, this.testId = i, this.storageKey = r, this.setStorageKey = o, this.removeStorageKey = l, this.getStorageKey = a, this.getSessionId = h, this.durations = {
|
|
3168
3180
|
testStart: 0,
|
|
3169
3181
|
tasks: []
|
|
3170
3182
|
}, this.getDurations = () => this.durations, this.setDurations = (d) => {
|
|
@@ -3214,24 +3226,24 @@ class uo {
|
|
|
3214
3226
|
c && (this.durations.testStart = parseInt(c, 10));
|
|
3215
3227
|
}
|
|
3216
3228
|
}
|
|
3217
|
-
class
|
|
3229
|
+
class vo {
|
|
3218
3230
|
constructor(e, s) {
|
|
3219
|
-
this.app = e, this.storageKey = s, this.bg = U("div", "bg",
|
|
3231
|
+
this.app = e, this.storageKey = s, this.bg = U("div", "bg", Xr, void 0, "__or_ut_bg"), this.container = U("div", "container", Jr, void 0, "__or_ut_ct"), this.widgetGuidelinesVisible = !0, this.widgetTasksVisible = !1, this.widgetVisible = !0, this.isActive = !1, this.descriptionSection = null, this.taskSection = null, this.endSection = null, this.stopButton = null, this.stopButtonContainer = null, this.test = null, this.testId = null, this.signalManager = null, this.getTest = (o, l, a) => {
|
|
3220
3232
|
this.testId = o;
|
|
3221
|
-
const
|
|
3222
|
-
return fetch(`${
|
|
3233
|
+
const h = this.app.options.ingestPoint;
|
|
3234
|
+
return fetch(`${h}/v1/web/uxt/test/${o}`, {
|
|
3223
3235
|
headers: {
|
|
3224
3236
|
Authorization: `Bearer ${l}`
|
|
3225
3237
|
}
|
|
3226
3238
|
}).then((c) => c.json()).then(({ test: c }) => {
|
|
3227
|
-
this.isActive = !0, this.test = c, this.signalManager = new
|
|
3239
|
+
this.isActive = !0, this.test = c, this.signalManager = new mo(this.app.options.ingestPoint, () => this.app.timestamp(), l, o, this.storageKey, (d, p) => this.app.localStorage.setItem(d, p), (d) => this.app.localStorage.removeItem(d), (d) => this.app.localStorage.getItem(d), () => this.app.getSessionID()), this.createGreeting(c.title, c.reqMic, c.reqCamera), a && ((c.reqMic || c.reqCamera) && this.userRecorder.startRecording(30, vn.Standard, c.reqMic, c.reqCamera), this.showWidget(c.description, c.tasks, !0), this.showTaskSection());
|
|
3228
3240
|
}).then(() => o).catch((c) => {
|
|
3229
3241
|
console.log("OR: Error fetching test", c);
|
|
3230
3242
|
});
|
|
3231
3243
|
}, this.hideTaskSection = () => !1, this.showTaskSection = () => !0, this.collapseWidget = () => !1, this.removeGreeting = () => !1, this.toggleDescriptionVisibility = () => {
|
|
3232
|
-
}, this.currentTaskIndex = 0, this.userRecorder = new
|
|
3244
|
+
}, this.currentTaskIndex = 0, this.userRecorder = new co(e);
|
|
3233
3245
|
const n = this.app.getSessionID(), i = this.app.localStorage.getItem(xs);
|
|
3234
|
-
n !== i && (this.app.localStorage.removeItem(this.storageKey), this.app.localStorage.removeItem(xs), this.app.localStorage.removeItem(
|
|
3246
|
+
n !== i && (this.app.localStorage.removeItem(this.storageKey), this.app.localStorage.removeItem(xs), this.app.localStorage.removeItem(go), this.app.localStorage.removeItem(ws), this.app.localStorage.removeItem(ft));
|
|
3235
3247
|
const r = this.app.localStorage.getItem(ws);
|
|
3236
3248
|
r && (this.currentTaskIndex = parseInt(r, 10));
|
|
3237
3249
|
}
|
|
@@ -3239,15 +3251,15 @@ class ho {
|
|
|
3239
3251
|
return this.testId;
|
|
3240
3252
|
}
|
|
3241
3253
|
createGreeting(e, s, n) {
|
|
3242
|
-
const i = U("div", "title",
|
|
3254
|
+
const i = U("div", "title", Yr, e), r = U("div", "description", Qr, `Welcome, you're here to help us improve, not to be judged. Your insights matter!
|
|
3243
3255
|
|
|
3244
3256
|
📹 We're recording this browser tab to learn from your experience.
|
|
3245
|
-
🎤 Please enable mic and camera if asked, to give us a complete picture.`), o = U("div", "button",
|
|
3257
|
+
🎤 Please enable mic and camera if asked, to give us a complete picture.`), o = U("div", "button", Zr, "Read guidelines to begin");
|
|
3246
3258
|
this.removeGreeting = () => ((s || n) && this.userRecorder.startRecording(30, vn.Standard, s, n), this.container.removeChild(o), this.container.removeChild(r), this.container.removeChild(i), !1), o.onclick = () => {
|
|
3247
|
-
var a,
|
|
3259
|
+
var a, h, c, d;
|
|
3248
3260
|
this.removeGreeting();
|
|
3249
3261
|
const l = (a = this.signalManager) == null ? void 0 : a.getDurations();
|
|
3250
|
-
l && this.signalManager && (l.testStart = this.app.timestamp(), this.signalManager.setDurations(l)), (
|
|
3262
|
+
l && this.signalManager && (l.testStart = this.app.timestamp(), this.signalManager.setDurations(l)), (h = this.signalManager) == null || h.signalTest("begin"), this.container.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Object.assign(this.container.style, rt), this.showWidget(((c = this.test) == null ? void 0 : c.guidelines) || "", ((d = this.test) == null ? void 0 : d.tasks) || []);
|
|
3251
3263
|
}, this.container.append(i, r, o), this.bg.appendChild(this.container), document.body.appendChild(this.bg);
|
|
3252
3264
|
}
|
|
3253
3265
|
showWidget(e, s, n) {
|
|
@@ -3268,13 +3280,13 @@ class ho {
|
|
|
3268
3280
|
this.container.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Object.assign(this.container.style, rt);
|
|
3269
3281
|
const r = this.createDescriptionSection(e), o = this.createTasksSection(s), l = U("div", "stop_bn_or", fn, "Abort Session"), a = U("div", "stop_ct_or", { fontSize: "13px!important" });
|
|
3270
3282
|
a.style.fontSize = "13px", a.append(l), this.container.append(i, r, o, a), this.taskSection = o, this.descriptionSection = r, this.stopButton = l, this.stopButtonContainer = a, l.onclick = () => {
|
|
3271
|
-
var
|
|
3272
|
-
this.userRecorder.discard(), (
|
|
3283
|
+
var h;
|
|
3284
|
+
this.userRecorder.discard(), (h = this.signalManager) == null || h.signalTest("skipped"), document.body.removeChild(this.bg), window.close();
|
|
3273
3285
|
}, n ? this.toggleDescriptionVisibility() : this.hideTaskSection();
|
|
3274
3286
|
}
|
|
3275
3287
|
createTitleSection() {
|
|
3276
3288
|
var l;
|
|
3277
|
-
const e = U("div", "title",
|
|
3289
|
+
const e = U("div", "title", eo), s = ho(), n = U("div", "title_text", {
|
|
3278
3290
|
maxWidth: "19rem",
|
|
3279
3291
|
overflow: "hidden",
|
|
3280
3292
|
textOverflow: "ellipsis",
|
|
@@ -3282,21 +3294,21 @@ class ho {
|
|
|
3282
3294
|
fontSize: 16,
|
|
3283
3295
|
lineHeight: "auto",
|
|
3284
3296
|
cursor: "pointer"
|
|
3285
|
-
}, (l = this.test) == null ? void 0 : l.title), i =
|
|
3297
|
+
}, (l = this.test) == null ? void 0 : l.title), i = uo();
|
|
3286
3298
|
e.append(s, n, i);
|
|
3287
3299
|
const r = (a) => (this.widgetVisible = a, this.container.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Object.assign(this.container.style, this.widgetVisible ? rt : { border: "none", background: "none", padding: 0 }), this.taskSection && Object.assign(this.taskSection.style, this.widgetVisible ? We : { display: "none" }), this.descriptionSection && Object.assign(this.descriptionSection.style, this.widgetVisible ? We : { display: "none" }), this.endSection && Object.assign(this.endSection.style, this.widgetVisible ? We : { display: "none" }), this.stopButton && Object.assign(this.stopButton.style, this.widgetVisible ? fn : { display: "none" }), a), o = () => {
|
|
3288
3300
|
Object.assign(i.style, {
|
|
3289
3301
|
transform: this.widgetVisible ? "rotate(0deg)" : "rotate(180deg)"
|
|
3290
3302
|
}), r(!this.widgetVisible);
|
|
3291
3303
|
};
|
|
3292
|
-
return n.onclick = o, i.onclick = o,
|
|
3304
|
+
return n.onclick = o, i.onclick = o, lo(this.bg, s), this.collapseWidget = () => r(!1), e;
|
|
3293
3305
|
}
|
|
3294
3306
|
createDescriptionSection(e) {
|
|
3295
|
-
const s = U("div", "description_section_or", We), n = U("div", "description_s_title_or",
|
|
3307
|
+
const s = U("div", "description_section_or", We), n = U("div", "description_s_title_or", hn), i = U("div", "title", {
|
|
3296
3308
|
fontSize: 13,
|
|
3297
3309
|
fontWeight: 500,
|
|
3298
3310
|
lineHeight: "auto"
|
|
3299
|
-
}, "Introduction & Guidelines"), r = U("div", "icon",
|
|
3311
|
+
}, "Introduction & Guidelines"), r = U("div", "icon", un, "-"), o = U("div", "content", je), l = U("div", "text_description", {
|
|
3300
3312
|
maxHeight: "250px",
|
|
3301
3313
|
overflowY: "auto",
|
|
3302
3314
|
whiteSpace: "pre-wrap",
|
|
@@ -3307,14 +3319,14 @@ class ho {
|
|
|
3307
3319
|
l.innerHTML = e;
|
|
3308
3320
|
const a = U("div", "button_begin_or", dn, "Begin Test");
|
|
3309
3321
|
n.append(i, r), o.append(l, a), s.append(n, o);
|
|
3310
|
-
const
|
|
3322
|
+
const h = () => {
|
|
3311
3323
|
this.widgetGuidelinesVisible = !this.widgetGuidelinesVisible, r.textContent = this.widgetGuidelinesVisible ? "-" : "+", Object.assign(o.style, this.widgetGuidelinesVisible ? je : { display: "none" });
|
|
3312
3324
|
};
|
|
3313
|
-
return n.onclick =
|
|
3325
|
+
return n.onclick = h, this.toggleDescriptionVisibility = () => {
|
|
3314
3326
|
this.widgetGuidelinesVisible = !1, r.textContent = this.widgetGuidelinesVisible ? "-" : "+", Object.assign(o.style, this.widgetGuidelinesVisible ? je : { display: "none" }), o.removeChild(a);
|
|
3315
3327
|
}, a.onclick = () => {
|
|
3316
3328
|
var c, d, p;
|
|
3317
|
-
if (
|
|
3329
|
+
if (h(), this.test) {
|
|
3318
3330
|
const y = (c = this.signalManager) == null ? void 0 : c.getDurations(), w = y ? y.tasks.findIndex((b) => this.test && b.taskId === this.test.tasks[0].task_id) : null;
|
|
3319
3331
|
y && w === -1 && (y.tasks.push({
|
|
3320
3332
|
taskId: this.test.tasks[0].task_id,
|
|
@@ -3326,21 +3338,21 @@ class ho {
|
|
|
3326
3338
|
}
|
|
3327
3339
|
createTasksSection(e) {
|
|
3328
3340
|
this.container.style.fontFamily = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"', Object.assign(this.container.style, rt);
|
|
3329
|
-
const s = U("div", "task_section_or", We), n = U("div", "description_t_title_or",
|
|
3341
|
+
const s = U("div", "task_section_or", We), n = U("div", "description_t_title_or", hn), i = U("div", "title", {
|
|
3330
3342
|
fontSize: "13px",
|
|
3331
3343
|
fontWeight: "500",
|
|
3332
3344
|
lineHeight: "auto"
|
|
3333
|
-
}, "Tasks"), r = U("div", "icon",
|
|
3345
|
+
}, "Tasks"), r = U("div", "icon", un, "-"), o = U("div", "content", je), l = U("div", "pagination", so), a = U("div", "taskCard", gn), h = U("div", "taskText", mn), c = U("div", "taskDescription", io), d = U("div", "taskButtons", oo), p = U("div", "taskText", mn);
|
|
3334
3346
|
p.textContent = "Your answer";
|
|
3335
3347
|
const y = U("textarea", "taskDescription", {
|
|
3336
3348
|
resize: "vertical"
|
|
3337
3349
|
}), w = U("div", "inputArea", gn);
|
|
3338
3350
|
w.append(p, y);
|
|
3339
|
-
const b = U("div", "closePanelButton",
|
|
3340
|
-
n.append(i, r), a.append(
|
|
3351
|
+
const b = U("div", "closePanelButton", yi, "Collapse Panel"), T = U("div", "nextButton", ro, "Done, Next");
|
|
3352
|
+
n.append(i, r), a.append(h, c), d.append(b, T), o.append(l, a, w, d), s.append(n, o);
|
|
3341
3353
|
const D = () => {
|
|
3342
3354
|
const k = e[this.currentTaskIndex];
|
|
3343
|
-
|
|
3355
|
+
h.textContent = k.title, c.textContent = k.description, k.allow_typing ? w.style.display = "flex" : w.style.display = "none";
|
|
3344
3356
|
};
|
|
3345
3357
|
e.forEach((k, O) => {
|
|
3346
3358
|
const N = U("span", `or_task_${O}`, {
|
|
@@ -3367,7 +3379,7 @@ class ho {
|
|
|
3367
3379
|
k && Object.assign(k.style, pn);
|
|
3368
3380
|
for (let O = 0; O < this.currentTaskIndex; O++) {
|
|
3369
3381
|
const N = document.getElementById(`or_task_${O}`);
|
|
3370
|
-
N && Object.assign(N.style,
|
|
3382
|
+
N && Object.assign(N.style, no);
|
|
3371
3383
|
}
|
|
3372
3384
|
};
|
|
3373
3385
|
return n.onclick = B, b.onclick = this.collapseWidget, T.onclick = () => {
|
|
@@ -3389,16 +3401,16 @@ class ho {
|
|
|
3389
3401
|
}, 1), s;
|
|
3390
3402
|
}
|
|
3391
3403
|
showEndSection() {
|
|
3392
|
-
var l, a,
|
|
3404
|
+
var l, a, h, c;
|
|
3393
3405
|
let e = !0;
|
|
3394
3406
|
(l = this.signalManager) == null || l.signalTest("done");
|
|
3395
|
-
const s = U("div", "end_section_or",
|
|
3407
|
+
const s = U("div", "end_section_or", to), n = U("div", "end_title_or", {
|
|
3396
3408
|
fontSize: "1.25rem",
|
|
3397
3409
|
fontWeight: "500"
|
|
3398
3410
|
}, "Thank you! 👍"), i = U("div", "end_description_or", {}, ((a = this.test) == null ? void 0 : a.conclusion) ?? `Thank you for participating in our usability test. Your feedback has been captured and will be used to enhance our website.
|
|
3399
3411
|
|
|
3400
|
-
We appreciate your time and valuable input.`), r = U("div", "end_button_or", dn, "Submitting Feedback"), o =
|
|
3401
|
-
r.appendChild(o), (
|
|
3412
|
+
We appreciate your time and valuable input.`), r = U("div", "end_button_or", dn, "Submitting Feedback"), o = po();
|
|
3413
|
+
r.appendChild(o), (h = this.test) != null && h.reqMic || (c = this.test) != null && c.reqCamera ? this.userRecorder.sendToAPI().then(() => {
|
|
3402
3414
|
r.removeChild(o), r.textContent = "End Session", e = !1;
|
|
3403
3415
|
}).catch((d) => {
|
|
3404
3416
|
console.error(d), r.removeChild(o), r.textContent = "End Session", e = !1;
|
|
@@ -3407,7 +3419,7 @@ We appreciate your time and valuable input.`), r = U("div", "end_button_or", dn,
|
|
|
3407
3419
|
}, s.append(n, i, r), this.endSection = s, this.container.append(s);
|
|
3408
3420
|
}
|
|
3409
3421
|
}
|
|
3410
|
-
function
|
|
3422
|
+
function bi(t) {
|
|
3411
3423
|
return !!t && t.nodeType != null;
|
|
3412
3424
|
}
|
|
3413
3425
|
function ks(t) {
|
|
@@ -3416,7 +3428,7 @@ function ks(t) {
|
|
|
3416
3428
|
function Te(t) {
|
|
3417
3429
|
return t.nodeType === Node.ELEMENT_NODE;
|
|
3418
3430
|
}
|
|
3419
|
-
function
|
|
3431
|
+
function yo(t) {
|
|
3420
3432
|
return t.nodeType === Node.COMMENT_NODE;
|
|
3421
3433
|
}
|
|
3422
3434
|
function Ts(t) {
|
|
@@ -3431,7 +3443,7 @@ function Nt(t) {
|
|
|
3431
3443
|
function Q(t, e) {
|
|
3432
3444
|
return t.localName === e;
|
|
3433
3445
|
}
|
|
3434
|
-
class
|
|
3446
|
+
class bo {
|
|
3435
3447
|
constructor(e, s) {
|
|
3436
3448
|
this.app = e, this.options = s, this.snapshots = {}, this.intervals = [], this.restartTracking = () => {
|
|
3437
3449
|
this.clear(), this.app.nodes.scanTree(this.captureCanvas);
|
|
@@ -3452,14 +3464,14 @@ class po {
|
|
|
3452
3464
|
paused: !1,
|
|
3453
3465
|
dummy: document.createElement("canvas")
|
|
3454
3466
|
};
|
|
3455
|
-
const o =
|
|
3467
|
+
const o = $r(i.toString(), r);
|
|
3456
3468
|
this.app.send(o);
|
|
3457
|
-
const l = (
|
|
3458
|
-
|
|
3469
|
+
const l = (h) => {
|
|
3470
|
+
So(h, this.options.quality, this.snapshots[i].dummy, this.options.fixedScaling, this.fileExt, (c) => {
|
|
3459
3471
|
c && (this.snapshots[i].images.push({ id: this.app.timestamp(), data: c }), this.snapshots[i].images.length > 9 && (this.sendSnaps(this.snapshots[i].images, i, this.snapshots[i].createdAt), this.snapshots[i].images = []));
|
|
3460
3472
|
});
|
|
3461
3473
|
}, a = setInterval(() => {
|
|
3462
|
-
const
|
|
3474
|
+
const h = this.app.nodes.getID(n), c = h ? this.app.nodes.getNode(h) : void 0;
|
|
3463
3475
|
!c || !Q(c, "canvas") || c !== n ? (this.app.debug.log("Canvas element not in sync"), clearInterval(a)) : this.snapshots[i].paused || (this.options.useAnimationFrame ? requestAnimationFrame(() => {
|
|
3464
3476
|
l(c);
|
|
3465
3477
|
}) : l(c));
|
|
@@ -3480,7 +3492,7 @@ class po {
|
|
|
3480
3492
|
const i = new FormData();
|
|
3481
3493
|
e.forEach((r) => {
|
|
3482
3494
|
const o = r.data;
|
|
3483
|
-
o && (i.append("snapshot", o, `${n}_${s}_${r.id}.${this.fileExt}`), this.options.isDebug &&
|
|
3495
|
+
o && (i.append("snapshot", o, `${n}_${s}_${r.id}.${this.fileExt}`), this.options.isDebug && wo(o, `${n}_${s}_${r.id}.${this.fileExt}`));
|
|
3484
3496
|
}), fetch(this.app.options.ingestPoint + "/v1/web/images", {
|
|
3485
3497
|
method: "POST",
|
|
3486
3498
|
headers: {
|
|
@@ -3500,7 +3512,7 @@ const yn = {
|
|
|
3500
3512
|
medium: 0.55,
|
|
3501
3513
|
high: 0.8
|
|
3502
3514
|
};
|
|
3503
|
-
function
|
|
3515
|
+
function So(t, e = "medium", s, n = !1, i, r) {
|
|
3504
3516
|
const o = `image/${i}`;
|
|
3505
3517
|
if (n) {
|
|
3506
3518
|
const l = window.devicePixelRatio || 1;
|
|
@@ -3512,7 +3524,7 @@ function go(t, e = "medium", s, n = !1, i, r) {
|
|
|
3512
3524
|
} else
|
|
3513
3525
|
t.toBlob(r, o, yn[e]);
|
|
3514
3526
|
}
|
|
3515
|
-
function
|
|
3527
|
+
function wo(t, e) {
|
|
3516
3528
|
const s = URL.createObjectURL(t), n = document.createElement("a");
|
|
3517
3529
|
n.href = s, n.download = e, n.style.display = "none", document.body.appendChild(n), n.click(), document.body.removeChild(n);
|
|
3518
3530
|
}
|
|
@@ -3523,7 +3535,7 @@ const tt = {
|
|
|
3523
3535
|
Errors: 2,
|
|
3524
3536
|
Silent: 0
|
|
3525
3537
|
};
|
|
3526
|
-
class
|
|
3538
|
+
class xo {
|
|
3527
3539
|
constructor(e = tt.Silent) {
|
|
3528
3540
|
this.shouldLog = (s) => this.level >= s, this.log = (...s) => {
|
|
3529
3541
|
this.shouldLog(tt.Log) && console.log(...s);
|
|
@@ -3534,7 +3546,7 @@ class vo {
|
|
|
3534
3546
|
}, this.level = e;
|
|
3535
3547
|
}
|
|
3536
3548
|
}
|
|
3537
|
-
class
|
|
3549
|
+
class ko {
|
|
3538
3550
|
constructor(e) {
|
|
3539
3551
|
this.node_id = e, this.nodes = [], this.totalNodeAmount = 0, this.nodeCallbacks = [], this.elementListeners = /* @__PURE__ */ new Map(), this.nextNodeId = 0, this.scanTree = (s) => {
|
|
3540
3552
|
this.nodes.forEach((n) => s(n));
|
|
@@ -3554,7 +3566,7 @@ class yo {
|
|
|
3554
3566
|
const r = this.getID(e);
|
|
3555
3567
|
if (r === void 0)
|
|
3556
3568
|
return;
|
|
3557
|
-
|
|
3569
|
+
fi(e, s, n, i);
|
|
3558
3570
|
let o = this.elementListeners.get(r);
|
|
3559
3571
|
o === void 0 && (o = [], this.elementListeners.set(r, o)), o.push([s, n, i]);
|
|
3560
3572
|
}
|
|
@@ -3568,7 +3580,7 @@ class yo {
|
|
|
3568
3580
|
if (s !== void 0) {
|
|
3569
3581
|
e[this.node_id] = void 0, delete e[this.node_id], delete this.nodes[s];
|
|
3570
3582
|
const n = this.elementListeners.get(s);
|
|
3571
|
-
n !== void 0 && (this.elementListeners.delete(s), n.forEach((i) =>
|
|
3583
|
+
n !== void 0 && (this.elementListeners.delete(s), n.forEach((i) => pi(e, i[0], i[1], i[2]))), this.totalNodeAmount--;
|
|
3572
3584
|
}
|
|
3573
3585
|
return s;
|
|
3574
3586
|
}
|
|
@@ -3600,7 +3612,7 @@ class yo {
|
|
|
3600
3612
|
}
|
|
3601
3613
|
}
|
|
3602
3614
|
function Es(t) {
|
|
3603
|
-
if (
|
|
3615
|
+
if (yo(t))
|
|
3604
3616
|
return !0;
|
|
3605
3617
|
if (Ts(t))
|
|
3606
3618
|
return !1;
|
|
@@ -3622,7 +3634,7 @@ var Se;
|
|
|
3622
3634
|
})(Se || (Se = {}));
|
|
3623
3635
|
class Ls {
|
|
3624
3636
|
constructor(e, s = !1) {
|
|
3625
|
-
this.app = e, this.isTopContext = s, this.commited = [], this.recents = /* @__PURE__ */ new Map(), this.indexes = [], this.attributesMap = /* @__PURE__ */ new Map(), this.textSet = /* @__PURE__ */ new Set(), this.observer =
|
|
3637
|
+
this.app = e, this.isTopContext = s, this.commited = [], this.recents = /* @__PURE__ */ new Map(), this.indexes = [], this.attributesMap = /* @__PURE__ */ new Map(), this.textSet = /* @__PURE__ */ new Set(), this.observer = di(this.app.safe((n) => {
|
|
3626
3638
|
for (const i of n) {
|
|
3627
3639
|
const r = i.target, o = i.type;
|
|
3628
3640
|
if (!ns(r))
|
|
@@ -3640,8 +3652,8 @@ class Ls {
|
|
|
3640
3652
|
const a = i.attributeName;
|
|
3641
3653
|
if (a === null)
|
|
3642
3654
|
continue;
|
|
3643
|
-
let
|
|
3644
|
-
|
|
3655
|
+
let h = this.attributesMap.get(l);
|
|
3656
|
+
h === void 0 && this.attributesMap.set(l, h = /* @__PURE__ */ new Set()), h.add(a);
|
|
3645
3657
|
continue;
|
|
3646
3658
|
}
|
|
3647
3659
|
if (o === "characterData") {
|
|
@@ -3675,10 +3687,10 @@ class Ls {
|
|
|
3675
3687
|
}
|
|
3676
3688
|
sendNodeData(e, s, n) {
|
|
3677
3689
|
if (Q(s, "style")) {
|
|
3678
|
-
this.app.send(
|
|
3690
|
+
this.app.send(Mr(e, n, this.app.getBaseHref()));
|
|
3679
3691
|
return;
|
|
3680
3692
|
}
|
|
3681
|
-
n = this.app.sanitizer.sanitize(e, n), this.app.send(
|
|
3693
|
+
n = this.app.sanitizer.sanitize(e, n), this.app.send(wr(e, n));
|
|
3682
3694
|
}
|
|
3683
3695
|
bindNode(e) {
|
|
3684
3696
|
const [s, n] = this.app.nodes.registerNode(e);
|
|
@@ -3703,7 +3715,7 @@ class Ls {
|
|
|
3703
3715
|
unbindTree(e) {
|
|
3704
3716
|
const s = this.app.nodes.unregisterNode(e);
|
|
3705
3717
|
if (s !== void 0 && this.recents.get(s) === Se.Removed) {
|
|
3706
|
-
this.app.send(
|
|
3718
|
+
this.app.send(Sr(s));
|
|
3707
3719
|
const n = document.createTreeWalker(
|
|
3708
3720
|
e,
|
|
3709
3721
|
NodeFilter.SHOW_ELEMENT + NodeFilter.SHOW_TEXT,
|
|
@@ -3718,7 +3730,7 @@ class Ls {
|
|
|
3718
3730
|
for (; n.nextNode(); )
|
|
3719
3731
|
i += 1, this.app.nodes.unregisterNode(n.currentNode);
|
|
3720
3732
|
const o = Math.floor(i / r * 100);
|
|
3721
|
-
o > 30 && this.app.send(
|
|
3733
|
+
o > 30 && this.app.send(Wr(o));
|
|
3722
3734
|
}
|
|
3723
3735
|
}
|
|
3724
3736
|
// A top-consumption function on the infinite lists test. (~1% of performance resources)
|
|
@@ -3758,22 +3770,22 @@ class Ls {
|
|
|
3758
3770
|
const d = c.clientWidth, p = c.clientHeight;
|
|
3759
3771
|
c = s.cloneNode(), c.style.width = `${d}px`, c.style.height = `${p}px`;
|
|
3760
3772
|
}
|
|
3761
|
-
this.app.send(
|
|
3773
|
+
this.app.send(vr(e, i, a, c.tagName, ks(s)));
|
|
3762
3774
|
}
|
|
3763
3775
|
for (let d = 0; d < c.attributes.length; d++) {
|
|
3764
3776
|
const p = c.attributes[d];
|
|
3765
3777
|
this.sendNodeAttribute(e, c, p.nodeName, p.value);
|
|
3766
3778
|
}
|
|
3767
3779
|
} else
|
|
3768
|
-
Ts(s) && (this.app.send(
|
|
3780
|
+
Ts(s) && (this.app.send(yr(e, i, a)), this.sendNodeData(e, n, s.data));
|
|
3769
3781
|
return !0;
|
|
3770
3782
|
}
|
|
3771
|
-
o === Se.Removed && i !== void 0 && this.app.send(
|
|
3772
|
-
const
|
|
3773
|
-
if (
|
|
3783
|
+
o === Se.Removed && i !== void 0 && this.app.send(br(e, i, a));
|
|
3784
|
+
const h = this.attributesMap.get(e);
|
|
3785
|
+
if (h !== void 0) {
|
|
3774
3786
|
if (!Te(s))
|
|
3775
3787
|
throw "commitNode: node is not an element";
|
|
3776
|
-
for (const c of
|
|
3788
|
+
for (const c of h)
|
|
3777
3789
|
this.sendNodeAttribute(e, s, c, s.getAttribute(c));
|
|
3778
3790
|
}
|
|
3779
3791
|
if (this.textSet.has(e)) {
|
|
@@ -3833,7 +3845,7 @@ class bn extends Ls {
|
|
|
3833
3845
|
});
|
|
3834
3846
|
}
|
|
3835
3847
|
}
|
|
3836
|
-
class
|
|
3848
|
+
class To extends Ls {
|
|
3837
3849
|
observe(e) {
|
|
3838
3850
|
const s = e.shadowRoot, n = this.app.nodes.getID(e);
|
|
3839
3851
|
!s || n === void 0 || this.observeRoot(s, (i) => {
|
|
@@ -3845,7 +3857,7 @@ class bo extends Ls {
|
|
|
3845
3857
|
});
|
|
3846
3858
|
}
|
|
3847
3859
|
}
|
|
3848
|
-
class
|
|
3860
|
+
class Eo {
|
|
3849
3861
|
constructor() {
|
|
3850
3862
|
this.states = /* @__PURE__ */ new Map();
|
|
3851
3863
|
}
|
|
@@ -3885,9 +3897,9 @@ class So {
|
|
|
3885
3897
|
}
|
|
3886
3898
|
}
|
|
3887
3899
|
const is = xe ? Element.prototype.attachShadow : () => new ShadowRoot();
|
|
3888
|
-
class
|
|
3900
|
+
class Co extends Ls {
|
|
3889
3901
|
constructor(e, s) {
|
|
3890
|
-
super(e, !0), this.iframeOffsets = new
|
|
3902
|
+
super(e, !0), this.iframeOffsets = new Eo(), this.contextCallbacks = [], this.contextsSet = /* @__PURE__ */ new Set(), this.iframeObservers = [], this.shadowRootObservers = [], this.options = Object.assign({
|
|
3891
3903
|
captureIFrames: !0
|
|
3892
3904
|
}, s), this.app.nodes.attachNodeCallback((n) => {
|
|
3893
3905
|
Q(n, "iframe") && (this.options.captureIFrames && !Fe(n, "obscured") || Fe(n, "capture")) && this.handleIframe(n);
|
|
@@ -3904,7 +3916,7 @@ class wo extends Ls {
|
|
|
3904
3916
|
handleIframe(e) {
|
|
3905
3917
|
let s = null;
|
|
3906
3918
|
const n = this.app.safe(() => setTimeout(() => {
|
|
3907
|
-
if (this.app.nodes.getID(e) === void 0 || !
|
|
3919
|
+
if (this.app.nodes.getID(e) === void 0 || !cr(e))
|
|
3908
3920
|
return;
|
|
3909
3921
|
const r = e.contentWindow, o = e.contentDocument;
|
|
3910
3922
|
if (o && o !== s) {
|
|
@@ -3917,7 +3929,7 @@ class wo extends Ls {
|
|
|
3917
3929
|
e.addEventListener("load", n), n();
|
|
3918
3930
|
}
|
|
3919
3931
|
handleShadowRoot(e) {
|
|
3920
|
-
const s = new
|
|
3932
|
+
const s = new To(this.app);
|
|
3921
3933
|
this.shadowRootObservers.push(s), s.observe(e.host);
|
|
3922
3934
|
}
|
|
3923
3935
|
observe() {
|
|
@@ -3926,7 +3938,7 @@ class wo extends Ls {
|
|
|
3926
3938
|
const s = is.apply(this, arguments);
|
|
3927
3939
|
return e.handleShadowRoot(s), s;
|
|
3928
3940
|
}, this.app.nodes.clear(), this.observeRoot(window.document, () => {
|
|
3929
|
-
this.app.send(
|
|
3941
|
+
this.app.send(mr()), this.app.nodes.callNodeCallbacks(document, !0);
|
|
3930
3942
|
}, window.document.documentElement);
|
|
3931
3943
|
}
|
|
3932
3944
|
crossdomainObserve(e, s) {
|
|
@@ -3946,8 +3958,8 @@ var Tt;
|
|
|
3946
3958
|
(function(t) {
|
|
3947
3959
|
t[t.Plain = 0] = "Plain", t[t.Obscured = 1] = "Obscured", t[t.Hidden = 2] = "Hidden";
|
|
3948
3960
|
})(Tt || (Tt = {}));
|
|
3949
|
-
const
|
|
3950
|
-
class
|
|
3961
|
+
const Io = (t) => t.trim().replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g, "█");
|
|
3962
|
+
class _o {
|
|
3951
3963
|
constructor(e, s) {
|
|
3952
3964
|
this.app = e, this.obscured = /* @__PURE__ */ new Set(), this.hidden = /* @__PURE__ */ new Set(), this.options = Object.assign({
|
|
3953
3965
|
obscureTextEmails: !0,
|
|
@@ -3961,7 +3973,7 @@ class ko {
|
|
|
3961
3973
|
}
|
|
3962
3974
|
}
|
|
3963
3975
|
sanitize(e, s) {
|
|
3964
|
-
return this.obscured.has(e) ?
|
|
3976
|
+
return this.obscured.has(e) ? Io(s) : (this.options.obscureTextNumbers && (s = s.replace(/\d/g, "0")), this.options.obscureTextEmails && (s = s.replace(/^\w+([+.-]\w+)*@\w+([.-]\w+)*\.\w{2,3}$/g, (n) => {
|
|
3965
3977
|
const [i, r] = n.split("@"), [o, l] = r.split(".");
|
|
3966
3978
|
return `${es(i)}@${es(o)}.${es(l)}`;
|
|
3967
3979
|
})), s);
|
|
@@ -3980,7 +3992,7 @@ class ko {
|
|
|
3980
3992
|
this.obscured.clear(), this.hidden.clear();
|
|
3981
3993
|
}
|
|
3982
3994
|
}
|
|
3983
|
-
class
|
|
3995
|
+
class Oo {
|
|
3984
3996
|
constructor(e, s) {
|
|
3985
3997
|
this.app = e, this.options = s, this.metadata = {}, this.userID = null, this.callbacks = [], this.timestamp = 0, this.createTabId();
|
|
3986
3998
|
}
|
|
@@ -4031,7 +4043,7 @@ class To {
|
|
|
4031
4043
|
return this.tabId || this.createTabId(), this.tabId;
|
|
4032
4044
|
}
|
|
4033
4045
|
regenerateTabId() {
|
|
4034
|
-
const e =
|
|
4046
|
+
const e = lr(12);
|
|
4035
4047
|
this.app.sessionStorage.setItem(this.options.session_tabid_key, e), this.tabId = e;
|
|
4036
4048
|
}
|
|
4037
4049
|
createTabId() {
|
|
@@ -4051,13 +4063,13 @@ class To {
|
|
|
4051
4063
|
this.app.sessionStorage.removeItem(this.options.session_token_key), this.metadata = {}, this.userID = null, this.sessionID = void 0, this.timestamp = 0;
|
|
4052
4064
|
}
|
|
4053
4065
|
}
|
|
4054
|
-
function
|
|
4066
|
+
function No(t, e) {
|
|
4055
4067
|
let s = 0;
|
|
4056
4068
|
return () => {
|
|
4057
4069
|
s++ >= e && (s = 0, t());
|
|
4058
4070
|
};
|
|
4059
4071
|
}
|
|
4060
|
-
class
|
|
4072
|
+
class Ro {
|
|
4061
4073
|
constructor(e) {
|
|
4062
4074
|
this.app = e, this.timer = null, this.callbacks = [];
|
|
4063
4075
|
}
|
|
@@ -4068,7 +4080,7 @@ class Co {
|
|
|
4068
4080
|
* @param {object} thisArg - link to <this>
|
|
4069
4081
|
* */
|
|
4070
4082
|
attach(e, s = 0, n = !0, i) {
|
|
4071
|
-
i && (e = e.bind(i)), n && (e = this.app.safe(e)), this.callbacks.unshift(s ?
|
|
4083
|
+
i && (e = e.bind(i)), n && (e = this.app.safe(e)), this.callbacks.unshift(s ? No(e, s) : e) - 1;
|
|
4072
4084
|
}
|
|
4073
4085
|
start() {
|
|
4074
4086
|
this.timer === null && (this.timer = setInterval(() => this.callbacks.forEach((e) => {
|
|
@@ -4079,17 +4091,17 @@ class Co {
|
|
|
4079
4091
|
this.timer !== null && (clearInterval(this.timer), this.timer = null);
|
|
4080
4092
|
}
|
|
4081
4093
|
}
|
|
4082
|
-
const et = "canceled", Sn = "or_uxt_active", rs = "or_buffer_1", _e = (t) => ({ reason: t, success: !1 }),
|
|
4094
|
+
const et = "canceled", Sn = "or_uxt_active", rs = "or_buffer_1", _e = (t) => ({ reason: t, success: !1 }), Do = (t) => ({ ...t, success: !0 });
|
|
4083
4095
|
var Y;
|
|
4084
4096
|
(function(t) {
|
|
4085
4097
|
t[t.NotActive = 0] = "NotActive", t[t.Starting = 1] = "Starting", t[t.Active = 2] = "Active", t[t.ColdStart = 3] = "ColdStart";
|
|
4086
4098
|
})(Y || (Y = {}));
|
|
4087
|
-
const
|
|
4099
|
+
const Si = "https://api.openreplay.com/ingest";
|
|
4088
4100
|
function os() {
|
|
4089
4101
|
const t = (/* @__PURE__ */ new Date()).getTimezoneOffset() * -1, e = t >= 0 ? "+" : "-", s = Math.floor(Math.abs(t) / 60), n = Math.abs(t) % 60;
|
|
4090
4102
|
return `UTC${e}${String(s).padStart(2, "0")}:${String(n).padStart(2, "0")}`;
|
|
4091
4103
|
}
|
|
4092
|
-
const
|
|
4104
|
+
const Ao = (t) => new Promise((e) => setTimeout(e, t)), he = {
|
|
4093
4105
|
// ask if there are any tabs alive
|
|
4094
4106
|
ask: "never-gonna-give-you-up",
|
|
4095
4107
|
// response from another tab
|
|
@@ -4103,20 +4115,20 @@ const _o = (t) => new Promise((e) => setTimeout(e, t)), he = {
|
|
|
4103
4115
|
// batch of messages from an iframe window
|
|
4104
4116
|
iframeBatch: "never-gonna-tell-a-lie-and-hurt-you"
|
|
4105
4117
|
};
|
|
4106
|
-
class
|
|
4118
|
+
class Fo {
|
|
4107
4119
|
constructor(e, s, n, i, r) {
|
|
4108
4120
|
this.signalError = i, this.insideIframe = r, this.messages = [], this.bufferedMessages1 = [], this.bufferedMessages2 = [], this.startCallbacks = [], this.stopCallbacks = [], this.commitCallbacks = [], this.activityState = Y.NotActive, this.version = "14.0.4", this.socketMode = !1, this.compressionThreshold = 24 * 1e3, this.bc = null, this.canvasRecorder = null, this.conditionsManager = null, this.canStart = !1, this.rootId = null, this.pageFrames = [], this.frameOderNumber = 0, this.initialHostName = location.hostname, this.startTimeout = null, this.coldStartCommitN = 0, this.delay = 0, this.coldInterval = null, this.orderNumber = 0, this.coldStartTs = 0, this.singleBuffer = !1, this.onSessionSent = () => {
|
|
4109
4121
|
}, this.restartCanvasTracking = () => {
|
|
4110
4122
|
var a;
|
|
4111
4123
|
(a = this.canvasRecorder) == null || a.restartTracking();
|
|
4112
|
-
}, this.flushBuffer = async (a) => new Promise((
|
|
4124
|
+
}, this.flushBuffer = async (a) => new Promise((h) => {
|
|
4113
4125
|
let c = !1;
|
|
4114
4126
|
const d = [a.shift()];
|
|
4115
4127
|
for (; !c; ) {
|
|
4116
4128
|
const p = a[0];
|
|
4117
4129
|
!p || p[0] === 0 ? c = !0 : d.push(a.shift());
|
|
4118
4130
|
}
|
|
4119
|
-
this.postToWorker(d),
|
|
4131
|
+
this.postToWorker(d), h(null);
|
|
4120
4132
|
}), this.onUxtCb = [], this.contextId = Math.random().toString(36).slice(2), this.projectKey = e, Object.keys(n).findIndex((a) => ["fixedCanvasScaling", "disableCanvas"].includes(a)) !== -1 && (console.warn('Openreplay: canvas options are moving to separate key "canvas" in next update. Please update your configuration.'), n = {
|
|
4121
4133
|
...n,
|
|
4122
4134
|
canvas: {
|
|
@@ -4133,7 +4145,7 @@ class Oo {
|
|
|
4133
4145
|
session_reset_key: "__openreplay_reset",
|
|
4134
4146
|
session_tabid_key: "__openreplay_tabid",
|
|
4135
4147
|
local_uuid_key: "__openreplay_uuid",
|
|
4136
|
-
ingestPoint:
|
|
4148
|
+
ingestPoint: Si,
|
|
4137
4149
|
resourceBaseHref: null,
|
|
4138
4150
|
__is_snippet: !1,
|
|
4139
4151
|
__debug_report_edp: null,
|
|
@@ -4159,14 +4171,14 @@ class Oo {
|
|
|
4159
4171
|
useAnimationFrame: !1
|
|
4160
4172
|
}
|
|
4161
4173
|
};
|
|
4162
|
-
if (this.options =
|
|
4174
|
+
if (this.options = gi(o, n), !this.insideIframe && !this.options.forceSingleTab && globalThis && "BroadcastChannel" in globalThis) {
|
|
4163
4175
|
const a = location.hostname.split(".").slice(-2).join("_");
|
|
4164
4176
|
this.bc = new BroadcastChannel(`rick_${a}`);
|
|
4165
4177
|
}
|
|
4166
|
-
this.revID = this.options.revID, this.localStorage = this.options.localStorage ?? window.localStorage, this.sessionStorage = this.options.sessionStorage ?? window.sessionStorage, this.sanitizer = new
|
|
4167
|
-
this.send(
|
|
4168
|
-
}), this.session.attachUpdateCallback(({ userID: a, metadata:
|
|
4169
|
-
a != null && this.send(
|
|
4178
|
+
this.revID = this.options.revID, this.localStorage = this.options.localStorage ?? window.localStorage, this.sessionStorage = this.options.sessionStorage ?? window.sessionStorage, this.sanitizer = new _o(this, n), this.nodes = new ko(this.options.node_id), this.observer = new Co(this, n), this.ticker = new Ro(this), this.ticker.attach(() => this.commit()), this.debug = new xo(this.options.__debug__), this.session = new Oo(this, this.options), this.attributeSender = new sr(this, !!this.options.disableStringDict), this.featureFlags = new rr(this), this.tagWatcher = new Kr(this.sessionStorage, this.debug.error, (a) => {
|
|
4179
|
+
this.send(qr(a));
|
|
4180
|
+
}), this.session.attachUpdateCallback(({ userID: a, metadata: h }) => {
|
|
4181
|
+
a != null && this.send(Nr(a)), h != null && Object.entries(h).forEach(([c, d]) => this.send(sn(c, d)));
|
|
4170
4182
|
}), s != null && this.session.applySessionHash(s), this.initWorker();
|
|
4171
4183
|
const l = this.session.getTabId();
|
|
4172
4184
|
if (this.insideIframe) {
|
|
@@ -4177,16 +4189,16 @@ class Oo {
|
|
|
4177
4189
|
window.addEventListener("message", a), this.attachStopCallback(() => {
|
|
4178
4190
|
window.removeEventListener("message", a);
|
|
4179
4191
|
});
|
|
4180
|
-
const
|
|
4192
|
+
const h = this.initialHostName;
|
|
4181
4193
|
window.parent.postMessage({
|
|
4182
4194
|
line: he.iframeSignal,
|
|
4183
4195
|
source: l,
|
|
4184
4196
|
context: this.contextId,
|
|
4185
|
-
domain:
|
|
4197
|
+
domain: h
|
|
4186
4198
|
}, "*");
|
|
4187
4199
|
} else {
|
|
4188
4200
|
let a = 0;
|
|
4189
|
-
const
|
|
4201
|
+
const h = (c) => {
|
|
4190
4202
|
const { data: d } = c;
|
|
4191
4203
|
if (d.line === he.iframeSignal) {
|
|
4192
4204
|
const p = d.domain, y = Array.from(document.querySelectorAll("iframe"));
|
|
@@ -4210,7 +4222,7 @@ class Oo {
|
|
|
4210
4222
|
}).catch(console.error), b = 10;
|
|
4211
4223
|
break;
|
|
4212
4224
|
}
|
|
4213
|
-
b++, await
|
|
4225
|
+
b++, await Ao(100);
|
|
4214
4226
|
}
|
|
4215
4227
|
})();
|
|
4216
4228
|
}
|
|
@@ -4247,8 +4259,8 @@ class Oo {
|
|
|
4247
4259
|
this.messages.push(...y);
|
|
4248
4260
|
}
|
|
4249
4261
|
};
|
|
4250
|
-
window.addEventListener("message",
|
|
4251
|
-
window.removeEventListener("message",
|
|
4262
|
+
window.addEventListener("message", h), this.attachStopCallback(() => {
|
|
4263
|
+
window.removeEventListener("message", h);
|
|
4252
4264
|
});
|
|
4253
4265
|
}
|
|
4254
4266
|
this.bc !== null && (this.bc.postMessage({
|
|
@@ -4260,18 +4272,18 @@ class Oo {
|
|
|
4260
4272
|
}, 500), this.bc.onmessage = (a) => {
|
|
4261
4273
|
if (a.data.context !== this.contextId) {
|
|
4262
4274
|
if (a.data.line === he.resp) {
|
|
4263
|
-
const
|
|
4264
|
-
this.session.setSessionToken(
|
|
4275
|
+
const h = a.data.token;
|
|
4276
|
+
this.session.setSessionToken(h), this.allowAppStart();
|
|
4265
4277
|
}
|
|
4266
4278
|
if (a.data.line === he.reg) {
|
|
4267
|
-
const
|
|
4268
|
-
this.session.regenerateTabId(), this.session.setSessionToken(
|
|
4279
|
+
const h = a.data.token;
|
|
4280
|
+
this.session.regenerateTabId(), this.session.setSessionToken(h), this.allowAppStart();
|
|
4269
4281
|
}
|
|
4270
4282
|
if (a.data.line === he.ask) {
|
|
4271
|
-
const
|
|
4272
|
-
|
|
4283
|
+
const h = this.session.getSessionToken();
|
|
4284
|
+
h && this.bc && this.bc.postMessage({
|
|
4273
4285
|
line: a.data.source === l ? he.reg : he.resp,
|
|
4274
|
-
token:
|
|
4286
|
+
token: h,
|
|
4275
4287
|
source: l,
|
|
4276
4288
|
context: this.contextId
|
|
4277
4289
|
});
|
|
@@ -4315,7 +4327,7 @@ class Oo {
|
|
|
4315
4327
|
this.stop(!1), this.debug.error("worker_failed", e.reason), this._debug("worker_failed", e.reason);
|
|
4316
4328
|
else if (e.type === "compress") {
|
|
4317
4329
|
const n = e.batch;
|
|
4318
|
-
n.byteLength > this.compressionThreshold ?
|
|
4330
|
+
n.byteLength > this.compressionThreshold ? Zi(e.batch, { mtime: 0 }, (r, o) => {
|
|
4319
4331
|
var l, a;
|
|
4320
4332
|
r ? (this.debug.error("Openreplay compression error:", r), (l = this.worker) == null || l.postMessage({ type: "uncompressed", batch: n })) : (a = this.worker) == null || a.postMessage({ type: "compressed", batch: o });
|
|
4321
4333
|
}) : (s = this.worker) == null || s.postMessage({ type: "uncompressed", batch: n });
|
|
@@ -4356,7 +4368,7 @@ class Oo {
|
|
|
4356
4368
|
return;
|
|
4357
4369
|
}
|
|
4358
4370
|
try {
|
|
4359
|
-
|
|
4371
|
+
fr(() => {
|
|
4360
4372
|
var e;
|
|
4361
4373
|
this.messages.unshift(Ae(this.session.getTabId())), this.messages.unshift(De(this.timestamp())), (e = this.worker) == null || e.postMessage(this.messages), this.commitCallbacks.forEach((s) => s(this.messages)), this.messages.length = 0;
|
|
4362
4374
|
});
|
|
@@ -4408,7 +4420,7 @@ class Oo {
|
|
|
4408
4420
|
// Use app.nodes.attachNodeListener for registered nodes instead
|
|
4409
4421
|
attachEventListener(e, s, n, i = !0, r = !0) {
|
|
4410
4422
|
i && (n = this.safe(n));
|
|
4411
|
-
const o = () => e ?
|
|
4423
|
+
const o = () => e ? fi(e, s, n, r) : null, l = () => e ? pi(e, s, n, r) : null;
|
|
4412
4424
|
this.attachStartCallback(o, i), this.attachStopCallback(l, i);
|
|
4413
4425
|
}
|
|
4414
4426
|
// TODO: full correct semantic
|
|
@@ -4453,8 +4465,8 @@ class Oo {
|
|
|
4453
4465
|
}
|
|
4454
4466
|
const r = this.options.ingestPoint, a = (/api\.openreplay\.com/.test(r) ? "https://app.openreplay.com/ingest" : r).replace(/ingest$/, `${s}/session/${n}`);
|
|
4455
4467
|
if (e != null && e.withCurrentTime) {
|
|
4456
|
-
const
|
|
4457
|
-
return `${a}?jumpto=${
|
|
4468
|
+
const h = ge() - i;
|
|
4469
|
+
return `${a}?jumpto=${h}`;
|
|
4458
4470
|
}
|
|
4459
4471
|
return a;
|
|
4460
4472
|
}
|
|
@@ -4506,7 +4518,7 @@ class Oo {
|
|
|
4506
4518
|
}
|
|
4507
4519
|
async setupConditionalStart(e) {
|
|
4508
4520
|
var p, y;
|
|
4509
|
-
this.conditionsManager = new
|
|
4521
|
+
this.conditionsManager = new nr(this, e);
|
|
4510
4522
|
const s = await fetch(this.options.ingestPoint + "/v1/web/start", {
|
|
4511
4523
|
method: "POST",
|
|
4512
4524
|
headers: {
|
|
@@ -4534,7 +4546,7 @@ class Oo {
|
|
|
4534
4546
|
userCountry: o,
|
|
4535
4547
|
userDevice: l,
|
|
4536
4548
|
userOS: a,
|
|
4537
|
-
userState:
|
|
4549
|
+
userState: h,
|
|
4538
4550
|
projectID: c
|
|
4539
4551
|
} = await s.json();
|
|
4540
4552
|
this.session.assign({ projectID: c }), this.session.setUserInfo({
|
|
@@ -4543,7 +4555,7 @@ class Oo {
|
|
|
4543
4555
|
userCountry: o,
|
|
4544
4556
|
userDevice: l,
|
|
4545
4557
|
userOS: a,
|
|
4546
|
-
userState:
|
|
4558
|
+
userState: h
|
|
4547
4559
|
});
|
|
4548
4560
|
const d = { sessionToken: n, userUUID: "", sessionID: "" };
|
|
4549
4561
|
this.startCallbacks.forEach((w) => w(d)), await ((p = this.conditionsManager) == null ? void 0 : p.fetchConditions(c, n)), await this.featureFlags.reloadFlags(n), await this.tagWatcher.fetchTags(this.options.ingestPoint, n), (y = this.conditionsManager) == null || y.processFlags(this.featureFlags.flags);
|
|
@@ -4632,7 +4644,7 @@ class Oo {
|
|
|
4632
4644
|
jsHeapSizeLimit: ss,
|
|
4633
4645
|
timezone: os()
|
|
4634
4646
|
})
|
|
4635
|
-
}), { token: n, userBrowser: i, userCity: r, userCountry: o, userDevice: l, userOS: a, userState:
|
|
4647
|
+
}), { token: n, userBrowser: i, userCity: r, userCountry: o, userDevice: l, userOS: a, userState: h, beaconSizeLimit: c, projectID: d } = await s.json();
|
|
4636
4648
|
for ((y = this.worker) == null || y.postMessage({
|
|
4637
4649
|
type: "auth",
|
|
4638
4650
|
token: n,
|
|
@@ -4643,7 +4655,7 @@ class Oo {
|
|
|
4643
4655
|
userCountry: o,
|
|
4644
4656
|
userDevice: l,
|
|
4645
4657
|
userOS: a,
|
|
4646
|
-
userState:
|
|
4658
|
+
userState: h
|
|
4647
4659
|
}); this.bufferedMessages1.length > 0; )
|
|
4648
4660
|
await this.flushBuffer(this.bufferedMessages1);
|
|
4649
4661
|
this.postToWorker([["q_end"]]), this.clearBuffers();
|
|
@@ -4705,7 +4717,7 @@ class Oo {
|
|
|
4705
4717
|
return this.signalError(I, []), _e(I);
|
|
4706
4718
|
}
|
|
4707
4719
|
const {
|
|
4708
|
-
token:
|
|
4720
|
+
token: h,
|
|
4709
4721
|
userUUID: c,
|
|
4710
4722
|
projectID: d,
|
|
4711
4723
|
beaconSizeLimit: p,
|
|
@@ -4728,11 +4740,11 @@ class Oo {
|
|
|
4728
4740
|
canvasFPS: E,
|
|
4729
4741
|
assistOnly: P
|
|
4730
4742
|
} = await a.json();
|
|
4731
|
-
if (typeof
|
|
4743
|
+
if (typeof h != "string" || typeof c != "string" || typeof T != "number" && typeof T < "u" || typeof b != "string" || typeof w != "number" || typeof p != "number" && typeof p < "u") {
|
|
4732
4744
|
const I = `Incorrect server response: ${JSON.stringify(a)}`;
|
|
4733
4745
|
return this.signalError(I, []), _e(I);
|
|
4734
4746
|
}
|
|
4735
|
-
this.delay = w, this.session.setSessionToken(
|
|
4747
|
+
this.delay = w, this.session.setSessionToken(h), this.session.setUserInfo({
|
|
4736
4748
|
userBrowser: D,
|
|
4737
4749
|
userCity: B,
|
|
4738
4750
|
userCountry: A,
|
|
@@ -4745,11 +4757,11 @@ class Oo {
|
|
|
4745
4757
|
projectID: d
|
|
4746
4758
|
}), P ? (this.socketMode = !0, this.worker.postMessage("stop")) : this.worker.postMessage({
|
|
4747
4759
|
type: "auth",
|
|
4748
|
-
token:
|
|
4760
|
+
token: h,
|
|
4749
4761
|
beaconSizeLimit: p
|
|
4750
|
-
}), !l &&
|
|
4751
|
-
const V = { sessionToken:
|
|
4752
|
-
if (this.startCallbacks.forEach((I) => I(V)), this.featureFlags.reloadFlags(), await this.tagWatcher.fetchTags(this.options.ingestPoint,
|
|
4762
|
+
}), !l && h === o && (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(dt(this.session.getTabId()))), Object.entries(this.session.getInfo().metadata).forEach(([I, M]) => this.send(sn(I, M))), this.localStorage.setItem(this.options.local_uuid_key, c), this.compressionThreshold = y;
|
|
4763
|
+
const V = { sessionToken: h, userUUID: c, sessionID: b };
|
|
4764
|
+
if (this.startCallbacks.forEach((I) => I(V)), this.featureFlags.reloadFlags(), await this.tagWatcher.fetchTags(this.options.ingestPoint, h), this.activityState = Y.Active, F && !this.options.canvas.disableCanvas && (this.canvasRecorder = this.canvasRecorder ?? new bo(this, {
|
|
4753
4765
|
fps: E,
|
|
4754
4766
|
quality: C,
|
|
4755
4767
|
isDebug: this.options.canvas.__save_canvas_locally,
|
|
@@ -4762,7 +4774,7 @@ class Oo {
|
|
|
4762
4774
|
this.clearBuffers(), this.commit();
|
|
4763
4775
|
} else
|
|
4764
4776
|
this.insideIframe && this.rootId ? this.observer.crossdomainObserve(this.rootId, this.frameOderNumber) : this.observer.observe(), this.ticker.start();
|
|
4765
|
-
this.uxtManager = this.uxtManager ? this.uxtManager : new
|
|
4777
|
+
this.uxtManager = this.uxtManager ? this.uxtManager : new vo(this, Sn);
|
|
4766
4778
|
let j;
|
|
4767
4779
|
const W = this.localStorage.getItem(Sn);
|
|
4768
4780
|
if (W && (j = parseInt(W, 10)), location != null && location.search) {
|
|
@@ -4772,15 +4784,15 @@ class Oo {
|
|
|
4772
4784
|
j = M ? parseInt(M, 10) : void 0;
|
|
4773
4785
|
}
|
|
4774
4786
|
}
|
|
4775
|
-
return j && (this.uxtManager.isActive ? this.onUxtCb.forEach((I) => I(j)) : this.uxtManager.getTest(j,
|
|
4787
|
+
return j && (this.uxtManager.isActive ? this.onUxtCb.forEach((I) => I(j)) : this.uxtManager.getTest(j, h, !!W).then((I) => {
|
|
4776
4788
|
I && this.onUxtCb.forEach((M) => M(I));
|
|
4777
|
-
})),
|
|
4789
|
+
})), Do(V);
|
|
4778
4790
|
} catch (a) {
|
|
4779
4791
|
if (this.stop(), this.session.reset(), a === et)
|
|
4780
4792
|
return this.signalError(et, []), _e(et);
|
|
4781
4793
|
this._debug("session_start", a);
|
|
4782
|
-
const
|
|
4783
|
-
return this.signalError(
|
|
4794
|
+
const h = a instanceof Error ? a.message : a.toString();
|
|
4795
|
+
return this.signalError(h, []), _e(h);
|
|
4784
4796
|
}
|
|
4785
4797
|
}
|
|
4786
4798
|
addOnUxtCb(e) {
|
|
@@ -4836,7 +4848,7 @@ class Oo {
|
|
|
4836
4848
|
trackWs(e) {
|
|
4837
4849
|
const s = e;
|
|
4838
4850
|
return (n, i, r = "down") => {
|
|
4839
|
-
typeof n != "string" || typeof i != "string" || i.length > 5 * 1024 * 1024 || n.length > 255 || this.send(
|
|
4851
|
+
typeof n != "string" || typeof i != "string" || i.length > 5 * 1024 * 1024 || n.length > 255 || this.send(Ur("websocket", s, i, this.timestamp(), r, n));
|
|
4840
4852
|
};
|
|
4841
4853
|
}
|
|
4842
4854
|
stop(e = !0) {
|
|
@@ -4849,22 +4861,22 @@ class Oo {
|
|
|
4849
4861
|
}
|
|
4850
4862
|
}
|
|
4851
4863
|
}
|
|
4852
|
-
function
|
|
4864
|
+
function Mo(t) {
|
|
4853
4865
|
const e = navigator.connection || navigator.mozConnection || navigator.webkitConnection;
|
|
4854
4866
|
if (e === void 0)
|
|
4855
4867
|
return;
|
|
4856
|
-
const s = () => t.send(
|
|
4868
|
+
const s = () => t.send(Ar(Math.round(e.downlink * 1e3), e.type || "unknown"));
|
|
4857
4869
|
s(), e.addEventListener("change", s);
|
|
4858
4870
|
}
|
|
4859
|
-
const
|
|
4871
|
+
const wi = xe && "InstallTrigger" in window ? (t) => t.message + `
|
|
4860
4872
|
` + t.stack : (t) => t.stack || t.message;
|
|
4861
4873
|
function Cs(t) {
|
|
4862
|
-
return t === void 0 ? "undefined" : t === null ? "null" : t instanceof Error ?
|
|
4874
|
+
return t === void 0 ? "undefined" : t === null ? "null" : t instanceof Error ? wi(t) : Array.isArray(t) ? `Array(${t.length})` : String(t);
|
|
4863
4875
|
}
|
|
4864
|
-
function
|
|
4876
|
+
function Lo(t) {
|
|
4865
4877
|
return typeof t != "number" ? "NaN" : t.toString();
|
|
4866
4878
|
}
|
|
4867
|
-
function
|
|
4879
|
+
function Po(t) {
|
|
4868
4880
|
return typeof t != "number" ? "NaN" : Math.floor(t).toString();
|
|
4869
4881
|
}
|
|
4870
4882
|
function wn(t) {
|
|
@@ -4873,7 +4885,7 @@ function wn(t) {
|
|
|
4873
4885
|
if (t === null)
|
|
4874
4886
|
return "null";
|
|
4875
4887
|
if (t instanceof Error)
|
|
4876
|
-
return
|
|
4888
|
+
return wi(t);
|
|
4877
4889
|
if (Array.isArray(t)) {
|
|
4878
4890
|
const e = t.length, s = t.slice(0, 10).map(Cs).join(", ");
|
|
4879
4891
|
return `Array(${e})[${s}]`;
|
|
@@ -4891,7 +4903,7 @@ function wn(t) {
|
|
|
4891
4903
|
}
|
|
4892
4904
|
return t.toString();
|
|
4893
4905
|
}
|
|
4894
|
-
function
|
|
4906
|
+
function Bo(t) {
|
|
4895
4907
|
return typeof t[0] == "string" && t.unshift(t.shift().replace(/%(o|s|f|d|i)/g, (e, s) => {
|
|
4896
4908
|
const n = t.shift();
|
|
4897
4909
|
if (n === void 0)
|
|
@@ -4902,33 +4914,33 @@ function Ao(t) {
|
|
|
4902
4914
|
case "s":
|
|
4903
4915
|
return Cs(n);
|
|
4904
4916
|
case "f":
|
|
4905
|
-
return
|
|
4917
|
+
return Lo(n);
|
|
4906
4918
|
case "d":
|
|
4907
4919
|
case "i":
|
|
4908
|
-
return
|
|
4920
|
+
return Po(n);
|
|
4909
4921
|
default:
|
|
4910
4922
|
return e;
|
|
4911
4923
|
}
|
|
4912
4924
|
})), t.map(wn).join(" ");
|
|
4913
4925
|
}
|
|
4914
4926
|
const xn = ["log", "info", "warn", "error", "debug", "assert"];
|
|
4915
|
-
function
|
|
4927
|
+
function jo(t, e) {
|
|
4916
4928
|
const s = Object.assign({
|
|
4917
4929
|
consoleMethods: xn,
|
|
4918
4930
|
consoleThrottling: 30
|
|
4919
4931
|
}, e);
|
|
4920
4932
|
if (!Array.isArray(s.consoleMethods) || s.consoleMethods.length === 0)
|
|
4921
4933
|
return;
|
|
4922
|
-
const n = t.safe((a,
|
|
4934
|
+
const n = t.safe((a, h) => t.send(Cr(a, Bo(h))));
|
|
4923
4935
|
let i = 0;
|
|
4924
4936
|
const r = () => {
|
|
4925
4937
|
i = 0;
|
|
4926
4938
|
};
|
|
4927
4939
|
t.attachStartCallback(r), t.ticker.attach(r, 33, !1);
|
|
4928
|
-
const o = (a,
|
|
4940
|
+
const o = (a, h) => {
|
|
4929
4941
|
const c = {
|
|
4930
4942
|
apply: function(d, p, y) {
|
|
4931
|
-
Reflect.apply(d,
|
|
4943
|
+
Reflect.apply(d, h, y), i = i + 1, !(i > s.consoleThrottling) && n(d.name, y);
|
|
4932
4944
|
}
|
|
4933
4945
|
};
|
|
4934
4946
|
s.consoleMethods.forEach((d) => {
|
|
@@ -4936,14 +4948,14 @@ function Fo(t, e) {
|
|
|
4936
4948
|
t.debug.error(`OpenReplay: unsupported console method "${d}"`);
|
|
4937
4949
|
return;
|
|
4938
4950
|
}
|
|
4939
|
-
const p =
|
|
4951
|
+
const p = h.console[d];
|
|
4940
4952
|
a[d] = new Proxy(p, c);
|
|
4941
4953
|
});
|
|
4942
4954
|
}, l = t.safe((a) => o(a.console, a));
|
|
4943
4955
|
l(window), t.observer.attachContextCallback(l);
|
|
4944
4956
|
}
|
|
4945
|
-
var
|
|
4946
|
-
function
|
|
4957
|
+
var xi = { exports: {} }, as = { exports: {} }, kn;
|
|
4958
|
+
function Uo() {
|
|
4947
4959
|
return kn || (kn = 1, function(t, e) {
|
|
4948
4960
|
(function(s, n) {
|
|
4949
4961
|
t.exports = n();
|
|
@@ -4959,7 +4971,7 @@ function Mo() {
|
|
|
4959
4971
|
return this[b];
|
|
4960
4972
|
};
|
|
4961
4973
|
}
|
|
4962
|
-
var r = ["isConstructor", "isEval", "isNative", "isToplevel"], o = ["columnNumber", "lineNumber"], l = ["fileName", "functionName", "source"], a = ["args"],
|
|
4974
|
+
var r = ["isConstructor", "isEval", "isNative", "isToplevel"], o = ["columnNumber", "lineNumber"], l = ["fileName", "functionName", "source"], a = ["args"], h = ["evalOrigin"], c = r.concat(o, l, a, h);
|
|
4963
4975
|
function d(b) {
|
|
4964
4976
|
if (b)
|
|
4965
4977
|
for (var T = 0; T < c.length; T++)
|
|
@@ -5027,7 +5039,7 @@ function Mo() {
|
|
|
5027
5039
|
}
|
|
5028
5040
|
(function(t, e) {
|
|
5029
5041
|
(function(s, n) {
|
|
5030
|
-
t.exports = n(
|
|
5042
|
+
t.exports = n(Uo());
|
|
5031
5043
|
})($e, function(n) {
|
|
5032
5044
|
var i = /(^|@)\S+:\d+/, r = /^\s*at .*(\S+:\d+|\(native\))/m, o = /^(eval@)?(\[native code])?$/;
|
|
5033
5045
|
return {
|
|
@@ -5050,15 +5062,15 @@ function Mo() {
|
|
|
5050
5062
|
extractLocation: function(a) {
|
|
5051
5063
|
if (a.indexOf(":") === -1)
|
|
5052
5064
|
return [a];
|
|
5053
|
-
var
|
|
5065
|
+
var h = /(.+?)(?::(\d+))?(?::(\d+))?$/, c = h.exec(a.replace(/[()]/g, ""));
|
|
5054
5066
|
return [c[1], c[2] || void 0, c[3] || void 0];
|
|
5055
5067
|
},
|
|
5056
5068
|
parseV8OrIE: function(a) {
|
|
5057
|
-
var
|
|
5069
|
+
var h = a.stack.split(`
|
|
5058
5070
|
`).filter(function(c) {
|
|
5059
5071
|
return !!c.match(r);
|
|
5060
5072
|
}, this);
|
|
5061
|
-
return
|
|
5073
|
+
return h.map(function(c) {
|
|
5062
5074
|
c.indexOf("(eval ") > -1 && (c = c.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
|
|
5063
5075
|
var d = c.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), p = d.match(/ (\(.+\)$)/);
|
|
5064
5076
|
d = p ? d.replace(p[0], "") : d;
|
|
@@ -5073,11 +5085,11 @@ function Mo() {
|
|
|
5073
5085
|
}, this);
|
|
5074
5086
|
},
|
|
5075
5087
|
parseFFOrSafari: function(a) {
|
|
5076
|
-
var
|
|
5088
|
+
var h = a.stack.split(`
|
|
5077
5089
|
`).filter(function(c) {
|
|
5078
5090
|
return !c.match(o);
|
|
5079
5091
|
}, this);
|
|
5080
|
-
return
|
|
5092
|
+
return h.map(function(c) {
|
|
5081
5093
|
if (c.indexOf(" > eval") > -1 && (c = c.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ":$1")), c.indexOf("@") === -1 && c.indexOf(":") === -1)
|
|
5082
5094
|
return new n({
|
|
5083
5095
|
functionName: c
|
|
@@ -5099,9 +5111,9 @@ function Mo() {
|
|
|
5099
5111
|
`).length ? this.parseOpera9(a) : a.stack ? this.parseOpera11(a) : this.parseOpera10(a);
|
|
5100
5112
|
},
|
|
5101
5113
|
parseOpera9: function(a) {
|
|
5102
|
-
for (var
|
|
5114
|
+
for (var h = /Line (\d+).*script (?:in )?(\S+)/i, c = a.message.split(`
|
|
5103
5115
|
`), d = [], p = 2, y = c.length; p < y; p += 2) {
|
|
5104
|
-
var w =
|
|
5116
|
+
var w = h.exec(c[p]);
|
|
5105
5117
|
w && d.push(new n({
|
|
5106
5118
|
fileName: w[2],
|
|
5107
5119
|
lineNumber: w[1],
|
|
@@ -5111,9 +5123,9 @@ function Mo() {
|
|
|
5111
5123
|
return d;
|
|
5112
5124
|
},
|
|
5113
5125
|
parseOpera10: function(a) {
|
|
5114
|
-
for (var
|
|
5126
|
+
for (var h = /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, c = a.stacktrace.split(`
|
|
5115
5127
|
`), d = [], p = 0, y = c.length; p < y; p += 2) {
|
|
5116
|
-
var w =
|
|
5128
|
+
var w = h.exec(c[p]);
|
|
5117
5129
|
w && d.push(
|
|
5118
5130
|
new n({
|
|
5119
5131
|
functionName: w[3] || void 0,
|
|
@@ -5127,11 +5139,11 @@ function Mo() {
|
|
|
5127
5139
|
},
|
|
5128
5140
|
// Opera 10.65+ Error.stack very similar to FF/Safari
|
|
5129
5141
|
parseOpera11: function(a) {
|
|
5130
|
-
var
|
|
5142
|
+
var h = a.stack.split(`
|
|
5131
5143
|
`).filter(function(c) {
|
|
5132
5144
|
return !!c.match(i) && !c.match(/^Error created at/);
|
|
5133
5145
|
}, this);
|
|
5134
|
-
return
|
|
5146
|
+
return h.map(function(c) {
|
|
5135
5147
|
var d = c.split("@"), p = this.extractLocation(d.pop()), y = d.shift() || "", w = y.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0, b;
|
|
5136
5148
|
y.match(/\(([^)]*)\)/) && (b = y.replace(/^[^(]+\(([^)]*)\)$/, "$1"));
|
|
5137
5149
|
var T = b === void 0 || b === "[arguments not available]" ? void 0 : b.split(",");
|
|
@@ -5147,9 +5159,9 @@ function Mo() {
|
|
|
5147
5159
|
}
|
|
5148
5160
|
};
|
|
5149
5161
|
});
|
|
5150
|
-
})(
|
|
5151
|
-
var
|
|
5152
|
-
const
|
|
5162
|
+
})(xi);
|
|
5163
|
+
var Ho = xi.exports;
|
|
5164
|
+
const zo = /* @__PURE__ */ Xn(Ho);
|
|
5153
5165
|
function Tn(t) {
|
|
5154
5166
|
return [
|
|
5155
5167
|
{
|
|
@@ -5164,12 +5176,12 @@ function Tn(t) {
|
|
|
5164
5176
|
function Et(t, e, s = {}) {
|
|
5165
5177
|
let n = e;
|
|
5166
5178
|
try {
|
|
5167
|
-
n =
|
|
5179
|
+
n = zo.parse(t);
|
|
5168
5180
|
} catch {
|
|
5169
5181
|
}
|
|
5170
5182
|
return bs(t.name, t.message, JSON.stringify(n), JSON.stringify(s));
|
|
5171
5183
|
}
|
|
5172
|
-
function
|
|
5184
|
+
function ki(t, e = window, s = {}) {
|
|
5173
5185
|
if (t instanceof ErrorEvent) {
|
|
5174
5186
|
if (t.error instanceof Error)
|
|
5175
5187
|
return Et(t.error, Tn(t), s);
|
|
@@ -5192,13 +5204,13 @@ function yi(t, e = window, s = {}) {
|
|
|
5192
5204
|
}
|
|
5193
5205
|
return null;
|
|
5194
5206
|
}
|
|
5195
|
-
function
|
|
5207
|
+
function Wo(t, e) {
|
|
5196
5208
|
const s = Object.assign({
|
|
5197
5209
|
captureExceptions: !0
|
|
5198
5210
|
}, e);
|
|
5199
5211
|
function n(i) {
|
|
5200
5212
|
function r(o) {
|
|
5201
|
-
const l =
|
|
5213
|
+
const l = ki(o, i);
|
|
5202
5214
|
l != null && t.send(l);
|
|
5203
5215
|
}
|
|
5204
5216
|
t.attachEventListener(i, "unhandledrejection", r), t.attachEventListener(i, "error", r);
|
|
@@ -5208,37 +5220,37 @@ function Bo(t, e) {
|
|
|
5208
5220
|
function En(t, e = document.location) {
|
|
5209
5221
|
return t = t.trim(), t.startsWith("//") || t.startsWith("http://") || t.startsWith("https://") || t.startsWith("data:") ? t : t.startsWith("/") ? e.origin + t : e.origin + e.pathname + t;
|
|
5210
5222
|
}
|
|
5211
|
-
function
|
|
5212
|
-
return
|
|
5223
|
+
function $o(t) {
|
|
5224
|
+
return or && (t.startsWith("data:image/svg+xml") || t.match(/.svg$|/i));
|
|
5213
5225
|
}
|
|
5214
|
-
const
|
|
5215
|
-
function
|
|
5226
|
+
const qo = "https://static.openreplay.com/tracker/placeholder.jpeg";
|
|
5227
|
+
function Vo(t) {
|
|
5216
5228
|
function e(l, a) {
|
|
5217
|
-
t.attributeSender.sendSetAttribute(l, "src",
|
|
5218
|
-
const { width:
|
|
5219
|
-
a.hasAttribute("width") || t.attributeSender.sendSetAttribute(l, "width", String(
|
|
5229
|
+
t.attributeSender.sendSetAttribute(l, "src", qo);
|
|
5230
|
+
const { width: h, height: c } = a.getBoundingClientRect();
|
|
5231
|
+
a.hasAttribute("width") || t.attributeSender.sendSetAttribute(l, "width", String(h)), a.hasAttribute("height") || t.attributeSender.sendSetAttribute(l, "height", String(c));
|
|
5220
5232
|
}
|
|
5221
5233
|
const s = function(l, a) {
|
|
5222
|
-
const { srcset:
|
|
5223
|
-
if (!
|
|
5234
|
+
const { srcset: h } = a;
|
|
5235
|
+
if (!h)
|
|
5224
5236
|
return;
|
|
5225
|
-
const c =
|
|
5237
|
+
const c = h.split(h.match(/,\s+/) ? /,\s+/ : ",").map((d) => En(d)).join(", ");
|
|
5226
5238
|
t.attributeSender.sendSetAttribute(l, "srcset", c);
|
|
5227
5239
|
}, n = function(l, a) {
|
|
5228
|
-
a.src.length >
|
|
5240
|
+
a.src.length > ar && e(l, a), t.send(ms(l, "src", a.src, t.getBaseHref()));
|
|
5229
5241
|
}, i = t.safe(function(l) {
|
|
5230
5242
|
const a = En(l.src || "");
|
|
5231
|
-
|
|
5243
|
+
ui(a) && t.send(vi(t.timestamp(), 0, 0, 0, 0, 0, a, "img", 0, !1));
|
|
5232
5244
|
}), r = t.safe(function(l) {
|
|
5233
5245
|
const a = t.nodes.getID(l);
|
|
5234
|
-
a !== void 0 && l.complete && (l.naturalHeight === 0 && l.naturalWidth === 0 &&
|
|
5235
|
-
}), o =
|
|
5246
|
+
a !== void 0 && l.complete && (l.naturalHeight === 0 && l.naturalWidth === 0 && !$o(l.src) ? i(l) : t.sanitizer.isHidden(a) || t.sanitizer.isObscured(a) ? e(a, l) : (n(a, l), s(a, l)));
|
|
5247
|
+
}), o = di(t.safe((l) => {
|
|
5236
5248
|
for (const a of l)
|
|
5237
5249
|
if (a.type === "attributes") {
|
|
5238
|
-
const
|
|
5250
|
+
const h = a.target, c = t.nodes.getID(h);
|
|
5239
5251
|
if (c === void 0)
|
|
5240
5252
|
return;
|
|
5241
|
-
a.attributeName === "src" && n(c,
|
|
5253
|
+
a.attributeName === "src" && n(c, h), a.attributeName === "srcset" && s(c, h);
|
|
5242
5254
|
}
|
|
5243
5255
|
}));
|
|
5244
5256
|
t.attachStopCallback(() => {
|
|
@@ -5247,7 +5259,7 @@ function Ho(t) {
|
|
|
5247
5259
|
Q(l, "img") && (t.nodes.attachNodeListener(l, "error", () => i(l)), t.nodes.attachNodeListener(l, "load", () => r(l)), r(l), o.observe(l, { attributes: !0, attributeFilter: ["src", "srcset"] }));
|
|
5248
5260
|
});
|
|
5249
5261
|
}
|
|
5250
|
-
const
|
|
5262
|
+
const Go = [
|
|
5251
5263
|
"text",
|
|
5252
5264
|
"password",
|
|
5253
5265
|
"email",
|
|
@@ -5258,16 +5270,16 @@ const zo = [
|
|
|
5258
5270
|
"tel",
|
|
5259
5271
|
"time"
|
|
5260
5272
|
];
|
|
5261
|
-
function
|
|
5262
|
-
return Q(t, "textarea") ? !0 : Q(t, "input") ?
|
|
5273
|
+
function Ko(t) {
|
|
5274
|
+
return Q(t, "textarea") ? !0 : Q(t, "input") ? Go.includes(t.type) : !1;
|
|
5263
5275
|
}
|
|
5264
|
-
function
|
|
5276
|
+
function Xo(t) {
|
|
5265
5277
|
if (!Q(t, "input"))
|
|
5266
5278
|
return !1;
|
|
5267
5279
|
const e = t.type;
|
|
5268
5280
|
return e === "checkbox" || e === "radio";
|
|
5269
5281
|
}
|
|
5270
|
-
const
|
|
5282
|
+
const Jo = xe && "labels" in HTMLInputElement.prototype ? (t) => {
|
|
5271
5283
|
let e = t;
|
|
5272
5284
|
for (; (e = e.parentNode) !== null; )
|
|
5273
5285
|
if (Q(e, "label"))
|
|
@@ -5287,20 +5299,20 @@ const qo = xe && "labels" in HTMLInputElement.prototype ? (t) => {
|
|
|
5287
5299
|
return n[0];
|
|
5288
5300
|
}
|
|
5289
5301
|
};
|
|
5290
|
-
function
|
|
5302
|
+
function Ti(t) {
|
|
5291
5303
|
let e = Fs(t);
|
|
5292
5304
|
if (e === null) {
|
|
5293
|
-
const s =
|
|
5305
|
+
const s = Jo(t);
|
|
5294
5306
|
e = s && s.innerText || t.placeholder || t.name || t.id || t.className || t.type;
|
|
5295
5307
|
}
|
|
5296
|
-
return
|
|
5308
|
+
return hi(e).slice(0, 100);
|
|
5297
5309
|
}
|
|
5298
5310
|
const Ue = {
|
|
5299
5311
|
Plain: 0,
|
|
5300
5312
|
Obscured: 1,
|
|
5301
5313
|
Hidden: 2
|
|
5302
5314
|
};
|
|
5303
|
-
function
|
|
5315
|
+
function Yo(t, e) {
|
|
5304
5316
|
const s = Object.assign({
|
|
5305
5317
|
obscureInputNumbers: !0,
|
|
5306
5318
|
obscureInputEmails: !0,
|
|
@@ -5323,7 +5335,7 @@ function Vo(t, e) {
|
|
|
5323
5335
|
}
|
|
5324
5336
|
function i(c, d) {
|
|
5325
5337
|
const { value: p, mask: y } = n(c, d);
|
|
5326
|
-
t.send(
|
|
5338
|
+
t.send(kr(c, p, y));
|
|
5327
5339
|
}
|
|
5328
5340
|
const r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
5329
5341
|
t.attachStopCallback(() => {
|
|
@@ -5333,7 +5345,7 @@ function Vo(t, e) {
|
|
|
5333
5345
|
r.get(c) !== d.value && (r.set(c, d.value), i(c, d));
|
|
5334
5346
|
}
|
|
5335
5347
|
function a(c, d) {
|
|
5336
|
-
o.get(c) !== d && (o.set(c, d), t.send(
|
|
5348
|
+
o.get(c) !== d && (o.set(c, d), t.send(Tr(c, d)));
|
|
5337
5349
|
}
|
|
5338
5350
|
t.ticker.attach(() => {
|
|
5339
5351
|
r.forEach((c, d) => {
|
|
@@ -5348,14 +5360,14 @@ function Vo(t, e) {
|
|
|
5348
5360
|
a(d, p.checked);
|
|
5349
5361
|
});
|
|
5350
5362
|
}, 3);
|
|
5351
|
-
function
|
|
5352
|
-
const { value: w, mask: b } = n(c, d), T =
|
|
5353
|
-
t.send(
|
|
5363
|
+
function h(c, d, p, y) {
|
|
5364
|
+
const { value: w, mask: b } = n(c, d), T = Ti(d);
|
|
5365
|
+
t.send(Hr(c, w, b !== 0, T, p, y));
|
|
5354
5366
|
}
|
|
5355
5367
|
t.nodes.attachNodeCallback(t.safe((c) => {
|
|
5356
5368
|
const d = t.nodes.getID(c);
|
|
5357
5369
|
if (d !== void 0) {
|
|
5358
|
-
if (Q(c, "select") && (i(d, c), t.nodes.attachNodeListener(c, "change", () => i(d, c))),
|
|
5370
|
+
if (Q(c, "select") && (i(d, c), t.nodes.attachNodeListener(c, "change", () => i(d, c))), Ko(c)) {
|
|
5359
5371
|
l(d, c);
|
|
5360
5372
|
let p = 0, y = 0, w = 0;
|
|
5361
5373
|
const b = () => {
|
|
@@ -5363,21 +5375,21 @@ function Vo(t, e) {
|
|
|
5363
5375
|
}, T = () => {
|
|
5364
5376
|
y === 0 && p !== 0 && (y = ge() - p);
|
|
5365
5377
|
}, D = () => {
|
|
5366
|
-
p !== 0 && (w = ge() - p),
|
|
5378
|
+
p !== 0 && (w = ge() - p), h(d, c, y, w), y = 0, w = 0, p = 0;
|
|
5367
5379
|
};
|
|
5368
5380
|
t.nodes.attachNodeListener(c, "focus", b), t.nodes.attachNodeListener(c, "input", T), t.nodes.attachNodeListener(c, "change", D);
|
|
5369
5381
|
return;
|
|
5370
5382
|
}
|
|
5371
|
-
if (
|
|
5383
|
+
if (Xo(c)) {
|
|
5372
5384
|
a(d, c.checked), t.nodes.attachNodeListener(c, "change", () => a(d, c.checked));
|
|
5373
5385
|
return;
|
|
5374
5386
|
}
|
|
5375
5387
|
}
|
|
5376
5388
|
}));
|
|
5377
5389
|
}
|
|
5378
|
-
let de, Ps,
|
|
5379
|
-
function
|
|
5380
|
-
if (
|
|
5390
|
+
let de, Ps, Ei;
|
|
5391
|
+
function Qo(t, e) {
|
|
5392
|
+
if (Ei = /* @__PURE__ */ new Date(), t.nodeType !== Node.ELEMENT_NODE)
|
|
5381
5393
|
throw new Error("Can't generate CSS selector for non-element node type.");
|
|
5382
5394
|
if (t.tagName.toLowerCase() === "html")
|
|
5383
5395
|
return "html";
|
|
@@ -5393,34 +5405,34 @@ function Go(t, e) {
|
|
|
5393
5405
|
maxNumberOfTries: 1e4,
|
|
5394
5406
|
timeoutMs: void 0
|
|
5395
5407
|
};
|
|
5396
|
-
de = { ...s, ...e }, Ps =
|
|
5408
|
+
de = { ...s, ...e }, Ps = Zo(de.root, s);
|
|
5397
5409
|
let n = ot(t, "all", () => ot(t, "two", () => ot(t, "one", () => ot(t, "none"))));
|
|
5398
5410
|
if (n) {
|
|
5399
|
-
const i =
|
|
5411
|
+
const i = _i(Oi(n, t));
|
|
5400
5412
|
return i.length > 0 && (n = i[0]), Rt(n);
|
|
5401
5413
|
} else
|
|
5402
5414
|
throw new Error("Selector was not found.");
|
|
5403
5415
|
}
|
|
5404
|
-
function
|
|
5416
|
+
function Zo(t, e) {
|
|
5405
5417
|
return t.nodeType === Node.DOCUMENT_NODE ? t : t === e.root ? t.ownerDocument : t;
|
|
5406
5418
|
}
|
|
5407
5419
|
function ot(t, e, s) {
|
|
5408
5420
|
let n = null, i = [], r = t, o = 0;
|
|
5409
5421
|
for (; r; ) {
|
|
5410
|
-
const l = (/* @__PURE__ */ new Date()).getTime() -
|
|
5422
|
+
const l = (/* @__PURE__ */ new Date()).getTime() - Ei.getTime();
|
|
5411
5423
|
if (de.timeoutMs !== void 0 && l > de.timeoutMs)
|
|
5412
5424
|
throw new Error(`Timeout: Can't find a unique selector after ${l}ms`);
|
|
5413
|
-
let a = ct(
|
|
5414
|
-
const
|
|
5425
|
+
let a = ct(ea(r)) || ct(...ta(r)) || ct(...sa(r)) || ct(na(r)) || [_n()];
|
|
5426
|
+
const h = ia(r);
|
|
5415
5427
|
if (e == "all")
|
|
5416
|
-
|
|
5428
|
+
h && (a = a.concat(a.filter(cs).map((c) => at(c, h))));
|
|
5417
5429
|
else if (e == "two")
|
|
5418
|
-
a = a.slice(0, 1),
|
|
5430
|
+
a = a.slice(0, 1), h && (a = a.concat(a.filter(cs).map((c) => at(c, h))));
|
|
5419
5431
|
else if (e == "one") {
|
|
5420
5432
|
const [c] = a = a.slice(0, 1);
|
|
5421
|
-
|
|
5433
|
+
h && cs(c) && (a = [at(c, h)]);
|
|
5422
5434
|
} else
|
|
5423
|
-
e == "none" && (a = [_n()],
|
|
5435
|
+
e == "none" && (a = [_n()], h && (a = [at(a[0], h)]));
|
|
5424
5436
|
for (let c of a)
|
|
5425
5437
|
c.level = o;
|
|
5426
5438
|
if (i.push(a), i.length >= de.seedMinLength && (n = Cn(i, s), n))
|
|
@@ -5430,11 +5442,11 @@ function ot(t, e, s) {
|
|
|
5430
5442
|
return n || (n = Cn(i, s)), !n && s ? s() : n;
|
|
5431
5443
|
}
|
|
5432
5444
|
function Cn(t, e) {
|
|
5433
|
-
const s =
|
|
5445
|
+
const s = _i(Ii(t));
|
|
5434
5446
|
if (s.length > de.threshold)
|
|
5435
5447
|
return e ? e() : null;
|
|
5436
5448
|
for (let n of s)
|
|
5437
|
-
if (
|
|
5449
|
+
if (Ci(n))
|
|
5438
5450
|
return n;
|
|
5439
5451
|
return null;
|
|
5440
5452
|
}
|
|
@@ -5449,7 +5461,7 @@ function Rt(t) {
|
|
|
5449
5461
|
function In(t) {
|
|
5450
5462
|
return t.map((e) => e.penalty).reduce((e, s) => e + s, 0);
|
|
5451
5463
|
}
|
|
5452
|
-
function
|
|
5464
|
+
function Ci(t) {
|
|
5453
5465
|
const e = Rt(t);
|
|
5454
5466
|
switch (Ps.querySelectorAll(e).length) {
|
|
5455
5467
|
case 0:
|
|
@@ -5460,26 +5472,26 @@ function wi(t) {
|
|
|
5460
5472
|
return !1;
|
|
5461
5473
|
}
|
|
5462
5474
|
}
|
|
5463
|
-
function
|
|
5475
|
+
function ea(t) {
|
|
5464
5476
|
const e = t.getAttribute("id");
|
|
5465
5477
|
return e && de.idName(e) ? {
|
|
5466
5478
|
name: "#" + CSS.escape(e),
|
|
5467
5479
|
penalty: 0
|
|
5468
5480
|
} : null;
|
|
5469
5481
|
}
|
|
5470
|
-
function
|
|
5482
|
+
function ta(t) {
|
|
5471
5483
|
return Array.from(t.attributes).filter((s) => de.attr(s.name, s.value)).map((s) => ({
|
|
5472
5484
|
name: `[${CSS.escape(s.name)}="${CSS.escape(s.value)}"]`,
|
|
5473
5485
|
penalty: 0.5
|
|
5474
5486
|
}));
|
|
5475
5487
|
}
|
|
5476
|
-
function
|
|
5488
|
+
function sa(t) {
|
|
5477
5489
|
return Array.from(t.classList).filter(de.className).map((s) => ({
|
|
5478
5490
|
name: "." + CSS.escape(s),
|
|
5479
5491
|
penalty: 1
|
|
5480
5492
|
}));
|
|
5481
5493
|
}
|
|
5482
|
-
function
|
|
5494
|
+
function na(t) {
|
|
5483
5495
|
const e = t.tagName.toLowerCase();
|
|
5484
5496
|
return de.tagName(e) ? {
|
|
5485
5497
|
name: e,
|
|
@@ -5492,7 +5504,7 @@ function _n() {
|
|
|
5492
5504
|
penalty: 3
|
|
5493
5505
|
};
|
|
5494
5506
|
}
|
|
5495
|
-
function
|
|
5507
|
+
function ia(t) {
|
|
5496
5508
|
const e = t.parentNode;
|
|
5497
5509
|
if (!e)
|
|
5498
5510
|
return null;
|
|
@@ -5514,23 +5526,23 @@ function cs(t) {
|
|
|
5514
5526
|
return t.name !== "html" && !t.name.startsWith("#");
|
|
5515
5527
|
}
|
|
5516
5528
|
function ct(...t) {
|
|
5517
|
-
const e = t.filter(
|
|
5529
|
+
const e = t.filter(ra);
|
|
5518
5530
|
return e.length > 0 ? e : null;
|
|
5519
5531
|
}
|
|
5520
|
-
function
|
|
5532
|
+
function ra(t) {
|
|
5521
5533
|
return t != null;
|
|
5522
5534
|
}
|
|
5523
|
-
function*
|
|
5535
|
+
function* Ii(t, e = []) {
|
|
5524
5536
|
if (t.length > 0)
|
|
5525
5537
|
for (let s of t[0])
|
|
5526
|
-
yield*
|
|
5538
|
+
yield* Ii(t.slice(1, t.length), e.concat(s));
|
|
5527
5539
|
else
|
|
5528
5540
|
yield e;
|
|
5529
5541
|
}
|
|
5530
|
-
function
|
|
5542
|
+
function _i(t) {
|
|
5531
5543
|
return [...t].sort((e, s) => In(e) - In(s));
|
|
5532
5544
|
}
|
|
5533
|
-
function*
|
|
5545
|
+
function* Oi(t, e, s = {
|
|
5534
5546
|
counter: 0,
|
|
5535
5547
|
visited: /* @__PURE__ */ new Map()
|
|
5536
5548
|
}) {
|
|
@@ -5544,14 +5556,14 @@ function* Ti(t, e, s = {
|
|
|
5544
5556
|
const r = Rt(i);
|
|
5545
5557
|
if (s.visited.has(r))
|
|
5546
5558
|
return;
|
|
5547
|
-
|
|
5559
|
+
Ci(i) && oa(i, e) && (yield i, s.visited.set(r, !0), yield* Oi(i, e, s));
|
|
5548
5560
|
}
|
|
5549
5561
|
}
|
|
5550
|
-
function
|
|
5562
|
+
function oa(t, e) {
|
|
5551
5563
|
return Ps.querySelector(Rt(t)) === e;
|
|
5552
5564
|
}
|
|
5553
|
-
function
|
|
5554
|
-
return
|
|
5565
|
+
function aa(t, e, s) {
|
|
5566
|
+
return Qo(t, {
|
|
5555
5567
|
root: e.body,
|
|
5556
5568
|
seedMinLength: 3,
|
|
5557
5569
|
optimizedMinLength: (s == null ? void 0 : s.minSelectorDepth) || 2,
|
|
@@ -5564,9 +5576,9 @@ function Is(t) {
|
|
|
5564
5576
|
return e === "BUTTON" || e === "A" || e === "LI" || e === "SELECT" || e === "TR" || e === "TH" || t.onclick != null || t.getAttribute("role") === "button";
|
|
5565
5577
|
}
|
|
5566
5578
|
function On(t, e) {
|
|
5567
|
-
return t instanceof Element ?
|
|
5579
|
+
return t instanceof Element ? ca(t, e) : null;
|
|
5568
5580
|
}
|
|
5569
|
-
function
|
|
5581
|
+
function ca(t, e) {
|
|
5570
5582
|
let s = t;
|
|
5571
5583
|
for (; s !== null && s !== e.documentElement; ) {
|
|
5572
5584
|
if (Fe(s, "masked"))
|
|
@@ -5588,21 +5600,21 @@ function na(t, e) {
|
|
|
5588
5600
|
}
|
|
5589
5601
|
return t === e.documentElement ? null : t;
|
|
5590
5602
|
}
|
|
5591
|
-
function
|
|
5603
|
+
function la(t, e) {
|
|
5592
5604
|
const { disableClickmaps: s = !1 } = e || {};
|
|
5593
5605
|
function n(k) {
|
|
5594
5606
|
const O = Fs(k);
|
|
5595
5607
|
if (O !== null)
|
|
5596
5608
|
return O;
|
|
5597
5609
|
if (Q(k, "input"))
|
|
5598
|
-
return
|
|
5610
|
+
return Ti(k);
|
|
5599
5611
|
if (Is(k)) {
|
|
5600
5612
|
let N = "";
|
|
5601
|
-
return k instanceof HTMLElement && (N = t.sanitizer.getInnerTextSecure(k)), N = N || k.id || k.className,
|
|
5613
|
+
return k instanceof HTMLElement && (N = t.sanitizer.getInnerTextSecure(k)), N = N || k.id || k.className, hi(N).slice(0, 100);
|
|
5602
5614
|
}
|
|
5603
5615
|
return "";
|
|
5604
5616
|
}
|
|
5605
|
-
let i = -1, r = -1, o = !1, l = null, a = 0,
|
|
5617
|
+
let i = -1, r = -1, o = !1, l = null, a = 0, h = {}, c = 0, d = 0, p = 0, y = 0, w;
|
|
5606
5618
|
const b = 8e-3, T = 225;
|
|
5607
5619
|
function D() {
|
|
5608
5620
|
const k = y / T;
|
|
@@ -5611,18 +5623,18 @@ function ia(t, e) {
|
|
|
5611
5623
|
return;
|
|
5612
5624
|
}
|
|
5613
5625
|
const O = (k - c) / T;
|
|
5614
|
-
p > 4 && O > b && t.send(
|
|
5626
|
+
p > 4 && O > b && t.send(zr(ge())), y = 0, p = 0, c = k;
|
|
5615
5627
|
}
|
|
5616
5628
|
t.attachStartCallback(() => {
|
|
5617
5629
|
w = setInterval(() => D(), T);
|
|
5618
5630
|
}), t.attachStopCallback(() => {
|
|
5619
|
-
i = -1, r = -1, o = !1, l = null,
|
|
5631
|
+
i = -1, r = -1, o = !1, l = null, h = {}, w && clearInterval(w);
|
|
5620
5632
|
});
|
|
5621
5633
|
const B = () => {
|
|
5622
|
-
o && (t.send(
|
|
5634
|
+
o && (t.send(Er(i, r)), o = !1);
|
|
5623
5635
|
}, A = (k, O = !1) => {
|
|
5624
5636
|
function N(C, E, P) {
|
|
5625
|
-
return
|
|
5637
|
+
return h[C] = h[C] || aa(E, k, P);
|
|
5626
5638
|
}
|
|
5627
5639
|
const F = O ? t.attachEventListener.bind(t) : t.nodes.attachNodeListener.bind(t.nodes);
|
|
5628
5640
|
F(k.documentElement, "mouseover", (C) => {
|
|
@@ -5640,7 +5652,7 @@ function ia(t, e) {
|
|
|
5640
5652
|
const P = t.nodes.getID(E);
|
|
5641
5653
|
if (P !== void 0) {
|
|
5642
5654
|
const V = C.pageX, j = C.pageY, W = k.documentElement.scrollWidth, I = k.documentElement.scrollHeight, M = Nn(V / W), q = Nn(j / I);
|
|
5643
|
-
B(), t.send(
|
|
5655
|
+
B(), t.send(Br(P, l === E ? Math.round(performance.now() - a) : 0, n(E), Is(E) && !s ? N(P, E, e) : "", M, q), !0);
|
|
5644
5656
|
}
|
|
5645
5657
|
l = null;
|
|
5646
5658
|
});
|
|
@@ -5652,7 +5664,7 @@ function ia(t, e) {
|
|
|
5652
5664
|
function Nn(t) {
|
|
5653
5665
|
return Math.round(t * 1e4);
|
|
5654
5666
|
}
|
|
5655
|
-
function
|
|
5667
|
+
function ha(t) {
|
|
5656
5668
|
const e = [], s = document.getElementsByTagName("*"), n = /url\(("[^"]*"|'[^']*'|[^)]*)\)/i;
|
|
5657
5669
|
for (let i = 0; i < s.length; i++) {
|
|
5658
5670
|
const r = s[i];
|
|
@@ -5669,15 +5681,15 @@ function ra(t) {
|
|
|
5669
5681
|
const l = o.substr(0, 10) === "data:image" ? 0 : t[o];
|
|
5670
5682
|
if (l === void 0)
|
|
5671
5683
|
continue;
|
|
5672
|
-
const a = r.getBoundingClientRect(),
|
|
5673
|
-
if (d <=
|
|
5684
|
+
const a = r.getBoundingClientRect(), h = Math.max(a.top, 0), c = Math.max(a.left, 0), d = Math.min(a.bottom, window.innerHeight || document.documentElement && document.documentElement.clientHeight || 0), p = Math.min(a.right, window.innerWidth || document.documentElement && document.documentElement.clientWidth || 0);
|
|
5685
|
+
if (d <= h || p <= c)
|
|
5674
5686
|
continue;
|
|
5675
|
-
const y = (d -
|
|
5687
|
+
const y = (d - h) * (p - c);
|
|
5676
5688
|
e.push({ time: l, area: y });
|
|
5677
5689
|
}
|
|
5678
5690
|
return e;
|
|
5679
5691
|
}
|
|
5680
|
-
function
|
|
5692
|
+
function ua(t, e) {
|
|
5681
5693
|
let s = Math.max(document.documentElement && document.documentElement.clientWidth || 0, window.innerWidth || 0) * Math.max(document.documentElement && document.documentElement.clientHeight || 0, window.innerHeight || 0) / 10, n = s * t;
|
|
5682
5694
|
for (let i = 0; i < e.length; i++) {
|
|
5683
5695
|
const { time: r, area: o } = e[i];
|
|
@@ -5685,7 +5697,7 @@ function oa(t, e) {
|
|
|
5685
5697
|
}
|
|
5686
5698
|
return s === 0 ? 0 : n / s;
|
|
5687
5699
|
}
|
|
5688
|
-
function
|
|
5700
|
+
function da(t, e) {
|
|
5689
5701
|
const s = Object.assign({
|
|
5690
5702
|
captureResourceTimings: !0,
|
|
5691
5703
|
capturePageLoadTimings: !0,
|
|
@@ -5695,43 +5707,43 @@ function aa(t, e) {
|
|
|
5695
5707
|
if ("PerformanceObserver" in window || (s.captureResourceTimings = !1), !s.captureResourceTimings)
|
|
5696
5708
|
return;
|
|
5697
5709
|
let n = {};
|
|
5698
|
-
function i(
|
|
5710
|
+
function i(h) {
|
|
5699
5711
|
var d;
|
|
5700
|
-
if (
|
|
5712
|
+
if (h.duration < 0 || !ui(h.name) || t.isServiceURL(h.name))
|
|
5701
5713
|
return;
|
|
5702
|
-
n !== null && (n[
|
|
5714
|
+
n !== null && (n[h.name] = h.startTime + h.duration);
|
|
5703
5715
|
let c = !1;
|
|
5704
5716
|
(d = s.excludedResourceUrls) == null || d.forEach((p) => {
|
|
5705
|
-
if (
|
|
5717
|
+
if (h.name.startsWith(p)) {
|
|
5706
5718
|
c = !0;
|
|
5707
5719
|
return;
|
|
5708
5720
|
}
|
|
5709
|
-
}), !c && t.send(
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5721
|
+
}), !c && t.send(vi(
|
|
5722
|
+
h.startTime + Ge(),
|
|
5723
|
+
h.duration,
|
|
5724
|
+
h.responseStart && h.startTime ? h.responseStart - h.startTime : 0,
|
|
5725
|
+
h.transferSize > h.encodedBodySize ? h.transferSize - h.encodedBodySize : 0,
|
|
5726
|
+
h.encodedBodySize || 0,
|
|
5727
|
+
h.decodedBodySize || 0,
|
|
5728
|
+
h.name,
|
|
5729
|
+
h.initiatorType,
|
|
5730
|
+
h.transferSize,
|
|
5719
5731
|
// @ts-ignore
|
|
5720
|
-
|
|
5732
|
+
h.responseStatus && h.responseStatus === 304 || h.transferSize === 0
|
|
5721
5733
|
));
|
|
5722
5734
|
}
|
|
5723
|
-
const r = new PerformanceObserver((
|
|
5735
|
+
const r = new PerformanceObserver((h) => h.getEntries().forEach(i));
|
|
5724
5736
|
let o;
|
|
5725
|
-
t.attachStartCallback(function({ sessionID:
|
|
5726
|
-
|
|
5737
|
+
t.attachStartCallback(function({ sessionID: h }) {
|
|
5738
|
+
h !== o && (performance.getEntriesByType("resource").forEach(i), o = h), r.observe({ entryTypes: ["resource"] });
|
|
5727
5739
|
}), t.attachStopCallback(function() {
|
|
5728
5740
|
r.disconnect();
|
|
5729
5741
|
});
|
|
5730
5742
|
let l = 0, a = 0;
|
|
5731
5743
|
if (s.capturePageLoadTimings) {
|
|
5732
|
-
let
|
|
5744
|
+
let h = !1;
|
|
5733
5745
|
t.ticker.attach(() => {
|
|
5734
|
-
if (!
|
|
5746
|
+
if (!h && ((l === 0 || a === 0) && performance.getEntriesByType("paint").forEach((c) => {
|
|
5735
5747
|
const { name: d, startTime: p } = c;
|
|
5736
5748
|
switch (d) {
|
|
5737
5749
|
case "first-paint":
|
|
@@ -5742,7 +5754,7 @@ function aa(t, e) {
|
|
|
5742
5754
|
break;
|
|
5743
5755
|
}
|
|
5744
5756
|
}), performance.timing.loadEventEnd || performance.now() > 3e4)) {
|
|
5745
|
-
|
|
5757
|
+
h = !0;
|
|
5746
5758
|
const {
|
|
5747
5759
|
// should be ok to use here, (https://github.com/mdn/content/issues/4713)
|
|
5748
5760
|
// since it is compared with the values obtained on the page load (before any possible sleep state)
|
|
@@ -5756,20 +5768,20 @@ function aa(t, e) {
|
|
|
5756
5768
|
loadEventStart: T,
|
|
5757
5769
|
loadEventEnd: D
|
|
5758
5770
|
} = performance.timing;
|
|
5759
|
-
t.send(
|
|
5771
|
+
t.send(Ir(d - c || 0, p - c || 0, y - c || 0, w - c || 0, b - c || 0, T - c || 0, D - c || 0, l, a));
|
|
5760
5772
|
}
|
|
5761
5773
|
}, 30);
|
|
5762
5774
|
}
|
|
5763
5775
|
if (s.capturePageRenderTimings) {
|
|
5764
|
-
let
|
|
5776
|
+
let h = 0, c = 0, d = 0, p = null, y = !1;
|
|
5765
5777
|
t.ticker.attach(() => {
|
|
5766
5778
|
if (y)
|
|
5767
5779
|
return;
|
|
5768
5780
|
const w = performance.now();
|
|
5769
|
-
if (n !== null && (
|
|
5781
|
+
if (n !== null && (h = Math.max.apply(null, Object.keys(n).map((b) => n[b])), w - h > 1e3 && (p = ha(n), n = null)), d !== null && (w - d > 50 && (c = w), d = w - c > 5e3 ? null : w), p !== null && d === null || w > 3e4) {
|
|
5770
5782
|
y = !0, n = null;
|
|
5771
|
-
const b = p === null ? 0 :
|
|
5772
|
-
t.send(
|
|
5783
|
+
const b = p === null ? 0 : ua(a || l, p), { domContentLoadedEventEnd: T, navigationStart: D } = performance.timing, B = d === null ? Math.max(c, a, T - D || 0) : 0;
|
|
5784
|
+
t.send(_r(b, a > h ? a : h, B));
|
|
5773
5785
|
}
|
|
5774
5786
|
});
|
|
5775
5787
|
}
|
|
@@ -5781,23 +5793,23 @@ function ls(t) {
|
|
|
5781
5793
|
e && e.scrollY || t.documentElement && t.documentElement.scrollTop || t.body && t.body.scrollTop || 0
|
|
5782
5794
|
];
|
|
5783
5795
|
}
|
|
5784
|
-
function
|
|
5796
|
+
function fa(t, e) {
|
|
5785
5797
|
let s = !1;
|
|
5786
5798
|
const n = /* @__PURE__ */ new Map();
|
|
5787
5799
|
function i(l) {
|
|
5788
|
-
|
|
5800
|
+
bi(l) && (Te(l) && n.set(l, [l.scrollLeft, l.scrollTop]), kt(l) && n.set(l, ls(l)));
|
|
5789
5801
|
}
|
|
5790
5802
|
const r = t.safe(() => {
|
|
5791
|
-
e || t.send(
|
|
5803
|
+
e || t.send(gr(...ls(document)));
|
|
5792
5804
|
}), o = t.safe((l, a) => {
|
|
5793
|
-
const
|
|
5794
|
-
|
|
5805
|
+
const h = t.nodes.getID(a);
|
|
5806
|
+
h !== void 0 && t.send(xr(h, l[0], l[1]));
|
|
5795
5807
|
});
|
|
5796
5808
|
t.attachStartCallback(r), t.attachStopCallback(() => {
|
|
5797
5809
|
s = !1, n.clear();
|
|
5798
5810
|
}), t.nodes.attachNodeCallback((l, a) => {
|
|
5799
|
-
a && (Te(l) && l.scrollLeft + l.scrollTop > 0 ? n.set(l, [l.scrollLeft, l.scrollTop]) : kt(l) && n.set(l, ls(l))), Nt(l) && t.nodes.attachNodeListener(l, "scroll", (
|
|
5800
|
-
i(
|
|
5811
|
+
a && (Te(l) && l.scrollLeft + l.scrollTop > 0 ? n.set(l, [l.scrollLeft, l.scrollTop]) : kt(l) && n.set(l, ls(l))), Nt(l) && t.nodes.attachNodeListener(l, "scroll", (h) => {
|
|
5812
|
+
i(h.target);
|
|
5801
5813
|
});
|
|
5802
5814
|
}), t.attachEventListener(document, "scroll", (l) => {
|
|
5803
5815
|
const a = l.target;
|
|
@@ -5810,15 +5822,15 @@ function ca(t, e) {
|
|
|
5810
5822
|
s && (r(), s = !1), n.forEach(o), n.clear();
|
|
5811
5823
|
}, 5, !1);
|
|
5812
5824
|
}
|
|
5813
|
-
function
|
|
5825
|
+
function pa(t) {
|
|
5814
5826
|
let e, s, n, i, r = document.referrer;
|
|
5815
5827
|
const o = t.safe(() => {
|
|
5816
|
-
const { URL:
|
|
5817
|
-
|
|
5828
|
+
const { URL: h } = document;
|
|
5829
|
+
h !== e && (e = h, t.send(Vr(e, r, i, document.title)), i = 0, r = e);
|
|
5818
5830
|
}), l = t.safe(() => {
|
|
5819
|
-
const { innerWidth:
|
|
5820
|
-
(
|
|
5821
|
-
}), a = document.hidden === void 0 ? Function.prototype : t.safe(() => t.send(
|
|
5831
|
+
const { innerWidth: h, innerHeight: c } = window;
|
|
5832
|
+
(h !== s || c !== n) && (s = h, n = c, t.send(pr(s, n)));
|
|
5833
|
+
}), a = document.hidden === void 0 ? Function.prototype : t.safe(() => t.send(Fr(document.hidden)));
|
|
5822
5834
|
t.attachStartCallback(() => {
|
|
5823
5835
|
e = null, i = Ge(), s = n = -1, o(), l(), a();
|
|
5824
5836
|
}), document.hidden !== void 0 && t.attachEventListener(document, "visibilitychange", a, !1, !1), t.ticker.attach(o, 1, !1), t.ticker.attach(l, 5, !1);
|
|
@@ -5827,12 +5839,12 @@ function Rn(t) {
|
|
|
5827
5839
|
return Nt(t) && // @ts-ignore
|
|
5828
5840
|
!!t.adoptedStyleSheets;
|
|
5829
5841
|
}
|
|
5830
|
-
let
|
|
5831
|
-
function
|
|
5832
|
-
return
|
|
5842
|
+
let ga = 15;
|
|
5843
|
+
function Ni() {
|
|
5844
|
+
return ga++;
|
|
5833
5845
|
}
|
|
5834
5846
|
const lt = /* @__PURE__ */ new Map();
|
|
5835
|
-
function
|
|
5847
|
+
function ma(t) {
|
|
5836
5848
|
if (t === null || !Rn(document))
|
|
5837
5849
|
return;
|
|
5838
5850
|
const e = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), n = (o) => setTimeout(() => {
|
|
@@ -5841,30 +5853,30 @@ function ha(t) {
|
|
|
5841
5853
|
return;
|
|
5842
5854
|
let a = s.get(l);
|
|
5843
5855
|
a || (a = []);
|
|
5844
|
-
const
|
|
5856
|
+
const h = [], c = o.adoptedStyleSheets;
|
|
5845
5857
|
if (c && Symbol.iterator in c)
|
|
5846
5858
|
for (const d of c) {
|
|
5847
5859
|
let p = e.get(d);
|
|
5848
5860
|
const y = !p;
|
|
5849
|
-
if (p || (p =
|
|
5861
|
+
if (p || (p = Ni(), e.set(d, p)), a.includes(p) || t.send(mi(p, l)), y) {
|
|
5850
5862
|
const w = d.cssRules;
|
|
5851
5863
|
for (let b = 0; b < w.length; b++)
|
|
5852
5864
|
t.send(ys(p, w[b].cssText, b, t.getBaseHref()));
|
|
5853
5865
|
}
|
|
5854
|
-
|
|
5866
|
+
h.push(p);
|
|
5855
5867
|
}
|
|
5856
5868
|
if (Symbol.iterator in a)
|
|
5857
5869
|
for (const d of a)
|
|
5858
|
-
|
|
5859
|
-
s.set(l,
|
|
5870
|
+
h.includes(d) || t.send(jr(d, l));
|
|
5871
|
+
s.set(l, h);
|
|
5860
5872
|
}, 20);
|
|
5861
5873
|
function i(o) {
|
|
5862
5874
|
const l = Object.getOwnPropertyDescriptor(o, "adoptedStyleSheets");
|
|
5863
5875
|
l && Object.defineProperty(o, "adoptedStyleSheets", {
|
|
5864
5876
|
...l,
|
|
5865
5877
|
set: function(a) {
|
|
5866
|
-
const
|
|
5867
|
-
return n(this),
|
|
5878
|
+
const h = l.set.call(this, a);
|
|
5879
|
+
return n(this), h;
|
|
5868
5880
|
}
|
|
5869
5881
|
});
|
|
5870
5882
|
}
|
|
@@ -5873,14 +5885,14 @@ function ha(t) {
|
|
|
5873
5885
|
return;
|
|
5874
5886
|
o.__openreplay_adpss_patched__ = !0, i(o.Document.prototype), i(o.ShadowRoot.prototype);
|
|
5875
5887
|
const { replace: l, replaceSync: a } = o.CSSStyleSheet.prototype;
|
|
5876
|
-
o.CSSStyleSheet.prototype.replace = function(
|
|
5877
|
-
return l.call(this,
|
|
5888
|
+
o.CSSStyleSheet.prototype.replace = function(h) {
|
|
5889
|
+
return l.call(this, h).then((c) => {
|
|
5878
5890
|
const d = e.get(this);
|
|
5879
|
-
return d && t.send(on(d,
|
|
5891
|
+
return d && t.send(on(d, h, t.getBaseHref())), c;
|
|
5880
5892
|
});
|
|
5881
|
-
}, o.CSSStyleSheet.prototype.replaceSync = function(
|
|
5893
|
+
}, o.CSSStyleSheet.prototype.replaceSync = function(h) {
|
|
5882
5894
|
const c = e.get(this);
|
|
5883
|
-
return c && t.send(on(c,
|
|
5895
|
+
return c && t.send(on(c, h, t.getBaseHref())), a.call(this, h);
|
|
5884
5896
|
};
|
|
5885
5897
|
};
|
|
5886
5898
|
r(window), t.observer.attachContextCallback(t.safe(r)), t.attachStopCallback(() => {
|
|
@@ -5891,11 +5903,11 @@ function ha(t) {
|
|
|
5891
5903
|
Rn(o) && n(o);
|
|
5892
5904
|
});
|
|
5893
5905
|
}
|
|
5894
|
-
function
|
|
5906
|
+
function va(t) {
|
|
5895
5907
|
if (t === null)
|
|
5896
5908
|
return;
|
|
5897
5909
|
if (!window.CSSStyleSheet) {
|
|
5898
|
-
t.send(
|
|
5910
|
+
t.send(Lr("no_stylesheet_prototype_in_window", ""));
|
|
5899
5911
|
return;
|
|
5900
5912
|
}
|
|
5901
5913
|
const e = t.safe((i, r, o) => {
|
|
@@ -5915,19 +5927,19 @@ function da(t) {
|
|
|
5915
5927
|
t.debug.warn("No sheedID found for", o, lt);
|
|
5916
5928
|
return;
|
|
5917
5929
|
}
|
|
5918
|
-
const a = r.cssText,
|
|
5930
|
+
const a = r.cssText, h = o.cssRules, c = Array.from(h).indexOf(r);
|
|
5919
5931
|
c >= 0 ? (t.send(ys(l, a, c, t.getBaseHref())), t.send(an(l, c + 1))) : t.debug.warn("Rule index not found in", o, r);
|
|
5920
5932
|
}), n = t.safe((i) => {
|
|
5921
5933
|
const { insertRule: r, deleteRule: o } = i.CSSStyleSheet.prototype, { insertRule: l, deleteRule: a } = i.CSSGroupingRule.prototype;
|
|
5922
|
-
i.CSSStyleSheet.prototype.insertRule = function(
|
|
5923
|
-
return e(this, c,
|
|
5924
|
-
}, i.CSSStyleSheet.prototype.deleteRule = function(
|
|
5925
|
-
return e(this,
|
|
5926
|
-
}, i.CSSGroupingRule.prototype.insertRule = function(
|
|
5927
|
-
const d = l.call(this,
|
|
5934
|
+
i.CSSStyleSheet.prototype.insertRule = function(h, c = 0) {
|
|
5935
|
+
return e(this, c, h), r.call(this, h, c);
|
|
5936
|
+
}, i.CSSStyleSheet.prototype.deleteRule = function(h) {
|
|
5937
|
+
return e(this, h), o.call(this, h);
|
|
5938
|
+
}, i.CSSGroupingRule.prototype.insertRule = function(h, c = 0) {
|
|
5939
|
+
const d = l.call(this, h, c);
|
|
5928
5940
|
return s(this), d;
|
|
5929
|
-
}, i.CSSGroupingRule.prototype.deleteRule = function(
|
|
5930
|
-
const c = a.call(this,
|
|
5941
|
+
}, i.CSSGroupingRule.prototype.deleteRule = function(h = 0) {
|
|
5942
|
+
const c = a.call(this, h);
|
|
5931
5943
|
return s(this), c;
|
|
5932
5944
|
};
|
|
5933
5945
|
});
|
|
@@ -5937,14 +5949,14 @@ function da(t) {
|
|
|
5937
5949
|
const r = t.nodes.getID(i);
|
|
5938
5950
|
if (!r)
|
|
5939
5951
|
return;
|
|
5940
|
-
const o = i.sheet, l =
|
|
5941
|
-
lt.set(o, l), t.send(
|
|
5952
|
+
const o = i.sheet, l = Ni();
|
|
5953
|
+
lt.set(o, l), t.send(mi(l, r));
|
|
5942
5954
|
const a = o.cssRules;
|
|
5943
|
-
for (let
|
|
5944
|
-
e(o,
|
|
5955
|
+
for (let h = 0; h < a.length; h++)
|
|
5956
|
+
e(o, h, a[h].cssText);
|
|
5945
5957
|
});
|
|
5946
5958
|
}
|
|
5947
|
-
function
|
|
5959
|
+
function ya(t) {
|
|
5948
5960
|
function e(n) {
|
|
5949
5961
|
const i = t.nodes.getID(n);
|
|
5950
5962
|
i !== void 0 && t.send(rn(i));
|
|
@@ -5952,7 +5964,7 @@ function fa(t) {
|
|
|
5952
5964
|
let s = !1;
|
|
5953
5965
|
t.nodes.attachNodeCallback((n) => {
|
|
5954
5966
|
Q(n, "body") && (t.nodes.attachNodeListener(n, "focus", (i) => {
|
|
5955
|
-
|
|
5967
|
+
bi(i.target) && (e(i.target), s = !1);
|
|
5956
5968
|
}), t.nodes.attachNodeListener(n, "blur", (i) => {
|
|
5957
5969
|
i.relatedTarget === null && (s = !0, setTimeout(() => {
|
|
5958
5970
|
s && t.send(rn(-1));
|
|
@@ -5965,7 +5977,7 @@ function fa(t) {
|
|
|
5965
5977
|
n && n !== n.ownerDocument.body && e(n);
|
|
5966
5978
|
}, !0);
|
|
5967
5979
|
}
|
|
5968
|
-
function
|
|
5980
|
+
function ba(t) {
|
|
5969
5981
|
if (!window.FontFace)
|
|
5970
5982
|
return;
|
|
5971
5983
|
const e = /* @__PURE__ */ new Map(), s = (n) => {
|
|
@@ -5976,8 +5988,8 @@ function pa(t) {
|
|
|
5976
5988
|
o[2] && t.safe(() => {
|
|
5977
5989
|
l = JSON.stringify(o[2]);
|
|
5978
5990
|
});
|
|
5979
|
-
const a = [o[0], o[1], l],
|
|
5980
|
-
|
|
5991
|
+
const a = [o[0], o[1], l], h = e.get(n.document) || [];
|
|
5992
|
+
h.push(a), e.set(n.document, h);
|
|
5981
5993
|
const c = n === window ? 0 : t.nodes.getID(n.document);
|
|
5982
5994
|
if (c === void 0)
|
|
5983
5995
|
return;
|
|
@@ -6000,7 +6012,7 @@ function pa(t) {
|
|
|
6000
6012
|
});
|
|
6001
6013
|
}));
|
|
6002
6014
|
}
|
|
6003
|
-
function
|
|
6015
|
+
function Sa(t, e, s, n, i) {
|
|
6004
6016
|
t.debug.log("Openreplay: attaching axios spy to instance", e);
|
|
6005
6017
|
function r(p) {
|
|
6006
6018
|
t.debug.log("Openreplay: capturing axios response data", p);
|
|
@@ -6045,12 +6057,12 @@ function ga(t, e, s, n, i) {
|
|
|
6045
6057
|
return s.failuresOnly || r(p), p;
|
|
6046
6058
|
}
|
|
6047
6059
|
function a(p) {
|
|
6048
|
-
return t.debug.log("Openreplay: capturing API request error", p),
|
|
6060
|
+
return t.debug.log("Openreplay: capturing API request error", p), wa(p) && p.response ? r(p.response) : p instanceof Error && t.send(Et(p, [])), Promise.reject(p);
|
|
6049
6061
|
}
|
|
6050
|
-
function
|
|
6062
|
+
function h(p) {
|
|
6051
6063
|
t.debug.log("Openreplay: failed API request, skipping", p);
|
|
6052
6064
|
}
|
|
6053
|
-
const c = e.interceptors.request.use(o,
|
|
6065
|
+
const c = e.interceptors.request.use(o, h, {
|
|
6054
6066
|
synchronous: !0
|
|
6055
6067
|
}), d = e.interceptors.response.use(l, a, {
|
|
6056
6068
|
synchronous: !0
|
|
@@ -6060,10 +6072,10 @@ function ga(t, e, s, n, i) {
|
|
|
6060
6072
|
(y = (p = e.interceptors.request).eject) == null || y.call(p, c), (b = (w = e.interceptors.response).eject) == null || b.call(w, d);
|
|
6061
6073
|
});
|
|
6062
6074
|
}
|
|
6063
|
-
function
|
|
6064
|
-
return
|
|
6075
|
+
function wa(t) {
|
|
6076
|
+
return xa(t) && t.isAxiosError === !0;
|
|
6065
6077
|
}
|
|
6066
|
-
function
|
|
6078
|
+
function xa(t) {
|
|
6067
6079
|
return t !== null && typeof t == "object";
|
|
6068
6080
|
}
|
|
6069
6081
|
var we;
|
|
@@ -6128,7 +6140,7 @@ const st = (t, e) => {
|
|
|
6128
6140
|
(t[0] === "{" || t[0] === "[") && (e = t);
|
|
6129
6141
|
const s = t.split("&");
|
|
6130
6142
|
s.length === 1 ? e = t : e = s.join(",");
|
|
6131
|
-
} else if (
|
|
6143
|
+
} else if (Ta(t)) {
|
|
6132
6144
|
const s = [];
|
|
6133
6145
|
for (const [n, i] of t)
|
|
6134
6146
|
s.push(`${n}=${typeof i == "string" ? i : "[object Object]"}`);
|
|
@@ -6136,7 +6148,7 @@ const st = (t, e) => {
|
|
|
6136
6148
|
} else
|
|
6137
6149
|
t instanceof Blob || t instanceof ReadableStream || t instanceof ArrayBuffer ? e = "byte data" : Us(t) ? e = t : e = `can't parse body ${typeof t}`;
|
|
6138
6150
|
return e;
|
|
6139
|
-
},
|
|
6151
|
+
}, ka = (t, e = {}) => {
|
|
6140
6152
|
Us(e) || (e = {});
|
|
6141
6153
|
let s = t ? t.split("?") : [];
|
|
6142
6154
|
if (s.shift(), s.length > 0) {
|
|
@@ -6155,14 +6167,14 @@ const st = (t, e) => {
|
|
|
6155
6167
|
function Us(t) {
|
|
6156
6168
|
return t !== null && typeof t == "object";
|
|
6157
6169
|
}
|
|
6158
|
-
function
|
|
6170
|
+
function Ta(t) {
|
|
6159
6171
|
return t == null || ArrayBuffer.isView(t) ? !1 : typeof Symbol < "u" && typeof t[Symbol.iterator] == "function";
|
|
6160
6172
|
}
|
|
6161
6173
|
function Ct(t) {
|
|
6162
6174
|
return t <= 0 ? "" : t >= 1e3 * 1e3 ? (t / 1e3 / 1e3).toFixed(1) + " MB" : t >= 1e3 ? (t / 1e3).toFixed(1) + " KB" : `${t}B`;
|
|
6163
6175
|
}
|
|
6164
6176
|
const _s = (t) => (t.startsWith("//") && (t = `${new URL(window.location.href).protocol}${t}`), t.startsWith("http") ? new URL(t) : new URL(t, window.location.href));
|
|
6165
|
-
class
|
|
6177
|
+
class Ea {
|
|
6166
6178
|
constructor(e, s) {
|
|
6167
6179
|
this.resp = e, this.item = s, this.mockReader();
|
|
6168
6180
|
}
|
|
@@ -6203,7 +6215,7 @@ class Sa {
|
|
|
6203
6215
|
};
|
|
6204
6216
|
}
|
|
6205
6217
|
}
|
|
6206
|
-
class
|
|
6218
|
+
class Ca {
|
|
6207
6219
|
constructor(e, s, n, i, r, o) {
|
|
6208
6220
|
this.ignoredHeaders = e, this.setSessionTokenHeader = s, this.sanitize = n, this.sendMessage = i, this.isServiceUrl = r, this.tokenUrlMatcher = o;
|
|
6209
6221
|
}
|
|
@@ -6213,11 +6225,11 @@ class wa {
|
|
|
6213
6225
|
typeof i != "string" && !(i != null && i.url) || (i instanceof URL || typeof i == "string" ? this.isServiceUrl(String(i)) : this.isServiceUrl(String(i.url))))
|
|
6214
6226
|
return e.apply(window, n);
|
|
6215
6227
|
const l = new Bs(this.ignoredHeaders, this.setSessionTokenHeader, this.sanitize);
|
|
6216
|
-
return this.beforeFetch(l, i, r), this.setSessionTokenHeader((a,
|
|
6228
|
+
return this.beforeFetch(l, i, r), this.setSessionTokenHeader((a, h) => {
|
|
6217
6229
|
if (!(this.tokenUrlMatcher !== void 0 && !this.tokenUrlMatcher(l.url))) {
|
|
6218
6230
|
if (n[1] === void 0 && n[0] instanceof Request)
|
|
6219
|
-
return n[0].headers.append(a,
|
|
6220
|
-
n[1] || (n[1] = {}), n[1].headers === void 0 && (n[1] = { ...n[1], headers: {} }), n[1].headers instanceof Headers ? n[1].headers.append(a,
|
|
6231
|
+
return n[0].headers.append(a, h);
|
|
6232
|
+
n[1] || (n[1] = {}), n[1].headers === void 0 && (n[1] = { ...n[1], headers: {} }), n[1].headers instanceof Headers ? n[1].headers.append(a, h) : Array.isArray(n[1].headers) ? n[1].headers.push([a, h]) : n[1].headers[a] = h;
|
|
6221
6233
|
}
|
|
6222
6234
|
}), e.apply(window, n).then(this.afterFetch(l)).catch((a) => {
|
|
6223
6235
|
throw l.endTime = performance.now(), l.duration = l.endTime - (l.startTime || l.endTime), a;
|
|
@@ -6252,7 +6264,7 @@ class wa {
|
|
|
6252
6264
|
}).catch((i) => {
|
|
6253
6265
|
if (i.name !== "AbortError")
|
|
6254
6266
|
throw i;
|
|
6255
|
-
})), new Proxy(s, new
|
|
6267
|
+
})), new Proxy(s, new Ea(s, e));
|
|
6256
6268
|
};
|
|
6257
6269
|
}
|
|
6258
6270
|
handleResponseBody(e, s) {
|
|
@@ -6260,12 +6272,12 @@ class wa {
|
|
|
6260
6272
|
return n && n.includes("application/json") ? (s.responseType = "json", e.text()) : n && (n.includes("text/html") || n.includes("text/plain")) ? (s.responseType = "text", e.text()) : (s.responseType = "arraybuffer", e.arrayBuffer());
|
|
6261
6273
|
}
|
|
6262
6274
|
}
|
|
6263
|
-
class
|
|
6275
|
+
class Ia {
|
|
6264
6276
|
static create(e, s, n, i, r, o) {
|
|
6265
|
-
return new Proxy(fetch, new
|
|
6277
|
+
return new Proxy(fetch, new Ca(e, s, n, i, r, o));
|
|
6266
6278
|
}
|
|
6267
6279
|
}
|
|
6268
|
-
class
|
|
6280
|
+
class _a {
|
|
6269
6281
|
constructor(e, s, n, i, r, o, l) {
|
|
6270
6282
|
this.ignoredHeaders = s, this.setSessionTokenHeader = n, this.sanitize = i, this.sendMessage = r, this.isServiceUrl = o, this.tokenUrlMatcher = l, this.XMLReq = e, this.XMLReq.onreadystatechange = () => {
|
|
6271
6283
|
this.onReadyStateChange();
|
|
@@ -6324,7 +6336,7 @@ class ka {
|
|
|
6324
6336
|
return (...n) => {
|
|
6325
6337
|
var o, l;
|
|
6326
6338
|
const i = n[0], r = n[1];
|
|
6327
|
-
return this.item.method = i ? i.toUpperCase() : "GET", this.item.url = ((o = r.toString) == null ? void 0 : o.call(r)) || "", this.item.name = ((l = this.item.url) == null ? void 0 : l.replace(new RegExp("/*$"), "").split("/").pop()) ?? "", this.item.getData =
|
|
6339
|
+
return this.item.method = i ? i.toUpperCase() : "GET", this.item.url = ((o = r.toString) == null ? void 0 : o.call(r)) || "", this.item.name = ((l = this.item.url) == null ? void 0 : l.replace(new RegExp("/*$"), "").split("/").pop()) ?? "", this.item.getData = ka(this.item.url, {}), s.apply(e, n);
|
|
6328
6340
|
};
|
|
6329
6341
|
}
|
|
6330
6342
|
getSend(e) {
|
|
@@ -6386,18 +6398,18 @@ class ka {
|
|
|
6386
6398
|
}
|
|
6387
6399
|
}
|
|
6388
6400
|
}
|
|
6389
|
-
class
|
|
6401
|
+
class Oa {
|
|
6390
6402
|
static create(e, s, n, i, r, o) {
|
|
6391
6403
|
return new Proxy(XMLHttpRequest, {
|
|
6392
6404
|
construct(l) {
|
|
6393
6405
|
const a = new l();
|
|
6394
|
-
return new Proxy(a, new
|
|
6406
|
+
return new Proxy(a, new _a(a, e, s, n, i, r, o));
|
|
6395
6407
|
}
|
|
6396
6408
|
});
|
|
6397
6409
|
}
|
|
6398
6410
|
}
|
|
6399
|
-
const
|
|
6400
|
-
class
|
|
6411
|
+
const Na = (t) => t instanceof Blob ? t.type : t instanceof FormData ? "multipart/form-data" : t instanceof URLSearchParams ? "application/x-www-form-urlencoded;charset=UTF-8" : "text/plain;charset=UTF-8";
|
|
6412
|
+
class Ra {
|
|
6401
6413
|
constructor(e, s, n, i, r) {
|
|
6402
6414
|
this.ignoredHeaders = e, this.setSessionTokenHeader = s, this.sanitize = n, this.sendMessage = i, this.isServiceUrl = r;
|
|
6403
6415
|
}
|
|
@@ -6406,7 +6418,7 @@ class Ca {
|
|
|
6406
6418
|
if (this.isServiceUrl(i))
|
|
6407
6419
|
return e.apply(s, n);
|
|
6408
6420
|
const l = _s(i);
|
|
6409
|
-
if (o.method = "POST", o.url = i, o.name = (l.pathname.split("/").pop() || "") + l.search, o.requestType = "beacon", o.requestHeader = { "Content-Type":
|
|
6421
|
+
if (o.method = "POST", o.url = i, o.name = (l.pathname.split("/").pop() || "") + l.search, o.requestType = "beacon", o.requestHeader = { "Content-Type": Na(r) }, o.status = 0, o.statusText = "Pending", l.search && l.searchParams) {
|
|
6410
6422
|
o.getData = {};
|
|
6411
6423
|
for (const [c, d] of l.searchParams)
|
|
6412
6424
|
o.getData[c] = d;
|
|
@@ -6414,8 +6426,8 @@ class Ca {
|
|
|
6414
6426
|
o.requestData = js(r), o.startTime || (o.startTime = performance.now());
|
|
6415
6427
|
const a = e.apply(s, n);
|
|
6416
6428
|
a ? (o.endTime = performance.now(), o.duration = o.endTime - (o.startTime || o.endTime), o.status = 0, o.statusText = "Sent", o.readyState = 4) : (o.status = 500, o.statusText = "Unknown");
|
|
6417
|
-
const
|
|
6418
|
-
return
|
|
6429
|
+
const h = o.getMessage();
|
|
6430
|
+
return h && this.sendMessage(h), a;
|
|
6419
6431
|
}
|
|
6420
6432
|
}
|
|
6421
6433
|
class Ve {
|
|
@@ -6424,24 +6436,24 @@ class Ve {
|
|
|
6424
6436
|
}
|
|
6425
6437
|
static create(e, s, n, i, r) {
|
|
6426
6438
|
if (Ve.hasSendBeacon())
|
|
6427
|
-
return new Proxy(Ve.origSendBeacon, new
|
|
6439
|
+
return new Proxy(Ve.origSendBeacon, new Ra(e, s, n, i, r));
|
|
6428
6440
|
}
|
|
6429
6441
|
}
|
|
6430
|
-
var
|
|
6431
|
-
Ve.origSendBeacon = (
|
|
6442
|
+
var Un;
|
|
6443
|
+
Ve.origSendBeacon = (Un = window == null ? void 0 : window.navigator) == null ? void 0 : Un.sendBeacon;
|
|
6432
6444
|
const Dn = (t) => console.warn(`Openreplay: Can't find ${t} in global context.
|
|
6433
6445
|
If you're using serverside rendering in your app, make sure that tracker is loaded dynamically, otherwise ${t} won't be tracked.`);
|
|
6434
|
-
function
|
|
6446
|
+
function Da(t, e, s, n, i, r, o) {
|
|
6435
6447
|
var l;
|
|
6436
|
-
t.XMLHttpRequest ? t.XMLHttpRequest =
|
|
6448
|
+
t.XMLHttpRequest ? t.XMLHttpRequest = Oa.create(e, s, n, i, r, o) : Dn("XMLHttpRequest"), t.fetch ? t.fetch = Ia.create(e, s, n, i, r, o) : Dn("fetch"), (l = t == null ? void 0 : t.navigator) != null && l.sendBeacon && (t.navigator.sendBeacon = Ve.create(e, s, n, i, r));
|
|
6437
6449
|
}
|
|
6438
|
-
function
|
|
6450
|
+
function hs(t) {
|
|
6439
6451
|
return t.__or_req_data__ || (t.__or_req_data__ = { body: void 0, headers: {} }), t.__or_req_data__;
|
|
6440
6452
|
}
|
|
6441
6453
|
function An(t) {
|
|
6442
6454
|
return typeof t == "string" ? t.toUpperCase() : "GET";
|
|
6443
6455
|
}
|
|
6444
|
-
function
|
|
6456
|
+
function Aa(t, e = {}) {
|
|
6445
6457
|
const s = Object.assign({
|
|
6446
6458
|
failuresOnly: !1,
|
|
6447
6459
|
ignoreHeaders: ["cookie", "set-cookie", "authorization"],
|
|
@@ -6480,9 +6492,9 @@ function _a(t, e = {}) {
|
|
|
6480
6492
|
}
|
|
6481
6493
|
return JSON.stringify(c);
|
|
6482
6494
|
}
|
|
6483
|
-
const
|
|
6495
|
+
const h = (c) => {
|
|
6484
6496
|
if (s.useProxy)
|
|
6485
|
-
return
|
|
6497
|
+
return Da(c, s.ignoreHeaders, o, l, (A) => t.send(A), (A) => t.isServiceURL(A), s.tokenUrlMatcher);
|
|
6486
6498
|
const d = c.fetch.bind(c), p = (A, k = {}) => {
|
|
6487
6499
|
if (!(typeof A == "string" || A instanceof URL) || t.isServiceURL(String(A)))
|
|
6488
6500
|
return d(A, k);
|
|
@@ -6532,7 +6544,7 @@ function _a(t, e = {}) {
|
|
|
6532
6544
|
return O.addEventListener("loadstart", (F) => {
|
|
6533
6545
|
N = F.timeStamp;
|
|
6534
6546
|
}), O.addEventListener("load", t.safe((F) => {
|
|
6535
|
-
const { headers: C, body: E } =
|
|
6547
|
+
const { headers: C, body: E } = hs(O), P = N > 0 ? F.timeStamp - N : 0, j = (O.getAllResponseHeaders() || "").trim().split(/[\r\n]+/), W = {};
|
|
6536
6548
|
j.forEach(function(q) {
|
|
6537
6549
|
const G = q.split(": "), H = G.shift();
|
|
6538
6550
|
i(H) || (W[H] = G.join(": "));
|
|
@@ -6555,23 +6567,23 @@ function _a(t, e = {}) {
|
|
|
6555
6567
|
})), y.apply(this, arguments);
|
|
6556
6568
|
}
|
|
6557
6569
|
function D(A) {
|
|
6558
|
-
const k =
|
|
6570
|
+
const k = hs(this);
|
|
6559
6571
|
return k.body = A, b.apply(this, arguments);
|
|
6560
6572
|
}
|
|
6561
6573
|
function B(A, k) {
|
|
6562
6574
|
if (!i(A)) {
|
|
6563
|
-
const O =
|
|
6575
|
+
const O = hs(this);
|
|
6564
6576
|
O.headers[A] = k;
|
|
6565
6577
|
}
|
|
6566
6578
|
return w.apply(this, arguments);
|
|
6567
6579
|
}
|
|
6568
6580
|
s.axiosInstances || (c.XMLHttpRequest.prototype.open = T, c.XMLHttpRequest.prototype.send = D, c.XMLHttpRequest.prototype.setRequestHeader = B);
|
|
6569
6581
|
};
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
}), s.captureInIframes && t.observer.attachContextCallback(t.safe(
|
|
6582
|
+
h(window), s.axiosInstances && s.axiosInstances.forEach((c) => {
|
|
6583
|
+
Sa(t, c, s, l, a);
|
|
6584
|
+
}), s.captureInIframes && t.observer.attachContextCallback(t.safe(h));
|
|
6573
6585
|
}
|
|
6574
|
-
function
|
|
6586
|
+
function Fa(t) {
|
|
6575
6587
|
t.attachEventListener(document, "selectionchange", () => {
|
|
6576
6588
|
const e = document.getSelection();
|
|
6577
6589
|
if (e !== null && !e.isCollapsed) {
|
|
@@ -6581,14 +6593,14 @@ function Oa(t) {
|
|
|
6581
6593
|
t.send(cn(-1, -1, ""));
|
|
6582
6594
|
});
|
|
6583
6595
|
}
|
|
6584
|
-
function
|
|
6596
|
+
function Ma(t) {
|
|
6585
6597
|
function e() {
|
|
6586
6598
|
document.hidden || (t.debug.log("Openreplay: tab change to" + t.session.getTabId()), t.send(dt(t.session.getTabId())));
|
|
6587
6599
|
}
|
|
6588
6600
|
t.attachEventListener(window, "focus", e, !1, !1);
|
|
6589
6601
|
}
|
|
6590
6602
|
const pt = "/installation/javascript-sdk";
|
|
6591
|
-
function
|
|
6603
|
+
function La(t) {
|
|
6592
6604
|
if (t == null)
|
|
6593
6605
|
return console.error(`OpenReplay: invalid options argument type. Please, check documentation on ${wt}${pt}`), !1;
|
|
6594
6606
|
if (typeof t.projectKey != "string")
|
|
@@ -6600,31 +6612,31 @@ function Ra(t) {
|
|
|
6600
6612
|
console.warn("OpenReplay: projectKey is expected to have a string type."), t.projectKey = t.projectKey.toString();
|
|
6601
6613
|
return t.sessionToken != null && Oe("`sessionToken` option", "`sessionHash` start() option", "/"), !0;
|
|
6602
6614
|
}
|
|
6603
|
-
class
|
|
6615
|
+
class Pa {
|
|
6604
6616
|
constructor(e) {
|
|
6605
6617
|
var l;
|
|
6606
6618
|
if (this.options = e, this.app = null, this.crossdomainMode = !1, this.checkDoNotTrack = () => this.options.respectDoNotTrack && (navigator.doNotTrack == "1" || // @ts-ignore
|
|
6607
|
-
window.doNotTrack == "1"), this.signalStartIssue = (a,
|
|
6608
|
-
const c = this.checkDoNotTrack(), d = new XMLHttpRequest(), p = this.options.ingestPoint ||
|
|
6619
|
+
window.doNotTrack == "1"), this.signalStartIssue = (a, h) => {
|
|
6620
|
+
const c = this.checkDoNotTrack(), d = new XMLHttpRequest(), p = this.options.ingestPoint || Si;
|
|
6609
6621
|
d.open("POST", p + "/v1/web/not-started"), d.send(JSON.stringify({
|
|
6610
6622
|
trackerVersion: "14.0.4",
|
|
6611
6623
|
projectKey: this.options.projectKey,
|
|
6612
6624
|
doNotTrack: c,
|
|
6613
|
-
reason:
|
|
6625
|
+
reason: h.length ? `missing api: ${h.join(",")}` : a
|
|
6614
6626
|
}));
|
|
6615
6627
|
}, this.restartCanvasTracking = () => {
|
|
6616
6628
|
this.app !== null && this.app.restartCanvasTracking();
|
|
6617
|
-
}, this.handleError = (a,
|
|
6629
|
+
}, this.handleError = (a, h = {}) => {
|
|
6618
6630
|
if (this.app !== null) {
|
|
6619
6631
|
if (a instanceof Error) {
|
|
6620
|
-
const c = Et(a, [],
|
|
6632
|
+
const c = Et(a, [], h);
|
|
6621
6633
|
this.app.send(c);
|
|
6622
6634
|
} else if (a instanceof ErrorEvent || "PromiseRejectionEvent" in window && a instanceof PromiseRejectionEvent) {
|
|
6623
|
-
const c =
|
|
6635
|
+
const c = ki(a, void 0, h);
|
|
6624
6636
|
c != null && this.app.send(c);
|
|
6625
6637
|
}
|
|
6626
6638
|
}
|
|
6627
|
-
}, this.crossdomainMode = !!(
|
|
6639
|
+
}, this.crossdomainMode = !!(hr() && ((l = e.crossdomain) != null && l.enabled)), !xe || !La(e))
|
|
6628
6640
|
return;
|
|
6629
6641
|
if (window.__OPENREPLAY__) {
|
|
6630
6642
|
console.error("OpenReplay: one tracker instance has been initialised already");
|
|
@@ -6667,13 +6679,13 @@ class Da {
|
|
|
6667
6679
|
console.error(`OpenReplay: browser doesn't support API required for tracking or doNotTrack is set to 1. Reason: ${a}`), this.signalStartIssue("missing_api", n);
|
|
6668
6680
|
return;
|
|
6669
6681
|
}
|
|
6670
|
-
const r = new
|
|
6671
|
-
this.app = r, this.crossdomainMode || (
|
|
6682
|
+
const r = new Fo(e.projectKey, e.sessionToken, e, this.signalStartIssue, this.crossdomainMode);
|
|
6683
|
+
this.app = r, this.crossdomainMode || (pa(r), Mo(r), Gr(r, e), Ma(r)), la(r, e.mouse), fa(r, this.crossdomainMode), va(r), ma(r), jo(r, e), Wo(r, e), Vo(r), Yo(r, e), da(r, e), ya(r), ba(r), Aa(r, e.network), Fa(r), window.__OPENREPLAY__ = this, e.flags && e.flags.onFlagsLoad && this.onFlagsLoad(e.flags.onFlagsLoad);
|
|
6672
6684
|
const o = window.open;
|
|
6673
6685
|
(e.autoResetOnWindowOpen || e.resetTabOnWindowOpen) && (r.attachStartCallback(() => {
|
|
6674
|
-
const a = r.getTabId(),
|
|
6686
|
+
const a = r.getTabId(), h = r.sessionStorage ?? window.sessionStorage;
|
|
6675
6687
|
window.open = function(...c) {
|
|
6676
|
-
return e.autoResetOnWindowOpen && r.resetNextPageSession(!0), e.resetTabOnWindowOpen &&
|
|
6688
|
+
return e.autoResetOnWindowOpen && r.resetNextPageSession(!0), e.resetTabOnWindowOpen && h.removeItem(e.session_tabid_key || "__openreplay_tabid"), r.resetNextPageSession(!1), h.setItem(e.session_tabid_key || "__openreplay_tabid", a), o.call(window, ...c);
|
|
6677
6689
|
};
|
|
6678
6690
|
}), r.attachStopCallback(() => {
|
|
6679
6691
|
window.open = o;
|
|
@@ -6801,7 +6813,7 @@ class Da {
|
|
|
6801
6813
|
Oe("'userID' method", "'setUserID' method", "/"), this.setUserID(e);
|
|
6802
6814
|
}
|
|
6803
6815
|
setUserAnonymousID(e) {
|
|
6804
|
-
typeof e == "string" && this.app !== null && this.app.send(
|
|
6816
|
+
typeof e == "string" && this.app !== null && this.app.send(Rr(e));
|
|
6805
6817
|
}
|
|
6806
6818
|
userAnonymousID(e) {
|
|
6807
6819
|
Oe("'userAnonymousID' method", "'setUserAnonymousID' method", "/"), this.setUserAnonymousID(e);
|
|
@@ -6821,7 +6833,7 @@ class Da {
|
|
|
6821
6833
|
} catch {
|
|
6822
6834
|
return;
|
|
6823
6835
|
}
|
|
6824
|
-
this.app.send(
|
|
6836
|
+
this.app.send(Or(e, s));
|
|
6825
6837
|
}
|
|
6826
6838
|
}
|
|
6827
6839
|
issue(e, s = null) {
|
|
@@ -6831,15 +6843,15 @@ class Da {
|
|
|
6831
6843
|
} catch {
|
|
6832
6844
|
return;
|
|
6833
6845
|
}
|
|
6834
|
-
this.app.send(
|
|
6846
|
+
this.app.send(Pr(e, s));
|
|
6835
6847
|
}
|
|
6836
6848
|
}
|
|
6837
6849
|
}
|
|
6838
|
-
const
|
|
6850
|
+
const Ba = ["climats", "telckel", "biobio", "weinpoint", "vinigrandi"], ja = "bMTFzLbWcXFgXK8SzyFHA6kIjelFcz5VQABVPbXdXh5XZJCDQH9BcVlrv3DF3kA";
|
|
6839
6851
|
class Hs {
|
|
6840
6852
|
constructor(e) {
|
|
6841
6853
|
var s;
|
|
6842
|
-
this.baseURL = "https://wineater-backend.vercel.app/", this.store =
|
|
6854
|
+
this.baseURL = "https://wineater-backend.vercel.app/", this.store = Ba.find((n) => window.location.href.includes(n)), this.token = ((s = window == null ? void 0 : window.wineaterData) == null ? void 0 : s.CLIENT_TOKEN) || ja;
|
|
6843
6855
|
}
|
|
6844
6856
|
async getStoreConfig(e) {
|
|
6845
6857
|
console.log(e);
|
|
@@ -6898,7 +6910,7 @@ class Hs {
|
|
|
6898
6910
|
}
|
|
6899
6911
|
}
|
|
6900
6912
|
}
|
|
6901
|
-
class
|
|
6913
|
+
class Ua {
|
|
6902
6914
|
constructor() {
|
|
6903
6915
|
this.api = new Hs(), this.language = "en", this.translations = {
|
|
6904
6916
|
fr: {
|
|
@@ -7001,44 +7013,31 @@ class Ma {
|
|
|
7001
7013
|
return this.translations[this.language][e] || e;
|
|
7002
7014
|
}
|
|
7003
7015
|
}
|
|
7004
|
-
const
|
|
7016
|
+
const ue = new Ua(), Ha = 3;
|
|
7005
7017
|
let gt = null;
|
|
7006
|
-
function
|
|
7018
|
+
function Ri() {
|
|
7007
7019
|
const t = document.getElementById("chat-window"), e = document.getElementById("chat-icon");
|
|
7008
|
-
t.classList.contains("visible") ? (
|
|
7009
|
-
}
|
|
7010
|
-
function Ii() {
|
|
7011
|
-
console.log("ghbdtn"), Wn(), document.getElementById("chat-window").classList.remove("visible");
|
|
7012
|
-
let e = parseInt(se("chatCloseCount")) || 0;
|
|
7013
|
-
e += 1, e >= La ? (console.log(e), mt("disableAutoOpen", "true", 1), Ni("chatCloseCount")) : (console.log(e), mt("chatCloseCount", e, 1));
|
|
7014
|
-
}
|
|
7015
|
-
function Pa(t) {
|
|
7016
|
-
const e = document.getElementById("chat-window"), s = document.getElementById("message-container"), n = document.querySelector("#input-container input");
|
|
7017
|
-
s.innerHTML = "", e.classList.add("visible");
|
|
7018
|
-
const i = document.createElement("div");
|
|
7019
|
-
i.className = "message api", i.textContent = re.translate("winePairingIntro"), s.appendChild(i), t.slice(0, 3).forEach((o) => {
|
|
7020
|
-
const l = document.createElement("div");
|
|
7021
|
-
l.className = "message dish-message", l.textContent = o, l.addEventListener("click", () => {
|
|
7022
|
-
n.value = o;
|
|
7023
|
-
}), s.appendChild(l);
|
|
7024
|
-
});
|
|
7025
|
-
const r = document.createElement("div");
|
|
7026
|
-
r.className = "message api", r.textContent = re.translate("askForDinner"), s.appendChild(r), s.scrollTop = s.scrollHeight;
|
|
7020
|
+
t.classList.contains("visible") ? (Kn(), Di(), e.style.display = "flex") : (gt && (clearTimeout(gt), gt = null), Gn(), t.classList.add("visible"), e.style.display = "none");
|
|
7027
7021
|
}
|
|
7028
|
-
function
|
|
7029
|
-
|
|
7022
|
+
function Di() {
|
|
7023
|
+
console.log("ghbdtn"), Kn(), document.getElementById("chat-window").classList.remove("visible");
|
|
7024
|
+
let e = parseInt(te("chatCloseCount")) || 0;
|
|
7025
|
+
e += 1, e >= Ha ? (console.log(e), mt("disableAutoOpen", "true", 1), Mi("chatCloseCount")) : (console.log(e), mt("chatCloseCount", e, 1));
|
|
7026
|
+
}
|
|
7027
|
+
function za(t = null) {
|
|
7028
|
+
t ? Pi(t) : Gn(), document.getElementById("chat-window").classList.add("visible");
|
|
7030
7029
|
}
|
|
7031
7030
|
document.addEventListener("DOMContentLoaded", () => {
|
|
7032
7031
|
setupCloseButton(), setupOutsideClick();
|
|
7033
7032
|
});
|
|
7034
|
-
function
|
|
7033
|
+
function Wa(t) {
|
|
7035
7034
|
gt = t;
|
|
7036
7035
|
}
|
|
7037
|
-
class
|
|
7036
|
+
class Fn {
|
|
7038
7037
|
constructor() {
|
|
7039
7038
|
var s;
|
|
7040
7039
|
this.api = new Hs();
|
|
7041
|
-
const e = ((s = window == null ? void 0 : window.wineaterData) == null ? void 0 : s.FIRST_MESSAGE_TEXT) ||
|
|
7040
|
+
const e = ((s = window == null ? void 0 : window.wineaterData) == null ? void 0 : s.FIRST_MESSAGE_TEXT) || ue.translate("welcomeMessage");
|
|
7042
7041
|
this.displayFirstMessage(e);
|
|
7043
7042
|
}
|
|
7044
7043
|
initialize() {
|
|
@@ -7055,11 +7054,11 @@ class Ua {
|
|
|
7055
7054
|
if (s) {
|
|
7056
7055
|
this.displayMessage(s, "user"), e.value = "", this.showTypingIndicator();
|
|
7057
7056
|
try {
|
|
7058
|
-
|
|
7057
|
+
Bi(s);
|
|
7059
7058
|
const n = await this.api.getWineRecommendations(s);
|
|
7060
7059
|
this.hideTypingIndicator(), n && n.length ? this.displayResults(n) : this.displayMessage("No results found.", "api");
|
|
7061
7060
|
} catch {
|
|
7062
|
-
this.hideTypingIndicator(), this.displayMessage(
|
|
7061
|
+
this.hideTypingIndicator(), this.displayMessage(ue.translate("somethingWentWrong"), "api");
|
|
7063
7062
|
}
|
|
7064
7063
|
}
|
|
7065
7064
|
}
|
|
@@ -7074,12 +7073,12 @@ class Ua {
|
|
|
7074
7073
|
i.textContent = e, i.className = "message " + s, n.appendChild(i), n.scrollTop = n.scrollHeight;
|
|
7075
7074
|
}
|
|
7076
7075
|
sendAnalytics(e) {
|
|
7077
|
-
console.log(e),
|
|
7076
|
+
console.log(e), Ui(e);
|
|
7078
7077
|
}
|
|
7079
7078
|
displayResults(e) {
|
|
7080
7079
|
console.log(e);
|
|
7081
7080
|
const s = document.getElementById("message-container");
|
|
7082
|
-
|
|
7081
|
+
ji(e.map((n) => n.Title)), e.forEach((n) => {
|
|
7083
7082
|
const i = document.createElement("div");
|
|
7084
7083
|
i.className = "wine-recommendation";
|
|
7085
7084
|
const r = document.createElement("div");
|
|
@@ -7089,88 +7088,78 @@ class Ua {
|
|
|
7089
7088
|
const l = document.createElement("div");
|
|
7090
7089
|
l.innerHTML = `
|
|
7091
7090
|
<strong>${n.Title}</strong><br>
|
|
7092
|
-
${
|
|
7093
|
-
${
|
|
7094
|
-
${
|
|
7095
|
-
<a href="${n.Url}" target="_blank">${
|
|
7091
|
+
${ue.translate("price")}: ${n.Price}<br>
|
|
7092
|
+
${ue.translate("region")}: ${n.Region}<br>
|
|
7093
|
+
${ue.translate("type")}: ${n.Type}<br>
|
|
7094
|
+
<a href="${n.Url}" target="_blank">${ue.translate("moreInfo")}</a>
|
|
7096
7095
|
`, l.querySelector("a").addEventListener("click", (c) => {
|
|
7097
7096
|
c.preventDefault(), this.sendAnalytics(n.Title), window.open(n.Url, "_blank");
|
|
7098
7097
|
}), r.appendChild(l);
|
|
7099
|
-
const
|
|
7100
|
-
|
|
7098
|
+
const h = document.createElement("div");
|
|
7099
|
+
h.className = "wine-description", h.innerHTML = n.Reason, i.appendChild(h), console.log(i), s.appendChild(i);
|
|
7101
7100
|
}), s.scrollTop = s.scrollHeight;
|
|
7102
7101
|
}
|
|
7103
7102
|
}
|
|
7104
|
-
|
|
7103
|
+
new Hs();
|
|
7104
|
+
const ht = {
|
|
7105
7105
|
PRODUCT_PAGES: /producto\/[^\/]+\/$/
|
|
7106
7106
|
// Matches any product page like 'producto/any-product-name/'
|
|
7107
7107
|
// CART_PAGE: /carrito\/$/ // Matches the cart page like 'carrito/'
|
|
7108
|
-
},
|
|
7108
|
+
}, Mn = {
|
|
7109
7109
|
FESTIVAL_PAGES: /festival/,
|
|
7110
7110
|
// Matches any URL containing 'festival'
|
|
7111
7111
|
TASTING_PAGES: /tasting/
|
|
7112
7112
|
// Matches any URL containing 'tasting'
|
|
7113
7113
|
};
|
|
7114
|
-
var
|
|
7115
|
-
const
|
|
7116
|
-
FESTIVAL_PAGES: ((
|
|
7117
|
-
TASTING_PAGES: ((
|
|
7114
|
+
var Hn, zn;
|
|
7115
|
+
const $a = {
|
|
7116
|
+
FESTIVAL_PAGES: ((Hn = window.wineaterData) == null ? void 0 : Hn.FESTIVAL_PAGES) || Mn.FESTIVAL_PAGES,
|
|
7117
|
+
TASTING_PAGES: ((zn = window.wineaterData) == null ? void 0 : zn.TASTING_PAGES) || Mn.TASTING_PAGES
|
|
7118
7118
|
};
|
|
7119
|
-
var
|
|
7120
|
-
const
|
|
7121
|
-
PRODUCT_PAGES: ((
|
|
7122
|
-
CART_PAGE: ((
|
|
7119
|
+
var Wn, $n;
|
|
7120
|
+
const qa = {
|
|
7121
|
+
PRODUCT_PAGES: ((Wn = window.wineaterData) == null ? void 0 : Wn.PRODUCT_PAGES) || ht.PRODUCT_PAGES,
|
|
7122
|
+
CART_PAGE: (($n = window.wineaterData) == null ? void 0 : $n.CART_PAGE) || (ht == null ? void 0 : ht.CART_PAGE)
|
|
7123
7123
|
};
|
|
7124
|
-
async function
|
|
7125
|
-
var e, s;
|
|
7124
|
+
async function Va() {
|
|
7126
7125
|
const t = window.location.href;
|
|
7127
|
-
for (const [
|
|
7128
|
-
if (
|
|
7126
|
+
for (const [e, s] of Object.entries($a))
|
|
7127
|
+
if (s.test(t))
|
|
7129
7128
|
return !1;
|
|
7130
|
-
for (const [
|
|
7131
|
-
if (
|
|
7129
|
+
for (const [e, s] of Object.entries(qa))
|
|
7130
|
+
if (s.test(t))
|
|
7132
7131
|
try {
|
|
7133
|
-
|
|
7134
|
-
|
|
7135
|
-
|
|
7136
|
-
Pa(l);
|
|
7132
|
+
console.log(dishes);
|
|
7133
|
+
const n = setTimeout(() => {
|
|
7134
|
+
openChatWindow();
|
|
7137
7135
|
}, 15e3);
|
|
7138
|
-
return
|
|
7139
|
-
} catch (
|
|
7140
|
-
return console.error("Error fetching dishes:",
|
|
7136
|
+
return Wa(n), !0;
|
|
7137
|
+
} catch (n) {
|
|
7138
|
+
return console.error("Error fetching dishes:", n), !1;
|
|
7141
7139
|
}
|
|
7142
7140
|
return !1;
|
|
7143
7141
|
}
|
|
7144
|
-
const
|
|
7142
|
+
const Ga = new Pa({
|
|
7145
7143
|
projectKey: "PA8j9fAi49i6g2QnvpNs",
|
|
7146
7144
|
__DISABLE_SECURE_MODE: !0
|
|
7147
|
-
});
|
|
7148
|
-
qn.init({
|
|
7149
|
-
environmentID: "5RfiDoiqb4dHrNdQvzbkfM",
|
|
7150
|
-
// api:"http://localhost:8000/api/v1/" set this if you are self hosting, and point it to your API
|
|
7151
|
-
cacheFlags: !0,
|
|
7152
|
-
// stores flags in localStorage cache
|
|
7153
|
-
enableAnalytics: !0
|
|
7154
|
-
// See https://docs.flagsmith.com/flag-analytics/ for more info.
|
|
7155
|
-
});
|
|
7156
|
-
const Va = "tbMTFzLbWcXFgXK8SzyFHA6kIjelFcz5VQABVPbXdXh5XZJCDQH9BcVlrv3DF3kA";
|
|
7145
|
+
}), Ka = "tbMTFzLbWcXFgXK8SzyFHA6kIjelFcz5VQABVPbXdXh5XZJCDQH9BcVlrv3DF3kA";
|
|
7157
7146
|
document.addEventListener("DOMContentLoaded", () => {
|
|
7158
|
-
window.toggleChatWindow =
|
|
7147
|
+
window.toggleChatWindow = Ri, window.closeChatWindow = Di, window.openChatWindow = za;
|
|
7159
7148
|
});
|
|
7160
|
-
function
|
|
7149
|
+
function Ln() {
|
|
7161
7150
|
var n;
|
|
7162
|
-
|
|
7163
|
-
const t =
|
|
7151
|
+
Ga.start();
|
|
7152
|
+
const t = Jn.getValue("chat-btn-txt"), s = `
|
|
7164
7153
|
<div id="chatbot-container">
|
|
7165
7154
|
<div id="chat-icon" onclick="toggleChatWindow()">
|
|
7166
7155
|
<img src="https://landing-static.s3.eu-central-1.amazonaws.com/images/chat-icon.svg" alt="Chat Icon"> <!-- Update the path to your logo image -->
|
|
7167
|
-
<span>${((n = window == null ? void 0 : window.wineaterData) == null ? void 0 : n.BUTTON_TEXT) ||
|
|
7156
|
+
<span>${((n = window == null ? void 0 : window.wineaterData) == null ? void 0 : n.BUTTON_TEXT) || ue.translate(`chatButton${t}`)}</span>
|
|
7168
7157
|
</div>
|
|
7169
7158
|
|
|
7170
7159
|
<div id="chat-window" class="hidden">
|
|
7171
7160
|
<div id="chat-header">
|
|
7172
7161
|
<div id="chat-title">
|
|
7173
|
-
<h1>${
|
|
7162
|
+
<h1>${ue.translate("chatTitle")}</h1>
|
|
7174
7163
|
</div>
|
|
7175
7164
|
<div id="close-btn">×</div>
|
|
7176
7165
|
</div>
|
|
@@ -7179,12 +7168,12 @@ function Ga() {
|
|
|
7179
7168
|
<span></span><span></span><span></span>
|
|
7180
7169
|
</div>
|
|
7181
7170
|
<div id="input-container">
|
|
7182
|
-
<input type="text" id="user-input" placeholder="${
|
|
7183
|
-
<button id="send-button">${
|
|
7171
|
+
<input type="text" id="user-input" placeholder="${ue.translate("inputPlaceholder")}">
|
|
7172
|
+
<button id="send-button">${ue.translate("sendButton")}</button>
|
|
7184
7173
|
</div>
|
|
7185
7174
|
<div id="powered-by">
|
|
7186
7175
|
<a href="https://wineater.com" target="_blank">
|
|
7187
|
-
<span>${
|
|
7176
|
+
<span>${ue.translate("poweredBy")}</span>
|
|
7188
7177
|
<img src="https://landing-static.s3.eu-central-1.amazonaws.com/images/logo.svg" alt="Wineater Logo" id="chatbot-logo">
|
|
7189
7178
|
</a>
|
|
7190
7179
|
</div>
|
|
@@ -7193,35 +7182,47 @@ function Ga() {
|
|
|
7193
7182
|
`;
|
|
7194
7183
|
document.body.insertAdjacentHTML("beforeend", s);
|
|
7195
7184
|
}
|
|
7196
|
-
function
|
|
7197
|
-
document.getElementById("close-btn").addEventListener("click",
|
|
7185
|
+
function Pn() {
|
|
7186
|
+
document.getElementById("close-btn").addEventListener("click", Ri);
|
|
7198
7187
|
}
|
|
7199
|
-
function
|
|
7188
|
+
function Bn() {
|
|
7200
7189
|
window.addEventListener("click", function(t) {
|
|
7201
7190
|
const e = document.getElementById("chat-window"), s = document.getElementById("chat-icon");
|
|
7202
7191
|
!e.contains(t.target) && !s.contains(t.target) && (e.classList.remove("visible"), s.style.display = "flex");
|
|
7203
7192
|
});
|
|
7204
7193
|
}
|
|
7205
|
-
function
|
|
7194
|
+
function jn(t) {
|
|
7206
7195
|
console.log(t);
|
|
7207
7196
|
const e = document.getElementById("chat-icon"), s = document.getElementById("chat-window");
|
|
7208
7197
|
e.className = "", s.className = "", t === "right-center" ? (e.classList.add("chat-icon-right-center"), s.classList.add("right-center-aligned")) : e.classList.add("chat-icon-bottom-right");
|
|
7209
7198
|
}
|
|
7210
7199
|
document.addEventListener("DOMContentLoaded", () => {
|
|
7211
|
-
|
|
7200
|
+
te("disableAutoOpen") || Va();
|
|
7212
7201
|
});
|
|
7213
|
-
var
|
|
7202
|
+
var qn;
|
|
7214
7203
|
if (typeof window < "u") {
|
|
7215
|
-
let t = ((
|
|
7204
|
+
let t = ((qn = window == null ? void 0 : window.wineaterData) == null ? void 0 : qn.POSITION) || "right-center";
|
|
7216
7205
|
window.addEventListener("DOMContentLoaded", async () => {
|
|
7217
|
-
var
|
|
7218
|
-
const s = ["climats", "telckel", "biobio", "weinpoint", "vinigrandi"].find((
|
|
7206
|
+
var i;
|
|
7207
|
+
const s = ["climats", "telckel", "biobio", "weinpoint", "vinigrandi"].find((r) => window.location.href.includes(r)) || null;
|
|
7219
7208
|
let n;
|
|
7220
|
-
s && (n = s.charAt(0).toUpperCase() + s.slice(1), n === "Climats" && (t = "right-center")), await
|
|
7209
|
+
s && (n = s.charAt(0).toUpperCase() + s.slice(1), n === "Climats" && (t = "right-center")), await ue.fetchConfig(n || "Climats"), mt("chatbotToken", ((i = window.wineaterData) == null ? void 0 : i.CLIENT_TOKEN) || Ka, 365), Li(), Jn.init({
|
|
7210
|
+
environmentID: "5RfiDoiqb4dHrNdQvzbkfM",
|
|
7211
|
+
// api:"http://localhost:8000/api/v1/" set this if you are self hosting, and point it to your API
|
|
7212
|
+
cacheFlags: !1,
|
|
7213
|
+
// stores flags in localStorage cache
|
|
7214
|
+
enableAnalytics: !0,
|
|
7215
|
+
identity: te("uniqueUserID")
|
|
7216
|
+
// See https://docs.flagsmith.com/flag-analytics/ for more info.
|
|
7217
|
+
}).then(() => {
|
|
7218
|
+
Ln(), Pn(), Bn(), jn(t), new Fn().initialize();
|
|
7219
|
+
}).catch(() => {
|
|
7220
|
+
Ln(), Pn(), Bn(), jn(t), new Fn().initialize();
|
|
7221
|
+
});
|
|
7221
7222
|
});
|
|
7222
7223
|
}
|
|
7223
7224
|
export {
|
|
7224
|
-
|
|
7225
|
-
|
|
7226
|
-
|
|
7225
|
+
Di as closeChatWindow,
|
|
7226
|
+
za as openChatWindow,
|
|
7227
|
+
Ri as toggleChatWindow
|
|
7227
7228
|
};
|