clarity-js 0.6.42 → 0.6.43
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.js +515 -500
- package/build/clarity.min.js +1 -1
- package/build/clarity.module.js +515 -500
- package/package.json +1 -1
- package/src/clarity.ts +1 -0
- package/src/core/version.ts +1 -1
- package/src/diagnostic/fraud.ts +7 -1
- package/src/layout/dom.ts +7 -1
- package/src/layout/index.ts +2 -0
- package/types/data.d.ts +8 -1
package/build/clarity.js
CHANGED
|
@@ -12,6 +12,7 @@ var dom = /*#__PURE__*/Object.freeze({
|
|
|
12
12
|
get update () { return update$1; },
|
|
13
13
|
get sameorigin () { return sameorigin; },
|
|
14
14
|
get iframe () { return iframe; },
|
|
15
|
+
get hashText () { return hashText; },
|
|
15
16
|
get getNode () { return getNode; },
|
|
16
17
|
get getValue () { return getValue; },
|
|
17
18
|
get get () { return get; },
|
|
@@ -79,7 +80,7 @@ var envelope$1 = /*#__PURE__*/Object.freeze({
|
|
|
79
80
|
|
|
80
81
|
var config$1 = {
|
|
81
82
|
projectId: null,
|
|
82
|
-
delay: 1 * 1000 /* Second */,
|
|
83
|
+
delay: 1 * 1000 /* Time.Second */,
|
|
83
84
|
lean: false,
|
|
84
85
|
track: true,
|
|
85
86
|
content: true,
|
|
@@ -100,7 +101,7 @@ function api(method) {
|
|
|
100
101
|
// Zone.js, a popular package for Angular, overrides native browser APIs which can lead to inconsistent state for single page applications.
|
|
101
102
|
// Example issue: https://github.com/angular/angular/issues/31712
|
|
102
103
|
// As a work around, we ensuring Clarity access APIs outside of Zone (and use native implementation instead)
|
|
103
|
-
return window["Zone" /* Zone */] && "__symbol__" /* Symbol */ in window["Zone" /* Zone */] ? window["Zone" /* Zone */]["__symbol__" /* Symbol */](method) : method;
|
|
104
|
+
return window["Zone" /* Constant.Zone */] && "__symbol__" /* Constant.Symbol */ in window["Zone" /* Constant.Zone */] ? window["Zone" /* Constant.Zone */]["__symbol__" /* Constant.Symbol */](method) : method;
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
var startTime = 0;
|
|
@@ -116,7 +117,7 @@ function stop$B() {
|
|
|
116
117
|
startTime = 0;
|
|
117
118
|
}
|
|
118
119
|
|
|
119
|
-
var version$1 = "0.6.
|
|
120
|
+
var version$1 = "0.6.43";
|
|
120
121
|
|
|
121
122
|
// tslint:disable: no-bitwise
|
|
122
123
|
function hash (input) {
|
|
@@ -149,7 +150,7 @@ function reset$p() {
|
|
|
149
150
|
// Baseline state holds the previous values - if it is updated in the current payload,
|
|
150
151
|
// reset the state to current value after sending the previous state
|
|
151
152
|
if (update$2) {
|
|
152
|
-
state$9 = { time: time(), event: 4 /* Baseline */, data: {
|
|
153
|
+
state$9 = { time: time(), event: 4 /* Event.Baseline */, data: {
|
|
153
154
|
visible: buffer.visible,
|
|
154
155
|
docWidth: buffer.docWidth,
|
|
155
156
|
docHeight: buffer.docHeight,
|
|
@@ -164,7 +165,7 @@ function reset$p() {
|
|
|
164
165
|
};
|
|
165
166
|
}
|
|
166
167
|
buffer = buffer ? buffer : {
|
|
167
|
-
visible: 1 /* True */,
|
|
168
|
+
visible: 1 /* BooleanFlag.True */,
|
|
168
169
|
docWidth: 0,
|
|
169
170
|
docHeight: 0,
|
|
170
171
|
screenWidth: 0,
|
|
@@ -178,15 +179,15 @@ function reset$p() {
|
|
|
178
179
|
}
|
|
179
180
|
function track$7(event, x, y) {
|
|
180
181
|
switch (event) {
|
|
181
|
-
case 8 /* Document */:
|
|
182
|
+
case 8 /* Event.Document */:
|
|
182
183
|
buffer.docWidth = x;
|
|
183
184
|
buffer.docHeight = y;
|
|
184
185
|
break;
|
|
185
|
-
case 11 /* Resize */:
|
|
186
|
+
case 11 /* Event.Resize */:
|
|
186
187
|
buffer.screenWidth = x;
|
|
187
188
|
buffer.screenHeight = y;
|
|
188
189
|
break;
|
|
189
|
-
case 10 /* Scroll */:
|
|
190
|
+
case 10 /* Event.Scroll */:
|
|
190
191
|
buffer.scrollX = x;
|
|
191
192
|
buffer.scrollY = y;
|
|
192
193
|
break;
|
|
@@ -201,7 +202,7 @@ function activity(t) {
|
|
|
201
202
|
buffer.activityTime = t;
|
|
202
203
|
}
|
|
203
204
|
function visibility(t, visible) {
|
|
204
|
-
buffer.visible = visible === "visible" ? 1 /* True */ : 0 /* False */;
|
|
205
|
+
buffer.visible = visible === "visible" ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
|
|
205
206
|
if (!buffer.visible) {
|
|
206
207
|
activity(t);
|
|
207
208
|
}
|
|
@@ -209,7 +210,7 @@ function visibility(t, visible) {
|
|
|
209
210
|
}
|
|
210
211
|
function compute$c() {
|
|
211
212
|
if (update$2) {
|
|
212
|
-
encode$1(4 /* Baseline */);
|
|
213
|
+
encode$1(4 /* Event.Baseline */);
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
216
|
function stop$A() {
|
|
@@ -233,12 +234,12 @@ function event(key, value) {
|
|
|
233
234
|
if (active() &&
|
|
234
235
|
key &&
|
|
235
236
|
value &&
|
|
236
|
-
typeof key === "string" /* String */ &&
|
|
237
|
-
typeof value === "string" /* String */ &&
|
|
237
|
+
typeof key === "string" /* Constant.String */ &&
|
|
238
|
+
typeof value === "string" /* Constant.String */ &&
|
|
238
239
|
key.length < 255 &&
|
|
239
240
|
value.length < 255) {
|
|
240
241
|
data$j = { key: key, value: value };
|
|
241
|
-
encode$1(24 /* Custom */);
|
|
242
|
+
encode$1(24 /* Event.Custom */);
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
245
|
|
|
@@ -247,7 +248,7 @@ var updates$3 = null;
|
|
|
247
248
|
function start$D() {
|
|
248
249
|
data$i = {};
|
|
249
250
|
updates$3 = {};
|
|
250
|
-
count$1(5 /* InvokeCount */);
|
|
251
|
+
count$1(5 /* Metric.InvokeCount */);
|
|
251
252
|
}
|
|
252
253
|
function stop$z() {
|
|
253
254
|
data$i = {};
|
|
@@ -288,7 +289,7 @@ function max(metric, value) {
|
|
|
288
289
|
}
|
|
289
290
|
}
|
|
290
291
|
function compute$b() {
|
|
291
|
-
encode$1(0 /* Metric */);
|
|
292
|
+
encode$1(0 /* Event.Metric */);
|
|
292
293
|
}
|
|
293
294
|
function reset$o() {
|
|
294
295
|
updates$3 = {};
|
|
@@ -306,7 +307,7 @@ var last = 0;
|
|
|
306
307
|
var interval = 0;
|
|
307
308
|
var timeout$6 = null;
|
|
308
309
|
function start$C() {
|
|
309
|
-
interval = 60000 /* PingInterval */;
|
|
310
|
+
interval = 60000 /* Setting.PingInterval */;
|
|
310
311
|
last = 0;
|
|
311
312
|
}
|
|
312
313
|
function reset$n() {
|
|
@@ -319,8 +320,8 @@ function reset$n() {
|
|
|
319
320
|
function ping() {
|
|
320
321
|
var now = time();
|
|
321
322
|
data$h = { gap: now - last };
|
|
322
|
-
encode$1(25 /* Ping */);
|
|
323
|
-
if (data$h.gap < 300000 /* PingTimeout */) {
|
|
323
|
+
encode$1(25 /* Event.Ping */);
|
|
324
|
+
if (data$h.gap < 300000 /* Setting.PingTimeout */) {
|
|
324
325
|
timeout$6 = setTimeout(ping, interval);
|
|
325
326
|
}
|
|
326
327
|
else {
|
|
@@ -357,7 +358,7 @@ function track$6(event, time) {
|
|
|
357
358
|
var last = e[e.length - 1];
|
|
358
359
|
// Add a new entry only if the new event occurs after configured interval
|
|
359
360
|
// Otherwise, extend the duration of the previous entry
|
|
360
|
-
if (time - last[0] > 100 /* SummaryInterval */) {
|
|
361
|
+
if (time - last[0] > 100 /* Setting.SummaryInterval */) {
|
|
361
362
|
data$g[event].push([time, 0]);
|
|
362
363
|
}
|
|
363
364
|
else {
|
|
@@ -366,7 +367,7 @@ function track$6(event, time) {
|
|
|
366
367
|
}
|
|
367
368
|
}
|
|
368
369
|
function compute$a() {
|
|
369
|
-
encode$1(36 /* Summary */);
|
|
370
|
+
encode$1(36 /* Event.Summary */);
|
|
370
371
|
}
|
|
371
372
|
function reset$m() {
|
|
372
373
|
data$g = {};
|
|
@@ -385,7 +386,7 @@ var summary = /*#__PURE__*/Object.freeze({
|
|
|
385
386
|
var data$f = null;
|
|
386
387
|
function start$A() {
|
|
387
388
|
if (!config$1.lean && config$1.upgrade) {
|
|
388
|
-
config$1.upgrade("Config" /* Config */);
|
|
389
|
+
config$1.upgrade("Config" /* Constant.Config */);
|
|
389
390
|
}
|
|
390
391
|
data$f = null;
|
|
391
392
|
}
|
|
@@ -404,7 +405,7 @@ function upgrade(key) {
|
|
|
404
405
|
if (config$1.upgrade) {
|
|
405
406
|
config$1.upgrade(key);
|
|
406
407
|
}
|
|
407
|
-
encode$1(3 /* Upgrade */);
|
|
408
|
+
encode$1(3 /* Event.Upgrade */);
|
|
408
409
|
}
|
|
409
410
|
}
|
|
410
411
|
function stop$w() {
|
|
@@ -424,25 +425,25 @@ function start$z() {
|
|
|
424
425
|
reset$l();
|
|
425
426
|
}
|
|
426
427
|
function set(variable, value) {
|
|
427
|
-
var values = typeof value === "string" /* String */ ? [value] : value;
|
|
428
|
+
var values = typeof value === "string" /* Constant.String */ ? [value] : value;
|
|
428
429
|
log$2(variable, values);
|
|
429
430
|
}
|
|
430
431
|
function identify(userId, sessionId, pageId) {
|
|
431
432
|
if (sessionId === void 0) { sessionId = null; }
|
|
432
433
|
if (pageId === void 0) { pageId = null; }
|
|
433
|
-
log$2("userId" /* UserId */, [userId]);
|
|
434
|
-
log$2("sessionId" /* SessionId */, [sessionId]);
|
|
435
|
-
log$2("pageId" /* PageId */, [pageId]);
|
|
434
|
+
log$2("userId" /* Constant.UserId */, [userId]);
|
|
435
|
+
log$2("sessionId" /* Constant.SessionId */, [sessionId]);
|
|
436
|
+
log$2("pageId" /* Constant.PageId */, [pageId]);
|
|
436
437
|
}
|
|
437
438
|
function log$2(variable, value) {
|
|
438
439
|
if (active() &&
|
|
439
440
|
variable &&
|
|
440
441
|
value &&
|
|
441
|
-
typeof variable === "string" /* String */ &&
|
|
442
|
+
typeof variable === "string" /* Constant.String */ &&
|
|
442
443
|
variable.length < 255) {
|
|
443
444
|
var validValues = variable in data$e ? data$e[variable] : [];
|
|
444
445
|
for (var i = 0; i < value.length; i++) {
|
|
445
|
-
if (typeof value[i] === "string" /* String */ && value[i].length < 255) {
|
|
446
|
+
if (typeof value[i] === "string" /* Constant.String */ && value[i].length < 255) {
|
|
446
447
|
validValues.push(value[i]);
|
|
447
448
|
}
|
|
448
449
|
}
|
|
@@ -450,7 +451,7 @@ function log$2(variable, value) {
|
|
|
450
451
|
}
|
|
451
452
|
}
|
|
452
453
|
function compute$9() {
|
|
453
|
-
encode$1(34 /* Variable */);
|
|
454
|
+
encode$1(34 /* Event.Variable */);
|
|
454
455
|
}
|
|
455
456
|
function reset$l() {
|
|
456
457
|
data$e = {};
|
|
@@ -470,7 +471,7 @@ var variable = /*#__PURE__*/Object.freeze({
|
|
|
470
471
|
stop: stop$v
|
|
471
472
|
});
|
|
472
473
|
|
|
473
|
-
|
|
474
|
+
/******************************************************************************
|
|
474
475
|
Copyright (c) Microsoft Corporation.
|
|
475
476
|
|
|
476
477
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -523,7 +524,7 @@ function __generator(thisArg, body) {
|
|
|
523
524
|
}
|
|
524
525
|
}
|
|
525
526
|
|
|
526
|
-
var supported$1 = "CompressionStream" /* CompressionStream */ in window;
|
|
527
|
+
var supported$1 = "CompressionStream" /* Constant.CompressionStream */ in window;
|
|
527
528
|
function compress (input) {
|
|
528
529
|
return __awaiter(this, void 0, void 0, function () {
|
|
529
530
|
var stream, _a;
|
|
@@ -540,7 +541,7 @@ function compress (input) {
|
|
|
540
541
|
return [2 /*return*/];
|
|
541
542
|
});
|
|
542
543
|
});
|
|
543
|
-
} }).pipeThrough(new TextEncoderStream()).pipeThrough(new window["CompressionStream" /* CompressionStream */]("gzip"));
|
|
544
|
+
} }).pipeThrough(new TextEncoderStream()).pipeThrough(new window["CompressionStream" /* Constant.CompressionStream */]("gzip"));
|
|
544
545
|
_a = Uint8Array.bind;
|
|
545
546
|
return [4 /*yield*/, read(stream)];
|
|
546
547
|
case 1: return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _c.sent()]))()];
|
|
@@ -614,11 +615,11 @@ function scrub (value, hint, privacy, mangle) {
|
|
|
614
615
|
if (mangle === void 0) { mangle = false; }
|
|
615
616
|
if (value) {
|
|
616
617
|
switch (privacy) {
|
|
617
|
-
case 0 /* None */:
|
|
618
|
+
case 0 /* Privacy.None */:
|
|
618
619
|
return value;
|
|
619
|
-
case 1 /* Sensitive */:
|
|
620
|
+
case 1 /* Privacy.Sensitive */:
|
|
620
621
|
switch (hint) {
|
|
621
|
-
case "*T" /* TextTag */:
|
|
622
|
+
case "*T" /* Layout.Constant.TextTag */:
|
|
622
623
|
case "value":
|
|
623
624
|
case "placeholder":
|
|
624
625
|
case "click":
|
|
@@ -626,16 +627,16 @@ function scrub (value, hint, privacy, mangle) {
|
|
|
626
627
|
return redact(value);
|
|
627
628
|
}
|
|
628
629
|
return value;
|
|
629
|
-
case 2 /* Text */:
|
|
630
|
-
case 3 /* TextImage */:
|
|
630
|
+
case 2 /* Privacy.Text */:
|
|
631
|
+
case 3 /* Privacy.TextImage */:
|
|
631
632
|
switch (hint) {
|
|
632
|
-
case "*T" /* TextTag */:
|
|
633
|
+
case "*T" /* Layout.Constant.TextTag */:
|
|
633
634
|
return mangle ? mangleText(value) : mask(value);
|
|
634
635
|
case "src":
|
|
635
636
|
case "srcset":
|
|
636
637
|
case "title":
|
|
637
638
|
case "alt":
|
|
638
|
-
return privacy === 3 /* TextImage */ ? "" /* Empty */ : value;
|
|
639
|
+
return privacy === 3 /* Privacy.TextImage */ ? "" /* Data.Constant.Empty */ : value;
|
|
639
640
|
case "value":
|
|
640
641
|
case "click":
|
|
641
642
|
case "input":
|
|
@@ -655,18 +656,18 @@ function mangleText(value) {
|
|
|
655
656
|
var index = value.indexOf(first);
|
|
656
657
|
var prefix = value.substr(0, index);
|
|
657
658
|
var suffix = value.substr(index + trimmed.length);
|
|
658
|
-
return ""
|
|
659
|
+
return "".concat(prefix).concat(trimmed.length.toString(36)).concat(suffix);
|
|
659
660
|
}
|
|
660
661
|
return value;
|
|
661
662
|
}
|
|
662
663
|
function mask(value) {
|
|
663
|
-
return value.replace(catchallRegex, "\u2022" /* Mask */);
|
|
664
|
+
return value.replace(catchallRegex, "\u2022" /* Data.Constant.Mask */);
|
|
664
665
|
}
|
|
665
666
|
function mangleToken(value) {
|
|
666
|
-
var length = ((Math.floor(value.length / 5 /* WordLength */) + 1) * 5 /* WordLength */);
|
|
667
|
-
var output = "" /* Empty */;
|
|
667
|
+
var length = ((Math.floor(value.length / 5 /* Data.Setting.WordLength */) + 1) * 5 /* Data.Setting.WordLength */);
|
|
668
|
+
var output = "" /* Layout.Constant.Empty */;
|
|
668
669
|
for (var i = 0; i < length; i++) {
|
|
669
|
-
output += i > 0 && i % 5 /* WordLength */ === 0 ? " " /* Space */ : "\u2022" /* Mask */;
|
|
670
|
+
output += i > 0 && i % 5 /* Data.Setting.WordLength */ === 0 ? " " /* Data.Constant.Space */ : "\u2022" /* Data.Constant.Mask */;
|
|
670
671
|
}
|
|
671
672
|
return output;
|
|
672
673
|
}
|
|
@@ -691,22 +692,22 @@ function redact(value) {
|
|
|
691
692
|
}
|
|
692
693
|
for (var i = 0; i < value.length; i++) {
|
|
693
694
|
var c = value.charCodeAt(i);
|
|
694
|
-
hasDigit = hasDigit || (c >= 48 /* Zero */ && c <= 57 /* Nine */); // Check for digits in the current word
|
|
695
|
-
hasEmail = hasEmail || c === 64 /* At */; // Check for @ sign anywhere within the current word
|
|
696
|
-
hasWhitespace = c === 9 /* Tab */ || c === 10 /* NewLine */ || c === 13 /* Return */ || c === 32 /* Blank */;
|
|
695
|
+
hasDigit = hasDigit || (c >= 48 /* Data.Character.Zero */ && c <= 57 /* Data.Character.Nine */); // Check for digits in the current word
|
|
696
|
+
hasEmail = hasEmail || c === 64 /* Data.Character.At */; // Check for @ sign anywhere within the current word
|
|
697
|
+
hasWhitespace = c === 9 /* Data.Character.Tab */ || c === 10 /* Data.Character.NewLine */ || c === 13 /* Data.Character.Return */ || c === 32 /* Data.Character.Blank */;
|
|
697
698
|
// Process each word as an individual token to redact any sensitive information
|
|
698
699
|
if (i === 0 || i === value.length - 1 || hasWhitespace) {
|
|
699
700
|
// Performance optimization: Lazy load string -> array conversion only when required
|
|
700
701
|
if (hasDigit || hasEmail) {
|
|
701
702
|
if (array === null) {
|
|
702
|
-
array = value.split("" /* Empty */);
|
|
703
|
+
array = value.split("" /* Data.Constant.Empty */);
|
|
703
704
|
}
|
|
704
705
|
// Work on a token at a time so we don't have to apply regex to a larger string
|
|
705
706
|
var token = value.substring(spaceIndex + 1, hasWhitespace ? i : i + 1);
|
|
706
707
|
// Check if unicode regex is supported, otherwise fallback to calling mask function on this token
|
|
707
708
|
if (unicodeRegex && currencyRegex !== null) {
|
|
708
709
|
// Do not redact information if the token contains a currency symbol
|
|
709
|
-
token = token.match(currencyRegex) ? token : token.replace(letterRegex, "\u25AA" /* Letter */).replace(digitRegex, "\u25AB" /* Digit */);
|
|
710
|
+
token = token.match(currencyRegex) ? token : token.replace(letterRegex, "\u25AA" /* Data.Constant.Letter */).replace(digitRegex, "\u25AB" /* Data.Constant.Digit */);
|
|
710
711
|
}
|
|
711
712
|
else {
|
|
712
713
|
token = mask(token);
|
|
@@ -723,28 +724,34 @@ function redact(value) {
|
|
|
723
724
|
}
|
|
724
725
|
}
|
|
725
726
|
}
|
|
726
|
-
return array ? array.join("" /* Empty */) : value;
|
|
727
|
+
return array ? array.join("" /* Data.Constant.Empty */) : value;
|
|
727
728
|
}
|
|
728
729
|
|
|
729
730
|
var history$5 = [];
|
|
730
731
|
var data$d;
|
|
731
732
|
function start$x() {
|
|
732
733
|
history$5 = [];
|
|
733
|
-
max(26 /* Automation */, navigator.webdriver ? 1 /* True */ : 0 /* False */);
|
|
734
|
+
max(26 /* Metric.Automation */, navigator.webdriver ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
|
|
735
|
+
try {
|
|
736
|
+
max(31 /* Metric.Iframed */, window.top == window.self ? 1 /* IframeStatus.TopFrame */ : 2 /* IframeStatus.Iframe */);
|
|
737
|
+
}
|
|
738
|
+
catch (ex) {
|
|
739
|
+
max(31 /* Metric.Iframed */, 0 /* IframeStatus.Unknown */);
|
|
740
|
+
}
|
|
734
741
|
}
|
|
735
742
|
function check$4(id, target, input) {
|
|
736
743
|
// Compute hash for fraud detection. Hash is computed only if input meets the minimum length criteria
|
|
737
|
-
if (id !== null && input && input.length >= 5 /* WordLength */) {
|
|
744
|
+
if (id !== null && input && input.length >= 5 /* Setting.WordLength */) {
|
|
738
745
|
data$d = { id: id, target: target, hash: hash(input) };
|
|
739
746
|
// Only encode this event if we haven't already reported this hash
|
|
740
747
|
if (history$5.indexOf(data$d.hash) < 0) {
|
|
741
748
|
history$5.push(data$d.hash);
|
|
742
|
-
encode$2(41 /* Fraud */);
|
|
749
|
+
encode$2(41 /* Event.Fraud */);
|
|
743
750
|
}
|
|
744
751
|
}
|
|
745
752
|
}
|
|
746
753
|
|
|
747
|
-
var excludeClassNames = "load,active,fixed,visible,focus,show,collaps,animat" /* ExcludeClassNames */.split("," /* Comma */);
|
|
754
|
+
var excludeClassNames = "load,active,fixed,visible,focus,show,collaps,animat" /* Constant.ExcludeClassNames */.split("," /* Constant.Comma */);
|
|
748
755
|
var selectorMap = {};
|
|
749
756
|
function reset$k() {
|
|
750
757
|
selectorMap = {};
|
|
@@ -752,68 +759,68 @@ function reset$k() {
|
|
|
752
759
|
function get$1(input, type) {
|
|
753
760
|
var a = input.attributes;
|
|
754
761
|
var prefix = input.prefix ? input.prefix[type] : null;
|
|
755
|
-
var suffix = type === 0 /* Alpha */ ? ""
|
|
762
|
+
var suffix = type === 0 /* Selector.Alpha */ ? "".concat("~" /* Constant.Tilde */).concat(input.position - 1) : ":nth-of-type(".concat(input.position, ")");
|
|
756
763
|
switch (input.tag) {
|
|
757
764
|
case "STYLE":
|
|
758
765
|
case "TITLE":
|
|
759
766
|
case "LINK":
|
|
760
767
|
case "META":
|
|
761
|
-
case "*T" /* TextTag */:
|
|
762
|
-
case "*D" /* DocumentTag */:
|
|
763
|
-
return "" /* Empty */;
|
|
768
|
+
case "*T" /* Constant.TextTag */:
|
|
769
|
+
case "*D" /* Constant.DocumentTag */:
|
|
770
|
+
return "" /* Constant.Empty */;
|
|
764
771
|
case "HTML":
|
|
765
|
-
return "HTML" /* HTML */;
|
|
772
|
+
return "HTML" /* Constant.HTML */;
|
|
766
773
|
default:
|
|
767
774
|
if (prefix === null) {
|
|
768
|
-
return "" /* Empty */;
|
|
775
|
+
return "" /* Constant.Empty */;
|
|
769
776
|
}
|
|
770
|
-
prefix = ""
|
|
771
|
-
input.tag = input.tag.indexOf("svg:" /* SvgPrefix */) === 0 ? input.tag.substr("svg:" /* SvgPrefix */.length) : input.tag;
|
|
772
|
-
var selector = ""
|
|
773
|
-
var id = "id" /* Id */ in a && a["id" /* Id */].length > 0 ? a["id" /* Id */] : null;
|
|
774
|
-
var classes = input.tag !== "BODY" /* BodyTag */ && "class" /* Class */ in a && a["class" /* Class */].length > 0 ? a["class" /* Class */].trim().split(/\s+/).filter(function (c) { return filter(c); }).join("." /* Period */) : null;
|
|
777
|
+
prefix = "".concat(prefix).concat(">" /* Constant.Separator */);
|
|
778
|
+
input.tag = input.tag.indexOf("svg:" /* Constant.SvgPrefix */) === 0 ? input.tag.substr("svg:" /* Constant.SvgPrefix */.length) : input.tag;
|
|
779
|
+
var selector = "".concat(prefix).concat(input.tag).concat(suffix);
|
|
780
|
+
var id = "id" /* Constant.Id */ in a && a["id" /* Constant.Id */].length > 0 ? a["id" /* Constant.Id */] : null;
|
|
781
|
+
var classes = input.tag !== "BODY" /* Constant.BodyTag */ && "class" /* Constant.Class */ in a && a["class" /* Constant.Class */].length > 0 ? a["class" /* Constant.Class */].trim().split(/\s+/).filter(function (c) { return filter(c); }).join("." /* Constant.Period */) : null;
|
|
775
782
|
if (classes && classes.length > 0) {
|
|
776
|
-
if (type === 0 /* Alpha */) {
|
|
783
|
+
if (type === 0 /* Selector.Alpha */) {
|
|
777
784
|
// In Alpha mode, update selector to use class names, with relative positioning within the parent id container.
|
|
778
785
|
// If the node has valid class name(s) then drop relative positioning within the parent path to keep things simple.
|
|
779
|
-
var key = ""
|
|
786
|
+
var key = "".concat(getDomPath(prefix)).concat(input.tag).concat("." /* Constant.Dot */).concat(classes);
|
|
780
787
|
if (!(key in selectorMap)) {
|
|
781
788
|
selectorMap[key] = [];
|
|
782
789
|
}
|
|
783
790
|
if (selectorMap[key].indexOf(input.id) < 0) {
|
|
784
791
|
selectorMap[key].push(input.id);
|
|
785
792
|
}
|
|
786
|
-
selector = ""
|
|
793
|
+
selector = "".concat(key).concat("~" /* Constant.Tilde */).concat(selectorMap[key].indexOf(input.id));
|
|
787
794
|
}
|
|
788
795
|
else {
|
|
789
796
|
// In Beta mode, we continue to look at query selectors in context of the full page
|
|
790
|
-
selector = ""
|
|
797
|
+
selector = "".concat(prefix).concat(input.tag, ".").concat(classes).concat(suffix);
|
|
791
798
|
}
|
|
792
799
|
}
|
|
793
800
|
// Update selector to use "id" field when available. There are two exceptions:
|
|
794
801
|
// (1) if "id" appears to be an auto generated string token, e.g. guid or a random id containing digits
|
|
795
802
|
// (2) if "id" appears inside a shadow DOM, in which case we continue to prefix up to shadow DOM to prevent conflicts
|
|
796
|
-
selector = id && filter(id) ? ""
|
|
803
|
+
selector = id && filter(id) ? "".concat(getDomPrefix(prefix)).concat("#" /* Constant.Hash */).concat(id) : selector;
|
|
797
804
|
return selector;
|
|
798
805
|
}
|
|
799
806
|
}
|
|
800
807
|
function getDomPrefix(prefix) {
|
|
801
|
-
var shadowDomStart = prefix.lastIndexOf("*S" /* ShadowDomTag */);
|
|
802
|
-
var iframeDomStart = prefix.lastIndexOf(""
|
|
808
|
+
var shadowDomStart = prefix.lastIndexOf("*S" /* Constant.ShadowDomTag */);
|
|
809
|
+
var iframeDomStart = prefix.lastIndexOf("".concat("iframe:" /* Constant.IFramePrefix */).concat("HTML" /* Constant.HTML */));
|
|
803
810
|
var domStart = Math.max(shadowDomStart, iframeDomStart);
|
|
804
811
|
if (domStart < 0) {
|
|
805
|
-
return "" /* Empty */;
|
|
812
|
+
return "" /* Constant.Empty */;
|
|
806
813
|
}
|
|
807
|
-
return prefix.substring(0, prefix.indexOf(">" /* Separator */, domStart) + 1);
|
|
814
|
+
return prefix.substring(0, prefix.indexOf(">" /* Constant.Separator */, domStart) + 1);
|
|
808
815
|
}
|
|
809
816
|
function getDomPath(input) {
|
|
810
|
-
var parts = input.split(">" /* Separator */);
|
|
817
|
+
var parts = input.split(">" /* Constant.Separator */);
|
|
811
818
|
for (var i = 0; i < parts.length; i++) {
|
|
812
|
-
var tIndex = parts[i].indexOf("~" /* Tilde */);
|
|
813
|
-
var dIndex = parts[i].indexOf("." /* Dot */);
|
|
819
|
+
var tIndex = parts[i].indexOf("~" /* Constant.Tilde */);
|
|
820
|
+
var dIndex = parts[i].indexOf("." /* Constant.Dot */);
|
|
814
821
|
parts[i] = parts[i].substring(0, dIndex > 0 ? dIndex : (tIndex > 0 ? tIndex : parts[i].length));
|
|
815
822
|
}
|
|
816
|
-
return parts.join(">" /* Separator */);
|
|
823
|
+
return parts.join(">" /* Constant.Separator */);
|
|
817
824
|
}
|
|
818
825
|
// Check if the given input string has digits or excluded class names
|
|
819
826
|
function filter(value) {
|
|
@@ -825,7 +832,7 @@ function filter(value) {
|
|
|
825
832
|
}
|
|
826
833
|
for (var i = 0; i < value.length; i++) {
|
|
827
834
|
var c = value.charCodeAt(i);
|
|
828
|
-
if (c >= 48 /* Zero */ && c <= 57 /* Nine */) {
|
|
835
|
+
if (c >= 48 /* Character.Zero */ && c <= 57 /* Character.Nine */) {
|
|
829
836
|
return false;
|
|
830
837
|
}
|
|
831
838
|
}
|
|
@@ -868,7 +875,7 @@ function reset$j() {
|
|
|
868
875
|
pauseTask = null;
|
|
869
876
|
}
|
|
870
877
|
function schedule$1(task, priority) {
|
|
871
|
-
if (priority === void 0) { priority = 0 /* Normal */; }
|
|
878
|
+
if (priority === void 0) { priority = 0 /* Priority.Normal */; }
|
|
872
879
|
return __awaiter(this, void 0, void 0, function () {
|
|
873
880
|
var _i, queuedTasks_1, q, promise;
|
|
874
881
|
return __generator(this, function (_a) {
|
|
@@ -880,7 +887,7 @@ function schedule$1(task, priority) {
|
|
|
880
887
|
}
|
|
881
888
|
}
|
|
882
889
|
promise = new Promise(function (resolve) {
|
|
883
|
-
var insert = priority === 1 /* High */ ? "unshift" : "push";
|
|
890
|
+
var insert = priority === 1 /* Priority.High */ ? "unshift" : "push";
|
|
884
891
|
// Queue this task for asynchronous execution later
|
|
885
892
|
// We also store a unique page identifier (id) along with the task to ensure
|
|
886
893
|
// ensure that we do not accidentally execute this task in context of a different page
|
|
@@ -915,7 +922,7 @@ function run() {
|
|
|
915
922
|
return;
|
|
916
923
|
}
|
|
917
924
|
if (error) {
|
|
918
|
-
log$1(0 /* RunTask */, 1 /* Warning */, error.name, error.message, error.stack);
|
|
925
|
+
log$1(0 /* Code.RunTask */, 1 /* Severity.Warning */, error.name, error.message, error.stack);
|
|
919
926
|
}
|
|
920
927
|
activeTask = null;
|
|
921
928
|
run();
|
|
@@ -926,13 +933,13 @@ function state$8(timer) {
|
|
|
926
933
|
var id = key(timer);
|
|
927
934
|
if (id in tracker) {
|
|
928
935
|
var elapsed = performance.now() - tracker[id].start;
|
|
929
|
-
return (elapsed > tracker[id].yield) ? 0 /* Wait */ : 1 /* Run */;
|
|
936
|
+
return (elapsed > tracker[id].yield) ? 0 /* Task.Wait */ : 1 /* Task.Run */;
|
|
930
937
|
}
|
|
931
938
|
// If this task is no longer being tracked, send stop message to the caller
|
|
932
|
-
return 2 /* Stop */;
|
|
939
|
+
return 2 /* Task.Stop */;
|
|
933
940
|
}
|
|
934
941
|
function start$w(timer) {
|
|
935
|
-
tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* LongTask */ };
|
|
942
|
+
tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* Setting.LongTask */ };
|
|
936
943
|
}
|
|
937
944
|
function restart$2(timer) {
|
|
938
945
|
var id = key(timer);
|
|
@@ -949,11 +956,11 @@ function stop$t(timer) {
|
|
|
949
956
|
var id = key(timer);
|
|
950
957
|
var duration = end - tracker[id].start;
|
|
951
958
|
sum(timer.cost, duration);
|
|
952
|
-
count$1(5 /* InvokeCount */);
|
|
959
|
+
count$1(5 /* Metric.InvokeCount */);
|
|
953
960
|
// For the first execution, which is synchronous, time is automatically counted towards TotalDuration.
|
|
954
961
|
// However, for subsequent asynchronous runs, we need to manually update TotalDuration metric.
|
|
955
962
|
if (tracker[id].calls > 0) {
|
|
956
|
-
sum(4 /* TotalCost */, duration);
|
|
963
|
+
sum(4 /* Metric.TotalCost */, duration);
|
|
957
964
|
}
|
|
958
965
|
}
|
|
959
966
|
function suspend$1(timer) {
|
|
@@ -974,13 +981,13 @@ function suspend$1(timer) {
|
|
|
974
981
|
case 2:
|
|
975
982
|
// After we are done with suspending task, ensure that we are still operating in the right context
|
|
976
983
|
// If the task is still being tracked, continue running the task, otherwise ask caller to stop execution
|
|
977
|
-
return [2 /*return*/, id in tracker ? 1 /* Run */ : 2 /* Stop */];
|
|
984
|
+
return [2 /*return*/, id in tracker ? 1 /* Task.Run */ : 2 /* Task.Stop */];
|
|
978
985
|
}
|
|
979
986
|
});
|
|
980
987
|
});
|
|
981
988
|
}
|
|
982
989
|
function key(timer) {
|
|
983
|
-
return timer.id
|
|
990
|
+
return "".concat(timer.id, ".").concat(timer.cost);
|
|
984
991
|
}
|
|
985
992
|
function wait() {
|
|
986
993
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -1018,14 +1025,14 @@ function requestIdleCallbackPolyfill(callback, options) {
|
|
|
1018
1025
|
var currentTime = performance.now();
|
|
1019
1026
|
var elapsed = currentTime - startTime;
|
|
1020
1027
|
var duration = currentTime - event.data;
|
|
1021
|
-
if (duration > 30 /* LongTask */ && elapsed < options.timeout) {
|
|
1028
|
+
if (duration > 30 /* Setting.LongTask */ && elapsed < options.timeout) {
|
|
1022
1029
|
requestAnimationFrame(function () { outgoing.postMessage(currentTime); });
|
|
1023
1030
|
}
|
|
1024
1031
|
else {
|
|
1025
1032
|
var didTimeout_1 = elapsed > options.timeout;
|
|
1026
1033
|
callback({
|
|
1027
1034
|
didTimeout: didTimeout_1,
|
|
1028
|
-
timeRemaining: function () { return didTimeout_1 ? 30 /* LongTask */ : Math.max(0, 30 /* LongTask */ - duration); }
|
|
1035
|
+
timeRemaining: function () { return didTimeout_1 ? 30 /* Setting.LongTask */ : Math.max(0, 30 /* Setting.LongTask */ - duration); }
|
|
1029
1036
|
});
|
|
1030
1037
|
}
|
|
1031
1038
|
};
|
|
@@ -1046,7 +1053,7 @@ function tokenize (tokens) {
|
|
|
1046
1053
|
var reference = null;
|
|
1047
1054
|
for (var i = 0; i < tokens.length; i++) {
|
|
1048
1055
|
// Only optimize for string values
|
|
1049
|
-
if (typeof tokens[i] === "string" /* String */) {
|
|
1056
|
+
if (typeof tokens[i] === "string" /* Constant.String */) {
|
|
1050
1057
|
var token = tokens[i];
|
|
1051
1058
|
var index = lookup[token] || -1;
|
|
1052
1059
|
if (index >= 0) {
|
|
@@ -1088,10 +1095,10 @@ function encode$4 (type, timer, ts) {
|
|
|
1088
1095
|
tokens = [eventTime, type];
|
|
1089
1096
|
_a = type;
|
|
1090
1097
|
switch (_a) {
|
|
1091
|
-
case 8 /* Document */: return [3 /*break*/, 1];
|
|
1092
|
-
case 7 /* Region */: return [3 /*break*/, 2];
|
|
1093
|
-
case 5 /* Discover */: return [3 /*break*/, 3];
|
|
1094
|
-
case 6 /* Mutation */: return [3 /*break*/, 3];
|
|
1098
|
+
case 8 /* Event.Document */: return [3 /*break*/, 1];
|
|
1099
|
+
case 7 /* Event.Region */: return [3 /*break*/, 2];
|
|
1100
|
+
case 5 /* Event.Discover */: return [3 /*break*/, 3];
|
|
1101
|
+
case 6 /* Event.Mutation */: return [3 /*break*/, 3];
|
|
1095
1102
|
}
|
|
1096
1103
|
return [3 /*break*/, 10];
|
|
1097
1104
|
case 1:
|
|
@@ -1104,7 +1111,7 @@ function encode$4 (type, timer, ts) {
|
|
|
1104
1111
|
case 2:
|
|
1105
1112
|
for (_i = 0, _b = state$1; _i < _b.length; _i++) {
|
|
1106
1113
|
r = _b[_i];
|
|
1107
|
-
tokens = [r.time, 7 /* Region */];
|
|
1114
|
+
tokens = [r.time, 7 /* Event.Region */];
|
|
1108
1115
|
tokens.push(r.data.id);
|
|
1109
1116
|
tokens.push(r.data.interaction);
|
|
1110
1117
|
tokens.push(r.data.visibility);
|
|
@@ -1115,7 +1122,7 @@ function encode$4 (type, timer, ts) {
|
|
|
1115
1122
|
return [3 /*break*/, 10];
|
|
1116
1123
|
case 3:
|
|
1117
1124
|
// Check if we are operating within the context of the current page
|
|
1118
|
-
if (state$8(timer) === 2 /* Stop */) {
|
|
1125
|
+
if (state$8(timer) === 2 /* Task.Stop */) {
|
|
1119
1126
|
return [3 /*break*/, 10];
|
|
1120
1127
|
}
|
|
1121
1128
|
values = updates$2();
|
|
@@ -1126,13 +1133,13 @@ function encode$4 (type, timer, ts) {
|
|
|
1126
1133
|
if (!(_c < values_1.length)) return [3 /*break*/, 8];
|
|
1127
1134
|
value = values_1[_c];
|
|
1128
1135
|
state = state$8(timer);
|
|
1129
|
-
if (!(state === 0 /* Wait */)) return [3 /*break*/, 6];
|
|
1136
|
+
if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 6];
|
|
1130
1137
|
return [4 /*yield*/, suspend$1(timer)];
|
|
1131
1138
|
case 5:
|
|
1132
1139
|
state = _e.sent();
|
|
1133
1140
|
_e.label = 6;
|
|
1134
1141
|
case 6:
|
|
1135
|
-
if (state === 2 /* Stop */) {
|
|
1142
|
+
if (state === 2 /* Task.Stop */) {
|
|
1136
1143
|
return [3 /*break*/, 8];
|
|
1137
1144
|
}
|
|
1138
1145
|
data = value.data;
|
|
@@ -1155,9 +1162,9 @@ function encode$4 (type, timer, ts) {
|
|
|
1155
1162
|
if (value.previous && active) {
|
|
1156
1163
|
tokens.push(value.previous);
|
|
1157
1164
|
}
|
|
1158
|
-
tokens.push(suspend ? "*M" /* SuspendMutationTag */ : data[key]);
|
|
1165
|
+
tokens.push(suspend ? "*M" /* Constant.SuspendMutationTag */ : data[key]);
|
|
1159
1166
|
if (box && box.length === 2) {
|
|
1160
|
-
tokens.push(""
|
|
1167
|
+
tokens.push("".concat("#" /* Constant.Hash */).concat(str$1(box[0]), ".").concat(str$1(box[1])));
|
|
1161
1168
|
}
|
|
1162
1169
|
break;
|
|
1163
1170
|
case "attributes":
|
|
@@ -1179,7 +1186,7 @@ function encode$4 (type, timer, ts) {
|
|
|
1179
1186
|
_c++;
|
|
1180
1187
|
return [3 /*break*/, 4];
|
|
1181
1188
|
case 8:
|
|
1182
|
-
if (type === 6 /* Mutation */) {
|
|
1189
|
+
if (type === 6 /* Event.Mutation */) {
|
|
1183
1190
|
activity(eventTime);
|
|
1184
1191
|
}
|
|
1185
1192
|
queue(tokenize(tokens), !config$1.lean);
|
|
@@ -1192,13 +1199,13 @@ function encode$4 (type, timer, ts) {
|
|
|
1192
1199
|
}
|
|
1193
1200
|
function shouldMangle(value) {
|
|
1194
1201
|
var privacy = value.metadata.privacy;
|
|
1195
|
-
return value.data.tag === "*T" /* TextTag */ && !(privacy === 0 /* None */ || privacy === 1 /* Sensitive */);
|
|
1202
|
+
return value.data.tag === "*T" /* Constant.TextTag */ && !(privacy === 0 /* Privacy.None */ || privacy === 1 /* Privacy.Sensitive */);
|
|
1196
1203
|
}
|
|
1197
1204
|
function size$1(value) {
|
|
1198
1205
|
if (value.metadata.size !== null && value.metadata.size.length === 0) {
|
|
1199
1206
|
var img = getNode(value.id);
|
|
1200
1207
|
if (img) {
|
|
1201
|
-
return [Math.floor(img.offsetWidth * 100 /* BoxPrecision */), Math.floor(img.offsetHeight * 100 /* BoxPrecision */)];
|
|
1208
|
+
return [Math.floor(img.offsetWidth * 100 /* Setting.BoxPrecision */), Math.floor(img.offsetHeight * 100 /* Setting.BoxPrecision */)];
|
|
1202
1209
|
}
|
|
1203
1210
|
}
|
|
1204
1211
|
return value.metadata.size;
|
|
@@ -1207,7 +1214,7 @@ function str$1(input) {
|
|
|
1207
1214
|
return input.toString(36);
|
|
1208
1215
|
}
|
|
1209
1216
|
function attribute(key, value, privacy) {
|
|
1210
|
-
return key
|
|
1217
|
+
return "".concat(key, "=").concat(scrub(value, key, privacy));
|
|
1211
1218
|
}
|
|
1212
1219
|
|
|
1213
1220
|
var data$c;
|
|
@@ -1238,7 +1245,7 @@ function compute$7() {
|
|
|
1238
1245
|
// Check that width or height has changed from before, and also that width & height are not null values
|
|
1239
1246
|
if ((data$c === null || width !== data$c.width || height !== data$c.height) && width !== null && height !== null) {
|
|
1240
1247
|
data$c = { width: width, height: height };
|
|
1241
|
-
encode$4(8 /* Document */);
|
|
1248
|
+
encode$4(8 /* Event.Document */);
|
|
1242
1249
|
}
|
|
1243
1250
|
}
|
|
1244
1251
|
function end() {
|
|
@@ -1267,7 +1274,7 @@ function start$u() {
|
|
|
1267
1274
|
reset$h();
|
|
1268
1275
|
}
|
|
1269
1276
|
function observe$b(root) {
|
|
1270
|
-
bind(root, "click", handler$3.bind(this, 9 /* Click */, root), true);
|
|
1277
|
+
bind(root, "click", handler$3.bind(this, 9 /* Event.Click */, root), true);
|
|
1271
1278
|
}
|
|
1272
1279
|
function handler$3(event, root, evt) {
|
|
1273
1280
|
var frame = iframe(root);
|
|
@@ -1293,13 +1300,14 @@ function handler$3(event, root, evt) {
|
|
|
1293
1300
|
x = Math.round(l.x + (l.w / 2));
|
|
1294
1301
|
y = Math.round(l.y + (l.h / 2));
|
|
1295
1302
|
}
|
|
1296
|
-
var eX = l ? Math.max(Math.floor(((x - l.x) / l.w) * 32767 /* ClickPrecision */), 0) : 0;
|
|
1297
|
-
var eY = l ? Math.max(Math.floor(((y - l.y) / l.h) * 32767 /* ClickPrecision */), 0) : 0;
|
|
1303
|
+
var eX = l ? Math.max(Math.floor(((x - l.x) / l.w) * 32767 /* Setting.ClickPrecision */), 0) : 0;
|
|
1304
|
+
var eY = l ? Math.max(Math.floor(((y - l.y) / l.h) * 32767 /* Setting.ClickPrecision */), 0) : 0;
|
|
1298
1305
|
// Check for null values before processing this event
|
|
1299
1306
|
if (x !== null && y !== null) {
|
|
1300
1307
|
state$7.push({
|
|
1301
1308
|
time: time(),
|
|
1302
|
-
event: event,
|
|
1309
|
+
event: event,
|
|
1310
|
+
data: {
|
|
1303
1311
|
target: t,
|
|
1304
1312
|
x: x,
|
|
1305
1313
|
y: y,
|
|
@@ -1311,7 +1319,7 @@ function handler$3(event, root, evt) {
|
|
|
1311
1319
|
text: text(t),
|
|
1312
1320
|
link: a ? a.href : null,
|
|
1313
1321
|
hash: null,
|
|
1314
|
-
trust: evt.isTrusted ? 1 /* True */ : 0 /* False */
|
|
1322
|
+
trust: evt.isTrusted ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */
|
|
1315
1323
|
}
|
|
1316
1324
|
});
|
|
1317
1325
|
schedule$1(encode$3.bind(this, event));
|
|
@@ -1326,7 +1334,7 @@ function text(element) {
|
|
|
1326
1334
|
// Trim any spaces at the beginning or at the end of string
|
|
1327
1335
|
// Also, replace multiple occurrence of space characters with a single white space
|
|
1328
1336
|
// Finally, send only first few characters as specified by the Setting
|
|
1329
|
-
output = t.trim().replace(/\s+/g, " " /* Space */).substr(0, 25 /* ClickText */);
|
|
1337
|
+
output = t.trim().replace(/\s+/g, " " /* Constant.Space */).substr(0, 25 /* Setting.ClickText */);
|
|
1330
1338
|
}
|
|
1331
1339
|
}
|
|
1332
1340
|
return output;
|
|
@@ -1335,10 +1343,10 @@ function reaction(element) {
|
|
|
1335
1343
|
if (element.nodeType === Node.ELEMENT_NODE) {
|
|
1336
1344
|
var tag = element.tagName.toLowerCase();
|
|
1337
1345
|
if (UserInputTags.indexOf(tag) >= 0) {
|
|
1338
|
-
return 0 /* False */;
|
|
1346
|
+
return 0 /* BooleanFlag.False */;
|
|
1339
1347
|
}
|
|
1340
1348
|
}
|
|
1341
|
-
return 1 /* True */;
|
|
1349
|
+
return 1 /* BooleanFlag.True */;
|
|
1342
1350
|
}
|
|
1343
1351
|
function layout$1(element) {
|
|
1344
1352
|
var box = null;
|
|
@@ -1362,14 +1370,14 @@ function layout$1(element) {
|
|
|
1362
1370
|
return box;
|
|
1363
1371
|
}
|
|
1364
1372
|
function context(a) {
|
|
1365
|
-
if (a && a.hasAttribute("target" /* Target */)) {
|
|
1366
|
-
switch (a.getAttribute("target" /* Target */)) {
|
|
1367
|
-
case "_blank" /* Blank */: return 1 /* Blank */;
|
|
1368
|
-
case "_parent" /* Parent */: return 2 /* Parent */;
|
|
1369
|
-
case "_top" /* Top */: return 3 /* Top */;
|
|
1373
|
+
if (a && a.hasAttribute("target" /* Constant.Target */)) {
|
|
1374
|
+
switch (a.getAttribute("target" /* Constant.Target */)) {
|
|
1375
|
+
case "_blank" /* Constant.Blank */: return 1 /* BrowsingContext.Blank */;
|
|
1376
|
+
case "_parent" /* Constant.Parent */: return 2 /* BrowsingContext.Parent */;
|
|
1377
|
+
case "_top" /* Constant.Top */: return 3 /* BrowsingContext.Top */;
|
|
1370
1378
|
}
|
|
1371
1379
|
}
|
|
1372
|
-
return 0 /* Self */;
|
|
1380
|
+
return 0 /* BrowsingContext.Self */;
|
|
1373
1381
|
}
|
|
1374
1382
|
function reset$h() {
|
|
1375
1383
|
state$7 = [];
|
|
@@ -1383,13 +1391,13 @@ function start$t() {
|
|
|
1383
1391
|
reset$g();
|
|
1384
1392
|
}
|
|
1385
1393
|
function observe$a(root) {
|
|
1386
|
-
bind(root, "cut", recompute$7.bind(this, 0 /* Cut */), true);
|
|
1387
|
-
bind(root, "copy", recompute$7.bind(this, 1 /* Copy */), true);
|
|
1388
|
-
bind(root, "paste", recompute$7.bind(this, 2 /* Paste */), true);
|
|
1394
|
+
bind(root, "cut", recompute$7.bind(this, 0 /* Clipboard.Cut */), true);
|
|
1395
|
+
bind(root, "copy", recompute$7.bind(this, 1 /* Clipboard.Copy */), true);
|
|
1396
|
+
bind(root, "paste", recompute$7.bind(this, 2 /* Clipboard.Paste */), true);
|
|
1389
1397
|
}
|
|
1390
1398
|
function recompute$7(action, evt) {
|
|
1391
|
-
state$6.push({ time: time(), event: 38 /* Clipboard */, data: { target: target(evt), action: action } });
|
|
1392
|
-
schedule$1(encode$3.bind(this, 38 /* Clipboard */));
|
|
1399
|
+
state$6.push({ time: time(), event: 38 /* Event.Clipboard */, data: { target: target(evt), action: action } });
|
|
1400
|
+
schedule$1(encode$3.bind(this, 38 /* Event.Clipboard */));
|
|
1393
1401
|
}
|
|
1394
1402
|
function reset$g() {
|
|
1395
1403
|
state$6 = [];
|
|
@@ -1422,9 +1430,9 @@ function recompute$6(evt) {
|
|
|
1422
1430
|
if (state$5.length > 0 && (state$5[state$5.length - 1].data.target === data.target)) {
|
|
1423
1431
|
state$5.pop();
|
|
1424
1432
|
}
|
|
1425
|
-
state$5.push({ time: time(), event: 27 /* Input */, data: data });
|
|
1433
|
+
state$5.push({ time: time(), event: 27 /* Event.Input */, data: data });
|
|
1426
1434
|
clearTimeout(timeout$5);
|
|
1427
|
-
timeout$5 = setTimeout(process$6, 500 /* LookAhead */, 27 /* Input */);
|
|
1435
|
+
timeout$5 = setTimeout(process$6, 500 /* Setting.LookAhead */, 27 /* Event.Input */);
|
|
1428
1436
|
}
|
|
1429
1437
|
}
|
|
1430
1438
|
function process$6(event) {
|
|
@@ -1444,15 +1452,15 @@ function start$r() {
|
|
|
1444
1452
|
reset$e();
|
|
1445
1453
|
}
|
|
1446
1454
|
function observe$8(root) {
|
|
1447
|
-
bind(root, "mousedown", mouse.bind(this, 13 /* MouseDown */, root), true);
|
|
1448
|
-
bind(root, "mouseup", mouse.bind(this, 14 /* MouseUp */, root), true);
|
|
1449
|
-
bind(root, "mousemove", mouse.bind(this, 12 /* MouseMove */, root), true);
|
|
1450
|
-
bind(root, "wheel", mouse.bind(this, 15 /* MouseWheel */, root), true);
|
|
1451
|
-
bind(root, "dblclick", mouse.bind(this, 16 /* DoubleClick */, root), true);
|
|
1452
|
-
bind(root, "touchstart", touch.bind(this, 17 /* TouchStart */, root), true);
|
|
1453
|
-
bind(root, "touchend", touch.bind(this, 18 /* TouchEnd */, root), true);
|
|
1454
|
-
bind(root, "touchmove", touch.bind(this, 19 /* TouchMove */, root), true);
|
|
1455
|
-
bind(root, "touchcancel", touch.bind(this, 20 /* TouchCancel */, root), true);
|
|
1455
|
+
bind(root, "mousedown", mouse.bind(this, 13 /* Event.MouseDown */, root), true);
|
|
1456
|
+
bind(root, "mouseup", mouse.bind(this, 14 /* Event.MouseUp */, root), true);
|
|
1457
|
+
bind(root, "mousemove", mouse.bind(this, 12 /* Event.MouseMove */, root), true);
|
|
1458
|
+
bind(root, "wheel", mouse.bind(this, 15 /* Event.MouseWheel */, root), true);
|
|
1459
|
+
bind(root, "dblclick", mouse.bind(this, 16 /* Event.DoubleClick */, root), true);
|
|
1460
|
+
bind(root, "touchstart", touch.bind(this, 17 /* Event.TouchStart */, root), true);
|
|
1461
|
+
bind(root, "touchend", touch.bind(this, 18 /* Event.TouchEnd */, root), true);
|
|
1462
|
+
bind(root, "touchmove", touch.bind(this, 19 /* Event.TouchMove */, root), true);
|
|
1463
|
+
bind(root, "touchcancel", touch.bind(this, 20 /* Event.TouchCancel */, root), true);
|
|
1456
1464
|
}
|
|
1457
1465
|
function mouse(event, root, evt) {
|
|
1458
1466
|
var frame = iframe(root);
|
|
@@ -1491,9 +1499,9 @@ function touch(event, root, evt) {
|
|
|
1491
1499
|
}
|
|
1492
1500
|
function handler$2(current) {
|
|
1493
1501
|
switch (current.event) {
|
|
1494
|
-
case 12 /* MouseMove */:
|
|
1495
|
-
case 15 /* MouseWheel */:
|
|
1496
|
-
case 19 /* TouchMove */:
|
|
1502
|
+
case 12 /* Event.MouseMove */:
|
|
1503
|
+
case 15 /* Event.MouseWheel */:
|
|
1504
|
+
case 19 /* Event.TouchMove */:
|
|
1497
1505
|
var length_1 = state$4.length;
|
|
1498
1506
|
var last = length_1 > 1 ? state$4[length_1 - 2] : null;
|
|
1499
1507
|
if (last && similar$1(last, current)) {
|
|
@@ -1501,7 +1509,7 @@ function handler$2(current) {
|
|
|
1501
1509
|
}
|
|
1502
1510
|
state$4.push(current);
|
|
1503
1511
|
clearTimeout(timeout$4);
|
|
1504
|
-
timeout$4 = setTimeout(process$5, 500 /* LookAhead */, current.event);
|
|
1512
|
+
timeout$4 = setTimeout(process$5, 500 /* Setting.LookAhead */, current.event);
|
|
1505
1513
|
break;
|
|
1506
1514
|
default:
|
|
1507
1515
|
state$4.push(current);
|
|
@@ -1521,7 +1529,7 @@ function similar$1(last, current) {
|
|
|
1521
1529
|
var distance = Math.sqrt(dx * dx + dy * dy);
|
|
1522
1530
|
var gap = current.time - last.time;
|
|
1523
1531
|
var match = current.data.target === last.data.target;
|
|
1524
|
-
return current.event === last.event && match && distance < 20 /* Distance */ && gap < 25 /* Interval */;
|
|
1532
|
+
return current.event === last.event && match && distance < 20 /* Setting.Distance */ && gap < 25 /* Setting.Interval */;
|
|
1525
1533
|
}
|
|
1526
1534
|
function stop$p() {
|
|
1527
1535
|
clearTimeout(timeout$4);
|
|
@@ -1544,7 +1552,7 @@ function recompute$5() {
|
|
|
1544
1552
|
width: de && "clientWidth" in de ? Math.min(de.clientWidth, window.innerWidth) : window.innerWidth,
|
|
1545
1553
|
height: de && "clientHeight" in de ? Math.min(de.clientHeight, window.innerHeight) : window.innerHeight,
|
|
1546
1554
|
};
|
|
1547
|
-
encode$3(11 /* Resize */);
|
|
1555
|
+
encode$3(11 /* Event.Resize */);
|
|
1548
1556
|
}
|
|
1549
1557
|
function reset$d() {
|
|
1550
1558
|
data$b = null;
|
|
@@ -1580,7 +1588,7 @@ function recompute$4(event) {
|
|
|
1580
1588
|
// And, if for some reason that is not available, fall back to looking up scrollTop on document.documentElement.
|
|
1581
1589
|
var x = element === de && "pageXOffset" in w ? Math.round(w.pageXOffset) : Math.round(element.scrollLeft);
|
|
1582
1590
|
var y = element === de && "pageYOffset" in w ? Math.round(w.pageYOffset) : Math.round(element.scrollTop);
|
|
1583
|
-
var current = { time: time(), event: 10 /* Scroll */, data: { target: element, x: x, y: y } };
|
|
1591
|
+
var current = { time: time(), event: 10 /* Event.Scroll */, data: { target: element, x: x, y: y } };
|
|
1584
1592
|
// We don't send any scroll events if this is the first event and the current position is top (0,0)
|
|
1585
1593
|
if ((event === null && x === 0 && y === 0) || (x === null || y === null)) {
|
|
1586
1594
|
return;
|
|
@@ -1592,7 +1600,7 @@ function recompute$4(event) {
|
|
|
1592
1600
|
}
|
|
1593
1601
|
state$3.push(current);
|
|
1594
1602
|
clearTimeout(timeout$3);
|
|
1595
|
-
timeout$3 = setTimeout(process$4, 500 /* LookAhead */, 10 /* Scroll */);
|
|
1603
|
+
timeout$3 = setTimeout(process$4, 500 /* Setting.LookAhead */, 10 /* Event.Scroll */);
|
|
1596
1604
|
}
|
|
1597
1605
|
function reset$c() {
|
|
1598
1606
|
state$3 = [];
|
|
@@ -1603,7 +1611,7 @@ function process$4(event) {
|
|
|
1603
1611
|
function similar(last, current) {
|
|
1604
1612
|
var dx = last.data.x - current.data.x;
|
|
1605
1613
|
var dy = last.data.y - current.data.y;
|
|
1606
|
-
return (dx * dx + dy * dy < 20 /* Distance */ * 20 /* Distance */) && (current.time - last.time < 25 /* Interval */);
|
|
1614
|
+
return (dx * dx + dy * dy < 20 /* Setting.Distance */ * 20 /* Setting.Distance */) && (current.time - last.time < 25 /* Setting.Interval */);
|
|
1607
1615
|
}
|
|
1608
1616
|
function stop$n() {
|
|
1609
1617
|
clearTimeout(timeout$3);
|
|
@@ -1638,7 +1646,7 @@ function recompute$3(root) {
|
|
|
1638
1646
|
var startNode = data$a.start ? data$a.start : null;
|
|
1639
1647
|
if (previous !== null && data$a.start !== null && startNode !== current.anchorNode) {
|
|
1640
1648
|
clearTimeout(timeout$2);
|
|
1641
|
-
process$3(21 /* Selection */);
|
|
1649
|
+
process$3(21 /* Event.Selection */);
|
|
1642
1650
|
}
|
|
1643
1651
|
data$a = {
|
|
1644
1652
|
start: current.anchorNode,
|
|
@@ -1648,7 +1656,7 @@ function recompute$3(root) {
|
|
|
1648
1656
|
};
|
|
1649
1657
|
previous = current;
|
|
1650
1658
|
clearTimeout(timeout$2);
|
|
1651
|
-
timeout$2 = setTimeout(process$3, 500 /* LookAhead */, 21 /* Selection */);
|
|
1659
|
+
timeout$2 = setTimeout(process$3, 500 /* Setting.LookAhead */, 21 /* Event.Selection */);
|
|
1652
1660
|
}
|
|
1653
1661
|
function process$3(event) {
|
|
1654
1662
|
schedule$1(encode$3.bind(this, event));
|
|
@@ -1670,8 +1678,8 @@ function observe$5(root) {
|
|
|
1670
1678
|
bind(root, "submit", recompute$2, true);
|
|
1671
1679
|
}
|
|
1672
1680
|
function recompute$2(evt) {
|
|
1673
|
-
state$2.push({ time: time(), event: 39 /* Submit */, data: { target: target(evt) } });
|
|
1674
|
-
schedule$1(encode$3.bind(this, 39 /* Submit */));
|
|
1681
|
+
state$2.push({ time: time(), event: 39 /* Event.Submit */, data: { target: target(evt) } });
|
|
1682
|
+
schedule$1(encode$3.bind(this, 39 /* Event.Submit */));
|
|
1675
1683
|
}
|
|
1676
1684
|
function reset$a() {
|
|
1677
1685
|
state$2 = [];
|
|
@@ -1686,7 +1694,7 @@ function start$m() {
|
|
|
1686
1694
|
}
|
|
1687
1695
|
function recompute$1(evt) {
|
|
1688
1696
|
data$9 = { name: evt.type };
|
|
1689
|
-
encode$3(26 /* Unload */);
|
|
1697
|
+
encode$3(26 /* Event.Unload */);
|
|
1690
1698
|
stop();
|
|
1691
1699
|
}
|
|
1692
1700
|
function reset$9() {
|
|
@@ -1703,7 +1711,7 @@ function start$l() {
|
|
|
1703
1711
|
}
|
|
1704
1712
|
function recompute() {
|
|
1705
1713
|
data$8 = { visible: "visibilityState" in document ? document.visibilityState : "default" };
|
|
1706
|
-
encode$3(28 /* Visibility */);
|
|
1714
|
+
encode$3(28 /* Event.Visibility */);
|
|
1707
1715
|
}
|
|
1708
1716
|
function reset$8() {
|
|
1709
1717
|
data$8 = null;
|
|
@@ -1765,51 +1773,51 @@ function ld(json) {
|
|
|
1765
1773
|
for (var _i = 0, _a = Object.keys(json); _i < _a.length; _i++) {
|
|
1766
1774
|
var key = _a[_i];
|
|
1767
1775
|
var value = json[key];
|
|
1768
|
-
if (key === "@type" /* Type */ && typeof value === "string") {
|
|
1776
|
+
if (key === "@type" /* JsonLD.Type */ && typeof value === "string") {
|
|
1769
1777
|
value = value.toLowerCase();
|
|
1770
1778
|
/* Normalizations */
|
|
1771
|
-
value = value.indexOf("article" /* Article */) >= 0 || value.indexOf("posting" /* Posting */) >= 0 ? "article" /* Article */ : value;
|
|
1779
|
+
value = value.indexOf("article" /* JsonLD.Article */) >= 0 || value.indexOf("posting" /* JsonLD.Posting */) >= 0 ? "article" /* JsonLD.Article */ : value;
|
|
1772
1780
|
switch (value) {
|
|
1773
|
-
case "article" /* Article */:
|
|
1774
|
-
case "recipe" /* Recipe */:
|
|
1775
|
-
log(5 /* SchemaType */, json[key]);
|
|
1776
|
-
log(8 /* AuthorName */, json["creator" /* Creator */]);
|
|
1777
|
-
log(18 /* Headline */, json["headline" /* Headline */]);
|
|
1781
|
+
case "article" /* JsonLD.Article */:
|
|
1782
|
+
case "recipe" /* JsonLD.Recipe */:
|
|
1783
|
+
log(5 /* Dimension.SchemaType */, json[key]);
|
|
1784
|
+
log(8 /* Dimension.AuthorName */, json["creator" /* JsonLD.Creator */]);
|
|
1785
|
+
log(18 /* Dimension.Headline */, json["headline" /* JsonLD.Headline */]);
|
|
1778
1786
|
break;
|
|
1779
|
-
case "product" /* Product */:
|
|
1780
|
-
log(5 /* SchemaType */, json[key]);
|
|
1781
|
-
log(10 /* ProductName */, json["name" /* Name */]);
|
|
1782
|
-
log(12 /* ProductSku */, json["sku" /* Sku */]);
|
|
1783
|
-
if (json["brand" /* Brand */]) {
|
|
1784
|
-
log(6 /* ProductBrand */, json["brand" /* Brand */]["name" /* Name */]);
|
|
1787
|
+
case "product" /* JsonLD.Product */:
|
|
1788
|
+
log(5 /* Dimension.SchemaType */, json[key]);
|
|
1789
|
+
log(10 /* Dimension.ProductName */, json["name" /* JsonLD.Name */]);
|
|
1790
|
+
log(12 /* Dimension.ProductSku */, json["sku" /* JsonLD.Sku */]);
|
|
1791
|
+
if (json["brand" /* JsonLD.Brand */]) {
|
|
1792
|
+
log(6 /* Dimension.ProductBrand */, json["brand" /* JsonLD.Brand */]["name" /* JsonLD.Name */]);
|
|
1785
1793
|
}
|
|
1786
1794
|
break;
|
|
1787
|
-
case "aggregaterating" /* AggregateRating */:
|
|
1788
|
-
if (json["ratingValue" /* RatingValue */]) {
|
|
1789
|
-
max(11 /* RatingValue */, num$1(json["ratingValue" /* RatingValue */], 100 /* RatingScale */));
|
|
1790
|
-
max(18 /* BestRating */, num$1(json["bestRating" /* BestRating */]));
|
|
1791
|
-
max(19 /* WorstRating */, num$1(json["worstRating" /* WorstRating */]));
|
|
1795
|
+
case "aggregaterating" /* JsonLD.AggregateRating */:
|
|
1796
|
+
if (json["ratingValue" /* JsonLD.RatingValue */]) {
|
|
1797
|
+
max(11 /* Metric.RatingValue */, num$1(json["ratingValue" /* JsonLD.RatingValue */], 100 /* Setting.RatingScale */));
|
|
1798
|
+
max(18 /* Metric.BestRating */, num$1(json["bestRating" /* JsonLD.BestRating */]));
|
|
1799
|
+
max(19 /* Metric.WorstRating */, num$1(json["worstRating" /* JsonLD.WorstRating */]));
|
|
1792
1800
|
}
|
|
1793
|
-
max(12 /* RatingCount */, num$1(json["ratingCount" /* RatingCount */]));
|
|
1794
|
-
max(17 /* ReviewCount */, num$1(json["reviewCount" /* ReviewCount */]));
|
|
1801
|
+
max(12 /* Metric.RatingCount */, num$1(json["ratingCount" /* JsonLD.RatingCount */]));
|
|
1802
|
+
max(17 /* Metric.ReviewCount */, num$1(json["reviewCount" /* JsonLD.ReviewCount */]));
|
|
1795
1803
|
break;
|
|
1796
|
-
case "person" /* Author */:
|
|
1797
|
-
log(8 /* AuthorName */, json["name" /* Name */]);
|
|
1804
|
+
case "person" /* JsonLD.Author */:
|
|
1805
|
+
log(8 /* Dimension.AuthorName */, json["name" /* JsonLD.Name */]);
|
|
1798
1806
|
break;
|
|
1799
|
-
case "offer" /* Offer */:
|
|
1800
|
-
log(7 /* ProductAvailability */, json["availability" /* Availability */]);
|
|
1801
|
-
log(14 /* ProductCondition */, json["itemCondition" /* ItemCondition */]);
|
|
1802
|
-
log(13 /* ProductCurrency */, json["priceCurrency" /* PriceCurrency */]);
|
|
1803
|
-
log(12 /* ProductSku */, json["sku" /* Sku */]);
|
|
1804
|
-
max(13 /* ProductPrice */, num$1(json["price" /* Price */]));
|
|
1807
|
+
case "offer" /* JsonLD.Offer */:
|
|
1808
|
+
log(7 /* Dimension.ProductAvailability */, json["availability" /* JsonLD.Availability */]);
|
|
1809
|
+
log(14 /* Dimension.ProductCondition */, json["itemCondition" /* JsonLD.ItemCondition */]);
|
|
1810
|
+
log(13 /* Dimension.ProductCurrency */, json["priceCurrency" /* JsonLD.PriceCurrency */]);
|
|
1811
|
+
log(12 /* Dimension.ProductSku */, json["sku" /* JsonLD.Sku */]);
|
|
1812
|
+
max(13 /* Metric.ProductPrice */, num$1(json["price" /* JsonLD.Price */]));
|
|
1805
1813
|
break;
|
|
1806
|
-
case "brand" /* Brand */:
|
|
1807
|
-
log(6 /* ProductBrand */, json["name" /* Name */]);
|
|
1814
|
+
case "brand" /* JsonLD.Brand */:
|
|
1815
|
+
log(6 /* Dimension.ProductBrand */, json["name" /* JsonLD.Name */]);
|
|
1808
1816
|
break;
|
|
1809
1817
|
}
|
|
1810
1818
|
}
|
|
1811
1819
|
// Continue parsing nested objects
|
|
1812
|
-
if (value !== null && typeof (value) === "object" /* Object */) {
|
|
1820
|
+
if (value !== null && typeof (value) === "object" /* Constant.Object */) {
|
|
1813
1821
|
ld(value);
|
|
1814
1822
|
}
|
|
1815
1823
|
}
|
|
@@ -1818,8 +1826,8 @@ function num$1(input, scale) {
|
|
|
1818
1826
|
if (scale === void 0) { scale = 1; }
|
|
1819
1827
|
if (input !== null) {
|
|
1820
1828
|
switch (typeof input) {
|
|
1821
|
-
case "number" /* Number */: return Math.round(input * scale);
|
|
1822
|
-
case "string" /* String */: return Math.round(parseFloat(input.replace(digitsRegex, "" /* Empty */)) * scale);
|
|
1829
|
+
case "number" /* Constant.Number */: return Math.round(input * scale);
|
|
1830
|
+
case "string" /* Constant.String */: return Math.round(parseFloat(input.replace(digitsRegex, "" /* Constant.Empty */)) * scale);
|
|
1823
1831
|
}
|
|
1824
1832
|
}
|
|
1825
1833
|
return null;
|
|
@@ -1830,11 +1838,11 @@ var newlineRegex = /[\r\n]+/g;
|
|
|
1830
1838
|
function processNode (node, source) {
|
|
1831
1839
|
var child = null;
|
|
1832
1840
|
// Do not track this change if we are attempting to remove a node before discovering it
|
|
1833
|
-
if (source === 2 /* ChildListRemove */ && has(node) === false) {
|
|
1841
|
+
if (source === 2 /* Source.ChildListRemove */ && has(node) === false) {
|
|
1834
1842
|
return child;
|
|
1835
1843
|
}
|
|
1836
1844
|
// Special handling for text nodes that belong to style nodes
|
|
1837
|
-
if (source !== 0 /* Discover */ &&
|
|
1845
|
+
if (source !== 0 /* Source.Discover */ &&
|
|
1838
1846
|
node.nodeType === Node.TEXT_NODE &&
|
|
1839
1847
|
node.parentElement &&
|
|
1840
1848
|
node.parentElement.tagName === "STYLE") {
|
|
@@ -1847,10 +1855,10 @@ function processNode (node, source) {
|
|
|
1847
1855
|
switch (node.nodeType) {
|
|
1848
1856
|
case Node.DOCUMENT_TYPE_NODE:
|
|
1849
1857
|
parent = insideFrame && node.parentNode ? iframe(node.parentNode) : parent;
|
|
1850
|
-
var docTypePrefix = insideFrame ? "iframe:" /* IFramePrefix */ : "" /* Empty */;
|
|
1858
|
+
var docTypePrefix = insideFrame ? "iframe:" /* Constant.IFramePrefix */ : "" /* Constant.Empty */;
|
|
1851
1859
|
var doctype = node;
|
|
1852
1860
|
var docAttributes = { name: doctype.name, publicId: doctype.publicId, systemId: doctype.systemId };
|
|
1853
|
-
var docData = { tag: docTypePrefix + "*D" /* DocumentTag */, attributes: docAttributes };
|
|
1861
|
+
var docData = { tag: docTypePrefix + "*D" /* Constant.DocumentTag */, attributes: docAttributes };
|
|
1854
1862
|
dom[call](node, parent, docData, source);
|
|
1855
1863
|
break;
|
|
1856
1864
|
case Node.DOCUMENT_NODE:
|
|
@@ -1865,26 +1873,26 @@ function processNode (node, source) {
|
|
|
1865
1873
|
if (shadowRoot.host) {
|
|
1866
1874
|
parse$1(shadowRoot);
|
|
1867
1875
|
var type = typeof (shadowRoot.constructor);
|
|
1868
|
-
if (type === "function" /* Function */ && shadowRoot.constructor.toString().indexOf("[native code]" /* NativeCode */) >= 0) {
|
|
1876
|
+
if (type === "function" /* Constant.Function */ && shadowRoot.constructor.toString().indexOf("[native code]" /* Constant.NativeCode */) >= 0) {
|
|
1869
1877
|
observe$3(shadowRoot);
|
|
1870
1878
|
// See: https://wicg.github.io/construct-stylesheets/ for more details on adoptedStyleSheets.
|
|
1871
1879
|
// At the moment, we are only able to capture "open" shadow DOM nodes. If they are closed, they are not accessible.
|
|
1872
1880
|
// In future we may decide to proxy "attachShadow" call to gain access, but at the moment, we don't want to
|
|
1873
1881
|
// cause any unintended side effect to the page. We will re-evaluate after we gather more real world data on this.
|
|
1874
|
-
var style = "" /* Empty */;
|
|
1882
|
+
var style = "" /* Constant.Empty */;
|
|
1875
1883
|
var adoptedStyleSheets = "adoptedStyleSheets" in shadowRoot ? shadowRoot["adoptedStyleSheets"] : [];
|
|
1876
1884
|
for (var _i = 0, adoptedStyleSheets_1 = adoptedStyleSheets; _i < adoptedStyleSheets_1.length; _i++) {
|
|
1877
1885
|
var styleSheet = adoptedStyleSheets_1[_i];
|
|
1878
1886
|
style += getCssRules(styleSheet);
|
|
1879
1887
|
}
|
|
1880
|
-
var fragementData = { tag: "*S" /* ShadowDomTag */, attributes: { style: style } };
|
|
1888
|
+
var fragementData = { tag: "*S" /* Constant.ShadowDomTag */, attributes: { style: style } };
|
|
1881
1889
|
dom[call](node, shadowRoot.host, fragementData, source);
|
|
1882
1890
|
}
|
|
1883
1891
|
else {
|
|
1884
1892
|
// If the browser doesn't support shadow DOM natively, we detect that, and send appropriate tag back.
|
|
1885
1893
|
// The differentiation is important because we don't have to observe pollyfill shadow DOM nodes,
|
|
1886
1894
|
// the same way we observe real shadow DOM nodes (encapsulation provided by the browser).
|
|
1887
|
-
dom[call](node, shadowRoot.host, { tag: "*P" /* PolyfillShadowDomTag */, attributes: {} }, source);
|
|
1895
|
+
dom[call](node, shadowRoot.host, { tag: "*P" /* Constant.PolyfillShadowDomTag */, attributes: {} }, source);
|
|
1888
1896
|
}
|
|
1889
1897
|
}
|
|
1890
1898
|
break;
|
|
@@ -1897,7 +1905,7 @@ function processNode (node, source) {
|
|
|
1897
1905
|
// The only exception is when we receive a mutation to remove the text node, in that case
|
|
1898
1906
|
// parent will be null, but we can still process the node by checking it's an update call.
|
|
1899
1907
|
if (call === "update" || (parent && has(parent) && parent.tagName !== "STYLE")) {
|
|
1900
|
-
var textData = { tag: "*T" /* TextTag */, value: node.nodeValue };
|
|
1908
|
+
var textData = { tag: "*T" /* Constant.TextTag */, value: node.nodeValue };
|
|
1901
1909
|
dom[call](node, parent, textData, source);
|
|
1902
1910
|
}
|
|
1903
1911
|
break;
|
|
@@ -1909,20 +1917,20 @@ function processNode (node, source) {
|
|
|
1909
1917
|
// For correctness, we first look at parentElement and if it not present then fall back to using parentNode
|
|
1910
1918
|
parent = node.parentElement ? node.parentElement : (node.parentNode ? node.parentNode : null);
|
|
1911
1919
|
// If we encounter a node that is part of SVG namespace, prefix the tag with SVG_PREFIX
|
|
1912
|
-
if (element.namespaceURI === "http://www.w3.org/2000/svg" /* SvgNamespace */) {
|
|
1913
|
-
tag = "svg:" /* SvgPrefix */ + tag;
|
|
1920
|
+
if (element.namespaceURI === "http://www.w3.org/2000/svg" /* Constant.SvgNamespace */) {
|
|
1921
|
+
tag = "svg:" /* Constant.SvgPrefix */ + tag;
|
|
1914
1922
|
}
|
|
1915
1923
|
switch (tag) {
|
|
1916
1924
|
case "HTML":
|
|
1917
1925
|
parent = insideFrame && parent ? iframe(parent) : null;
|
|
1918
|
-
var htmlPrefix = insideFrame ? "iframe:" /* IFramePrefix */ : "" /* Empty */;
|
|
1926
|
+
var htmlPrefix = insideFrame ? "iframe:" /* Constant.IFramePrefix */ : "" /* Constant.Empty */;
|
|
1919
1927
|
var htmlData = { tag: htmlPrefix + tag, attributes: attributes };
|
|
1920
1928
|
dom[call](node, parent, htmlData, source);
|
|
1921
1929
|
break;
|
|
1922
1930
|
case "SCRIPT":
|
|
1923
|
-
if ("type" /* Type */ in attributes && attributes["type" /* Type */] === "application/ld+json" /* JsonLD */) {
|
|
1931
|
+
if ("type" /* Constant.Type */ in attributes && attributes["type" /* Constant.Type */] === "application/ld+json" /* Constant.JsonLD */) {
|
|
1924
1932
|
try {
|
|
1925
|
-
ld(JSON.parse(element.text.replace(newlineRegex, "" /* Empty */)));
|
|
1933
|
+
ld(JSON.parse(element.text.replace(newlineRegex, "" /* Constant.Empty */)));
|
|
1926
1934
|
}
|
|
1927
1935
|
catch ( /* do nothing */_a) { /* do nothing */ }
|
|
1928
1936
|
}
|
|
@@ -1930,20 +1938,20 @@ function processNode (node, source) {
|
|
|
1930
1938
|
case "NOSCRIPT":
|
|
1931
1939
|
break;
|
|
1932
1940
|
case "META":
|
|
1933
|
-
var key = ("property" /* Property */ in attributes ?
|
|
1934
|
-
"property" /* Property */ :
|
|
1935
|
-
("name" /* Name */ in attributes ? "name" /* Name */ : null));
|
|
1936
|
-
if (key && "content" /* Content */ in attributes) {
|
|
1937
|
-
var content = attributes["content" /* Content */];
|
|
1941
|
+
var key = ("property" /* Constant.Property */ in attributes ?
|
|
1942
|
+
"property" /* Constant.Property */ :
|
|
1943
|
+
("name" /* Constant.Name */ in attributes ? "name" /* Constant.Name */ : null));
|
|
1944
|
+
if (key && "content" /* Constant.Content */ in attributes) {
|
|
1945
|
+
var content = attributes["content" /* Constant.Content */];
|
|
1938
1946
|
switch (attributes[key]) {
|
|
1939
|
-
case "og:title" /* ogTitle */:
|
|
1940
|
-
log(20 /* MetaTitle */, content);
|
|
1947
|
+
case "og:title" /* Constant.ogTitle */:
|
|
1948
|
+
log(20 /* Dimension.MetaTitle */, content);
|
|
1941
1949
|
break;
|
|
1942
|
-
case "og:type" /* ogType */:
|
|
1943
|
-
log(19 /* MetaType */, content);
|
|
1950
|
+
case "og:type" /* Constant.ogType */:
|
|
1951
|
+
log(19 /* Dimension.MetaType */, content);
|
|
1944
1952
|
break;
|
|
1945
|
-
case "generator" /* Generator */:
|
|
1946
|
-
log(21 /* Generator */, content);
|
|
1953
|
+
case "generator" /* Constant.Generator */:
|
|
1954
|
+
log(21 /* Dimension.Generator */, content);
|
|
1947
1955
|
break;
|
|
1948
1956
|
}
|
|
1949
1957
|
}
|
|
@@ -1951,7 +1959,7 @@ function processNode (node, source) {
|
|
|
1951
1959
|
case "HEAD":
|
|
1952
1960
|
var head = { tag: tag, attributes: attributes };
|
|
1953
1961
|
if (location) {
|
|
1954
|
-
head.attributes["*B" /* Base */] = location.protocol + "//" + location.hostname;
|
|
1962
|
+
head.attributes["*B" /* Constant.Base */] = location.protocol + "//" + location.hostname;
|
|
1955
1963
|
}
|
|
1956
1964
|
dom[call](node, parent, head, source);
|
|
1957
1965
|
break;
|
|
@@ -1964,7 +1972,7 @@ function processNode (node, source) {
|
|
|
1964
1972
|
var frameData = { tag: tag, attributes: attributes };
|
|
1965
1973
|
if (sameorigin(iframe$1)) {
|
|
1966
1974
|
monitor(iframe$1);
|
|
1967
|
-
frameData.attributes["*O" /* SameOrigin */] = "true";
|
|
1975
|
+
frameData.attributes["*O" /* Constant.SameOrigin */] = "true";
|
|
1968
1976
|
if (iframe$1.contentDocument && iframe$1.contentWindow && iframe$1.contentDocument.readyState !== "loading") {
|
|
1969
1977
|
child = iframe$1.contentDocument;
|
|
1970
1978
|
}
|
|
@@ -1993,7 +2001,7 @@ function observe$3(root) {
|
|
|
1993
2001
|
function getStyleValue(style) {
|
|
1994
2002
|
// Call trim on the text content to ensure we do not process white spaces ( , \n, \r\n, \t, etc.)
|
|
1995
2003
|
// Also, check if stylesheet has any data-* attribute, if so process rules instead of looking up text
|
|
1996
|
-
var value = style.textContent ? style.textContent.trim() : "" /* Empty */;
|
|
2004
|
+
var value = style.textContent ? style.textContent.trim() : "" /* Constant.Empty */;
|
|
1997
2005
|
var dataset = style.dataset ? Object.keys(style.dataset).length : 0;
|
|
1998
2006
|
if (value.length === 0 || dataset > 0) {
|
|
1999
2007
|
value = getCssRules(style.sheet);
|
|
@@ -2001,14 +2009,14 @@ function getStyleValue(style) {
|
|
|
2001
2009
|
return value;
|
|
2002
2010
|
}
|
|
2003
2011
|
function getCssRules(sheet) {
|
|
2004
|
-
var value = "" /* Empty */;
|
|
2012
|
+
var value = "" /* Constant.Empty */;
|
|
2005
2013
|
var cssRules = null;
|
|
2006
2014
|
// Firefox throws a SecurityError when trying to access cssRules of a stylesheet from a different domain
|
|
2007
2015
|
try {
|
|
2008
2016
|
cssRules = sheet ? sheet.cssRules : [];
|
|
2009
2017
|
}
|
|
2010
2018
|
catch (e) {
|
|
2011
|
-
log$1(1 /* CssRules */, 1 /* Warning */, e ? e.name : null);
|
|
2019
|
+
log$1(1 /* Code.CssRules */, 1 /* Severity.Warning */, e ? e.name : null);
|
|
2012
2020
|
if (e && e.name !== "SecurityError") {
|
|
2013
2021
|
throw e;
|
|
2014
2022
|
}
|
|
@@ -2032,8 +2040,8 @@ function getAttributes(element) {
|
|
|
2032
2040
|
}
|
|
2033
2041
|
}
|
|
2034
2042
|
// For INPUT tags read the dynamic "value" property if an explicit "value" attribute is not set
|
|
2035
|
-
if (element.tagName === "INPUT" /* InputTag */ && !("value" /* Value */ in output) && element.value) {
|
|
2036
|
-
output["value" /* Value */] = element.value;
|
|
2043
|
+
if (element.tagName === "INPUT" /* Constant.InputTag */ && !("value" /* Constant.Value */ in output) && element.value) {
|
|
2044
|
+
output["value" /* Constant.Value */] = element.value;
|
|
2037
2045
|
}
|
|
2038
2046
|
return output;
|
|
2039
2047
|
}
|
|
@@ -2055,13 +2063,13 @@ function traverse (root, timer, source) {
|
|
|
2055
2063
|
next = next.nextSibling;
|
|
2056
2064
|
}
|
|
2057
2065
|
state = state$8(timer);
|
|
2058
|
-
if (!(state === 0 /* Wait */)) return [3 /*break*/, 3];
|
|
2066
|
+
if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 3];
|
|
2059
2067
|
return [4 /*yield*/, suspend$1(timer)];
|
|
2060
2068
|
case 2:
|
|
2061
2069
|
state = _a.sent();
|
|
2062
2070
|
_a.label = 3;
|
|
2063
2071
|
case 3:
|
|
2064
|
-
if (state === 2 /* Stop */) {
|
|
2072
|
+
if (state === 2 /* Task.Stop */) {
|
|
2065
2073
|
return [3 /*break*/, 4];
|
|
2066
2074
|
}
|
|
2067
2075
|
subnode = processNode(node, source);
|
|
@@ -2138,7 +2146,7 @@ function observe$2(node) {
|
|
|
2138
2146
|
// For this reason, we need to wire up mutations every time we see a new shadow dom.
|
|
2139
2147
|
// Also, wrap it inside a try / catch. In certain browsers (e.g. legacy Edge), observer on shadow dom can throw errors
|
|
2140
2148
|
try {
|
|
2141
|
-
var m = api("MutationObserver" /* MutationObserver */);
|
|
2149
|
+
var m = api("MutationObserver" /* Constant.MutationObserver */);
|
|
2142
2150
|
var observer = m in window ? new window[m](measure(handle$1)) : null;
|
|
2143
2151
|
if (observer) {
|
|
2144
2152
|
observer.observe(node, { attributes: true, childList: true, characterData: true, subtree: true });
|
|
@@ -2146,7 +2154,7 @@ function observe$2(node) {
|
|
|
2146
2154
|
}
|
|
2147
2155
|
}
|
|
2148
2156
|
catch (e) {
|
|
2149
|
-
log$1(2 /* MutationObserver */, 0 /* Info */, e ? e.name : null);
|
|
2157
|
+
log$1(2 /* Code.MutationObserver */, 0 /* Severity.Info */, e ? e.name : null);
|
|
2150
2158
|
}
|
|
2151
2159
|
}
|
|
2152
2160
|
function monitor(frame) {
|
|
@@ -2154,7 +2162,7 @@ function monitor(frame) {
|
|
|
2154
2162
|
// This includes cases where iframe location is updated without explicitly updating src attribute
|
|
2155
2163
|
// E.g. iframe.contentWindow.location.href = "new-location";
|
|
2156
2164
|
if (has(frame) === false) {
|
|
2157
|
-
bind(frame, "load" /* LoadEvent */, generate.bind(this, frame, "childList" /* ChildList */), true);
|
|
2165
|
+
bind(frame, "load" /* Constant.LoadEvent */, generate.bind(this, frame, "childList" /* Constant.ChildList */), true);
|
|
2158
2166
|
}
|
|
2159
2167
|
}
|
|
2160
2168
|
function stop$h() {
|
|
@@ -2172,14 +2180,14 @@ function stop$h() {
|
|
|
2172
2180
|
timeout$1 = null;
|
|
2173
2181
|
}
|
|
2174
2182
|
function active$2() {
|
|
2175
|
-
activePeriod = time() + 3000 /* MutationActivePeriod */;
|
|
2183
|
+
activePeriod = time() + 3000 /* Setting.MutationActivePeriod */;
|
|
2176
2184
|
}
|
|
2177
2185
|
function handle$1(m) {
|
|
2178
2186
|
// Queue up mutation records for asynchronous processing
|
|
2179
2187
|
var now = time();
|
|
2180
|
-
track$6(6 /* Mutation */, now);
|
|
2188
|
+
track$6(6 /* Event.Mutation */, now);
|
|
2181
2189
|
mutations.push({ time: now, mutations: m });
|
|
2182
|
-
schedule$1(process$2, 1 /* High */).then(function () {
|
|
2190
|
+
schedule$1(process$2, 1 /* Priority.High */).then(function () {
|
|
2183
2191
|
setTimeout(compute$7);
|
|
2184
2192
|
measure(compute$6)();
|
|
2185
2193
|
});
|
|
@@ -2190,7 +2198,7 @@ function process$2() {
|
|
|
2190
2198
|
return __generator(this, function (_b) {
|
|
2191
2199
|
switch (_b.label) {
|
|
2192
2200
|
case 0:
|
|
2193
|
-
timer = { id: id(), cost: 3 /* LayoutCost */ };
|
|
2201
|
+
timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
|
|
2194
2202
|
start$w(timer);
|
|
2195
2203
|
_b.label = 1;
|
|
2196
2204
|
case 1:
|
|
@@ -2202,13 +2210,13 @@ function process$2() {
|
|
|
2202
2210
|
if (!(_i < _a.length)) return [3 /*break*/, 6];
|
|
2203
2211
|
mutation = _a[_i];
|
|
2204
2212
|
state = state$8(timer);
|
|
2205
|
-
if (!(state === 0 /* Wait */)) return [3 /*break*/, 4];
|
|
2213
|
+
if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 4];
|
|
2206
2214
|
return [4 /*yield*/, suspend$1(timer)];
|
|
2207
2215
|
case 3:
|
|
2208
2216
|
state = _b.sent();
|
|
2209
2217
|
_b.label = 4;
|
|
2210
2218
|
case 4:
|
|
2211
|
-
if (state === 2 /* Stop */) {
|
|
2219
|
+
if (state === 2 /* Task.Stop */) {
|
|
2212
2220
|
return [3 /*break*/, 6];
|
|
2213
2221
|
}
|
|
2214
2222
|
target = mutation.target;
|
|
@@ -2220,17 +2228,17 @@ function process$2() {
|
|
|
2220
2228
|
parse$1(target);
|
|
2221
2229
|
}
|
|
2222
2230
|
switch (type) {
|
|
2223
|
-
case "attributes" /* Attributes */:
|
|
2224
|
-
processNode(target, 3 /* Attributes */);
|
|
2231
|
+
case "attributes" /* Constant.Attributes */:
|
|
2232
|
+
processNode(target, 3 /* Source.Attributes */);
|
|
2225
2233
|
break;
|
|
2226
|
-
case "characterData" /* CharacterData */:
|
|
2227
|
-
processNode(target, 4 /* CharacterData */);
|
|
2234
|
+
case "characterData" /* Constant.CharacterData */:
|
|
2235
|
+
processNode(target, 4 /* Source.CharacterData */);
|
|
2228
2236
|
break;
|
|
2229
|
-
case "childList" /* ChildList */:
|
|
2230
|
-
processNodeList(mutation.addedNodes, 1 /* ChildListAdd */, timer);
|
|
2231
|
-
processNodeList(mutation.removedNodes, 2 /* ChildListRemove */, timer);
|
|
2237
|
+
case "childList" /* Constant.ChildList */:
|
|
2238
|
+
processNodeList(mutation.addedNodes, 1 /* Source.ChildListAdd */, timer);
|
|
2239
|
+
processNodeList(mutation.removedNodes, 2 /* Source.ChildListRemove */, timer);
|
|
2232
2240
|
break;
|
|
2233
|
-
case "suspend" /* Suspend */:
|
|
2241
|
+
case "suspend" /* Constant.Suspend */:
|
|
2234
2242
|
value = get(target);
|
|
2235
2243
|
if (value) {
|
|
2236
2244
|
value.metadata.suspend = true;
|
|
@@ -2241,7 +2249,7 @@ function process$2() {
|
|
|
2241
2249
|
case 5:
|
|
2242
2250
|
_i++;
|
|
2243
2251
|
return [3 /*break*/, 2];
|
|
2244
|
-
case 6: return [4 /*yield*/, encode$4(6 /* Mutation */, timer, record.time)];
|
|
2252
|
+
case 6: return [4 /*yield*/, encode$4(6 /* Event.Mutation */, timer, record.time)];
|
|
2245
2253
|
case 7:
|
|
2246
2254
|
_b.sent();
|
|
2247
2255
|
return [3 /*break*/, 1];
|
|
@@ -2255,11 +2263,11 @@ function process$2() {
|
|
|
2255
2263
|
function track$5(m, timer) {
|
|
2256
2264
|
var value = m.target ? get(m.target.parentNode) : null;
|
|
2257
2265
|
// Check if the parent is already discovered and that the parent is not the document root
|
|
2258
|
-
if (value && value.data.tag !== "HTML" /* HTML */) {
|
|
2266
|
+
if (value && value.data.tag !== "HTML" /* Constant.HTML */) {
|
|
2259
2267
|
var inactive = time() > activePeriod;
|
|
2260
2268
|
var target = get(m.target);
|
|
2261
2269
|
var element = target && target.selector ? target.selector.join() : m.target.nodeName;
|
|
2262
|
-
var parent_1 = value.selector ? value.selector.join() : "" /* Empty */;
|
|
2270
|
+
var parent_1 = value.selector ? value.selector.join() : "" /* Constant.Empty */;
|
|
2263
2271
|
// We use selector, instead of id, to determine the key (signature for the mutation) because in some cases
|
|
2264
2272
|
// repeated mutations can cause elements to be destroyed and then recreated as new DOM nodes
|
|
2265
2273
|
// In those cases, IDs will change however the selector (which is relative to DOM xPath) remains the same
|
|
@@ -2268,20 +2276,20 @@ function track$5(m, timer) {
|
|
|
2268
2276
|
history$4[key] = key in history$4 ? history$4[key] : [0];
|
|
2269
2277
|
var h = history$4[key];
|
|
2270
2278
|
// Lookup any pending nodes queued up for removal, and process them now if we suspended a mutation before
|
|
2271
|
-
if (inactive === false && h[0] >= 10 /* MutationSuspendThreshold */) {
|
|
2272
|
-
processNodeList(h[1], 2 /* ChildListRemove */, timer);
|
|
2279
|
+
if (inactive === false && h[0] >= 10 /* Setting.MutationSuspendThreshold */) {
|
|
2280
|
+
processNodeList(h[1], 2 /* Source.ChildListRemove */, timer);
|
|
2273
2281
|
}
|
|
2274
2282
|
// Update the counter
|
|
2275
2283
|
h[0] = inactive ? h[0] + 1 : 1;
|
|
2276
2284
|
// Return updated mutation type based on if we have already hit the threshold or not
|
|
2277
|
-
if (h[0] === 10 /* MutationSuspendThreshold */) {
|
|
2285
|
+
if (h[0] === 10 /* Setting.MutationSuspendThreshold */) {
|
|
2278
2286
|
// Store a reference to removedNodes so we can process them later
|
|
2279
2287
|
// when we resume mutations again on user interactions
|
|
2280
2288
|
h[1] = m.removedNodes;
|
|
2281
|
-
return "suspend" /* Suspend */;
|
|
2289
|
+
return "suspend" /* Constant.Suspend */;
|
|
2282
2290
|
}
|
|
2283
|
-
else if (h[0] > 10 /* MutationSuspendThreshold */) {
|
|
2284
|
-
return "" /* Empty */;
|
|
2291
|
+
else if (h[0] > 10 /* Setting.MutationSuspendThreshold */) {
|
|
2292
|
+
return "" /* Constant.Empty */;
|
|
2285
2293
|
}
|
|
2286
2294
|
}
|
|
2287
2295
|
return m.type;
|
|
@@ -2304,18 +2312,18 @@ function processNodeList(list, source, timer) {
|
|
|
2304
2312
|
_a.label = 1;
|
|
2305
2313
|
case 1:
|
|
2306
2314
|
if (!(i < length)) return [3 /*break*/, 6];
|
|
2307
|
-
if (!(source === 1 /* ChildListAdd */)) return [3 /*break*/, 2];
|
|
2315
|
+
if (!(source === 1 /* Source.ChildListAdd */)) return [3 /*break*/, 2];
|
|
2308
2316
|
traverse(list[i], timer, source);
|
|
2309
2317
|
return [3 /*break*/, 5];
|
|
2310
2318
|
case 2:
|
|
2311
2319
|
state = state$8(timer);
|
|
2312
|
-
if (!(state === 0 /* Wait */)) return [3 /*break*/, 4];
|
|
2320
|
+
if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 4];
|
|
2313
2321
|
return [4 /*yield*/, suspend$1(timer)];
|
|
2314
2322
|
case 3:
|
|
2315
2323
|
state = _a.sent();
|
|
2316
2324
|
_a.label = 4;
|
|
2317
2325
|
case 4:
|
|
2318
|
-
if (state === 2 /* Stop */) {
|
|
2326
|
+
if (state === 2 /* Task.Stop */) {
|
|
2319
2327
|
return [3 /*break*/, 6];
|
|
2320
2328
|
}
|
|
2321
2329
|
processNode(list[i], source);
|
|
@@ -2340,7 +2348,7 @@ function schedule(node, fragment) {
|
|
|
2340
2348
|
if (timeout$1) {
|
|
2341
2349
|
clearTimeout(timeout$1);
|
|
2342
2350
|
}
|
|
2343
|
-
timeout$1 = setTimeout(function () { trigger$1(fragment); }, 33 /* LookAhead */);
|
|
2351
|
+
timeout$1 = setTimeout(function () { trigger$1(fragment); }, 33 /* Setting.LookAhead */);
|
|
2344
2352
|
return node;
|
|
2345
2353
|
}
|
|
2346
2354
|
function trigger$1(fragment) {
|
|
@@ -2353,7 +2361,7 @@ function trigger$1(fragment) {
|
|
|
2353
2361
|
if (shadowRoot && has(node)) {
|
|
2354
2362
|
continue;
|
|
2355
2363
|
}
|
|
2356
|
-
generate(node, shadowRoot || fragment ? "childList" /* ChildList */ : "characterData" /* CharacterData */);
|
|
2364
|
+
generate(node, shadowRoot || fragment ? "childList" /* Constant.ChildList */ : "characterData" /* Constant.CharacterData */);
|
|
2357
2365
|
}
|
|
2358
2366
|
}
|
|
2359
2367
|
queue$2 = [];
|
|
@@ -2403,9 +2411,9 @@ function reset$7() {
|
|
|
2403
2411
|
hashMap = {};
|
|
2404
2412
|
override = [];
|
|
2405
2413
|
unmask = [];
|
|
2406
|
-
maskText = "address,password,contact" /* Text */.split("," /* Comma */);
|
|
2407
|
-
maskInput = "password,secret,pass,social,ssn,name,code,dob,cell,mob,contact,hidden,account,cvv,ccv,email,tel,phone,address,addr,card,zip" /* Input */.split("," /* Comma */);
|
|
2408
|
-
maskDisable = "radio,checkbox,range,button,reset,submit" /* Disable */.split("," /* Comma */);
|
|
2414
|
+
maskText = "address,password,contact" /* Mask.Text */.split("," /* Constant.Comma */);
|
|
2415
|
+
maskInput = "password,secret,pass,social,ssn,name,code,dob,cell,mob,contact,hidden,account,cvv,ccv,email,tel,phone,address,addr,card,zip" /* Mask.Input */.split("," /* Constant.Comma */);
|
|
2416
|
+
maskDisable = "radio,checkbox,range,button,reset,submit" /* Mask.Disable */.split("," /* Constant.Comma */);
|
|
2409
2417
|
idMap = new WeakMap();
|
|
2410
2418
|
iframeMap = new WeakMap();
|
|
2411
2419
|
privacyMap = new WeakMap();
|
|
@@ -2421,19 +2429,19 @@ function parse$1(root, init) {
|
|
|
2421
2429
|
try {
|
|
2422
2430
|
// Parse unmask configuration into separate query selectors and override tokens as part of initialization
|
|
2423
2431
|
if (init) {
|
|
2424
|
-
config$1.unmask.forEach(function (x) { return x.indexOf("!" /* Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
|
|
2432
|
+
config$1.unmask.forEach(function (x) { return x.indexOf("!" /* Constant.Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
|
|
2425
2433
|
}
|
|
2426
2434
|
// Since mutations may happen on leaf nodes too, e.g. text nodes, which may not support all selector APIs.
|
|
2427
2435
|
// We ensure that the root note supports querySelectorAll API before executing the code below to identify new regions.
|
|
2428
2436
|
if ("querySelectorAll" in root) {
|
|
2429
|
-
config$1.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, ""
|
|
2430
|
-
config$1.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /* TextImage */); }); }); // Masked Elements
|
|
2437
|
+
config$1.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, "".concat(x[0])); }); }); // Regions
|
|
2438
|
+
config$1.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /* Privacy.TextImage */); }); }); // Masked Elements
|
|
2431
2439
|
config$1.fraud.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return fraudMap.set(e, x[0]); }); }); // Fraud Check
|
|
2432
|
-
unmask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 0 /* None */); }); }); // Unmasked Elements
|
|
2440
|
+
unmask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 0 /* Privacy.None */); }); }); // Unmasked Elements
|
|
2433
2441
|
}
|
|
2434
2442
|
}
|
|
2435
2443
|
catch (e) {
|
|
2436
|
-
log$1(5 /* Selector */, 1 /* Warning */, e ? e.name : null);
|
|
2444
|
+
log$1(5 /* Code.Selector */, 1 /* Severity.Warning */, e ? e.name : null);
|
|
2437
2445
|
}
|
|
2438
2446
|
}
|
|
2439
2447
|
function getId(node, autogen) {
|
|
@@ -2456,7 +2464,7 @@ function add(node, parent, data, source) {
|
|
|
2456
2464
|
var regionId = exists(node) ? id : null;
|
|
2457
2465
|
var fragmentId = null;
|
|
2458
2466
|
var fraudId = fraudMap.has(node) ? fraudMap.get(node) : null;
|
|
2459
|
-
var privacyId = config$1.content ? 1 /* Sensitive */ : 3 /* TextImage */;
|
|
2467
|
+
var privacyId = config$1.content ? 1 /* Privacy.Sensitive */ : 3 /* Privacy.TextImage */;
|
|
2460
2468
|
if (parentId >= 0 && values[parentId]) {
|
|
2461
2469
|
parentValue = values[parentId];
|
|
2462
2470
|
parentValue.children.push(id);
|
|
@@ -2466,8 +2474,8 @@ function add(node, parent, data, source) {
|
|
|
2466
2474
|
privacyId = parentValue.metadata.privacy;
|
|
2467
2475
|
}
|
|
2468
2476
|
// If there's an explicit region attribute set on the element, use it to mark a region on the page
|
|
2469
|
-
if (data.attributes && "data-clarity-region" /* RegionData */ in data.attributes) {
|
|
2470
|
-
observe$1(node, data.attributes["data-clarity-region" /* RegionData */]);
|
|
2477
|
+
if (data.attributes && "data-clarity-region" /* Constant.RegionData */ in data.attributes) {
|
|
2478
|
+
observe$1(node, data.attributes["data-clarity-region" /* Constant.RegionData */]);
|
|
2471
2479
|
regionId = id;
|
|
2472
2480
|
}
|
|
2473
2481
|
nodes[id] = node;
|
|
@@ -2545,7 +2553,7 @@ function update$1(node, parent, data, source) {
|
|
|
2545
2553
|
}
|
|
2546
2554
|
function sameorigin(node) {
|
|
2547
2555
|
var output = false;
|
|
2548
|
-
if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "IFRAME" /* IFrameTag */) {
|
|
2556
|
+
if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "IFRAME" /* Constant.IFrameTag */) {
|
|
2549
2557
|
var frame = node;
|
|
2550
2558
|
// To determine if the iframe is same-origin or not, we try accessing it's contentDocument.
|
|
2551
2559
|
// If the browser throws an exception, we assume it's cross-origin and move on.
|
|
@@ -2572,11 +2580,11 @@ function privacy(node, value, parent) {
|
|
|
2572
2580
|
var attributes = data.attributes || {};
|
|
2573
2581
|
var tag = data.tag.toUpperCase();
|
|
2574
2582
|
switch (true) {
|
|
2575
|
-
case "data-clarity-mask" /* MaskData */ in attributes:
|
|
2576
|
-
metadata.privacy = 3 /* TextImage */;
|
|
2583
|
+
case "data-clarity-mask" /* Constant.MaskData */ in attributes:
|
|
2584
|
+
metadata.privacy = 3 /* Privacy.TextImage */;
|
|
2577
2585
|
break;
|
|
2578
|
-
case "data-clarity-unmask" /* UnmaskData */ in attributes:
|
|
2579
|
-
metadata.privacy = 0 /* None */;
|
|
2586
|
+
case "data-clarity-unmask" /* Constant.UnmaskData */ in attributes:
|
|
2587
|
+
metadata.privacy = 0 /* Privacy.None */;
|
|
2580
2588
|
break;
|
|
2581
2589
|
case privacyMap.has(node):
|
|
2582
2590
|
// If this node was explicitly configured to contain sensitive content, honor that privacy setting
|
|
@@ -2584,38 +2592,38 @@ function privacy(node, value, parent) {
|
|
|
2584
2592
|
break;
|
|
2585
2593
|
case fraudMap.has(node):
|
|
2586
2594
|
// If this node was explicitly configured to be evaluated for fraud, then also mask content
|
|
2587
|
-
metadata.privacy = 2 /* Text */;
|
|
2595
|
+
metadata.privacy = 2 /* Privacy.Text */;
|
|
2588
2596
|
break;
|
|
2589
|
-
case tag === "*T" /* TextTag */:
|
|
2597
|
+
case tag === "*T" /* Constant.TextTag */:
|
|
2590
2598
|
// If it's a text node belonging to a STYLE or TITLE tag or one of scrub exceptions, then capture content
|
|
2591
|
-
var pTag = parent && parent.data ? parent.data.tag : "" /* Empty */;
|
|
2592
|
-
var pSelector_1 = parent && parent.selector ? parent.selector[1 /* Default */] : "" /* Empty */;
|
|
2593
|
-
var tags = ["STYLE" /* StyleTag */, "TITLE" /* TitleTag */, "svg:style" /* SvgStyle */];
|
|
2594
|
-
metadata.privacy = tags.includes(pTag) || override.some(function (x) { return pSelector_1.indexOf(x) >= 0; }) ? 0 /* None */ : current;
|
|
2599
|
+
var pTag = parent && parent.data ? parent.data.tag : "" /* Constant.Empty */;
|
|
2600
|
+
var pSelector_1 = parent && parent.selector ? parent.selector[1 /* Selector.Default */] : "" /* Constant.Empty */;
|
|
2601
|
+
var tags = ["STYLE" /* Constant.StyleTag */, "TITLE" /* Constant.TitleTag */, "svg:style" /* Constant.SvgStyle */];
|
|
2602
|
+
metadata.privacy = tags.includes(pTag) || override.some(function (x) { return pSelector_1.indexOf(x) >= 0; }) ? 0 /* Privacy.None */ : current;
|
|
2595
2603
|
break;
|
|
2596
|
-
case tag === "INPUT" /* InputTag */ && current === 0 /* None */:
|
|
2604
|
+
case tag === "INPUT" /* Constant.InputTag */ && current === 0 /* Privacy.None */:
|
|
2597
2605
|
// If even default privacy setting is to not mask, we still scan through input fields for any sensitive information
|
|
2598
|
-
var field_1 = "" /* Empty */;
|
|
2606
|
+
var field_1 = "" /* Constant.Empty */;
|
|
2599
2607
|
Object.keys(attributes).forEach(function (x) { return field_1 += attributes[x].toLowerCase(); });
|
|
2600
2608
|
metadata.privacy = inspect(field_1, maskInput, metadata);
|
|
2601
2609
|
break;
|
|
2602
|
-
case tag === "INPUT" /* InputTag */ && current === 1 /* Sensitive */:
|
|
2610
|
+
case tag === "INPUT" /* Constant.InputTag */ && current === 1 /* Privacy.Sensitive */:
|
|
2603
2611
|
// Look through class names to aggressively mask content
|
|
2604
|
-
metadata.privacy = inspect(attributes["class" /* Class */], maskText, metadata);
|
|
2612
|
+
metadata.privacy = inspect(attributes["class" /* Constant.Class */], maskText, metadata);
|
|
2605
2613
|
// If this node has an explicit type assigned to it, go through masking rules to determine right privacy setting
|
|
2606
|
-
metadata.privacy = inspect(attributes["type" /* Type */], maskInput, metadata);
|
|
2614
|
+
metadata.privacy = inspect(attributes["type" /* Constant.Type */], maskInput, metadata);
|
|
2607
2615
|
// If it's a button or an input option, make an exception to disable masking in sensitive mode
|
|
2608
|
-
metadata.privacy = maskDisable.indexOf(attributes["type" /* Type */]) >= 0 ? 0 /* None */ : metadata.privacy;
|
|
2616
|
+
metadata.privacy = maskDisable.indexOf(attributes["type" /* Constant.Type */]) >= 0 ? 0 /* Privacy.None */ : metadata.privacy;
|
|
2609
2617
|
break;
|
|
2610
|
-
case current === 1 /* Sensitive */:
|
|
2618
|
+
case current === 1 /* Privacy.Sensitive */:
|
|
2611
2619
|
// In a mode where we mask sensitive information by default, look through class names to aggressively mask content
|
|
2612
|
-
metadata.privacy = inspect(attributes["class" /* Class */], maskText, metadata);
|
|
2620
|
+
metadata.privacy = inspect(attributes["class" /* Constant.Class */], maskText, metadata);
|
|
2613
2621
|
break;
|
|
2614
2622
|
}
|
|
2615
2623
|
}
|
|
2616
2624
|
function inspect(input, lookup, metadata) {
|
|
2617
2625
|
if (input && lookup.some(function (x) { return input.indexOf(x) >= 0; })) {
|
|
2618
|
-
return 2 /* Text */;
|
|
2626
|
+
return 2 /* Privacy.Text */;
|
|
2619
2627
|
}
|
|
2620
2628
|
return metadata.privacy;
|
|
2621
2629
|
}
|
|
@@ -2653,7 +2661,7 @@ function updateSelector(value) {
|
|
|
2653
2661
|
var d = value.data;
|
|
2654
2662
|
var p = position(parent, value);
|
|
2655
2663
|
var s = { id: value.id, tag: d.tag, prefix: prefix, position: p, attributes: d.attributes };
|
|
2656
|
-
value.selector = [get$1(s, 0 /* Alpha */), get$1(s, 1 /* Beta */)];
|
|
2664
|
+
value.selector = [get$1(s, 0 /* Selector.Alpha */), get$1(s, 1 /* Selector.Beta */)];
|
|
2657
2665
|
value.hash = value.selector.map(function (x) { return x ? hash(x) : null; });
|
|
2658
2666
|
value.hash.forEach(function (h) { return hashMap[h] = value.id; });
|
|
2659
2667
|
// Match fragment configuration against both alpha and beta hash
|
|
@@ -2661,6 +2669,11 @@ function updateSelector(value) {
|
|
|
2661
2669
|
value.fragment = value.id;
|
|
2662
2670
|
}
|
|
2663
2671
|
}
|
|
2672
|
+
function hashText(hash) {
|
|
2673
|
+
var id = lookup(hash);
|
|
2674
|
+
var node = getNode(id);
|
|
2675
|
+
return node !== null && node.textContent !== null ? node.textContent.substr(0, 25 /* Setting.ClickText */) : '';
|
|
2676
|
+
}
|
|
2664
2677
|
function getNode(id) {
|
|
2665
2678
|
if (id in nodes) {
|
|
2666
2679
|
return nodes[id];
|
|
@@ -2708,7 +2721,7 @@ function remove(id, source) {
|
|
|
2708
2721
|
}
|
|
2709
2722
|
function size(value) {
|
|
2710
2723
|
// If this element is a image node, and is masked, then track box model for the current element
|
|
2711
|
-
if (value.data.tag === "IMG" /* ImageTag */ && value.metadata.privacy === 3 /* TextImage */) {
|
|
2724
|
+
if (value.data.tag === "IMG" /* Constant.ImageTag */ && value.metadata.privacy === 3 /* Privacy.TextImage */) {
|
|
2712
2725
|
value.metadata.size = [];
|
|
2713
2726
|
}
|
|
2714
2727
|
}
|
|
@@ -2743,7 +2756,7 @@ function track$4(id, source, fragment, changed, parentChanged) {
|
|
|
2743
2756
|
// Edge case: If an element is added later on, and pre-discovered element is moved as a child.
|
|
2744
2757
|
// In that case, we need to reorder the pre-discovered element in the update list to keep visualization consistent.
|
|
2745
2758
|
var uIndex = updateMap.indexOf(id);
|
|
2746
|
-
if (uIndex >= 0 && source === 1 /* ChildListAdd */ && parentChanged) {
|
|
2759
|
+
if (uIndex >= 0 && source === 1 /* Source.ChildListAdd */ && parentChanged) {
|
|
2747
2760
|
updateMap.splice(uIndex, 1);
|
|
2748
2761
|
updateMap.push(id);
|
|
2749
2762
|
}
|
|
@@ -2789,15 +2802,15 @@ function exists(node) {
|
|
|
2789
2802
|
}
|
|
2790
2803
|
function track$3(id, event) {
|
|
2791
2804
|
var node = getNode(id);
|
|
2792
|
-
var data = id in regions ? regions[id] : { id: id, visibility: 0 /* Rendered */, interaction: 16 /* None */, name: regionMap.get(node) };
|
|
2805
|
+
var data = id in regions ? regions[id] : { id: id, visibility: 0 /* RegionVisibility.Rendered */, interaction: 16 /* InteractionState.None */, name: regionMap.get(node) };
|
|
2793
2806
|
// Determine the interaction state based on incoming event
|
|
2794
|
-
var interaction = 16 /* None */;
|
|
2807
|
+
var interaction = 16 /* InteractionState.None */;
|
|
2795
2808
|
switch (event) {
|
|
2796
|
-
case 9 /* Click */:
|
|
2797
|
-
interaction = 20 /* Clicked */;
|
|
2809
|
+
case 9 /* Event.Click */:
|
|
2810
|
+
interaction = 20 /* InteractionState.Clicked */;
|
|
2798
2811
|
break;
|
|
2799
|
-
case 27 /* Input */:
|
|
2800
|
-
interaction = 30 /* Input */;
|
|
2812
|
+
case 27 /* Event.Input */:
|
|
2813
|
+
interaction = 30 /* InteractionState.Input */;
|
|
2801
2814
|
break;
|
|
2802
2815
|
}
|
|
2803
2816
|
// Process updates to this region, if applicable
|
|
@@ -2825,7 +2838,7 @@ function compute$6() {
|
|
|
2825
2838
|
queue$1 = q;
|
|
2826
2839
|
// Schedule encode only when we have at least one valid data entry
|
|
2827
2840
|
if (state$1.length > 0) {
|
|
2828
|
-
encode$4(7 /* Region */);
|
|
2841
|
+
encode$4(7 /* Event.Region */);
|
|
2829
2842
|
}
|
|
2830
2843
|
}
|
|
2831
2844
|
function handler$1(entries) {
|
|
@@ -2841,27 +2854,27 @@ function handler$1(entries) {
|
|
|
2841
2854
|
// Also, if these regions ever become non-zero width or height (through AJAX, user action or orientation change) - we will automatically start monitoring them from that point onwards
|
|
2842
2855
|
if (regionMap.has(target) && rect.width + rect.height > 0 && viewport.width > 0 && viewport.height > 0) {
|
|
2843
2856
|
var id = target ? getId(target) : null;
|
|
2844
|
-
var data = id in regions ? regions[id] : { id: id, name: regionMap.get(target), interaction: 16 /* None */, visibility: 0 /* Rendered */ };
|
|
2857
|
+
var data = id in regions ? regions[id] : { id: id, name: regionMap.get(target), interaction: 16 /* InteractionState.None */, visibility: 0 /* RegionVisibility.Rendered */ };
|
|
2845
2858
|
// For regions that have relatively smaller area, we look at intersection ratio and see the overlap relative to element's area
|
|
2846
2859
|
// However, for larger regions, area of regions could be bigger than viewport and therefore comparison is relative to visible area
|
|
2847
2860
|
var viewportRatio = overlap ? (overlap.width * overlap.height * 1.0) / (viewport.width * viewport.height) : 0;
|
|
2848
|
-
var visible = viewportRatio > 0.05 /* ViewportIntersectionRatio */ || entry.intersectionRatio > 0.8 /* IntersectionRatio */;
|
|
2861
|
+
var visible = viewportRatio > 0.05 /* Setting.ViewportIntersectionRatio */ || entry.intersectionRatio > 0.8 /* Setting.IntersectionRatio */;
|
|
2849
2862
|
// If an element is either visible or was visible and has been scrolled to the end
|
|
2850
2863
|
// i.e. Scrolled to end is determined by if the starting position of the element + the window height is more than the total element height.
|
|
2851
2864
|
// starting position is relative to the viewport - so Intersection observer returns a negative value for rect.top to indicate that the element top is above the viewport
|
|
2852
|
-
var scrolledToEnd = (visible || data.visibility == 10 /* Visible */) && Math.abs(rect.top) + viewport.height > rect.height;
|
|
2865
|
+
var scrolledToEnd = (visible || data.visibility == 10 /* RegionVisibility.Visible */) && Math.abs(rect.top) + viewport.height > rect.height;
|
|
2853
2866
|
// Process updates to this region, if applicable
|
|
2854
2867
|
process$1(target, data, data.interaction, (scrolledToEnd ?
|
|
2855
|
-
13 /* ScrolledToEnd */ :
|
|
2856
|
-
(visible ? 10 /* Visible */ : 0 /* Rendered */)));
|
|
2868
|
+
13 /* RegionVisibility.ScrolledToEnd */ :
|
|
2869
|
+
(visible ? 10 /* RegionVisibility.Visible */ : 0 /* RegionVisibility.Rendered */)));
|
|
2857
2870
|
// Stop observing this element now that we have already received scrolled signal
|
|
2858
|
-
if (data.visibility >= 13 /* ScrolledToEnd */ && observer$1) {
|
|
2871
|
+
if (data.visibility >= 13 /* RegionVisibility.ScrolledToEnd */ && observer$1) {
|
|
2859
2872
|
observer$1.unobserve(target);
|
|
2860
2873
|
}
|
|
2861
2874
|
}
|
|
2862
2875
|
}
|
|
2863
2876
|
if (state$1.length > 0) {
|
|
2864
|
-
encode$4(7 /* Region */);
|
|
2877
|
+
encode$4(7 /* Event.Region */);
|
|
2865
2878
|
}
|
|
2866
2879
|
}
|
|
2867
2880
|
function process$1(n, d, s, v) {
|
|
@@ -2920,7 +2933,7 @@ function link(node) {
|
|
|
2920
2933
|
function metadata$2(node, event, text) {
|
|
2921
2934
|
if (text === void 0) { text = null; }
|
|
2922
2935
|
// If the node is null, we return a reserved value for id: 0. Valid assignment of id begins from 1+.
|
|
2923
|
-
var output = { id: 0, hash: null, privacy: 2 /* Text */, node: node };
|
|
2936
|
+
var output = { id: 0, hash: null, privacy: 2 /* Privacy.Text */, node: node };
|
|
2924
2937
|
if (node) {
|
|
2925
2938
|
var value = get(node);
|
|
2926
2939
|
if (value !== null) {
|
|
@@ -2946,15 +2959,15 @@ function encode$3 (type) {
|
|
|
2946
2959
|
t = time();
|
|
2947
2960
|
tokens = [t, type];
|
|
2948
2961
|
switch (type) {
|
|
2949
|
-
case 13 /* MouseDown */:
|
|
2950
|
-
case 14 /* MouseUp */:
|
|
2951
|
-
case 12 /* MouseMove */:
|
|
2952
|
-
case 15 /* MouseWheel */:
|
|
2953
|
-
case 16 /* DoubleClick */:
|
|
2954
|
-
case 17 /* TouchStart */:
|
|
2955
|
-
case 18 /* TouchEnd */:
|
|
2956
|
-
case 19 /* TouchMove */:
|
|
2957
|
-
case 20 /* TouchCancel */:
|
|
2962
|
+
case 13 /* Event.MouseDown */:
|
|
2963
|
+
case 14 /* Event.MouseUp */:
|
|
2964
|
+
case 12 /* Event.MouseMove */:
|
|
2965
|
+
case 15 /* Event.MouseWheel */:
|
|
2966
|
+
case 16 /* Event.DoubleClick */:
|
|
2967
|
+
case 17 /* Event.TouchStart */:
|
|
2968
|
+
case 18 /* Event.TouchEnd */:
|
|
2969
|
+
case 19 /* Event.TouchMove */:
|
|
2970
|
+
case 20 /* Event.TouchCancel */:
|
|
2958
2971
|
for (_i = 0, _a = state$4; _i < _a.length; _i++) {
|
|
2959
2972
|
entry = _a[_i];
|
|
2960
2973
|
pTarget = metadata$2(entry.data.target, entry.event);
|
|
@@ -2969,12 +2982,12 @@ function encode$3 (type) {
|
|
|
2969
2982
|
}
|
|
2970
2983
|
reset$e();
|
|
2971
2984
|
break;
|
|
2972
|
-
case 9 /* Click */:
|
|
2985
|
+
case 9 /* Event.Click */:
|
|
2973
2986
|
for (_b = 0, _c = state$7; _b < _c.length; _b++) {
|
|
2974
2987
|
entry = _c[_b];
|
|
2975
2988
|
cTarget = metadata$2(entry.data.target, entry.event, entry.data.text);
|
|
2976
2989
|
tokens = [entry.time, entry.event];
|
|
2977
|
-
cHash = cTarget.hash.join("." /* Dot */);
|
|
2990
|
+
cHash = cTarget.hash.join("." /* Constant.Dot */);
|
|
2978
2991
|
tokens.push(cTarget.id);
|
|
2979
2992
|
tokens.push(entry.data.x);
|
|
2980
2993
|
tokens.push(entry.data.y);
|
|
@@ -2992,7 +3005,7 @@ function encode$3 (type) {
|
|
|
2992
3005
|
}
|
|
2993
3006
|
reset$h();
|
|
2994
3007
|
break;
|
|
2995
|
-
case 38 /* Clipboard */:
|
|
3008
|
+
case 38 /* Event.Clipboard */:
|
|
2996
3009
|
for (_d = 0, _e = state$6; _d < _e.length; _d++) {
|
|
2997
3010
|
entry = _e[_d];
|
|
2998
3011
|
tokens = [entry.time, entry.event];
|
|
@@ -3005,7 +3018,7 @@ function encode$3 (type) {
|
|
|
3005
3018
|
}
|
|
3006
3019
|
reset$g();
|
|
3007
3020
|
break;
|
|
3008
|
-
case 11 /* Resize */:
|
|
3021
|
+
case 11 /* Event.Resize */:
|
|
3009
3022
|
r = data$b;
|
|
3010
3023
|
tokens.push(r.width);
|
|
3011
3024
|
tokens.push(r.height);
|
|
@@ -3013,13 +3026,13 @@ function encode$3 (type) {
|
|
|
3013
3026
|
reset$d();
|
|
3014
3027
|
queue(tokens);
|
|
3015
3028
|
break;
|
|
3016
|
-
case 26 /* Unload */:
|
|
3029
|
+
case 26 /* Event.Unload */:
|
|
3017
3030
|
u = data$9;
|
|
3018
3031
|
tokens.push(u.name);
|
|
3019
3032
|
reset$9();
|
|
3020
3033
|
queue(tokens);
|
|
3021
3034
|
break;
|
|
3022
|
-
case 27 /* Input */:
|
|
3035
|
+
case 27 /* Event.Input */:
|
|
3023
3036
|
for (_f = 0, _g = state$5; _f < _g.length; _f++) {
|
|
3024
3037
|
entry = _g[_f];
|
|
3025
3038
|
iTarget = metadata$2(entry.data.target, entry.event, entry.data.value);
|
|
@@ -3030,7 +3043,7 @@ function encode$3 (type) {
|
|
|
3030
3043
|
}
|
|
3031
3044
|
reset$f();
|
|
3032
3045
|
break;
|
|
3033
|
-
case 21 /* Selection */:
|
|
3046
|
+
case 21 /* Event.Selection */:
|
|
3034
3047
|
s = data$a;
|
|
3035
3048
|
if (s) {
|
|
3036
3049
|
startTarget = metadata$2(s.start, type);
|
|
@@ -3043,7 +3056,7 @@ function encode$3 (type) {
|
|
|
3043
3056
|
queue(tokens);
|
|
3044
3057
|
}
|
|
3045
3058
|
break;
|
|
3046
|
-
case 10 /* Scroll */:
|
|
3059
|
+
case 10 /* Event.Scroll */:
|
|
3047
3060
|
for (_h = 0, _j = state$3; _h < _j.length; _h++) {
|
|
3048
3061
|
entry = _j[_h];
|
|
3049
3062
|
sTarget = metadata$2(entry.data.target, entry.event);
|
|
@@ -3058,7 +3071,7 @@ function encode$3 (type) {
|
|
|
3058
3071
|
}
|
|
3059
3072
|
reset$c();
|
|
3060
3073
|
break;
|
|
3061
|
-
case 39 /* Submit */:
|
|
3074
|
+
case 39 /* Event.Submit */:
|
|
3062
3075
|
for (_k = 0, _l = state$2; _k < _l.length; _k++) {
|
|
3063
3076
|
entry = _l[_k];
|
|
3064
3077
|
tokens = [entry.time, entry.event];
|
|
@@ -3070,7 +3083,7 @@ function encode$3 (type) {
|
|
|
3070
3083
|
}
|
|
3071
3084
|
reset$a();
|
|
3072
3085
|
break;
|
|
3073
|
-
case 22 /* Timeline */:
|
|
3086
|
+
case 22 /* Event.Timeline */:
|
|
3074
3087
|
for (_m = 0, _o = updates$1; _m < _o.length; _m++) {
|
|
3075
3088
|
entry = _o[_m];
|
|
3076
3089
|
tokens = [entry.time, entry.event];
|
|
@@ -3084,7 +3097,7 @@ function encode$3 (type) {
|
|
|
3084
3097
|
}
|
|
3085
3098
|
reset$5();
|
|
3086
3099
|
break;
|
|
3087
|
-
case 28 /* Visibility */:
|
|
3100
|
+
case 28 /* Event.Visibility */:
|
|
3088
3101
|
v = data$8;
|
|
3089
3102
|
tokens.push(v.visible);
|
|
3090
3103
|
queue(tokens);
|
|
@@ -3107,11 +3120,11 @@ function reset$5() {
|
|
|
3107
3120
|
updates$1 = [];
|
|
3108
3121
|
}
|
|
3109
3122
|
function track$2(time, event, hash, x, y, reaction, context) {
|
|
3110
|
-
if (reaction === void 0) { reaction = 1 /* True */; }
|
|
3111
|
-
if (context === void 0) { context = 0 /* Self */; }
|
|
3123
|
+
if (reaction === void 0) { reaction = 1 /* BooleanFlag.True */; }
|
|
3124
|
+
if (context === void 0) { context = 0 /* BrowsingContext.Self */; }
|
|
3112
3125
|
state.push({
|
|
3113
3126
|
time: time,
|
|
3114
|
-
event: 22 /* Timeline */,
|
|
3127
|
+
event: 22 /* Event.Timeline */,
|
|
3115
3128
|
data: {
|
|
3116
3129
|
type: event,
|
|
3117
3130
|
hash: hash,
|
|
@@ -3130,7 +3143,7 @@ function compute$5() {
|
|
|
3130
3143
|
var temp = [];
|
|
3131
3144
|
updates$1 = [];
|
|
3132
3145
|
var max = data$1.start + data$1.duration;
|
|
3133
|
-
var min = Math.max(max - 2000 /* TimelineSpan */, 0);
|
|
3146
|
+
var min = Math.max(max - 2000 /* Setting.TimelineSpan */, 0);
|
|
3134
3147
|
for (var _i = 0, state_1 = state; _i < state_1.length; _i++) {
|
|
3135
3148
|
var s = state_1[_i];
|
|
3136
3149
|
if (s.time >= min) {
|
|
@@ -3141,7 +3154,7 @@ function compute$5() {
|
|
|
3141
3154
|
}
|
|
3142
3155
|
}
|
|
3143
3156
|
state = temp; // Drop events less than the min time
|
|
3144
|
-
encode$3(22 /* Timeline */);
|
|
3157
|
+
encode$3(22 /* Event.Timeline */);
|
|
3145
3158
|
}
|
|
3146
3159
|
function stop$e() {
|
|
3147
3160
|
state = [];
|
|
@@ -3174,10 +3187,10 @@ function queue(tokens, transmit) {
|
|
|
3174
3187
|
var type = tokens.length > 1 ? tokens[1] : null;
|
|
3175
3188
|
var event_1 = JSON.stringify(tokens);
|
|
3176
3189
|
switch (type) {
|
|
3177
|
-
case 5 /* Discover */:
|
|
3190
|
+
case 5 /* Event.Discover */:
|
|
3178
3191
|
discoverBytes += event_1.length;
|
|
3179
|
-
case 37 /* Box */:
|
|
3180
|
-
case 6 /* Mutation */:
|
|
3192
|
+
case 37 /* Event.Box */:
|
|
3193
|
+
case 6 /* Event.Mutation */:
|
|
3181
3194
|
playbackBytes += event_1.length;
|
|
3182
3195
|
playback.push(event_1);
|
|
3183
3196
|
break;
|
|
@@ -3186,7 +3199,7 @@ function queue(tokens, transmit) {
|
|
|
3186
3199
|
break;
|
|
3187
3200
|
}
|
|
3188
3201
|
// Increment event count metric
|
|
3189
|
-
count$1(25 /* EventCount */);
|
|
3202
|
+
count$1(25 /* Metric.EventCount */);
|
|
3190
3203
|
// Following two checks are precautionary and act as a fail safe mechanism to get out of unexpected situations.
|
|
3191
3204
|
// Check 1: If for any reason the upload hasn't happened after waiting for 2x the config.delay time,
|
|
3192
3205
|
// reset the timer. This allows Clarity to attempt an upload again.
|
|
@@ -3199,7 +3212,7 @@ function queue(tokens, transmit) {
|
|
|
3199
3212
|
// However, in certain scenarios - like metric calculation - which are triggered as part of an existing upload
|
|
3200
3213
|
// We enrich the data going out with the existing upload. In these cases, call to upload comes with 'transmit' set to false.
|
|
3201
3214
|
if (transmit && timeout === null) {
|
|
3202
|
-
if (type !== 25 /* Ping */) {
|
|
3215
|
+
if (type !== 25 /* Event.Ping */) {
|
|
3203
3216
|
reset$n();
|
|
3204
3217
|
}
|
|
3205
3218
|
timeout = setTimeout(upload, gap);
|
|
@@ -3228,9 +3241,9 @@ function upload(final) {
|
|
|
3228
3241
|
switch (_b.label) {
|
|
3229
3242
|
case 0:
|
|
3230
3243
|
timeout = null;
|
|
3231
|
-
sendPlaybackBytes = config$1.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* MaxFirstPayloadBytes */ || data$1.sequence > 0);
|
|
3244
|
+
sendPlaybackBytes = config$1.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* Setting.MaxFirstPayloadBytes */ || data$1.sequence > 0);
|
|
3232
3245
|
if (sendPlaybackBytes) {
|
|
3233
|
-
max(1 /* Playback */, 1 /* True */);
|
|
3246
|
+
max(1 /* Metric.Playback */, 1 /* BooleanFlag.True */);
|
|
3234
3247
|
}
|
|
3235
3248
|
// CAUTION: Ensure "transmit" is set to false in the queue function for following events
|
|
3236
3249
|
// Otherwise you run a risk of infinite loop.
|
|
@@ -3239,8 +3252,8 @@ function upload(final) {
|
|
|
3239
3252
|
compute$8();
|
|
3240
3253
|
last = final === true;
|
|
3241
3254
|
e = JSON.stringify(envelope(last));
|
|
3242
|
-
a = "["
|
|
3243
|
-
p = sendPlaybackBytes ? "["
|
|
3255
|
+
a = "[".concat(analysis.join(), "]");
|
|
3256
|
+
p = sendPlaybackBytes ? "[".concat(playback.join(), "]") : "" /* Constant.Empty */;
|
|
3244
3257
|
encoded = { e: e, a: a, p: p };
|
|
3245
3258
|
payload = stringify(encoded);
|
|
3246
3259
|
if (!last) return [3 /*break*/, 1];
|
|
@@ -3252,7 +3265,7 @@ function upload(final) {
|
|
|
3252
3265
|
_b.label = 3;
|
|
3253
3266
|
case 3:
|
|
3254
3267
|
zipped = _a;
|
|
3255
|
-
sum(2 /* TotalBytes */, zipped ? zipped.length : payload.length);
|
|
3268
|
+
sum(2 /* Metric.TotalBytes */, zipped ? zipped.length : payload.length);
|
|
3256
3269
|
send(payload, zipped, data$1.sequence, last);
|
|
3257
3270
|
// Clear out events now that payload has been dispatched
|
|
3258
3271
|
analysis = [];
|
|
@@ -3267,12 +3280,12 @@ function upload(final) {
|
|
|
3267
3280
|
});
|
|
3268
3281
|
}
|
|
3269
3282
|
function stringify(encoded) {
|
|
3270
|
-
return encoded.p.length > 0 ? "{\"e\":"
|
|
3283
|
+
return encoded.p.length > 0 ? "{\"e\":".concat(encoded.e, ",\"a\":").concat(encoded.a, ",\"p\":").concat(encoded.p, "}") : "{\"e\":".concat(encoded.e, ",\"a\":").concat(encoded.a, "}");
|
|
3271
3284
|
}
|
|
3272
3285
|
function send(payload, zipped, sequence, beacon) {
|
|
3273
3286
|
if (beacon === void 0) { beacon = false; }
|
|
3274
3287
|
// Upload data if a valid URL is defined in the config
|
|
3275
|
-
if (typeof config$1.upload === "string" /* String */) {
|
|
3288
|
+
if (typeof config$1.upload === "string" /* Constant.String */) {
|
|
3276
3289
|
var url = config$1.upload;
|
|
3277
3290
|
var dispatched = false;
|
|
3278
3291
|
// If it's the last payload, attempt to upload using sendBeacon first.
|
|
@@ -3311,7 +3324,7 @@ function send(payload, zipped, sequence, beacon) {
|
|
|
3311
3324
|
xhr_1.withCredentials = true;
|
|
3312
3325
|
if (zipped) {
|
|
3313
3326
|
// If we do have valid compressed array, send it with appropriate HTTP headers so server can decode it appropriately
|
|
3314
|
-
xhr_1.setRequestHeader("Accept" /* Accept */, "application/x-clarity-gzip" /* ClarityGzip */);
|
|
3327
|
+
xhr_1.setRequestHeader("Accept" /* Constant.Accept */, "application/x-clarity-gzip" /* Constant.ClarityGzip */);
|
|
3315
3328
|
xhr_1.send(zipped);
|
|
3316
3329
|
}
|
|
3317
3330
|
else {
|
|
@@ -3328,13 +3341,13 @@ function send(payload, zipped, sequence, beacon) {
|
|
|
3328
3341
|
}
|
|
3329
3342
|
function check$3(xhr, sequence) {
|
|
3330
3343
|
var transitData = transit[sequence];
|
|
3331
|
-
if (xhr && xhr.readyState === 4 /* Done */ && transitData) {
|
|
3344
|
+
if (xhr && xhr.readyState === 4 /* XMLReadyState.Done */ && transitData) {
|
|
3332
3345
|
// Attempt send payload again (as configured in settings) if we do not receive a success (2XX) response code back from the server
|
|
3333
|
-
if ((xhr.status < 200 || xhr.status > 208) && transitData.attempts <= 1 /* RetryLimit */) {
|
|
3346
|
+
if ((xhr.status < 200 || xhr.status > 208) && transitData.attempts <= 1 /* Setting.RetryLimit */) {
|
|
3334
3347
|
// We re-attempt in all cases except when server explicitly rejects our request with 4XX error
|
|
3335
3348
|
if (xhr.status >= 400 && xhr.status < 500) {
|
|
3336
3349
|
// In case of a 4XX response from the server, we bail out instead of trying again
|
|
3337
|
-
trigger(6 /* Server */);
|
|
3350
|
+
trigger(6 /* Check.Server */);
|
|
3338
3351
|
}
|
|
3339
3352
|
else {
|
|
3340
3353
|
// Browser will send status = 0 when it refuses to put network request over the wire
|
|
@@ -3355,7 +3368,7 @@ function check$3(xhr, sequence) {
|
|
|
3355
3368
|
track$1 = { sequence: sequence, attempts: transitData.attempts, status: xhr.status };
|
|
3356
3369
|
// Send back an event only if we were not successful in our first attempt
|
|
3357
3370
|
if (transitData.attempts > 1) {
|
|
3358
|
-
encode$1(2 /* Upload */);
|
|
3371
|
+
encode$1(2 /* Event.Upload */);
|
|
3359
3372
|
}
|
|
3360
3373
|
// Handle response if it was a 200 response with a valid body
|
|
3361
3374
|
if (xhr.status === 200 && xhr.responseText) {
|
|
@@ -3366,7 +3379,7 @@ function check$3(xhr, sequence) {
|
|
|
3366
3379
|
// And, right before we terminate the session, we will attempt one last time to see if we can use
|
|
3367
3380
|
// different transport option (sendBeacon vs. XHR) to get this data to the server for analysis purposes
|
|
3368
3381
|
send(transitData.data, null, sequence, true);
|
|
3369
|
-
trigger(3 /* Retry */);
|
|
3382
|
+
trigger(3 /* Check.Retry */);
|
|
3370
3383
|
}
|
|
3371
3384
|
// Signal that this request completed successfully
|
|
3372
3385
|
if (xhr.status >= 200 && xhr.status <= 208) {
|
|
@@ -3386,21 +3399,21 @@ function done(sequence) {
|
|
|
3386
3399
|
function delay() {
|
|
3387
3400
|
// Progressively increase delay as we continue to send more payloads from the client to the server
|
|
3388
3401
|
// If we are not uploading data to a server, and instead invoking UploadCallback, in that case keep returning configured value
|
|
3389
|
-
var gap = config$1.lean === false && discoverBytes > 0 ? 100 /* MinUploadDelay */ : data$1.sequence * config$1.delay;
|
|
3390
|
-
return typeof config$1.upload === "string" /* String */ ? Math.max(Math.min(gap, 30000 /* MaxUploadDelay */), 100 /* MinUploadDelay */) : config$1.delay;
|
|
3402
|
+
var gap = config$1.lean === false && discoverBytes > 0 ? 100 /* Setting.MinUploadDelay */ : data$1.sequence * config$1.delay;
|
|
3403
|
+
return typeof config$1.upload === "string" /* Constant.String */ ? Math.max(Math.min(gap, 30000 /* Setting.MaxUploadDelay */), 100 /* Setting.MinUploadDelay */) : config$1.delay;
|
|
3391
3404
|
}
|
|
3392
3405
|
function response(payload) {
|
|
3393
|
-
var parts = payload && payload.length > 0 ? payload.split(" ") : ["" /* Empty */];
|
|
3406
|
+
var parts = payload && payload.length > 0 ? payload.split(" ") : ["" /* Constant.Empty */];
|
|
3394
3407
|
switch (parts[0]) {
|
|
3395
|
-
case "END" /* End */:
|
|
3408
|
+
case "END" /* Constant.End */:
|
|
3396
3409
|
// Clear out session storage and end the session so we can start fresh the next time
|
|
3397
|
-
trigger(6 /* Server */);
|
|
3410
|
+
trigger(6 /* Check.Server */);
|
|
3398
3411
|
break;
|
|
3399
|
-
case "UPGRADE" /* Upgrade */:
|
|
3412
|
+
case "UPGRADE" /* Constant.Upgrade */:
|
|
3400
3413
|
// Upgrade current session to send back playback information
|
|
3401
|
-
upgrade("Auto" /* Auto */);
|
|
3414
|
+
upgrade("Auto" /* Constant.Auto */);
|
|
3402
3415
|
break;
|
|
3403
|
-
case "ACTION" /* Action */:
|
|
3416
|
+
case "ACTION" /* Constant.Action */:
|
|
3404
3417
|
// Invoke action callback, if configured and has a valid value
|
|
3405
3418
|
if (config$1.action && parts.length > 1) {
|
|
3406
3419
|
config$1.action(parts[1]);
|
|
@@ -3422,7 +3435,7 @@ function handler(error) {
|
|
|
3422
3435
|
if (!(e.message in history$3)) {
|
|
3423
3436
|
history$3[e.message] = 0;
|
|
3424
3437
|
}
|
|
3425
|
-
if (history$3[e.message]++ >= 5 /* ScriptErrorLimit */) {
|
|
3438
|
+
if (history$3[e.message]++ >= 5 /* Setting.ScriptErrorLimit */) {
|
|
3426
3439
|
return true;
|
|
3427
3440
|
}
|
|
3428
3441
|
// Send back information only if the handled error has valid information
|
|
@@ -3434,7 +3447,7 @@ function handler(error) {
|
|
|
3434
3447
|
stack: e.stack,
|
|
3435
3448
|
source: error["filename"]
|
|
3436
3449
|
};
|
|
3437
|
-
encode$2(31 /* ScriptError */);
|
|
3450
|
+
encode$2(31 /* Event.ScriptError */);
|
|
3438
3451
|
}
|
|
3439
3452
|
return true;
|
|
3440
3453
|
}
|
|
@@ -3445,7 +3458,7 @@ function encode$2 (type) {
|
|
|
3445
3458
|
return __generator(this, function (_a) {
|
|
3446
3459
|
tokens = [time(), type];
|
|
3447
3460
|
switch (type) {
|
|
3448
|
-
case 31 /* ScriptError */:
|
|
3461
|
+
case 31 /* Event.ScriptError */:
|
|
3449
3462
|
tokens.push(data$7.message);
|
|
3450
3463
|
tokens.push(data$7.line);
|
|
3451
3464
|
tokens.push(data$7.column);
|
|
@@ -3453,7 +3466,7 @@ function encode$2 (type) {
|
|
|
3453
3466
|
tokens.push(data$7.source);
|
|
3454
3467
|
queue(tokens);
|
|
3455
3468
|
break;
|
|
3456
|
-
case 33 /* Log */:
|
|
3469
|
+
case 33 /* Event.Log */:
|
|
3457
3470
|
if (data$6) {
|
|
3458
3471
|
tokens.push(data$6.code);
|
|
3459
3472
|
tokens.push(data$6.name);
|
|
@@ -3463,7 +3476,7 @@ function encode$2 (type) {
|
|
|
3463
3476
|
queue(tokens, false);
|
|
3464
3477
|
}
|
|
3465
3478
|
break;
|
|
3466
|
-
case 41 /* Fraud */:
|
|
3479
|
+
case 41 /* Event.Fraud */:
|
|
3467
3480
|
if (data$d) {
|
|
3468
3481
|
tokens.push(data$d.id);
|
|
3469
3482
|
tokens.push(data$d.target);
|
|
@@ -3486,7 +3499,7 @@ function log$1(code, severity, name, message, stack) {
|
|
|
3486
3499
|
if (name === void 0) { name = null; }
|
|
3487
3500
|
if (message === void 0) { message = null; }
|
|
3488
3501
|
if (stack === void 0) { stack = null; }
|
|
3489
|
-
var key = name ? name
|
|
3502
|
+
var key = name ? "".concat(name, "|").concat(message) : "";
|
|
3490
3503
|
// While rare, it's possible for code to fail repeatedly during the lifetime of the same page
|
|
3491
3504
|
// In those cases, we only want to log the failure once and not spam logs with redundant information.
|
|
3492
3505
|
if (code in history$2 && history$2[code].indexOf(key) >= 0) {
|
|
@@ -3500,7 +3513,7 @@ function log$1(code, severity, name, message, stack) {
|
|
|
3500
3513
|
else {
|
|
3501
3514
|
history$2[code] = [key];
|
|
3502
3515
|
}
|
|
3503
|
-
encode$2(33 /* Log */);
|
|
3516
|
+
encode$2(33 /* Event.Log */);
|
|
3504
3517
|
}
|
|
3505
3518
|
function stop$c() {
|
|
3506
3519
|
history$2 = {};
|
|
@@ -3521,25 +3534,25 @@ function start$c() {
|
|
|
3521
3534
|
var source = e[i];
|
|
3522
3535
|
var key = e[i + 1];
|
|
3523
3536
|
switch (source) {
|
|
3524
|
-
case 0 /* Javascript */:
|
|
3537
|
+
case 0 /* ExtractSource.Javascript */:
|
|
3525
3538
|
var variable = e[i + 2];
|
|
3526
3539
|
variables[key] = parse(variable);
|
|
3527
3540
|
break;
|
|
3528
|
-
case 1 /* Cookie */:
|
|
3541
|
+
case 1 /* ExtractSource.Cookie */:
|
|
3529
3542
|
/*Todo: Add cookie extract logic*/
|
|
3530
3543
|
break;
|
|
3531
|
-
case 2 /* Text */:
|
|
3544
|
+
case 2 /* ExtractSource.Text */:
|
|
3532
3545
|
var match_1 = e[i + 2];
|
|
3533
3546
|
selectors[key] = match_1;
|
|
3534
3547
|
break;
|
|
3535
|
-
case 3 /* Fragment */:
|
|
3548
|
+
case 3 /* ExtractSource.Fragment */:
|
|
3536
3549
|
fragments = e[i + 2];
|
|
3537
3550
|
break;
|
|
3538
3551
|
}
|
|
3539
3552
|
}
|
|
3540
3553
|
}
|
|
3541
3554
|
catch (e) {
|
|
3542
|
-
log$1(8 /* Config */, 1 /* Warning */, e ? e.name : null);
|
|
3555
|
+
log$1(8 /* Code.Config */, 1 /* Severity.Warning */, e ? e.name : null);
|
|
3543
3556
|
}
|
|
3544
3557
|
}
|
|
3545
3558
|
function clone(v) {
|
|
@@ -3561,9 +3574,9 @@ function compute$4() {
|
|
|
3561
3574
|
}
|
|
3562
3575
|
}
|
|
3563
3576
|
catch (e) {
|
|
3564
|
-
log$1(5 /* Selector */, 1 /* Warning */, e ? e.name : null);
|
|
3577
|
+
log$1(5 /* Code.Selector */, 1 /* Severity.Warning */, e ? e.name : null);
|
|
3565
3578
|
}
|
|
3566
|
-
encode$1(40 /* Extract */);
|
|
3579
|
+
encode$1(40 /* Event.Extract */);
|
|
3567
3580
|
}
|
|
3568
3581
|
function reset$4() {
|
|
3569
3582
|
keys = [];
|
|
@@ -3583,15 +3596,15 @@ function stop$b() {
|
|
|
3583
3596
|
}
|
|
3584
3597
|
function parse(variable) {
|
|
3585
3598
|
var syntax = [];
|
|
3586
|
-
var parts = variable.split("." /* Dot */);
|
|
3599
|
+
var parts = variable.split("." /* Constant.Dot */);
|
|
3587
3600
|
while (parts.length > 0) {
|
|
3588
3601
|
var part = parts.shift();
|
|
3589
|
-
var arrayStart = part.indexOf("[" /* ArrayStart */);
|
|
3590
|
-
var conditionStart = part.indexOf("{" /* ConditionStart */);
|
|
3591
|
-
var conditionEnd = part.indexOf("}" /* ConditionEnd */);
|
|
3602
|
+
var arrayStart = part.indexOf("[" /* Constant.ArrayStart */);
|
|
3603
|
+
var conditionStart = part.indexOf("{" /* Constant.ConditionStart */);
|
|
3604
|
+
var conditionEnd = part.indexOf("}" /* Constant.ConditionEnd */);
|
|
3592
3605
|
syntax.push({
|
|
3593
3606
|
name: arrayStart > 0 ? part.substring(0, arrayStart) : (conditionStart > 0 ? part.substring(0, conditionStart) : part),
|
|
3594
|
-
type: arrayStart > 0 ? 1 /* Array */ : (conditionStart > 0 ? 2 /* Object */ : 3 /* Simple */),
|
|
3607
|
+
type: arrayStart > 0 ? 1 /* Type.Array */ : (conditionStart > 0 ? 2 /* Type.Object */ : 3 /* Type.Simple */),
|
|
3595
3608
|
condition: conditionStart > 0 ? part.substring(conditionStart + 1, conditionEnd) : null
|
|
3596
3609
|
});
|
|
3597
3610
|
}
|
|
@@ -3609,7 +3622,7 @@ function evaluate(variable, base) {
|
|
|
3609
3622
|
var output;
|
|
3610
3623
|
if (base && base[part.name]) {
|
|
3611
3624
|
var obj = base[part.name];
|
|
3612
|
-
if (part.type !== 1 /* Array */ && match(obj, part.condition)) {
|
|
3625
|
+
if (part.type !== 1 /* Type.Array */ && match(obj, part.condition)) {
|
|
3613
3626
|
output = evaluate(variable, obj);
|
|
3614
3627
|
}
|
|
3615
3628
|
else if (Array.isArray(obj)) {
|
|
@@ -3631,7 +3644,7 @@ function evaluate(variable, base) {
|
|
|
3631
3644
|
}
|
|
3632
3645
|
function str(input) {
|
|
3633
3646
|
// Automatically trim string to max of Setting.ExtractLimit to avoid fetching long strings
|
|
3634
|
-
return input ? JSON.stringify(input).substring(0, 10000 /* ExtractLimit */) : input;
|
|
3647
|
+
return input ? JSON.stringify(input).substring(0, 10000 /* Setting.ExtractLimit */) : input;
|
|
3635
3648
|
}
|
|
3636
3649
|
function match(base, condition) {
|
|
3637
3650
|
if (condition) {
|
|
@@ -3645,7 +3658,7 @@ function encode$1 (event) {
|
|
|
3645
3658
|
var t = time();
|
|
3646
3659
|
var tokens = [t, event];
|
|
3647
3660
|
switch (event) {
|
|
3648
|
-
case 4 /* Baseline */:
|
|
3661
|
+
case 4 /* Event.Baseline */:
|
|
3649
3662
|
var b = state$9;
|
|
3650
3663
|
if (b) {
|
|
3651
3664
|
tokens = [b.time, b.event];
|
|
@@ -3663,30 +3676,30 @@ function encode$1 (event) {
|
|
|
3663
3676
|
}
|
|
3664
3677
|
reset$p();
|
|
3665
3678
|
break;
|
|
3666
|
-
case 25 /* Ping */:
|
|
3679
|
+
case 25 /* Event.Ping */:
|
|
3667
3680
|
tokens.push(data$h.gap);
|
|
3668
3681
|
queue(tokens);
|
|
3669
3682
|
break;
|
|
3670
|
-
case 35 /* Limit */:
|
|
3683
|
+
case 35 /* Event.Limit */:
|
|
3671
3684
|
tokens.push(data$4.check);
|
|
3672
3685
|
queue(tokens, false);
|
|
3673
3686
|
break;
|
|
3674
|
-
case 3 /* Upgrade */:
|
|
3687
|
+
case 3 /* Event.Upgrade */:
|
|
3675
3688
|
tokens.push(data$f.key);
|
|
3676
3689
|
queue(tokens);
|
|
3677
3690
|
break;
|
|
3678
|
-
case 2 /* Upload */:
|
|
3691
|
+
case 2 /* Event.Upload */:
|
|
3679
3692
|
tokens.push(track$1.sequence);
|
|
3680
3693
|
tokens.push(track$1.attempts);
|
|
3681
3694
|
tokens.push(track$1.status);
|
|
3682
3695
|
queue(tokens, false);
|
|
3683
3696
|
break;
|
|
3684
|
-
case 24 /* Custom */:
|
|
3697
|
+
case 24 /* Event.Custom */:
|
|
3685
3698
|
tokens.push(data$j.key);
|
|
3686
3699
|
tokens.push(data$j.value);
|
|
3687
3700
|
queue(tokens);
|
|
3688
3701
|
break;
|
|
3689
|
-
case 34 /* Variable */:
|
|
3702
|
+
case 34 /* Event.Variable */:
|
|
3690
3703
|
var variableKeys = Object.keys(data$e);
|
|
3691
3704
|
if (variableKeys.length > 0) {
|
|
3692
3705
|
for (var _i = 0, variableKeys_1 = variableKeys; _i < variableKeys_1.length; _i++) {
|
|
@@ -3698,7 +3711,7 @@ function encode$1 (event) {
|
|
|
3698
3711
|
queue(tokens, false);
|
|
3699
3712
|
}
|
|
3700
3713
|
break;
|
|
3701
|
-
case 0 /* Metric */:
|
|
3714
|
+
case 0 /* Event.Metric */:
|
|
3702
3715
|
var metricKeys = Object.keys(updates$3);
|
|
3703
3716
|
if (metricKeys.length > 0) {
|
|
3704
3717
|
for (var _a = 0, metricKeys_1 = metricKeys; _a < metricKeys_1.length; _a++) {
|
|
@@ -3713,7 +3726,7 @@ function encode$1 (event) {
|
|
|
3713
3726
|
queue(tokens, false);
|
|
3714
3727
|
}
|
|
3715
3728
|
break;
|
|
3716
|
-
case 1 /* Dimension */:
|
|
3729
|
+
case 1 /* Event.Dimension */:
|
|
3717
3730
|
var dimensionKeys = Object.keys(updates);
|
|
3718
3731
|
if (dimensionKeys.length > 0) {
|
|
3719
3732
|
for (var _b = 0, dimensionKeys_1 = dimensionKeys; _b < dimensionKeys_1.length; _b++) {
|
|
@@ -3726,7 +3739,7 @@ function encode$1 (event) {
|
|
|
3726
3739
|
queue(tokens, false);
|
|
3727
3740
|
}
|
|
3728
3741
|
break;
|
|
3729
|
-
case 36 /* Summary */:
|
|
3742
|
+
case 36 /* Event.Summary */:
|
|
3730
3743
|
var eventKeys = Object.keys(data$g);
|
|
3731
3744
|
if (eventKeys.length > 0) {
|
|
3732
3745
|
for (var _c = 0, eventKeys_1 = eventKeys; _c < eventKeys_1.length; _c++) {
|
|
@@ -3739,7 +3752,7 @@ function encode$1 (event) {
|
|
|
3739
3752
|
queue(tokens, false);
|
|
3740
3753
|
}
|
|
3741
3754
|
break;
|
|
3742
|
-
case 40 /* Extract */:
|
|
3755
|
+
case 40 /* Event.Extract */:
|
|
3743
3756
|
var extractKeys = keys;
|
|
3744
3757
|
for (var _d = 0, extractKeys_1 = extractKeys; _d < extractKeys_1.length; _d++) {
|
|
3745
3758
|
var e = extractKeys_1[_d];
|
|
@@ -3753,14 +3766,14 @@ function encode$1 (event) {
|
|
|
3753
3766
|
|
|
3754
3767
|
var data$4;
|
|
3755
3768
|
function start$b() {
|
|
3756
|
-
data$4 = { check: 0 /* None */ };
|
|
3769
|
+
data$4 = { check: 0 /* Check.None */ };
|
|
3757
3770
|
}
|
|
3758
3771
|
function check$2(bytes) {
|
|
3759
|
-
if (data$4.check === 0 /* None */) {
|
|
3772
|
+
if (data$4.check === 0 /* Check.None */) {
|
|
3760
3773
|
var reason = data$4.check;
|
|
3761
|
-
reason = data$1.sequence >= 128 /* PayloadLimit */ ? 1 /* Payload */ : reason;
|
|
3762
|
-
reason = time() > 7200000 /* ShutdownLimit */ ? 2 /* Shutdown */ : reason;
|
|
3763
|
-
reason = bytes > 10485760 /* PlaybackBytesLimit */ ? 2 /* Shutdown */ : reason;
|
|
3774
|
+
reason = data$1.sequence >= 128 /* Setting.PayloadLimit */ ? 1 /* Check.Payload */ : reason;
|
|
3775
|
+
reason = time() > 7200000 /* Setting.ShutdownLimit */ ? 2 /* Check.Shutdown */ : reason;
|
|
3776
|
+
reason = bytes > 10485760 /* Setting.PlaybackBytesLimit */ ? 2 /* Check.Shutdown */ : reason;
|
|
3764
3777
|
if (reason !== data$4.check) {
|
|
3765
3778
|
trigger(reason);
|
|
3766
3779
|
}
|
|
@@ -3772,8 +3785,8 @@ function trigger(reason) {
|
|
|
3772
3785
|
stop();
|
|
3773
3786
|
}
|
|
3774
3787
|
function compute$3() {
|
|
3775
|
-
if (data$4.check !== 0 /* None */) {
|
|
3776
|
-
encode$1(35 /* Limit */);
|
|
3788
|
+
if (data$4.check !== 0 /* Check.None */) {
|
|
3789
|
+
encode$1(35 /* Event.Limit */);
|
|
3777
3790
|
}
|
|
3778
3791
|
}
|
|
3779
3792
|
function stop$a() {
|
|
@@ -3794,7 +3807,7 @@ function log(dimension, value) {
|
|
|
3794
3807
|
// Check valid value before moving ahead
|
|
3795
3808
|
if (value) {
|
|
3796
3809
|
// Ensure received value is casted into a string if it wasn't a string to begin with
|
|
3797
|
-
value = ""
|
|
3810
|
+
value = "".concat(value);
|
|
3798
3811
|
if (!(dimension in data$3)) {
|
|
3799
3812
|
data$3[dimension] = [];
|
|
3800
3813
|
}
|
|
@@ -3807,14 +3820,14 @@ function log(dimension, value) {
|
|
|
3807
3820
|
}
|
|
3808
3821
|
updates[dimension].push(value);
|
|
3809
3822
|
// Limit check to ensure we have a cap on number of dimensions we can collect
|
|
3810
|
-
if (data$3[dimension].length > 128 /* CollectionLimit */) {
|
|
3811
|
-
trigger(5 /* Collection */);
|
|
3823
|
+
if (data$3[dimension].length > 128 /* Setting.CollectionLimit */) {
|
|
3824
|
+
trigger(5 /* Check.Collection */);
|
|
3812
3825
|
}
|
|
3813
3826
|
}
|
|
3814
3827
|
}
|
|
3815
3828
|
}
|
|
3816
3829
|
function compute$2() {
|
|
3817
|
-
encode$1(1 /* Dimension */);
|
|
3830
|
+
encode$1(1 /* Event.Dimension */);
|
|
3818
3831
|
}
|
|
3819
3832
|
function reset$3() {
|
|
3820
3833
|
updates = {};
|
|
@@ -3825,8 +3838,8 @@ var callbacks = [];
|
|
|
3825
3838
|
var rootDomain = null;
|
|
3826
3839
|
function start$9() {
|
|
3827
3840
|
rootDomain = null;
|
|
3828
|
-
var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Empty */;
|
|
3829
|
-
var title = document && document.title ? document.title : "" /* Empty */;
|
|
3841
|
+
var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Constant.Empty */;
|
|
3842
|
+
var title = document && document.title ? document.title : "" /* Constant.Empty */;
|
|
3830
3843
|
// Populate ids for this page
|
|
3831
3844
|
var s = session();
|
|
3832
3845
|
var u = user();
|
|
@@ -3837,27 +3850,27 @@ function start$9() {
|
|
|
3837
3850
|
pageNum: s.count
|
|
3838
3851
|
};
|
|
3839
3852
|
// Override configuration based on what's in the session storage, unless it is blank (e.g. using upload callback, like in devtools)
|
|
3840
|
-
config$1.lean = config$1.track && s.upgrade !== null ? s.upgrade === 0 /* False */ : config$1.lean;
|
|
3841
|
-
config$1.upload = config$1.track && typeof config$1.upload === "string" /* String */ && s.upload && s.upload.length > "https://" /* HTTPS */.length ? s.upload : config$1.upload;
|
|
3853
|
+
config$1.lean = config$1.track && s.upgrade !== null ? s.upgrade === 0 /* BooleanFlag.False */ : config$1.lean;
|
|
3854
|
+
config$1.upload = config$1.track && typeof config$1.upload === "string" /* Constant.String */ && s.upload && s.upload.length > "https://" /* Constant.HTTPS */.length ? s.upload : config$1.upload;
|
|
3842
3855
|
// Log dimensions
|
|
3843
|
-
log(0 /* UserAgent */, ua);
|
|
3844
|
-
log(3 /* PageTitle */, title);
|
|
3845
|
-
log(1 /* Url */, location.href);
|
|
3846
|
-
log(2 /* Referrer */, document.referrer);
|
|
3847
|
-
log(15 /* TabId */, tab());
|
|
3848
|
-
log(16 /* PageLanguage */, document.documentElement.lang);
|
|
3849
|
-
log(17 /* DocumentDirection */, document.dir);
|
|
3856
|
+
log(0 /* Dimension.UserAgent */, ua);
|
|
3857
|
+
log(3 /* Dimension.PageTitle */, title);
|
|
3858
|
+
log(1 /* Dimension.Url */, location.href);
|
|
3859
|
+
log(2 /* Dimension.Referrer */, document.referrer);
|
|
3860
|
+
log(15 /* Dimension.TabId */, tab());
|
|
3861
|
+
log(16 /* Dimension.PageLanguage */, document.documentElement.lang);
|
|
3862
|
+
log(17 /* Dimension.DocumentDirection */, document.dir);
|
|
3850
3863
|
if (navigator) {
|
|
3851
|
-
log(9 /* Language */, navigator.userLanguage || navigator.language);
|
|
3864
|
+
log(9 /* Dimension.Language */, navigator.userLanguage || navigator.language);
|
|
3852
3865
|
userAgentData();
|
|
3853
3866
|
}
|
|
3854
3867
|
// Metrics
|
|
3855
|
-
max(0 /* ClientTimestamp */, s.ts);
|
|
3856
|
-
max(1 /* Playback */, 0 /* False */);
|
|
3868
|
+
max(0 /* Metric.ClientTimestamp */, s.ts);
|
|
3869
|
+
max(1 /* Metric.Playback */, 0 /* BooleanFlag.False */);
|
|
3857
3870
|
if (screen) {
|
|
3858
|
-
max(14 /* ScreenWidth */, Math.round(screen.width));
|
|
3859
|
-
max(15 /* ScreenHeight */, Math.round(screen.height));
|
|
3860
|
-
max(16 /* ColorDepth */, Math.round(screen.colorDepth));
|
|
3871
|
+
max(14 /* Metric.ScreenWidth */, Math.round(screen.width));
|
|
3872
|
+
max(15 /* Metric.ScreenHeight */, Math.round(screen.height));
|
|
3873
|
+
max(16 /* Metric.ColorDepth */, Math.round(screen.colorDepth));
|
|
3861
3874
|
}
|
|
3862
3875
|
// Read cookies specified in configuration
|
|
3863
3876
|
for (var _i = 0, _a = config$1.cookies; _i < _a.length; _i++) {
|
|
@@ -3878,13 +3891,13 @@ function userAgentData() {
|
|
|
3878
3891
|
"uaFullVersion"])
|
|
3879
3892
|
.then(function (ua) {
|
|
3880
3893
|
var _a;
|
|
3881
|
-
log(22 /* Platform */, ua.platform);
|
|
3882
|
-
log(23 /* PlatformVersion */, ua.platformVersion);
|
|
3894
|
+
log(22 /* Dimension.Platform */, ua.platform);
|
|
3895
|
+
log(23 /* Dimension.PlatformVersion */, ua.platformVersion);
|
|
3883
3896
|
(_a = ua.brands) === null || _a === void 0 ? void 0 : _a.forEach(function (brand) {
|
|
3884
|
-
log(24 /* Brand */, brand.name + "~" /* Tilde */ + brand.version);
|
|
3897
|
+
log(24 /* Dimension.Brand */, brand.name + "~" /* Constant.Tilde */ + brand.version);
|
|
3885
3898
|
});
|
|
3886
|
-
log(25 /* Model */, ua.model);
|
|
3887
|
-
max(27 /* Mobile */, ua.mobile ? 1 /* True */ : 0 /* False */);
|
|
3899
|
+
log(25 /* Dimension.Model */, ua.model);
|
|
3900
|
+
max(27 /* Metric.Mobile */, ua.mobile ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
|
|
3888
3901
|
});
|
|
3889
3902
|
}
|
|
3890
3903
|
}
|
|
@@ -3901,33 +3914,33 @@ function metadata(cb, wait) {
|
|
|
3901
3914
|
callbacks.push({ callback: cb, wait: wait });
|
|
3902
3915
|
}
|
|
3903
3916
|
function id() {
|
|
3904
|
-
return data$2 ? [data$2.userId, data$2.sessionId, data$2.pageNum].join("." /* Dot */) : "" /* Empty */;
|
|
3917
|
+
return data$2 ? [data$2.userId, data$2.sessionId, data$2.pageNum].join("." /* Constant.Dot */) : "" /* Constant.Empty */;
|
|
3905
3918
|
}
|
|
3906
3919
|
function consent() {
|
|
3907
3920
|
if (active()) {
|
|
3908
3921
|
config$1.track = true;
|
|
3909
|
-
track(user(), 1 /* True */);
|
|
3922
|
+
track(user(), 1 /* BooleanFlag.True */);
|
|
3910
3923
|
}
|
|
3911
3924
|
}
|
|
3912
3925
|
function clear() {
|
|
3913
3926
|
// Clear any stored information in the cookie that tracks session information so we can restart fresh the next time
|
|
3914
|
-
setCookie("_clsk" /* SessionKey */, "" /* Empty */, 0);
|
|
3927
|
+
setCookie("_clsk" /* Constant.SessionKey */, "" /* Constant.Empty */, 0);
|
|
3915
3928
|
}
|
|
3916
3929
|
function tab() {
|
|
3917
3930
|
var id = shortid();
|
|
3918
|
-
if (config$1.track && supported(window, "sessionStorage" /* SessionStorage */)) {
|
|
3919
|
-
var value = sessionStorage.getItem("_cltk" /* TabKey */);
|
|
3931
|
+
if (config$1.track && supported(window, "sessionStorage" /* Constant.SessionStorage */)) {
|
|
3932
|
+
var value = sessionStorage.getItem("_cltk" /* Constant.TabKey */);
|
|
3920
3933
|
id = value ? value : id;
|
|
3921
|
-
sessionStorage.setItem("_cltk" /* TabKey */, id);
|
|
3934
|
+
sessionStorage.setItem("_cltk" /* Constant.TabKey */, id);
|
|
3922
3935
|
}
|
|
3923
3936
|
return id;
|
|
3924
3937
|
}
|
|
3925
3938
|
function save() {
|
|
3926
3939
|
var ts = Math.round(Date.now());
|
|
3927
|
-
var upload = config$1.upload && typeof config$1.upload === "string" /* String */ ? config$1.upload.replace("https://" /* HTTPS */, "" /* Empty */) : "" /* Empty */;
|
|
3928
|
-
var upgrade = config$1.lean ? 0 /* False */ : 1 /* True */;
|
|
3940
|
+
var upload = config$1.upload && typeof config$1.upload === "string" /* Constant.String */ ? config$1.upload.replace("https://" /* Constant.HTTPS */, "" /* Constant.Empty */) : "" /* Constant.Empty */;
|
|
3941
|
+
var upgrade = config$1.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
|
|
3929
3942
|
processCallback(upgrade);
|
|
3930
|
-
setCookie("_clsk" /* SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Pipe */), 1 /* SessionExpire */);
|
|
3943
|
+
setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Constant.Pipe */), 1 /* Setting.SessionExpire */);
|
|
3931
3944
|
}
|
|
3932
3945
|
function processCallback(upgrade) {
|
|
3933
3946
|
if (callbacks.length > 0) {
|
|
@@ -3952,10 +3965,10 @@ function track(u, consent) {
|
|
|
3952
3965
|
consent = consent === null ? u.consent : consent;
|
|
3953
3966
|
// Convert time precision into days to reduce number of bytes we have to write in a cookie
|
|
3954
3967
|
// E.g. Math.ceil(1628735962643 / (24*60*60*1000)) => 18852 (days) => ejo in base36 (13 bytes => 3 bytes)
|
|
3955
|
-
var end = Math.ceil((Date.now() + (365 /* Expire */ * 86400000 /* Day */)) / 86400000 /* Day */);
|
|
3968
|
+
var end = Math.ceil((Date.now() + (365 /* Setting.Expire */ * 86400000 /* Time.Day */)) / 86400000 /* Time.Day */);
|
|
3956
3969
|
// To avoid cookie churn, write user id cookie only once every day
|
|
3957
|
-
if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* CookieInterval */ || u.consent !== consent) {
|
|
3958
|
-
setCookie("_clck" /* CookieKey */, [data$2.userId, 1 /* CookieVersion */, end.toString(36), consent].join("|" /* Pipe */), 365 /* Expire */);
|
|
3970
|
+
if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* Setting.CookieInterval */ || u.consent !== consent) {
|
|
3971
|
+
setCookie("_clck" /* Constant.CookieKey */, [data$2.userId, 1 /* Setting.CookieVersion */, end.toString(36), consent].join("|" /* Constant.Pipe */), 365 /* Setting.Expire */);
|
|
3959
3972
|
}
|
|
3960
3973
|
}
|
|
3961
3974
|
function shortid() {
|
|
@@ -3966,17 +3979,17 @@ function shortid() {
|
|
|
3966
3979
|
return id.toString(36);
|
|
3967
3980
|
}
|
|
3968
3981
|
function session() {
|
|
3969
|
-
var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /* Empty */ };
|
|
3970
|
-
var value = getCookie("_clsk" /* SessionKey */);
|
|
3982
|
+
var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /* Constant.Empty */ };
|
|
3983
|
+
var value = getCookie("_clsk" /* Constant.SessionKey */);
|
|
3971
3984
|
if (value) {
|
|
3972
|
-
var parts = value.split("|" /* Pipe */);
|
|
3985
|
+
var parts = value.split("|" /* Constant.Pipe */);
|
|
3973
3986
|
// Making it backward & forward compatible by using greater than comparison (v0.6.21)
|
|
3974
3987
|
// In future version, we can reduce the parts length to be 5 where the last part contains the full upload URL
|
|
3975
|
-
if (parts.length >= 5 && output.ts - num(parts[1]) < 1800000 /* SessionTimeout */) {
|
|
3988
|
+
if (parts.length >= 5 && output.ts - num(parts[1]) < 1800000 /* Setting.SessionTimeout */) {
|
|
3976
3989
|
output.session = parts[0];
|
|
3977
3990
|
output.count = num(parts[2]) + 1;
|
|
3978
3991
|
output.upgrade = num(parts[3]);
|
|
3979
|
-
output.upload = parts.length >= 6 ? ""
|
|
3992
|
+
output.upload = parts.length >= 6 ? "".concat("https://" /* Constant.HTTPS */).concat(parts[5], "/").concat(parts[4]) : "".concat("https://" /* Constant.HTTPS */).concat(parts[4]);
|
|
3980
3993
|
}
|
|
3981
3994
|
}
|
|
3982
3995
|
return output;
|
|
@@ -3986,26 +3999,26 @@ function num(string, base) {
|
|
|
3986
3999
|
return parseInt(string, base);
|
|
3987
4000
|
}
|
|
3988
4001
|
function user() {
|
|
3989
|
-
var output = { id: shortid(), expiry: null, consent: 0 /* False */ };
|
|
3990
|
-
var cookie = getCookie("_clck" /* CookieKey */);
|
|
4002
|
+
var output = { id: shortid(), expiry: null, consent: 0 /* BooleanFlag.False */ };
|
|
4003
|
+
var cookie = getCookie("_clck" /* Constant.CookieKey */);
|
|
3991
4004
|
if (cookie && cookie.length > 0) {
|
|
3992
4005
|
// Splitting and looking up first part for forward compatibility, in case we wish to store additional information in a cookie
|
|
3993
|
-
var parts = cookie.split("|" /* Pipe */);
|
|
4006
|
+
var parts = cookie.split("|" /* Constant.Pipe */);
|
|
3994
4007
|
// For backward compatibility introduced in v0.6.18; following code can be removed with future iterations
|
|
3995
4008
|
// Count number of times Clarity's user cookie crumb appears in document.cookie (could be on different sub-domains e.g. www.domain.com and .domain.com)
|
|
3996
4009
|
var count = 0;
|
|
3997
|
-
for (var _i = 0, _a = document.cookie.split(";" /* Semicolon */); _i < _a.length; _i++) {
|
|
4010
|
+
for (var _i = 0, _a = document.cookie.split(";" /* Constant.Semicolon */); _i < _a.length; _i++) {
|
|
3998
4011
|
var c = _a[_i];
|
|
3999
|
-
count += c.split("=" /* Equals */)[0].trim() === "_clck" /* CookieKey */ ? 1 : 0;
|
|
4012
|
+
count += c.split("=" /* Constant.Equals */)[0].trim() === "_clck" /* Constant.CookieKey */ ? 1 : 0;
|
|
4000
4013
|
}
|
|
4001
4014
|
// Check if we either got version-less cookie value or saw multiple copies of the user cookie crumbs
|
|
4002
4015
|
// In both these cases, we go ahead and delete the existing cookie set on current domain
|
|
4003
4016
|
if (parts.length === 1 || count > 1) {
|
|
4004
|
-
var deleted = ""
|
|
4017
|
+
var deleted = "".concat(";" /* Constant.Semicolon */).concat("expires=" /* Constant.Expires */).concat((new Date(0)).toUTCString()).concat(";path=/" /* Constant.Path */);
|
|
4005
4018
|
// First, delete current user cookie which might be set on current sub-domain vs. root domain
|
|
4006
|
-
document.cookie = "_clck" /* CookieKey
|
|
4019
|
+
document.cookie = "".concat("_clck" /* Constant.CookieKey */, "=").concat(deleted);
|
|
4007
4020
|
// Second, same thing for current session cookie so it can be re-written later with the root domain
|
|
4008
|
-
document.cookie = "_clsk" /* SessionKey
|
|
4021
|
+
document.cookie = "".concat("_clsk" /* Constant.SessionKey */, "=").concat(deleted);
|
|
4009
4022
|
}
|
|
4010
4023
|
// End code for backward compatibility
|
|
4011
4024
|
// Read version information and timestamp from cookie, if available
|
|
@@ -4014,21 +4027,21 @@ function user() {
|
|
|
4014
4027
|
}
|
|
4015
4028
|
// Check if we have explicit consent to track this user
|
|
4016
4029
|
if (parts.length > 3 && num(parts[3]) === 1) {
|
|
4017
|
-
output.consent = 1 /* True */;
|
|
4030
|
+
output.consent = 1 /* BooleanFlag.True */;
|
|
4018
4031
|
}
|
|
4019
4032
|
// Set track configuration to true for this user if we have explicit consent, regardless of project setting
|
|
4020
|
-
config$1.track = config$1.track || output.consent === 1 /* True */;
|
|
4033
|
+
config$1.track = config$1.track || output.consent === 1 /* BooleanFlag.True */;
|
|
4021
4034
|
// Get user id from cookie only if we tracking is enabled, otherwise fallback to a random id
|
|
4022
4035
|
output.id = config$1.track ? parts[0] : output.id;
|
|
4023
4036
|
}
|
|
4024
4037
|
return output;
|
|
4025
4038
|
}
|
|
4026
4039
|
function getCookie(key) {
|
|
4027
|
-
if (supported(document, "cookie" /* Cookie */)) {
|
|
4028
|
-
var cookies = document.cookie.split(";" /* Semicolon */);
|
|
4040
|
+
if (supported(document, "cookie" /* Constant.Cookie */)) {
|
|
4041
|
+
var cookies = document.cookie.split(";" /* Constant.Semicolon */);
|
|
4029
4042
|
if (cookies) {
|
|
4030
4043
|
for (var i = 0; i < cookies.length; i++) {
|
|
4031
|
-
var pair = cookies[i].split("=" /* Equals */);
|
|
4044
|
+
var pair = cookies[i].split("=" /* Constant.Equals */);
|
|
4032
4045
|
if (pair.length > 1 && pair[0] && pair[0].trim() === key) {
|
|
4033
4046
|
return pair[1];
|
|
4034
4047
|
}
|
|
@@ -4038,23 +4051,23 @@ function getCookie(key) {
|
|
|
4038
4051
|
return null;
|
|
4039
4052
|
}
|
|
4040
4053
|
function setCookie(key, value, time) {
|
|
4041
|
-
if (config$1.track && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Cookie */))) {
|
|
4054
|
+
if (config$1.track && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Constant.Cookie */))) {
|
|
4042
4055
|
var expiry = new Date();
|
|
4043
4056
|
expiry.setDate(expiry.getDate() + time);
|
|
4044
|
-
var expires = expiry ? "expires=" /* Expires */ + expiry.toUTCString() : "" /* Empty */;
|
|
4045
|
-
var cookie = key
|
|
4057
|
+
var expires = expiry ? "expires=" /* Constant.Expires */ + expiry.toUTCString() : "" /* Constant.Empty */;
|
|
4058
|
+
var cookie = "".concat(key, "=").concat(value).concat(";" /* Constant.Semicolon */).concat(expires).concat(";path=/" /* Constant.Path */);
|
|
4046
4059
|
try {
|
|
4047
4060
|
// Attempt to get the root domain only once and fall back to writing cookie on the current domain.
|
|
4048
4061
|
if (rootDomain === null) {
|
|
4049
|
-
var hostname = location.hostname ? location.hostname.split("." /* Dot */) : [];
|
|
4062
|
+
var hostname = location.hostname ? location.hostname.split("." /* Constant.Dot */) : [];
|
|
4050
4063
|
// Walk backwards on a domain and attempt to set a cookie, until successful
|
|
4051
4064
|
for (var i = hostname.length - 1; i >= 0; i--) {
|
|
4052
|
-
rootDomain = "."
|
|
4065
|
+
rootDomain = ".".concat(hostname[i]).concat(rootDomain ? rootDomain : "" /* Constant.Empty */);
|
|
4053
4066
|
// We do not wish to attempt writing a cookie on the absolute last part of the domain, e.g. .com or .net.
|
|
4054
4067
|
// So we start attempting after second-last part, e.g. .domain.com (PASS) or .co.uk (FAIL)
|
|
4055
4068
|
if (i < hostname.length - 1) {
|
|
4056
4069
|
// Write the cookie on the current computed top level domain
|
|
4057
|
-
document.cookie = ""
|
|
4070
|
+
document.cookie = "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain);
|
|
4058
4071
|
// Once written, check if the cookie exists and its value matches exactly with what we intended to set
|
|
4059
4072
|
// Checking for exact value match helps us eliminate a corner case where the cookie may already be present with a different value
|
|
4060
4073
|
// If the check is successful, no more action is required and we can return from the function since rootDomain cookie is already set
|
|
@@ -4066,13 +4079,13 @@ function setCookie(key, value, time) {
|
|
|
4066
4079
|
}
|
|
4067
4080
|
// Finally, if we were not successful and gone through all the options, play it safe and reset rootDomain to be empty
|
|
4068
4081
|
// This forces our code to fall back to always writing cookie to the current domain
|
|
4069
|
-
rootDomain = "" /* Empty */;
|
|
4082
|
+
rootDomain = "" /* Constant.Empty */;
|
|
4070
4083
|
}
|
|
4071
4084
|
}
|
|
4072
4085
|
catch (_a) {
|
|
4073
|
-
rootDomain = "" /* Empty */;
|
|
4086
|
+
rootDomain = "" /* Constant.Empty */;
|
|
4074
4087
|
}
|
|
4075
|
-
document.cookie = rootDomain ? ""
|
|
4088
|
+
document.cookie = rootDomain ? "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain) : cookie;
|
|
4076
4089
|
}
|
|
4077
4090
|
}
|
|
4078
4091
|
|
|
@@ -4088,8 +4101,8 @@ function start$8() {
|
|
|
4088
4101
|
userId: m.userId,
|
|
4089
4102
|
sessionId: m.sessionId,
|
|
4090
4103
|
pageNum: m.pageNum,
|
|
4091
|
-
upload: 0 /* Async */,
|
|
4092
|
-
end: 0 /* False */
|
|
4104
|
+
upload: 0 /* Upload.Async */,
|
|
4105
|
+
end: 0 /* BooleanFlag.False */
|
|
4093
4106
|
};
|
|
4094
4107
|
}
|
|
4095
4108
|
function stop$7() {
|
|
@@ -4099,8 +4112,8 @@ function envelope(last) {
|
|
|
4099
4112
|
data$1.start = data$1.start + data$1.duration;
|
|
4100
4113
|
data$1.duration = time() - data$1.start;
|
|
4101
4114
|
data$1.sequence++;
|
|
4102
|
-
data$1.upload = last && "sendBeacon" in navigator ? 1 /* Beacon */ : 0 /* Async */;
|
|
4103
|
-
data$1.end = last ? 1 /* True */ : 0 /* False */;
|
|
4115
|
+
data$1.upload = last && "sendBeacon" in navigator ? 1 /* Upload.Beacon */ : 0 /* Upload.Async */;
|
|
4116
|
+
data$1.end = last ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
|
|
4104
4117
|
return [
|
|
4105
4118
|
data$1.version,
|
|
4106
4119
|
data$1.sequence,
|
|
@@ -4153,10 +4166,10 @@ function measure (method) {
|
|
|
4153
4166
|
throw report(ex);
|
|
4154
4167
|
}
|
|
4155
4168
|
var duration = performance.now() - start;
|
|
4156
|
-
sum(4 /* TotalCost */, duration);
|
|
4157
|
-
if (duration > 30 /* LongTask */) {
|
|
4158
|
-
count$1(7 /* LongTaskCount */);
|
|
4159
|
-
max(6 /* ThreadBlockedTime */, duration);
|
|
4169
|
+
sum(4 /* Metric.TotalCost */, duration);
|
|
4170
|
+
if (duration > 30 /* Setting.LongTask */) {
|
|
4171
|
+
count$1(7 /* Metric.LongTaskCount */);
|
|
4172
|
+
max(6 /* Metric.ThreadBlockedTime */, duration);
|
|
4160
4173
|
}
|
|
4161
4174
|
};
|
|
4162
4175
|
}
|
|
@@ -4168,7 +4181,7 @@ function bind(target, event, listener, capture) {
|
|
|
4168
4181
|
// Wrapping following lines inside try / catch to cover edge cases where we might try to access an inaccessible element.
|
|
4169
4182
|
// E.g. Iframe may start off as same-origin but later turn into cross-origin, and the following lines will throw an exception.
|
|
4170
4183
|
try {
|
|
4171
|
-
target[api("addEventListener" /* AddEventListener */)](event, listener, capture);
|
|
4184
|
+
target[api("addEventListener" /* Constant.AddEventListener */)](event, listener, capture);
|
|
4172
4185
|
bindings.push({ event: event, target: target, listener: listener, capture: capture });
|
|
4173
4186
|
}
|
|
4174
4187
|
catch ( /* do nothing */_a) { /* do nothing */ }
|
|
@@ -4179,7 +4192,7 @@ function reset$1() {
|
|
|
4179
4192
|
var binding = bindings_1[_i];
|
|
4180
4193
|
// Wrapping inside try / catch to avoid situations where the element may be destroyed before we get a chance to unbind
|
|
4181
4194
|
try {
|
|
4182
|
-
binding.target[api("removeEventListener" /* RemoveEventListener */)](binding.event, binding.listener, binding.capture);
|
|
4195
|
+
binding.target[api("removeEventListener" /* Constant.RemoveEventListener */)](binding.event, binding.listener, binding.capture);
|
|
4183
4196
|
}
|
|
4184
4197
|
catch ( /* do nothing */_a) { /* do nothing */ }
|
|
4185
4198
|
}
|
|
@@ -4216,8 +4229,8 @@ function start$7() {
|
|
|
4216
4229
|
}
|
|
4217
4230
|
}
|
|
4218
4231
|
function check$1() {
|
|
4219
|
-
if (count++ > 20 /* CallStackDepth */) {
|
|
4220
|
-
log$1(4 /* CallStackDepth */, 0 /* Info */);
|
|
4232
|
+
if (count++ > 20 /* Setting.CallStackDepth */) {
|
|
4233
|
+
log$1(4 /* Code.CallStackDepth */, 0 /* Severity.Info */);
|
|
4221
4234
|
return false;
|
|
4222
4235
|
}
|
|
4223
4236
|
return true;
|
|
@@ -4227,15 +4240,15 @@ function compute$1() {
|
|
|
4227
4240
|
if (url !== getCurrentUrl()) {
|
|
4228
4241
|
// If the url changed, start tracking it as a new page
|
|
4229
4242
|
stop();
|
|
4230
|
-
window.setTimeout(restart$1, 250 /* RestartDelay */);
|
|
4243
|
+
window.setTimeout(restart$1, 250 /* Setting.RestartDelay */);
|
|
4231
4244
|
}
|
|
4232
4245
|
}
|
|
4233
4246
|
function restart$1() {
|
|
4234
4247
|
start();
|
|
4235
|
-
max(29 /* SinglePage */, 1 /* True */);
|
|
4248
|
+
max(29 /* Metric.SinglePage */, 1 /* BooleanFlag.True */);
|
|
4236
4249
|
}
|
|
4237
4250
|
function getCurrentUrl() {
|
|
4238
|
-
return location.href ? location.href.replace(location.hash, "" /* Empty */) : location.href;
|
|
4251
|
+
return location.href ? location.href.replace(location.hash, "" /* Constant.Empty */) : location.href;
|
|
4239
4252
|
}
|
|
4240
4253
|
function stop$6() {
|
|
4241
4254
|
url = null;
|
|
@@ -4298,7 +4311,7 @@ function config(override) {
|
|
|
4298
4311
|
// not holding the session during inactive time periods.
|
|
4299
4312
|
function suspend() {
|
|
4300
4313
|
if (status) {
|
|
4301
|
-
event("clarity" /* Clarity */, "suspend" /* Suspend */);
|
|
4314
|
+
event("clarity" /* Constant.Clarity */, "suspend" /* Constant.Suspend */);
|
|
4302
4315
|
stop();
|
|
4303
4316
|
["mousemove", "touchstart"].forEach(function (x) { return bind(document, x, restart); });
|
|
4304
4317
|
["resize", "scroll", "pageshow"].forEach(function (x) { return bind(window, x, restart); });
|
|
@@ -4306,7 +4319,7 @@ function suspend() {
|
|
|
4306
4319
|
}
|
|
4307
4320
|
function restart() {
|
|
4308
4321
|
start();
|
|
4309
|
-
event("clarity" /* Clarity */, "restart" /* Restart */);
|
|
4322
|
+
event("clarity" /* Constant.Clarity */, "restart" /* Constant.Restart */);
|
|
4310
4323
|
}
|
|
4311
4324
|
|
|
4312
4325
|
function start$5() {
|
|
@@ -4325,7 +4338,7 @@ var diagnostic = /*#__PURE__*/Object.freeze({
|
|
|
4325
4338
|
});
|
|
4326
4339
|
|
|
4327
4340
|
function start$4() {
|
|
4328
|
-
schedule$1(discover, 1 /* High */).then(function () {
|
|
4341
|
+
schedule$1(discover, 1 /* Priority.High */).then(function () {
|
|
4329
4342
|
measure(compute$7)();
|
|
4330
4343
|
measure(compute$6)();
|
|
4331
4344
|
});
|
|
@@ -4337,12 +4350,12 @@ function discover() {
|
|
|
4337
4350
|
switch (_a.label) {
|
|
4338
4351
|
case 0:
|
|
4339
4352
|
ts = time();
|
|
4340
|
-
timer = { id: id(), cost: 3 /* LayoutCost */ };
|
|
4353
|
+
timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
|
|
4341
4354
|
start$w(timer);
|
|
4342
|
-
return [4 /*yield*/, traverse(document, timer, 0 /* Discover */)];
|
|
4355
|
+
return [4 /*yield*/, traverse(document, timer, 0 /* Source.Discover */)];
|
|
4343
4356
|
case 1:
|
|
4344
4357
|
_a.sent();
|
|
4345
|
-
return [4 /*yield*/, encode$4(5 /* Discover */, timer, ts)];
|
|
4358
|
+
return [4 /*yield*/, encode$4(5 /* Event.Discover */, timer, ts)];
|
|
4346
4359
|
case 2:
|
|
4347
4360
|
_a.sent();
|
|
4348
4361
|
stop$t(timer);
|
|
@@ -4371,7 +4384,8 @@ function stop$3() {
|
|
|
4371
4384
|
var layout = /*#__PURE__*/Object.freeze({
|
|
4372
4385
|
__proto__: null,
|
|
4373
4386
|
start: start$3,
|
|
4374
|
-
stop: stop$3
|
|
4387
|
+
stop: stop$3,
|
|
4388
|
+
hashText: hashText
|
|
4375
4389
|
});
|
|
4376
4390
|
|
|
4377
4391
|
function encode (type) {
|
|
@@ -4381,7 +4395,7 @@ function encode (type) {
|
|
|
4381
4395
|
t = time();
|
|
4382
4396
|
tokens = [t, type];
|
|
4383
4397
|
switch (type) {
|
|
4384
|
-
case 29 /* Navigation */:
|
|
4398
|
+
case 29 /* Event.Navigation */:
|
|
4385
4399
|
tokens.push(data.fetchStart);
|
|
4386
4400
|
tokens.push(data.connectStart);
|
|
4387
4401
|
tokens.push(data.connectEnd);
|
|
@@ -4430,11 +4444,11 @@ function compute(entry) {
|
|
|
4430
4444
|
encodedSize: entry.encodedBodySize ? entry.encodedBodySize : 0,
|
|
4431
4445
|
decodedSize: entry.decodedBodySize ? entry.decodedBodySize : 0
|
|
4432
4446
|
};
|
|
4433
|
-
encode(29 /* Navigation */);
|
|
4447
|
+
encode(29 /* Event.Navigation */);
|
|
4434
4448
|
}
|
|
4435
4449
|
|
|
4436
4450
|
var observer;
|
|
4437
|
-
var types = ["navigation" /* Navigation */, "resource" /* Resource */, "longtask" /* LongTask */, "first-input" /* FID */, "layout-shift" /* CLS */, "largest-contentful-paint" /* LCP */];
|
|
4451
|
+
var types = ["navigation" /* Constant.Navigation */, "resource" /* Constant.Resource */, "longtask" /* Constant.LongTask */, "first-input" /* Constant.FID */, "layout-shift" /* Constant.CLS */, "largest-contentful-paint" /* Constant.LCP */];
|
|
4438
4452
|
function start$2() {
|
|
4439
4453
|
// Check the browser support performance observer as a pre-requisite for any performance measurement
|
|
4440
4454
|
if (window["PerformanceObserver"] && PerformanceObserver.supportedEntryTypes) {
|
|
@@ -4449,7 +4463,7 @@ function start$2() {
|
|
|
4449
4463
|
}
|
|
4450
4464
|
}
|
|
4451
4465
|
else {
|
|
4452
|
-
log$1(3 /* PerformanceObserver */, 0 /* Info */);
|
|
4466
|
+
log$1(3 /* Code.PerformanceObserver */, 0 /* Severity.Info */);
|
|
4453
4467
|
}
|
|
4454
4468
|
}
|
|
4455
4469
|
function observe() {
|
|
@@ -4469,15 +4483,15 @@ function observe() {
|
|
|
4469
4483
|
if (PerformanceObserver.supportedEntryTypes.indexOf(x) >= 0) {
|
|
4470
4484
|
// Initialize CLS with a value of zero. It's possible (and recommended) for sites to not have any cumulative layout shift.
|
|
4471
4485
|
// In those cases, we want to still initialize the metric in Clarity
|
|
4472
|
-
if (x === "layout-shift" /* CLS */) {
|
|
4473
|
-
sum(9 /* CumulativeLayoutShift */, 0);
|
|
4486
|
+
if (x === "layout-shift" /* Constant.CLS */) {
|
|
4487
|
+
sum(9 /* Metric.CumulativeLayoutShift */, 0);
|
|
4474
4488
|
}
|
|
4475
4489
|
observer.observe({ type: x, buffered: true });
|
|
4476
4490
|
}
|
|
4477
4491
|
}
|
|
4478
4492
|
}
|
|
4479
4493
|
catch (_a) {
|
|
4480
|
-
log$1(3 /* PerformanceObserver */, 1 /* Warning */);
|
|
4494
|
+
log$1(3 /* Code.PerformanceObserver */, 1 /* Severity.Warning */);
|
|
4481
4495
|
}
|
|
4482
4496
|
}
|
|
4483
4497
|
function handle(entries) {
|
|
@@ -4488,41 +4502,41 @@ function process(entries) {
|
|
|
4488
4502
|
for (var i = 0; i < entries.length; i++) {
|
|
4489
4503
|
var entry = entries[i];
|
|
4490
4504
|
switch (entry.entryType) {
|
|
4491
|
-
case "navigation" /* Navigation */:
|
|
4505
|
+
case "navigation" /* Constant.Navigation */:
|
|
4492
4506
|
compute(entry);
|
|
4493
4507
|
break;
|
|
4494
|
-
case "resource" /* Resource */:
|
|
4508
|
+
case "resource" /* Constant.Resource */:
|
|
4495
4509
|
var name_1 = entry.name;
|
|
4496
|
-
log(4 /* NetworkHosts */, host(name_1));
|
|
4510
|
+
log(4 /* Dimension.NetworkHosts */, host(name_1));
|
|
4497
4511
|
if (name_1 === config$1.upload || name_1 === config$1.fallback) {
|
|
4498
|
-
max(28 /* UploadTime */, entry.duration);
|
|
4512
|
+
max(28 /* Metric.UploadTime */, entry.duration);
|
|
4499
4513
|
}
|
|
4500
4514
|
break;
|
|
4501
|
-
case "longtask" /* LongTask */:
|
|
4502
|
-
count$1(7 /* LongTaskCount */);
|
|
4515
|
+
case "longtask" /* Constant.LongTask */:
|
|
4516
|
+
count$1(7 /* Metric.LongTaskCount */);
|
|
4503
4517
|
break;
|
|
4504
|
-
case "first-input" /* FID */:
|
|
4518
|
+
case "first-input" /* Constant.FID */:
|
|
4505
4519
|
if (visible) {
|
|
4506
|
-
max(10 /* FirstInputDelay */, entry["processingStart"] - entry.startTime);
|
|
4520
|
+
max(10 /* Metric.FirstInputDelay */, entry["processingStart"] - entry.startTime);
|
|
4507
4521
|
}
|
|
4508
4522
|
break;
|
|
4509
|
-
case "layout-shift" /* CLS */:
|
|
4523
|
+
case "layout-shift" /* Constant.CLS */:
|
|
4510
4524
|
// Scale the value to avoid sending back floating point number
|
|
4511
4525
|
if (visible && !entry["hadRecentInput"]) {
|
|
4512
|
-
sum(9 /* CumulativeLayoutShift */, entry["value"] * 1000);
|
|
4526
|
+
sum(9 /* Metric.CumulativeLayoutShift */, entry["value"] * 1000);
|
|
4513
4527
|
}
|
|
4514
4528
|
break;
|
|
4515
|
-
case "largest-contentful-paint" /* LCP */:
|
|
4529
|
+
case "largest-contentful-paint" /* Constant.LCP */:
|
|
4516
4530
|
if (visible) {
|
|
4517
|
-
max(8 /* LargestPaint */, entry.startTime);
|
|
4531
|
+
max(8 /* Metric.LargestPaint */, entry.startTime);
|
|
4518
4532
|
}
|
|
4519
4533
|
break;
|
|
4520
4534
|
}
|
|
4521
4535
|
}
|
|
4522
|
-
if (performance && "memory" /* Memory */ in performance && performance["memory" /* Memory */].usedJSHeapSize) {
|
|
4536
|
+
if (performance && "memory" /* Constant.Memory */ in performance && performance["memory" /* Constant.Memory */].usedJSHeapSize) {
|
|
4523
4537
|
// Track consumed memory (MBs) where "memory" API is available
|
|
4524
4538
|
// Reference: https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory
|
|
4525
|
-
max(30 /* UsedMemory */, Math.abs(performance["memory" /* Memory */].usedJSHeapSize / 1048576 /* MegaByte */));
|
|
4539
|
+
max(30 /* Metric.UsedMemory */, Math.abs(performance["memory" /* Constant.Memory */].usedJSHeapSize / 1048576 /* Setting.MegaByte */));
|
|
4526
4540
|
}
|
|
4527
4541
|
}
|
|
4528
4542
|
function stop$2() {
|
|
@@ -4570,7 +4584,7 @@ function start(config$1) {
|
|
|
4570
4584
|
// performance impact even further. For reference, we are talking single digit milliseconds optimization here, not seconds.
|
|
4571
4585
|
function pause() {
|
|
4572
4586
|
if (active()) {
|
|
4573
|
-
event("clarity" /* Clarity */, "pause" /* Pause */);
|
|
4587
|
+
event("clarity" /* Constant.Clarity */, "pause" /* Constant.Pause */);
|
|
4574
4588
|
pause$1();
|
|
4575
4589
|
}
|
|
4576
4590
|
}
|
|
@@ -4578,7 +4592,7 @@ function pause() {
|
|
|
4578
4592
|
function resume() {
|
|
4579
4593
|
if (active()) {
|
|
4580
4594
|
resume$1();
|
|
4581
|
-
event("clarity" /* Clarity */, "resume" /* Resume */);
|
|
4595
|
+
event("clarity" /* Constant.Clarity */, "resume" /* Constant.Resume */);
|
|
4582
4596
|
}
|
|
4583
4597
|
}
|
|
4584
4598
|
function stop() {
|
|
@@ -4602,7 +4616,8 @@ var clarity = /*#__PURE__*/Object.freeze({
|
|
|
4602
4616
|
identify: identify,
|
|
4603
4617
|
set: set,
|
|
4604
4618
|
upgrade: upgrade,
|
|
4605
|
-
metadata: metadata
|
|
4619
|
+
metadata: metadata,
|
|
4620
|
+
hashText: hashText
|
|
4606
4621
|
});
|
|
4607
4622
|
|
|
4608
4623
|
var helper = { hash: hash, selector: selector, get: get, getNode: getNode, lookup: lookup };
|