clarity-js 0.6.40 → 0.6.42

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 CHANGED
@@ -79,7 +79,7 @@ var envelope$1 = /*#__PURE__*/Object.freeze({
79
79
 
80
80
  var config$1 = {
81
81
  projectId: null,
82
- delay: 1 * 1000 /* Time.Second */,
82
+ delay: 1 * 1000 /* Second */,
83
83
  lean: false,
84
84
  track: true,
85
85
  content: true,
@@ -92,14 +92,15 @@ var config$1 = {
92
92
  report: null,
93
93
  upload: null,
94
94
  fallback: null,
95
- upgrade: null
95
+ upgrade: null,
96
+ action: null
96
97
  };
97
98
 
98
99
  function api(method) {
99
100
  // Zone.js, a popular package for Angular, overrides native browser APIs which can lead to inconsistent state for single page applications.
100
101
  // Example issue: https://github.com/angular/angular/issues/31712
101
102
  // As a work around, we ensuring Clarity access APIs outside of Zone (and use native implementation instead)
102
- return window["Zone" /* Constant.Zone */] && "__symbol__" /* Constant.Symbol */ in window["Zone" /* Constant.Zone */] ? window["Zone" /* Constant.Zone */]["__symbol__" /* Constant.Symbol */](method) : method;
103
+ return window["Zone" /* Zone */] && "__symbol__" /* Symbol */ in window["Zone" /* Zone */] ? window["Zone" /* Zone */]["__symbol__" /* Symbol */](method) : method;
103
104
  }
104
105
 
105
106
  var startTime = 0;
@@ -115,7 +116,7 @@ function stop$B() {
115
116
  startTime = 0;
116
117
  }
117
118
 
118
- var version$1 = "0.6.40";
119
+ var version$1 = "0.6.42";
119
120
 
120
121
  // tslint:disable: no-bitwise
121
122
  function hash (input) {
@@ -148,7 +149,7 @@ function reset$p() {
148
149
  // Baseline state holds the previous values - if it is updated in the current payload,
149
150
  // reset the state to current value after sending the previous state
150
151
  if (update$2) {
151
- state$9 = { time: time(), event: 4 /* Event.Baseline */, data: {
152
+ state$9 = { time: time(), event: 4 /* Baseline */, data: {
152
153
  visible: buffer.visible,
153
154
  docWidth: buffer.docWidth,
154
155
  docHeight: buffer.docHeight,
@@ -163,7 +164,7 @@ function reset$p() {
163
164
  };
164
165
  }
165
166
  buffer = buffer ? buffer : {
166
- visible: 1 /* BooleanFlag.True */,
167
+ visible: 1 /* True */,
167
168
  docWidth: 0,
168
169
  docHeight: 0,
169
170
  screenWidth: 0,
@@ -177,15 +178,15 @@ function reset$p() {
177
178
  }
178
179
  function track$7(event, x, y) {
179
180
  switch (event) {
180
- case 8 /* Event.Document */:
181
+ case 8 /* Document */:
181
182
  buffer.docWidth = x;
182
183
  buffer.docHeight = y;
183
184
  break;
184
- case 11 /* Event.Resize */:
185
+ case 11 /* Resize */:
185
186
  buffer.screenWidth = x;
186
187
  buffer.screenHeight = y;
187
188
  break;
188
- case 10 /* Event.Scroll */:
189
+ case 10 /* Scroll */:
189
190
  buffer.scrollX = x;
190
191
  buffer.scrollY = y;
191
192
  break;
@@ -200,7 +201,7 @@ function activity(t) {
200
201
  buffer.activityTime = t;
201
202
  }
202
203
  function visibility(t, visible) {
203
- buffer.visible = visible === "visible" ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
204
+ buffer.visible = visible === "visible" ? 1 /* True */ : 0 /* False */;
204
205
  if (!buffer.visible) {
205
206
  activity(t);
206
207
  }
@@ -208,7 +209,7 @@ function visibility(t, visible) {
208
209
  }
209
210
  function compute$c() {
210
211
  if (update$2) {
211
- encode$1(4 /* Event.Baseline */);
212
+ encode$1(4 /* Baseline */);
212
213
  }
213
214
  }
214
215
  function stop$A() {
@@ -232,12 +233,12 @@ function event(key, value) {
232
233
  if (active() &&
233
234
  key &&
234
235
  value &&
235
- typeof key === "string" /* Constant.String */ &&
236
- typeof value === "string" /* Constant.String */ &&
236
+ typeof key === "string" /* String */ &&
237
+ typeof value === "string" /* String */ &&
237
238
  key.length < 255 &&
238
239
  value.length < 255) {
239
240
  data$j = { key: key, value: value };
240
- encode$1(24 /* Event.Custom */);
241
+ encode$1(24 /* Custom */);
241
242
  }
242
243
  }
243
244
 
@@ -246,7 +247,7 @@ var updates$3 = null;
246
247
  function start$D() {
247
248
  data$i = {};
248
249
  updates$3 = {};
249
- count$1(5 /* Metric.InvokeCount */);
250
+ count$1(5 /* InvokeCount */);
250
251
  }
251
252
  function stop$z() {
252
253
  data$i = {};
@@ -287,7 +288,7 @@ function max(metric, value) {
287
288
  }
288
289
  }
289
290
  function compute$b() {
290
- encode$1(0 /* Event.Metric */);
291
+ encode$1(0 /* Metric */);
291
292
  }
292
293
  function reset$o() {
293
294
  updates$3 = {};
@@ -305,7 +306,7 @@ var last = 0;
305
306
  var interval = 0;
306
307
  var timeout$6 = null;
307
308
  function start$C() {
308
- interval = 60000 /* Setting.PingInterval */;
309
+ interval = 60000 /* PingInterval */;
309
310
  last = 0;
310
311
  }
311
312
  function reset$n() {
@@ -318,8 +319,8 @@ function reset$n() {
318
319
  function ping() {
319
320
  var now = time();
320
321
  data$h = { gap: now - last };
321
- encode$1(25 /* Event.Ping */);
322
- if (data$h.gap < 300000 /* Setting.PingTimeout */) {
322
+ encode$1(25 /* Ping */);
323
+ if (data$h.gap < 300000 /* PingTimeout */) {
323
324
  timeout$6 = setTimeout(ping, interval);
324
325
  }
325
326
  else {
@@ -356,7 +357,7 @@ function track$6(event, time) {
356
357
  var last = e[e.length - 1];
357
358
  // Add a new entry only if the new event occurs after configured interval
358
359
  // Otherwise, extend the duration of the previous entry
359
- if (time - last[0] > 100 /* Setting.SummaryInterval */) {
360
+ if (time - last[0] > 100 /* SummaryInterval */) {
360
361
  data$g[event].push([time, 0]);
361
362
  }
362
363
  else {
@@ -365,7 +366,7 @@ function track$6(event, time) {
365
366
  }
366
367
  }
367
368
  function compute$a() {
368
- encode$1(36 /* Event.Summary */);
369
+ encode$1(36 /* Summary */);
369
370
  }
370
371
  function reset$m() {
371
372
  data$g = {};
@@ -384,7 +385,7 @@ var summary = /*#__PURE__*/Object.freeze({
384
385
  var data$f = null;
385
386
  function start$A() {
386
387
  if (!config$1.lean && config$1.upgrade) {
387
- config$1.upgrade("Config" /* Constant.Config */);
388
+ config$1.upgrade("Config" /* Config */);
388
389
  }
389
390
  data$f = null;
390
391
  }
@@ -403,7 +404,7 @@ function upgrade(key) {
403
404
  if (config$1.upgrade) {
404
405
  config$1.upgrade(key);
405
406
  }
406
- encode$1(3 /* Event.Upgrade */);
407
+ encode$1(3 /* Upgrade */);
407
408
  }
408
409
  }
409
410
  function stop$w() {
@@ -423,25 +424,25 @@ function start$z() {
423
424
  reset$l();
424
425
  }
425
426
  function set(variable, value) {
426
- var values = typeof value === "string" /* Constant.String */ ? [value] : value;
427
+ var values = typeof value === "string" /* String */ ? [value] : value;
427
428
  log$2(variable, values);
428
429
  }
429
430
  function identify(userId, sessionId, pageId) {
430
431
  if (sessionId === void 0) { sessionId = null; }
431
432
  if (pageId === void 0) { pageId = null; }
432
- log$2("userId" /* Constant.UserId */, [userId]);
433
- log$2("sessionId" /* Constant.SessionId */, [sessionId]);
434
- log$2("pageId" /* Constant.PageId */, [pageId]);
433
+ log$2("userId" /* UserId */, [userId]);
434
+ log$2("sessionId" /* SessionId */, [sessionId]);
435
+ log$2("pageId" /* PageId */, [pageId]);
435
436
  }
436
437
  function log$2(variable, value) {
437
438
  if (active() &&
438
439
  variable &&
439
440
  value &&
440
- typeof variable === "string" /* Constant.String */ &&
441
+ typeof variable === "string" /* String */ &&
441
442
  variable.length < 255) {
442
443
  var validValues = variable in data$e ? data$e[variable] : [];
443
444
  for (var i = 0; i < value.length; i++) {
444
- if (typeof value[i] === "string" /* Constant.String */ && value[i].length < 255) {
445
+ if (typeof value[i] === "string" /* String */ && value[i].length < 255) {
445
446
  validValues.push(value[i]);
446
447
  }
447
448
  }
@@ -449,7 +450,7 @@ function log$2(variable, value) {
449
450
  }
450
451
  }
451
452
  function compute$9() {
452
- encode$1(34 /* Event.Variable */);
453
+ encode$1(34 /* Variable */);
453
454
  }
454
455
  function reset$l() {
455
456
  data$e = {};
@@ -469,7 +470,7 @@ var variable = /*#__PURE__*/Object.freeze({
469
470
  stop: stop$v
470
471
  });
471
472
 
472
- /******************************************************************************
473
+ /*! *****************************************************************************
473
474
  Copyright (c) Microsoft Corporation.
474
475
 
475
476
  Permission to use, copy, modify, and/or distribute this software for any
@@ -522,7 +523,7 @@ function __generator(thisArg, body) {
522
523
  }
523
524
  }
524
525
 
525
- var supported$1 = "CompressionStream" /* Constant.CompressionStream */ in window;
526
+ var supported$1 = "CompressionStream" /* CompressionStream */ in window;
526
527
  function compress (input) {
527
528
  return __awaiter(this, void 0, void 0, function () {
528
529
  var stream, _a;
@@ -539,7 +540,7 @@ function compress (input) {
539
540
  return [2 /*return*/];
540
541
  });
541
542
  });
542
- } }).pipeThrough(new TextEncoderStream()).pipeThrough(new window["CompressionStream" /* Constant.CompressionStream */]("gzip"));
543
+ } }).pipeThrough(new TextEncoderStream()).pipeThrough(new window["CompressionStream" /* CompressionStream */]("gzip"));
543
544
  _a = Uint8Array.bind;
544
545
  return [4 /*yield*/, read(stream)];
545
546
  case 1: return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _c.sent()]))()];
@@ -613,11 +614,11 @@ function scrub (value, hint, privacy, mangle) {
613
614
  if (mangle === void 0) { mangle = false; }
614
615
  if (value) {
615
616
  switch (privacy) {
616
- case 0 /* Privacy.None */:
617
+ case 0 /* None */:
617
618
  return value;
618
- case 1 /* Privacy.Sensitive */:
619
+ case 1 /* Sensitive */:
619
620
  switch (hint) {
620
- case "*T" /* Layout.Constant.TextTag */:
621
+ case "*T" /* TextTag */:
621
622
  case "value":
622
623
  case "placeholder":
623
624
  case "click":
@@ -625,16 +626,16 @@ function scrub (value, hint, privacy, mangle) {
625
626
  return redact(value);
626
627
  }
627
628
  return value;
628
- case 2 /* Privacy.Text */:
629
- case 3 /* Privacy.TextImage */:
629
+ case 2 /* Text */:
630
+ case 3 /* TextImage */:
630
631
  switch (hint) {
631
- case "*T" /* Layout.Constant.TextTag */:
632
+ case "*T" /* TextTag */:
632
633
  return mangle ? mangleText(value) : mask(value);
633
634
  case "src":
634
635
  case "srcset":
635
636
  case "title":
636
637
  case "alt":
637
- return privacy === 3 /* Privacy.TextImage */ ? "" /* Data.Constant.Empty */ : value;
638
+ return privacy === 3 /* TextImage */ ? "" /* Empty */ : value;
638
639
  case "value":
639
640
  case "click":
640
641
  case "input":
@@ -654,18 +655,18 @@ function mangleText(value) {
654
655
  var index = value.indexOf(first);
655
656
  var prefix = value.substr(0, index);
656
657
  var suffix = value.substr(index + trimmed.length);
657
- return "".concat(prefix).concat(trimmed.length.toString(36)).concat(suffix);
658
+ return "" + prefix + trimmed.length.toString(36) + suffix;
658
659
  }
659
660
  return value;
660
661
  }
661
662
  function mask(value) {
662
- return value.replace(catchallRegex, "\u2022" /* Data.Constant.Mask */);
663
+ return value.replace(catchallRegex, "\u2022" /* Mask */);
663
664
  }
664
665
  function mangleToken(value) {
665
- var length = ((Math.floor(value.length / 5 /* Data.Setting.WordLength */) + 1) * 5 /* Data.Setting.WordLength */);
666
- var output = "" /* Layout.Constant.Empty */;
666
+ var length = ((Math.floor(value.length / 5 /* WordLength */) + 1) * 5 /* WordLength */);
667
+ var output = "" /* Empty */;
667
668
  for (var i = 0; i < length; i++) {
668
- output += i > 0 && i % 5 /* Data.Setting.WordLength */ === 0 ? " " /* Data.Constant.Space */ : "\u2022" /* Data.Constant.Mask */;
669
+ output += i > 0 && i % 5 /* WordLength */ === 0 ? " " /* Space */ : "\u2022" /* Mask */;
669
670
  }
670
671
  return output;
671
672
  }
@@ -690,22 +691,22 @@ function redact(value) {
690
691
  }
691
692
  for (var i = 0; i < value.length; i++) {
692
693
  var c = value.charCodeAt(i);
693
- hasDigit = hasDigit || (c >= 48 /* Data.Character.Zero */ && c <= 57 /* Data.Character.Nine */); // Check for digits in the current word
694
- hasEmail = hasEmail || c === 64 /* Data.Character.At */; // Check for @ sign anywhere within the current word
695
- hasWhitespace = c === 9 /* Data.Character.Tab */ || c === 10 /* Data.Character.NewLine */ || c === 13 /* Data.Character.Return */ || c === 32 /* Data.Character.Blank */;
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 */;
696
697
  // Process each word as an individual token to redact any sensitive information
697
698
  if (i === 0 || i === value.length - 1 || hasWhitespace) {
698
699
  // Performance optimization: Lazy load string -> array conversion only when required
699
700
  if (hasDigit || hasEmail) {
700
701
  if (array === null) {
701
- array = value.split("" /* Data.Constant.Empty */);
702
+ array = value.split("" /* Empty */);
702
703
  }
703
704
  // Work on a token at a time so we don't have to apply regex to a larger string
704
705
  var token = value.substring(spaceIndex + 1, hasWhitespace ? i : i + 1);
705
706
  // Check if unicode regex is supported, otherwise fallback to calling mask function on this token
706
707
  if (unicodeRegex && currencyRegex !== null) {
707
708
  // Do not redact information if the token contains a currency symbol
708
- token = token.match(currencyRegex) ? token : token.replace(letterRegex, "\u2022" /* Data.Constant.Letter */).replace(digitRegex, "\u2022" /* Data.Constant.Digit */);
709
+ token = token.match(currencyRegex) ? token : token.replace(letterRegex, "\u25AA" /* Letter */).replace(digitRegex, "\u25AB" /* Digit */);
709
710
  }
710
711
  else {
711
712
  token = mask(token);
@@ -722,28 +723,28 @@ function redact(value) {
722
723
  }
723
724
  }
724
725
  }
725
- return array ? array.join("" /* Data.Constant.Empty */) : value;
726
+ return array ? array.join("" /* Empty */) : value;
726
727
  }
727
728
 
728
729
  var history$5 = [];
729
730
  var data$d;
730
731
  function start$x() {
731
732
  history$5 = [];
732
- max(26 /* Metric.Automation */, navigator.webdriver ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
733
+ max(26 /* Automation */, navigator.webdriver ? 1 /* True */ : 0 /* False */);
733
734
  }
734
735
  function check$4(id, target, input) {
735
736
  // Compute hash for fraud detection. Hash is computed only if input meets the minimum length criteria
736
- if (id !== null && input && input.length >= 5 /* Setting.WordLength */) {
737
+ if (id !== null && input && input.length >= 5 /* WordLength */) {
737
738
  data$d = { id: id, target: target, hash: hash(input) };
738
739
  // Only encode this event if we haven't already reported this hash
739
740
  if (history$5.indexOf(data$d.hash) < 0) {
740
741
  history$5.push(data$d.hash);
741
- encode$2(41 /* Event.Fraud */);
742
+ encode$2(41 /* Fraud */);
742
743
  }
743
744
  }
744
745
  }
745
746
 
746
- var excludeClassNames = "load,active,fixed,visible,focus,show,collaps,animat" /* Constant.ExcludeClassNames */.split("," /* Constant.Comma */);
747
+ var excludeClassNames = "load,active,fixed,visible,focus,show,collaps,animat" /* ExcludeClassNames */.split("," /* Comma */);
747
748
  var selectorMap = {};
748
749
  function reset$k() {
749
750
  selectorMap = {};
@@ -751,68 +752,68 @@ function reset$k() {
751
752
  function get$1(input, type) {
752
753
  var a = input.attributes;
753
754
  var prefix = input.prefix ? input.prefix[type] : null;
754
- var suffix = type === 0 /* Selector.Alpha */ ? "".concat("~" /* Constant.Tilde */).concat(input.position - 1) : ":nth-of-type(".concat(input.position, ")");
755
+ var suffix = type === 0 /* Alpha */ ? "" + "~" /* Tilde */ + (input.position - 1) : ":nth-of-type(" + input.position + ")";
755
756
  switch (input.tag) {
756
757
  case "STYLE":
757
758
  case "TITLE":
758
759
  case "LINK":
759
760
  case "META":
760
- case "*T" /* Constant.TextTag */:
761
- case "*D" /* Constant.DocumentTag */:
762
- return "" /* Constant.Empty */;
761
+ case "*T" /* TextTag */:
762
+ case "*D" /* DocumentTag */:
763
+ return "" /* Empty */;
763
764
  case "HTML":
764
- return "HTML" /* Constant.HTML */;
765
+ return "HTML" /* HTML */;
765
766
  default:
766
767
  if (prefix === null) {
767
- return "" /* Constant.Empty */;
768
+ return "" /* Empty */;
768
769
  }
769
- prefix = "".concat(prefix).concat(">" /* Constant.Separator */);
770
- input.tag = input.tag.indexOf("svg:" /* Constant.SvgPrefix */) === 0 ? input.tag.substr("svg:" /* Constant.SvgPrefix */.length) : input.tag;
771
- var selector = "".concat(prefix).concat(input.tag).concat(suffix);
772
- var id = "id" /* Constant.Id */ in a && a["id" /* Constant.Id */].length > 0 ? a["id" /* Constant.Id */] : null;
773
- 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;
770
+ prefix = "" + prefix + ">" /* Separator */;
771
+ input.tag = input.tag.indexOf("svg:" /* SvgPrefix */) === 0 ? input.tag.substr("svg:" /* SvgPrefix */.length) : input.tag;
772
+ var selector = "" + prefix + input.tag + suffix;
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;
774
775
  if (classes && classes.length > 0) {
775
- if (type === 0 /* Selector.Alpha */) {
776
+ if (type === 0 /* Alpha */) {
776
777
  // In Alpha mode, update selector to use class names, with relative positioning within the parent id container.
777
778
  // If the node has valid class name(s) then drop relative positioning within the parent path to keep things simple.
778
- var key = "".concat(getDomPath(prefix)).concat(input.tag).concat("." /* Constant.Dot */).concat(classes);
779
+ var key = "" + getDomPath(prefix) + input.tag + "." /* Dot */ + classes;
779
780
  if (!(key in selectorMap)) {
780
781
  selectorMap[key] = [];
781
782
  }
782
783
  if (selectorMap[key].indexOf(input.id) < 0) {
783
784
  selectorMap[key].push(input.id);
784
785
  }
785
- selector = "".concat(key).concat("~" /* Constant.Tilde */).concat(selectorMap[key].indexOf(input.id));
786
+ selector = "" + key + "~" /* Tilde */ + selectorMap[key].indexOf(input.id);
786
787
  }
787
788
  else {
788
789
  // In Beta mode, we continue to look at query selectors in context of the full page
789
- selector = "".concat(prefix).concat(input.tag, ".").concat(classes).concat(suffix);
790
+ selector = "" + prefix + input.tag + "." + classes + suffix;
790
791
  }
791
792
  }
792
793
  // Update selector to use "id" field when available. There are two exceptions:
793
794
  // (1) if "id" appears to be an auto generated string token, e.g. guid or a random id containing digits
794
795
  // (2) if "id" appears inside a shadow DOM, in which case we continue to prefix up to shadow DOM to prevent conflicts
795
- selector = id && filter(id) ? "".concat(getDomPrefix(prefix)).concat("#" /* Constant.Hash */).concat(id) : selector;
796
+ selector = id && filter(id) ? "" + getDomPrefix(prefix) + "#" /* Hash */ + id : selector;
796
797
  return selector;
797
798
  }
798
799
  }
799
800
  function getDomPrefix(prefix) {
800
- var shadowDomStart = prefix.lastIndexOf("*S" /* Constant.ShadowDomTag */);
801
- var iframeDomStart = prefix.lastIndexOf("".concat("iframe:" /* Constant.IFramePrefix */).concat("HTML" /* Constant.HTML */));
801
+ var shadowDomStart = prefix.lastIndexOf("*S" /* ShadowDomTag */);
802
+ var iframeDomStart = prefix.lastIndexOf("" + "iframe:" /* IFramePrefix */ + "HTML" /* HTML */);
802
803
  var domStart = Math.max(shadowDomStart, iframeDomStart);
803
804
  if (domStart < 0) {
804
- return "" /* Constant.Empty */;
805
+ return "" /* Empty */;
805
806
  }
806
- return prefix.substring(0, prefix.indexOf(">" /* Constant.Separator */, domStart) + 1);
807
+ return prefix.substring(0, prefix.indexOf(">" /* Separator */, domStart) + 1);
807
808
  }
808
809
  function getDomPath(input) {
809
- var parts = input.split(">" /* Constant.Separator */);
810
+ var parts = input.split(">" /* Separator */);
810
811
  for (var i = 0; i < parts.length; i++) {
811
- var tIndex = parts[i].indexOf("~" /* Constant.Tilde */);
812
- var dIndex = parts[i].indexOf("." /* Constant.Dot */);
812
+ var tIndex = parts[i].indexOf("~" /* Tilde */);
813
+ var dIndex = parts[i].indexOf("." /* Dot */);
813
814
  parts[i] = parts[i].substring(0, dIndex > 0 ? dIndex : (tIndex > 0 ? tIndex : parts[i].length));
814
815
  }
815
- return parts.join(">" /* Constant.Separator */);
816
+ return parts.join(">" /* Separator */);
816
817
  }
817
818
  // Check if the given input string has digits or excluded class names
818
819
  function filter(value) {
@@ -824,7 +825,7 @@ function filter(value) {
824
825
  }
825
826
  for (var i = 0; i < value.length; i++) {
826
827
  var c = value.charCodeAt(i);
827
- if (c >= 48 /* Character.Zero */ && c <= 57 /* Character.Nine */) {
828
+ if (c >= 48 /* Zero */ && c <= 57 /* Nine */) {
828
829
  return false;
829
830
  }
830
831
  }
@@ -867,7 +868,7 @@ function reset$j() {
867
868
  pauseTask = null;
868
869
  }
869
870
  function schedule$1(task, priority) {
870
- if (priority === void 0) { priority = 0 /* Priority.Normal */; }
871
+ if (priority === void 0) { priority = 0 /* Normal */; }
871
872
  return __awaiter(this, void 0, void 0, function () {
872
873
  var _i, queuedTasks_1, q, promise;
873
874
  return __generator(this, function (_a) {
@@ -879,7 +880,7 @@ function schedule$1(task, priority) {
879
880
  }
880
881
  }
881
882
  promise = new Promise(function (resolve) {
882
- var insert = priority === 1 /* Priority.High */ ? "unshift" : "push";
883
+ var insert = priority === 1 /* High */ ? "unshift" : "push";
883
884
  // Queue this task for asynchronous execution later
884
885
  // We also store a unique page identifier (id) along with the task to ensure
885
886
  // ensure that we do not accidentally execute this task in context of a different page
@@ -914,7 +915,7 @@ function run() {
914
915
  return;
915
916
  }
916
917
  if (error) {
917
- log$1(0 /* Code.RunTask */, 1 /* Severity.Warning */, error.name, error.message, error.stack);
918
+ log$1(0 /* RunTask */, 1 /* Warning */, error.name, error.message, error.stack);
918
919
  }
919
920
  activeTask = null;
920
921
  run();
@@ -925,13 +926,13 @@ function state$8(timer) {
925
926
  var id = key(timer);
926
927
  if (id in tracker) {
927
928
  var elapsed = performance.now() - tracker[id].start;
928
- return (elapsed > tracker[id].yield) ? 0 /* Task.Wait */ : 1 /* Task.Run */;
929
+ return (elapsed > tracker[id].yield) ? 0 /* Wait */ : 1 /* Run */;
929
930
  }
930
931
  // If this task is no longer being tracked, send stop message to the caller
931
- return 2 /* Task.Stop */;
932
+ return 2 /* Stop */;
932
933
  }
933
934
  function start$w(timer) {
934
- tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* Setting.LongTask */ };
935
+ tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* LongTask */ };
935
936
  }
936
937
  function restart$2(timer) {
937
938
  var id = key(timer);
@@ -948,11 +949,11 @@ function stop$t(timer) {
948
949
  var id = key(timer);
949
950
  var duration = end - tracker[id].start;
950
951
  sum(timer.cost, duration);
951
- count$1(5 /* Metric.InvokeCount */);
952
+ count$1(5 /* InvokeCount */);
952
953
  // For the first execution, which is synchronous, time is automatically counted towards TotalDuration.
953
954
  // However, for subsequent asynchronous runs, we need to manually update TotalDuration metric.
954
955
  if (tracker[id].calls > 0) {
955
- sum(4 /* Metric.TotalCost */, duration);
956
+ sum(4 /* TotalCost */, duration);
956
957
  }
957
958
  }
958
959
  function suspend$1(timer) {
@@ -973,13 +974,13 @@ function suspend$1(timer) {
973
974
  case 2:
974
975
  // After we are done with suspending task, ensure that we are still operating in the right context
975
976
  // If the task is still being tracked, continue running the task, otherwise ask caller to stop execution
976
- return [2 /*return*/, id in tracker ? 1 /* Task.Run */ : 2 /* Task.Stop */];
977
+ return [2 /*return*/, id in tracker ? 1 /* Run */ : 2 /* Stop */];
977
978
  }
978
979
  });
979
980
  });
980
981
  }
981
982
  function key(timer) {
982
- return "".concat(timer.id, ".").concat(timer.cost);
983
+ return timer.id + "." + timer.cost;
983
984
  }
984
985
  function wait() {
985
986
  return __awaiter(this, void 0, void 0, function () {
@@ -1017,14 +1018,14 @@ function requestIdleCallbackPolyfill(callback, options) {
1017
1018
  var currentTime = performance.now();
1018
1019
  var elapsed = currentTime - startTime;
1019
1020
  var duration = currentTime - event.data;
1020
- if (duration > 30 /* Setting.LongTask */ && elapsed < options.timeout) {
1021
+ if (duration > 30 /* LongTask */ && elapsed < options.timeout) {
1021
1022
  requestAnimationFrame(function () { outgoing.postMessage(currentTime); });
1022
1023
  }
1023
1024
  else {
1024
1025
  var didTimeout_1 = elapsed > options.timeout;
1025
1026
  callback({
1026
1027
  didTimeout: didTimeout_1,
1027
- timeRemaining: function () { return didTimeout_1 ? 30 /* Setting.LongTask */ : Math.max(0, 30 /* Setting.LongTask */ - duration); }
1028
+ timeRemaining: function () { return didTimeout_1 ? 30 /* LongTask */ : Math.max(0, 30 /* LongTask */ - duration); }
1028
1029
  });
1029
1030
  }
1030
1031
  };
@@ -1045,7 +1046,7 @@ function tokenize (tokens) {
1045
1046
  var reference = null;
1046
1047
  for (var i = 0; i < tokens.length; i++) {
1047
1048
  // Only optimize for string values
1048
- if (typeof tokens[i] === "string" /* Constant.String */) {
1049
+ if (typeof tokens[i] === "string" /* String */) {
1049
1050
  var token = tokens[i];
1050
1051
  var index = lookup[token] || -1;
1051
1052
  if (index >= 0) {
@@ -1087,10 +1088,10 @@ function encode$4 (type, timer, ts) {
1087
1088
  tokens = [eventTime, type];
1088
1089
  _a = type;
1089
1090
  switch (_a) {
1090
- case 8 /* Event.Document */: return [3 /*break*/, 1];
1091
- case 7 /* Event.Region */: return [3 /*break*/, 2];
1092
- case 5 /* Event.Discover */: return [3 /*break*/, 3];
1093
- case 6 /* Event.Mutation */: return [3 /*break*/, 3];
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];
1094
1095
  }
1095
1096
  return [3 /*break*/, 10];
1096
1097
  case 1:
@@ -1103,7 +1104,7 @@ function encode$4 (type, timer, ts) {
1103
1104
  case 2:
1104
1105
  for (_i = 0, _b = state$1; _i < _b.length; _i++) {
1105
1106
  r = _b[_i];
1106
- tokens = [r.time, 7 /* Event.Region */];
1107
+ tokens = [r.time, 7 /* Region */];
1107
1108
  tokens.push(r.data.id);
1108
1109
  tokens.push(r.data.interaction);
1109
1110
  tokens.push(r.data.visibility);
@@ -1114,7 +1115,7 @@ function encode$4 (type, timer, ts) {
1114
1115
  return [3 /*break*/, 10];
1115
1116
  case 3:
1116
1117
  // Check if we are operating within the context of the current page
1117
- if (state$8(timer) === 2 /* Task.Stop */) {
1118
+ if (state$8(timer) === 2 /* Stop */) {
1118
1119
  return [3 /*break*/, 10];
1119
1120
  }
1120
1121
  values = updates$2();
@@ -1125,13 +1126,13 @@ function encode$4 (type, timer, ts) {
1125
1126
  if (!(_c < values_1.length)) return [3 /*break*/, 8];
1126
1127
  value = values_1[_c];
1127
1128
  state = state$8(timer);
1128
- if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 6];
1129
+ if (!(state === 0 /* Wait */)) return [3 /*break*/, 6];
1129
1130
  return [4 /*yield*/, suspend$1(timer)];
1130
1131
  case 5:
1131
1132
  state = _e.sent();
1132
1133
  _e.label = 6;
1133
1134
  case 6:
1134
- if (state === 2 /* Task.Stop */) {
1135
+ if (state === 2 /* Stop */) {
1135
1136
  return [3 /*break*/, 8];
1136
1137
  }
1137
1138
  data = value.data;
@@ -1154,9 +1155,9 @@ function encode$4 (type, timer, ts) {
1154
1155
  if (value.previous && active) {
1155
1156
  tokens.push(value.previous);
1156
1157
  }
1157
- tokens.push(suspend ? "*M" /* Constant.SuspendMutationTag */ : data[key]);
1158
+ tokens.push(suspend ? "*M" /* SuspendMutationTag */ : data[key]);
1158
1159
  if (box && box.length === 2) {
1159
- tokens.push("".concat("#" /* Constant.Hash */).concat(str$1(box[0]), ".").concat(str$1(box[1])));
1160
+ tokens.push("" + "#" /* Hash */ + str$1(box[0]) + "." + str$1(box[1]));
1160
1161
  }
1161
1162
  break;
1162
1163
  case "attributes":
@@ -1178,7 +1179,7 @@ function encode$4 (type, timer, ts) {
1178
1179
  _c++;
1179
1180
  return [3 /*break*/, 4];
1180
1181
  case 8:
1181
- if (type === 6 /* Event.Mutation */) {
1182
+ if (type === 6 /* Mutation */) {
1182
1183
  activity(eventTime);
1183
1184
  }
1184
1185
  queue(tokenize(tokens), !config$1.lean);
@@ -1191,13 +1192,13 @@ function encode$4 (type, timer, ts) {
1191
1192
  }
1192
1193
  function shouldMangle(value) {
1193
1194
  var privacy = value.metadata.privacy;
1194
- return value.data.tag === "*T" /* Constant.TextTag */ && !(privacy === 0 /* Privacy.None */ || privacy === 1 /* Privacy.Sensitive */);
1195
+ return value.data.tag === "*T" /* TextTag */ && !(privacy === 0 /* None */ || privacy === 1 /* Sensitive */);
1195
1196
  }
1196
1197
  function size$1(value) {
1197
1198
  if (value.metadata.size !== null && value.metadata.size.length === 0) {
1198
1199
  var img = getNode(value.id);
1199
1200
  if (img) {
1200
- return [Math.floor(img.offsetWidth * 100 /* Setting.BoxPrecision */), Math.floor(img.offsetHeight * 100 /* Setting.BoxPrecision */)];
1201
+ return [Math.floor(img.offsetWidth * 100 /* BoxPrecision */), Math.floor(img.offsetHeight * 100 /* BoxPrecision */)];
1201
1202
  }
1202
1203
  }
1203
1204
  return value.metadata.size;
@@ -1206,7 +1207,7 @@ function str$1(input) {
1206
1207
  return input.toString(36);
1207
1208
  }
1208
1209
  function attribute(key, value, privacy) {
1209
- return "".concat(key, "=").concat(scrub(value, key, privacy));
1210
+ return key + "=" + scrub(value, key, privacy);
1210
1211
  }
1211
1212
 
1212
1213
  var data$c;
@@ -1237,7 +1238,7 @@ function compute$7() {
1237
1238
  // Check that width or height has changed from before, and also that width & height are not null values
1238
1239
  if ((data$c === null || width !== data$c.width || height !== data$c.height) && width !== null && height !== null) {
1239
1240
  data$c = { width: width, height: height };
1240
- encode$4(8 /* Event.Document */);
1241
+ encode$4(8 /* Document */);
1241
1242
  }
1242
1243
  }
1243
1244
  function end() {
@@ -1266,7 +1267,7 @@ function start$u() {
1266
1267
  reset$h();
1267
1268
  }
1268
1269
  function observe$b(root) {
1269
- bind(root, "click", handler$3.bind(this, 9 /* Event.Click */, root), true);
1270
+ bind(root, "click", handler$3.bind(this, 9 /* Click */, root), true);
1270
1271
  }
1271
1272
  function handler$3(event, root, evt) {
1272
1273
  var frame = iframe(root);
@@ -1292,14 +1293,13 @@ function handler$3(event, root, evt) {
1292
1293
  x = Math.round(l.x + (l.w / 2));
1293
1294
  y = Math.round(l.y + (l.h / 2));
1294
1295
  }
1295
- var eX = l ? Math.max(Math.floor(((x - l.x) / l.w) * 32767 /* Setting.ClickPrecision */), 0) : 0;
1296
- var eY = l ? Math.max(Math.floor(((y - l.y) / l.h) * 32767 /* Setting.ClickPrecision */), 0) : 0;
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;
1297
1298
  // Check for null values before processing this event
1298
1299
  if (x !== null && y !== null) {
1299
1300
  state$7.push({
1300
1301
  time: time(),
1301
- event: event,
1302
- data: {
1302
+ event: event, data: {
1303
1303
  target: t,
1304
1304
  x: x,
1305
1305
  y: y,
@@ -1311,7 +1311,7 @@ function handler$3(event, root, evt) {
1311
1311
  text: text(t),
1312
1312
  link: a ? a.href : null,
1313
1313
  hash: null,
1314
- trust: evt.isTrusted ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */
1314
+ trust: evt.isTrusted ? 1 /* True */ : 0 /* False */
1315
1315
  }
1316
1316
  });
1317
1317
  schedule$1(encode$3.bind(this, event));
@@ -1326,7 +1326,7 @@ function text(element) {
1326
1326
  // Trim any spaces at the beginning or at the end of string
1327
1327
  // Also, replace multiple occurrence of space characters with a single white space
1328
1328
  // Finally, send only first few characters as specified by the Setting
1329
- output = t.trim().replace(/\s+/g, " " /* Constant.Space */).substr(0, 25 /* Setting.ClickText */);
1329
+ output = t.trim().replace(/\s+/g, " " /* Space */).substr(0, 25 /* ClickText */);
1330
1330
  }
1331
1331
  }
1332
1332
  return output;
@@ -1335,10 +1335,10 @@ function reaction(element) {
1335
1335
  if (element.nodeType === Node.ELEMENT_NODE) {
1336
1336
  var tag = element.tagName.toLowerCase();
1337
1337
  if (UserInputTags.indexOf(tag) >= 0) {
1338
- return 0 /* BooleanFlag.False */;
1338
+ return 0 /* False */;
1339
1339
  }
1340
1340
  }
1341
- return 1 /* BooleanFlag.True */;
1341
+ return 1 /* True */;
1342
1342
  }
1343
1343
  function layout$1(element) {
1344
1344
  var box = null;
@@ -1362,14 +1362,14 @@ function layout$1(element) {
1362
1362
  return box;
1363
1363
  }
1364
1364
  function context(a) {
1365
- if (a && a.hasAttribute("target" /* Constant.Target */)) {
1366
- switch (a.getAttribute("target" /* Constant.Target */)) {
1367
- case "_blank" /* Constant.Blank */: return 1 /* BrowsingContext.Blank */;
1368
- case "_parent" /* Constant.Parent */: return 2 /* BrowsingContext.Parent */;
1369
- case "_top" /* Constant.Top */: return 3 /* BrowsingContext.Top */;
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 */;
1370
1370
  }
1371
1371
  }
1372
- return 0 /* BrowsingContext.Self */;
1372
+ return 0 /* Self */;
1373
1373
  }
1374
1374
  function reset$h() {
1375
1375
  state$7 = [];
@@ -1383,13 +1383,13 @@ function start$t() {
1383
1383
  reset$g();
1384
1384
  }
1385
1385
  function observe$a(root) {
1386
- bind(root, "cut", recompute$7.bind(this, 0 /* Clipboard.Cut */), true);
1387
- bind(root, "copy", recompute$7.bind(this, 1 /* Clipboard.Copy */), true);
1388
- bind(root, "paste", recompute$7.bind(this, 2 /* Clipboard.Paste */), true);
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);
1389
1389
  }
1390
1390
  function recompute$7(action, evt) {
1391
- state$6.push({ time: time(), event: 38 /* Event.Clipboard */, data: { target: target(evt), action: action } });
1392
- schedule$1(encode$3.bind(this, 38 /* Event.Clipboard */));
1391
+ state$6.push({ time: time(), event: 38 /* Clipboard */, data: { target: target(evt), action: action } });
1392
+ schedule$1(encode$3.bind(this, 38 /* Clipboard */));
1393
1393
  }
1394
1394
  function reset$g() {
1395
1395
  state$6 = [];
@@ -1422,9 +1422,9 @@ function recompute$6(evt) {
1422
1422
  if (state$5.length > 0 && (state$5[state$5.length - 1].data.target === data.target)) {
1423
1423
  state$5.pop();
1424
1424
  }
1425
- state$5.push({ time: time(), event: 27 /* Event.Input */, data: data });
1425
+ state$5.push({ time: time(), event: 27 /* Input */, data: data });
1426
1426
  clearTimeout(timeout$5);
1427
- timeout$5 = setTimeout(process$6, 500 /* Setting.LookAhead */, 27 /* Event.Input */);
1427
+ timeout$5 = setTimeout(process$6, 500 /* LookAhead */, 27 /* Input */);
1428
1428
  }
1429
1429
  }
1430
1430
  function process$6(event) {
@@ -1444,15 +1444,15 @@ function start$r() {
1444
1444
  reset$e();
1445
1445
  }
1446
1446
  function observe$8(root) {
1447
- bind(root, "mousedown", mouse.bind(this, 13 /* Event.MouseDown */, root), true);
1448
- bind(root, "mouseup", mouse.bind(this, 14 /* Event.MouseUp */, root), true);
1449
- bind(root, "mousemove", mouse.bind(this, 12 /* Event.MouseMove */, root), true);
1450
- bind(root, "wheel", mouse.bind(this, 15 /* Event.MouseWheel */, root), true);
1451
- bind(root, "dblclick", mouse.bind(this, 16 /* Event.DoubleClick */, root), true);
1452
- bind(root, "touchstart", touch.bind(this, 17 /* Event.TouchStart */, root), true);
1453
- bind(root, "touchend", touch.bind(this, 18 /* Event.TouchEnd */, root), true);
1454
- bind(root, "touchmove", touch.bind(this, 19 /* Event.TouchMove */, root), true);
1455
- bind(root, "touchcancel", touch.bind(this, 20 /* Event.TouchCancel */, root), true);
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);
1456
1456
  }
1457
1457
  function mouse(event, root, evt) {
1458
1458
  var frame = iframe(root);
@@ -1491,9 +1491,9 @@ function touch(event, root, evt) {
1491
1491
  }
1492
1492
  function handler$2(current) {
1493
1493
  switch (current.event) {
1494
- case 12 /* Event.MouseMove */:
1495
- case 15 /* Event.MouseWheel */:
1496
- case 19 /* Event.TouchMove */:
1494
+ case 12 /* MouseMove */:
1495
+ case 15 /* MouseWheel */:
1496
+ case 19 /* TouchMove */:
1497
1497
  var length_1 = state$4.length;
1498
1498
  var last = length_1 > 1 ? state$4[length_1 - 2] : null;
1499
1499
  if (last && similar$1(last, current)) {
@@ -1501,7 +1501,7 @@ function handler$2(current) {
1501
1501
  }
1502
1502
  state$4.push(current);
1503
1503
  clearTimeout(timeout$4);
1504
- timeout$4 = setTimeout(process$5, 500 /* Setting.LookAhead */, current.event);
1504
+ timeout$4 = setTimeout(process$5, 500 /* LookAhead */, current.event);
1505
1505
  break;
1506
1506
  default:
1507
1507
  state$4.push(current);
@@ -1521,7 +1521,7 @@ function similar$1(last, current) {
1521
1521
  var distance = Math.sqrt(dx * dx + dy * dy);
1522
1522
  var gap = current.time - last.time;
1523
1523
  var match = current.data.target === last.data.target;
1524
- return current.event === last.event && match && distance < 20 /* Setting.Distance */ && gap < 25 /* Setting.Interval */;
1524
+ return current.event === last.event && match && distance < 20 /* Distance */ && gap < 25 /* Interval */;
1525
1525
  }
1526
1526
  function stop$p() {
1527
1527
  clearTimeout(timeout$4);
@@ -1544,7 +1544,7 @@ function recompute$5() {
1544
1544
  width: de && "clientWidth" in de ? Math.min(de.clientWidth, window.innerWidth) : window.innerWidth,
1545
1545
  height: de && "clientHeight" in de ? Math.min(de.clientHeight, window.innerHeight) : window.innerHeight,
1546
1546
  };
1547
- encode$3(11 /* Event.Resize */);
1547
+ encode$3(11 /* Resize */);
1548
1548
  }
1549
1549
  function reset$d() {
1550
1550
  data$b = null;
@@ -1580,7 +1580,7 @@ function recompute$4(event) {
1580
1580
  // And, if for some reason that is not available, fall back to looking up scrollTop on document.documentElement.
1581
1581
  var x = element === de && "pageXOffset" in w ? Math.round(w.pageXOffset) : Math.round(element.scrollLeft);
1582
1582
  var y = element === de && "pageYOffset" in w ? Math.round(w.pageYOffset) : Math.round(element.scrollTop);
1583
- var current = { time: time(), event: 10 /* Event.Scroll */, data: { target: element, x: x, y: y } };
1583
+ var current = { time: time(), event: 10 /* Scroll */, data: { target: element, x: x, y: y } };
1584
1584
  // We don't send any scroll events if this is the first event and the current position is top (0,0)
1585
1585
  if ((event === null && x === 0 && y === 0) || (x === null || y === null)) {
1586
1586
  return;
@@ -1592,7 +1592,7 @@ function recompute$4(event) {
1592
1592
  }
1593
1593
  state$3.push(current);
1594
1594
  clearTimeout(timeout$3);
1595
- timeout$3 = setTimeout(process$4, 500 /* Setting.LookAhead */, 10 /* Event.Scroll */);
1595
+ timeout$3 = setTimeout(process$4, 500 /* LookAhead */, 10 /* Scroll */);
1596
1596
  }
1597
1597
  function reset$c() {
1598
1598
  state$3 = [];
@@ -1603,7 +1603,7 @@ function process$4(event) {
1603
1603
  function similar(last, current) {
1604
1604
  var dx = last.data.x - current.data.x;
1605
1605
  var dy = last.data.y - current.data.y;
1606
- return (dx * dx + dy * dy < 20 /* Setting.Distance */ * 20 /* Setting.Distance */) && (current.time - last.time < 25 /* Setting.Interval */);
1606
+ return (dx * dx + dy * dy < 20 /* Distance */ * 20 /* Distance */) && (current.time - last.time < 25 /* Interval */);
1607
1607
  }
1608
1608
  function stop$n() {
1609
1609
  clearTimeout(timeout$3);
@@ -1638,7 +1638,7 @@ function recompute$3(root) {
1638
1638
  var startNode = data$a.start ? data$a.start : null;
1639
1639
  if (previous !== null && data$a.start !== null && startNode !== current.anchorNode) {
1640
1640
  clearTimeout(timeout$2);
1641
- process$3(21 /* Event.Selection */);
1641
+ process$3(21 /* Selection */);
1642
1642
  }
1643
1643
  data$a = {
1644
1644
  start: current.anchorNode,
@@ -1648,7 +1648,7 @@ function recompute$3(root) {
1648
1648
  };
1649
1649
  previous = current;
1650
1650
  clearTimeout(timeout$2);
1651
- timeout$2 = setTimeout(process$3, 500 /* Setting.LookAhead */, 21 /* Event.Selection */);
1651
+ timeout$2 = setTimeout(process$3, 500 /* LookAhead */, 21 /* Selection */);
1652
1652
  }
1653
1653
  function process$3(event) {
1654
1654
  schedule$1(encode$3.bind(this, event));
@@ -1670,8 +1670,8 @@ function observe$5(root) {
1670
1670
  bind(root, "submit", recompute$2, true);
1671
1671
  }
1672
1672
  function recompute$2(evt) {
1673
- state$2.push({ time: time(), event: 39 /* Event.Submit */, data: { target: target(evt) } });
1674
- schedule$1(encode$3.bind(this, 39 /* Event.Submit */));
1673
+ state$2.push({ time: time(), event: 39 /* Submit */, data: { target: target(evt) } });
1674
+ schedule$1(encode$3.bind(this, 39 /* Submit */));
1675
1675
  }
1676
1676
  function reset$a() {
1677
1677
  state$2 = [];
@@ -1686,7 +1686,7 @@ function start$m() {
1686
1686
  }
1687
1687
  function recompute$1(evt) {
1688
1688
  data$9 = { name: evt.type };
1689
- encode$3(26 /* Event.Unload */);
1689
+ encode$3(26 /* Unload */);
1690
1690
  stop();
1691
1691
  }
1692
1692
  function reset$9() {
@@ -1703,7 +1703,7 @@ function start$l() {
1703
1703
  }
1704
1704
  function recompute() {
1705
1705
  data$8 = { visible: "visibilityState" in document ? document.visibilityState : "default" };
1706
- encode$3(28 /* Event.Visibility */);
1706
+ encode$3(28 /* Visibility */);
1707
1707
  }
1708
1708
  function reset$8() {
1709
1709
  data$8 = null;
@@ -1765,51 +1765,51 @@ function ld(json) {
1765
1765
  for (var _i = 0, _a = Object.keys(json); _i < _a.length; _i++) {
1766
1766
  var key = _a[_i];
1767
1767
  var value = json[key];
1768
- if (key === "@type" /* JsonLD.Type */ && typeof value === "string") {
1768
+ if (key === "@type" /* Type */ && typeof value === "string") {
1769
1769
  value = value.toLowerCase();
1770
1770
  /* Normalizations */
1771
- value = value.indexOf("article" /* JsonLD.Article */) >= 0 || value.indexOf("posting" /* JsonLD.Posting */) >= 0 ? "article" /* JsonLD.Article */ : value;
1771
+ value = value.indexOf("article" /* Article */) >= 0 || value.indexOf("posting" /* Posting */) >= 0 ? "article" /* Article */ : value;
1772
1772
  switch (value) {
1773
- case "article" /* JsonLD.Article */:
1774
- case "recipe" /* JsonLD.Recipe */:
1775
- log(5 /* Dimension.SchemaType */, json[key]);
1776
- log(8 /* Dimension.AuthorName */, json["creator" /* JsonLD.Creator */]);
1777
- log(18 /* Dimension.Headline */, json["headline" /* JsonLD.Headline */]);
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 */]);
1778
1778
  break;
1779
- case "product" /* JsonLD.Product */:
1780
- log(5 /* Dimension.SchemaType */, json[key]);
1781
- log(10 /* Dimension.ProductName */, json["name" /* JsonLD.Name */]);
1782
- log(12 /* Dimension.ProductSku */, json["sku" /* JsonLD.Sku */]);
1783
- if (json["brand" /* JsonLD.Brand */]) {
1784
- log(6 /* Dimension.ProductBrand */, json["brand" /* JsonLD.Brand */]["name" /* JsonLD.Name */]);
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 */]);
1785
1785
  }
1786
1786
  break;
1787
- case "aggregaterating" /* JsonLD.AggregateRating */:
1788
- if (json["ratingValue" /* JsonLD.RatingValue */]) {
1789
- max(11 /* Metric.RatingValue */, num$1(json["ratingValue" /* JsonLD.RatingValue */], 100 /* Setting.RatingScale */));
1790
- max(18 /* Metric.BestRating */, num$1(json["bestRating" /* JsonLD.BestRating */]));
1791
- max(19 /* Metric.WorstRating */, num$1(json["worstRating" /* JsonLD.WorstRating */]));
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 */]));
1792
1792
  }
1793
- max(12 /* Metric.RatingCount */, num$1(json["ratingCount" /* JsonLD.RatingCount */]));
1794
- max(17 /* Metric.ReviewCount */, num$1(json["reviewCount" /* JsonLD.ReviewCount */]));
1793
+ max(12 /* RatingCount */, num$1(json["ratingCount" /* RatingCount */]));
1794
+ max(17 /* ReviewCount */, num$1(json["reviewCount" /* ReviewCount */]));
1795
1795
  break;
1796
- case "person" /* JsonLD.Author */:
1797
- log(8 /* Dimension.AuthorName */, json["name" /* JsonLD.Name */]);
1796
+ case "person" /* Author */:
1797
+ log(8 /* AuthorName */, json["name" /* Name */]);
1798
1798
  break;
1799
- case "offer" /* JsonLD.Offer */:
1800
- log(7 /* Dimension.ProductAvailability */, json["availability" /* JsonLD.Availability */]);
1801
- log(14 /* Dimension.ProductCondition */, json["itemCondition" /* JsonLD.ItemCondition */]);
1802
- log(13 /* Dimension.ProductCurrency */, json["priceCurrency" /* JsonLD.PriceCurrency */]);
1803
- log(12 /* Dimension.ProductSku */, json["sku" /* JsonLD.Sku */]);
1804
- max(13 /* Metric.ProductPrice */, num$1(json["price" /* JsonLD.Price */]));
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 */]));
1805
1805
  break;
1806
- case "brand" /* JsonLD.Brand */:
1807
- log(6 /* Dimension.ProductBrand */, json["name" /* JsonLD.Name */]);
1806
+ case "brand" /* Brand */:
1807
+ log(6 /* ProductBrand */, json["name" /* Name */]);
1808
1808
  break;
1809
1809
  }
1810
1810
  }
1811
1811
  // Continue parsing nested objects
1812
- if (value !== null && typeof (value) === "object" /* Constant.Object */) {
1812
+ if (value !== null && typeof (value) === "object" /* Object */) {
1813
1813
  ld(value);
1814
1814
  }
1815
1815
  }
@@ -1818,8 +1818,8 @@ function num$1(input, scale) {
1818
1818
  if (scale === void 0) { scale = 1; }
1819
1819
  if (input !== null) {
1820
1820
  switch (typeof input) {
1821
- case "number" /* Constant.Number */: return Math.round(input * scale);
1822
- case "string" /* Constant.String */: return Math.round(parseFloat(input.replace(digitsRegex, "" /* Constant.Empty */)) * scale);
1821
+ case "number" /* Number */: return Math.round(input * scale);
1822
+ case "string" /* String */: return Math.round(parseFloat(input.replace(digitsRegex, "" /* Empty */)) * scale);
1823
1823
  }
1824
1824
  }
1825
1825
  return null;
@@ -1830,11 +1830,11 @@ var newlineRegex = /[\r\n]+/g;
1830
1830
  function processNode (node, source) {
1831
1831
  var child = null;
1832
1832
  // Do not track this change if we are attempting to remove a node before discovering it
1833
- if (source === 2 /* Source.ChildListRemove */ && has(node) === false) {
1833
+ if (source === 2 /* ChildListRemove */ && has(node) === false) {
1834
1834
  return child;
1835
1835
  }
1836
1836
  // Special handling for text nodes that belong to style nodes
1837
- if (source !== 0 /* Source.Discover */ &&
1837
+ if (source !== 0 /* Discover */ &&
1838
1838
  node.nodeType === Node.TEXT_NODE &&
1839
1839
  node.parentElement &&
1840
1840
  node.parentElement.tagName === "STYLE") {
@@ -1847,10 +1847,10 @@ function processNode (node, source) {
1847
1847
  switch (node.nodeType) {
1848
1848
  case Node.DOCUMENT_TYPE_NODE:
1849
1849
  parent = insideFrame && node.parentNode ? iframe(node.parentNode) : parent;
1850
- var docTypePrefix = insideFrame ? "iframe:" /* Constant.IFramePrefix */ : "" /* Constant.Empty */;
1850
+ var docTypePrefix = insideFrame ? "iframe:" /* IFramePrefix */ : "" /* Empty */;
1851
1851
  var doctype = node;
1852
1852
  var docAttributes = { name: doctype.name, publicId: doctype.publicId, systemId: doctype.systemId };
1853
- var docData = { tag: docTypePrefix + "*D" /* Constant.DocumentTag */, attributes: docAttributes };
1853
+ var docData = { tag: docTypePrefix + "*D" /* DocumentTag */, attributes: docAttributes };
1854
1854
  dom[call](node, parent, docData, source);
1855
1855
  break;
1856
1856
  case Node.DOCUMENT_NODE:
@@ -1865,26 +1865,26 @@ function processNode (node, source) {
1865
1865
  if (shadowRoot.host) {
1866
1866
  parse$1(shadowRoot);
1867
1867
  var type = typeof (shadowRoot.constructor);
1868
- if (type === "function" /* Constant.Function */ && shadowRoot.constructor.toString().indexOf("[native code]" /* Constant.NativeCode */) >= 0) {
1868
+ if (type === "function" /* Function */ && shadowRoot.constructor.toString().indexOf("[native code]" /* NativeCode */) >= 0) {
1869
1869
  observe$3(shadowRoot);
1870
1870
  // See: https://wicg.github.io/construct-stylesheets/ for more details on adoptedStyleSheets.
1871
1871
  // At the moment, we are only able to capture "open" shadow DOM nodes. If they are closed, they are not accessible.
1872
1872
  // In future we may decide to proxy "attachShadow" call to gain access, but at the moment, we don't want to
1873
1873
  // cause any unintended side effect to the page. We will re-evaluate after we gather more real world data on this.
1874
- var style = "" /* Constant.Empty */;
1874
+ var style = "" /* Empty */;
1875
1875
  var adoptedStyleSheets = "adoptedStyleSheets" in shadowRoot ? shadowRoot["adoptedStyleSheets"] : [];
1876
1876
  for (var _i = 0, adoptedStyleSheets_1 = adoptedStyleSheets; _i < adoptedStyleSheets_1.length; _i++) {
1877
1877
  var styleSheet = adoptedStyleSheets_1[_i];
1878
1878
  style += getCssRules(styleSheet);
1879
1879
  }
1880
- var fragementData = { tag: "*S" /* Constant.ShadowDomTag */, attributes: { style: style } };
1880
+ var fragementData = { tag: "*S" /* ShadowDomTag */, attributes: { style: style } };
1881
1881
  dom[call](node, shadowRoot.host, fragementData, source);
1882
1882
  }
1883
1883
  else {
1884
1884
  // If the browser doesn't support shadow DOM natively, we detect that, and send appropriate tag back.
1885
1885
  // The differentiation is important because we don't have to observe pollyfill shadow DOM nodes,
1886
1886
  // the same way we observe real shadow DOM nodes (encapsulation provided by the browser).
1887
- dom[call](node, shadowRoot.host, { tag: "*P" /* Constant.PolyfillShadowDomTag */, attributes: {} }, source);
1887
+ dom[call](node, shadowRoot.host, { tag: "*P" /* PolyfillShadowDomTag */, attributes: {} }, source);
1888
1888
  }
1889
1889
  }
1890
1890
  break;
@@ -1897,7 +1897,7 @@ function processNode (node, source) {
1897
1897
  // The only exception is when we receive a mutation to remove the text node, in that case
1898
1898
  // parent will be null, but we can still process the node by checking it's an update call.
1899
1899
  if (call === "update" || (parent && has(parent) && parent.tagName !== "STYLE")) {
1900
- var textData = { tag: "*T" /* Constant.TextTag */, value: node.nodeValue };
1900
+ var textData = { tag: "*T" /* TextTag */, value: node.nodeValue };
1901
1901
  dom[call](node, parent, textData, source);
1902
1902
  }
1903
1903
  break;
@@ -1909,20 +1909,20 @@ function processNode (node, source) {
1909
1909
  // For correctness, we first look at parentElement and if it not present then fall back to using parentNode
1910
1910
  parent = node.parentElement ? node.parentElement : (node.parentNode ? node.parentNode : null);
1911
1911
  // 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" /* Constant.SvgNamespace */) {
1913
- tag = "svg:" /* Constant.SvgPrefix */ + tag;
1912
+ if (element.namespaceURI === "http://www.w3.org/2000/svg" /* SvgNamespace */) {
1913
+ tag = "svg:" /* SvgPrefix */ + tag;
1914
1914
  }
1915
1915
  switch (tag) {
1916
1916
  case "HTML":
1917
1917
  parent = insideFrame && parent ? iframe(parent) : null;
1918
- var htmlPrefix = insideFrame ? "iframe:" /* Constant.IFramePrefix */ : "" /* Constant.Empty */;
1918
+ var htmlPrefix = insideFrame ? "iframe:" /* IFramePrefix */ : "" /* Empty */;
1919
1919
  var htmlData = { tag: htmlPrefix + tag, attributes: attributes };
1920
1920
  dom[call](node, parent, htmlData, source);
1921
1921
  break;
1922
1922
  case "SCRIPT":
1923
- if ("type" /* Constant.Type */ in attributes && attributes["type" /* Constant.Type */] === "application/ld+json" /* Constant.JsonLD */) {
1923
+ if ("type" /* Type */ in attributes && attributes["type" /* Type */] === "application/ld+json" /* JsonLD */) {
1924
1924
  try {
1925
- ld(JSON.parse(element.text.replace(newlineRegex, "" /* Constant.Empty */)));
1925
+ ld(JSON.parse(element.text.replace(newlineRegex, "" /* Empty */)));
1926
1926
  }
1927
1927
  catch ( /* do nothing */_a) { /* do nothing */ }
1928
1928
  }
@@ -1930,20 +1930,20 @@ function processNode (node, source) {
1930
1930
  case "NOSCRIPT":
1931
1931
  break;
1932
1932
  case "META":
1933
- var key = ("property" /* Constant.Property */ in attributes ?
1934
- "property" /* Constant.Property */ :
1935
- ("name" /* Constant.Name */ in attributes ? "name" /* Constant.Name */ : null));
1936
- if (key && "content" /* Constant.Content */ in attributes) {
1937
- var content = attributes["content" /* Constant.Content */];
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 */];
1938
1938
  switch (attributes[key]) {
1939
- case "og:title" /* Constant.ogTitle */:
1940
- log(20 /* Dimension.MetaTitle */, content);
1939
+ case "og:title" /* ogTitle */:
1940
+ log(20 /* MetaTitle */, content);
1941
1941
  break;
1942
- case "og:type" /* Constant.ogType */:
1943
- log(19 /* Dimension.MetaType */, content);
1942
+ case "og:type" /* ogType */:
1943
+ log(19 /* MetaType */, content);
1944
1944
  break;
1945
- case "generator" /* Constant.Generator */:
1946
- log(21 /* Dimension.Generator */, content);
1945
+ case "generator" /* Generator */:
1946
+ log(21 /* Generator */, content);
1947
1947
  break;
1948
1948
  }
1949
1949
  }
@@ -1951,7 +1951,7 @@ function processNode (node, source) {
1951
1951
  case "HEAD":
1952
1952
  var head = { tag: tag, attributes: attributes };
1953
1953
  if (location) {
1954
- head.attributes["*B" /* Constant.Base */] = location.protocol + "//" + location.hostname;
1954
+ head.attributes["*B" /* Base */] = location.protocol + "//" + location.hostname;
1955
1955
  }
1956
1956
  dom[call](node, parent, head, source);
1957
1957
  break;
@@ -1964,7 +1964,7 @@ function processNode (node, source) {
1964
1964
  var frameData = { tag: tag, attributes: attributes };
1965
1965
  if (sameorigin(iframe$1)) {
1966
1966
  monitor(iframe$1);
1967
- frameData.attributes["*O" /* Constant.SameOrigin */] = "true";
1967
+ frameData.attributes["*O" /* SameOrigin */] = "true";
1968
1968
  if (iframe$1.contentDocument && iframe$1.contentWindow && iframe$1.contentDocument.readyState !== "loading") {
1969
1969
  child = iframe$1.contentDocument;
1970
1970
  }
@@ -1993,7 +1993,7 @@ function observe$3(root) {
1993
1993
  function getStyleValue(style) {
1994
1994
  // Call trim on the text content to ensure we do not process white spaces ( , \n, \r\n, \t, etc.)
1995
1995
  // 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() : "" /* Constant.Empty */;
1996
+ var value = style.textContent ? style.textContent.trim() : "" /* Empty */;
1997
1997
  var dataset = style.dataset ? Object.keys(style.dataset).length : 0;
1998
1998
  if (value.length === 0 || dataset > 0) {
1999
1999
  value = getCssRules(style.sheet);
@@ -2001,14 +2001,14 @@ function getStyleValue(style) {
2001
2001
  return value;
2002
2002
  }
2003
2003
  function getCssRules(sheet) {
2004
- var value = "" /* Constant.Empty */;
2004
+ var value = "" /* Empty */;
2005
2005
  var cssRules = null;
2006
2006
  // Firefox throws a SecurityError when trying to access cssRules of a stylesheet from a different domain
2007
2007
  try {
2008
2008
  cssRules = sheet ? sheet.cssRules : [];
2009
2009
  }
2010
2010
  catch (e) {
2011
- log$1(1 /* Code.CssRules */, 1 /* Severity.Warning */, e ? e.name : null);
2011
+ log$1(1 /* CssRules */, 1 /* Warning */, e ? e.name : null);
2012
2012
  if (e && e.name !== "SecurityError") {
2013
2013
  throw e;
2014
2014
  }
@@ -2032,8 +2032,8 @@ function getAttributes(element) {
2032
2032
  }
2033
2033
  }
2034
2034
  // For INPUT tags read the dynamic "value" property if an explicit "value" attribute is not set
2035
- if (element.tagName === "INPUT" /* Constant.InputTag */ && !("value" /* Constant.Value */ in output) && element.value) {
2036
- output["value" /* Constant.Value */] = element.value;
2035
+ if (element.tagName === "INPUT" /* InputTag */ && !("value" /* Value */ in output) && element.value) {
2036
+ output["value" /* Value */] = element.value;
2037
2037
  }
2038
2038
  return output;
2039
2039
  }
@@ -2055,13 +2055,13 @@ function traverse (root, timer, source) {
2055
2055
  next = next.nextSibling;
2056
2056
  }
2057
2057
  state = state$8(timer);
2058
- if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 3];
2058
+ if (!(state === 0 /* Wait */)) return [3 /*break*/, 3];
2059
2059
  return [4 /*yield*/, suspend$1(timer)];
2060
2060
  case 2:
2061
2061
  state = _a.sent();
2062
2062
  _a.label = 3;
2063
2063
  case 3:
2064
- if (state === 2 /* Task.Stop */) {
2064
+ if (state === 2 /* Stop */) {
2065
2065
  return [3 /*break*/, 4];
2066
2066
  }
2067
2067
  subnode = processNode(node, source);
@@ -2138,7 +2138,7 @@ function observe$2(node) {
2138
2138
  // For this reason, we need to wire up mutations every time we see a new shadow dom.
2139
2139
  // Also, wrap it inside a try / catch. In certain browsers (e.g. legacy Edge), observer on shadow dom can throw errors
2140
2140
  try {
2141
- var m = api("MutationObserver" /* Constant.MutationObserver */);
2141
+ var m = api("MutationObserver" /* MutationObserver */);
2142
2142
  var observer = m in window ? new window[m](measure(handle$1)) : null;
2143
2143
  if (observer) {
2144
2144
  observer.observe(node, { attributes: true, childList: true, characterData: true, subtree: true });
@@ -2146,7 +2146,7 @@ function observe$2(node) {
2146
2146
  }
2147
2147
  }
2148
2148
  catch (e) {
2149
- log$1(2 /* Code.MutationObserver */, 0 /* Severity.Info */, e ? e.name : null);
2149
+ log$1(2 /* MutationObserver */, 0 /* Info */, e ? e.name : null);
2150
2150
  }
2151
2151
  }
2152
2152
  function monitor(frame) {
@@ -2154,7 +2154,7 @@ function monitor(frame) {
2154
2154
  // This includes cases where iframe location is updated without explicitly updating src attribute
2155
2155
  // E.g. iframe.contentWindow.location.href = "new-location";
2156
2156
  if (has(frame) === false) {
2157
- bind(frame, "load" /* Constant.LoadEvent */, generate.bind(this, frame, "childList" /* Constant.ChildList */), true);
2157
+ bind(frame, "load" /* LoadEvent */, generate.bind(this, frame, "childList" /* ChildList */), true);
2158
2158
  }
2159
2159
  }
2160
2160
  function stop$h() {
@@ -2172,14 +2172,14 @@ function stop$h() {
2172
2172
  timeout$1 = null;
2173
2173
  }
2174
2174
  function active$2() {
2175
- activePeriod = time() + 3000 /* Setting.MutationActivePeriod */;
2175
+ activePeriod = time() + 3000 /* MutationActivePeriod */;
2176
2176
  }
2177
2177
  function handle$1(m) {
2178
2178
  // Queue up mutation records for asynchronous processing
2179
2179
  var now = time();
2180
- track$6(6 /* Event.Mutation */, now);
2180
+ track$6(6 /* Mutation */, now);
2181
2181
  mutations.push({ time: now, mutations: m });
2182
- schedule$1(process$2, 1 /* Priority.High */).then(function () {
2182
+ schedule$1(process$2, 1 /* High */).then(function () {
2183
2183
  setTimeout(compute$7);
2184
2184
  measure(compute$6)();
2185
2185
  });
@@ -2190,7 +2190,7 @@ function process$2() {
2190
2190
  return __generator(this, function (_b) {
2191
2191
  switch (_b.label) {
2192
2192
  case 0:
2193
- timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
2193
+ timer = { id: id(), cost: 3 /* LayoutCost */ };
2194
2194
  start$w(timer);
2195
2195
  _b.label = 1;
2196
2196
  case 1:
@@ -2202,13 +2202,13 @@ function process$2() {
2202
2202
  if (!(_i < _a.length)) return [3 /*break*/, 6];
2203
2203
  mutation = _a[_i];
2204
2204
  state = state$8(timer);
2205
- if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 4];
2205
+ if (!(state === 0 /* Wait */)) return [3 /*break*/, 4];
2206
2206
  return [4 /*yield*/, suspend$1(timer)];
2207
2207
  case 3:
2208
2208
  state = _b.sent();
2209
2209
  _b.label = 4;
2210
2210
  case 4:
2211
- if (state === 2 /* Task.Stop */) {
2211
+ if (state === 2 /* Stop */) {
2212
2212
  return [3 /*break*/, 6];
2213
2213
  }
2214
2214
  target = mutation.target;
@@ -2220,17 +2220,17 @@ function process$2() {
2220
2220
  parse$1(target);
2221
2221
  }
2222
2222
  switch (type) {
2223
- case "attributes" /* Constant.Attributes */:
2224
- processNode(target, 3 /* Source.Attributes */);
2223
+ case "attributes" /* Attributes */:
2224
+ processNode(target, 3 /* Attributes */);
2225
2225
  break;
2226
- case "characterData" /* Constant.CharacterData */:
2227
- processNode(target, 4 /* Source.CharacterData */);
2226
+ case "characterData" /* CharacterData */:
2227
+ processNode(target, 4 /* CharacterData */);
2228
2228
  break;
2229
- case "childList" /* Constant.ChildList */:
2230
- processNodeList(mutation.addedNodes, 1 /* Source.ChildListAdd */, timer);
2231
- processNodeList(mutation.removedNodes, 2 /* Source.ChildListRemove */, timer);
2229
+ case "childList" /* ChildList */:
2230
+ processNodeList(mutation.addedNodes, 1 /* ChildListAdd */, timer);
2231
+ processNodeList(mutation.removedNodes, 2 /* ChildListRemove */, timer);
2232
2232
  break;
2233
- case "suspend" /* Constant.Suspend */:
2233
+ case "suspend" /* Suspend */:
2234
2234
  value = get(target);
2235
2235
  if (value) {
2236
2236
  value.metadata.suspend = true;
@@ -2241,7 +2241,7 @@ function process$2() {
2241
2241
  case 5:
2242
2242
  _i++;
2243
2243
  return [3 /*break*/, 2];
2244
- case 6: return [4 /*yield*/, encode$4(6 /* Event.Mutation */, timer, record.time)];
2244
+ case 6: return [4 /*yield*/, encode$4(6 /* Mutation */, timer, record.time)];
2245
2245
  case 7:
2246
2246
  _b.sent();
2247
2247
  return [3 /*break*/, 1];
@@ -2255,11 +2255,11 @@ function process$2() {
2255
2255
  function track$5(m, timer) {
2256
2256
  var value = m.target ? get(m.target.parentNode) : null;
2257
2257
  // Check if the parent is already discovered and that the parent is not the document root
2258
- if (value && value.data.tag !== "HTML" /* Constant.HTML */) {
2258
+ if (value && value.data.tag !== "HTML" /* HTML */) {
2259
2259
  var inactive = time() > activePeriod;
2260
2260
  var target = get(m.target);
2261
2261
  var element = target && target.selector ? target.selector.join() : m.target.nodeName;
2262
- var parent_1 = value.selector ? value.selector.join() : "" /* Constant.Empty */;
2262
+ var parent_1 = value.selector ? value.selector.join() : "" /* Empty */;
2263
2263
  // We use selector, instead of id, to determine the key (signature for the mutation) because in some cases
2264
2264
  // repeated mutations can cause elements to be destroyed and then recreated as new DOM nodes
2265
2265
  // In those cases, IDs will change however the selector (which is relative to DOM xPath) remains the same
@@ -2268,20 +2268,20 @@ function track$5(m, timer) {
2268
2268
  history$4[key] = key in history$4 ? history$4[key] : [0];
2269
2269
  var h = history$4[key];
2270
2270
  // 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 /* Setting.MutationSuspendThreshold */) {
2272
- processNodeList(h[1], 2 /* Source.ChildListRemove */, timer);
2271
+ if (inactive === false && h[0] >= 10 /* MutationSuspendThreshold */) {
2272
+ processNodeList(h[1], 2 /* ChildListRemove */, timer);
2273
2273
  }
2274
2274
  // Update the counter
2275
2275
  h[0] = inactive ? h[0] + 1 : 1;
2276
2276
  // Return updated mutation type based on if we have already hit the threshold or not
2277
- if (h[0] === 10 /* Setting.MutationSuspendThreshold */) {
2277
+ if (h[0] === 10 /* MutationSuspendThreshold */) {
2278
2278
  // Store a reference to removedNodes so we can process them later
2279
2279
  // when we resume mutations again on user interactions
2280
2280
  h[1] = m.removedNodes;
2281
- return "suspend" /* Constant.Suspend */;
2281
+ return "suspend" /* Suspend */;
2282
2282
  }
2283
- else if (h[0] > 10 /* Setting.MutationSuspendThreshold */) {
2284
- return "" /* Constant.Empty */;
2283
+ else if (h[0] > 10 /* MutationSuspendThreshold */) {
2284
+ return "" /* Empty */;
2285
2285
  }
2286
2286
  }
2287
2287
  return m.type;
@@ -2304,18 +2304,18 @@ function processNodeList(list, source, timer) {
2304
2304
  _a.label = 1;
2305
2305
  case 1:
2306
2306
  if (!(i < length)) return [3 /*break*/, 6];
2307
- if (!(source === 1 /* Source.ChildListAdd */)) return [3 /*break*/, 2];
2307
+ if (!(source === 1 /* ChildListAdd */)) return [3 /*break*/, 2];
2308
2308
  traverse(list[i], timer, source);
2309
2309
  return [3 /*break*/, 5];
2310
2310
  case 2:
2311
2311
  state = state$8(timer);
2312
- if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 4];
2312
+ if (!(state === 0 /* Wait */)) return [3 /*break*/, 4];
2313
2313
  return [4 /*yield*/, suspend$1(timer)];
2314
2314
  case 3:
2315
2315
  state = _a.sent();
2316
2316
  _a.label = 4;
2317
2317
  case 4:
2318
- if (state === 2 /* Task.Stop */) {
2318
+ if (state === 2 /* Stop */) {
2319
2319
  return [3 /*break*/, 6];
2320
2320
  }
2321
2321
  processNode(list[i], source);
@@ -2340,7 +2340,7 @@ function schedule(node, fragment) {
2340
2340
  if (timeout$1) {
2341
2341
  clearTimeout(timeout$1);
2342
2342
  }
2343
- timeout$1 = setTimeout(function () { trigger$1(fragment); }, 33 /* Setting.LookAhead */);
2343
+ timeout$1 = setTimeout(function () { trigger$1(fragment); }, 33 /* LookAhead */);
2344
2344
  return node;
2345
2345
  }
2346
2346
  function trigger$1(fragment) {
@@ -2353,7 +2353,7 @@ function trigger$1(fragment) {
2353
2353
  if (shadowRoot && has(node)) {
2354
2354
  continue;
2355
2355
  }
2356
- generate(node, shadowRoot || fragment ? "childList" /* Constant.ChildList */ : "characterData" /* Constant.CharacterData */);
2356
+ generate(node, shadowRoot || fragment ? "childList" /* ChildList */ : "characterData" /* CharacterData */);
2357
2357
  }
2358
2358
  }
2359
2359
  queue$2 = [];
@@ -2403,9 +2403,9 @@ function reset$7() {
2403
2403
  hashMap = {};
2404
2404
  override = [];
2405
2405
  unmask = [];
2406
- maskText = "address,password,contact" /* Mask.Text */.split("," /* Constant.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" /* Mask.Input */.split("," /* Constant.Comma */);
2408
- maskDisable = "radio,checkbox,range,button,reset,submit" /* Mask.Disable */.split("," /* Constant.Comma */);
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 */);
2409
2409
  idMap = new WeakMap();
2410
2410
  iframeMap = new WeakMap();
2411
2411
  privacyMap = new WeakMap();
@@ -2421,19 +2421,19 @@ function parse$1(root, init) {
2421
2421
  try {
2422
2422
  // Parse unmask configuration into separate query selectors and override tokens as part of initialization
2423
2423
  if (init) {
2424
- config$1.unmask.forEach(function (x) { return x.indexOf("!" /* Constant.Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
2424
+ config$1.unmask.forEach(function (x) { return x.indexOf("!" /* Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
2425
2425
  }
2426
2426
  // Since mutations may happen on leaf nodes too, e.g. text nodes, which may not support all selector APIs.
2427
2427
  // We ensure that the root note supports querySelectorAll API before executing the code below to identify new regions.
2428
2428
  if ("querySelectorAll" in root) {
2429
- config$1.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, "".concat(x[0])); }); }); // Regions
2430
- config$1.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /* Privacy.TextImage */); }); }); // Masked Elements
2429
+ config$1.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, "" + x[0]); }); }); // Regions
2430
+ config$1.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /* TextImage */); }); }); // Masked Elements
2431
2431
  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 /* Privacy.None */); }); }); // Unmasked Elements
2432
+ unmask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 0 /* None */); }); }); // Unmasked Elements
2433
2433
  }
2434
2434
  }
2435
2435
  catch (e) {
2436
- log$1(5 /* Code.Selector */, 1 /* Severity.Warning */, e ? e.name : null);
2436
+ log$1(5 /* Selector */, 1 /* Warning */, e ? e.name : null);
2437
2437
  }
2438
2438
  }
2439
2439
  function getId(node, autogen) {
@@ -2456,7 +2456,7 @@ function add(node, parent, data, source) {
2456
2456
  var regionId = exists(node) ? id : null;
2457
2457
  var fragmentId = null;
2458
2458
  var fraudId = fraudMap.has(node) ? fraudMap.get(node) : null;
2459
- var privacyId = config$1.content ? 1 /* Privacy.Sensitive */ : 2 /* Privacy.Text */;
2459
+ var privacyId = config$1.content ? 1 /* Sensitive */ : 3 /* TextImage */;
2460
2460
  if (parentId >= 0 && values[parentId]) {
2461
2461
  parentValue = values[parentId];
2462
2462
  parentValue.children.push(id);
@@ -2466,8 +2466,8 @@ function add(node, parent, data, source) {
2466
2466
  privacyId = parentValue.metadata.privacy;
2467
2467
  }
2468
2468
  // 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" /* Constant.RegionData */ in data.attributes) {
2470
- observe$1(node, data.attributes["data-clarity-region" /* Constant.RegionData */]);
2469
+ if (data.attributes && "data-clarity-region" /* RegionData */ in data.attributes) {
2470
+ observe$1(node, data.attributes["data-clarity-region" /* RegionData */]);
2471
2471
  regionId = id;
2472
2472
  }
2473
2473
  nodes[id] = node;
@@ -2545,7 +2545,7 @@ function update$1(node, parent, data, source) {
2545
2545
  }
2546
2546
  function sameorigin(node) {
2547
2547
  var output = false;
2548
- if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "IFRAME" /* Constant.IFrameTag */) {
2548
+ if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "IFRAME" /* IFrameTag */) {
2549
2549
  var frame = node;
2550
2550
  // To determine if the iframe is same-origin or not, we try accessing it's contentDocument.
2551
2551
  // If the browser throws an exception, we assume it's cross-origin and move on.
@@ -2572,11 +2572,11 @@ function privacy(node, value, parent) {
2572
2572
  var attributes = data.attributes || {};
2573
2573
  var tag = data.tag.toUpperCase();
2574
2574
  switch (true) {
2575
- case "data-clarity-mask" /* Constant.MaskData */ in attributes:
2576
- metadata.privacy = 3 /* Privacy.TextImage */;
2575
+ case "data-clarity-mask" /* MaskData */ in attributes:
2576
+ metadata.privacy = 3 /* TextImage */;
2577
2577
  break;
2578
- case "data-clarity-unmask" /* Constant.UnmaskData */ in attributes:
2579
- metadata.privacy = 0 /* Privacy.None */;
2578
+ case "data-clarity-unmask" /* UnmaskData */ in attributes:
2579
+ metadata.privacy = 0 /* None */;
2580
2580
  break;
2581
2581
  case privacyMap.has(node):
2582
2582
  // If this node was explicitly configured to contain sensitive content, honor that privacy setting
@@ -2584,40 +2584,38 @@ function privacy(node, value, parent) {
2584
2584
  break;
2585
2585
  case fraudMap.has(node):
2586
2586
  // If this node was explicitly configured to be evaluated for fraud, then also mask content
2587
- metadata.privacy = 2 /* Privacy.Text */;
2587
+ metadata.privacy = 2 /* Text */;
2588
2588
  break;
2589
- case tag === "*T" /* Constant.TextTag */:
2589
+ case tag === "*T" /* TextTag */:
2590
2590
  // 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 : "" /* Constant.Empty */;
2592
- var pSelector_1 = parent && parent.selector ? parent.selector[1 /* Selector.Default */] : "" /* Constant.Empty */;
2593
- var tags = ["STYLE" /* Constant.StyleTag */, "TITLE" /* Constant.TitleTag */, "svg:style" /* Constant.SvgStyle */];
2594
- metadata.privacy = tags.includes(pTag) || override.some(function (x) { return pSelector_1.indexOf(x) >= 0; }) ? 0 /* Privacy.None */ : current;
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;
2595
2595
  break;
2596
- case "type" /* Constant.Type */ in attributes:
2597
- // If this node has an explicit type assigned to it, go through masking rules to determine right privacy setting
2598
- metadata.privacy = inspect(attributes["type" /* Constant.Type */], maskInput, metadata);
2599
- break;
2600
- case tag === "INPUT" /* Constant.InputTag */ && current === 0 /* Privacy.None */:
2596
+ case tag === "INPUT" /* InputTag */ && current === 0 /* None */:
2601
2597
  // If even default privacy setting is to not mask, we still scan through input fields for any sensitive information
2602
- var field_1 = "" /* Constant.Empty */;
2598
+ var field_1 = "" /* Empty */;
2603
2599
  Object.keys(attributes).forEach(function (x) { return field_1 += attributes[x].toLowerCase(); });
2604
2600
  metadata.privacy = inspect(field_1, maskInput, metadata);
2605
2601
  break;
2606
- case current === 1 /* Privacy.Sensitive */ && tag === "INPUT" /* Constant.InputTag */:
2602
+ case tag === "INPUT" /* InputTag */ && current === 1 /* Sensitive */:
2607
2603
  // Look through class names to aggressively mask content
2608
- metadata.privacy = inspect(attributes["class" /* Constant.Class */], maskText, metadata);
2609
- // If it's a button or an input option, make an exception to disable masking
2610
- metadata.privacy = maskDisable.indexOf(attributes["type" /* Constant.Type */]) >= 0 ? 0 /* Privacy.None */ : current;
2604
+ metadata.privacy = inspect(attributes["class" /* Class */], maskText, metadata);
2605
+ // 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);
2607
+ // 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;
2611
2609
  break;
2612
- case current === 1 /* Privacy.Sensitive */:
2610
+ case current === 1 /* Sensitive */:
2613
2611
  // In a mode where we mask sensitive information by default, look through class names to aggressively mask content
2614
- metadata.privacy = inspect(attributes["class" /* Constant.Class */], maskText, metadata);
2612
+ metadata.privacy = inspect(attributes["class" /* Class */], maskText, metadata);
2615
2613
  break;
2616
2614
  }
2617
2615
  }
2618
2616
  function inspect(input, lookup, metadata) {
2619
2617
  if (input && lookup.some(function (x) { return input.indexOf(x) >= 0; })) {
2620
- return 2 /* Privacy.Text */;
2618
+ return 2 /* Text */;
2621
2619
  }
2622
2620
  return metadata.privacy;
2623
2621
  }
@@ -2655,7 +2653,7 @@ function updateSelector(value) {
2655
2653
  var d = value.data;
2656
2654
  var p = position(parent, value);
2657
2655
  var s = { id: value.id, tag: d.tag, prefix: prefix, position: p, attributes: d.attributes };
2658
- value.selector = [get$1(s, 0 /* Selector.Alpha */), get$1(s, 1 /* Selector.Beta */)];
2656
+ value.selector = [get$1(s, 0 /* Alpha */), get$1(s, 1 /* Beta */)];
2659
2657
  value.hash = value.selector.map(function (x) { return x ? hash(x) : null; });
2660
2658
  value.hash.forEach(function (h) { return hashMap[h] = value.id; });
2661
2659
  // Match fragment configuration against both alpha and beta hash
@@ -2710,7 +2708,7 @@ function remove(id, source) {
2710
2708
  }
2711
2709
  function size(value) {
2712
2710
  // If this element is a image node, and is masked, then track box model for the current element
2713
- if (value.data.tag === "IMG" /* Constant.ImageTag */ && value.metadata.privacy === 3 /* Privacy.TextImage */) {
2711
+ if (value.data.tag === "IMG" /* ImageTag */ && value.metadata.privacy === 3 /* TextImage */) {
2714
2712
  value.metadata.size = [];
2715
2713
  }
2716
2714
  }
@@ -2745,7 +2743,7 @@ function track$4(id, source, fragment, changed, parentChanged) {
2745
2743
  // Edge case: If an element is added later on, and pre-discovered element is moved as a child.
2746
2744
  // In that case, we need to reorder the pre-discovered element in the update list to keep visualization consistent.
2747
2745
  var uIndex = updateMap.indexOf(id);
2748
- if (uIndex >= 0 && source === 1 /* Source.ChildListAdd */ && parentChanged) {
2746
+ if (uIndex >= 0 && source === 1 /* ChildListAdd */ && parentChanged) {
2749
2747
  updateMap.splice(uIndex, 1);
2750
2748
  updateMap.push(id);
2751
2749
  }
@@ -2791,15 +2789,15 @@ function exists(node) {
2791
2789
  }
2792
2790
  function track$3(id, event) {
2793
2791
  var node = getNode(id);
2794
- var data = id in regions ? regions[id] : { id: id, visibility: 0 /* RegionVisibility.Rendered */, interaction: 16 /* InteractionState.None */, name: regionMap.get(node) };
2792
+ var data = id in regions ? regions[id] : { id: id, visibility: 0 /* Rendered */, interaction: 16 /* None */, name: regionMap.get(node) };
2795
2793
  // Determine the interaction state based on incoming event
2796
- var interaction = 16 /* InteractionState.None */;
2794
+ var interaction = 16 /* None */;
2797
2795
  switch (event) {
2798
- case 9 /* Event.Click */:
2799
- interaction = 20 /* InteractionState.Clicked */;
2796
+ case 9 /* Click */:
2797
+ interaction = 20 /* Clicked */;
2800
2798
  break;
2801
- case 27 /* Event.Input */:
2802
- interaction = 30 /* InteractionState.Input */;
2799
+ case 27 /* Input */:
2800
+ interaction = 30 /* Input */;
2803
2801
  break;
2804
2802
  }
2805
2803
  // Process updates to this region, if applicable
@@ -2827,7 +2825,7 @@ function compute$6() {
2827
2825
  queue$1 = q;
2828
2826
  // Schedule encode only when we have at least one valid data entry
2829
2827
  if (state$1.length > 0) {
2830
- encode$4(7 /* Event.Region */);
2828
+ encode$4(7 /* Region */);
2831
2829
  }
2832
2830
  }
2833
2831
  function handler$1(entries) {
@@ -2843,27 +2841,27 @@ function handler$1(entries) {
2843
2841
  // 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
2844
2842
  if (regionMap.has(target) && rect.width + rect.height > 0 && viewport.width > 0 && viewport.height > 0) {
2845
2843
  var id = target ? getId(target) : null;
2846
- var data = id in regions ? regions[id] : { id: id, name: regionMap.get(target), interaction: 16 /* InteractionState.None */, visibility: 0 /* RegionVisibility.Rendered */ };
2844
+ var data = id in regions ? regions[id] : { id: id, name: regionMap.get(target), interaction: 16 /* None */, visibility: 0 /* Rendered */ };
2847
2845
  // For regions that have relatively smaller area, we look at intersection ratio and see the overlap relative to element's area
2848
2846
  // However, for larger regions, area of regions could be bigger than viewport and therefore comparison is relative to visible area
2849
2847
  var viewportRatio = overlap ? (overlap.width * overlap.height * 1.0) / (viewport.width * viewport.height) : 0;
2850
- var visible = viewportRatio > 0.05 /* Setting.ViewportIntersectionRatio */ || entry.intersectionRatio > 0.8 /* Setting.IntersectionRatio */;
2848
+ var visible = viewportRatio > 0.05 /* ViewportIntersectionRatio */ || entry.intersectionRatio > 0.8 /* IntersectionRatio */;
2851
2849
  // If an element is either visible or was visible and has been scrolled to the end
2852
2850
  // 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.
2853
2851
  // 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
2854
- var scrolledToEnd = (visible || data.visibility == 10 /* RegionVisibility.Visible */) && Math.abs(rect.top) + viewport.height > rect.height;
2852
+ var scrolledToEnd = (visible || data.visibility == 10 /* Visible */) && Math.abs(rect.top) + viewport.height > rect.height;
2855
2853
  // Process updates to this region, if applicable
2856
2854
  process$1(target, data, data.interaction, (scrolledToEnd ?
2857
- 13 /* RegionVisibility.ScrolledToEnd */ :
2858
- (visible ? 10 /* RegionVisibility.Visible */ : 0 /* RegionVisibility.Rendered */)));
2855
+ 13 /* ScrolledToEnd */ :
2856
+ (visible ? 10 /* Visible */ : 0 /* Rendered */)));
2859
2857
  // Stop observing this element now that we have already received scrolled signal
2860
- if (data.visibility >= 13 /* RegionVisibility.ScrolledToEnd */ && observer$1) {
2858
+ if (data.visibility >= 13 /* ScrolledToEnd */ && observer$1) {
2861
2859
  observer$1.unobserve(target);
2862
2860
  }
2863
2861
  }
2864
2862
  }
2865
2863
  if (state$1.length > 0) {
2866
- encode$4(7 /* Event.Region */);
2864
+ encode$4(7 /* Region */);
2867
2865
  }
2868
2866
  }
2869
2867
  function process$1(n, d, s, v) {
@@ -2922,7 +2920,7 @@ function link(node) {
2922
2920
  function metadata$2(node, event, text) {
2923
2921
  if (text === void 0) { text = null; }
2924
2922
  // If the node is null, we return a reserved value for id: 0. Valid assignment of id begins from 1+.
2925
- var output = { id: 0, hash: null, privacy: 2 /* Privacy.Text */, node: node };
2923
+ var output = { id: 0, hash: null, privacy: 2 /* Text */, node: node };
2926
2924
  if (node) {
2927
2925
  var value = get(node);
2928
2926
  if (value !== null) {
@@ -2948,15 +2946,15 @@ function encode$3 (type) {
2948
2946
  t = time();
2949
2947
  tokens = [t, type];
2950
2948
  switch (type) {
2951
- case 13 /* Event.MouseDown */:
2952
- case 14 /* Event.MouseUp */:
2953
- case 12 /* Event.MouseMove */:
2954
- case 15 /* Event.MouseWheel */:
2955
- case 16 /* Event.DoubleClick */:
2956
- case 17 /* Event.TouchStart */:
2957
- case 18 /* Event.TouchEnd */:
2958
- case 19 /* Event.TouchMove */:
2959
- case 20 /* Event.TouchCancel */:
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 */:
2960
2958
  for (_i = 0, _a = state$4; _i < _a.length; _i++) {
2961
2959
  entry = _a[_i];
2962
2960
  pTarget = metadata$2(entry.data.target, entry.event);
@@ -2971,12 +2969,12 @@ function encode$3 (type) {
2971
2969
  }
2972
2970
  reset$e();
2973
2971
  break;
2974
- case 9 /* Event.Click */:
2972
+ case 9 /* Click */:
2975
2973
  for (_b = 0, _c = state$7; _b < _c.length; _b++) {
2976
2974
  entry = _c[_b];
2977
2975
  cTarget = metadata$2(entry.data.target, entry.event, entry.data.text);
2978
2976
  tokens = [entry.time, entry.event];
2979
- cHash = cTarget.hash.join("." /* Constant.Dot */);
2977
+ cHash = cTarget.hash.join("." /* Dot */);
2980
2978
  tokens.push(cTarget.id);
2981
2979
  tokens.push(entry.data.x);
2982
2980
  tokens.push(entry.data.y);
@@ -2994,7 +2992,7 @@ function encode$3 (type) {
2994
2992
  }
2995
2993
  reset$h();
2996
2994
  break;
2997
- case 38 /* Event.Clipboard */:
2995
+ case 38 /* Clipboard */:
2998
2996
  for (_d = 0, _e = state$6; _d < _e.length; _d++) {
2999
2997
  entry = _e[_d];
3000
2998
  tokens = [entry.time, entry.event];
@@ -3007,7 +3005,7 @@ function encode$3 (type) {
3007
3005
  }
3008
3006
  reset$g();
3009
3007
  break;
3010
- case 11 /* Event.Resize */:
3008
+ case 11 /* Resize */:
3011
3009
  r = data$b;
3012
3010
  tokens.push(r.width);
3013
3011
  tokens.push(r.height);
@@ -3015,13 +3013,13 @@ function encode$3 (type) {
3015
3013
  reset$d();
3016
3014
  queue(tokens);
3017
3015
  break;
3018
- case 26 /* Event.Unload */:
3016
+ case 26 /* Unload */:
3019
3017
  u = data$9;
3020
3018
  tokens.push(u.name);
3021
3019
  reset$9();
3022
3020
  queue(tokens);
3023
3021
  break;
3024
- case 27 /* Event.Input */:
3022
+ case 27 /* Input */:
3025
3023
  for (_f = 0, _g = state$5; _f < _g.length; _f++) {
3026
3024
  entry = _g[_f];
3027
3025
  iTarget = metadata$2(entry.data.target, entry.event, entry.data.value);
@@ -3032,7 +3030,7 @@ function encode$3 (type) {
3032
3030
  }
3033
3031
  reset$f();
3034
3032
  break;
3035
- case 21 /* Event.Selection */:
3033
+ case 21 /* Selection */:
3036
3034
  s = data$a;
3037
3035
  if (s) {
3038
3036
  startTarget = metadata$2(s.start, type);
@@ -3045,7 +3043,7 @@ function encode$3 (type) {
3045
3043
  queue(tokens);
3046
3044
  }
3047
3045
  break;
3048
- case 10 /* Event.Scroll */:
3046
+ case 10 /* Scroll */:
3049
3047
  for (_h = 0, _j = state$3; _h < _j.length; _h++) {
3050
3048
  entry = _j[_h];
3051
3049
  sTarget = metadata$2(entry.data.target, entry.event);
@@ -3060,7 +3058,7 @@ function encode$3 (type) {
3060
3058
  }
3061
3059
  reset$c();
3062
3060
  break;
3063
- case 39 /* Event.Submit */:
3061
+ case 39 /* Submit */:
3064
3062
  for (_k = 0, _l = state$2; _k < _l.length; _k++) {
3065
3063
  entry = _l[_k];
3066
3064
  tokens = [entry.time, entry.event];
@@ -3072,7 +3070,7 @@ function encode$3 (type) {
3072
3070
  }
3073
3071
  reset$a();
3074
3072
  break;
3075
- case 22 /* Event.Timeline */:
3073
+ case 22 /* Timeline */:
3076
3074
  for (_m = 0, _o = updates$1; _m < _o.length; _m++) {
3077
3075
  entry = _o[_m];
3078
3076
  tokens = [entry.time, entry.event];
@@ -3086,7 +3084,7 @@ function encode$3 (type) {
3086
3084
  }
3087
3085
  reset$5();
3088
3086
  break;
3089
- case 28 /* Event.Visibility */:
3087
+ case 28 /* Visibility */:
3090
3088
  v = data$8;
3091
3089
  tokens.push(v.visible);
3092
3090
  queue(tokens);
@@ -3109,11 +3107,11 @@ function reset$5() {
3109
3107
  updates$1 = [];
3110
3108
  }
3111
3109
  function track$2(time, event, hash, x, y, reaction, context) {
3112
- if (reaction === void 0) { reaction = 1 /* BooleanFlag.True */; }
3113
- if (context === void 0) { context = 0 /* BrowsingContext.Self */; }
3110
+ if (reaction === void 0) { reaction = 1 /* True */; }
3111
+ if (context === void 0) { context = 0 /* Self */; }
3114
3112
  state.push({
3115
3113
  time: time,
3116
- event: 22 /* Event.Timeline */,
3114
+ event: 22 /* Timeline */,
3117
3115
  data: {
3118
3116
  type: event,
3119
3117
  hash: hash,
@@ -3132,7 +3130,7 @@ function compute$5() {
3132
3130
  var temp = [];
3133
3131
  updates$1 = [];
3134
3132
  var max = data$1.start + data$1.duration;
3135
- var min = Math.max(max - 2000 /* Setting.TimelineSpan */, 0);
3133
+ var min = Math.max(max - 2000 /* TimelineSpan */, 0);
3136
3134
  for (var _i = 0, state_1 = state; _i < state_1.length; _i++) {
3137
3135
  var s = state_1[_i];
3138
3136
  if (s.time >= min) {
@@ -3143,7 +3141,7 @@ function compute$5() {
3143
3141
  }
3144
3142
  }
3145
3143
  state = temp; // Drop events less than the min time
3146
- encode$3(22 /* Event.Timeline */);
3144
+ encode$3(22 /* Timeline */);
3147
3145
  }
3148
3146
  function stop$e() {
3149
3147
  state = [];
@@ -3176,10 +3174,10 @@ function queue(tokens, transmit) {
3176
3174
  var type = tokens.length > 1 ? tokens[1] : null;
3177
3175
  var event_1 = JSON.stringify(tokens);
3178
3176
  switch (type) {
3179
- case 5 /* Event.Discover */:
3177
+ case 5 /* Discover */:
3180
3178
  discoverBytes += event_1.length;
3181
- case 37 /* Event.Box */:
3182
- case 6 /* Event.Mutation */:
3179
+ case 37 /* Box */:
3180
+ case 6 /* Mutation */:
3183
3181
  playbackBytes += event_1.length;
3184
3182
  playback.push(event_1);
3185
3183
  break;
@@ -3188,7 +3186,7 @@ function queue(tokens, transmit) {
3188
3186
  break;
3189
3187
  }
3190
3188
  // Increment event count metric
3191
- count$1(25 /* Metric.EventCount */);
3189
+ count$1(25 /* EventCount */);
3192
3190
  // Following two checks are precautionary and act as a fail safe mechanism to get out of unexpected situations.
3193
3191
  // Check 1: If for any reason the upload hasn't happened after waiting for 2x the config.delay time,
3194
3192
  // reset the timer. This allows Clarity to attempt an upload again.
@@ -3201,7 +3199,7 @@ function queue(tokens, transmit) {
3201
3199
  // However, in certain scenarios - like metric calculation - which are triggered as part of an existing upload
3202
3200
  // We enrich the data going out with the existing upload. In these cases, call to upload comes with 'transmit' set to false.
3203
3201
  if (transmit && timeout === null) {
3204
- if (type !== 25 /* Event.Ping */) {
3202
+ if (type !== 25 /* Ping */) {
3205
3203
  reset$n();
3206
3204
  }
3207
3205
  timeout = setTimeout(upload, gap);
@@ -3230,9 +3228,9 @@ function upload(final) {
3230
3228
  switch (_b.label) {
3231
3229
  case 0:
3232
3230
  timeout = null;
3233
- sendPlaybackBytes = config$1.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* Setting.MaxFirstPayloadBytes */ || data$1.sequence > 0);
3231
+ sendPlaybackBytes = config$1.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* MaxFirstPayloadBytes */ || data$1.sequence > 0);
3234
3232
  if (sendPlaybackBytes) {
3235
- max(1 /* Metric.Playback */, 1 /* BooleanFlag.True */);
3233
+ max(1 /* Playback */, 1 /* True */);
3236
3234
  }
3237
3235
  // CAUTION: Ensure "transmit" is set to false in the queue function for following events
3238
3236
  // Otherwise you run a risk of infinite loop.
@@ -3241,8 +3239,8 @@ function upload(final) {
3241
3239
  compute$8();
3242
3240
  last = final === true;
3243
3241
  e = JSON.stringify(envelope(last));
3244
- a = "[".concat(analysis.join(), "]");
3245
- p = sendPlaybackBytes ? "[".concat(playback.join(), "]") : "" /* Constant.Empty */;
3242
+ a = "[" + analysis.join() + "]";
3243
+ p = sendPlaybackBytes ? "[" + playback.join() + "]" : "" /* Empty */;
3246
3244
  encoded = { e: e, a: a, p: p };
3247
3245
  payload = stringify(encoded);
3248
3246
  if (!last) return [3 /*break*/, 1];
@@ -3254,7 +3252,7 @@ function upload(final) {
3254
3252
  _b.label = 3;
3255
3253
  case 3:
3256
3254
  zipped = _a;
3257
- sum(2 /* Metric.TotalBytes */, zipped ? zipped.length : payload.length);
3255
+ sum(2 /* TotalBytes */, zipped ? zipped.length : payload.length);
3258
3256
  send(payload, zipped, data$1.sequence, last);
3259
3257
  // Clear out events now that payload has been dispatched
3260
3258
  analysis = [];
@@ -3269,12 +3267,12 @@ function upload(final) {
3269
3267
  });
3270
3268
  }
3271
3269
  function stringify(encoded) {
3272
- 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, "}");
3270
+ return encoded.p.length > 0 ? "{\"e\":" + encoded.e + ",\"a\":" + encoded.a + ",\"p\":" + encoded.p + "}" : "{\"e\":" + encoded.e + ",\"a\":" + encoded.a + "}";
3273
3271
  }
3274
3272
  function send(payload, zipped, sequence, beacon) {
3275
3273
  if (beacon === void 0) { beacon = false; }
3276
3274
  // Upload data if a valid URL is defined in the config
3277
- if (typeof config$1.upload === "string" /* Constant.String */) {
3275
+ if (typeof config$1.upload === "string" /* String */) {
3278
3276
  var url = config$1.upload;
3279
3277
  var dispatched = false;
3280
3278
  // If it's the last payload, attempt to upload using sendBeacon first.
@@ -3313,7 +3311,7 @@ function send(payload, zipped, sequence, beacon) {
3313
3311
  xhr_1.withCredentials = true;
3314
3312
  if (zipped) {
3315
3313
  // If we do have valid compressed array, send it with appropriate HTTP headers so server can decode it appropriately
3316
- xhr_1.setRequestHeader("Accept" /* Constant.Accept */, "application/x-clarity-gzip" /* Constant.ClarityGzip */);
3314
+ xhr_1.setRequestHeader("Accept" /* Accept */, "application/x-clarity-gzip" /* ClarityGzip */);
3317
3315
  xhr_1.send(zipped);
3318
3316
  }
3319
3317
  else {
@@ -3330,13 +3328,13 @@ function send(payload, zipped, sequence, beacon) {
3330
3328
  }
3331
3329
  function check$3(xhr, sequence) {
3332
3330
  var transitData = transit[sequence];
3333
- if (xhr && xhr.readyState === 4 /* XMLReadyState.Done */ && transitData) {
3331
+ if (xhr && xhr.readyState === 4 /* Done */ && transitData) {
3334
3332
  // Attempt send payload again (as configured in settings) if we do not receive a success (2XX) response code back from the server
3335
- if ((xhr.status < 200 || xhr.status > 208) && transitData.attempts <= 1 /* Setting.RetryLimit */) {
3333
+ if ((xhr.status < 200 || xhr.status > 208) && transitData.attempts <= 1 /* RetryLimit */) {
3336
3334
  // We re-attempt in all cases except when server explicitly rejects our request with 4XX error
3337
3335
  if (xhr.status >= 400 && xhr.status < 500) {
3338
3336
  // In case of a 4XX response from the server, we bail out instead of trying again
3339
- trigger(6 /* Check.Server */);
3337
+ trigger(6 /* Server */);
3340
3338
  }
3341
3339
  else {
3342
3340
  // Browser will send status = 0 when it refuses to put network request over the wire
@@ -3357,7 +3355,7 @@ function check$3(xhr, sequence) {
3357
3355
  track$1 = { sequence: sequence, attempts: transitData.attempts, status: xhr.status };
3358
3356
  // Send back an event only if we were not successful in our first attempt
3359
3357
  if (transitData.attempts > 1) {
3360
- encode$1(2 /* Event.Upload */);
3358
+ encode$1(2 /* Upload */);
3361
3359
  }
3362
3360
  // Handle response if it was a 200 response with a valid body
3363
3361
  if (xhr.status === 200 && xhr.responseText) {
@@ -3368,7 +3366,7 @@ function check$3(xhr, sequence) {
3368
3366
  // And, right before we terminate the session, we will attempt one last time to see if we can use
3369
3367
  // different transport option (sendBeacon vs. XHR) to get this data to the server for analysis purposes
3370
3368
  send(transitData.data, null, sequence, true);
3371
- trigger(3 /* Check.Retry */);
3369
+ trigger(3 /* Retry */);
3372
3370
  }
3373
3371
  // Signal that this request completed successfully
3374
3372
  if (xhr.status >= 200 && xhr.status <= 208) {
@@ -3388,19 +3386,25 @@ function done(sequence) {
3388
3386
  function delay() {
3389
3387
  // Progressively increase delay as we continue to send more payloads from the client to the server
3390
3388
  // If we are not uploading data to a server, and instead invoking UploadCallback, in that case keep returning configured value
3391
- var gap = config$1.lean === false && discoverBytes > 0 ? 100 /* Setting.MinUploadDelay */ : data$1.sequence * config$1.delay;
3392
- return typeof config$1.upload === "string" /* Constant.String */ ? Math.max(Math.min(gap, 30000 /* Setting.MaxUploadDelay */), 100 /* Setting.MinUploadDelay */) : config$1.delay;
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;
3393
3391
  }
3394
3392
  function response(payload) {
3395
- var key = payload && payload.length > 0 ? payload.split(" ")[0] : "" /* Constant.Empty */;
3396
- switch (key) {
3397
- case "END" /* Constant.End */:
3393
+ var parts = payload && payload.length > 0 ? payload.split(" ") : ["" /* Empty */];
3394
+ switch (parts[0]) {
3395
+ case "END" /* End */:
3398
3396
  // Clear out session storage and end the session so we can start fresh the next time
3399
- trigger(6 /* Check.Server */);
3397
+ trigger(6 /* Server */);
3400
3398
  break;
3401
- case "UPGRADE" /* Constant.Upgrade */:
3399
+ case "UPGRADE" /* Upgrade */:
3402
3400
  // Upgrade current session to send back playback information
3403
- upgrade("Auto" /* Constant.Auto */);
3401
+ upgrade("Auto" /* Auto */);
3402
+ break;
3403
+ case "ACTION" /* Action */:
3404
+ // Invoke action callback, if configured and has a valid value
3405
+ if (config$1.action && parts.length > 1) {
3406
+ config$1.action(parts[1]);
3407
+ }
3404
3408
  break;
3405
3409
  }
3406
3410
  }
@@ -3418,7 +3422,7 @@ function handler(error) {
3418
3422
  if (!(e.message in history$3)) {
3419
3423
  history$3[e.message] = 0;
3420
3424
  }
3421
- if (history$3[e.message]++ >= 5 /* Setting.ScriptErrorLimit */) {
3425
+ if (history$3[e.message]++ >= 5 /* ScriptErrorLimit */) {
3422
3426
  return true;
3423
3427
  }
3424
3428
  // Send back information only if the handled error has valid information
@@ -3430,7 +3434,7 @@ function handler(error) {
3430
3434
  stack: e.stack,
3431
3435
  source: error["filename"]
3432
3436
  };
3433
- encode$2(31 /* Event.ScriptError */);
3437
+ encode$2(31 /* ScriptError */);
3434
3438
  }
3435
3439
  return true;
3436
3440
  }
@@ -3441,7 +3445,7 @@ function encode$2 (type) {
3441
3445
  return __generator(this, function (_a) {
3442
3446
  tokens = [time(), type];
3443
3447
  switch (type) {
3444
- case 31 /* Event.ScriptError */:
3448
+ case 31 /* ScriptError */:
3445
3449
  tokens.push(data$7.message);
3446
3450
  tokens.push(data$7.line);
3447
3451
  tokens.push(data$7.column);
@@ -3449,7 +3453,7 @@ function encode$2 (type) {
3449
3453
  tokens.push(data$7.source);
3450
3454
  queue(tokens);
3451
3455
  break;
3452
- case 33 /* Event.Log */:
3456
+ case 33 /* Log */:
3453
3457
  if (data$6) {
3454
3458
  tokens.push(data$6.code);
3455
3459
  tokens.push(data$6.name);
@@ -3459,7 +3463,7 @@ function encode$2 (type) {
3459
3463
  queue(tokens, false);
3460
3464
  }
3461
3465
  break;
3462
- case 41 /* Event.Fraud */:
3466
+ case 41 /* Fraud */:
3463
3467
  if (data$d) {
3464
3468
  tokens.push(data$d.id);
3465
3469
  tokens.push(data$d.target);
@@ -3482,7 +3486,7 @@ function log$1(code, severity, name, message, stack) {
3482
3486
  if (name === void 0) { name = null; }
3483
3487
  if (message === void 0) { message = null; }
3484
3488
  if (stack === void 0) { stack = null; }
3485
- var key = name ? "".concat(name, "|").concat(message) : "";
3489
+ var key = name ? name + "|" + message : "";
3486
3490
  // While rare, it's possible for code to fail repeatedly during the lifetime of the same page
3487
3491
  // In those cases, we only want to log the failure once and not spam logs with redundant information.
3488
3492
  if (code in history$2 && history$2[code].indexOf(key) >= 0) {
@@ -3496,7 +3500,7 @@ function log$1(code, severity, name, message, stack) {
3496
3500
  else {
3497
3501
  history$2[code] = [key];
3498
3502
  }
3499
- encode$2(33 /* Event.Log */);
3503
+ encode$2(33 /* Log */);
3500
3504
  }
3501
3505
  function stop$c() {
3502
3506
  history$2 = {};
@@ -3517,25 +3521,25 @@ function start$c() {
3517
3521
  var source = e[i];
3518
3522
  var key = e[i + 1];
3519
3523
  switch (source) {
3520
- case 0 /* ExtractSource.Javascript */:
3524
+ case 0 /* Javascript */:
3521
3525
  var variable = e[i + 2];
3522
3526
  variables[key] = parse(variable);
3523
3527
  break;
3524
- case 1 /* ExtractSource.Cookie */:
3528
+ case 1 /* Cookie */:
3525
3529
  /*Todo: Add cookie extract logic*/
3526
3530
  break;
3527
- case 2 /* ExtractSource.Text */:
3531
+ case 2 /* Text */:
3528
3532
  var match_1 = e[i + 2];
3529
3533
  selectors[key] = match_1;
3530
3534
  break;
3531
- case 3 /* ExtractSource.Fragment */:
3535
+ case 3 /* Fragment */:
3532
3536
  fragments = e[i + 2];
3533
3537
  break;
3534
3538
  }
3535
3539
  }
3536
3540
  }
3537
3541
  catch (e) {
3538
- log$1(8 /* Code.Config */, 1 /* Severity.Warning */, e ? e.name : null);
3542
+ log$1(8 /* Config */, 1 /* Warning */, e ? e.name : null);
3539
3543
  }
3540
3544
  }
3541
3545
  function clone(v) {
@@ -3557,9 +3561,9 @@ function compute$4() {
3557
3561
  }
3558
3562
  }
3559
3563
  catch (e) {
3560
- log$1(5 /* Code.Selector */, 1 /* Severity.Warning */, e ? e.name : null);
3564
+ log$1(5 /* Selector */, 1 /* Warning */, e ? e.name : null);
3561
3565
  }
3562
- encode$1(40 /* Event.Extract */);
3566
+ encode$1(40 /* Extract */);
3563
3567
  }
3564
3568
  function reset$4() {
3565
3569
  keys = [];
@@ -3579,15 +3583,15 @@ function stop$b() {
3579
3583
  }
3580
3584
  function parse(variable) {
3581
3585
  var syntax = [];
3582
- var parts = variable.split("." /* Constant.Dot */);
3586
+ var parts = variable.split("." /* Dot */);
3583
3587
  while (parts.length > 0) {
3584
3588
  var part = parts.shift();
3585
- var arrayStart = part.indexOf("[" /* Constant.ArrayStart */);
3586
- var conditionStart = part.indexOf("{" /* Constant.ConditionStart */);
3587
- var conditionEnd = part.indexOf("}" /* Constant.ConditionEnd */);
3589
+ var arrayStart = part.indexOf("[" /* ArrayStart */);
3590
+ var conditionStart = part.indexOf("{" /* ConditionStart */);
3591
+ var conditionEnd = part.indexOf("}" /* ConditionEnd */);
3588
3592
  syntax.push({
3589
3593
  name: arrayStart > 0 ? part.substring(0, arrayStart) : (conditionStart > 0 ? part.substring(0, conditionStart) : part),
3590
- type: arrayStart > 0 ? 1 /* Type.Array */ : (conditionStart > 0 ? 2 /* Type.Object */ : 3 /* Type.Simple */),
3594
+ type: arrayStart > 0 ? 1 /* Array */ : (conditionStart > 0 ? 2 /* Object */ : 3 /* Simple */),
3591
3595
  condition: conditionStart > 0 ? part.substring(conditionStart + 1, conditionEnd) : null
3592
3596
  });
3593
3597
  }
@@ -3605,7 +3609,7 @@ function evaluate(variable, base) {
3605
3609
  var output;
3606
3610
  if (base && base[part.name]) {
3607
3611
  var obj = base[part.name];
3608
- if (part.type !== 1 /* Type.Array */ && match(obj, part.condition)) {
3612
+ if (part.type !== 1 /* Array */ && match(obj, part.condition)) {
3609
3613
  output = evaluate(variable, obj);
3610
3614
  }
3611
3615
  else if (Array.isArray(obj)) {
@@ -3627,7 +3631,7 @@ function evaluate(variable, base) {
3627
3631
  }
3628
3632
  function str(input) {
3629
3633
  // Automatically trim string to max of Setting.ExtractLimit to avoid fetching long strings
3630
- return input ? JSON.stringify(input).substring(0, 10000 /* Setting.ExtractLimit */) : input;
3634
+ return input ? JSON.stringify(input).substring(0, 10000 /* ExtractLimit */) : input;
3631
3635
  }
3632
3636
  function match(base, condition) {
3633
3637
  if (condition) {
@@ -3641,7 +3645,7 @@ function encode$1 (event) {
3641
3645
  var t = time();
3642
3646
  var tokens = [t, event];
3643
3647
  switch (event) {
3644
- case 4 /* Event.Baseline */:
3648
+ case 4 /* Baseline */:
3645
3649
  var b = state$9;
3646
3650
  if (b) {
3647
3651
  tokens = [b.time, b.event];
@@ -3659,30 +3663,30 @@ function encode$1 (event) {
3659
3663
  }
3660
3664
  reset$p();
3661
3665
  break;
3662
- case 25 /* Event.Ping */:
3666
+ case 25 /* Ping */:
3663
3667
  tokens.push(data$h.gap);
3664
3668
  queue(tokens);
3665
3669
  break;
3666
- case 35 /* Event.Limit */:
3670
+ case 35 /* Limit */:
3667
3671
  tokens.push(data$4.check);
3668
3672
  queue(tokens, false);
3669
3673
  break;
3670
- case 3 /* Event.Upgrade */:
3674
+ case 3 /* Upgrade */:
3671
3675
  tokens.push(data$f.key);
3672
3676
  queue(tokens);
3673
3677
  break;
3674
- case 2 /* Event.Upload */:
3678
+ case 2 /* Upload */:
3675
3679
  tokens.push(track$1.sequence);
3676
3680
  tokens.push(track$1.attempts);
3677
3681
  tokens.push(track$1.status);
3678
3682
  queue(tokens, false);
3679
3683
  break;
3680
- case 24 /* Event.Custom */:
3684
+ case 24 /* Custom */:
3681
3685
  tokens.push(data$j.key);
3682
3686
  tokens.push(data$j.value);
3683
3687
  queue(tokens);
3684
3688
  break;
3685
- case 34 /* Event.Variable */:
3689
+ case 34 /* Variable */:
3686
3690
  var variableKeys = Object.keys(data$e);
3687
3691
  if (variableKeys.length > 0) {
3688
3692
  for (var _i = 0, variableKeys_1 = variableKeys; _i < variableKeys_1.length; _i++) {
@@ -3694,7 +3698,7 @@ function encode$1 (event) {
3694
3698
  queue(tokens, false);
3695
3699
  }
3696
3700
  break;
3697
- case 0 /* Event.Metric */:
3701
+ case 0 /* Metric */:
3698
3702
  var metricKeys = Object.keys(updates$3);
3699
3703
  if (metricKeys.length > 0) {
3700
3704
  for (var _a = 0, metricKeys_1 = metricKeys; _a < metricKeys_1.length; _a++) {
@@ -3709,7 +3713,7 @@ function encode$1 (event) {
3709
3713
  queue(tokens, false);
3710
3714
  }
3711
3715
  break;
3712
- case 1 /* Event.Dimension */:
3716
+ case 1 /* Dimension */:
3713
3717
  var dimensionKeys = Object.keys(updates);
3714
3718
  if (dimensionKeys.length > 0) {
3715
3719
  for (var _b = 0, dimensionKeys_1 = dimensionKeys; _b < dimensionKeys_1.length; _b++) {
@@ -3722,7 +3726,7 @@ function encode$1 (event) {
3722
3726
  queue(tokens, false);
3723
3727
  }
3724
3728
  break;
3725
- case 36 /* Event.Summary */:
3729
+ case 36 /* Summary */:
3726
3730
  var eventKeys = Object.keys(data$g);
3727
3731
  if (eventKeys.length > 0) {
3728
3732
  for (var _c = 0, eventKeys_1 = eventKeys; _c < eventKeys_1.length; _c++) {
@@ -3735,7 +3739,7 @@ function encode$1 (event) {
3735
3739
  queue(tokens, false);
3736
3740
  }
3737
3741
  break;
3738
- case 40 /* Event.Extract */:
3742
+ case 40 /* Extract */:
3739
3743
  var extractKeys = keys;
3740
3744
  for (var _d = 0, extractKeys_1 = extractKeys; _d < extractKeys_1.length; _d++) {
3741
3745
  var e = extractKeys_1[_d];
@@ -3749,14 +3753,14 @@ function encode$1 (event) {
3749
3753
 
3750
3754
  var data$4;
3751
3755
  function start$b() {
3752
- data$4 = { check: 0 /* Check.None */ };
3756
+ data$4 = { check: 0 /* None */ };
3753
3757
  }
3754
3758
  function check$2(bytes) {
3755
- if (data$4.check === 0 /* Check.None */) {
3759
+ if (data$4.check === 0 /* None */) {
3756
3760
  var reason = data$4.check;
3757
- reason = data$1.sequence >= 128 /* Setting.PayloadLimit */ ? 1 /* Check.Payload */ : reason;
3758
- reason = time() > 7200000 /* Setting.ShutdownLimit */ ? 2 /* Check.Shutdown */ : reason;
3759
- reason = bytes > 10485760 /* Setting.PlaybackBytesLimit */ ? 2 /* Check.Shutdown */ : reason;
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;
3760
3764
  if (reason !== data$4.check) {
3761
3765
  trigger(reason);
3762
3766
  }
@@ -3768,8 +3772,8 @@ function trigger(reason) {
3768
3772
  stop();
3769
3773
  }
3770
3774
  function compute$3() {
3771
- if (data$4.check !== 0 /* Check.None */) {
3772
- encode$1(35 /* Event.Limit */);
3775
+ if (data$4.check !== 0 /* None */) {
3776
+ encode$1(35 /* Limit */);
3773
3777
  }
3774
3778
  }
3775
3779
  function stop$a() {
@@ -3790,7 +3794,7 @@ function log(dimension, value) {
3790
3794
  // Check valid value before moving ahead
3791
3795
  if (value) {
3792
3796
  // Ensure received value is casted into a string if it wasn't a string to begin with
3793
- value = "".concat(value);
3797
+ value = "" + value;
3794
3798
  if (!(dimension in data$3)) {
3795
3799
  data$3[dimension] = [];
3796
3800
  }
@@ -3803,14 +3807,14 @@ function log(dimension, value) {
3803
3807
  }
3804
3808
  updates[dimension].push(value);
3805
3809
  // Limit check to ensure we have a cap on number of dimensions we can collect
3806
- if (data$3[dimension].length > 128 /* Setting.CollectionLimit */) {
3807
- trigger(5 /* Check.Collection */);
3810
+ if (data$3[dimension].length > 128 /* CollectionLimit */) {
3811
+ trigger(5 /* Collection */);
3808
3812
  }
3809
3813
  }
3810
3814
  }
3811
3815
  }
3812
3816
  function compute$2() {
3813
- encode$1(1 /* Event.Dimension */);
3817
+ encode$1(1 /* Dimension */);
3814
3818
  }
3815
3819
  function reset$3() {
3816
3820
  updates = {};
@@ -3821,8 +3825,8 @@ var callbacks = [];
3821
3825
  var rootDomain = null;
3822
3826
  function start$9() {
3823
3827
  rootDomain = null;
3824
- var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Constant.Empty */;
3825
- var title = document && document.title ? document.title : "" /* Constant.Empty */;
3828
+ var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Empty */;
3829
+ var title = document && document.title ? document.title : "" /* Empty */;
3826
3830
  // Populate ids for this page
3827
3831
  var s = session();
3828
3832
  var u = user();
@@ -3833,27 +3837,27 @@ function start$9() {
3833
3837
  pageNum: s.count
3834
3838
  };
3835
3839
  // Override configuration based on what's in the session storage, unless it is blank (e.g. using upload callback, like in devtools)
3836
- config$1.lean = config$1.track && s.upgrade !== null ? s.upgrade === 0 /* BooleanFlag.False */ : config$1.lean;
3837
- 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;
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;
3838
3842
  // Log dimensions
3839
- log(0 /* Dimension.UserAgent */, ua);
3840
- log(3 /* Dimension.PageTitle */, title);
3841
- log(1 /* Dimension.Url */, location.href);
3842
- log(2 /* Dimension.Referrer */, document.referrer);
3843
- log(15 /* Dimension.TabId */, tab());
3844
- log(16 /* Dimension.PageLanguage */, document.documentElement.lang);
3845
- log(17 /* Dimension.DocumentDirection */, document.dir);
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);
3846
3850
  if (navigator) {
3847
- log(9 /* Dimension.Language */, navigator.userLanguage || navigator.language);
3851
+ log(9 /* Language */, navigator.userLanguage || navigator.language);
3848
3852
  userAgentData();
3849
3853
  }
3850
3854
  // Metrics
3851
- max(0 /* Metric.ClientTimestamp */, s.ts);
3852
- max(1 /* Metric.Playback */, 0 /* BooleanFlag.False */);
3855
+ max(0 /* ClientTimestamp */, s.ts);
3856
+ max(1 /* Playback */, 0 /* False */);
3853
3857
  if (screen) {
3854
- max(14 /* Metric.ScreenWidth */, Math.round(screen.width));
3855
- max(15 /* Metric.ScreenHeight */, Math.round(screen.height));
3856
- max(16 /* Metric.ColorDepth */, Math.round(screen.colorDepth));
3858
+ max(14 /* ScreenWidth */, Math.round(screen.width));
3859
+ max(15 /* ScreenHeight */, Math.round(screen.height));
3860
+ max(16 /* ColorDepth */, Math.round(screen.colorDepth));
3857
3861
  }
3858
3862
  // Read cookies specified in configuration
3859
3863
  for (var _i = 0, _a = config$1.cookies; _i < _a.length; _i++) {
@@ -3874,13 +3878,13 @@ function userAgentData() {
3874
3878
  "uaFullVersion"])
3875
3879
  .then(function (ua) {
3876
3880
  var _a;
3877
- log(22 /* Dimension.Platform */, ua.platform);
3878
- log(23 /* Dimension.PlatformVersion */, ua.platformVersion);
3881
+ log(22 /* Platform */, ua.platform);
3882
+ log(23 /* PlatformVersion */, ua.platformVersion);
3879
3883
  (_a = ua.brands) === null || _a === void 0 ? void 0 : _a.forEach(function (brand) {
3880
- log(24 /* Dimension.Brand */, brand.name + "~" /* Constant.Tilde */ + brand.version);
3884
+ log(24 /* Brand */, brand.name + "~" /* Tilde */ + brand.version);
3881
3885
  });
3882
- log(25 /* Dimension.Model */, ua.model);
3883
- max(27 /* Metric.Mobile */, ua.mobile ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
3886
+ log(25 /* Model */, ua.model);
3887
+ max(27 /* Mobile */, ua.mobile ? 1 /* True */ : 0 /* False */);
3884
3888
  });
3885
3889
  }
3886
3890
  }
@@ -3897,33 +3901,33 @@ function metadata(cb, wait) {
3897
3901
  callbacks.push({ callback: cb, wait: wait });
3898
3902
  }
3899
3903
  function id() {
3900
- return data$2 ? [data$2.userId, data$2.sessionId, data$2.pageNum].join("." /* Constant.Dot */) : "" /* Constant.Empty */;
3904
+ return data$2 ? [data$2.userId, data$2.sessionId, data$2.pageNum].join("." /* Dot */) : "" /* Empty */;
3901
3905
  }
3902
3906
  function consent() {
3903
3907
  if (active()) {
3904
3908
  config$1.track = true;
3905
- track(user(), 1 /* BooleanFlag.True */);
3909
+ track(user(), 1 /* True */);
3906
3910
  }
3907
3911
  }
3908
3912
  function clear() {
3909
3913
  // Clear any stored information in the cookie that tracks session information so we can restart fresh the next time
3910
- setCookie("_clsk" /* Constant.SessionKey */, "" /* Constant.Empty */, 0);
3914
+ setCookie("_clsk" /* SessionKey */, "" /* Empty */, 0);
3911
3915
  }
3912
3916
  function tab() {
3913
3917
  var id = shortid();
3914
- if (config$1.track && supported(window, "sessionStorage" /* Constant.SessionStorage */)) {
3915
- var value = sessionStorage.getItem("_cltk" /* Constant.TabKey */);
3918
+ if (config$1.track && supported(window, "sessionStorage" /* SessionStorage */)) {
3919
+ var value = sessionStorage.getItem("_cltk" /* TabKey */);
3916
3920
  id = value ? value : id;
3917
- sessionStorage.setItem("_cltk" /* Constant.TabKey */, id);
3921
+ sessionStorage.setItem("_cltk" /* TabKey */, id);
3918
3922
  }
3919
3923
  return id;
3920
3924
  }
3921
3925
  function save() {
3922
3926
  var ts = Math.round(Date.now());
3923
- var upload = config$1.upload && typeof config$1.upload === "string" /* Constant.String */ ? config$1.upload.replace("https://" /* Constant.HTTPS */, "" /* Constant.Empty */) : "" /* Constant.Empty */;
3924
- var upgrade = config$1.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
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 */;
3925
3929
  processCallback(upgrade);
3926
- setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Constant.Pipe */), 1 /* Setting.SessionExpire */);
3930
+ setCookie("_clsk" /* SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Pipe */), 1 /* SessionExpire */);
3927
3931
  }
3928
3932
  function processCallback(upgrade) {
3929
3933
  if (callbacks.length > 0) {
@@ -3948,10 +3952,10 @@ function track(u, consent) {
3948
3952
  consent = consent === null ? u.consent : consent;
3949
3953
  // Convert time precision into days to reduce number of bytes we have to write in a cookie
3950
3954
  // E.g. Math.ceil(1628735962643 / (24*60*60*1000)) => 18852 (days) => ejo in base36 (13 bytes => 3 bytes)
3951
- var end = Math.ceil((Date.now() + (365 /* Setting.Expire */ * 86400000 /* Time.Day */)) / 86400000 /* Time.Day */);
3955
+ var end = Math.ceil((Date.now() + (365 /* Expire */ * 86400000 /* Day */)) / 86400000 /* Day */);
3952
3956
  // To avoid cookie churn, write user id cookie only once every day
3953
- if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* Setting.CookieInterval */ || u.consent !== consent) {
3954
- setCookie("_clck" /* Constant.CookieKey */, [data$2.userId, 1 /* Setting.CookieVersion */, end.toString(36), consent].join("|" /* Constant.Pipe */), 365 /* Setting.Expire */);
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 */);
3955
3959
  }
3956
3960
  }
3957
3961
  function shortid() {
@@ -3962,17 +3966,17 @@ function shortid() {
3962
3966
  return id.toString(36);
3963
3967
  }
3964
3968
  function session() {
3965
- var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /* Constant.Empty */ };
3966
- var value = getCookie("_clsk" /* Constant.SessionKey */);
3969
+ var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /* Empty */ };
3970
+ var value = getCookie("_clsk" /* SessionKey */);
3967
3971
  if (value) {
3968
- var parts = value.split("|" /* Constant.Pipe */);
3972
+ var parts = value.split("|" /* Pipe */);
3969
3973
  // Making it backward & forward compatible by using greater than comparison (v0.6.21)
3970
3974
  // In future version, we can reduce the parts length to be 5 where the last part contains the full upload URL
3971
- if (parts.length >= 5 && output.ts - num(parts[1]) < 1800000 /* Setting.SessionTimeout */) {
3975
+ if (parts.length >= 5 && output.ts - num(parts[1]) < 1800000 /* SessionTimeout */) {
3972
3976
  output.session = parts[0];
3973
3977
  output.count = num(parts[2]) + 1;
3974
3978
  output.upgrade = num(parts[3]);
3975
- output.upload = parts.length >= 6 ? "".concat("https://" /* Constant.HTTPS */).concat(parts[5], "/").concat(parts[4]) : "".concat("https://" /* Constant.HTTPS */).concat(parts[4]);
3979
+ output.upload = parts.length >= 6 ? "" + "https://" /* HTTPS */ + parts[5] + "/" + parts[4] : "" + "https://" /* HTTPS */ + parts[4];
3976
3980
  }
3977
3981
  }
3978
3982
  return output;
@@ -3982,26 +3986,26 @@ function num(string, base) {
3982
3986
  return parseInt(string, base);
3983
3987
  }
3984
3988
  function user() {
3985
- var output = { id: shortid(), expiry: null, consent: 0 /* BooleanFlag.False */ };
3986
- var cookie = getCookie("_clck" /* Constant.CookieKey */);
3989
+ var output = { id: shortid(), expiry: null, consent: 0 /* False */ };
3990
+ var cookie = getCookie("_clck" /* CookieKey */);
3987
3991
  if (cookie && cookie.length > 0) {
3988
3992
  // Splitting and looking up first part for forward compatibility, in case we wish to store additional information in a cookie
3989
- var parts = cookie.split("|" /* Constant.Pipe */);
3993
+ var parts = cookie.split("|" /* Pipe */);
3990
3994
  // For backward compatibility introduced in v0.6.18; following code can be removed with future iterations
3991
3995
  // 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)
3992
3996
  var count = 0;
3993
- for (var _i = 0, _a = document.cookie.split(";" /* Constant.Semicolon */); _i < _a.length; _i++) {
3997
+ for (var _i = 0, _a = document.cookie.split(";" /* Semicolon */); _i < _a.length; _i++) {
3994
3998
  var c = _a[_i];
3995
- count += c.split("=" /* Constant.Equals */)[0].trim() === "_clck" /* Constant.CookieKey */ ? 1 : 0;
3999
+ count += c.split("=" /* Equals */)[0].trim() === "_clck" /* CookieKey */ ? 1 : 0;
3996
4000
  }
3997
4001
  // Check if we either got version-less cookie value or saw multiple copies of the user cookie crumbs
3998
4002
  // In both these cases, we go ahead and delete the existing cookie set on current domain
3999
4003
  if (parts.length === 1 || count > 1) {
4000
- var deleted = "".concat(";" /* Constant.Semicolon */).concat("expires=" /* Constant.Expires */).concat((new Date(0)).toUTCString()).concat(";path=/" /* Constant.Path */);
4004
+ var deleted = "" + ";" /* Semicolon */ + "expires=" /* Expires */ + (new Date(0)).toUTCString() + ";path=/" /* Path */;
4001
4005
  // First, delete current user cookie which might be set on current sub-domain vs. root domain
4002
- document.cookie = "".concat("_clck" /* Constant.CookieKey */, "=").concat(deleted);
4006
+ document.cookie = "_clck" /* CookieKey */ + "=" + deleted;
4003
4007
  // Second, same thing for current session cookie so it can be re-written later with the root domain
4004
- document.cookie = "".concat("_clsk" /* Constant.SessionKey */, "=").concat(deleted);
4008
+ document.cookie = "_clsk" /* SessionKey */ + "=" + deleted;
4005
4009
  }
4006
4010
  // End code for backward compatibility
4007
4011
  // Read version information and timestamp from cookie, if available
@@ -4010,21 +4014,21 @@ function user() {
4010
4014
  }
4011
4015
  // Check if we have explicit consent to track this user
4012
4016
  if (parts.length > 3 && num(parts[3]) === 1) {
4013
- output.consent = 1 /* BooleanFlag.True */;
4017
+ output.consent = 1 /* True */;
4014
4018
  }
4015
4019
  // Set track configuration to true for this user if we have explicit consent, regardless of project setting
4016
- config$1.track = config$1.track || output.consent === 1 /* BooleanFlag.True */;
4020
+ config$1.track = config$1.track || output.consent === 1 /* True */;
4017
4021
  // Get user id from cookie only if we tracking is enabled, otherwise fallback to a random id
4018
4022
  output.id = config$1.track ? parts[0] : output.id;
4019
4023
  }
4020
4024
  return output;
4021
4025
  }
4022
4026
  function getCookie(key) {
4023
- if (supported(document, "cookie" /* Constant.Cookie */)) {
4024
- var cookies = document.cookie.split(";" /* Constant.Semicolon */);
4027
+ if (supported(document, "cookie" /* Cookie */)) {
4028
+ var cookies = document.cookie.split(";" /* Semicolon */);
4025
4029
  if (cookies) {
4026
4030
  for (var i = 0; i < cookies.length; i++) {
4027
- var pair = cookies[i].split("=" /* Constant.Equals */);
4031
+ var pair = cookies[i].split("=" /* Equals */);
4028
4032
  if (pair.length > 1 && pair[0] && pair[0].trim() === key) {
4029
4033
  return pair[1];
4030
4034
  }
@@ -4034,23 +4038,23 @@ function getCookie(key) {
4034
4038
  return null;
4035
4039
  }
4036
4040
  function setCookie(key, value, time) {
4037
- if (config$1.track && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Constant.Cookie */))) {
4041
+ if (config$1.track && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Cookie */))) {
4038
4042
  var expiry = new Date();
4039
4043
  expiry.setDate(expiry.getDate() + time);
4040
- var expires = expiry ? "expires=" /* Constant.Expires */ + expiry.toUTCString() : "" /* Constant.Empty */;
4041
- var cookie = "".concat(key, "=").concat(value).concat(";" /* Constant.Semicolon */).concat(expires).concat(";path=/" /* Constant.Path */);
4044
+ var expires = expiry ? "expires=" /* Expires */ + expiry.toUTCString() : "" /* Empty */;
4045
+ var cookie = key + "=" + value + ";" /* Semicolon */ + expires + ";path=/" /* Path */;
4042
4046
  try {
4043
4047
  // Attempt to get the root domain only once and fall back to writing cookie on the current domain.
4044
4048
  if (rootDomain === null) {
4045
- var hostname = location.hostname ? location.hostname.split("." /* Constant.Dot */) : [];
4049
+ var hostname = location.hostname ? location.hostname.split("." /* Dot */) : [];
4046
4050
  // Walk backwards on a domain and attempt to set a cookie, until successful
4047
4051
  for (var i = hostname.length - 1; i >= 0; i--) {
4048
- rootDomain = ".".concat(hostname[i]).concat(rootDomain ? rootDomain : "" /* Constant.Empty */);
4052
+ rootDomain = "." + hostname[i] + (rootDomain ? rootDomain : "" /* Empty */);
4049
4053
  // We do not wish to attempt writing a cookie on the absolute last part of the domain, e.g. .com or .net.
4050
4054
  // So we start attempting after second-last part, e.g. .domain.com (PASS) or .co.uk (FAIL)
4051
4055
  if (i < hostname.length - 1) {
4052
4056
  // Write the cookie on the current computed top level domain
4053
- document.cookie = "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain);
4057
+ document.cookie = "" + cookie + ";" /* Semicolon */ + "domain=" /* Domain */ + rootDomain;
4054
4058
  // Once written, check if the cookie exists and its value matches exactly with what we intended to set
4055
4059
  // Checking for exact value match helps us eliminate a corner case where the cookie may already be present with a different value
4056
4060
  // If the check is successful, no more action is required and we can return from the function since rootDomain cookie is already set
@@ -4062,13 +4066,13 @@ function setCookie(key, value, time) {
4062
4066
  }
4063
4067
  // Finally, if we were not successful and gone through all the options, play it safe and reset rootDomain to be empty
4064
4068
  // This forces our code to fall back to always writing cookie to the current domain
4065
- rootDomain = "" /* Constant.Empty */;
4069
+ rootDomain = "" /* Empty */;
4066
4070
  }
4067
4071
  }
4068
4072
  catch (_a) {
4069
- rootDomain = "" /* Constant.Empty */;
4073
+ rootDomain = "" /* Empty */;
4070
4074
  }
4071
- document.cookie = rootDomain ? "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain) : cookie;
4075
+ document.cookie = rootDomain ? "" + cookie + ";" /* Semicolon */ + "domain=" /* Domain */ + rootDomain : cookie;
4072
4076
  }
4073
4077
  }
4074
4078
 
@@ -4084,8 +4088,8 @@ function start$8() {
4084
4088
  userId: m.userId,
4085
4089
  sessionId: m.sessionId,
4086
4090
  pageNum: m.pageNum,
4087
- upload: 0 /* Upload.Async */,
4088
- end: 0 /* BooleanFlag.False */
4091
+ upload: 0 /* Async */,
4092
+ end: 0 /* False */
4089
4093
  };
4090
4094
  }
4091
4095
  function stop$7() {
@@ -4095,8 +4099,8 @@ function envelope(last) {
4095
4099
  data$1.start = data$1.start + data$1.duration;
4096
4100
  data$1.duration = time() - data$1.start;
4097
4101
  data$1.sequence++;
4098
- data$1.upload = last && "sendBeacon" in navigator ? 1 /* Upload.Beacon */ : 0 /* Upload.Async */;
4099
- data$1.end = last ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
4102
+ data$1.upload = last && "sendBeacon" in navigator ? 1 /* Beacon */ : 0 /* Async */;
4103
+ data$1.end = last ? 1 /* True */ : 0 /* False */;
4100
4104
  return [
4101
4105
  data$1.version,
4102
4106
  data$1.sequence,
@@ -4149,10 +4153,10 @@ function measure (method) {
4149
4153
  throw report(ex);
4150
4154
  }
4151
4155
  var duration = performance.now() - start;
4152
- sum(4 /* Metric.TotalCost */, duration);
4153
- if (duration > 30 /* Setting.LongTask */) {
4154
- count$1(7 /* Metric.LongTaskCount */);
4155
- max(6 /* Metric.ThreadBlockedTime */, duration);
4156
+ sum(4 /* TotalCost */, duration);
4157
+ if (duration > 30 /* LongTask */) {
4158
+ count$1(7 /* LongTaskCount */);
4159
+ max(6 /* ThreadBlockedTime */, duration);
4156
4160
  }
4157
4161
  };
4158
4162
  }
@@ -4164,7 +4168,7 @@ function bind(target, event, listener, capture) {
4164
4168
  // Wrapping following lines inside try / catch to cover edge cases where we might try to access an inaccessible element.
4165
4169
  // E.g. Iframe may start off as same-origin but later turn into cross-origin, and the following lines will throw an exception.
4166
4170
  try {
4167
- target[api("addEventListener" /* Constant.AddEventListener */)](event, listener, capture);
4171
+ target[api("addEventListener" /* AddEventListener */)](event, listener, capture);
4168
4172
  bindings.push({ event: event, target: target, listener: listener, capture: capture });
4169
4173
  }
4170
4174
  catch ( /* do nothing */_a) { /* do nothing */ }
@@ -4175,7 +4179,7 @@ function reset$1() {
4175
4179
  var binding = bindings_1[_i];
4176
4180
  // Wrapping inside try / catch to avoid situations where the element may be destroyed before we get a chance to unbind
4177
4181
  try {
4178
- binding.target[api("removeEventListener" /* Constant.RemoveEventListener */)](binding.event, binding.listener, binding.capture);
4182
+ binding.target[api("removeEventListener" /* RemoveEventListener */)](binding.event, binding.listener, binding.capture);
4179
4183
  }
4180
4184
  catch ( /* do nothing */_a) { /* do nothing */ }
4181
4185
  }
@@ -4212,8 +4216,8 @@ function start$7() {
4212
4216
  }
4213
4217
  }
4214
4218
  function check$1() {
4215
- if (count++ > 20 /* Setting.CallStackDepth */) {
4216
- log$1(4 /* Code.CallStackDepth */, 0 /* Severity.Info */);
4219
+ if (count++ > 20 /* CallStackDepth */) {
4220
+ log$1(4 /* CallStackDepth */, 0 /* Info */);
4217
4221
  return false;
4218
4222
  }
4219
4223
  return true;
@@ -4223,15 +4227,15 @@ function compute$1() {
4223
4227
  if (url !== getCurrentUrl()) {
4224
4228
  // If the url changed, start tracking it as a new page
4225
4229
  stop();
4226
- window.setTimeout(restart$1, 250 /* Setting.RestartDelay */);
4230
+ window.setTimeout(restart$1, 250 /* RestartDelay */);
4227
4231
  }
4228
4232
  }
4229
4233
  function restart$1() {
4230
4234
  start();
4231
- max(29 /* Metric.SinglePage */, 1 /* BooleanFlag.True */);
4235
+ max(29 /* SinglePage */, 1 /* True */);
4232
4236
  }
4233
4237
  function getCurrentUrl() {
4234
- return location.href ? location.href.replace(location.hash, "" /* Constant.Empty */) : location.href;
4238
+ return location.href ? location.href.replace(location.hash, "" /* Empty */) : location.href;
4235
4239
  }
4236
4240
  function stop$6() {
4237
4241
  url = null;
@@ -4294,7 +4298,7 @@ function config(override) {
4294
4298
  // not holding the session during inactive time periods.
4295
4299
  function suspend() {
4296
4300
  if (status) {
4297
- event("clarity" /* Constant.Clarity */, "suspend" /* Constant.Suspend */);
4301
+ event("clarity" /* Clarity */, "suspend" /* Suspend */);
4298
4302
  stop();
4299
4303
  ["mousemove", "touchstart"].forEach(function (x) { return bind(document, x, restart); });
4300
4304
  ["resize", "scroll", "pageshow"].forEach(function (x) { return bind(window, x, restart); });
@@ -4302,7 +4306,7 @@ function suspend() {
4302
4306
  }
4303
4307
  function restart() {
4304
4308
  start();
4305
- event("clarity" /* Constant.Clarity */, "restart" /* Constant.Restart */);
4309
+ event("clarity" /* Clarity */, "restart" /* Restart */);
4306
4310
  }
4307
4311
 
4308
4312
  function start$5() {
@@ -4321,7 +4325,7 @@ var diagnostic = /*#__PURE__*/Object.freeze({
4321
4325
  });
4322
4326
 
4323
4327
  function start$4() {
4324
- schedule$1(discover, 1 /* Priority.High */).then(function () {
4328
+ schedule$1(discover, 1 /* High */).then(function () {
4325
4329
  measure(compute$7)();
4326
4330
  measure(compute$6)();
4327
4331
  });
@@ -4333,12 +4337,12 @@ function discover() {
4333
4337
  switch (_a.label) {
4334
4338
  case 0:
4335
4339
  ts = time();
4336
- timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
4340
+ timer = { id: id(), cost: 3 /* LayoutCost */ };
4337
4341
  start$w(timer);
4338
- return [4 /*yield*/, traverse(document, timer, 0 /* Source.Discover */)];
4342
+ return [4 /*yield*/, traverse(document, timer, 0 /* Discover */)];
4339
4343
  case 1:
4340
4344
  _a.sent();
4341
- return [4 /*yield*/, encode$4(5 /* Event.Discover */, timer, ts)];
4345
+ return [4 /*yield*/, encode$4(5 /* Discover */, timer, ts)];
4342
4346
  case 2:
4343
4347
  _a.sent();
4344
4348
  stop$t(timer);
@@ -4377,7 +4381,7 @@ function encode (type) {
4377
4381
  t = time();
4378
4382
  tokens = [t, type];
4379
4383
  switch (type) {
4380
- case 29 /* Event.Navigation */:
4384
+ case 29 /* Navigation */:
4381
4385
  tokens.push(data.fetchStart);
4382
4386
  tokens.push(data.connectStart);
4383
4387
  tokens.push(data.connectEnd);
@@ -4426,11 +4430,11 @@ function compute(entry) {
4426
4430
  encodedSize: entry.encodedBodySize ? entry.encodedBodySize : 0,
4427
4431
  decodedSize: entry.decodedBodySize ? entry.decodedBodySize : 0
4428
4432
  };
4429
- encode(29 /* Event.Navigation */);
4433
+ encode(29 /* Navigation */);
4430
4434
  }
4431
4435
 
4432
4436
  var observer;
4433
- var types = ["navigation" /* Constant.Navigation */, "resource" /* Constant.Resource */, "longtask" /* Constant.LongTask */, "first-input" /* Constant.FID */, "layout-shift" /* Constant.CLS */, "largest-contentful-paint" /* Constant.LCP */];
4437
+ var types = ["navigation" /* Navigation */, "resource" /* Resource */, "longtask" /* LongTask */, "first-input" /* FID */, "layout-shift" /* CLS */, "largest-contentful-paint" /* LCP */];
4434
4438
  function start$2() {
4435
4439
  // Check the browser support performance observer as a pre-requisite for any performance measurement
4436
4440
  if (window["PerformanceObserver"] && PerformanceObserver.supportedEntryTypes) {
@@ -4445,7 +4449,7 @@ function start$2() {
4445
4449
  }
4446
4450
  }
4447
4451
  else {
4448
- log$1(3 /* Code.PerformanceObserver */, 0 /* Severity.Info */);
4452
+ log$1(3 /* PerformanceObserver */, 0 /* Info */);
4449
4453
  }
4450
4454
  }
4451
4455
  function observe() {
@@ -4465,15 +4469,15 @@ function observe() {
4465
4469
  if (PerformanceObserver.supportedEntryTypes.indexOf(x) >= 0) {
4466
4470
  // Initialize CLS with a value of zero. It's possible (and recommended) for sites to not have any cumulative layout shift.
4467
4471
  // In those cases, we want to still initialize the metric in Clarity
4468
- if (x === "layout-shift" /* Constant.CLS */) {
4469
- sum(9 /* Metric.CumulativeLayoutShift */, 0);
4472
+ if (x === "layout-shift" /* CLS */) {
4473
+ sum(9 /* CumulativeLayoutShift */, 0);
4470
4474
  }
4471
4475
  observer.observe({ type: x, buffered: true });
4472
4476
  }
4473
4477
  }
4474
4478
  }
4475
4479
  catch (_a) {
4476
- log$1(3 /* Code.PerformanceObserver */, 1 /* Severity.Warning */);
4480
+ log$1(3 /* PerformanceObserver */, 1 /* Warning */);
4477
4481
  }
4478
4482
  }
4479
4483
  function handle(entries) {
@@ -4484,41 +4488,41 @@ function process(entries) {
4484
4488
  for (var i = 0; i < entries.length; i++) {
4485
4489
  var entry = entries[i];
4486
4490
  switch (entry.entryType) {
4487
- case "navigation" /* Constant.Navigation */:
4491
+ case "navigation" /* Navigation */:
4488
4492
  compute(entry);
4489
4493
  break;
4490
- case "resource" /* Constant.Resource */:
4494
+ case "resource" /* Resource */:
4491
4495
  var name_1 = entry.name;
4492
- log(4 /* Dimension.NetworkHosts */, host(name_1));
4496
+ log(4 /* NetworkHosts */, host(name_1));
4493
4497
  if (name_1 === config$1.upload || name_1 === config$1.fallback) {
4494
- max(28 /* Metric.UploadTime */, entry.duration);
4498
+ max(28 /* UploadTime */, entry.duration);
4495
4499
  }
4496
4500
  break;
4497
- case "longtask" /* Constant.LongTask */:
4498
- count$1(7 /* Metric.LongTaskCount */);
4501
+ case "longtask" /* LongTask */:
4502
+ count$1(7 /* LongTaskCount */);
4499
4503
  break;
4500
- case "first-input" /* Constant.FID */:
4504
+ case "first-input" /* FID */:
4501
4505
  if (visible) {
4502
- max(10 /* Metric.FirstInputDelay */, entry["processingStart"] - entry.startTime);
4506
+ max(10 /* FirstInputDelay */, entry["processingStart"] - entry.startTime);
4503
4507
  }
4504
4508
  break;
4505
- case "layout-shift" /* Constant.CLS */:
4509
+ case "layout-shift" /* CLS */:
4506
4510
  // Scale the value to avoid sending back floating point number
4507
4511
  if (visible && !entry["hadRecentInput"]) {
4508
- sum(9 /* Metric.CumulativeLayoutShift */, entry["value"] * 1000);
4512
+ sum(9 /* CumulativeLayoutShift */, entry["value"] * 1000);
4509
4513
  }
4510
4514
  break;
4511
- case "largest-contentful-paint" /* Constant.LCP */:
4515
+ case "largest-contentful-paint" /* LCP */:
4512
4516
  if (visible) {
4513
- max(8 /* Metric.LargestPaint */, entry.startTime);
4517
+ max(8 /* LargestPaint */, entry.startTime);
4514
4518
  }
4515
4519
  break;
4516
4520
  }
4517
4521
  }
4518
- if (performance && "memory" /* Constant.Memory */ in performance && performance["memory" /* Constant.Memory */].usedJSHeapSize) {
4522
+ if (performance && "memory" /* Memory */ in performance && performance["memory" /* Memory */].usedJSHeapSize) {
4519
4523
  // Track consumed memory (MBs) where "memory" API is available
4520
4524
  // Reference: https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory
4521
- max(30 /* Metric.UsedMemory */, Math.abs(performance["memory" /* Constant.Memory */].usedJSHeapSize / 1048576 /* Setting.MegaByte */));
4525
+ max(30 /* UsedMemory */, Math.abs(performance["memory" /* Memory */].usedJSHeapSize / 1048576 /* MegaByte */));
4522
4526
  }
4523
4527
  }
4524
4528
  function stop$2() {
@@ -4566,7 +4570,7 @@ function start(config$1) {
4566
4570
  // performance impact even further. For reference, we are talking single digit milliseconds optimization here, not seconds.
4567
4571
  function pause() {
4568
4572
  if (active()) {
4569
- event("clarity" /* Constant.Clarity */, "pause" /* Constant.Pause */);
4573
+ event("clarity" /* Clarity */, "pause" /* Pause */);
4570
4574
  pause$1();
4571
4575
  }
4572
4576
  }
@@ -4574,7 +4578,7 @@ function pause() {
4574
4578
  function resume() {
4575
4579
  if (active()) {
4576
4580
  resume$1();
4577
- event("clarity" /* Constant.Clarity */, "resume" /* Constant.Resume */);
4581
+ event("clarity" /* Clarity */, "resume" /* Resume */);
4578
4582
  }
4579
4583
  }
4580
4584
  function stop() {