clarity-js 0.7.49 → 0.7.51
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 +75 -54
- package/build/clarity.min.js +1 -1
- package/build/clarity.module.js +75 -54
- package/build/clarity.performance.js +1 -1
- package/package.json +1 -1
- package/src/core/version.ts +1 -1
- package/src/data/consent.ts +21 -0
- package/src/data/metadata.ts +11 -1
- package/src/data/upgrade.ts +1 -0
- package/src/data/upload.ts +4 -1
- package/types/data.d.ts +13 -2
package/build/clarity.module.js
CHANGED
|
@@ -38,6 +38,7 @@ var dimension = /*#__PURE__*/Object.freeze({
|
|
|
38
38
|
});
|
|
39
39
|
var metadata$1 = /*#__PURE__*/Object.freeze({
|
|
40
40
|
__proto__: null,
|
|
41
|
+
get callback () { return callback; },
|
|
41
42
|
get callbacks () { return callbacks; },
|
|
42
43
|
get clear () { return clear; },
|
|
43
44
|
get consent () { return consent; },
|
|
@@ -112,7 +113,7 @@ function process$7() {
|
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
|
|
115
|
-
var config$
|
|
116
|
+
var config$2 = {
|
|
116
117
|
projectId: null,
|
|
117
118
|
delay: 1 * 1000 /* Time.Second */,
|
|
118
119
|
lean: false,
|
|
@@ -162,7 +163,7 @@ function stop$F() {
|
|
|
162
163
|
startTime = 0;
|
|
163
164
|
}
|
|
164
165
|
|
|
165
|
-
var version$1 = "0.7.
|
|
166
|
+
var version$1 = "0.7.51";
|
|
166
167
|
|
|
167
168
|
// tslint:disable: no-bitwise
|
|
168
169
|
function hash (input, precision) {
|
|
@@ -273,7 +274,7 @@ function url$1(input, electron) {
|
|
|
273
274
|
if (electron) {
|
|
274
275
|
return "".concat("https://" /* Data.Constant.HTTPS */).concat("Electron" /* Data.Constant.Electron */);
|
|
275
276
|
}
|
|
276
|
-
var drop = config$
|
|
277
|
+
var drop = config$2.drop;
|
|
277
278
|
if (drop && drop.length > 0 && input && input.indexOf("?") > 0) {
|
|
278
279
|
var _a = input.split("?"), path = _a[0], query = _a[1];
|
|
279
280
|
var swap_1 = "*na*" /* Data.Constant.Dropped */;
|
|
@@ -619,8 +620,8 @@ var summary = /*#__PURE__*/Object.freeze({
|
|
|
619
620
|
|
|
620
621
|
var data$f = null;
|
|
621
622
|
function start$D() {
|
|
622
|
-
if (!config$
|
|
623
|
-
config$
|
|
623
|
+
if (!config$2.lean && config$2.upgrade) {
|
|
624
|
+
config$2.upgrade("Config" /* Constant.Config */);
|
|
624
625
|
}
|
|
625
626
|
data$f = null;
|
|
626
627
|
}
|
|
@@ -630,14 +631,15 @@ function start$D() {
|
|
|
630
631
|
// and send all backed up layout events to the server.
|
|
631
632
|
function upgrade(key) {
|
|
632
633
|
// Upgrade only if Clarity was successfully activated on the page
|
|
633
|
-
if (active() && config$
|
|
634
|
-
config$
|
|
634
|
+
if (active() && config$2.lean) {
|
|
635
|
+
config$2.lean = false;
|
|
635
636
|
data$f = { key: key };
|
|
636
637
|
// Update metadata to track we have upgraded this session
|
|
638
|
+
callback();
|
|
637
639
|
save();
|
|
638
640
|
// Callback upgrade handler, if configured
|
|
639
|
-
if (config$
|
|
640
|
-
config$
|
|
641
|
+
if (config$2.upgrade) {
|
|
642
|
+
config$2.upgrade(key);
|
|
641
643
|
}
|
|
642
644
|
encode$1(3 /* Event.Upgrade */);
|
|
643
645
|
}
|
|
@@ -939,7 +941,7 @@ function start$A() {
|
|
|
939
941
|
}
|
|
940
942
|
function check$4(id, target, input) {
|
|
941
943
|
// Compute hash for fraud detection, if enabled. Hash is computed only if input meets the minimum length criteria
|
|
942
|
-
if (config$
|
|
944
|
+
if (config$2.fraud && id !== null && input && input.length >= 5 /* Setting.WordLength */) {
|
|
943
945
|
data$d = { id: id, target: target, checksum: hash(input, 28 /* Setting.ChecksumPrecision */) };
|
|
944
946
|
// Only encode this event if we haven't already reported this hash
|
|
945
947
|
if (history$5.indexOf(data$d.checksum) < 0) {
|
|
@@ -1093,14 +1095,14 @@ function parse$1(root, init) {
|
|
|
1093
1095
|
try {
|
|
1094
1096
|
// Parse unmask configuration into separate query selectors and override tokens as part of initialization
|
|
1095
1097
|
if (init) {
|
|
1096
|
-
config$
|
|
1098
|
+
config$2.unmask.forEach(function (x) { return x.indexOf("!" /* Constant.Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
|
|
1097
1099
|
}
|
|
1098
1100
|
// Since mutations may happen on leaf nodes too, e.g. text nodes, which may not support all selector APIs.
|
|
1099
1101
|
// We ensure that the root note supports querySelectorAll API before executing the code below to identify new regions.
|
|
1100
1102
|
if ("querySelectorAll" in root) {
|
|
1101
|
-
config$
|
|
1102
|
-
config$
|
|
1103
|
-
config$
|
|
1103
|
+
config$2.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, "".concat(x[0])); }); }); // Regions
|
|
1104
|
+
config$2.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /* Privacy.TextImage */); }); }); // Masked Elements
|
|
1105
|
+
config$2.checksum.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return fraudMap.set(e, x[0]); }); }); // Fraud Checksum Check
|
|
1104
1106
|
unmask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 0 /* Privacy.None */); }); }); // Unmasked Elements
|
|
1105
1107
|
}
|
|
1106
1108
|
}
|
|
@@ -1127,7 +1129,7 @@ function add(node, parent, data, source) {
|
|
|
1127
1129
|
var parentValue = null;
|
|
1128
1130
|
var regionId = exists(node) ? id : null;
|
|
1129
1131
|
var fraudId = fraudMap.has(node) ? fraudMap.get(node) : null;
|
|
1130
|
-
var privacyId = config$
|
|
1132
|
+
var privacyId = config$2.content ? 1 /* Privacy.Sensitive */ : 3 /* Privacy.TextImage */;
|
|
1131
1133
|
if (parentId >= 0 && values[parentId]) {
|
|
1132
1134
|
parentValue = values[parentId];
|
|
1133
1135
|
parentValue.children.push(id);
|
|
@@ -1526,7 +1528,7 @@ function state$a(timer) {
|
|
|
1526
1528
|
return 2 /* Task.Stop */;
|
|
1527
1529
|
}
|
|
1528
1530
|
function start$y(timer) {
|
|
1529
|
-
tracker[key(timer)] = { start: performance.now(), calls: 0, yield: config$
|
|
1531
|
+
tracker[key(timer)] = { start: performance.now(), calls: 0, yield: config$2.longTask };
|
|
1530
1532
|
}
|
|
1531
1533
|
function restart$2(timer) {
|
|
1532
1534
|
var id = key(timer);
|
|
@@ -1612,14 +1614,14 @@ function requestIdleCallbackPolyfill(callback, options) {
|
|
|
1612
1614
|
var currentTime = performance.now();
|
|
1613
1615
|
var elapsed = currentTime - startTime;
|
|
1614
1616
|
var duration = currentTime - event.data;
|
|
1615
|
-
if (duration > config$
|
|
1617
|
+
if (duration > config$2.longTask && elapsed < options.timeout) {
|
|
1616
1618
|
requestAnimationFrame(function () { outgoing.postMessage(currentTime); });
|
|
1617
1619
|
}
|
|
1618
1620
|
else {
|
|
1619
1621
|
var didTimeout_1 = elapsed > options.timeout;
|
|
1620
1622
|
callback({
|
|
1621
1623
|
didTimeout: didTimeout_1,
|
|
1622
|
-
timeRemaining: function () { return didTimeout_1 ? config$
|
|
1624
|
+
timeRemaining: function () { return didTimeout_1 ? config$2.longTask : Math.max(0, config$2.longTask - duration); }
|
|
1623
1625
|
});
|
|
1624
1626
|
}
|
|
1625
1627
|
};
|
|
@@ -1716,7 +1718,7 @@ function recompute$8(evt) {
|
|
|
1716
1718
|
var element = target(evt);
|
|
1717
1719
|
if (element) {
|
|
1718
1720
|
var value = element.value;
|
|
1719
|
-
var checksum = value && value.length >= 5 /* Setting.WordLength */ && config$
|
|
1721
|
+
var checksum = value && value.length >= 5 /* Setting.WordLength */ && config$2.fraud && "password,secret,pass,social,ssn,code,hidden" /* Mask.Exclude */.indexOf(element.type) === -1 ? hash(value, 28 /* Setting.ChecksumPrecision */) : "" /* Constant.Empty */;
|
|
1720
1722
|
state$9.push({ time: time(evt), event: 42 /* Event.Change */, data: { target: target(evt), type: element.type, value: value, checksum: checksum } });
|
|
1721
1723
|
schedule$1(encode$3.bind(this, 42 /* Event.Change */));
|
|
1722
1724
|
}
|
|
@@ -2503,7 +2505,7 @@ function process$2() {
|
|
|
2503
2505
|
return [3 /*break*/, 6];
|
|
2504
2506
|
}
|
|
2505
2507
|
target = mutation.target;
|
|
2506
|
-
type = config$
|
|
2508
|
+
type = config$2.throttleDom ? track$5(mutation, timer, instance, record.time) : mutation.type;
|
|
2507
2509
|
if (type && target && target.ownerDocument) {
|
|
2508
2510
|
parse$1(target.ownerDocument);
|
|
2509
2511
|
}
|
|
@@ -3363,7 +3365,7 @@ function encode$4 (type, timer, ts) {
|
|
|
3363
3365
|
if (type === 6 /* Event.Mutation */) {
|
|
3364
3366
|
activity(eventTime);
|
|
3365
3367
|
}
|
|
3366
|
-
queue(tokenize(tokens), !config$
|
|
3368
|
+
queue(tokenize(tokens), !config$2.lean);
|
|
3367
3369
|
_l.label = 11;
|
|
3368
3370
|
case 11: return [3 /*break*/, 12];
|
|
3369
3371
|
case 12: return [2 /*return*/];
|
|
@@ -3883,7 +3885,7 @@ function upload(final) {
|
|
|
3883
3885
|
switch (_b.label) {
|
|
3884
3886
|
case 0:
|
|
3885
3887
|
timeout = null;
|
|
3886
|
-
sendPlaybackBytes = config$
|
|
3888
|
+
sendPlaybackBytes = config$2.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* Setting.MaxFirstPayloadBytes */ || data$1.sequence > 0);
|
|
3887
3889
|
if (sendPlaybackBytes) {
|
|
3888
3890
|
max(1 /* Metric.Playback */, 1 /* BooleanFlag.True */);
|
|
3889
3891
|
}
|
|
@@ -3928,8 +3930,8 @@ function stringify(encoded) {
|
|
|
3928
3930
|
function send(payload, zipped, sequence, beacon) {
|
|
3929
3931
|
if (beacon === void 0) { beacon = false; }
|
|
3930
3932
|
// Upload data if a valid URL is defined in the config
|
|
3931
|
-
if (typeof config$
|
|
3932
|
-
var url_1 = config$
|
|
3933
|
+
if (typeof config$2.upload === "string" /* Constant.String */) {
|
|
3934
|
+
var url_1 = config$2.upload;
|
|
3933
3935
|
var dispatched = false;
|
|
3934
3936
|
// If it's the last payload, attempt to upload using sendBeacon first.
|
|
3935
3937
|
// The advantage to using sendBeacon is that browser can decide to upload asynchronously, improving chances of success
|
|
@@ -3978,8 +3980,8 @@ function send(payload, zipped, sequence, beacon) {
|
|
|
3978
3980
|
}
|
|
3979
3981
|
}
|
|
3980
3982
|
}
|
|
3981
|
-
else if (config$
|
|
3982
|
-
var callback = config$
|
|
3983
|
+
else if (config$2.upload) {
|
|
3984
|
+
var callback = config$2.upload;
|
|
3983
3985
|
callback(payload);
|
|
3984
3986
|
done(sequence);
|
|
3985
3987
|
}
|
|
@@ -4001,7 +4003,7 @@ function check$3(xhr, sequence) {
|
|
|
4001
4003
|
// 2: Safari will terminate pending XHR requests with status code 0 if the user navigates away from the page
|
|
4002
4004
|
// In any case, we switch the upload URL to fallback configuration (if available) before re-trying one more time
|
|
4003
4005
|
if (xhr.status === 0) {
|
|
4004
|
-
config$
|
|
4006
|
+
config$2.upload = config$2.fallback ? config$2.fallback : config$2.upload;
|
|
4005
4007
|
}
|
|
4006
4008
|
// In all other cases, re-attempt sending the same data
|
|
4007
4009
|
// For retry we always fallback to string payload, even though we may have attempted
|
|
@@ -4039,13 +4041,14 @@ function done(sequence) {
|
|
|
4039
4041
|
// If we everything went successfully, and it is the first sequence, save this session for future reference
|
|
4040
4042
|
if (sequence === 1) {
|
|
4041
4043
|
save();
|
|
4044
|
+
callback();
|
|
4042
4045
|
}
|
|
4043
4046
|
}
|
|
4044
4047
|
function delay() {
|
|
4045
4048
|
// Progressively increase delay as we continue to send more payloads from the client to the server
|
|
4046
4049
|
// If we are not uploading data to a server, and instead invoking UploadCallback, in that case keep returning configured value
|
|
4047
|
-
var gap = config$
|
|
4048
|
-
return typeof config$
|
|
4050
|
+
var gap = config$2.lean === false && discoverBytes > 0 ? 100 /* Setting.MinUploadDelay */ : data$1.sequence * config$2.delay;
|
|
4051
|
+
return typeof config$2.upload === "string" /* Constant.String */ ? Math.max(Math.min(gap, 30000 /* Setting.MaxUploadDelay */), 100 /* Setting.MinUploadDelay */) : config$2.delay;
|
|
4049
4052
|
}
|
|
4050
4053
|
function response(payload) {
|
|
4051
4054
|
var lines = payload && payload.length > 0 ? payload.split("\n") : [];
|
|
@@ -4063,8 +4066,8 @@ function response(payload) {
|
|
|
4063
4066
|
break;
|
|
4064
4067
|
case "ACTION" /* Constant.Action */:
|
|
4065
4068
|
// Invoke action callback, if configured and has a valid value
|
|
4066
|
-
if (config$
|
|
4067
|
-
config$
|
|
4069
|
+
if (config$2.action && parts.length > 1) {
|
|
4070
|
+
config$2.action(parts[1]);
|
|
4068
4071
|
}
|
|
4069
4072
|
break;
|
|
4070
4073
|
case "EXTRACT" /* Constant.Extract */:
|
|
@@ -4547,6 +4550,17 @@ function reset$3() {
|
|
|
4547
4550
|
updates = {};
|
|
4548
4551
|
}
|
|
4549
4552
|
|
|
4553
|
+
function config$1(track) {
|
|
4554
|
+
trackConsent(track ? 1 /* ConsentType.Implicit */ : 0 /* ConsentType.None */);
|
|
4555
|
+
}
|
|
4556
|
+
// When we get consent signal as false, we restart the service and track config as false.
|
|
4557
|
+
function consent$1() {
|
|
4558
|
+
trackConsent(2 /* ConsentType.General */);
|
|
4559
|
+
}
|
|
4560
|
+
function trackConsent(consent) {
|
|
4561
|
+
log(36 /* Dimension.Consent */, consent.toString());
|
|
4562
|
+
}
|
|
4563
|
+
|
|
4550
4564
|
var data$2 = null;
|
|
4551
4565
|
var callbacks = [];
|
|
4552
4566
|
var electron = 0 /* BooleanFlag.False */;
|
|
@@ -4563,11 +4577,11 @@ function start$9() {
|
|
|
4563
4577
|
// Populate ids for this page
|
|
4564
4578
|
var s = session();
|
|
4565
4579
|
var u = user();
|
|
4566
|
-
var projectId = config$
|
|
4580
|
+
var projectId = config$2.projectId || hash(location.host);
|
|
4567
4581
|
data$2 = { projectId: projectId, userId: u.id, sessionId: s.session, pageNum: s.count };
|
|
4568
4582
|
// Override configuration based on what's in the session storage, unless it is blank (e.g. using upload callback, like in devtools)
|
|
4569
|
-
config$
|
|
4570
|
-
config$
|
|
4583
|
+
config$2.lean = config$2.track && s.upgrade !== null ? s.upgrade === 0 /* BooleanFlag.False */ : config$2.lean;
|
|
4584
|
+
config$2.upload = config$2.track && typeof config$2.upload === "string" /* Constant.String */ && s.upload && s.upload.length > "https://" /* Constant.HTTPS */.length ? s.upload : config$2.upload;
|
|
4571
4585
|
// Log page metadata as dimensions
|
|
4572
4586
|
log(0 /* Dimension.UserAgent */, ua);
|
|
4573
4587
|
log(3 /* Dimension.PageTitle */, title);
|
|
@@ -4600,13 +4614,15 @@ function start$9() {
|
|
|
4600
4614
|
max(16 /* Metric.ColorDepth */, Math.round(screen.colorDepth));
|
|
4601
4615
|
}
|
|
4602
4616
|
// Read cookies specified in configuration
|
|
4603
|
-
for (var _i = 0, _d = config$
|
|
4617
|
+
for (var _i = 0, _d = config$2.cookies; _i < _d.length; _i++) {
|
|
4604
4618
|
var key = _d[_i];
|
|
4605
4619
|
var value = getCookie(key);
|
|
4606
4620
|
if (value) {
|
|
4607
4621
|
set(key, value);
|
|
4608
4622
|
}
|
|
4609
4623
|
}
|
|
4624
|
+
// Track consent config
|
|
4625
|
+
config$1(config$2.track);
|
|
4610
4626
|
// Track ids using a cookie if configuration allows it
|
|
4611
4627
|
track(u);
|
|
4612
4628
|
}
|
|
@@ -4634,14 +4650,14 @@ function stop$8() {
|
|
|
4634
4650
|
function metadata(cb, wait, recall) {
|
|
4635
4651
|
if (wait === void 0) { wait = true; }
|
|
4636
4652
|
if (recall === void 0) { recall = false; }
|
|
4637
|
-
var upgraded = config$
|
|
4653
|
+
var upgraded = config$2.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
|
|
4638
4654
|
var called = false;
|
|
4639
4655
|
// if caller hasn't specified that they want to skip waiting for upgrade but we've already upgraded, we need to
|
|
4640
4656
|
// directly execute the callback in addition to adding to our list as we only process callbacks at the moment
|
|
4641
4657
|
// we go through the upgrading flow.
|
|
4642
4658
|
if (data$2 && (upgraded || wait === false)) {
|
|
4643
4659
|
// Immediately invoke the callback if the caller explicitly doesn't want to wait for the upgrade confirmation
|
|
4644
|
-
cb(data$2, !config$
|
|
4660
|
+
cb(data$2, !config$2.lean);
|
|
4645
4661
|
called = true;
|
|
4646
4662
|
}
|
|
4647
4663
|
if (recall || !called) {
|
|
@@ -4654,7 +4670,7 @@ function id() {
|
|
|
4654
4670
|
function consent(status) {
|
|
4655
4671
|
if (status === void 0) { status = true; }
|
|
4656
4672
|
if (!status) {
|
|
4657
|
-
config$
|
|
4673
|
+
config$2.track = false;
|
|
4658
4674
|
setCookie("_clsk" /* Constant.SessionKey */, "" /* Constant.Empty */, -Number.MAX_VALUE);
|
|
4659
4675
|
setCookie("_clck" /* Constant.CookieKey */, "" /* Constant.Empty */, -Number.MAX_VALUE);
|
|
4660
4676
|
stop();
|
|
@@ -4662,8 +4678,10 @@ function consent(status) {
|
|
|
4662
4678
|
return;
|
|
4663
4679
|
}
|
|
4664
4680
|
if (active()) {
|
|
4665
|
-
config$
|
|
4681
|
+
config$2.track = true;
|
|
4666
4682
|
track(user(), 1 /* BooleanFlag.True */);
|
|
4683
|
+
save();
|
|
4684
|
+
consent$1();
|
|
4667
4685
|
}
|
|
4668
4686
|
}
|
|
4669
4687
|
function clear() {
|
|
@@ -4672,20 +4690,23 @@ function clear() {
|
|
|
4672
4690
|
}
|
|
4673
4691
|
function tab() {
|
|
4674
4692
|
var id = shortid();
|
|
4675
|
-
if (config$
|
|
4693
|
+
if (config$2.track && supported(window, "sessionStorage" /* Constant.SessionStorage */)) {
|
|
4676
4694
|
var value = sessionStorage.getItem("_cltk" /* Constant.TabKey */);
|
|
4677
4695
|
id = value ? value : id;
|
|
4678
4696
|
sessionStorage.setItem("_cltk" /* Constant.TabKey */, id);
|
|
4679
4697
|
}
|
|
4680
4698
|
return id;
|
|
4681
4699
|
}
|
|
4700
|
+
function callback() {
|
|
4701
|
+
var upgrade = config$2.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
|
|
4702
|
+
processCallback(upgrade);
|
|
4703
|
+
}
|
|
4682
4704
|
function save() {
|
|
4683
4705
|
if (!data$2)
|
|
4684
4706
|
return;
|
|
4685
4707
|
var ts = Math.round(Date.now());
|
|
4686
|
-
var upload = config$
|
|
4687
|
-
var upgrade = config$
|
|
4688
|
-
processCallback(upgrade);
|
|
4708
|
+
var upload = config$2.upload && typeof config$2.upload === "string" /* Constant.String */ ? config$2.upload.replace("https://" /* Constant.HTTPS */, "" /* Constant.Empty */) : "" /* Constant.Empty */;
|
|
4709
|
+
var upgrade = config$2.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
|
|
4689
4710
|
setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Constant.Pipe */), 1 /* Setting.SessionExpire */);
|
|
4690
4711
|
}
|
|
4691
4712
|
function processCallback(upgrade) {
|
|
@@ -4693,7 +4714,7 @@ function processCallback(upgrade) {
|
|
|
4693
4714
|
for (var i = 0; i < callbacks.length; i++) {
|
|
4694
4715
|
var cb = callbacks[i];
|
|
4695
4716
|
if (cb.callback && !cb.called && (!cb.wait || upgrade)) {
|
|
4696
|
-
cb.callback(data$2, !config$
|
|
4717
|
+
cb.callback(data$2, !config$2.lean);
|
|
4697
4718
|
cb.called = true;
|
|
4698
4719
|
if (!cb.recall) {
|
|
4699
4720
|
callbacks.splice(i, 1);
|
|
@@ -4719,7 +4740,7 @@ function track(u, consent) {
|
|
|
4719
4740
|
// E.g. Math.ceil(1628735962643 / (24*60*60*1000)) => 18852 (days) => ejo in base36 (13 bytes => 3 bytes)
|
|
4720
4741
|
var end = Math.ceil((Date.now() + (365 /* Setting.Expire */ * 86400000 /* Time.Day */)) / 86400000 /* Time.Day */);
|
|
4721
4742
|
// If DOB is not set in the user object, use the date set in the config as a DOB
|
|
4722
|
-
var dob = u.dob === 0 ? (config$
|
|
4743
|
+
var dob = u.dob === 0 ? (config$2.dob === null ? 0 : config$2.dob) : u.dob;
|
|
4723
4744
|
// To avoid cookie churn, write user id cookie only once every day
|
|
4724
4745
|
if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* Setting.CookieInterval */ || u.consent !== consent || u.dob !== dob) {
|
|
4725
4746
|
var cookieParts = [data$2.userId, 2 /* Setting.CookieVersion */, end.toString(36), consent, dob];
|
|
@@ -4791,9 +4812,9 @@ function user() {
|
|
|
4791
4812
|
output.dob = num(parts[4]);
|
|
4792
4813
|
}
|
|
4793
4814
|
// Set track configuration to true for this user if we have explicit consent, regardless of project setting
|
|
4794
|
-
config$
|
|
4815
|
+
config$2.track = config$2.track || output.consent === 1 /* BooleanFlag.True */;
|
|
4795
4816
|
// Get user id from cookie only if we tracking is enabled, otherwise fallback to a random id
|
|
4796
|
-
output.id = config$
|
|
4817
|
+
output.id = config$2.track ? parts[0] : output.id;
|
|
4797
4818
|
}
|
|
4798
4819
|
return output;
|
|
4799
4820
|
}
|
|
@@ -4837,7 +4858,7 @@ function encodeCookieValue(value) {
|
|
|
4837
4858
|
function setCookie(key, value, time) {
|
|
4838
4859
|
// only write cookies if we are currently in a cookie writing mode (and they are supported)
|
|
4839
4860
|
// OR if we are trying to write an empty cookie (i.e. clear the cookie value out)
|
|
4840
|
-
if ((config$
|
|
4861
|
+
if ((config$2.track || value == "" /* Constant.Empty */) && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Constant.Cookie */))) {
|
|
4841
4862
|
// Some browsers automatically url encode cookie values if they are not url encoded.
|
|
4842
4863
|
// We therefore encode and decode cookie values ourselves.
|
|
4843
4864
|
var encodedValue = encodeCookieValue(value);
|
|
@@ -4924,7 +4945,7 @@ function reset$2() {
|
|
|
4924
4945
|
function report(e) {
|
|
4925
4946
|
// Do not report the same message twice for the same page
|
|
4926
4947
|
if (history$1 && history$1.indexOf(e.message) === -1) {
|
|
4927
|
-
var url = config$
|
|
4948
|
+
var url = config$2.report;
|
|
4928
4949
|
if (url && url.length > 0) {
|
|
4929
4950
|
var payload = { v: data$1.version, p: data$1.projectId, u: data$1.userId, s: data$1.sessionId, n: data$1.pageNum };
|
|
4930
4951
|
if (e.message) {
|
|
@@ -4956,7 +4977,7 @@ function measure (method) {
|
|
|
4956
4977
|
}
|
|
4957
4978
|
var duration = performance.now() - start;
|
|
4958
4979
|
sum(4 /* Metric.TotalCost */, duration);
|
|
4959
|
-
if (duration > config$
|
|
4980
|
+
if (duration > config$2.longTask) {
|
|
4960
4981
|
count$1(7 /* Metric.LongTaskCount */);
|
|
4961
4982
|
max(6 /* Metric.ThreadBlockedTime */, duration);
|
|
4962
4983
|
}
|
|
@@ -5086,8 +5107,8 @@ function config(override) {
|
|
|
5086
5107
|
return false;
|
|
5087
5108
|
}
|
|
5088
5109
|
for (var key in override) {
|
|
5089
|
-
if (key in config$
|
|
5090
|
-
config$
|
|
5110
|
+
if (key in config$2) {
|
|
5111
|
+
config$2[key] = override[key];
|
|
5091
5112
|
}
|
|
5092
5113
|
}
|
|
5093
5114
|
return true;
|
|
@@ -5164,7 +5185,7 @@ function start$3() {
|
|
|
5164
5185
|
start$x();
|
|
5165
5186
|
start$h();
|
|
5166
5187
|
start$z();
|
|
5167
|
-
if (config$
|
|
5188
|
+
if (config$2.delayDom) {
|
|
5168
5189
|
// Lazy load layout module as part of page load time performance improvements experiment
|
|
5169
5190
|
bind(window, 'load', function () {
|
|
5170
5191
|
start$k();
|
|
@@ -5317,7 +5338,7 @@ function process(entries) {
|
|
|
5317
5338
|
case "resource" /* Constant.Resource */:
|
|
5318
5339
|
var name_1 = entry.name;
|
|
5319
5340
|
log(4 /* Dimension.NetworkHosts */, host(name_1));
|
|
5320
|
-
if (name_1 === config$
|
|
5341
|
+
if (name_1 === config$2.upload || name_1 === config$2.fallback) {
|
|
5321
5342
|
max(28 /* Metric.UploadTime */, entry.duration);
|
|
5322
5343
|
}
|
|
5323
5344
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var t=Object.freeze({__proto__:null,get queue(){return gt},get start(){return vt},get stop(){return mt},get track(){return st}}),n=Object.freeze({__proto__:null,get check(){return Et},get compute(){return Ot},get data(){return lt},get start(){return _t},get stop(){return Mt},get trigger(){return It}}),e=Object.freeze({__proto__:null,get compute(){return Ct},get data(){return Tt},get log(){return At},get reset(){return qt},get start(){return jt},get stop(){return zt},get updates(){return xt}}),r=Object.freeze({__proto__:null,get callbacks(){return Dt},get clear(){return Xt},get consent(){return Bt},get data(){return Nt},get electron(){return Rt},get id(){return Vt},get metadata(){return Lt},get save(){return Jt},get shortid(){return Gt},get start(){return Ut},get stop(){return Ht}}),o=Object.freeze({__proto__:null,get data(){return nn},get envelope(){return on},get start(){return en},get stop(){return rn}}),a={projectId:null,delay:1e3,lean:!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,longTask:30};function u(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}var c=0;function i(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-c),0)}var s="0.7.49";var l=!0,d=null,p=null;function f(t,n,e){return function(){if(l&&null===d)try{d=new RegExp("\\p{N}","gu"),p=new RegExp("\\p{L}","gu"),new RegExp("\\p{Sc}","gu")}catch(t){l=!1}}(),t?t.replace(p,n).replace(d,e):t}var h=[],v=null;function g(){}var m=[];function y(){}function b(){}var w=Object.freeze({__proto__:null,checkDocumentStyles:function(t){},compute:function(){},data:v,hashText:y,keys:m,log:g,observe:function(){},reset:function(){},sheetAdoptionState:[],sheetUpdateState:[],start:function(){},state:h,stop:function(){},trigger:b}),k=null;function S(t,n){jn()&&t&&"string"==typeof t&&t.length<255&&(k=n&&"string"==typeof n&&n.length<255?{key:t,value:n}:{value:t},St(24))}var _,E=null,I=null;function O(t){t in E||(E[t]=0),t in I||(I[t]=0),E[t]++,I[t]++}function M(t,n){null!==n&&(t in E||(E[t]=0),t in I||(I[t]=0),E[t]+=n,I[t]+=n)}function T(t,n){null!==n&&!1===isNaN(n)&&(t in E||(E[t]=0),(n>E[t]||0===E[t])&&(I[t]=n,E[t]=n))}function x(t,n,e){return window.setTimeout(cn(t),n,e)}function j(t){return window.clearTimeout(t)}var z=0,A=0,C=null;function q(){C&&j(C),C=x(N,A),z=i()}function N(){var t=i();_={gap:t-z},St(25),_.gap<3e5?C=x(N,A):Mn&&(S("clarity","suspend"),Bn(),["mousemove","touchstart"].forEach((function(t){return ln(document,t,An)})),["resize","scroll","pageshow"].forEach((function(t){return ln(window,t,An)})))}var D=Object.freeze({__proto__:null,get data(){return _},reset:q,start:function(){A=6e4,z=0},stop:function(){j(C),z=0,A=0}}),R=null;function P(t){jn()&&a.lean&&(a.lean=!1,R={key:t},Jt(),a.upgrade&&a.upgrade(t),St(3))}var U=Object.freeze({__proto__:null,get data(){return R},start:function(){!a.lean&&a.upgrade&&a.upgrade("Config"),R=null},stop:function(){R=null},upgrade:P});function H(t,n,e,r){return new(e||(e=Promise))((function(o,a){function u(t){try{i(r.next(t))}catch(t){a(t)}}function c(t){try{i(r.throw(t))}catch(t){a(t)}}function i(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(u,c)}i((r=r.apply(t,n||[])).next())}))}function L(t,n){var e,r,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(i){return function(c){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(u=0)),u;)try{if(e=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){u.label=c[1];break}if(6===c[0]&&u.label<o[1]){u.label=o[1],o=c;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(c);break}o[2]&&u.ops.pop(),u.trys.pop();continue}c=n.call(t,u)}catch(t){c=[6,t],r=0}finally{e=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,i])}}}var V=null;function B(t,n){J(t,"string"==typeof n?[n]:n)}function X(t,n,e,r){return void 0===n&&(n=null),void 0===e&&(e=null),void 0===r&&(r=null),H(this,void 0,void 0,(function(){var o,a;return L(this,(function(u){switch(u.label){case 0:return a={},[4,G(t)];case 1:return a.userId=u.sent(),a.userHint=r||((c=t)&&c.length>=5?"".concat(c.substring(0,2)).concat(f(c.substring(2),"*","*")):f(c,"*","*")),J("userId",[(o=a).userId]),J("userHint",[o.userHint]),J("userType",[F(t)]),n&&(J("sessionId",[n]),o.sessionId=n),e&&(J("pageId",[e]),o.pageId=e),[2,o]}var c}))}))}function J(t,n){if(jn()&&t&&n&&"string"==typeof t&&t.length<255){for(var e=(t in V?V[t]:[]),r=0;r<n.length;r++)"string"==typeof n[r]&&n[r].length<255&&e.push(n[r]);V[t]=e}}function W(){St(34)}function Z(){V={}}function G(t){return H(this,void 0,void 0,(function(){var n;return L(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 F(t){return t&&t.indexOf("@")>0?"email":"string"}var Y="CompressionStream"in window;function K(t){return H(this,void 0,void 0,(function(){var n,e;return L(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),Y?(n=new ReadableStream({start:function(n){return H(this,void 0,void 0,(function(){return L(this,(function(e){return n.enqueue(t),n.close(),[2]}))}))}}).pipeThrough(new TextEncoderStream).pipeThrough(new window.CompressionStream("gzip")),e=Uint8Array.bind,[4,Q(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 Q(t){return H(this,void 0,void 0,(function(){var n,e,r,o,a;return L(this,(function(u){switch(u.label){case 0:n=t.getReader(),e=[],r=!1,o=[],u.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return a=u.sent(),r=a.done,o=a.value,r?[2,e]:(e.push.apply(e,o),[3,1]);case 3:return[2,e]}}))}))}var $=null;function tt(t){try{if(!$)return;var n=function(t){try{return JSON.parse(t)}catch(t){return[]}}(t);n.forEach((function(t){$(t)}))}catch(t){}}var nt=[w,e,Object.freeze({__proto__:null,compute:W,get data(){return V},identify:X,reset:Z,set:B,start:function(){Z()},stop:function(){Z()}}),n,w,r,o,t,D,U,w];function et(){E={},I={},O(5),nt.forEach((function(t){return cn(t.start)()}))}function rt(){nt.slice().reverse().forEach((function(t){return cn(t.stop)()})),E={},I={}}function ot(){W(),Ct(),St(0),Ot()}var at,ut,ct,it,st,lt,dt=0,pt=0,ft=null,ht=0;function vt(){it=!0,dt=0,pt=0,ht=0,at=[],ut=[],ct={},st=null}function gt(t,n){if(void 0===n&&(n=!0),it){var e=i(),r=t.length>1?t[1]:null,o=JSON.stringify(t);switch(r){case 5:dt+=o.length;case 37:case 6:case 43:case 45:case 46:pt+=o.length,at.push(o);break;default:ut.push(o)}O(25);var u=function(){var t=!1===a.lean&&dt>0?100:nn.sequence*a.delay;return"string"==typeof a.upload?Math.max(Math.min(t,3e4),100):a.delay}();e-ht>2*u&&(j(ft),ft=null),n&&null===ft&&(25!==r&&q(),ft=x(yt,u),ht=e,Et(pt))}}function mt(){j(ft),yt(!0),dt=0,pt=0,ht=0,at=[],ut=[],ct={},st=null,it=!1}function yt(t){return void 0===t&&(t=!1),H(this,void 0,void 0,(function(){var n,e,r,o,u,c,i,s;return L(this,(function(l){switch(l.label){case 0:return ft=null,(n=!1===a.lean&&pt>0&&(pt<1048576||nn.sequence>0))&&T(1,1),ot(),e=!0===t,r=JSON.stringify(on(e)),o="[".concat(ut.join(),"]"),u=n?"[".concat(at.join(),"]"):"",c=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:o,p:u}),e?(s=null,[3,3]):[3,1];case 1:return[4,K(c)];case 2:s=l.sent(),l.label=3;case 3:return M(2,(i=s)?i.length:c.length),bt(c,i,nn.sequence,e),ut=[],n&&(at=[],pt=0,dt=0),[2]}}))}))}function bt(t,n,e,r){if(void 0===r&&(r=!1),"string"==typeof a.upload){var o=a.upload,u=!1;if(r&&"sendBeacon"in navigator)try{(u=navigator.sendBeacon.bind(navigator)(o,t))&&kt(e)}catch(t){}if(!1===u){e in ct?ct[e].attempts++:ct[e]={data:t,attempts:1};var c=new XMLHttpRequest;c.open("POST",o,!0),c.timeout=15e3,c.ontimeout=function(){un(new Error("".concat("Timeout"," : ").concat(o)))},null!==e&&(c.onreadystatechange=function(){cn(wt)(c,e)}),c.withCredentials=!0,n?(c.setRequestHeader("Accept","application/x-clarity-gzip"),c.send(n)):c.send(t)}}else if(a.upload){(0,a.upload)(t),kt(e)}}function wt(t,n){var e=ct[n];t&&4===t.readyState&&e&&((t.status<200||t.status>208)&&e.attempts<=1?t.status>=400&&t.status<500?It(6):(0===t.status&&(a.upload=a.fallback?a.fallback:a.upload),bt(e.data,null,n)):(st={sequence:n,attempts:e.attempts,status:t.status},e.attempts>1&&St(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 o=r[e],u=o&&o.length>0?o.split(/ (.*)/):[""];switch(u[0]){case"END":It(6);break;case"UPGRADE":P("Auto");break;case"ACTION":a.action&&u.length>1&&a.action(u[1]);break;case"EXTRACT":u.length>1&&u[1];break;case"SIGNAL":u.length>1&&tt(u[1])}}}(t.responseText),0===t.status&&(bt(e.data,null,n,!0),It(3)),t.status>=200&&t.status<=208&&kt(n),delete ct[n]))}function kt(t){1===t&&Jt()}function St(t){var n=[i(),t];switch(t){case 4:var e=h;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),gt(n,!1));break;case 25:n.push(_.gap),gt(n);break;case 35:n.push(lt.check),gt(n,!1);break;case 3:n.push(R.key),gt(n);break;case 2:n.push(st.sequence),n.push(st.attempts),n.push(st.status),gt(n,!1);break;case 24:k.key&&n.push(k.key),n.push(k.value),gt(n);break;case 34:var r=Object.keys(V);if(r.length>0){for(var o=0,a=r;o<a.length;o++){var u=a[o];n.push(u),n.push(V[u])}Z(),gt(n,!1)}break;case 0:var c=Object.keys(I);if(c.length>0){for(var s=0,l=c;s<l.length;s++){var d=l[s],p=parseInt(d,10);n.push(p),n.push(Math.round(I[d]))}I={},gt(n,!1)}break;case 1:var f=Object.keys(xt);if(f.length>0){for(var g=0,y=f;g<y.length;g++){var b=y[g];p=parseInt(b,10);n.push(p),n.push(xt[b])}qt(),gt(n,!1)}break;case 36:var w=Object.keys(v);if(w.length>0){for(var S=0,E=w;S<E.length;S++){var O=E[S];p=parseInt(O,10);n.push(p),n.push([].concat.apply([],v[O]))}gt(n,!1)}break;case 40:m.forEach((function(t){n.push(t);var e=[];for(var r in v[t]){var o=parseInt(r,10);e.push(o),e.push(v[t][r])}n.push(e)})),gt(n,!1)}}function _t(){lt={check:0}}function Et(t){if(0===lt.check){var n=lt.check;n=nn.sequence>=128?1:n,n=nn.pageNum>=128?7:n,n=i()>72e5?2:n,(n=t>10485760?2:n)!==lt.check&&It(n)}}function It(t){lt.check=t,Xt(),Bn()}function Ot(){0!==lt.check&&St(35)}function Mt(){lt=null}var Tt=null,xt=null;function jt(){Tt={},xt={}}function zt(){Tt={},xt={}}function At(t,n){n&&(n="".concat(n),t in Tt||(Tt[t]=[]),Tt[t].indexOf(n)<0&&(Tt[t].push(n),t in xt||(xt[t]=[]),xt[t].push(n),Tt[t].length>128&&It(5)))}function Ct(){St(1)}function qt(){xt={}}var Nt=null,Dt=[],Rt=0,Pt=null;function Ut(){var t,n,e;Pt=null;var r=navigator&&"userAgent"in navigator?navigator.userAgent:"",o=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:"",u=(new Date).getTimezoneOffset().toString(),c=window.location.ancestorOrigins?Array.from(window.location.ancestorOrigins).toString():"",i=document&&document.title?document.title:"";Rt=r.indexOf("Electron")>0?1:0;var s,l=function(){var t={session:Gt(),ts:Math.round(Date.now()),count:1,upgrade:null,upload:""},n=Kt("_clsk");if(n){var e=n.split("|");e.length>=5&&t.ts-Ft(e[1])<18e5&&(t.session=e[0],t.count=Ft(e[2])+1,t.upgrade=Ft(e[3]),t.upload=e.length>=6?"".concat("https://").concat(e[5],"/").concat(e[4]):"".concat("https://").concat(e[4]))}return t}(),d=Yt(),p=a.projectId||function(t,n){void 0===n&&(n=null);for(var e,r=5381,o=r,a=0;a<t.length;a+=2)r=(r<<5)+r^t.charCodeAt(a),a+1<t.length&&(o=(o<<5)+o^t.charCodeAt(a+1));return e=Math.abs(r+11579*o),(n?e%Math.pow(2,n):e).toString(36)}(location.host);Nt={projectId:p,userId:d.id,sessionId:l.session,pageNum:l.count},a.lean=a.track&&null!==l.upgrade?0===l.upgrade:a.lean,a.upload=a.track&&"string"==typeof a.upload&&l.upload&&l.upload.length>"https://".length?l.upload:a.upload,At(0,r),At(3,i),At(1,function(t,n){if(void 0===n&&(n=!1),n)return"".concat("https://").concat("Electron");var e=a.drop;if(e&&e.length>0&&t&&t.indexOf("?")>0){var r=t.split("?");return r[0]+"?"+r[1].split("&").map((function(t){return e.some((function(n){return 0===t.indexOf("".concat(n,"="))}))?"".concat(t.split("=")[0],"=").concat("*na*"):t})).join("&")}return t}(location.href,!!Rt)),At(2,document.referrer),At(15,function(){var t=Gt();if(a.track&&Wt(window,"sessionStorage")){var n=sessionStorage.getItem("_cltk");t=n||t,sessionStorage.setItem("_cltk",t)}return t}()),At(16,document.documentElement.lang),At(17,document.dir),At(26,"".concat(window.devicePixelRatio)),At(28,d.dob.toString()),At(29,d.version.toString()),At(33,c),At(34,o),At(35,u),T(0,l.ts),T(1,0),T(35,Rt),navigator&&(At(9,navigator.language),T(33,navigator.hardwareConcurrency),T(32,navigator.maxTouchPoints),T(34,Math.round(navigator.deviceMemory)),(s=navigator.userAgentData)&&s.getHighEntropyValues?s.getHighEntropyValues(["model","platform","platformVersion","uaFullVersion"]).then((function(t){var n;At(22,t.platform),At(23,t.platformVersion),null===(n=t.brands)||void 0===n||n.forEach((function(t){At(24,t.name+"~"+t.version)})),At(25,t.model),T(27,t.mobile?1:0)})):At(22,navigator.platform)),screen&&(T(14,Math.round(screen.width)),T(15,Math.round(screen.height)),T(16,Math.round(screen.colorDepth)));for(var f=0,h=a.cookies;f<h.length;f++){var v=h[f],g=Kt(v);g&&B(v,g)}Zt(d)}function Ht(){Pt=null,Nt=null,Dt.forEach((function(t){t.called=!1}))}function Lt(t,n,e){void 0===n&&(n=!0),void 0===e&&(e=!1);var r=a.lean?0:1,o=!1;Nt&&(r||!1===n)&&(t(Nt,!a.lean),o=!0),!e&&o||Dt.push({callback:t,wait:n,recall:e,called:o})}function Vt(){return Nt?[Nt.userId,Nt.sessionId,Nt.pageNum].join("."):""}function Bt(t){if(void 0===t&&(t=!0),!t)return a.track=!1,$t("_clsk","",-Number.MAX_VALUE),$t("_clck","",-Number.MAX_VALUE),Bn(),void window.setTimeout(Vn,250);jn()&&(a.track=!0,Zt(Yt(),1))}function Xt(){$t("_clsk","",0)}function Jt(){if(Nt){var t=Math.round(Date.now()),n=a.upload&&"string"==typeof a.upload?a.upload.replace("https://",""):"",e=a.lean?0:1;!function(t){if(Dt.length>0)for(var n=0;n<Dt.length;n++){var e=Dt[n];!e.callback||e.called||e.wait&&!t||(e.callback(Nt,!a.lean),e.called=!0,e.recall||(Dt.splice(n,1),n--))}}(e),$t("_clsk",[Nt.sessionId,t,Nt.pageNum,e,n].join("|"),1)}}function Wt(t,n){try{return!!t[n]}catch(t){return!1}}function Zt(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===a.dob?0:a.dob:t.dob;(null===t.expiry||Math.abs(e-t.expiry)>=1||t.consent!==n||t.dob!==r)&&$t("_clck",[Nt.userId,2,e.toString(36),n,r].join("|"),365)}function Gt(){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 Ft(t,n){return void 0===n&&(n=10),parseInt(t,n)}function Yt(){var t={id:Gt(),version:0,expiry:null,consent:0,dob:0},n=Kt("_clck");if(n&&n.length>0){for(var e=n.split("|"),r=0,o=0,u=document.cookie.split(";");o<u.length;o++){r+="_clck"===u[o].split("=")[0].trim()?1:0}if(1===e.length||r>1){var c="".concat(";").concat("expires=").concat(new Date(0).toUTCString()).concat(";path=/");document.cookie="".concat("_clck","=").concat(c),document.cookie="".concat("_clsk","=").concat(c)}e.length>1&&(t.version=Ft(e[1])),e.length>2&&(t.expiry=Ft(e[2],36)),e.length>3&&1===Ft(e[3])&&(t.consent=1),e.length>4&&Ft(e[1])>1&&(t.dob=Ft(e[4])),a.track=a.track||1===t.consent,t.id=a.track?e[0]:t.id}return t}function Kt(t){var n;if(Wt(document,"cookie")){var e=document.cookie.split(";");if(e)for(var r=0;r<e.length;r++){var o=e[r].split("=");if(o.length>1&&o[0]&&o[0].trim()===t){for(var a=Qt(o[1]),u=a[0],c=a[1];u;)u=(n=Qt(c))[0],c=n[1];return c}}}return null}function Qt(t){try{var n=decodeURIComponent(t);return[n!=t,n]}catch(t){}return[!1,t]}function $t(t,n,e){if((a.track||""==n)&&(navigator&&navigator.cookieEnabled||Wt(document,"cookie"))){var r=function(t){return encodeURIComponent(t)}(n),o=new Date;o.setDate(o.getDate()+e);var u=o?"expires="+o.toUTCString():"",c="".concat(t,"=").concat(r).concat(";").concat(u).concat(";path=/");try{if(null===Pt){for(var i=location.hostname?location.hostname.split("."):[],s=i.length-1;s>=0;s--)if(Pt=".".concat(i[s]).concat(Pt||""),s<i.length-1&&(document.cookie="".concat(c).concat(";").concat("domain=").concat(Pt),Kt(t)===n))return;Pt=""}}catch(t){Pt=""}document.cookie=Pt?"".concat(c).concat(";").concat("domain=").concat(Pt):c}}var tn,nn=null;function en(){var t=Nt;nn={version:s,sequence:0,start:0,duration:0,projectId:t.projectId,userId:t.userId,sessionId:t.sessionId,pageNum:t.pageNum,upload:0,end:0}}function rn(){nn=null}function on(t){return nn.start=nn.start+nn.duration,nn.duration=i()-nn.start,nn.sequence++,nn.upload=t&&"sendBeacon"in navigator?1:0,nn.end=t?1:0,[nn.version,nn.sequence,nn.start,nn.duration,nn.projectId,nn.userId,nn.sessionId,nn.pageNum,nn.upload,nn.end]}function an(){tn=[]}function un(t){if(tn&&-1===tn.indexOf(t.message)){var n=a.report;if(n&&n.length>0){var e={v:nn.version,p:nn.projectId,u:nn.userId,s:nn.sessionId,n:nn.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)),tn.push(t.message)}}return t}function cn(t){return function(){var n=performance.now();try{t.apply(this,arguments)}catch(t){throw un(t)}var e=performance.now()-n;M(4,e),e>a.longTask&&(O(7),T(6,e))}}var sn=[];function ln(t,n,e,r){void 0===r&&(r=!1),e=cn(e);try{t[u("addEventListener")](n,e,r),sn.push({event:n,target:t,listener:e,capture:r})}catch(t){}}function dn(){for(var t=0,n=sn;t<n.length;t++){var e=n[t];try{e.target[u("removeEventListener")](e.event,e.listener,e.capture)}catch(t){}}sn=[]}var pn=null,fn=null,hn=null,vn=0;function gn(){return!(vn++>20)}function mn(){vn=0,hn!==bn()&&(Bn(),window.setTimeout(yn,250))}function yn(){Vn(),T(29,1)}function bn(){return location.href?location.href.replace(location.hash,""):location.href}var wn=[],kn=null,Sn=null,_n=null;function En(){Sn&&(_n(),Sn=null,null===kn&&On())}function In(){wn=[],kn=null,Sn=null}function On(){var t=wn.shift();t&&(kn=t,t.task().then((function(){t.id===Vt()&&(t.resolve(),kn=null,On())})).catch((function(n){t.id===Vt()&&(n&&(n.name,n.message,n.stack),kn=null,On())})))}var Mn=!1;function Tn(){Mn=!0,c=performance.now()+performance.timeOrigin,In(),dn(),an(),hn=bn(),vn=0,ln(window,"popstate",mn),null===pn&&(pn=history.pushState,history.pushState=function(){pn.apply(this,arguments),jn()&&gn()&&mn()}),null===fn&&(fn=history.replaceState,history.replaceState=function(){fn.apply(this,arguments),jn()&&gn()&&mn()})}function xn(){hn=null,vn=0,an(),dn(),In(),c=0,Mn=!1}function jn(){return Mn}function zn(t){if(null===t||Mn)return!1;for(var n in t)n in a&&(a[n]=t[n]);return!0}function An(){Vn(),S("clarity","restart")}var Cn,qn=null;function Nn(){qn=null}function Dn(t){qn={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){H(this,void 0,void 0,(function(){var n,e;return L(this,(function(r){return n=i(),e=[n,t],29===t&&(e.push(qn.fetchStart),e.push(qn.connectStart),e.push(qn.connectEnd),e.push(qn.requestStart),e.push(qn.responseStart),e.push(qn.responseEnd),e.push(qn.domInteractive),e.push(qn.domComplete),e.push(qn.loadEventStart),e.push(qn.loadEventEnd),e.push(qn.redirectCount),e.push(qn.size),e.push(qn.type),e.push(qn.protocol),e.push(qn.encodedSize),e.push(qn.decodedSize),Nn(),gt(e)),[2]}))}))}(29)}var Rn=["navigation","resource","longtask","first-input","layout-shift","largest-contentful-paint","event"];function Pn(){try{Cn&&Cn.disconnect(),Cn=new PerformanceObserver(cn(Un));for(var t=0,n=Rn;t<n.length;t++){var e=n[t];PerformanceObserver.supportedEntryTypes.indexOf(e)>=0&&("layout-shift"===e&&M(9,0),Cn.observe({type:e,buffered:!0}))}}catch(t){}}function Un(t){!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":Dn(r);break;case"resource":var o=r.name;At(4,Hn(o)),o!==a.upload&&o!==a.fallback||T(28,r.duration);break;case"longtask":O(7);break;case"first-input":n&&T(10,r.processingStart-r.startTime);break;case"event":n&&T(37,r.duration);break;case"layout-shift":n&&!r.hadRecentInput&&M(9,1e3*r.value);break;case"largest-contentful-paint":n&&T(8,r.startTime)}}}(t.getEntries())}function Hn(t){var n=document.createElement("a");return n.href=t,n.host}var Ln=[w,w,w,Object.freeze({__proto__:null,start:function(){Nn(),function(){navigator&&"connection"in navigator&&At(27,navigator.connection.effectiveType),window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&("complete"!==document.readyState?ln(window,"load",x.bind(this,Pn,0)):Pn())}()},stop:function(){Cn&&Cn.disconnect(),Cn=null,Nn()}})];function Vn(t){void 0===t&&(t=null),function(){try{var t=navigator&&"globalPrivacyControl"in navigator&&1==navigator.globalPrivacyControl;return!1===Mn&&"undefined"!=typeof Promise&&window.MutationObserver&&document.createTreeWalker&&"now"in Date&&"now"in performance&&"undefined"!=typeof WeakMap&&!t}catch(t){return!1}}()&&(zn(t),Tn(),et(),Ln.forEach((function(t){return cn(t.start)()})),null===t&&Zn())}function Bn(){jn()&&(Ln.slice().reverse().forEach((function(t){return cn(t.stop)()})),rt(),xn(),void 0!==Jn&&(Jn[Wn]=function(){(Jn[Wn].q=Jn[Wn].q||[]).push(arguments),"start"===arguments[0]&&Jn[Wn].q.unshift(Jn[Wn].q.pop())&&Zn()}))}var Xn=Object.freeze({__proto__:null,consent:Bt,event:S,hashText:y,identify:X,metadata:Lt,pause:function(){jn()&&(S("clarity","pause"),null===Sn&&(Sn=new Promise((function(t){_n=t}))))},resume:function(){jn()&&(En(),S("clarity","resume"))},set:B,signal:function(t){$=t},start:Vn,stop:Bn,upgrade:P,version:s}),Jn=window,Wn="clarity";function Zn(){if(void 0!==Jn){if(Jn[Wn]&&Jn[Wn].v)return console.warn("Error CL001: Multiple Clarity tags detected.");var t=Jn[Wn]&&Jn[Wn].q||[];for(Jn[Wn]=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return Xn[t].apply(Xn,n)},Jn[Wn].v=s;t.length>0;)Jn[Wn].apply(Jn,t.shift())}}Zn()}();
|
|
1
|
+
!function(){"use strict";var t=Object.freeze({__proto__:null,get queue(){return gt},get start(){return vt},get stop(){return mt},get track(){return st}}),n=Object.freeze({__proto__:null,get check(){return Et},get compute(){return Ot},get data(){return lt},get start(){return _t},get stop(){return Mt},get trigger(){return It}}),e=Object.freeze({__proto__:null,get compute(){return Ct},get data(){return Tt},get log(){return At},get reset(){return qt},get start(){return jt},get stop(){return zt},get updates(){return xt}}),r=Object.freeze({__proto__:null,get callback(){return Wt},get callbacks(){return Rt},get clear(){return Jt},get consent(){return Xt},get data(){return Dt},get electron(){return Pt},get id(){return Bt},get metadata(){return Vt},get save(){return Zt},get shortid(){return Yt},get start(){return Ht},get stop(){return Lt}}),o=Object.freeze({__proto__:null,get data(){return rn},get envelope(){return un},get start(){return on},get stop(){return an}}),a={projectId:null,delay:1e3,lean:!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,longTask:30};function u(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}var c=0;function i(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-c),0)}var s="0.7.51";var l=!0,d=null,p=null;function f(t,n,e){return function(){if(l&&null===d)try{d=new RegExp("\\p{N}","gu"),p=new RegExp("\\p{L}","gu"),new RegExp("\\p{Sc}","gu")}catch(t){l=!1}}(),t?t.replace(p,n).replace(d,e):t}var h=[],v=null;function g(){}var m=[];function y(){}function b(){}var w=Object.freeze({__proto__:null,checkDocumentStyles:function(t){},compute:function(){},data:v,hashText:y,keys:m,log:g,observe:function(){},reset:function(){},sheetAdoptionState:[],sheetUpdateState:[],start:function(){},state:h,stop:function(){},trigger:b}),k=null;function S(t,n){An()&&t&&"string"==typeof t&&t.length<255&&(k=n&&"string"==typeof n&&n.length<255?{key:t,value:n}:{value:t},St(24))}var _,E=null,I=null;function O(t){t in E||(E[t]=0),t in I||(I[t]=0),E[t]++,I[t]++}function M(t,n){null!==n&&(t in E||(E[t]=0),t in I||(I[t]=0),E[t]+=n,I[t]+=n)}function T(t,n){null!==n&&!1===isNaN(n)&&(t in E||(E[t]=0),(n>E[t]||0===E[t])&&(I[t]=n,E[t]=n))}function x(t,n,e){return window.setTimeout(ln(t),n,e)}function j(t){return window.clearTimeout(t)}var z=0,A=0,C=null;function q(){C&&j(C),C=x(N,A),z=i()}function N(){var t=i();_={gap:t-z},St(25),_.gap<3e5?C=x(N,A):xn&&(S("clarity","suspend"),Xn(),["mousemove","touchstart"].forEach((function(t){return pn(document,t,Cn)})),["resize","scroll","pageshow"].forEach((function(t){return pn(window,t,Cn)})))}var D=Object.freeze({__proto__:null,get data(){return _},reset:q,start:function(){A=6e4,z=0},stop:function(){j(C),z=0,A=0}}),R=null;function P(t){An()&&a.lean&&(a.lean=!1,R={key:t},Wt(),Zt(),a.upgrade&&a.upgrade(t),St(3))}var U=Object.freeze({__proto__:null,get data(){return R},start:function(){!a.lean&&a.upgrade&&a.upgrade("Config"),R=null},stop:function(){R=null},upgrade:P});function H(t,n,e,r){return new(e||(e=Promise))((function(o,a){function u(t){try{i(r.next(t))}catch(t){a(t)}}function c(t){try{i(r.throw(t))}catch(t){a(t)}}function i(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(u,c)}i((r=r.apply(t,n||[])).next())}))}function L(t,n){var e,r,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(i){return function(c){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(u=0)),u;)try{if(e=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){u.label=c[1];break}if(6===c[0]&&u.label<o[1]){u.label=o[1],o=c;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(c);break}o[2]&&u.ops.pop(),u.trys.pop();continue}c=n.call(t,u)}catch(t){c=[6,t],r=0}finally{e=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,i])}}}var V=null;function B(t,n){J(t,"string"==typeof n?[n]:n)}function X(t,n,e,r){return void 0===n&&(n=null),void 0===e&&(e=null),void 0===r&&(r=null),H(this,void 0,void 0,(function(){var o,a;return L(this,(function(u){switch(u.label){case 0:return a={},[4,G(t)];case 1:return a.userId=u.sent(),a.userHint=r||((c=t)&&c.length>=5?"".concat(c.substring(0,2)).concat(f(c.substring(2),"*","*")):f(c,"*","*")),J("userId",[(o=a).userId]),J("userHint",[o.userHint]),J("userType",[F(t)]),n&&(J("sessionId",[n]),o.sessionId=n),e&&(J("pageId",[e]),o.pageId=e),[2,o]}var c}))}))}function J(t,n){if(An()&&t&&n&&"string"==typeof t&&t.length<255){for(var e=(t in V?V[t]:[]),r=0;r<n.length;r++)"string"==typeof n[r]&&n[r].length<255&&e.push(n[r]);V[t]=e}}function W(){St(34)}function Z(){V={}}function G(t){return H(this,void 0,void 0,(function(){var n;return L(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 F(t){return t&&t.indexOf("@")>0?"email":"string"}var Y="CompressionStream"in window;function K(t){return H(this,void 0,void 0,(function(){var n,e;return L(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),Y?(n=new ReadableStream({start:function(n){return H(this,void 0,void 0,(function(){return L(this,(function(e){return n.enqueue(t),n.close(),[2]}))}))}}).pipeThrough(new TextEncoderStream).pipeThrough(new window.CompressionStream("gzip")),e=Uint8Array.bind,[4,Q(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 Q(t){return H(this,void 0,void 0,(function(){var n,e,r,o,a;return L(this,(function(u){switch(u.label){case 0:n=t.getReader(),e=[],r=!1,o=[],u.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return a=u.sent(),r=a.done,o=a.value,r?[2,e]:(e.push.apply(e,o),[3,1]);case 3:return[2,e]}}))}))}var $=null;function tt(t){try{if(!$)return;var n=function(t){try{return JSON.parse(t)}catch(t){return[]}}(t);n.forEach((function(t){$(t)}))}catch(t){}}var nt=[w,e,Object.freeze({__proto__:null,compute:W,get data(){return V},identify:X,reset:Z,set:B,start:function(){Z()},stop:function(){Z()}}),n,w,r,o,t,D,U,w];function et(){E={},I={},O(5),nt.forEach((function(t){return ln(t.start)()}))}function rt(){nt.slice().reverse().forEach((function(t){return ln(t.stop)()})),E={},I={}}function ot(){W(),Ct(),St(0),Ot()}var at,ut,ct,it,st,lt,dt=0,pt=0,ft=null,ht=0;function vt(){it=!0,dt=0,pt=0,ht=0,at=[],ut=[],ct={},st=null}function gt(t,n){if(void 0===n&&(n=!0),it){var e=i(),r=t.length>1?t[1]:null,o=JSON.stringify(t);switch(r){case 5:dt+=o.length;case 37:case 6:case 43:case 45:case 46:pt+=o.length,at.push(o);break;default:ut.push(o)}O(25);var u=function(){var t=!1===a.lean&&dt>0?100:rn.sequence*a.delay;return"string"==typeof a.upload?Math.max(Math.min(t,3e4),100):a.delay}();e-ht>2*u&&(j(ft),ft=null),n&&null===ft&&(25!==r&&q(),ft=x(yt,u),ht=e,Et(pt))}}function mt(){j(ft),yt(!0),dt=0,pt=0,ht=0,at=[],ut=[],ct={},st=null,it=!1}function yt(t){return void 0===t&&(t=!1),H(this,void 0,void 0,(function(){var n,e,r,o,u,c,i,s;return L(this,(function(l){switch(l.label){case 0:return ft=null,(n=!1===a.lean&&pt>0&&(pt<1048576||rn.sequence>0))&&T(1,1),ot(),e=!0===t,r=JSON.stringify(un(e)),o="[".concat(ut.join(),"]"),u=n?"[".concat(at.join(),"]"):"",c=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:o,p:u}),e?(s=null,[3,3]):[3,1];case 1:return[4,K(c)];case 2:s=l.sent(),l.label=3;case 3:return M(2,(i=s)?i.length:c.length),bt(c,i,rn.sequence,e),ut=[],n&&(at=[],pt=0,dt=0),[2]}}))}))}function bt(t,n,e,r){if(void 0===r&&(r=!1),"string"==typeof a.upload){var o=a.upload,u=!1;if(r&&"sendBeacon"in navigator)try{(u=navigator.sendBeacon.bind(navigator)(o,t))&&kt(e)}catch(t){}if(!1===u){e in ct?ct[e].attempts++:ct[e]={data:t,attempts:1};var c=new XMLHttpRequest;c.open("POST",o,!0),c.timeout=15e3,c.ontimeout=function(){sn(new Error("".concat("Timeout"," : ").concat(o)))},null!==e&&(c.onreadystatechange=function(){ln(wt)(c,e)}),c.withCredentials=!0,n?(c.setRequestHeader("Accept","application/x-clarity-gzip"),c.send(n)):c.send(t)}}else if(a.upload){(0,a.upload)(t),kt(e)}}function wt(t,n){var e=ct[n];t&&4===t.readyState&&e&&((t.status<200||t.status>208)&&e.attempts<=1?t.status>=400&&t.status<500?It(6):(0===t.status&&(a.upload=a.fallback?a.fallback:a.upload),bt(e.data,null,n)):(st={sequence:n,attempts:e.attempts,status:t.status},e.attempts>1&&St(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 o=r[e],u=o&&o.length>0?o.split(/ (.*)/):[""];switch(u[0]){case"END":It(6);break;case"UPGRADE":P("Auto");break;case"ACTION":a.action&&u.length>1&&a.action(u[1]);break;case"EXTRACT":u.length>1&&u[1];break;case"SIGNAL":u.length>1&&tt(u[1])}}}(t.responseText),0===t.status&&(bt(e.data,null,n,!0),It(3)),t.status>=200&&t.status<=208&&kt(n),delete ct[n]))}function kt(t){1===t&&(Zt(),Wt())}function St(t){var n=[i(),t];switch(t){case 4:var e=h;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),gt(n,!1));break;case 25:n.push(_.gap),gt(n);break;case 35:n.push(lt.check),gt(n,!1);break;case 3:n.push(R.key),gt(n);break;case 2:n.push(st.sequence),n.push(st.attempts),n.push(st.status),gt(n,!1);break;case 24:k.key&&n.push(k.key),n.push(k.value),gt(n);break;case 34:var r=Object.keys(V);if(r.length>0){for(var o=0,a=r;o<a.length;o++){var u=a[o];n.push(u),n.push(V[u])}Z(),gt(n,!1)}break;case 0:var c=Object.keys(I);if(c.length>0){for(var s=0,l=c;s<l.length;s++){var d=l[s],p=parseInt(d,10);n.push(p),n.push(Math.round(I[d]))}I={},gt(n,!1)}break;case 1:var f=Object.keys(xt);if(f.length>0){for(var g=0,y=f;g<y.length;g++){var b=y[g];p=parseInt(b,10);n.push(p),n.push(xt[b])}qt(),gt(n,!1)}break;case 36:var w=Object.keys(v);if(w.length>0){for(var S=0,E=w;S<E.length;S++){var O=E[S];p=parseInt(O,10);n.push(p),n.push([].concat.apply([],v[O]))}gt(n,!1)}break;case 40:m.forEach((function(t){n.push(t);var e=[];for(var r in v[t]){var o=parseInt(r,10);e.push(o),e.push(v[t][r])}n.push(e)})),gt(n,!1)}}function _t(){lt={check:0}}function Et(t){if(0===lt.check){var n=lt.check;n=rn.sequence>=128?1:n,n=rn.pageNum>=128?7:n,n=i()>72e5?2:n,(n=t>10485760?2:n)!==lt.check&&It(n)}}function It(t){lt.check=t,Jt(),Xn()}function Ot(){0!==lt.check&&St(35)}function Mt(){lt=null}var Tt=null,xt=null;function jt(){Tt={},xt={}}function zt(){Tt={},xt={}}function At(t,n){n&&(n="".concat(n),t in Tt||(Tt[t]=[]),Tt[t].indexOf(n)<0&&(Tt[t].push(n),t in xt||(xt[t]=[]),xt[t].push(n),Tt[t].length>128&&It(5)))}function Ct(){St(1)}function qt(){xt={}}function Nt(t){At(36,t.toString())}var Dt=null,Rt=[],Pt=0,Ut=null;function Ht(){var t,n,e;Ut=null;var r=navigator&&"userAgent"in navigator?navigator.userAgent:"",o=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:"",u=(new Date).getTimezoneOffset().toString(),c=window.location.ancestorOrigins?Array.from(window.location.ancestorOrigins).toString():"",i=document&&document.title?document.title:"";Pt=r.indexOf("Electron")>0?1:0;var s,l=function(){var t={session:Yt(),ts:Math.round(Date.now()),count:1,upgrade:null,upload:""},n=$t("_clsk");if(n){var e=n.split("|");e.length>=5&&t.ts-Kt(e[1])<18e5&&(t.session=e[0],t.count=Kt(e[2])+1,t.upgrade=Kt(e[3]),t.upload=e.length>=6?"".concat("https://").concat(e[5],"/").concat(e[4]):"".concat("https://").concat(e[4]))}return t}(),d=Qt(),p=a.projectId||function(t,n){void 0===n&&(n=null);for(var e,r=5381,o=r,a=0;a<t.length;a+=2)r=(r<<5)+r^t.charCodeAt(a),a+1<t.length&&(o=(o<<5)+o^t.charCodeAt(a+1));return e=Math.abs(r+11579*o),(n?e%Math.pow(2,n):e).toString(36)}(location.host);Dt={projectId:p,userId:d.id,sessionId:l.session,pageNum:l.count},a.lean=a.track&&null!==l.upgrade?0===l.upgrade:a.lean,a.upload=a.track&&"string"==typeof a.upload&&l.upload&&l.upload.length>"https://".length?l.upload:a.upload,At(0,r),At(3,i),At(1,function(t,n){if(void 0===n&&(n=!1),n)return"".concat("https://").concat("Electron");var e=a.drop;if(e&&e.length>0&&t&&t.indexOf("?")>0){var r=t.split("?");return r[0]+"?"+r[1].split("&").map((function(t){return e.some((function(n){return 0===t.indexOf("".concat(n,"="))}))?"".concat(t.split("=")[0],"=").concat("*na*"):t})).join("&")}return t}(location.href,!!Pt)),At(2,document.referrer),At(15,function(){var t=Yt();if(a.track&&Gt(window,"sessionStorage")){var n=sessionStorage.getItem("_cltk");t=n||t,sessionStorage.setItem("_cltk",t)}return t}()),At(16,document.documentElement.lang),At(17,document.dir),At(26,"".concat(window.devicePixelRatio)),At(28,d.dob.toString()),At(29,d.version.toString()),At(33,c),At(34,o),At(35,u),T(0,l.ts),T(1,0),T(35,Pt),navigator&&(At(9,navigator.language),T(33,navigator.hardwareConcurrency),T(32,navigator.maxTouchPoints),T(34,Math.round(navigator.deviceMemory)),(s=navigator.userAgentData)&&s.getHighEntropyValues?s.getHighEntropyValues(["model","platform","platformVersion","uaFullVersion"]).then((function(t){var n;At(22,t.platform),At(23,t.platformVersion),null===(n=t.brands)||void 0===n||n.forEach((function(t){At(24,t.name+"~"+t.version)})),At(25,t.model),T(27,t.mobile?1:0)})):At(22,navigator.platform)),screen&&(T(14,Math.round(screen.width)),T(15,Math.round(screen.height)),T(16,Math.round(screen.colorDepth)));for(var f=0,h=a.cookies;f<h.length;f++){var v=h[f],g=$t(v);g&&B(v,g)}!function(t){Nt(t?1:0)}(a.track),Ft(d)}function Lt(){Ut=null,Dt=null,Rt.forEach((function(t){t.called=!1}))}function Vt(t,n,e){void 0===n&&(n=!0),void 0===e&&(e=!1);var r=a.lean?0:1,o=!1;Dt&&(r||!1===n)&&(t(Dt,!a.lean),o=!0),!e&&o||Rt.push({callback:t,wait:n,recall:e,called:o})}function Bt(){return Dt?[Dt.userId,Dt.sessionId,Dt.pageNum].join("."):""}function Xt(t){if(void 0===t&&(t=!0),!t)return a.track=!1,nn("_clsk","",-Number.MAX_VALUE),nn("_clck","",-Number.MAX_VALUE),Xn(),void window.setTimeout(Bn,250);An()&&(a.track=!0,Ft(Qt(),1),Zt(),Nt(2))}function Jt(){nn("_clsk","",0)}function Wt(){!function(t){if(Rt.length>0)for(var n=0;n<Rt.length;n++){var e=Rt[n];!e.callback||e.called||e.wait&&!t||(e.callback(Dt,!a.lean),e.called=!0,e.recall||(Rt.splice(n,1),n--))}}(a.lean?0:1)}function Zt(){if(Dt){var t=Math.round(Date.now()),n=a.upload&&"string"==typeof a.upload?a.upload.replace("https://",""):"",e=a.lean?0:1;nn("_clsk",[Dt.sessionId,t,Dt.pageNum,e,n].join("|"),1)}}function Gt(t,n){try{return!!t[n]}catch(t){return!1}}function Ft(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===a.dob?0:a.dob:t.dob;(null===t.expiry||Math.abs(e-t.expiry)>=1||t.consent!==n||t.dob!==r)&&nn("_clck",[Dt.userId,2,e.toString(36),n,r].join("|"),365)}function Yt(){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 Kt(t,n){return void 0===n&&(n=10),parseInt(t,n)}function Qt(){var t={id:Yt(),version:0,expiry:null,consent:0,dob:0},n=$t("_clck");if(n&&n.length>0){for(var e=n.split("|"),r=0,o=0,u=document.cookie.split(";");o<u.length;o++){r+="_clck"===u[o].split("=")[0].trim()?1:0}if(1===e.length||r>1){var c="".concat(";").concat("expires=").concat(new Date(0).toUTCString()).concat(";path=/");document.cookie="".concat("_clck","=").concat(c),document.cookie="".concat("_clsk","=").concat(c)}e.length>1&&(t.version=Kt(e[1])),e.length>2&&(t.expiry=Kt(e[2],36)),e.length>3&&1===Kt(e[3])&&(t.consent=1),e.length>4&&Kt(e[1])>1&&(t.dob=Kt(e[4])),a.track=a.track||1===t.consent,t.id=a.track?e[0]:t.id}return t}function $t(t){var n;if(Gt(document,"cookie")){var e=document.cookie.split(";");if(e)for(var r=0;r<e.length;r++){var o=e[r].split("=");if(o.length>1&&o[0]&&o[0].trim()===t){for(var a=tn(o[1]),u=a[0],c=a[1];u;)u=(n=tn(c))[0],c=n[1];return c}}}return null}function tn(t){try{var n=decodeURIComponent(t);return[n!=t,n]}catch(t){}return[!1,t]}function nn(t,n,e){if((a.track||""==n)&&(navigator&&navigator.cookieEnabled||Gt(document,"cookie"))){var r=function(t){return encodeURIComponent(t)}(n),o=new Date;o.setDate(o.getDate()+e);var u=o?"expires="+o.toUTCString():"",c="".concat(t,"=").concat(r).concat(";").concat(u).concat(";path=/");try{if(null===Ut){for(var i=location.hostname?location.hostname.split("."):[],s=i.length-1;s>=0;s--)if(Ut=".".concat(i[s]).concat(Ut||""),s<i.length-1&&(document.cookie="".concat(c).concat(";").concat("domain=").concat(Ut),$t(t)===n))return;Ut=""}}catch(t){Ut=""}document.cookie=Ut?"".concat(c).concat(";").concat("domain=").concat(Ut):c}}var en,rn=null;function on(){var t=Dt;rn={version:s,sequence:0,start:0,duration:0,projectId:t.projectId,userId:t.userId,sessionId:t.sessionId,pageNum:t.pageNum,upload:0,end:0}}function an(){rn=null}function un(t){return rn.start=rn.start+rn.duration,rn.duration=i()-rn.start,rn.sequence++,rn.upload=t&&"sendBeacon"in navigator?1:0,rn.end=t?1:0,[rn.version,rn.sequence,rn.start,rn.duration,rn.projectId,rn.userId,rn.sessionId,rn.pageNum,rn.upload,rn.end]}function cn(){en=[]}function sn(t){if(en&&-1===en.indexOf(t.message)){var n=a.report;if(n&&n.length>0){var e={v:rn.version,p:rn.projectId,u:rn.userId,s:rn.sessionId,n:rn.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)),en.push(t.message)}}return t}function ln(t){return function(){var n=performance.now();try{t.apply(this,arguments)}catch(t){throw sn(t)}var e=performance.now()-n;M(4,e),e>a.longTask&&(O(7),T(6,e))}}var dn=[];function pn(t,n,e,r){void 0===r&&(r=!1),e=ln(e);try{t[u("addEventListener")](n,e,r),dn.push({event:n,target:t,listener:e,capture:r})}catch(t){}}function fn(){for(var t=0,n=dn;t<n.length;t++){var e=n[t];try{e.target[u("removeEventListener")](e.event,e.listener,e.capture)}catch(t){}}dn=[]}var hn=null,vn=null,gn=null,mn=0;function yn(){return!(mn++>20)}function bn(){mn=0,gn!==kn()&&(Xn(),window.setTimeout(wn,250))}function wn(){Bn(),T(29,1)}function kn(){return location.href?location.href.replace(location.hash,""):location.href}var Sn=[],_n=null,En=null,In=null;function On(){En&&(In(),En=null,null===_n&&Tn())}function Mn(){Sn=[],_n=null,En=null}function Tn(){var t=Sn.shift();t&&(_n=t,t.task().then((function(){t.id===Bt()&&(t.resolve(),_n=null,Tn())})).catch((function(n){t.id===Bt()&&(n&&(n.name,n.message,n.stack),_n=null,Tn())})))}var xn=!1;function jn(){xn=!0,c=performance.now()+performance.timeOrigin,Mn(),fn(),cn(),gn=kn(),mn=0,pn(window,"popstate",bn),null===hn&&(hn=history.pushState,history.pushState=function(){hn.apply(this,arguments),An()&&yn()&&bn()}),null===vn&&(vn=history.replaceState,history.replaceState=function(){vn.apply(this,arguments),An()&&yn()&&bn()})}function zn(){gn=null,mn=0,cn(),fn(),Mn(),c=0,xn=!1}function An(){return xn}function Cn(){Bn(),S("clarity","restart")}var qn,Nn=null;function Dn(){Nn=null}function Rn(t){Nn={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){H(this,void 0,void 0,(function(){var n,e;return L(this,(function(r){return n=i(),e=[n,t],29===t&&(e.push(Nn.fetchStart),e.push(Nn.connectStart),e.push(Nn.connectEnd),e.push(Nn.requestStart),e.push(Nn.responseStart),e.push(Nn.responseEnd),e.push(Nn.domInteractive),e.push(Nn.domComplete),e.push(Nn.loadEventStart),e.push(Nn.loadEventEnd),e.push(Nn.redirectCount),e.push(Nn.size),e.push(Nn.type),e.push(Nn.protocol),e.push(Nn.encodedSize),e.push(Nn.decodedSize),Dn(),gt(e)),[2]}))}))}(29)}var Pn=["navigation","resource","longtask","first-input","layout-shift","largest-contentful-paint","event"];function Un(){try{qn&&qn.disconnect(),qn=new PerformanceObserver(ln(Hn));for(var t=0,n=Pn;t<n.length;t++){var e=n[t];PerformanceObserver.supportedEntryTypes.indexOf(e)>=0&&("layout-shift"===e&&M(9,0),qn.observe({type:e,buffered:!0}))}}catch(t){}}function Hn(t){!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":Rn(r);break;case"resource":var o=r.name;At(4,Ln(o)),o!==a.upload&&o!==a.fallback||T(28,r.duration);break;case"longtask":O(7);break;case"first-input":n&&T(10,r.processingStart-r.startTime);break;case"event":n&&T(37,r.duration);break;case"layout-shift":n&&!r.hadRecentInput&&M(9,1e3*r.value);break;case"largest-contentful-paint":n&&T(8,r.startTime)}}}(t.getEntries())}function Ln(t){var n=document.createElement("a");return n.href=t,n.host}var Vn=[w,w,w,Object.freeze({__proto__:null,start:function(){Dn(),function(){navigator&&"connection"in navigator&&At(27,navigator.connection.effectiveType),window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&("complete"!==document.readyState?pn(window,"load",x.bind(this,Un,0)):Un())}()},stop:function(){qn&&qn.disconnect(),qn=null,Dn()}})];function Bn(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 a&&(a[n]=t[n])}(t),jn(),et(),Vn.forEach((function(t){return ln(t.start)()})),null===t&&Gn())}function Xn(){An()&&(Vn.slice().reverse().forEach((function(t){return ln(t.stop)()})),rt(),zn(),void 0!==Wn&&(Wn[Zn]=function(){(Wn[Zn].q=Wn[Zn].q||[]).push(arguments),"start"===arguments[0]&&Wn[Zn].q.unshift(Wn[Zn].q.pop())&&Gn()}))}var Jn=Object.freeze({__proto__:null,consent:Xt,event:S,hashText:y,identify:X,metadata:Vt,pause:function(){An()&&(S("clarity","pause"),null===En&&(En=new Promise((function(t){In=t}))))},resume:function(){An()&&(On(),S("clarity","resume"))},set:B,signal:function(t){$=t},start:Bn,stop:Xn,upgrade:P,version:s}),Wn=window,Zn="clarity";function Gn(){if(void 0!==Wn){if(Wn[Zn]&&Wn[Zn].v)return console.warn("Error CL001: Multiple Clarity tags detected.");var t=Wn[Zn]&&Wn[Zn].q||[];for(Wn[Zn]=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return Jn[t].apply(Jn,n)},Wn[Zn].v=s;t.length>0;)Wn[Zn].apply(Wn,t.shift())}}Gn()}();
|
package/package.json
CHANGED
package/src/core/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
let version = "0.7.
|
|
1
|
+
let version = "0.7.51";
|
|
2
2
|
export default version;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Dimension } from "@clarity-types/data";
|
|
2
|
+
import * as dimension from "@src/data/dimension";
|
|
3
|
+
|
|
4
|
+
const enum ConsentType {
|
|
5
|
+
None = 0,
|
|
6
|
+
Implicit = 1,
|
|
7
|
+
General = 2
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function config(track: boolean): void {
|
|
11
|
+
trackConsent(track ? ConsentType.Implicit : ConsentType.None);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// When we get consent signal as false, we restart the service and track config as false.
|
|
15
|
+
export function consent(): void {
|
|
16
|
+
trackConsent(ConsentType.General);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function trackConsent(consent: ConsentType): void {
|
|
20
|
+
dimension.log(Dimension.Consent, consent.toString());
|
|
21
|
+
}
|
package/src/data/metadata.ts
CHANGED
|
@@ -8,6 +8,7 @@ import * as scrub from "@src/core/scrub";
|
|
|
8
8
|
import * as dimension from "@src/data/dimension";
|
|
9
9
|
import * as metric from "@src/data/metric";
|
|
10
10
|
import { set } from "@src/data/variable";
|
|
11
|
+
import * as trackConsent from "@src/data/consent";
|
|
11
12
|
|
|
12
13
|
export let data: Metadata = null;
|
|
13
14
|
export let callbacks: MetadataCallbackOptions[] = [];
|
|
@@ -74,6 +75,9 @@ export function start(): void {
|
|
|
74
75
|
if (value) { set(key, value); }
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
// Track consent config
|
|
79
|
+
trackConsent.config(config.track);
|
|
80
|
+
|
|
77
81
|
// Track ids using a cookie if configuration allows it
|
|
78
82
|
track(u);
|
|
79
83
|
}
|
|
@@ -130,6 +134,8 @@ export function consent(status: boolean = true): void {
|
|
|
130
134
|
if (core.active()) {
|
|
131
135
|
config.track = true;
|
|
132
136
|
track(user(), BooleanFlag.True);
|
|
137
|
+
save();
|
|
138
|
+
trackConsent.consent();
|
|
133
139
|
}
|
|
134
140
|
}
|
|
135
141
|
|
|
@@ -148,12 +154,16 @@ function tab(): string {
|
|
|
148
154
|
return id;
|
|
149
155
|
}
|
|
150
156
|
|
|
157
|
+
export function callback(): void {
|
|
158
|
+
let upgrade = config.lean ? BooleanFlag.False : BooleanFlag.True;
|
|
159
|
+
processCallback(upgrade);
|
|
160
|
+
}
|
|
161
|
+
|
|
151
162
|
export function save(): void {
|
|
152
163
|
if (!data) return;
|
|
153
164
|
let ts = Math.round(Date.now());
|
|
154
165
|
let upload = config.upload && typeof config.upload === Constant.String ? (config.upload as string).replace(Constant.HTTPS, Constant.Empty) : Constant.Empty;
|
|
155
166
|
let upgrade = config.lean ? BooleanFlag.False : BooleanFlag.True;
|
|
156
|
-
processCallback(upgrade);
|
|
157
167
|
setCookie(Constant.SessionKey, [data.sessionId, ts, data.pageNum, upgrade, upload].join(Constant.Pipe), Setting.SessionExpire);
|
|
158
168
|
}
|
|
159
169
|
|