clarity-js 0.8.18 → 0.8.20
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/build/clarity.extended.js +1 -1
- package/build/clarity.insight.js +1 -1
- package/build/clarity.js +58 -33
- package/build/clarity.min.js +1 -1
- package/build/clarity.module.js +58 -33
- package/build/clarity.performance.js +1 -1
- package/package.json +3 -3
- package/src/core/throttle.ts +15 -4
- package/src/core/time.ts +10 -3
- package/src/core/version.ts +1 -1
- package/src/data/encode.ts +33 -27
- package/src/interaction/click.ts +1 -0
- package/src/interaction/encode.ts +1 -0
- package/src/interaction/scroll.ts +1 -0
- package/types/data.d.ts +1 -0
package/build/clarity.module.js
CHANGED
|
@@ -164,24 +164,30 @@ function api(method) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
var startTime = 0;
|
|
167
|
+
function computeStartTime() {
|
|
168
|
+
return performance.now() + performance.timeOrigin;
|
|
169
|
+
}
|
|
167
170
|
function start$I() {
|
|
168
|
-
startTime =
|
|
171
|
+
startTime = computeStartTime();
|
|
169
172
|
}
|
|
170
|
-
// event.timestamp is number of milliseconds elapsed since the document was loaded
|
|
173
|
+
// event.timestamp is number of milliseconds elapsed since the document was loaded
|
|
171
174
|
// since iframes can be loaded later the event timestamp is not the same as performance.now()
|
|
172
175
|
// converting everything to absolute time by adding timeorigin of the event view
|
|
173
176
|
// to synchronize times before calculating the difference with start time
|
|
174
177
|
function time(event) {
|
|
175
178
|
if (event === void 0) { event = null; }
|
|
179
|
+
// If startTime is 0, Clarity hasn't been started or has been stopped
|
|
180
|
+
// Use a local baseline to maintain relative timing semantics without affecting global state
|
|
181
|
+
var baseline = startTime === 0 ? computeStartTime() : startTime;
|
|
176
182
|
var ts = event && event.timeStamp > 0 ? event.timeStamp : performance.now();
|
|
177
183
|
var origin = event && event.view ? event.view.performance.timeOrigin : performance.timeOrigin;
|
|
178
|
-
return Math.max(Math.round(ts + origin -
|
|
184
|
+
return Math.max(Math.round(ts + origin - baseline), 0);
|
|
179
185
|
}
|
|
180
186
|
function stop$F() {
|
|
181
187
|
startTime = 0;
|
|
182
188
|
}
|
|
183
189
|
|
|
184
|
-
var version$1 = "0.8.
|
|
190
|
+
var version$1 = "0.8.20";
|
|
185
191
|
|
|
186
192
|
// tslint:disable: no-bitwise
|
|
187
193
|
function hash (input, precision) {
|
|
@@ -653,7 +659,7 @@ function reset$r() {
|
|
|
653
659
|
function setTimeout$1(handler, timeout, event) {
|
|
654
660
|
return window.setTimeout(measure(handler), timeout, event);
|
|
655
661
|
}
|
|
656
|
-
function clearTimeout(handle) {
|
|
662
|
+
function clearTimeout$1(handle) {
|
|
657
663
|
return window.clearTimeout(handle);
|
|
658
664
|
}
|
|
659
665
|
|
|
@@ -667,7 +673,7 @@ function start$F() {
|
|
|
667
673
|
}
|
|
668
674
|
function reset$q() {
|
|
669
675
|
if (timeout$7) {
|
|
670
|
-
clearTimeout(timeout$7);
|
|
676
|
+
clearTimeout$1(timeout$7);
|
|
671
677
|
}
|
|
672
678
|
timeout$7 = setTimeout$1(ping, interval);
|
|
673
679
|
last = time();
|
|
@@ -684,7 +690,7 @@ function ping() {
|
|
|
684
690
|
}
|
|
685
691
|
}
|
|
686
692
|
function stop$C() {
|
|
687
|
-
clearTimeout(timeout$7);
|
|
693
|
+
clearTimeout$1(timeout$7);
|
|
688
694
|
last = 0;
|
|
689
695
|
interval = 0;
|
|
690
696
|
}
|
|
@@ -1284,6 +1290,7 @@ function start$y() {
|
|
|
1284
1290
|
}
|
|
1285
1291
|
function observe$b(root) {
|
|
1286
1292
|
bind(root, "click", handler$3.bind(this, 9 /* Event.Click */, root), true);
|
|
1293
|
+
bind(root, "contextmenu", handler$3.bind(this, 48 /* Event.ContextMenu */, root), true);
|
|
1287
1294
|
}
|
|
1288
1295
|
function handler$3(event, root, evt) {
|
|
1289
1296
|
handler$3.dn = 6 /* FunctionNames.ClickHandler */;
|
|
@@ -1461,7 +1468,7 @@ function recompute$6(evt) {
|
|
|
1461
1468
|
state$7.pop();
|
|
1462
1469
|
}
|
|
1463
1470
|
state$7.push({ time: time(evt), event: 27 /* Event.Input */, data: data });
|
|
1464
|
-
clearTimeout(timeout$6);
|
|
1471
|
+
clearTimeout$1(timeout$6);
|
|
1465
1472
|
timeout$6 = setTimeout$1(process$7, 1000 /* Setting.InputLookAhead */, 27 /* Event.Input */);
|
|
1466
1473
|
}
|
|
1467
1474
|
}
|
|
@@ -1472,7 +1479,7 @@ function reset$j() {
|
|
|
1472
1479
|
state$7 = [];
|
|
1473
1480
|
}
|
|
1474
1481
|
function stop$u() {
|
|
1475
|
-
clearTimeout(timeout$6);
|
|
1482
|
+
clearTimeout$1(timeout$6);
|
|
1476
1483
|
reset$j();
|
|
1477
1484
|
}
|
|
1478
1485
|
|
|
@@ -1567,7 +1574,7 @@ function handler$2(current) {
|
|
|
1567
1574
|
state$6.pop();
|
|
1568
1575
|
}
|
|
1569
1576
|
state$6.push(current);
|
|
1570
|
-
clearTimeout(timeout$5);
|
|
1577
|
+
clearTimeout$1(timeout$5);
|
|
1571
1578
|
timeout$5 = setTimeout$1(process$6, 500 /* Setting.LookAhead */, current.event);
|
|
1572
1579
|
break;
|
|
1573
1580
|
default:
|
|
@@ -1592,7 +1599,7 @@ function similar$1(last, current) {
|
|
|
1592
1599
|
return current.event === last.event && match && distance < 20 /* Setting.Distance */ && gap < 25 /* Setting.PointerInterval */ && sameId;
|
|
1593
1600
|
}
|
|
1594
1601
|
function stop$t() {
|
|
1595
|
-
clearTimeout(timeout$5);
|
|
1602
|
+
clearTimeout$1(timeout$5);
|
|
1596
1603
|
// Send out any pending pointer events in the pipeline
|
|
1597
1604
|
if (state$6.length > 0) {
|
|
1598
1605
|
process$6(state$6[state$6.length - 1].event);
|
|
@@ -1617,7 +1624,7 @@ function recompute$5() {
|
|
|
1617
1624
|
height: de && "clientHeight" in de ? Math.min(de.clientHeight, window.innerHeight) : window.innerHeight,
|
|
1618
1625
|
};
|
|
1619
1626
|
if (initialStateLogged) {
|
|
1620
|
-
clearTimeout(timeout$4);
|
|
1627
|
+
clearTimeout$1(timeout$4);
|
|
1621
1628
|
timeout$4 = setTimeout$1(process$5, 500 /* Setting.LookAhead */, 11 /* Event.Resize */);
|
|
1622
1629
|
}
|
|
1623
1630
|
else {
|
|
@@ -1630,7 +1637,7 @@ function process$5(event) {
|
|
|
1630
1637
|
}
|
|
1631
1638
|
function reset$h() {
|
|
1632
1639
|
data$c = null;
|
|
1633
|
-
clearTimeout(timeout$4);
|
|
1640
|
+
clearTimeout$1(timeout$4);
|
|
1634
1641
|
}
|
|
1635
1642
|
function stop$s() {
|
|
1636
1643
|
reset$h();
|
|
@@ -1641,13 +1648,13 @@ function stop$s() {
|
|
|
1641
1648
|
* every specified duration in milliseconds, ensuring the last event is not lost.
|
|
1642
1649
|
* @param func - The function to throttle.
|
|
1643
1650
|
* @param duration - The duration in milliseconds to wait before allowing the next execution.
|
|
1644
|
-
* @returns A throttled version of the provided function.
|
|
1651
|
+
* @returns A throttled version of the provided function with a cleanup method.
|
|
1645
1652
|
*/
|
|
1646
1653
|
function throttle(func, duration) {
|
|
1647
1654
|
var lastExecutionTime = 0;
|
|
1648
1655
|
var timeoutId = null;
|
|
1649
1656
|
var lastArgs = null;
|
|
1650
|
-
|
|
1657
|
+
function throttledFunction() {
|
|
1651
1658
|
var _this = this;
|
|
1652
1659
|
var args = [];
|
|
1653
1660
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -1672,7 +1679,16 @@ function throttle(func, duration) {
|
|
|
1672
1679
|
lastExecutionTime = now;
|
|
1673
1680
|
func.apply(this, args);
|
|
1674
1681
|
}
|
|
1682
|
+
}
|
|
1683
|
+
// Add cleanup method to clear pending timeouts
|
|
1684
|
+
throttledFunction.cleanup = function () {
|
|
1685
|
+
if (timeoutId) {
|
|
1686
|
+
clearTimeout(timeoutId);
|
|
1687
|
+
timeoutId = null;
|
|
1688
|
+
lastArgs = null;
|
|
1689
|
+
}
|
|
1675
1690
|
};
|
|
1691
|
+
return throttledFunction;
|
|
1676
1692
|
}
|
|
1677
1693
|
|
|
1678
1694
|
var state$5 = [];
|
|
@@ -1731,7 +1747,7 @@ function recompute$4(event) {
|
|
|
1731
1747
|
state$5.pop();
|
|
1732
1748
|
}
|
|
1733
1749
|
state$5.push(current);
|
|
1734
|
-
clearTimeout(timeout$3);
|
|
1750
|
+
clearTimeout$1(timeout$3);
|
|
1735
1751
|
timeout$3 = setTimeout$1(process$4, 500 /* Setting.LookAhead */, 10 /* Event.Scroll */);
|
|
1736
1752
|
}
|
|
1737
1753
|
var throttledRecompute = throttle(recompute$4, 25 /* Setting.Throttle */);
|
|
@@ -1778,7 +1794,8 @@ function compute$8() {
|
|
|
1778
1794
|
}
|
|
1779
1795
|
}
|
|
1780
1796
|
function stop$r() {
|
|
1781
|
-
clearTimeout(timeout$3);
|
|
1797
|
+
clearTimeout$1(timeout$3);
|
|
1798
|
+
throttledRecompute.cleanup();
|
|
1782
1799
|
state$5 = [];
|
|
1783
1800
|
initialTop = null;
|
|
1784
1801
|
initialBottom = null;
|
|
@@ -1812,7 +1829,7 @@ function recompute$3(root) {
|
|
|
1812
1829
|
}
|
|
1813
1830
|
var startNode = data$b.start ? data$b.start : null;
|
|
1814
1831
|
if (previous !== null && data$b.start !== null && startNode !== current.anchorNode) {
|
|
1815
|
-
clearTimeout(timeout$2);
|
|
1832
|
+
clearTimeout$1(timeout$2);
|
|
1816
1833
|
process$3(21 /* Event.Selection */);
|
|
1817
1834
|
}
|
|
1818
1835
|
data$b = {
|
|
@@ -1822,7 +1839,7 @@ function recompute$3(root) {
|
|
|
1822
1839
|
endOffset: current.focusOffset
|
|
1823
1840
|
};
|
|
1824
1841
|
previous = current;
|
|
1825
|
-
clearTimeout(timeout$2);
|
|
1842
|
+
clearTimeout$1(timeout$2);
|
|
1826
1843
|
timeout$2 = setTimeout$1(process$3, 500 /* Setting.LookAhead */, 21 /* Event.Selection */);
|
|
1827
1844
|
}
|
|
1828
1845
|
function process$3(event) {
|
|
@@ -1834,7 +1851,7 @@ function reset$f() {
|
|
|
1834
1851
|
}
|
|
1835
1852
|
function stop$q() {
|
|
1836
1853
|
reset$f();
|
|
1837
|
-
clearTimeout(timeout$2);
|
|
1854
|
+
clearTimeout$1(timeout$2);
|
|
1838
1855
|
}
|
|
1839
1856
|
|
|
1840
1857
|
var state$4 = [];
|
|
@@ -2777,7 +2794,7 @@ function processNodeList(list, source, timer, timestamp) {
|
|
|
2777
2794
|
}
|
|
2778
2795
|
function processThrottledMutations() {
|
|
2779
2796
|
if (throttleDelay) {
|
|
2780
|
-
clearTimeout(throttleDelay);
|
|
2797
|
+
clearTimeout$1(throttleDelay);
|
|
2781
2798
|
}
|
|
2782
2799
|
throttleDelay = setTimeout$1(function () {
|
|
2783
2800
|
schedule(process$2, 1 /* Priority.High */);
|
|
@@ -2792,7 +2809,7 @@ function schedule$1(node) {
|
|
|
2792
2809
|
// It's common for a webpage to call multiple synchronous "insertRule" / "deleteRule" calls.
|
|
2793
2810
|
// And in those cases we do not wish to monitor changes multiple times for the same node.
|
|
2794
2811
|
if (timeout$1) {
|
|
2795
|
-
clearTimeout(timeout$1);
|
|
2812
|
+
clearTimeout$1(timeout$1);
|
|
2796
2813
|
}
|
|
2797
2814
|
timeout$1 = setTimeout$1(function () {
|
|
2798
2815
|
trigger$1();
|
|
@@ -3955,6 +3972,7 @@ function encode$3 (type, ts) {
|
|
|
3955
3972
|
reset$i();
|
|
3956
3973
|
break;
|
|
3957
3974
|
case 9 /* Event.Click */:
|
|
3975
|
+
case 48 /* Event.ContextMenu */:
|
|
3958
3976
|
for (_b = 0, _c = state$9; _b < _c.length; _b++) {
|
|
3959
3977
|
entry = _c[_b];
|
|
3960
3978
|
cTarget = metadata$2(entry.data.target, entry.event, entry.data.text);
|
|
@@ -4224,7 +4242,7 @@ function queue(tokens, transmit) {
|
|
|
4224
4242
|
// reset the timer. This allows Clarity to attempt an upload again.
|
|
4225
4243
|
var gap = delay();
|
|
4226
4244
|
if (now - queuedTime > (gap * 2)) {
|
|
4227
|
-
clearTimeout(timeout);
|
|
4245
|
+
clearTimeout$1(timeout);
|
|
4228
4246
|
timeout = null;
|
|
4229
4247
|
}
|
|
4230
4248
|
// Transmit Check: When transmit is set to true (default), it indicates that we should schedule an upload
|
|
@@ -4240,7 +4258,7 @@ function queue(tokens, transmit) {
|
|
|
4240
4258
|
}
|
|
4241
4259
|
}
|
|
4242
4260
|
function stop$e() {
|
|
4243
|
-
clearTimeout(timeout);
|
|
4261
|
+
clearTimeout$1(timeout);
|
|
4244
4262
|
upload(true);
|
|
4245
4263
|
discoverBytes = 0;
|
|
4246
4264
|
playbackBytes = 0;
|
|
@@ -4830,9 +4848,9 @@ function encode$1 (event) {
|
|
|
4830
4848
|
var t = time();
|
|
4831
4849
|
var tokens = [t, event];
|
|
4832
4850
|
switch (event) {
|
|
4833
|
-
case 4 /* Event.Baseline */:
|
|
4851
|
+
case 4 /* Event.Baseline */: {
|
|
4834
4852
|
var b = state$b;
|
|
4835
|
-
if (b) {
|
|
4853
|
+
if (b && b.data) {
|
|
4836
4854
|
tokens = [b.time, b.event];
|
|
4837
4855
|
tokens.push(b.data.visible);
|
|
4838
4856
|
tokens.push(b.data.docWidth);
|
|
@@ -4862,6 +4880,7 @@ function encode$1 (event) {
|
|
|
4862
4880
|
}
|
|
4863
4881
|
reset$s();
|
|
4864
4882
|
break;
|
|
4883
|
+
}
|
|
4865
4884
|
case 25 /* Event.Ping */:
|
|
4866
4885
|
tokens.push(data$h.gap);
|
|
4867
4886
|
queue(tokens);
|
|
@@ -4886,7 +4905,7 @@ function encode$1 (event) {
|
|
|
4886
4905
|
tokens.push(data$j.value);
|
|
4887
4906
|
queue(tokens);
|
|
4888
4907
|
break;
|
|
4889
|
-
case 34 /* Event.Variable */:
|
|
4908
|
+
case 34 /* Event.Variable */: {
|
|
4890
4909
|
var variableKeys = Object.keys(data$f);
|
|
4891
4910
|
if (variableKeys.length > 0) {
|
|
4892
4911
|
for (var _i = 0, variableKeys_1 = variableKeys; _i < variableKeys_1.length; _i++) {
|
|
@@ -4898,7 +4917,8 @@ function encode$1 (event) {
|
|
|
4898
4917
|
queue(tokens, false);
|
|
4899
4918
|
}
|
|
4900
4919
|
break;
|
|
4901
|
-
|
|
4920
|
+
}
|
|
4921
|
+
case 0 /* Event.Metric */: {
|
|
4902
4922
|
var metricKeys = Object.keys(updates$3);
|
|
4903
4923
|
if (metricKeys.length > 0) {
|
|
4904
4924
|
for (var _a = 0, metricKeys_1 = metricKeys; _a < metricKeys_1.length; _a++) {
|
|
@@ -4913,7 +4933,8 @@ function encode$1 (event) {
|
|
|
4913
4933
|
queue(tokens, false);
|
|
4914
4934
|
}
|
|
4915
4935
|
break;
|
|
4916
|
-
|
|
4936
|
+
}
|
|
4937
|
+
case 1 /* Event.Dimension */: {
|
|
4917
4938
|
var dimensionKeys = Object.keys(updates);
|
|
4918
4939
|
if (dimensionKeys.length > 0) {
|
|
4919
4940
|
for (var _b = 0, dimensionKeys_1 = dimensionKeys; _b < dimensionKeys_1.length; _b++) {
|
|
@@ -4926,7 +4947,8 @@ function encode$1 (event) {
|
|
|
4926
4947
|
queue(tokens, false);
|
|
4927
4948
|
}
|
|
4928
4949
|
break;
|
|
4929
|
-
|
|
4950
|
+
}
|
|
4951
|
+
case 36 /* Event.Summary */: {
|
|
4930
4952
|
var eventKeys = Object.keys(data$g);
|
|
4931
4953
|
if (eventKeys.length > 0) {
|
|
4932
4954
|
for (var _c = 0, eventKeys_1 = eventKeys; _c < eventKeys_1.length; _c++) {
|
|
@@ -4939,9 +4961,10 @@ function encode$1 (event) {
|
|
|
4939
4961
|
queue(tokens, false);
|
|
4940
4962
|
}
|
|
4941
4963
|
break;
|
|
4942
|
-
|
|
4964
|
+
}
|
|
4965
|
+
case 40 /* Event.Extract */: {
|
|
4943
4966
|
var extractKeys = keys;
|
|
4944
|
-
extractKeys.forEach(
|
|
4967
|
+
extractKeys.forEach(function (e) {
|
|
4945
4968
|
tokens.push(e);
|
|
4946
4969
|
var token = [];
|
|
4947
4970
|
for (var d in data$e[e]) {
|
|
@@ -4950,9 +4973,11 @@ function encode$1 (event) {
|
|
|
4950
4973
|
token.push(data$e[e][d]);
|
|
4951
4974
|
}
|
|
4952
4975
|
tokens.push(token);
|
|
4953
|
-
})
|
|
4976
|
+
});
|
|
4954
4977
|
reset$n();
|
|
4955
4978
|
queue(tokens, false);
|
|
4979
|
+
break;
|
|
4980
|
+
}
|
|
4956
4981
|
case 47 /* Event.Consent */:
|
|
4957
4982
|
tokens.push(data$k.source);
|
|
4958
4983
|
tokens.push(data$k.ad_Storage);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var t=Object.freeze({__proto__:null,get queue(){return _t},get start(){return St},get stop(){return It},get track(){return vt}}),n=Object.freeze({__proto__:null,get check(){return zt},get compute(){return At},get data(){return gt},get start(){return jt},get stop(){return Pt},get trigger(){return Ct}}),e=Object.freeze({__proto__:null,get compute(){return Xt},get data(){return qt},get log(){return Ut},get reset(){return Lt},get start(){return Rt},get stop(){return Ht},get updates(){return Nt}}),r=Object.freeze({__proto__:null,get callback(){return an},get callbacks(){return Bt},get clear(){return rn},get consent(){return $t},get consentv2(){return tn},get data(){return Vt},get electron(){return Yt},get id(){return Qt},get metadata(){return Kt},get save(){return on},get shortid(){return sn},get start(){return Gt},get stop(){return Ft}}),a=Object.freeze({__proto__:null,get data(){return gn},get envelope(){return wn},get start(){return mn},get stop(){return yn}}),o={projectId:null,delay:1e3,lean:!1,lite:!1,track:!0,content:!0,drop:[],mask:[],unmask:[],regions:[],cookies:[],fraud:!0,checksum:[],report:null,upload:null,fallback:null,upgrade:null,action:null,dob:null,delayDom:!1,throttleDom:!0,conversions:!1,includeSubdomains:!0};function i(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}var u=0;function c(t){void 0===t&&(t=null);var n=t&&t.timeStamp>0?t.timeStamp:performance.now(),e=t&&t.view?t.view.performance.timeOrigin:performance.timeOrigin;return Math.max(Math.round(n+e-u),0)}var s="0.8.18";var l=255,d=!0,p=null,f=null;function h(t,n,e){void 0===n&&(n=!1),void 0===e&&(e=!1);var r=t;if(n)r="".concat("https://").concat("Electron");else{var a=o.drop;if(a&&a.length>0&&t&&t.indexOf("?")>0){var i=t.split("?"),u=i[0],c=i[1];r=u+"?"+c.split("&").map((function(t){return a.some((function(n){return 0===t.indexOf("".concat(n,"="))}))?"".concat(t.split("=")[0],"=").concat("*na*"):t})).join("&")}}return e&&(r=r.substring(0,l)),r}function v(t,n,e){return function(){if(d&&null===p)try{p=new RegExp("\\p{N}","gu"),f=new RegExp("\\p{L}","gu"),new RegExp("\\p{Sc}","gu")}catch(t){d=!1}}(),t?t.replace(f,n).replace(p,e):t}var g=[],m=null;function y(){}var w=[];function b(){}function k(){}var S=Object.freeze({__proto__:null,checkDocumentStyles:function(t){},compute:function(){},data:m,hashText:b,keys:w,log:y,observe:function(){},reset:function(){},sheetAdoptionState:[],sheetUpdateState:[],start:function(){},state:g,stop:function(){},trigger:k}),_=null,I=!0;function E(){M(2)}function M(t){Ut(36,t.toString())}var O=null;function T(t,n){Bn()&&t&&"string"==typeof t&&t.length<255&&(O=n&&"string"==typeof n&&n.length<255?{key:t,value:n}:{value:t},xt(24))}var x,j=null,z=null;function C(t){t in j||(j[t]=0),t in z||(z[t]=0),j[t]++,z[t]++}function A(t,n){null!==n&&(t in j||(j[t]=0),t in z||(z[t]=0),j[t]+=n,z[t]+=n)}function P(t,n){null!==n&&!1===isNaN(n)&&(t in j||(j[t]=0),(n>j[t]||0===j[t])&&(z[t]=n,j[t]=n))}function q(t,n,e){return window.setTimeout(Sn(t),n,e)}function N(t){return window.clearTimeout(t)}var D=0,R=0,H=null;function U(){H&&N(H),H=q(X,R),D=c()}function X(){var t=c();x={gap:t-D},xt(25),x.gap<3e5?H=q(X,R):Xn&&(T("clarity","suspend"),he(),["mousemove","touchstart"].forEach((function(t){return In(document,t,Yn)})),["resize","scroll","pageshow"].forEach((function(t){return In(window,t,Yn)})))}var L=Object.freeze({__proto__:null,get data(){return x},reset:U,start:function(){R=6e4,D=0},stop:function(){N(H),D=0,R=0}}),V=null;function B(t){Bn()&&o.lean&&(o.lean=!1,V={key:t},an(),on(),o.upgrade&&o.upgrade(t),xt(3),o.lite)}var Y=Object.freeze({__proto__:null,get data(){return V},start:function(){!o.lean&&o.upgrade&&o.upgrade("Config"),V=null},stop:function(){V=null},upgrade:B});function W(t,n,e,r){return new(e||(e=Promise))((function(a,o){function i(t){try{c(r.next(t))}catch(t){o(t)}}function u(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var n;t.done?a(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(i,u)}c((r=r.apply(t,n||[])).next())}))}function Z(t,n){var e,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(i=0)),i;)try{if(e=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){i.label=u[1];break}if(6===u[0]&&i.label<a[1]){i.label=a[1],a=u;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(u);break}a[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(t,i)}catch(t){u=[6,t],r=0}finally{e=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}var J=null;function G(t,n){K(t,"string"==typeof n?[n]:n)}function F(t,n,e,r){return void 0===n&&(n=null),void 0===e&&(e=null),void 0===r&&(r=null),W(this,void 0,void 0,(function(){var a,o;return Z(this,(function(i){switch(i.label){case 0:return o={},[4,tt(t)];case 1:return o.userId=i.sent(),o.userHint=r||((u=t)&&u.length>=5?"".concat(u.substring(0,2)).concat(v(u.substring(2),"*","*")):v(u,"*","*")),K("userId",[(a=o).userId]),K("userHint",[a.userHint]),K("userType",[nt(t)]),n&&(K("sessionId",[n]),a.sessionId=n),e&&(K("pageId",[e]),a.pageId=e),[2,a]}var u}))}))}function K(t,n){if(Bn()&&t&&n&&"string"==typeof t&&t.length<255){for(var e=(t in J?J[t]:[]),r=0;r<n.length;r++)"string"==typeof n[r]&&n[r].length<255&&e.push(n[r]);J[t]=e}}function Q(){xt(34)}function $(){J={}}function tt(t){return W(this,void 0,void 0,(function(){var n;return Z(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),crypto&&t?[4,crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t))]:[3,2];case 1:return n=e.sent(),[2,Array.prototype.map.call(new Uint8Array(n),(function(t){return("00"+t.toString(16)).slice(-2)})).join("")];case 2:return[2,""];case 3:return[3,5];case 4:return e.sent(),[2,""];case 5:return[2]}}))}))}function nt(t){return t&&t.indexOf("@")>0?"email":"string"}var et="CompressionStream"in window;function rt(t){return W(this,void 0,void 0,(function(){var n,e;return Z(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),et?(n=new ReadableStream({start:function(n){return W(this,void 0,void 0,(function(){return Z(this,(function(e){return n.enqueue(t),n.close(),[2]}))}))}}).pipeThrough(new TextEncoderStream).pipeThrough(new window.CompressionStream("gzip")),e=Uint8Array.bind,[4,at(n)]):[3,2];case 1:return[2,new(e.apply(Uint8Array,[void 0,r.sent()]))];case 2:return[3,4];case 3:return r.sent(),[3,4];case 4:return[2,null]}}))}))}function at(t){return W(this,void 0,void 0,(function(){var n,e,r,a,o;return Z(this,(function(i){switch(i.label){case 0:n=t.getReader(),e=[],r=!1,a=[],i.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return o=i.sent(),r=o.done,a=o.value,r?[2,e]:(e.push.apply(e,a),[3,1]);case 3:return[2,e]}}))}))}var ot=null;function it(t){try{if(!ot)return;var n=function(t){try{return JSON.parse(t)}catch(t){return[]}}(t);n.forEach((function(t){ot(t)}))}catch(t){}}var ut=[S,e,Object.freeze({__proto__:null,compute:Q,get data(){return J},identify:F,reset:$,set:G,start:function(){$()},stop:function(){$()}}),n,S,r,a,t,L,Y,S];function ct(){j={},z={},C(5),ut.forEach((function(t){return Sn(t.start)()}))}function st(){ut.slice().reverse().forEach((function(t){return Sn(t.stop)()})),j={},z={}}function lt(){Q(),Xt(),xt(0),At(),I&&(xt(47),I=!1)}var dt,pt,ft,ht,vt,gt,mt=0,yt=0,wt=null,bt=0,kt=!1;function St(){ht=!0,mt=0,yt=0,kt=!1,bt=0,dt=[],pt=[],ft={},vt=null}function _t(t,n){if(void 0===n&&(n=!0),ht){var e=c(),r=t.length>1?t[1]:null,a=JSON.stringify(t);switch(o.lean?!kt&&yt+a.length>10485760&&(kt=!0):kt=!1,r){case 5:if(kt)break;mt+=a.length;case 37:case 6:case 43:case 45:case 46:if(kt)break;yt+=a.length,dt.push(a);break;default:pt.push(a)}C(25);var i=function(){var t=!1===o.lean&&mt>0?100:gn.sequence*o.delay;return"string"==typeof o.upload?Math.max(Math.min(t,3e4),100):o.delay}();e-bt>2*i&&(N(wt),wt=null),n&&null===wt&&(25!==r&&U(),wt=q(Et,i),bt=e,zt(yt))}}function It(){N(wt),Et(!0),mt=0,yt=0,kt=!1,bt=0,dt=[],pt=[],ft={},vt=null,ht=!1}function Et(t){return void 0===t&&(t=!1),W(this,void 0,void 0,(function(){var n,e,r,a,i,u,c,s;return Z(this,(function(l){switch(l.label){case 0:return ht?(wt=null,(n=!1===o.lean&&yt>0&&(yt<1048576||gn.sequence>0))&&P(1,1),lt(),e=!0===t,gn?(r=JSON.stringify(wn(e)),a="[".concat(pt.join(),"]"),i=n?"[".concat(dt.join(),"]"):"",u=function(t){return t.p.length>0?'{"e":'.concat(t.e,',"a":').concat(t.a,',"p":').concat(t.p,"}"):'{"e":'.concat(t.e,',"a":').concat(t.a,"}")}({e:r,a:a,p:i}),e?(s=null,[3,3]):[3,1]):[2]):[2];case 1:return[4,rt(u)];case 2:s=l.sent(),l.label=3;case 3:return A(2,(c=s)?c.length:u.length),Mt(u,c,gn.sequence,e),pt=[],n&&(dt=[],yt=0,mt=0,kt=!1),[2]}}))}))}function Mt(t,n,e,r){if(void 0===r&&(r=!1),"string"==typeof o.upload){var a=o.upload,i=!1;if(r&&"sendBeacon"in navigator)try{(i=navigator.sendBeacon.bind(navigator)(a,t))&&Tt(e)}catch(t){}if(!1===i){e in ft?ft[e].attempts++:ft[e]={data:t,attempts:1};var u=new XMLHttpRequest;u.open("POST",a,!0),u.timeout=15e3,u.ontimeout=function(){kn(new Error("".concat("Timeout"," : ").concat(a)))},null!==e&&(u.onreadystatechange=function(){Sn(Ot)(u,e)}),u.withCredentials=!0,n?(u.setRequestHeader("Accept","application/x-clarity-gzip"),u.send(n)):u.send(t)}}else if(o.upload){(0,o.upload)(t),Tt(e)}}function Ot(t,n){var e=ft[n];t&&4===t.readyState&&e&&((t.status<200||t.status>208)&&e.attempts<=1?t.status>=400&&t.status<500?Ct(6):(0===t.status&&(o.upload=o.fallback?o.fallback:o.upload),Mt(e.data,null,n)):(vt={sequence:n,attempts:e.attempts,status:t.status},e.attempts>1&&xt(2),200===t.status&&t.responseText&&function(t){for(var n=t&&t.length>0?t.split("\n"):[],e=0,r=n;e<r.length;e++){var a=r[e],i=a&&a.length>0?a.split(/ (.*)/):[""];switch(i[0]){case"END":Ct(6);break;case"UPGRADE":B("Auto");break;case"ACTION":o.action&&i.length>1&&o.action(i[1]);break;case"EXTRACT":i.length>1&&i[1];break;case"SIGNAL":i.length>1&&it(i[1])}}}(t.responseText),0===t.status&&(Mt(e.data,null,n,!0),Ct(3)),t.status>=200&&t.status<=208&&Tt(n),delete ft[n]))}function Tt(t){1===t&&(on(),an())}function xt(t){var n=[c(),t];switch(t){case 4:var e=g;e&&((n=[e.time,e.event]).push(e.data.visible),n.push(e.data.docWidth),n.push(e.data.docHeight),n.push(e.data.screenWidth),n.push(e.data.screenHeight),n.push(e.data.scrollX),n.push(e.data.scrollY),n.push(e.data.pointerX),n.push(e.data.pointerY),n.push(e.data.activityTime),n.push(e.data.scrollTime),n.push(e.data.pointerTime),n.push(e.data.moveX),n.push(e.data.moveY),n.push(e.data.moveTime),n.push(e.data.downX),n.push(e.data.downY),n.push(e.data.downTime),n.push(e.data.upX),n.push(e.data.upY),n.push(e.data.upTime),n.push(e.data.pointerPrevX),n.push(e.data.pointerPrevY),n.push(e.data.pointerPrevTime),_t(n,!1));break;case 25:n.push(x.gap),_t(n);break;case 35:n.push(gt.check),_t(n,!1);break;case 3:n.push(V.key),_t(n);break;case 2:n.push(vt.sequence),n.push(vt.attempts),n.push(vt.status),_t(n,!1);break;case 24:O.key&&n.push(O.key),n.push(O.value),_t(n);break;case 34:var r=Object.keys(J);if(r.length>0){for(var a=0,o=r;a<o.length;a++){var i=o[a];n.push(i),n.push(J[i])}$(),_t(n,!1)}break;case 0:var u=Object.keys(z);if(u.length>0){for(var s=0,l=u;s<l.length;s++){var d=l[s],p=parseInt(d,10);n.push(p),n.push(Math.round(z[d]))}z={},_t(n,!1)}break;case 1:var f=Object.keys(Nt);if(f.length>0){for(var h=0,v=f;h<v.length;h++){var y=v[h];p=parseInt(y,10);n.push(p),n.push(Nt[y])}Lt(),_t(n,!1)}break;case 36:var b=Object.keys(m);if(b.length>0){for(var k=0,S=b;k<S.length;k++){var I=S[k];p=parseInt(I,10);n.push(p),n.push([].concat.apply([],m[I]))}_t(n,!1)}break;case 40:w.forEach((function(t){n.push(t);var e=[];for(var r in m[t]){var a=parseInt(r,10);e.push(a),e.push(m[t][r])}n.push(e)})),_t(n,!1);case 47:n.push(_.source),n.push(_.ad_Storage),n.push(_.analytics_Storage),_t(n,!1)}}function jt(){gt={check:0}}function zt(t){if(0===gt.check){var n=gt.check;n=gn.sequence>=128?1:n,n=gn.pageNum>=128?7:n,n=c()>72e5?2:n,(n=t>10485760?2:n)!==gt.check&&Ct(n)}}function Ct(t){gt.check=t,5!==t&&(rn(),he())}function At(){0!==gt.check&&xt(35)}function Pt(){gt=null}var qt=null,Nt=null,Dt=!1;function Rt(){qt={},Nt={},Dt=!1}function Ht(){qt={},Nt={},Dt=!1}function Ut(t,n){if(n&&(n="".concat(n),t in qt||(qt[t]=[]),qt[t].indexOf(n)<0)){if(qt[t].length>128)return void(Dt||(Dt=!0,Ct(5)));qt[t].push(n),t in Nt||(Nt[t]=[]),Nt[t].push(n)}}function Xt(){xt(1)}function Lt(){Nt={},Dt=!1}var Vt=null,Bt=[],Yt=0,Wt=null,Zt=null,Jt={ad_Storage:"denied",analytics_Storage:"denied"};function Gt(){var t,n,e;Wt=null;var r=navigator&&"userAgent"in navigator?navigator.userAgent:"",a=null!==(e=null===(n=null===(t=null===Intl||void 0===Intl?void 0:Intl.DateTimeFormat())||void 0===t?void 0:t.resolvedOptions())||void 0===n?void 0:n.timeZone)&&void 0!==e?e:"",i=(new Date).getTimezoneOffset().toString(),u=window.location.ancestorOrigins?Array.from(window.location.ancestorOrigins).toString():"",c=document&&document.title?document.title:"";Yt=r.indexOf("Electron")>0?1:0;var s=function(){var t={session:sn(),ts:Math.round(Date.now()),count:1,upgrade:null,upload:""},n=pn("_clsk",!o.includeSubdomains);if(n){var e=n.includes("^")?n.split("^"):n.split("|");e.length>=5&&t.ts-ln(e[1])<18e5&&(t.session=e[0],t.count=ln(e[2])+1,t.upgrade=ln(e[3]),t.upload=e.length>=6?"".concat("https://").concat(e[5],"/").concat(e[4]):"".concat("https://").concat(e[4]))}return t}(),l=dn(),d=o.projectId||function(t,n){void 0===n&&(n=null);for(var e,r=5381,a=r,o=0;o<t.length;o+=2)r=(r<<5)+r^t.charCodeAt(o),o+1<t.length&&(a=(a<<5)+a^t.charCodeAt(o+1));return e=Math.abs(r+11579*a),(n?e%Math.pow(2,n):e).toString(36)}(location.host);Vt={projectId:d,userId:l.id,sessionId:s.session,pageNum:s.count},o.lean=o.track&&null!==s.upgrade?0===s.upgrade:o.lean,o.upload=o.track&&"string"==typeof o.upload&&s.upload&&s.upload.length>"https://".length?s.upload:o.upload,Ut(0,r),Ut(3,c),Ut(1,h(location.href,!!Yt)),Ut(2,document.referrer),Ut(15,function(){var t=sn();if(o.track&&un(window,"sessionStorage")){var n=sessionStorage.getItem("_cltk");t=n||t,sessionStorage.setItem("_cltk",t)}return t}()),Ut(16,document.documentElement.lang),Ut(17,document.dir),Ut(26,"".concat(window.devicePixelRatio)),Ut(28,l.dob.toString()),Ut(29,l.version.toString()),Ut(33,u),Ut(34,a),Ut(35,i),P(0,s.ts),P(1,0),P(35,Yt);var p,f=null===window||void 0===window?void 0:window.Zone;f&&"__symbol__"in f&&P(39,1),navigator&&(Ut(9,navigator.language),P(33,navigator.hardwareConcurrency),P(32,navigator.maxTouchPoints),P(34,Math.round(navigator.deviceMemory)),(p=navigator.userAgentData)&&p.getHighEntropyValues?p.getHighEntropyValues(["model","platform","platformVersion","uaFullVersion"]).then((function(t){var n;Ut(22,t.platform),Ut(23,t.platformVersion),null===(n=t.brands)||void 0===n||n.forEach((function(t){Ut(24,t.name+"~"+t.version)})),Ut(25,t.model),P(27,t.mobile?1:0)})):Ut(22,navigator.platform)),screen&&(P(14,Math.round(screen.width)),P(15,Math.round(screen.height)),P(16,Math.round(screen.colorDepth)));for(var v=0,g=o.cookies;v<g.length;v++){var m=g[v],y=pn(m);y&&G(m,y)}!function(t){M(t.analytics_Storage?1:0),_=t}(nn(Zt={ad_Storage:o.track?"granted":"denied",analytics_Storage:o.track?"granted":"denied"},0)),cn(l)}function Ft(){Wt=null,Vt=null,Zt=null,Bt.forEach((function(t){t.called=!1}))}function Kt(t,n,e,r){void 0===n&&(n=!0),void 0===e&&(e=!1),void 0===r&&(r=!1);var a=o.lean?0:1,i=!1;Vt&&(a||!1===n)&&(t(Vt,!o.lean,r?Zt:void 0),i=!0),!e&&i||Bt.push({callback:t,wait:n,recall:e,called:i,consentInfo:r})}function Qt(){return Vt?[Vt.userId,Vt.sessionId,Vt.pageNum].join("."):""}function $t(t){void 0===t&&(t=!0),t?(tn({ad_Storage:"granted",analytics_Storage:"granted"}),E()):tn()}function tn(t,n){void 0===t&&(t=Jt),void 0===n&&(n=1),Zt={ad_Storage:en(t.ad_Storage),analytics_Storage:en(t.analytics_Storage)},an(!0);var e=nn(Zt,n);if(!e.analytics_Storage)return o.track=!1,hn("_clsk","",-Number.MAX_VALUE),hn("_clck","",-Number.MAX_VALUE),he(),void window.setTimeout(fe,250);Bn()&&(o.track=!0,cn(dn(),1),on(),function(t){_=t,xt(47)}(e),E())}function nn(t,n){return{source:n,ad_Storage:"granted"===t.ad_Storage?1:0,analytics_Storage:"granted"===t.analytics_Storage?1:0}}function en(t){return"string"==typeof t?t.toLowerCase():"denied"}function rn(){hn("_clsk","",0)}function an(t){void 0===t&&(t=!1),function(t,n){void 0===n&&(n=!1);if(Bt.length>0)for(var e=0;e<Bt.length;e++){var r=Bt[e];r.callback&&(!r.called&&!n||r.consentInfo&&n)&&(!r.wait||t)&&(r.callback(Vt,!o.lean,r.consentInfo?Zt:void 0),r.called=!0,r.recall||(Bt.splice(e,1),e--))}}(o.lean?0:1,t)}function on(){if(Vt&&o.track){var t=Math.round(Date.now()),n=o.upload&&"string"==typeof o.upload?o.upload.replace("https://",""):"",e=o.lean?0:1;hn("_clsk",[Vt.sessionId,t,Vt.pageNum,e,n].join("|"),1)}}function un(t,n){try{return!!t[n]}catch(t){return!1}}function cn(t,n){void 0===n&&(n=null),n=null===n?t.consent:n;var e=Math.ceil((Date.now()+31536e6)/864e5),r=0===t.dob?null===o.dob?0:o.dob:t.dob;(null===t.expiry||Math.abs(e-t.expiry)>=1||t.consent!==n||t.dob!==r)&&hn("_clck",[Vt.userId,2,e.toString(36),n,r].join("|"),365)}function sn(){var t=Math.floor(Math.random()*Math.pow(2,32));return window&&window.crypto&&window.crypto.getRandomValues&&Uint32Array&&(t=window.crypto.getRandomValues(new Uint32Array(1))[0]),t.toString(36)}function ln(t,n){return void 0===n&&(n=10),parseInt(t,n)}function dn(){var t={id:sn(),version:0,expiry:null,consent:0,dob:0},n=pn("_clck",!o.includeSubdomains);if(n&&n.length>0){var e=n.includes("^")?n.split("^"):n.split("|");e.length>1&&(t.version=ln(e[1])),e.length>2&&(t.expiry=ln(e[2],36)),e.length>3&&1===ln(e[3])&&(t.consent=1),e.length>4&&ln(e[1])>1&&(t.dob=ln(e[4])),o.track=o.track||1===t.consent,t.id=o.track?e[0]:t.id}return t}function pn(t,n){var e;if(void 0===n&&(n=!1),un(document,"cookie")){var r=document.cookie.split(";");if(r)for(var a=0;a<r.length;a++){var o=r[a].split("=");if(o.length>1&&o[0]&&o[0].trim()===t){for(var i=fn(o[1]),u=i[0],c=i[1];u;)u=(e=fn(c))[0],c=e[1];return n?c.endsWith("".concat("~","1"))?c.substring(0,c.length-2):null:c}}}return null}function fn(t){try{var n=decodeURIComponent(t);return[n!=t,n]}catch(t){}return[!1,t]}function hn(t,n,e){if((o.track||""==n)&&(navigator&&navigator.cookieEnabled||un(document,"cookie"))){var r=function(t){return encodeURIComponent(t)}(n),a=new Date;a.setDate(a.getDate()+e);var i=a?"expires="+a.toUTCString():"",u="".concat(t,"=").concat(r).concat(";").concat(i).concat(";path=/");try{if(null===Wt){for(var c=location.hostname?location.hostname.split("."):[],s=c.length-1;s>=0;s--)if(Wt=".".concat(c[s]).concat(Wt||""),s<c.length-1&&(document.cookie="".concat(u).concat(";").concat("domain=").concat(Wt),pn(t)===n))return;Wt=""}}catch(t){Wt=""}document.cookie=Wt?"".concat(u).concat(";").concat("domain=").concat(Wt):u}}var vn,gn=null;function mn(){var t=Vt;gn={version:s,sequence:0,start:0,duration:0,projectId:t.projectId,userId:t.userId,sessionId:t.sessionId,pageNum:t.pageNum,upload:0,end:0,applicationPlatform:0,url:""}}function yn(){gn=null}function wn(t){return gn.start=gn.start+gn.duration,gn.duration=c()-gn.start,gn.sequence++,gn.upload=t&&"sendBeacon"in navigator?1:0,gn.end=t?1:0,gn.applicationPlatform=0,gn.url=h(location.href,!1,!0),[gn.version,gn.sequence,gn.start,gn.duration,gn.projectId,gn.userId,gn.sessionId,gn.pageNum,gn.upload,gn.end,gn.applicationPlatform,gn.url]}function bn(){vn=[]}function kn(t){if(vn&&-1===vn.indexOf(t.message)){var n=o.report;if(n&&n.length>0&&gn){var e={v:gn.version,p:gn.projectId,u:gn.userId,s:gn.sessionId,n:gn.pageNum};t.message&&(e.m=t.message),t.stack&&(e.e=t.stack);var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(JSON.stringify(e)),vn.push(t.message)}}return t}function Sn(t){return function(){var n=performance.now();try{t.apply(this,arguments)}catch(t){throw kn(t)}var e=performance.now()-n;A(4,e),e>30&&(C(7),P(6,e),"".concat(t.dn||t.name,"-").concat(e))}}var _n=new Map;function In(t,n,e,r,a){void 0===r&&(r=!1),void 0===a&&(a=!0),e=Sn(e);try{t[i("addEventListener")](n,e,{capture:r,passive:a}),function(t){return _n.has(t)}(t)||_n.set(t,[]),_n.get(t).push({event:n,listener:e,options:{capture:r,passive:a}})}catch(t){}}function En(){_n.forEach((function(t,n){!function(t,n){t.forEach((function(t){try{n[i("removeEventListener")](t.event,t.listener,{capture:t.options.capture,passive:t.options.passive})}catch(t){}})),_n.delete(n)}(t,n)})),_n=new Map}var Mn=null,On=null,Tn=null,xn=0;function jn(){return!(xn++>20)}function zn(){zn.dn=1,xn=0,Tn!==An()&&(he(),window.setTimeout(Cn,250))}function Cn(){fe(),P(29,1)}function An(){return location.href?location.href.replace(location.hash,""):location.href}var Pn=[],qn=null,Nn=null,Dn=null;function Rn(){Nn&&(Dn(),Nn=null,null===qn&&Un())}function Hn(){Pn=[],qn=null,Nn=null}function Un(){var t=Pn.shift();t&&(qn=t,t.task().then((function(){t.id===Qt()&&(t.resolve(),qn=null,Un())})).catch((function(n){t.id===Qt()&&(n&&(n.name,n.message,n.stack),qn=null,Un())})))}var Xn=!1;function Ln(){Xn=!0,u=performance.now()+performance.timeOrigin,Hn(),En(),bn(),Tn=An(),xn=0,In(window,"popstate",zn),null===Mn&&(Mn=history.pushState,history.pushState=function(){Mn.apply(this,arguments),Bn()&&jn()&&zn()}),null===On&&(On=history.replaceState,history.replaceState=function(){On.apply(this,arguments),Bn()&&jn()&&zn()})}function Vn(){Tn=null,xn=0,bn(),En(),Hn(),u=0,Xn=!1}function Bn(){return Xn}function Yn(){Yn.dn=2,fe(),T("clarity","restart")}var Wn=null;function Zn(){Wn=null}function Jn(t){Wn={fetchStart:Math.round(t.fetchStart),connectStart:Math.round(t.connectStart),connectEnd:Math.round(t.connectEnd),requestStart:Math.round(t.requestStart),responseStart:Math.round(t.responseStart),responseEnd:Math.round(t.responseEnd),domInteractive:Math.round(t.domInteractive),domComplete:Math.round(t.domComplete),loadEventStart:Math.round(t.loadEventStart),loadEventEnd:Math.round(t.loadEventEnd),redirectCount:Math.round(t.redirectCount),size:t.transferSize?t.transferSize:0,type:t.type,protocol:t.nextHopProtocol,encodedSize:t.encodedBodySize?t.encodedBodySize:0,decodedSize:t.decodedBodySize?t.decodedBodySize:0},function(t){W(this,void 0,void 0,(function(){var n,e;return Z(this,(function(r){return n=c(),e=[n,t],29===t&&(e.push(Wn.fetchStart),e.push(Wn.connectStart),e.push(Wn.connectEnd),e.push(Wn.requestStart),e.push(Wn.responseStart),e.push(Wn.responseEnd),e.push(Wn.domInteractive),e.push(Wn.domComplete),e.push(Wn.loadEventStart),e.push(Wn.loadEventEnd),e.push(Wn.redirectCount),e.push(Wn.size),e.push(Wn.type),e.push(Wn.protocol),e.push(Wn.encodedSize),e.push(Wn.decodedSize),Zn(),_t(e)),[2]}))}))}(29)}var Gn,Fn=0,Kn=1/0,Qn=0,$n=0,te=[],ne=new Map,ee=function(){return Fn||0},re=function(){if(!te.length)return-1;var t=Math.min(te.length-1,Math.floor((ee()-$n)/50));return te[t].latency},ae=function(){$n=ee(),te.length=0,ne.clear()},oe=function(t){if(t.interactionId&&!(t.duration<40)){!function(t){"interactionCount"in performance?Fn=performance.interactionCount:t.interactionId&&(Kn=Math.min(Kn,t.interactionId),Qn=Math.max(Qn,t.interactionId),Fn=Qn?(Qn-Kn)/7+1:0)}(t);var n=te[te.length-1],e=ne.get(t.interactionId);if(e||te.length<10||t.duration>(null==n?void 0:n.latency)){if(e)t.duration>e.latency&&(e.latency=t.duration);else{var r={id:t.interactionId,latency:t.duration};ne.set(r.id,r),te.push(r)}te.sort((function(t,n){return n.latency-t.latency})),te.length>10&&te.splice(10).forEach((function(t){return ne.delete(t.id)}))}}},ie=["navigation","resource","longtask","first-input","layout-shift","largest-contentful-paint","event"];function ue(){ue.dn=26;try{Gn&&Gn.disconnect(),Gn=new PerformanceObserver(Sn(ce));for(var t=0,n=ie;t<n.length;t++){var e=n[t];PerformanceObserver.supportedEntryTypes.indexOf(e)>=0&&("layout-shift"===e&&A(9,0),Gn.observe({type:e,buffered:!0}))}}catch(t){}}function ce(t){ce.dn=27,function(t){for(var n=(!("visibilityState"in document)||"visible"===document.visibilityState),e=0;e<t.length;e++){var r=t[e];switch(r.entryType){case"navigation":Jn(r);break;case"resource":var a=r.name;Ut(4,le(a)),a!==o.upload&&a!==o.fallback||P(28,r.duration);break;case"longtask":C(7);break;case"first-input":n&&P(10,r.processingStart-r.startTime);break;case"event":n&&"PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&(oe(r),Ut(37,re().toString()));break;case"layout-shift":n&&!r.hadRecentInput&&A(9,1e3*r.value);break;case"largest-contentful-paint":n&&P(8,r.startTime)}}}(t.getEntries())}var se=null;function le(t){return se||(se=document.createElement("a")),se.href=t,se.host}var de=Object.freeze({__proto__:null,start:function t(){t.dn=25,Zn(),function(){navigator&&"connection"in navigator&&Ut(27,navigator.connection.effectiveType),window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&("complete"!==document.readyState?In(window,"load",q.bind(this,ue,0)):ue())}()},stop:function(){Gn&&Gn.disconnect(),Gn=null,ae(),se=null,Zn()}}),pe=[S,S,S,de];function fe(t){void 0===t&&(t=null),function(){try{var t=navigator&&"globalPrivacyControl"in navigator&&1==navigator.globalPrivacyControl;return!1===Xn&&"undefined"!=typeof Promise&&window.MutationObserver&&document.createTreeWalker&&"now"in Date&&"now"in performance&&"undefined"!=typeof WeakMap&&!t}catch(t){return!1}}()&&(!function(t){if(null===t||Xn)return!1;for(var n in t)n in o&&(o[n]=t[n])}(t),Ln(),ct(),pe.forEach((function(t){return Sn(t.start)()})),null===t&&ye())}function he(){Bn()&&(pe.slice().reverse().forEach((function(t){return Sn(t.stop)()})),st(),Vn(),void 0!==ge&&(ge[me]=function(){(ge[me].q=ge[me].q||[]).push(arguments),"start"===arguments[0]&&ge[me].q.unshift(ge[me].q.pop())&&ye()}))}var ve=Object.freeze({__proto__:null,consent:$t,consentv2:tn,event:T,hashText:b,identify:F,metadata:Kt,pause:function(){Bn()&&(T("clarity","pause"),null===Nn&&(Nn=new Promise((function(t){Dn=t}))))},resume:function(){Bn()&&(Rn(),T("clarity","resume"))},set:G,signal:function(t){ot=t},start:fe,stop:he,upgrade:B,version:s}),ge=window,me="clarity";function ye(){if(void 0!==ge){if(ge[me]&&ge[me].v)return console.warn("Error CL001: Multiple Clarity tags detected.");var t=ge[me]&&ge[me].q||[];for(ge[me]=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return ve[t].apply(ve,n)},ge[me].v=s;t.length>0;)ge[me].apply(ge,t.shift())}}ye()}();
|
|
1
|
+
!function(){"use strict";var t=Object.freeze({__proto__:null,get queue(){return It},get start(){return _t},get stop(){return Et},get track(){return gt}}),n=Object.freeze({__proto__:null,get check(){return Ct},get compute(){return Pt},get data(){return mt},get start(){return zt},get stop(){return qt},get trigger(){return At}}),e=Object.freeze({__proto__:null,get compute(){return Lt},get data(){return Nt},get log(){return Xt},get reset(){return Vt},get start(){return Ht},get stop(){return Ut},get updates(){return Dt}}),r=Object.freeze({__proto__:null,get callback(){return on},get callbacks(){return Yt},get clear(){return an},get consent(){return tn},get consentv2(){return nn},get data(){return Bt},get electron(){return Wt},get id(){return $t},get metadata(){return Qt},get save(){return un},get shortid(){return ln},get start(){return Ft},get stop(){return Kt}}),a=Object.freeze({__proto__:null,get data(){return mn},get envelope(){return bn},get start(){return yn},get stop(){return wn}}),o={projectId:null,delay:1e3,lean:!1,lite:!1,track:!0,content:!0,drop:[],mask:[],unmask:[],regions:[],cookies:[],fraud:!0,checksum:[],report:null,upload:null,fallback:null,upgrade:null,action:null,dob:null,delayDom:!1,throttleDom:!0,conversions:!1,includeSubdomains:!0};function i(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}var u=0;function c(){return performance.now()+performance.timeOrigin}function s(t){void 0===t&&(t=null);var n=0===u?c():u,e=t&&t.timeStamp>0?t.timeStamp:performance.now(),r=t&&t.view?t.view.performance.timeOrigin:performance.timeOrigin;return Math.max(Math.round(e+r-n),0)}var l="0.8.20";var d=255,p=!0,f=null,h=null;function v(t,n,e){void 0===n&&(n=!1),void 0===e&&(e=!1);var r=t;if(n)r="".concat("https://").concat("Electron");else{var a=o.drop;if(a&&a.length>0&&t&&t.indexOf("?")>0){var i=t.split("?"),u=i[0],c=i[1];r=u+"?"+c.split("&").map((function(t){return a.some((function(n){return 0===t.indexOf("".concat(n,"="))}))?"".concat(t.split("=")[0],"=").concat("*na*"):t})).join("&")}}return e&&(r=r.substring(0,d)),r}function g(t,n,e){return function(){if(p&&null===f)try{f=new RegExp("\\p{N}","gu"),h=new RegExp("\\p{L}","gu"),new RegExp("\\p{Sc}","gu")}catch(t){p=!1}}(),t?t.replace(h,n).replace(f,e):t}var m=[],y=null;function w(){}var b=[];function k(){}function S(){}var _=Object.freeze({__proto__:null,checkDocumentStyles:function(t){},compute:function(){},data:y,hashText:k,keys:b,log:w,observe:function(){},reset:function(){},sheetAdoptionState:[],sheetUpdateState:[],start:function(){},state:m,stop:function(){},trigger:S}),I=null,E=!0;function M(){O(2)}function O(t){Xt(36,t.toString())}var T=null;function x(t,n){Yn()&&t&&"string"==typeof t&&t.length<255&&(T=n&&"string"==typeof n&&n.length<255?{key:t,value:n}:{value:t},jt(24))}var j,z=null,C=null;function A(t){t in z||(z[t]=0),t in C||(C[t]=0),z[t]++,C[t]++}function P(t,n){null!==n&&(t in z||(z[t]=0),t in C||(C[t]=0),z[t]+=n,C[t]+=n)}function q(t,n){null!==n&&!1===isNaN(n)&&(t in z||(z[t]=0),(n>z[t]||0===z[t])&&(C[t]=n,z[t]=n))}function N(t,n,e){return window.setTimeout(_n(t),n,e)}function D(t){return window.clearTimeout(t)}var R=0,H=0,U=null;function X(){U&&D(U),U=N(L,H),R=s()}function L(){var t=s();j={gap:t-R},jt(25),j.gap<3e5?U=N(L,H):Ln&&(x("clarity","suspend"),ve(),["mousemove","touchstart"].forEach((function(t){return En(document,t,Wn)})),["resize","scroll","pageshow"].forEach((function(t){return En(window,t,Wn)})))}var V=Object.freeze({__proto__:null,get data(){return j},reset:X,start:function(){H=6e4,R=0},stop:function(){D(U),R=0,H=0}}),B=null;function Y(t){Yn()&&o.lean&&(o.lean=!1,B={key:t},on(),un(),o.upgrade&&o.upgrade(t),jt(3),o.lite)}var W=Object.freeze({__proto__:null,get data(){return B},start:function(){!o.lean&&o.upgrade&&o.upgrade("Config"),B=null},stop:function(){B=null},upgrade:Y});function Z(t,n,e,r){return new(e||(e=Promise))((function(a,o){function i(t){try{c(r.next(t))}catch(t){o(t)}}function u(t){try{c(r.throw(t))}catch(t){o(t)}}function c(t){var n;t.done?a(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(i,u)}c((r=r.apply(t,n||[])).next())}))}function J(t,n){var e,r,a,o,i={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(i=0)),i;)try{if(e=1,r&&(a=2&u[0]?r.return:u[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;switch(r=0,a&&(u=[2&u[0],a.value]),u[0]){case 0:case 1:a=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(a=i.trys,(a=a.length>0&&a[a.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!a||u[1]>a[0]&&u[1]<a[3])){i.label=u[1];break}if(6===u[0]&&i.label<a[1]){i.label=a[1],a=u;break}if(a&&i.label<a[2]){i.label=a[2],i.ops.push(u);break}a[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(t,i)}catch(t){u=[6,t],r=0}finally{e=a=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}var G=null;function F(t,n){Q(t,"string"==typeof n?[n]:n)}function K(t,n,e,r){return void 0===n&&(n=null),void 0===e&&(e=null),void 0===r&&(r=null),Z(this,void 0,void 0,(function(){var a,o;return J(this,(function(i){switch(i.label){case 0:return o={},[4,nt(t)];case 1:return o.userId=i.sent(),o.userHint=r||((u=t)&&u.length>=5?"".concat(u.substring(0,2)).concat(g(u.substring(2),"*","*")):g(u,"*","*")),Q("userId",[(a=o).userId]),Q("userHint",[a.userHint]),Q("userType",[et(t)]),n&&(Q("sessionId",[n]),a.sessionId=n),e&&(Q("pageId",[e]),a.pageId=e),[2,a]}var u}))}))}function Q(t,n){if(Yn()&&t&&n&&"string"==typeof t&&t.length<255){for(var e=(t in G?G[t]:[]),r=0;r<n.length;r++)"string"==typeof n[r]&&n[r].length<255&&e.push(n[r]);G[t]=e}}function $(){jt(34)}function tt(){G={}}function nt(t){return Z(this,void 0,void 0,(function(){var n;return J(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),crypto&&t?[4,crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t))]:[3,2];case 1:return n=e.sent(),[2,Array.prototype.map.call(new Uint8Array(n),(function(t){return("00"+t.toString(16)).slice(-2)})).join("")];case 2:return[2,""];case 3:return[3,5];case 4:return e.sent(),[2,""];case 5:return[2]}}))}))}function et(t){return t&&t.indexOf("@")>0?"email":"string"}var rt="CompressionStream"in window;function at(t){return Z(this,void 0,void 0,(function(){var n,e;return J(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),rt?(n=new ReadableStream({start:function(n){return Z(this,void 0,void 0,(function(){return J(this,(function(e){return n.enqueue(t),n.close(),[2]}))}))}}).pipeThrough(new TextEncoderStream).pipeThrough(new window.CompressionStream("gzip")),e=Uint8Array.bind,[4,ot(n)]):[3,2];case 1:return[2,new(e.apply(Uint8Array,[void 0,r.sent()]))];case 2:return[3,4];case 3:return r.sent(),[3,4];case 4:return[2,null]}}))}))}function ot(t){return Z(this,void 0,void 0,(function(){var n,e,r,a,o;return J(this,(function(i){switch(i.label){case 0:n=t.getReader(),e=[],r=!1,a=[],i.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return o=i.sent(),r=o.done,a=o.value,r?[2,e]:(e.push.apply(e,a),[3,1]);case 3:return[2,e]}}))}))}var it=null;function ut(t){try{if(!it)return;var n=function(t){try{return JSON.parse(t)}catch(t){return[]}}(t);n.forEach((function(t){it(t)}))}catch(t){}}var ct=[_,e,Object.freeze({__proto__:null,compute:$,get data(){return G},identify:K,reset:tt,set:F,start:function(){tt()},stop:function(){tt()}}),n,_,r,a,t,V,W,_];function st(){z={},C={},A(5),ct.forEach((function(t){return _n(t.start)()}))}function lt(){ct.slice().reverse().forEach((function(t){return _n(t.stop)()})),z={},C={}}function dt(){$(),Lt(),jt(0),Pt(),E&&(jt(47),E=!1)}var pt,ft,ht,vt,gt,mt,yt=0,wt=0,bt=null,kt=0,St=!1;function _t(){vt=!0,yt=0,wt=0,St=!1,kt=0,pt=[],ft=[],ht={},gt=null}function It(t,n){if(void 0===n&&(n=!0),vt){var e=s(),r=t.length>1?t[1]:null,a=JSON.stringify(t);switch(o.lean?!St&&wt+a.length>10485760&&(St=!0):St=!1,r){case 5:if(St)break;yt+=a.length;case 37:case 6:case 43:case 45:case 46:if(St)break;wt+=a.length,pt.push(a);break;default:ft.push(a)}A(25);var i=function(){var t=!1===o.lean&&yt>0?100:mn.sequence*o.delay;return"string"==typeof o.upload?Math.max(Math.min(t,3e4),100):o.delay}();e-kt>2*i&&(D(bt),bt=null),n&&null===bt&&(25!==r&&X(),bt=N(Mt,i),kt=e,Ct(wt))}}function Et(){D(bt),Mt(!0),yt=0,wt=0,St=!1,kt=0,pt=[],ft=[],ht={},gt=null,vt=!1}function Mt(t){return void 0===t&&(t=!1),Z(this,void 0,void 0,(function(){var n,e,r,a,i,u,c,s;return J(this,(function(l){switch(l.label){case 0:return vt?(bt=null,(n=!1===o.lean&&wt>0&&(wt<1048576||mn.sequence>0))&&q(1,1),dt(),e=!0===t,mn?(r=JSON.stringify(bn(e)),a="[".concat(ft.join(),"]"),i=n?"[".concat(pt.join(),"]"):"",u=function(t){return t.p.length>0?'{"e":'.concat(t.e,',"a":').concat(t.a,',"p":').concat(t.p,"}"):'{"e":'.concat(t.e,',"a":').concat(t.a,"}")}({e:r,a:a,p:i}),e?(s=null,[3,3]):[3,1]):[2]):[2];case 1:return[4,at(u)];case 2:s=l.sent(),l.label=3;case 3:return P(2,(c=s)?c.length:u.length),Ot(u,c,mn.sequence,e),ft=[],n&&(pt=[],wt=0,yt=0,St=!1),[2]}}))}))}function Ot(t,n,e,r){if(void 0===r&&(r=!1),"string"==typeof o.upload){var a=o.upload,i=!1;if(r&&"sendBeacon"in navigator)try{(i=navigator.sendBeacon.bind(navigator)(a,t))&&xt(e)}catch(t){}if(!1===i){e in ht?ht[e].attempts++:ht[e]={data:t,attempts:1};var u=new XMLHttpRequest;u.open("POST",a,!0),u.timeout=15e3,u.ontimeout=function(){Sn(new Error("".concat("Timeout"," : ").concat(a)))},null!==e&&(u.onreadystatechange=function(){_n(Tt)(u,e)}),u.withCredentials=!0,n?(u.setRequestHeader("Accept","application/x-clarity-gzip"),u.send(n)):u.send(t)}}else if(o.upload){(0,o.upload)(t),xt(e)}}function Tt(t,n){var e=ht[n];t&&4===t.readyState&&e&&((t.status<200||t.status>208)&&e.attempts<=1?t.status>=400&&t.status<500?At(6):(0===t.status&&(o.upload=o.fallback?o.fallback:o.upload),Ot(e.data,null,n)):(gt={sequence:n,attempts:e.attempts,status:t.status},e.attempts>1&&jt(2),200===t.status&&t.responseText&&function(t){for(var n=t&&t.length>0?t.split("\n"):[],e=0,r=n;e<r.length;e++){var a=r[e],i=a&&a.length>0?a.split(/ (.*)/):[""];switch(i[0]){case"END":At(6);break;case"UPGRADE":Y("Auto");break;case"ACTION":o.action&&i.length>1&&o.action(i[1]);break;case"EXTRACT":i.length>1&&i[1];break;case"SIGNAL":i.length>1&&ut(i[1])}}}(t.responseText),0===t.status&&(Ot(e.data,null,n,!0),At(3)),t.status>=200&&t.status<=208&&xt(n),delete ht[n]))}function xt(t){1===t&&(un(),on())}function jt(t){var n=[s(),t];switch(t){case 4:var e=m;e&&e.data&&((n=[e.time,e.event]).push(e.data.visible),n.push(e.data.docWidth),n.push(e.data.docHeight),n.push(e.data.screenWidth),n.push(e.data.screenHeight),n.push(e.data.scrollX),n.push(e.data.scrollY),n.push(e.data.pointerX),n.push(e.data.pointerY),n.push(e.data.activityTime),n.push(e.data.scrollTime),n.push(e.data.pointerTime),n.push(e.data.moveX),n.push(e.data.moveY),n.push(e.data.moveTime),n.push(e.data.downX),n.push(e.data.downY),n.push(e.data.downTime),n.push(e.data.upX),n.push(e.data.upY),n.push(e.data.upTime),n.push(e.data.pointerPrevX),n.push(e.data.pointerPrevY),n.push(e.data.pointerPrevTime),It(n,!1));break;case 25:n.push(j.gap),It(n);break;case 35:n.push(mt.check),It(n,!1);break;case 3:n.push(B.key),It(n);break;case 2:n.push(gt.sequence),n.push(gt.attempts),n.push(gt.status),It(n,!1);break;case 24:T.key&&n.push(T.key),n.push(T.value),It(n);break;case 34:var r=Object.keys(G);if(r.length>0){for(var a=0,o=r;a<o.length;a++){var i=o[a];n.push(i),n.push(G[i])}tt(),It(n,!1)}break;case 0:var u=Object.keys(C);if(u.length>0){for(var c=0,l=u;c<l.length;c++){var d=l[c],p=parseInt(d,10);n.push(p),n.push(Math.round(C[d]))}C={},It(n,!1)}break;case 1:var f=Object.keys(Dt);if(f.length>0){for(var h=0,v=f;h<v.length;h++){var g=v[h];p=parseInt(g,10);n.push(p),n.push(Dt[g])}Vt(),It(n,!1)}break;case 36:var w=Object.keys(y);if(w.length>0){for(var k=0,S=w;k<S.length;k++){var _=S[k];p=parseInt(_,10);n.push(p),n.push([].concat.apply([],y[_]))}It(n,!1)}break;case 40:b.forEach((function(t){n.push(t);var e=[];for(var r in y[t]){var a=parseInt(r,10);e.push(a),e.push(y[t][r])}n.push(e)})),It(n,!1);break;case 47:n.push(I.source),n.push(I.ad_Storage),n.push(I.analytics_Storage),It(n,!1)}}function zt(){mt={check:0}}function Ct(t){if(0===mt.check){var n=mt.check;n=mn.sequence>=128?1:n,n=mn.pageNum>=128?7:n,n=s()>72e5?2:n,(n=t>10485760?2:n)!==mt.check&&At(n)}}function At(t){mt.check=t,5!==t&&(an(),ve())}function Pt(){0!==mt.check&&jt(35)}function qt(){mt=null}var Nt=null,Dt=null,Rt=!1;function Ht(){Nt={},Dt={},Rt=!1}function Ut(){Nt={},Dt={},Rt=!1}function Xt(t,n){if(n&&(n="".concat(n),t in Nt||(Nt[t]=[]),Nt[t].indexOf(n)<0)){if(Nt[t].length>128)return void(Rt||(Rt=!0,At(5)));Nt[t].push(n),t in Dt||(Dt[t]=[]),Dt[t].push(n)}}function Lt(){jt(1)}function Vt(){Dt={},Rt=!1}var Bt=null,Yt=[],Wt=0,Zt=null,Jt=null,Gt={ad_Storage:"denied",analytics_Storage:"denied"};function Ft(){var t,n,e;Zt=null;var r=navigator&&"userAgent"in navigator?navigator.userAgent:"",a=null!==(e=null===(n=null===(t=null===Intl||void 0===Intl?void 0:Intl.DateTimeFormat())||void 0===t?void 0:t.resolvedOptions())||void 0===n?void 0:n.timeZone)&&void 0!==e?e:"",i=(new Date).getTimezoneOffset().toString(),u=window.location.ancestorOrigins?Array.from(window.location.ancestorOrigins).toString():"",c=document&&document.title?document.title:"";Wt=r.indexOf("Electron")>0?1:0;var s=function(){var t={session:ln(),ts:Math.round(Date.now()),count:1,upgrade:null,upload:""},n=fn("_clsk",!o.includeSubdomains);if(n){var e=n.includes("^")?n.split("^"):n.split("|");e.length>=5&&t.ts-dn(e[1])<18e5&&(t.session=e[0],t.count=dn(e[2])+1,t.upgrade=dn(e[3]),t.upload=e.length>=6?"".concat("https://").concat(e[5],"/").concat(e[4]):"".concat("https://").concat(e[4]))}return t}(),l=pn(),d=o.projectId||function(t,n){void 0===n&&(n=null);for(var e,r=5381,a=r,o=0;o<t.length;o+=2)r=(r<<5)+r^t.charCodeAt(o),o+1<t.length&&(a=(a<<5)+a^t.charCodeAt(o+1));return e=Math.abs(r+11579*a),(n?e%Math.pow(2,n):e).toString(36)}(location.host);Bt={projectId:d,userId:l.id,sessionId:s.session,pageNum:s.count},o.lean=o.track&&null!==s.upgrade?0===s.upgrade:o.lean,o.upload=o.track&&"string"==typeof o.upload&&s.upload&&s.upload.length>"https://".length?s.upload:o.upload,Xt(0,r),Xt(3,c),Xt(1,v(location.href,!!Wt)),Xt(2,document.referrer),Xt(15,function(){var t=ln();if(o.track&&cn(window,"sessionStorage")){var n=sessionStorage.getItem("_cltk");t=n||t,sessionStorage.setItem("_cltk",t)}return t}()),Xt(16,document.documentElement.lang),Xt(17,document.dir),Xt(26,"".concat(window.devicePixelRatio)),Xt(28,l.dob.toString()),Xt(29,l.version.toString()),Xt(33,u),Xt(34,a),Xt(35,i),q(0,s.ts),q(1,0),q(35,Wt);var p,f=null===window||void 0===window?void 0:window.Zone;f&&"__symbol__"in f&&q(39,1),navigator&&(Xt(9,navigator.language),q(33,navigator.hardwareConcurrency),q(32,navigator.maxTouchPoints),q(34,Math.round(navigator.deviceMemory)),(p=navigator.userAgentData)&&p.getHighEntropyValues?p.getHighEntropyValues(["model","platform","platformVersion","uaFullVersion"]).then((function(t){var n;Xt(22,t.platform),Xt(23,t.platformVersion),null===(n=t.brands)||void 0===n||n.forEach((function(t){Xt(24,t.name+"~"+t.version)})),Xt(25,t.model),q(27,t.mobile?1:0)})):Xt(22,navigator.platform)),screen&&(q(14,Math.round(screen.width)),q(15,Math.round(screen.height)),q(16,Math.round(screen.colorDepth)));for(var h=0,g=o.cookies;h<g.length;h++){var m=g[h],y=fn(m);y&&F(m,y)}!function(t){O(t.analytics_Storage?1:0),I=t}(en(Jt={ad_Storage:o.track?"granted":"denied",analytics_Storage:o.track?"granted":"denied"},0)),sn(l)}function Kt(){Zt=null,Bt=null,Jt=null,Yt.forEach((function(t){t.called=!1}))}function Qt(t,n,e,r){void 0===n&&(n=!0),void 0===e&&(e=!1),void 0===r&&(r=!1);var a=o.lean?0:1,i=!1;Bt&&(a||!1===n)&&(t(Bt,!o.lean,r?Jt:void 0),i=!0),!e&&i||Yt.push({callback:t,wait:n,recall:e,called:i,consentInfo:r})}function $t(){return Bt?[Bt.userId,Bt.sessionId,Bt.pageNum].join("."):""}function tn(t){void 0===t&&(t=!0),t?(nn({ad_Storage:"granted",analytics_Storage:"granted"}),M()):nn()}function nn(t,n){void 0===t&&(t=Gt),void 0===n&&(n=1),Jt={ad_Storage:rn(t.ad_Storage),analytics_Storage:rn(t.analytics_Storage)},on(!0);var e=en(Jt,n);if(!e.analytics_Storage)return o.track=!1,vn("_clsk","",-Number.MAX_VALUE),vn("_clck","",-Number.MAX_VALUE),ve(),void window.setTimeout(he,250);Yn()&&(o.track=!0,sn(pn(),1),un(),function(t){I=t,jt(47)}(e),M())}function en(t,n){return{source:n,ad_Storage:"granted"===t.ad_Storage?1:0,analytics_Storage:"granted"===t.analytics_Storage?1:0}}function rn(t){return"string"==typeof t?t.toLowerCase():"denied"}function an(){vn("_clsk","",0)}function on(t){void 0===t&&(t=!1),function(t,n){void 0===n&&(n=!1);if(Yt.length>0)for(var e=0;e<Yt.length;e++){var r=Yt[e];r.callback&&(!r.called&&!n||r.consentInfo&&n)&&(!r.wait||t)&&(r.callback(Bt,!o.lean,r.consentInfo?Jt:void 0),r.called=!0,r.recall||(Yt.splice(e,1),e--))}}(o.lean?0:1,t)}function un(){if(Bt&&o.track){var t=Math.round(Date.now()),n=o.upload&&"string"==typeof o.upload?o.upload.replace("https://",""):"",e=o.lean?0:1;vn("_clsk",[Bt.sessionId,t,Bt.pageNum,e,n].join("|"),1)}}function cn(t,n){try{return!!t[n]}catch(t){return!1}}function sn(t,n){void 0===n&&(n=null),n=null===n?t.consent:n;var e=Math.ceil((Date.now()+31536e6)/864e5),r=0===t.dob?null===o.dob?0:o.dob:t.dob;(null===t.expiry||Math.abs(e-t.expiry)>=1||t.consent!==n||t.dob!==r)&&vn("_clck",[Bt.userId,2,e.toString(36),n,r].join("|"),365)}function ln(){var t=Math.floor(Math.random()*Math.pow(2,32));return window&&window.crypto&&window.crypto.getRandomValues&&Uint32Array&&(t=window.crypto.getRandomValues(new Uint32Array(1))[0]),t.toString(36)}function dn(t,n){return void 0===n&&(n=10),parseInt(t,n)}function pn(){var t={id:ln(),version:0,expiry:null,consent:0,dob:0},n=fn("_clck",!o.includeSubdomains);if(n&&n.length>0){var e=n.includes("^")?n.split("^"):n.split("|");e.length>1&&(t.version=dn(e[1])),e.length>2&&(t.expiry=dn(e[2],36)),e.length>3&&1===dn(e[3])&&(t.consent=1),e.length>4&&dn(e[1])>1&&(t.dob=dn(e[4])),o.track=o.track||1===t.consent,t.id=o.track?e[0]:t.id}return t}function fn(t,n){var e;if(void 0===n&&(n=!1),cn(document,"cookie")){var r=document.cookie.split(";");if(r)for(var a=0;a<r.length;a++){var o=r[a].split("=");if(o.length>1&&o[0]&&o[0].trim()===t){for(var i=hn(o[1]),u=i[0],c=i[1];u;)u=(e=hn(c))[0],c=e[1];return n?c.endsWith("".concat("~","1"))?c.substring(0,c.length-2):null:c}}}return null}function hn(t){try{var n=decodeURIComponent(t);return[n!=t,n]}catch(t){}return[!1,t]}function vn(t,n,e){if((o.track||""==n)&&(navigator&&navigator.cookieEnabled||cn(document,"cookie"))){var r=function(t){return encodeURIComponent(t)}(n),a=new Date;a.setDate(a.getDate()+e);var i=a?"expires="+a.toUTCString():"",u="".concat(t,"=").concat(r).concat(";").concat(i).concat(";path=/");try{if(null===Zt){for(var c=location.hostname?location.hostname.split("."):[],s=c.length-1;s>=0;s--)if(Zt=".".concat(c[s]).concat(Zt||""),s<c.length-1&&(document.cookie="".concat(u).concat(";").concat("domain=").concat(Zt),fn(t)===n))return;Zt=""}}catch(t){Zt=""}document.cookie=Zt?"".concat(u).concat(";").concat("domain=").concat(Zt):u}}var gn,mn=null;function yn(){var t=Bt;mn={version:l,sequence:0,start:0,duration:0,projectId:t.projectId,userId:t.userId,sessionId:t.sessionId,pageNum:t.pageNum,upload:0,end:0,applicationPlatform:0,url:""}}function wn(){mn=null}function bn(t){return mn.start=mn.start+mn.duration,mn.duration=s()-mn.start,mn.sequence++,mn.upload=t&&"sendBeacon"in navigator?1:0,mn.end=t?1:0,mn.applicationPlatform=0,mn.url=v(location.href,!1,!0),[mn.version,mn.sequence,mn.start,mn.duration,mn.projectId,mn.userId,mn.sessionId,mn.pageNum,mn.upload,mn.end,mn.applicationPlatform,mn.url]}function kn(){gn=[]}function Sn(t){if(gn&&-1===gn.indexOf(t.message)){var n=o.report;if(n&&n.length>0&&mn){var e={v:mn.version,p:mn.projectId,u:mn.userId,s:mn.sessionId,n:mn.pageNum};t.message&&(e.m=t.message),t.stack&&(e.e=t.stack);var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(JSON.stringify(e)),gn.push(t.message)}}return t}function _n(t){return function(){var n=performance.now();try{t.apply(this,arguments)}catch(t){throw Sn(t)}var e=performance.now()-n;P(4,e),e>30&&(A(7),q(6,e),"".concat(t.dn||t.name,"-").concat(e))}}var In=new Map;function En(t,n,e,r,a){void 0===r&&(r=!1),void 0===a&&(a=!0),e=_n(e);try{t[i("addEventListener")](n,e,{capture:r,passive:a}),function(t){return In.has(t)}(t)||In.set(t,[]),In.get(t).push({event:n,listener:e,options:{capture:r,passive:a}})}catch(t){}}function Mn(){In.forEach((function(t,n){!function(t,n){t.forEach((function(t){try{n[i("removeEventListener")](t.event,t.listener,{capture:t.options.capture,passive:t.options.passive})}catch(t){}})),In.delete(n)}(t,n)})),In=new Map}var On=null,Tn=null,xn=null,jn=0;function zn(){return!(jn++>20)}function Cn(){Cn.dn=1,jn=0,xn!==Pn()&&(ve(),window.setTimeout(An,250))}function An(){he(),q(29,1)}function Pn(){return location.href?location.href.replace(location.hash,""):location.href}var qn=[],Nn=null,Dn=null,Rn=null;function Hn(){Dn&&(Rn(),Dn=null,null===Nn&&Xn())}function Un(){qn=[],Nn=null,Dn=null}function Xn(){var t=qn.shift();t&&(Nn=t,t.task().then((function(){t.id===$t()&&(t.resolve(),Nn=null,Xn())})).catch((function(n){t.id===$t()&&(n&&(n.name,n.message,n.stack),Nn=null,Xn())})))}var Ln=!1;function Vn(){Ln=!0,u=c(),Un(),Mn(),kn(),xn=Pn(),jn=0,En(window,"popstate",Cn),null===On&&(On=history.pushState,history.pushState=function(){On.apply(this,arguments),Yn()&&zn()&&Cn()}),null===Tn&&(Tn=history.replaceState,history.replaceState=function(){Tn.apply(this,arguments),Yn()&&zn()&&Cn()})}function Bn(){xn=null,jn=0,kn(),Mn(),Un(),u=0,Ln=!1}function Yn(){return Ln}function Wn(){Wn.dn=2,he(),x("clarity","restart")}var Zn=null;function Jn(){Zn=null}function Gn(t){Zn={fetchStart:Math.round(t.fetchStart),connectStart:Math.round(t.connectStart),connectEnd:Math.round(t.connectEnd),requestStart:Math.round(t.requestStart),responseStart:Math.round(t.responseStart),responseEnd:Math.round(t.responseEnd),domInteractive:Math.round(t.domInteractive),domComplete:Math.round(t.domComplete),loadEventStart:Math.round(t.loadEventStart),loadEventEnd:Math.round(t.loadEventEnd),redirectCount:Math.round(t.redirectCount),size:t.transferSize?t.transferSize:0,type:t.type,protocol:t.nextHopProtocol,encodedSize:t.encodedBodySize?t.encodedBodySize:0,decodedSize:t.decodedBodySize?t.decodedBodySize:0},function(t){Z(this,void 0,void 0,(function(){var n,e;return J(this,(function(r){return n=s(),e=[n,t],29===t&&(e.push(Zn.fetchStart),e.push(Zn.connectStart),e.push(Zn.connectEnd),e.push(Zn.requestStart),e.push(Zn.responseStart),e.push(Zn.responseEnd),e.push(Zn.domInteractive),e.push(Zn.domComplete),e.push(Zn.loadEventStart),e.push(Zn.loadEventEnd),e.push(Zn.redirectCount),e.push(Zn.size),e.push(Zn.type),e.push(Zn.protocol),e.push(Zn.encodedSize),e.push(Zn.decodedSize),Jn(),It(e)),[2]}))}))}(29)}var Fn,Kn=0,Qn=1/0,$n=0,te=0,ne=[],ee=new Map,re=function(){return Kn||0},ae=function(){if(!ne.length)return-1;var t=Math.min(ne.length-1,Math.floor((re()-te)/50));return ne[t].latency},oe=function(){te=re(),ne.length=0,ee.clear()},ie=function(t){if(t.interactionId&&!(t.duration<40)){!function(t){"interactionCount"in performance?Kn=performance.interactionCount:t.interactionId&&(Qn=Math.min(Qn,t.interactionId),$n=Math.max($n,t.interactionId),Kn=$n?($n-Qn)/7+1:0)}(t);var n=ne[ne.length-1],e=ee.get(t.interactionId);if(e||ne.length<10||t.duration>(null==n?void 0:n.latency)){if(e)t.duration>e.latency&&(e.latency=t.duration);else{var r={id:t.interactionId,latency:t.duration};ee.set(r.id,r),ne.push(r)}ne.sort((function(t,n){return n.latency-t.latency})),ne.length>10&&ne.splice(10).forEach((function(t){return ee.delete(t.id)}))}}},ue=["navigation","resource","longtask","first-input","layout-shift","largest-contentful-paint","event"];function ce(){ce.dn=26;try{Fn&&Fn.disconnect(),Fn=new PerformanceObserver(_n(se));for(var t=0,n=ue;t<n.length;t++){var e=n[t];PerformanceObserver.supportedEntryTypes.indexOf(e)>=0&&("layout-shift"===e&&P(9,0),Fn.observe({type:e,buffered:!0}))}}catch(t){}}function se(t){se.dn=27,function(t){for(var n=(!("visibilityState"in document)||"visible"===document.visibilityState),e=0;e<t.length;e++){var r=t[e];switch(r.entryType){case"navigation":Gn(r);break;case"resource":var a=r.name;Xt(4,de(a)),a!==o.upload&&a!==o.fallback||q(28,r.duration);break;case"longtask":A(7);break;case"first-input":n&&q(10,r.processingStart-r.startTime);break;case"event":n&&"PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&(ie(r),Xt(37,ae().toString()));break;case"layout-shift":n&&!r.hadRecentInput&&P(9,1e3*r.value);break;case"largest-contentful-paint":n&&q(8,r.startTime)}}}(t.getEntries())}var le=null;function de(t){return le||(le=document.createElement("a")),le.href=t,le.host}var pe=Object.freeze({__proto__:null,start:function t(){t.dn=25,Jn(),function(){navigator&&"connection"in navigator&&Xt(27,navigator.connection.effectiveType),window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&("complete"!==document.readyState?En(window,"load",N.bind(this,ce,0)):ce())}()},stop:function(){Fn&&Fn.disconnect(),Fn=null,oe(),le=null,Jn()}}),fe=[_,_,_,pe];function he(t){void 0===t&&(t=null),function(){try{var t=navigator&&"globalPrivacyControl"in navigator&&1==navigator.globalPrivacyControl;return!1===Ln&&"undefined"!=typeof Promise&&window.MutationObserver&&document.createTreeWalker&&"now"in Date&&"now"in performance&&"undefined"!=typeof WeakMap&&!t}catch(t){return!1}}()&&(!function(t){if(null===t||Ln)return!1;for(var n in t)n in o&&(o[n]=t[n])}(t),Vn(),st(),fe.forEach((function(t){return _n(t.start)()})),null===t&&we())}function ve(){Yn()&&(fe.slice().reverse().forEach((function(t){return _n(t.stop)()})),lt(),Bn(),void 0!==me&&(me[ye]=function(){(me[ye].q=me[ye].q||[]).push(arguments),"start"===arguments[0]&&me[ye].q.unshift(me[ye].q.pop())&&we()}))}var ge=Object.freeze({__proto__:null,consent:tn,consentv2:nn,event:x,hashText:k,identify:K,metadata:Qt,pause:function(){Yn()&&(x("clarity","pause"),null===Dn&&(Dn=new Promise((function(t){Rn=t}))))},resume:function(){Yn()&&(Hn(),x("clarity","resume"))},set:F,signal:function(t){it=t},start:he,stop:ve,upgrade:Y,version:l}),me=window,ye="clarity";function we(){if(void 0!==me){if(me[ye]&&me[ye].v)return console.warn("Error CL001: Multiple Clarity tags detected.");var t=me[ye]&&me[ye].q||[];for(me[ye]=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return ge[t].apply(ge,n)},me[ye].v=l;t.length>0;)me[ye].apply(me,t.shift())}}we()}();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clarity-js",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.20",
|
|
4
4
|
"description": "An analytics library that uses web page interactions to generate aggregated insights",
|
|
5
5
|
"author": "Microsoft Corp.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"@rollup/plugin-node-resolve": "^15.0.0",
|
|
35
35
|
"@rollup/plugin-terser": "^0.4.0",
|
|
36
36
|
"@rollup/plugin-typescript": "^11.0.0",
|
|
37
|
-
"@types/chai": "^4.
|
|
37
|
+
"@types/chai": "^4.3.0",
|
|
38
38
|
"@types/mocha": "^10.0.0",
|
|
39
39
|
"@types/resize-observer-browser": "^0.1.6",
|
|
40
|
-
"chai": "^4.
|
|
40
|
+
"chai": "^4.3.0",
|
|
41
41
|
"del-cli": "^5.0.0",
|
|
42
42
|
"husky": "^8.0.0",
|
|
43
43
|
"lint-staged": "^13.1.0",
|
package/src/core/throttle.ts
CHANGED
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* every specified duration in milliseconds, ensuring the last event is not lost.
|
|
4
4
|
* @param func - The function to throttle.
|
|
5
5
|
* @param duration - The duration in milliseconds to wait before allowing the next execution.
|
|
6
|
-
* @returns A throttled version of the provided function.
|
|
6
|
+
* @returns A throttled version of the provided function with a cleanup method.
|
|
7
7
|
*/
|
|
8
|
-
export default function throttle<T extends (...args: any[]) => void>(func: T, duration: number): T {
|
|
8
|
+
export default function throttle<T extends (...args: any[]) => void>(func: T, duration: number): T & { cleanup: () => void } {
|
|
9
9
|
let lastExecutionTime = 0;
|
|
10
10
|
let timeoutId: ReturnType<typeof setTimeout> | null = null;
|
|
11
11
|
let lastArgs: Parameters<T> | null = null;
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
function throttledFunction(...args: Parameters<T>) {
|
|
14
14
|
const now = performance.now();
|
|
15
15
|
const timeSinceLastExecution = now - lastExecutionTime;
|
|
16
16
|
|
|
@@ -31,5 +31,16 @@ export default function throttle<T extends (...args: any[]) => void>(func: T, du
|
|
|
31
31
|
lastExecutionTime = now;
|
|
32
32
|
func.apply(this, args);
|
|
33
33
|
}
|
|
34
|
-
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Add cleanup method to clear pending timeouts
|
|
37
|
+
throttledFunction.cleanup = function () {
|
|
38
|
+
if (timeoutId) {
|
|
39
|
+
clearTimeout(timeoutId);
|
|
40
|
+
timeoutId = null;
|
|
41
|
+
lastArgs = null;
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return throttledFunction as T & { cleanup: () => void };
|
|
35
46
|
}
|
package/src/core/time.ts
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
let startTime = 0;
|
|
2
2
|
|
|
3
|
+
function computeStartTime(): number {
|
|
4
|
+
return performance.now() + performance.timeOrigin;
|
|
5
|
+
}
|
|
6
|
+
|
|
3
7
|
export function start(): void {
|
|
4
|
-
startTime =
|
|
8
|
+
startTime = computeStartTime();
|
|
5
9
|
}
|
|
6
10
|
|
|
7
|
-
// event.timestamp is number of milliseconds elapsed since the document was loaded
|
|
11
|
+
// event.timestamp is number of milliseconds elapsed since the document was loaded
|
|
8
12
|
// since iframes can be loaded later the event timestamp is not the same as performance.now()
|
|
9
13
|
// converting everything to absolute time by adding timeorigin of the event view
|
|
10
14
|
// to synchronize times before calculating the difference with start time
|
|
11
15
|
export function time(event: UIEvent | PageTransitionEvent = null): number {
|
|
16
|
+
// If startTime is 0, Clarity hasn't been started or has been stopped
|
|
17
|
+
// Use a local baseline to maintain relative timing semantics without affecting global state
|
|
18
|
+
let baseline = startTime === 0 ? computeStartTime() : startTime;
|
|
12
19
|
let ts = event && event.timeStamp > 0 ? event.timeStamp : performance.now();
|
|
13
20
|
let origin = event && (event as UIEvent).view ? (event as UIEvent).view.performance.timeOrigin : performance.timeOrigin;
|
|
14
|
-
return Math.max(Math.round(ts + origin -
|
|
21
|
+
return Math.max(Math.round(ts + origin - baseline), 0);
|
|
15
22
|
}
|
|
16
23
|
|
|
17
24
|
export function stop(): void {
|
package/src/core/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let version = "0.8.
|
|
1
|
+
let version = "0.8.20";
|
|
2
2
|
export default version;
|