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.
@@ -75,7 +75,7 @@ var envelope$1 = /*#__PURE__*/Object.freeze({
75
75
 
76
76
  var config$1 = {
77
77
  projectId: null,
78
- delay: 1 * 1000 /* Time.Second */,
78
+ delay: 1 * 1000 /* Second */,
79
79
  lean: false,
80
80
  track: true,
81
81
  content: true,
@@ -88,14 +88,15 @@ var config$1 = {
88
88
  report: null,
89
89
  upload: null,
90
90
  fallback: null,
91
- upgrade: null
91
+ upgrade: null,
92
+ action: null
92
93
  };
93
94
 
94
95
  function api(method) {
95
96
  // Zone.js, a popular package for Angular, overrides native browser APIs which can lead to inconsistent state for single page applications.
96
97
  // Example issue: https://github.com/angular/angular/issues/31712
97
98
  // As a work around, we ensuring Clarity access APIs outside of Zone (and use native implementation instead)
98
- return window["Zone" /* Constant.Zone */] && "__symbol__" /* Constant.Symbol */ in window["Zone" /* Constant.Zone */] ? window["Zone" /* Constant.Zone */]["__symbol__" /* Constant.Symbol */](method) : method;
99
+ return window["Zone" /* Zone */] && "__symbol__" /* Symbol */ in window["Zone" /* Zone */] ? window["Zone" /* Zone */]["__symbol__" /* Symbol */](method) : method;
99
100
  }
100
101
 
101
102
  var startTime = 0;
@@ -111,7 +112,7 @@ function stop$B() {
111
112
  startTime = 0;
112
113
  }
113
114
 
114
- var version$1 = "0.6.40";
115
+ var version$1 = "0.6.42";
115
116
 
116
117
  // tslint:disable: no-bitwise
117
118
  function hash (input) {
@@ -144,7 +145,7 @@ function reset$p() {
144
145
  // Baseline state holds the previous values - if it is updated in the current payload,
145
146
  // reset the state to current value after sending the previous state
146
147
  if (update$2) {
147
- state$9 = { time: time(), event: 4 /* Event.Baseline */, data: {
148
+ state$9 = { time: time(), event: 4 /* Baseline */, data: {
148
149
  visible: buffer.visible,
149
150
  docWidth: buffer.docWidth,
150
151
  docHeight: buffer.docHeight,
@@ -159,7 +160,7 @@ function reset$p() {
159
160
  };
160
161
  }
161
162
  buffer = buffer ? buffer : {
162
- visible: 1 /* BooleanFlag.True */,
163
+ visible: 1 /* True */,
163
164
  docWidth: 0,
164
165
  docHeight: 0,
165
166
  screenWidth: 0,
@@ -173,15 +174,15 @@ function reset$p() {
173
174
  }
174
175
  function track$7(event, x, y) {
175
176
  switch (event) {
176
- case 8 /* Event.Document */:
177
+ case 8 /* Document */:
177
178
  buffer.docWidth = x;
178
179
  buffer.docHeight = y;
179
180
  break;
180
- case 11 /* Event.Resize */:
181
+ case 11 /* Resize */:
181
182
  buffer.screenWidth = x;
182
183
  buffer.screenHeight = y;
183
184
  break;
184
- case 10 /* Event.Scroll */:
185
+ case 10 /* Scroll */:
185
186
  buffer.scrollX = x;
186
187
  buffer.scrollY = y;
187
188
  break;
@@ -196,7 +197,7 @@ function activity(t) {
196
197
  buffer.activityTime = t;
197
198
  }
198
199
  function visibility(t, visible) {
199
- buffer.visible = visible === "visible" ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
200
+ buffer.visible = visible === "visible" ? 1 /* True */ : 0 /* False */;
200
201
  if (!buffer.visible) {
201
202
  activity(t);
202
203
  }
@@ -204,7 +205,7 @@ function visibility(t, visible) {
204
205
  }
205
206
  function compute$c() {
206
207
  if (update$2) {
207
- encode$1(4 /* Event.Baseline */);
208
+ encode$1(4 /* Baseline */);
208
209
  }
209
210
  }
210
211
  function stop$A() {
@@ -228,12 +229,12 @@ function event(key, value) {
228
229
  if (active() &&
229
230
  key &&
230
231
  value &&
231
- typeof key === "string" /* Constant.String */ &&
232
- typeof value === "string" /* Constant.String */ &&
232
+ typeof key === "string" /* String */ &&
233
+ typeof value === "string" /* String */ &&
233
234
  key.length < 255 &&
234
235
  value.length < 255) {
235
236
  data$j = { key: key, value: value };
236
- encode$1(24 /* Event.Custom */);
237
+ encode$1(24 /* Custom */);
237
238
  }
238
239
  }
239
240
 
@@ -242,7 +243,7 @@ var updates$3 = null;
242
243
  function start$D() {
243
244
  data$i = {};
244
245
  updates$3 = {};
245
- count$1(5 /* Metric.InvokeCount */);
246
+ count$1(5 /* InvokeCount */);
246
247
  }
247
248
  function stop$z() {
248
249
  data$i = {};
@@ -283,7 +284,7 @@ function max(metric, value) {
283
284
  }
284
285
  }
285
286
  function compute$b() {
286
- encode$1(0 /* Event.Metric */);
287
+ encode$1(0 /* Metric */);
287
288
  }
288
289
  function reset$o() {
289
290
  updates$3 = {};
@@ -301,7 +302,7 @@ var last = 0;
301
302
  var interval = 0;
302
303
  var timeout$6 = null;
303
304
  function start$C() {
304
- interval = 60000 /* Setting.PingInterval */;
305
+ interval = 60000 /* PingInterval */;
305
306
  last = 0;
306
307
  }
307
308
  function reset$n() {
@@ -314,8 +315,8 @@ function reset$n() {
314
315
  function ping() {
315
316
  var now = time();
316
317
  data$h = { gap: now - last };
317
- encode$1(25 /* Event.Ping */);
318
- if (data$h.gap < 300000 /* Setting.PingTimeout */) {
318
+ encode$1(25 /* Ping */);
319
+ if (data$h.gap < 300000 /* PingTimeout */) {
319
320
  timeout$6 = setTimeout(ping, interval);
320
321
  }
321
322
  else {
@@ -352,7 +353,7 @@ function track$6(event, time) {
352
353
  var last = e[e.length - 1];
353
354
  // Add a new entry only if the new event occurs after configured interval
354
355
  // Otherwise, extend the duration of the previous entry
355
- if (time - last[0] > 100 /* Setting.SummaryInterval */) {
356
+ if (time - last[0] > 100 /* SummaryInterval */) {
356
357
  data$g[event].push([time, 0]);
357
358
  }
358
359
  else {
@@ -361,7 +362,7 @@ function track$6(event, time) {
361
362
  }
362
363
  }
363
364
  function compute$a() {
364
- encode$1(36 /* Event.Summary */);
365
+ encode$1(36 /* Summary */);
365
366
  }
366
367
  function reset$m() {
367
368
  data$g = {};
@@ -380,7 +381,7 @@ var summary = /*#__PURE__*/Object.freeze({
380
381
  var data$f = null;
381
382
  function start$A() {
382
383
  if (!config$1.lean && config$1.upgrade) {
383
- config$1.upgrade("Config" /* Constant.Config */);
384
+ config$1.upgrade("Config" /* Config */);
384
385
  }
385
386
  data$f = null;
386
387
  }
@@ -399,7 +400,7 @@ function upgrade(key) {
399
400
  if (config$1.upgrade) {
400
401
  config$1.upgrade(key);
401
402
  }
402
- encode$1(3 /* Event.Upgrade */);
403
+ encode$1(3 /* Upgrade */);
403
404
  }
404
405
  }
405
406
  function stop$w() {
@@ -419,25 +420,25 @@ function start$z() {
419
420
  reset$l();
420
421
  }
421
422
  function set(variable, value) {
422
- var values = typeof value === "string" /* Constant.String */ ? [value] : value;
423
+ var values = typeof value === "string" /* String */ ? [value] : value;
423
424
  log$2(variable, values);
424
425
  }
425
426
  function identify(userId, sessionId, pageId) {
426
427
  if (sessionId === void 0) { sessionId = null; }
427
428
  if (pageId === void 0) { pageId = null; }
428
- log$2("userId" /* Constant.UserId */, [userId]);
429
- log$2("sessionId" /* Constant.SessionId */, [sessionId]);
430
- log$2("pageId" /* Constant.PageId */, [pageId]);
429
+ log$2("userId" /* UserId */, [userId]);
430
+ log$2("sessionId" /* SessionId */, [sessionId]);
431
+ log$2("pageId" /* PageId */, [pageId]);
431
432
  }
432
433
  function log$2(variable, value) {
433
434
  if (active() &&
434
435
  variable &&
435
436
  value &&
436
- typeof variable === "string" /* Constant.String */ &&
437
+ typeof variable === "string" /* String */ &&
437
438
  variable.length < 255) {
438
439
  var validValues = variable in data$e ? data$e[variable] : [];
439
440
  for (var i = 0; i < value.length; i++) {
440
- if (typeof value[i] === "string" /* Constant.String */ && value[i].length < 255) {
441
+ if (typeof value[i] === "string" /* String */ && value[i].length < 255) {
441
442
  validValues.push(value[i]);
442
443
  }
443
444
  }
@@ -445,7 +446,7 @@ function log$2(variable, value) {
445
446
  }
446
447
  }
447
448
  function compute$9() {
448
- encode$1(34 /* Event.Variable */);
449
+ encode$1(34 /* Variable */);
449
450
  }
450
451
  function reset$l() {
451
452
  data$e = {};
@@ -465,7 +466,7 @@ var variable = /*#__PURE__*/Object.freeze({
465
466
  stop: stop$v
466
467
  });
467
468
 
468
- /******************************************************************************
469
+ /*! *****************************************************************************
469
470
  Copyright (c) Microsoft Corporation.
470
471
 
471
472
  Permission to use, copy, modify, and/or distribute this software for any
@@ -518,7 +519,7 @@ function __generator(thisArg, body) {
518
519
  }
519
520
  }
520
521
 
521
- var supported$1 = "CompressionStream" /* Constant.CompressionStream */ in window;
522
+ var supported$1 = "CompressionStream" /* CompressionStream */ in window;
522
523
  function compress (input) {
523
524
  return __awaiter(this, void 0, void 0, function () {
524
525
  var stream, _a;
@@ -535,7 +536,7 @@ function compress (input) {
535
536
  return [2 /*return*/];
536
537
  });
537
538
  });
538
- } }).pipeThrough(new TextEncoderStream()).pipeThrough(new window["CompressionStream" /* Constant.CompressionStream */]("gzip"));
539
+ } }).pipeThrough(new TextEncoderStream()).pipeThrough(new window["CompressionStream" /* CompressionStream */]("gzip"));
539
540
  _a = Uint8Array.bind;
540
541
  return [4 /*yield*/, read(stream)];
541
542
  case 1: return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _c.sent()]))()];
@@ -609,11 +610,11 @@ function scrub (value, hint, privacy, mangle) {
609
610
  if (mangle === void 0) { mangle = false; }
610
611
  if (value) {
611
612
  switch (privacy) {
612
- case 0 /* Privacy.None */:
613
+ case 0 /* None */:
613
614
  return value;
614
- case 1 /* Privacy.Sensitive */:
615
+ case 1 /* Sensitive */:
615
616
  switch (hint) {
616
- case "*T" /* Layout.Constant.TextTag */:
617
+ case "*T" /* TextTag */:
617
618
  case "value":
618
619
  case "placeholder":
619
620
  case "click":
@@ -621,16 +622,16 @@ function scrub (value, hint, privacy, mangle) {
621
622
  return redact(value);
622
623
  }
623
624
  return value;
624
- case 2 /* Privacy.Text */:
625
- case 3 /* Privacy.TextImage */:
625
+ case 2 /* Text */:
626
+ case 3 /* TextImage */:
626
627
  switch (hint) {
627
- case "*T" /* Layout.Constant.TextTag */:
628
+ case "*T" /* TextTag */:
628
629
  return mangle ? mangleText(value) : mask(value);
629
630
  case "src":
630
631
  case "srcset":
631
632
  case "title":
632
633
  case "alt":
633
- return privacy === 3 /* Privacy.TextImage */ ? "" /* Data.Constant.Empty */ : value;
634
+ return privacy === 3 /* TextImage */ ? "" /* Empty */ : value;
634
635
  case "value":
635
636
  case "click":
636
637
  case "input":
@@ -650,18 +651,18 @@ function mangleText(value) {
650
651
  var index = value.indexOf(first);
651
652
  var prefix = value.substr(0, index);
652
653
  var suffix = value.substr(index + trimmed.length);
653
- return "".concat(prefix).concat(trimmed.length.toString(36)).concat(suffix);
654
+ return "" + prefix + trimmed.length.toString(36) + suffix;
654
655
  }
655
656
  return value;
656
657
  }
657
658
  function mask(value) {
658
- return value.replace(catchallRegex, "\u2022" /* Data.Constant.Mask */);
659
+ return value.replace(catchallRegex, "\u2022" /* Mask */);
659
660
  }
660
661
  function mangleToken(value) {
661
- var length = ((Math.floor(value.length / 5 /* Data.Setting.WordLength */) + 1) * 5 /* Data.Setting.WordLength */);
662
- var output = "" /* Layout.Constant.Empty */;
662
+ var length = ((Math.floor(value.length / 5 /* WordLength */) + 1) * 5 /* WordLength */);
663
+ var output = "" /* Empty */;
663
664
  for (var i = 0; i < length; i++) {
664
- output += i > 0 && i % 5 /* Data.Setting.WordLength */ === 0 ? " " /* Data.Constant.Space */ : "\u2022" /* Data.Constant.Mask */;
665
+ output += i > 0 && i % 5 /* WordLength */ === 0 ? " " /* Space */ : "\u2022" /* Mask */;
665
666
  }
666
667
  return output;
667
668
  }
@@ -686,22 +687,22 @@ function redact(value) {
686
687
  }
687
688
  for (var i = 0; i < value.length; i++) {
688
689
  var c = value.charCodeAt(i);
689
- hasDigit = hasDigit || (c >= 48 /* Data.Character.Zero */ && c <= 57 /* Data.Character.Nine */); // Check for digits in the current word
690
- hasEmail = hasEmail || c === 64 /* Data.Character.At */; // Check for @ sign anywhere within the current word
691
- hasWhitespace = c === 9 /* Data.Character.Tab */ || c === 10 /* Data.Character.NewLine */ || c === 13 /* Data.Character.Return */ || c === 32 /* Data.Character.Blank */;
690
+ hasDigit = hasDigit || (c >= 48 /* Zero */ && c <= 57 /* Nine */); // Check for digits in the current word
691
+ hasEmail = hasEmail || c === 64 /* At */; // Check for @ sign anywhere within the current word
692
+ hasWhitespace = c === 9 /* Tab */ || c === 10 /* NewLine */ || c === 13 /* Return */ || c === 32 /* Blank */;
692
693
  // Process each word as an individual token to redact any sensitive information
693
694
  if (i === 0 || i === value.length - 1 || hasWhitespace) {
694
695
  // Performance optimization: Lazy load string -> array conversion only when required
695
696
  if (hasDigit || hasEmail) {
696
697
  if (array === null) {
697
- array = value.split("" /* Data.Constant.Empty */);
698
+ array = value.split("" /* Empty */);
698
699
  }
699
700
  // Work on a token at a time so we don't have to apply regex to a larger string
700
701
  var token = value.substring(spaceIndex + 1, hasWhitespace ? i : i + 1);
701
702
  // Check if unicode regex is supported, otherwise fallback to calling mask function on this token
702
703
  if (unicodeRegex && currencyRegex !== null) {
703
704
  // Do not redact information if the token contains a currency symbol
704
- token = token.match(currencyRegex) ? token : token.replace(letterRegex, "\u2022" /* Data.Constant.Letter */).replace(digitRegex, "\u2022" /* Data.Constant.Digit */);
705
+ token = token.match(currencyRegex) ? token : token.replace(letterRegex, "\u25AA" /* Letter */).replace(digitRegex, "\u25AB" /* Digit */);
705
706
  }
706
707
  else {
707
708
  token = mask(token);
@@ -718,28 +719,28 @@ function redact(value) {
718
719
  }
719
720
  }
720
721
  }
721
- return array ? array.join("" /* Data.Constant.Empty */) : value;
722
+ return array ? array.join("" /* Empty */) : value;
722
723
  }
723
724
 
724
725
  var history$5 = [];
725
726
  var data$d;
726
727
  function start$x() {
727
728
  history$5 = [];
728
- max(26 /* Metric.Automation */, navigator.webdriver ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
729
+ max(26 /* Automation */, navigator.webdriver ? 1 /* True */ : 0 /* False */);
729
730
  }
730
731
  function check$4(id, target, input) {
731
732
  // Compute hash for fraud detection. Hash is computed only if input meets the minimum length criteria
732
- if (id !== null && input && input.length >= 5 /* Setting.WordLength */) {
733
+ if (id !== null && input && input.length >= 5 /* WordLength */) {
733
734
  data$d = { id: id, target: target, hash: hash(input) };
734
735
  // Only encode this event if we haven't already reported this hash
735
736
  if (history$5.indexOf(data$d.hash) < 0) {
736
737
  history$5.push(data$d.hash);
737
- encode$2(41 /* Event.Fraud */);
738
+ encode$2(41 /* Fraud */);
738
739
  }
739
740
  }
740
741
  }
741
742
 
742
- var excludeClassNames = "load,active,fixed,visible,focus,show,collaps,animat" /* Constant.ExcludeClassNames */.split("," /* Constant.Comma */);
743
+ var excludeClassNames = "load,active,fixed,visible,focus,show,collaps,animat" /* ExcludeClassNames */.split("," /* Comma */);
743
744
  var selectorMap = {};
744
745
  function reset$k() {
745
746
  selectorMap = {};
@@ -747,68 +748,68 @@ function reset$k() {
747
748
  function get$1(input, type) {
748
749
  var a = input.attributes;
749
750
  var prefix = input.prefix ? input.prefix[type] : null;
750
- var suffix = type === 0 /* Selector.Alpha */ ? "".concat("~" /* Constant.Tilde */).concat(input.position - 1) : ":nth-of-type(".concat(input.position, ")");
751
+ var suffix = type === 0 /* Alpha */ ? "" + "~" /* Tilde */ + (input.position - 1) : ":nth-of-type(" + input.position + ")";
751
752
  switch (input.tag) {
752
753
  case "STYLE":
753
754
  case "TITLE":
754
755
  case "LINK":
755
756
  case "META":
756
- case "*T" /* Constant.TextTag */:
757
- case "*D" /* Constant.DocumentTag */:
758
- return "" /* Constant.Empty */;
757
+ case "*T" /* TextTag */:
758
+ case "*D" /* DocumentTag */:
759
+ return "" /* Empty */;
759
760
  case "HTML":
760
- return "HTML" /* Constant.HTML */;
761
+ return "HTML" /* HTML */;
761
762
  default:
762
763
  if (prefix === null) {
763
- return "" /* Constant.Empty */;
764
+ return "" /* Empty */;
764
765
  }
765
- prefix = "".concat(prefix).concat(">" /* Constant.Separator */);
766
- input.tag = input.tag.indexOf("svg:" /* Constant.SvgPrefix */) === 0 ? input.tag.substr("svg:" /* Constant.SvgPrefix */.length) : input.tag;
767
- var selector = "".concat(prefix).concat(input.tag).concat(suffix);
768
- var id = "id" /* Constant.Id */ in a && a["id" /* Constant.Id */].length > 0 ? a["id" /* Constant.Id */] : null;
769
- 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;
766
+ prefix = "" + prefix + ">" /* Separator */;
767
+ input.tag = input.tag.indexOf("svg:" /* SvgPrefix */) === 0 ? input.tag.substr("svg:" /* SvgPrefix */.length) : input.tag;
768
+ var selector = "" + prefix + input.tag + suffix;
769
+ var id = "id" /* Id */ in a && a["id" /* Id */].length > 0 ? a["id" /* Id */] : null;
770
+ 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;
770
771
  if (classes && classes.length > 0) {
771
- if (type === 0 /* Selector.Alpha */) {
772
+ if (type === 0 /* Alpha */) {
772
773
  // In Alpha mode, update selector to use class names, with relative positioning within the parent id container.
773
774
  // If the node has valid class name(s) then drop relative positioning within the parent path to keep things simple.
774
- var key = "".concat(getDomPath(prefix)).concat(input.tag).concat("." /* Constant.Dot */).concat(classes);
775
+ var key = "" + getDomPath(prefix) + input.tag + "." /* Dot */ + classes;
775
776
  if (!(key in selectorMap)) {
776
777
  selectorMap[key] = [];
777
778
  }
778
779
  if (selectorMap[key].indexOf(input.id) < 0) {
779
780
  selectorMap[key].push(input.id);
780
781
  }
781
- selector = "".concat(key).concat("~" /* Constant.Tilde */).concat(selectorMap[key].indexOf(input.id));
782
+ selector = "" + key + "~" /* Tilde */ + selectorMap[key].indexOf(input.id);
782
783
  }
783
784
  else {
784
785
  // In Beta mode, we continue to look at query selectors in context of the full page
785
- selector = "".concat(prefix).concat(input.tag, ".").concat(classes).concat(suffix);
786
+ selector = "" + prefix + input.tag + "." + classes + suffix;
786
787
  }
787
788
  }
788
789
  // Update selector to use "id" field when available. There are two exceptions:
789
790
  // (1) if "id" appears to be an auto generated string token, e.g. guid or a random id containing digits
790
791
  // (2) if "id" appears inside a shadow DOM, in which case we continue to prefix up to shadow DOM to prevent conflicts
791
- selector = id && filter(id) ? "".concat(getDomPrefix(prefix)).concat("#" /* Constant.Hash */).concat(id) : selector;
792
+ selector = id && filter(id) ? "" + getDomPrefix(prefix) + "#" /* Hash */ + id : selector;
792
793
  return selector;
793
794
  }
794
795
  }
795
796
  function getDomPrefix(prefix) {
796
- var shadowDomStart = prefix.lastIndexOf("*S" /* Constant.ShadowDomTag */);
797
- var iframeDomStart = prefix.lastIndexOf("".concat("iframe:" /* Constant.IFramePrefix */).concat("HTML" /* Constant.HTML */));
797
+ var shadowDomStart = prefix.lastIndexOf("*S" /* ShadowDomTag */);
798
+ var iframeDomStart = prefix.lastIndexOf("" + "iframe:" /* IFramePrefix */ + "HTML" /* HTML */);
798
799
  var domStart = Math.max(shadowDomStart, iframeDomStart);
799
800
  if (domStart < 0) {
800
- return "" /* Constant.Empty */;
801
+ return "" /* Empty */;
801
802
  }
802
- return prefix.substring(0, prefix.indexOf(">" /* Constant.Separator */, domStart) + 1);
803
+ return prefix.substring(0, prefix.indexOf(">" /* Separator */, domStart) + 1);
803
804
  }
804
805
  function getDomPath(input) {
805
- var parts = input.split(">" /* Constant.Separator */);
806
+ var parts = input.split(">" /* Separator */);
806
807
  for (var i = 0; i < parts.length; i++) {
807
- var tIndex = parts[i].indexOf("~" /* Constant.Tilde */);
808
- var dIndex = parts[i].indexOf("." /* Constant.Dot */);
808
+ var tIndex = parts[i].indexOf("~" /* Tilde */);
809
+ var dIndex = parts[i].indexOf("." /* Dot */);
809
810
  parts[i] = parts[i].substring(0, dIndex > 0 ? dIndex : (tIndex > 0 ? tIndex : parts[i].length));
810
811
  }
811
- return parts.join(">" /* Constant.Separator */);
812
+ return parts.join(">" /* Separator */);
812
813
  }
813
814
  // Check if the given input string has digits or excluded class names
814
815
  function filter(value) {
@@ -820,7 +821,7 @@ function filter(value) {
820
821
  }
821
822
  for (var i = 0; i < value.length; i++) {
822
823
  var c = value.charCodeAt(i);
823
- if (c >= 48 /* Character.Zero */ && c <= 57 /* Character.Nine */) {
824
+ if (c >= 48 /* Zero */ && c <= 57 /* Nine */) {
824
825
  return false;
825
826
  }
826
827
  }
@@ -863,7 +864,7 @@ function reset$j() {
863
864
  pauseTask = null;
864
865
  }
865
866
  function schedule$1(task, priority) {
866
- if (priority === void 0) { priority = 0 /* Priority.Normal */; }
867
+ if (priority === void 0) { priority = 0 /* Normal */; }
867
868
  return __awaiter(this, void 0, void 0, function () {
868
869
  var _i, queuedTasks_1, q, promise;
869
870
  return __generator(this, function (_a) {
@@ -875,7 +876,7 @@ function schedule$1(task, priority) {
875
876
  }
876
877
  }
877
878
  promise = new Promise(function (resolve) {
878
- var insert = priority === 1 /* Priority.High */ ? "unshift" : "push";
879
+ var insert = priority === 1 /* High */ ? "unshift" : "push";
879
880
  // Queue this task for asynchronous execution later
880
881
  // We also store a unique page identifier (id) along with the task to ensure
881
882
  // ensure that we do not accidentally execute this task in context of a different page
@@ -910,7 +911,7 @@ function run() {
910
911
  return;
911
912
  }
912
913
  if (error) {
913
- log$1(0 /* Code.RunTask */, 1 /* Severity.Warning */, error.name, error.message, error.stack);
914
+ log$1(0 /* RunTask */, 1 /* Warning */, error.name, error.message, error.stack);
914
915
  }
915
916
  activeTask = null;
916
917
  run();
@@ -921,13 +922,13 @@ function state$8(timer) {
921
922
  var id = key(timer);
922
923
  if (id in tracker) {
923
924
  var elapsed = performance.now() - tracker[id].start;
924
- return (elapsed > tracker[id].yield) ? 0 /* Task.Wait */ : 1 /* Task.Run */;
925
+ return (elapsed > tracker[id].yield) ? 0 /* Wait */ : 1 /* Run */;
925
926
  }
926
927
  // If this task is no longer being tracked, send stop message to the caller
927
- return 2 /* Task.Stop */;
928
+ return 2 /* Stop */;
928
929
  }
929
930
  function start$w(timer) {
930
- tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* Setting.LongTask */ };
931
+ tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* LongTask */ };
931
932
  }
932
933
  function restart$2(timer) {
933
934
  var id = key(timer);
@@ -944,11 +945,11 @@ function stop$t(timer) {
944
945
  var id = key(timer);
945
946
  var duration = end - tracker[id].start;
946
947
  sum(timer.cost, duration);
947
- count$1(5 /* Metric.InvokeCount */);
948
+ count$1(5 /* InvokeCount */);
948
949
  // For the first execution, which is synchronous, time is automatically counted towards TotalDuration.
949
950
  // However, for subsequent asynchronous runs, we need to manually update TotalDuration metric.
950
951
  if (tracker[id].calls > 0) {
951
- sum(4 /* Metric.TotalCost */, duration);
952
+ sum(4 /* TotalCost */, duration);
952
953
  }
953
954
  }
954
955
  function suspend$1(timer) {
@@ -969,13 +970,13 @@ function suspend$1(timer) {
969
970
  case 2:
970
971
  // After we are done with suspending task, ensure that we are still operating in the right context
971
972
  // If the task is still being tracked, continue running the task, otherwise ask caller to stop execution
972
- return [2 /*return*/, id in tracker ? 1 /* Task.Run */ : 2 /* Task.Stop */];
973
+ return [2 /*return*/, id in tracker ? 1 /* Run */ : 2 /* Stop */];
973
974
  }
974
975
  });
975
976
  });
976
977
  }
977
978
  function key(timer) {
978
- return "".concat(timer.id, ".").concat(timer.cost);
979
+ return timer.id + "." + timer.cost;
979
980
  }
980
981
  function wait() {
981
982
  return __awaiter(this, void 0, void 0, function () {
@@ -1013,14 +1014,14 @@ function requestIdleCallbackPolyfill(callback, options) {
1013
1014
  var currentTime = performance.now();
1014
1015
  var elapsed = currentTime - startTime;
1015
1016
  var duration = currentTime - event.data;
1016
- if (duration > 30 /* Setting.LongTask */ && elapsed < options.timeout) {
1017
+ if (duration > 30 /* LongTask */ && elapsed < options.timeout) {
1017
1018
  requestAnimationFrame(function () { outgoing.postMessage(currentTime); });
1018
1019
  }
1019
1020
  else {
1020
1021
  var didTimeout_1 = elapsed > options.timeout;
1021
1022
  callback({
1022
1023
  didTimeout: didTimeout_1,
1023
- timeRemaining: function () { return didTimeout_1 ? 30 /* Setting.LongTask */ : Math.max(0, 30 /* Setting.LongTask */ - duration); }
1024
+ timeRemaining: function () { return didTimeout_1 ? 30 /* LongTask */ : Math.max(0, 30 /* LongTask */ - duration); }
1024
1025
  });
1025
1026
  }
1026
1027
  };
@@ -1041,7 +1042,7 @@ function tokenize (tokens) {
1041
1042
  var reference = null;
1042
1043
  for (var i = 0; i < tokens.length; i++) {
1043
1044
  // Only optimize for string values
1044
- if (typeof tokens[i] === "string" /* Constant.String */) {
1045
+ if (typeof tokens[i] === "string" /* String */) {
1045
1046
  var token = tokens[i];
1046
1047
  var index = lookup[token] || -1;
1047
1048
  if (index >= 0) {
@@ -1083,10 +1084,10 @@ function encode$4 (type, timer, ts) {
1083
1084
  tokens = [eventTime, type];
1084
1085
  _a = type;
1085
1086
  switch (_a) {
1086
- case 8 /* Event.Document */: return [3 /*break*/, 1];
1087
- case 7 /* Event.Region */: return [3 /*break*/, 2];
1088
- case 5 /* Event.Discover */: return [3 /*break*/, 3];
1089
- case 6 /* Event.Mutation */: return [3 /*break*/, 3];
1087
+ case 8 /* Document */: return [3 /*break*/, 1];
1088
+ case 7 /* Region */: return [3 /*break*/, 2];
1089
+ case 5 /* Discover */: return [3 /*break*/, 3];
1090
+ case 6 /* Mutation */: return [3 /*break*/, 3];
1090
1091
  }
1091
1092
  return [3 /*break*/, 10];
1092
1093
  case 1:
@@ -1099,7 +1100,7 @@ function encode$4 (type, timer, ts) {
1099
1100
  case 2:
1100
1101
  for (_i = 0, _b = state$1; _i < _b.length; _i++) {
1101
1102
  r = _b[_i];
1102
- tokens = [r.time, 7 /* Event.Region */];
1103
+ tokens = [r.time, 7 /* Region */];
1103
1104
  tokens.push(r.data.id);
1104
1105
  tokens.push(r.data.interaction);
1105
1106
  tokens.push(r.data.visibility);
@@ -1110,7 +1111,7 @@ function encode$4 (type, timer, ts) {
1110
1111
  return [3 /*break*/, 10];
1111
1112
  case 3:
1112
1113
  // Check if we are operating within the context of the current page
1113
- if (state$8(timer) === 2 /* Task.Stop */) {
1114
+ if (state$8(timer) === 2 /* Stop */) {
1114
1115
  return [3 /*break*/, 10];
1115
1116
  }
1116
1117
  values = updates$2();
@@ -1121,13 +1122,13 @@ function encode$4 (type, timer, ts) {
1121
1122
  if (!(_c < values_1.length)) return [3 /*break*/, 8];
1122
1123
  value = values_1[_c];
1123
1124
  state = state$8(timer);
1124
- if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 6];
1125
+ if (!(state === 0 /* Wait */)) return [3 /*break*/, 6];
1125
1126
  return [4 /*yield*/, suspend$1(timer)];
1126
1127
  case 5:
1127
1128
  state = _e.sent();
1128
1129
  _e.label = 6;
1129
1130
  case 6:
1130
- if (state === 2 /* Task.Stop */) {
1131
+ if (state === 2 /* Stop */) {
1131
1132
  return [3 /*break*/, 8];
1132
1133
  }
1133
1134
  data = value.data;
@@ -1150,9 +1151,9 @@ function encode$4 (type, timer, ts) {
1150
1151
  if (value.previous && active) {
1151
1152
  tokens.push(value.previous);
1152
1153
  }
1153
- tokens.push(suspend ? "*M" /* Constant.SuspendMutationTag */ : data[key]);
1154
+ tokens.push(suspend ? "*M" /* SuspendMutationTag */ : data[key]);
1154
1155
  if (box && box.length === 2) {
1155
- tokens.push("".concat("#" /* Constant.Hash */).concat(str$1(box[0]), ".").concat(str$1(box[1])));
1156
+ tokens.push("" + "#" /* Hash */ + str$1(box[0]) + "." + str$1(box[1]));
1156
1157
  }
1157
1158
  break;
1158
1159
  case "attributes":
@@ -1174,7 +1175,7 @@ function encode$4 (type, timer, ts) {
1174
1175
  _c++;
1175
1176
  return [3 /*break*/, 4];
1176
1177
  case 8:
1177
- if (type === 6 /* Event.Mutation */) {
1178
+ if (type === 6 /* Mutation */) {
1178
1179
  activity(eventTime);
1179
1180
  }
1180
1181
  queue(tokenize(tokens), !config$1.lean);
@@ -1187,13 +1188,13 @@ function encode$4 (type, timer, ts) {
1187
1188
  }
1188
1189
  function shouldMangle(value) {
1189
1190
  var privacy = value.metadata.privacy;
1190
- return value.data.tag === "*T" /* Constant.TextTag */ && !(privacy === 0 /* Privacy.None */ || privacy === 1 /* Privacy.Sensitive */);
1191
+ return value.data.tag === "*T" /* TextTag */ && !(privacy === 0 /* None */ || privacy === 1 /* Sensitive */);
1191
1192
  }
1192
1193
  function size$1(value) {
1193
1194
  if (value.metadata.size !== null && value.metadata.size.length === 0) {
1194
1195
  var img = getNode(value.id);
1195
1196
  if (img) {
1196
- return [Math.floor(img.offsetWidth * 100 /* Setting.BoxPrecision */), Math.floor(img.offsetHeight * 100 /* Setting.BoxPrecision */)];
1197
+ return [Math.floor(img.offsetWidth * 100 /* BoxPrecision */), Math.floor(img.offsetHeight * 100 /* BoxPrecision */)];
1197
1198
  }
1198
1199
  }
1199
1200
  return value.metadata.size;
@@ -1202,7 +1203,7 @@ function str$1(input) {
1202
1203
  return input.toString(36);
1203
1204
  }
1204
1205
  function attribute(key, value, privacy) {
1205
- return "".concat(key, "=").concat(scrub(value, key, privacy));
1206
+ return key + "=" + scrub(value, key, privacy);
1206
1207
  }
1207
1208
 
1208
1209
  var data$c;
@@ -1233,7 +1234,7 @@ function compute$7() {
1233
1234
  // Check that width or height has changed from before, and also that width & height are not null values
1234
1235
  if ((data$c === null || width !== data$c.width || height !== data$c.height) && width !== null && height !== null) {
1235
1236
  data$c = { width: width, height: height };
1236
- encode$4(8 /* Event.Document */);
1237
+ encode$4(8 /* Document */);
1237
1238
  }
1238
1239
  }
1239
1240
  function end() {
@@ -1262,7 +1263,7 @@ function start$u() {
1262
1263
  reset$h();
1263
1264
  }
1264
1265
  function observe$b(root) {
1265
- bind(root, "click", handler$3.bind(this, 9 /* Event.Click */, root), true);
1266
+ bind(root, "click", handler$3.bind(this, 9 /* Click */, root), true);
1266
1267
  }
1267
1268
  function handler$3(event, root, evt) {
1268
1269
  var frame = iframe(root);
@@ -1288,14 +1289,13 @@ function handler$3(event, root, evt) {
1288
1289
  x = Math.round(l.x + (l.w / 2));
1289
1290
  y = Math.round(l.y + (l.h / 2));
1290
1291
  }
1291
- var eX = l ? Math.max(Math.floor(((x - l.x) / l.w) * 32767 /* Setting.ClickPrecision */), 0) : 0;
1292
- var eY = l ? Math.max(Math.floor(((y - l.y) / l.h) * 32767 /* Setting.ClickPrecision */), 0) : 0;
1292
+ var eX = l ? Math.max(Math.floor(((x - l.x) / l.w) * 32767 /* ClickPrecision */), 0) : 0;
1293
+ var eY = l ? Math.max(Math.floor(((y - l.y) / l.h) * 32767 /* ClickPrecision */), 0) : 0;
1293
1294
  // Check for null values before processing this event
1294
1295
  if (x !== null && y !== null) {
1295
1296
  state$7.push({
1296
1297
  time: time(),
1297
- event: event,
1298
- data: {
1298
+ event: event, data: {
1299
1299
  target: t,
1300
1300
  x: x,
1301
1301
  y: y,
@@ -1307,7 +1307,7 @@ function handler$3(event, root, evt) {
1307
1307
  text: text(t),
1308
1308
  link: a ? a.href : null,
1309
1309
  hash: null,
1310
- trust: evt.isTrusted ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */
1310
+ trust: evt.isTrusted ? 1 /* True */ : 0 /* False */
1311
1311
  }
1312
1312
  });
1313
1313
  schedule$1(encode$3.bind(this, event));
@@ -1322,7 +1322,7 @@ function text(element) {
1322
1322
  // Trim any spaces at the beginning or at the end of string
1323
1323
  // Also, replace multiple occurrence of space characters with a single white space
1324
1324
  // Finally, send only first few characters as specified by the Setting
1325
- output = t.trim().replace(/\s+/g, " " /* Constant.Space */).substr(0, 25 /* Setting.ClickText */);
1325
+ output = t.trim().replace(/\s+/g, " " /* Space */).substr(0, 25 /* ClickText */);
1326
1326
  }
1327
1327
  }
1328
1328
  return output;
@@ -1331,10 +1331,10 @@ function reaction(element) {
1331
1331
  if (element.nodeType === Node.ELEMENT_NODE) {
1332
1332
  var tag = element.tagName.toLowerCase();
1333
1333
  if (UserInputTags.indexOf(tag) >= 0) {
1334
- return 0 /* BooleanFlag.False */;
1334
+ return 0 /* False */;
1335
1335
  }
1336
1336
  }
1337
- return 1 /* BooleanFlag.True */;
1337
+ return 1 /* True */;
1338
1338
  }
1339
1339
  function layout$1(element) {
1340
1340
  var box = null;
@@ -1358,14 +1358,14 @@ function layout$1(element) {
1358
1358
  return box;
1359
1359
  }
1360
1360
  function context(a) {
1361
- if (a && a.hasAttribute("target" /* Constant.Target */)) {
1362
- switch (a.getAttribute("target" /* Constant.Target */)) {
1363
- case "_blank" /* Constant.Blank */: return 1 /* BrowsingContext.Blank */;
1364
- case "_parent" /* Constant.Parent */: return 2 /* BrowsingContext.Parent */;
1365
- case "_top" /* Constant.Top */: return 3 /* BrowsingContext.Top */;
1361
+ if (a && a.hasAttribute("target" /* Target */)) {
1362
+ switch (a.getAttribute("target" /* Target */)) {
1363
+ case "_blank" /* Blank */: return 1 /* Blank */;
1364
+ case "_parent" /* Parent */: return 2 /* Parent */;
1365
+ case "_top" /* Top */: return 3 /* Top */;
1366
1366
  }
1367
1367
  }
1368
- return 0 /* BrowsingContext.Self */;
1368
+ return 0 /* Self */;
1369
1369
  }
1370
1370
  function reset$h() {
1371
1371
  state$7 = [];
@@ -1379,13 +1379,13 @@ function start$t() {
1379
1379
  reset$g();
1380
1380
  }
1381
1381
  function observe$a(root) {
1382
- bind(root, "cut", recompute$7.bind(this, 0 /* Clipboard.Cut */), true);
1383
- bind(root, "copy", recompute$7.bind(this, 1 /* Clipboard.Copy */), true);
1384
- bind(root, "paste", recompute$7.bind(this, 2 /* Clipboard.Paste */), true);
1382
+ bind(root, "cut", recompute$7.bind(this, 0 /* Cut */), true);
1383
+ bind(root, "copy", recompute$7.bind(this, 1 /* Copy */), true);
1384
+ bind(root, "paste", recompute$7.bind(this, 2 /* Paste */), true);
1385
1385
  }
1386
1386
  function recompute$7(action, evt) {
1387
- state$6.push({ time: time(), event: 38 /* Event.Clipboard */, data: { target: target(evt), action: action } });
1388
- schedule$1(encode$3.bind(this, 38 /* Event.Clipboard */));
1387
+ state$6.push({ time: time(), event: 38 /* Clipboard */, data: { target: target(evt), action: action } });
1388
+ schedule$1(encode$3.bind(this, 38 /* Clipboard */));
1389
1389
  }
1390
1390
  function reset$g() {
1391
1391
  state$6 = [];
@@ -1418,9 +1418,9 @@ function recompute$6(evt) {
1418
1418
  if (state$5.length > 0 && (state$5[state$5.length - 1].data.target === data.target)) {
1419
1419
  state$5.pop();
1420
1420
  }
1421
- state$5.push({ time: time(), event: 27 /* Event.Input */, data: data });
1421
+ state$5.push({ time: time(), event: 27 /* Input */, data: data });
1422
1422
  clearTimeout(timeout$5);
1423
- timeout$5 = setTimeout(process$6, 500 /* Setting.LookAhead */, 27 /* Event.Input */);
1423
+ timeout$5 = setTimeout(process$6, 500 /* LookAhead */, 27 /* Input */);
1424
1424
  }
1425
1425
  }
1426
1426
  function process$6(event) {
@@ -1440,15 +1440,15 @@ function start$r() {
1440
1440
  reset$e();
1441
1441
  }
1442
1442
  function observe$8(root) {
1443
- bind(root, "mousedown", mouse.bind(this, 13 /* Event.MouseDown */, root), true);
1444
- bind(root, "mouseup", mouse.bind(this, 14 /* Event.MouseUp */, root), true);
1445
- bind(root, "mousemove", mouse.bind(this, 12 /* Event.MouseMove */, root), true);
1446
- bind(root, "wheel", mouse.bind(this, 15 /* Event.MouseWheel */, root), true);
1447
- bind(root, "dblclick", mouse.bind(this, 16 /* Event.DoubleClick */, root), true);
1448
- bind(root, "touchstart", touch.bind(this, 17 /* Event.TouchStart */, root), true);
1449
- bind(root, "touchend", touch.bind(this, 18 /* Event.TouchEnd */, root), true);
1450
- bind(root, "touchmove", touch.bind(this, 19 /* Event.TouchMove */, root), true);
1451
- bind(root, "touchcancel", touch.bind(this, 20 /* Event.TouchCancel */, root), true);
1443
+ bind(root, "mousedown", mouse.bind(this, 13 /* MouseDown */, root), true);
1444
+ bind(root, "mouseup", mouse.bind(this, 14 /* MouseUp */, root), true);
1445
+ bind(root, "mousemove", mouse.bind(this, 12 /* MouseMove */, root), true);
1446
+ bind(root, "wheel", mouse.bind(this, 15 /* MouseWheel */, root), true);
1447
+ bind(root, "dblclick", mouse.bind(this, 16 /* DoubleClick */, root), true);
1448
+ bind(root, "touchstart", touch.bind(this, 17 /* TouchStart */, root), true);
1449
+ bind(root, "touchend", touch.bind(this, 18 /* TouchEnd */, root), true);
1450
+ bind(root, "touchmove", touch.bind(this, 19 /* TouchMove */, root), true);
1451
+ bind(root, "touchcancel", touch.bind(this, 20 /* TouchCancel */, root), true);
1452
1452
  }
1453
1453
  function mouse(event, root, evt) {
1454
1454
  var frame = iframe(root);
@@ -1487,9 +1487,9 @@ function touch(event, root, evt) {
1487
1487
  }
1488
1488
  function handler$2(current) {
1489
1489
  switch (current.event) {
1490
- case 12 /* Event.MouseMove */:
1491
- case 15 /* Event.MouseWheel */:
1492
- case 19 /* Event.TouchMove */:
1490
+ case 12 /* MouseMove */:
1491
+ case 15 /* MouseWheel */:
1492
+ case 19 /* TouchMove */:
1493
1493
  var length_1 = state$4.length;
1494
1494
  var last = length_1 > 1 ? state$4[length_1 - 2] : null;
1495
1495
  if (last && similar$1(last, current)) {
@@ -1497,7 +1497,7 @@ function handler$2(current) {
1497
1497
  }
1498
1498
  state$4.push(current);
1499
1499
  clearTimeout(timeout$4);
1500
- timeout$4 = setTimeout(process$5, 500 /* Setting.LookAhead */, current.event);
1500
+ timeout$4 = setTimeout(process$5, 500 /* LookAhead */, current.event);
1501
1501
  break;
1502
1502
  default:
1503
1503
  state$4.push(current);
@@ -1517,7 +1517,7 @@ function similar$1(last, current) {
1517
1517
  var distance = Math.sqrt(dx * dx + dy * dy);
1518
1518
  var gap = current.time - last.time;
1519
1519
  var match = current.data.target === last.data.target;
1520
- return current.event === last.event && match && distance < 20 /* Setting.Distance */ && gap < 25 /* Setting.Interval */;
1520
+ return current.event === last.event && match && distance < 20 /* Distance */ && gap < 25 /* Interval */;
1521
1521
  }
1522
1522
  function stop$p() {
1523
1523
  clearTimeout(timeout$4);
@@ -1540,7 +1540,7 @@ function recompute$5() {
1540
1540
  width: de && "clientWidth" in de ? Math.min(de.clientWidth, window.innerWidth) : window.innerWidth,
1541
1541
  height: de && "clientHeight" in de ? Math.min(de.clientHeight, window.innerHeight) : window.innerHeight,
1542
1542
  };
1543
- encode$3(11 /* Event.Resize */);
1543
+ encode$3(11 /* Resize */);
1544
1544
  }
1545
1545
  function reset$d() {
1546
1546
  data$b = null;
@@ -1576,7 +1576,7 @@ function recompute$4(event) {
1576
1576
  // And, if for some reason that is not available, fall back to looking up scrollTop on document.documentElement.
1577
1577
  var x = element === de && "pageXOffset" in w ? Math.round(w.pageXOffset) : Math.round(element.scrollLeft);
1578
1578
  var y = element === de && "pageYOffset" in w ? Math.round(w.pageYOffset) : Math.round(element.scrollTop);
1579
- var current = { time: time(), event: 10 /* Event.Scroll */, data: { target: element, x: x, y: y } };
1579
+ var current = { time: time(), event: 10 /* Scroll */, data: { target: element, x: x, y: y } };
1580
1580
  // We don't send any scroll events if this is the first event and the current position is top (0,0)
1581
1581
  if ((event === null && x === 0 && y === 0) || (x === null || y === null)) {
1582
1582
  return;
@@ -1588,7 +1588,7 @@ function recompute$4(event) {
1588
1588
  }
1589
1589
  state$3.push(current);
1590
1590
  clearTimeout(timeout$3);
1591
- timeout$3 = setTimeout(process$4, 500 /* Setting.LookAhead */, 10 /* Event.Scroll */);
1591
+ timeout$3 = setTimeout(process$4, 500 /* LookAhead */, 10 /* Scroll */);
1592
1592
  }
1593
1593
  function reset$c() {
1594
1594
  state$3 = [];
@@ -1599,7 +1599,7 @@ function process$4(event) {
1599
1599
  function similar(last, current) {
1600
1600
  var dx = last.data.x - current.data.x;
1601
1601
  var dy = last.data.y - current.data.y;
1602
- return (dx * dx + dy * dy < 20 /* Setting.Distance */ * 20 /* Setting.Distance */) && (current.time - last.time < 25 /* Setting.Interval */);
1602
+ return (dx * dx + dy * dy < 20 /* Distance */ * 20 /* Distance */) && (current.time - last.time < 25 /* Interval */);
1603
1603
  }
1604
1604
  function stop$n() {
1605
1605
  clearTimeout(timeout$3);
@@ -1634,7 +1634,7 @@ function recompute$3(root) {
1634
1634
  var startNode = data$a.start ? data$a.start : null;
1635
1635
  if (previous !== null && data$a.start !== null && startNode !== current.anchorNode) {
1636
1636
  clearTimeout(timeout$2);
1637
- process$3(21 /* Event.Selection */);
1637
+ process$3(21 /* Selection */);
1638
1638
  }
1639
1639
  data$a = {
1640
1640
  start: current.anchorNode,
@@ -1644,7 +1644,7 @@ function recompute$3(root) {
1644
1644
  };
1645
1645
  previous = current;
1646
1646
  clearTimeout(timeout$2);
1647
- timeout$2 = setTimeout(process$3, 500 /* Setting.LookAhead */, 21 /* Event.Selection */);
1647
+ timeout$2 = setTimeout(process$3, 500 /* LookAhead */, 21 /* Selection */);
1648
1648
  }
1649
1649
  function process$3(event) {
1650
1650
  schedule$1(encode$3.bind(this, event));
@@ -1666,8 +1666,8 @@ function observe$5(root) {
1666
1666
  bind(root, "submit", recompute$2, true);
1667
1667
  }
1668
1668
  function recompute$2(evt) {
1669
- state$2.push({ time: time(), event: 39 /* Event.Submit */, data: { target: target(evt) } });
1670
- schedule$1(encode$3.bind(this, 39 /* Event.Submit */));
1669
+ state$2.push({ time: time(), event: 39 /* Submit */, data: { target: target(evt) } });
1670
+ schedule$1(encode$3.bind(this, 39 /* Submit */));
1671
1671
  }
1672
1672
  function reset$a() {
1673
1673
  state$2 = [];
@@ -1682,7 +1682,7 @@ function start$m() {
1682
1682
  }
1683
1683
  function recompute$1(evt) {
1684
1684
  data$9 = { name: evt.type };
1685
- encode$3(26 /* Event.Unload */);
1685
+ encode$3(26 /* Unload */);
1686
1686
  stop();
1687
1687
  }
1688
1688
  function reset$9() {
@@ -1699,7 +1699,7 @@ function start$l() {
1699
1699
  }
1700
1700
  function recompute() {
1701
1701
  data$8 = { visible: "visibilityState" in document ? document.visibilityState : "default" };
1702
- encode$3(28 /* Event.Visibility */);
1702
+ encode$3(28 /* Visibility */);
1703
1703
  }
1704
1704
  function reset$8() {
1705
1705
  data$8 = null;
@@ -1761,51 +1761,51 @@ function ld(json) {
1761
1761
  for (var _i = 0, _a = Object.keys(json); _i < _a.length; _i++) {
1762
1762
  var key = _a[_i];
1763
1763
  var value = json[key];
1764
- if (key === "@type" /* JsonLD.Type */ && typeof value === "string") {
1764
+ if (key === "@type" /* Type */ && typeof value === "string") {
1765
1765
  value = value.toLowerCase();
1766
1766
  /* Normalizations */
1767
- value = value.indexOf("article" /* JsonLD.Article */) >= 0 || value.indexOf("posting" /* JsonLD.Posting */) >= 0 ? "article" /* JsonLD.Article */ : value;
1767
+ value = value.indexOf("article" /* Article */) >= 0 || value.indexOf("posting" /* Posting */) >= 0 ? "article" /* Article */ : value;
1768
1768
  switch (value) {
1769
- case "article" /* JsonLD.Article */:
1770
- case "recipe" /* JsonLD.Recipe */:
1771
- log(5 /* Dimension.SchemaType */, json[key]);
1772
- log(8 /* Dimension.AuthorName */, json["creator" /* JsonLD.Creator */]);
1773
- log(18 /* Dimension.Headline */, json["headline" /* JsonLD.Headline */]);
1769
+ case "article" /* Article */:
1770
+ case "recipe" /* Recipe */:
1771
+ log(5 /* SchemaType */, json[key]);
1772
+ log(8 /* AuthorName */, json["creator" /* Creator */]);
1773
+ log(18 /* Headline */, json["headline" /* Headline */]);
1774
1774
  break;
1775
- case "product" /* JsonLD.Product */:
1776
- log(5 /* Dimension.SchemaType */, json[key]);
1777
- log(10 /* Dimension.ProductName */, json["name" /* JsonLD.Name */]);
1778
- log(12 /* Dimension.ProductSku */, json["sku" /* JsonLD.Sku */]);
1779
- if (json["brand" /* JsonLD.Brand */]) {
1780
- log(6 /* Dimension.ProductBrand */, json["brand" /* JsonLD.Brand */]["name" /* JsonLD.Name */]);
1775
+ case "product" /* Product */:
1776
+ log(5 /* SchemaType */, json[key]);
1777
+ log(10 /* ProductName */, json["name" /* Name */]);
1778
+ log(12 /* ProductSku */, json["sku" /* Sku */]);
1779
+ if (json["brand" /* Brand */]) {
1780
+ log(6 /* ProductBrand */, json["brand" /* Brand */]["name" /* Name */]);
1781
1781
  }
1782
1782
  break;
1783
- case "aggregaterating" /* JsonLD.AggregateRating */:
1784
- if (json["ratingValue" /* JsonLD.RatingValue */]) {
1785
- max(11 /* Metric.RatingValue */, num$1(json["ratingValue" /* JsonLD.RatingValue */], 100 /* Setting.RatingScale */));
1786
- max(18 /* Metric.BestRating */, num$1(json["bestRating" /* JsonLD.BestRating */]));
1787
- max(19 /* Metric.WorstRating */, num$1(json["worstRating" /* JsonLD.WorstRating */]));
1783
+ case "aggregaterating" /* AggregateRating */:
1784
+ if (json["ratingValue" /* RatingValue */]) {
1785
+ max(11 /* RatingValue */, num$1(json["ratingValue" /* RatingValue */], 100 /* RatingScale */));
1786
+ max(18 /* BestRating */, num$1(json["bestRating" /* BestRating */]));
1787
+ max(19 /* WorstRating */, num$1(json["worstRating" /* WorstRating */]));
1788
1788
  }
1789
- max(12 /* Metric.RatingCount */, num$1(json["ratingCount" /* JsonLD.RatingCount */]));
1790
- max(17 /* Metric.ReviewCount */, num$1(json["reviewCount" /* JsonLD.ReviewCount */]));
1789
+ max(12 /* RatingCount */, num$1(json["ratingCount" /* RatingCount */]));
1790
+ max(17 /* ReviewCount */, num$1(json["reviewCount" /* ReviewCount */]));
1791
1791
  break;
1792
- case "person" /* JsonLD.Author */:
1793
- log(8 /* Dimension.AuthorName */, json["name" /* JsonLD.Name */]);
1792
+ case "person" /* Author */:
1793
+ log(8 /* AuthorName */, json["name" /* Name */]);
1794
1794
  break;
1795
- case "offer" /* JsonLD.Offer */:
1796
- log(7 /* Dimension.ProductAvailability */, json["availability" /* JsonLD.Availability */]);
1797
- log(14 /* Dimension.ProductCondition */, json["itemCondition" /* JsonLD.ItemCondition */]);
1798
- log(13 /* Dimension.ProductCurrency */, json["priceCurrency" /* JsonLD.PriceCurrency */]);
1799
- log(12 /* Dimension.ProductSku */, json["sku" /* JsonLD.Sku */]);
1800
- max(13 /* Metric.ProductPrice */, num$1(json["price" /* JsonLD.Price */]));
1795
+ case "offer" /* Offer */:
1796
+ log(7 /* ProductAvailability */, json["availability" /* Availability */]);
1797
+ log(14 /* ProductCondition */, json["itemCondition" /* ItemCondition */]);
1798
+ log(13 /* ProductCurrency */, json["priceCurrency" /* PriceCurrency */]);
1799
+ log(12 /* ProductSku */, json["sku" /* Sku */]);
1800
+ max(13 /* ProductPrice */, num$1(json["price" /* Price */]));
1801
1801
  break;
1802
- case "brand" /* JsonLD.Brand */:
1803
- log(6 /* Dimension.ProductBrand */, json["name" /* JsonLD.Name */]);
1802
+ case "brand" /* Brand */:
1803
+ log(6 /* ProductBrand */, json["name" /* Name */]);
1804
1804
  break;
1805
1805
  }
1806
1806
  }
1807
1807
  // Continue parsing nested objects
1808
- if (value !== null && typeof (value) === "object" /* Constant.Object */) {
1808
+ if (value !== null && typeof (value) === "object" /* Object */) {
1809
1809
  ld(value);
1810
1810
  }
1811
1811
  }
@@ -1814,8 +1814,8 @@ function num$1(input, scale) {
1814
1814
  if (scale === void 0) { scale = 1; }
1815
1815
  if (input !== null) {
1816
1816
  switch (typeof input) {
1817
- case "number" /* Constant.Number */: return Math.round(input * scale);
1818
- case "string" /* Constant.String */: return Math.round(parseFloat(input.replace(digitsRegex, "" /* Constant.Empty */)) * scale);
1817
+ case "number" /* Number */: return Math.round(input * scale);
1818
+ case "string" /* String */: return Math.round(parseFloat(input.replace(digitsRegex, "" /* Empty */)) * scale);
1819
1819
  }
1820
1820
  }
1821
1821
  return null;
@@ -1826,11 +1826,11 @@ var newlineRegex = /[\r\n]+/g;
1826
1826
  function processNode (node, source) {
1827
1827
  var child = null;
1828
1828
  // Do not track this change if we are attempting to remove a node before discovering it
1829
- if (source === 2 /* Source.ChildListRemove */ && has(node) === false) {
1829
+ if (source === 2 /* ChildListRemove */ && has(node) === false) {
1830
1830
  return child;
1831
1831
  }
1832
1832
  // Special handling for text nodes that belong to style nodes
1833
- if (source !== 0 /* Source.Discover */ &&
1833
+ if (source !== 0 /* Discover */ &&
1834
1834
  node.nodeType === Node.TEXT_NODE &&
1835
1835
  node.parentElement &&
1836
1836
  node.parentElement.tagName === "STYLE") {
@@ -1843,10 +1843,10 @@ function processNode (node, source) {
1843
1843
  switch (node.nodeType) {
1844
1844
  case Node.DOCUMENT_TYPE_NODE:
1845
1845
  parent = insideFrame && node.parentNode ? iframe(node.parentNode) : parent;
1846
- var docTypePrefix = insideFrame ? "iframe:" /* Constant.IFramePrefix */ : "" /* Constant.Empty */;
1846
+ var docTypePrefix = insideFrame ? "iframe:" /* IFramePrefix */ : "" /* Empty */;
1847
1847
  var doctype = node;
1848
1848
  var docAttributes = { name: doctype.name, publicId: doctype.publicId, systemId: doctype.systemId };
1849
- var docData = { tag: docTypePrefix + "*D" /* Constant.DocumentTag */, attributes: docAttributes };
1849
+ var docData = { tag: docTypePrefix + "*D" /* DocumentTag */, attributes: docAttributes };
1850
1850
  dom[call](node, parent, docData, source);
1851
1851
  break;
1852
1852
  case Node.DOCUMENT_NODE:
@@ -1861,26 +1861,26 @@ function processNode (node, source) {
1861
1861
  if (shadowRoot.host) {
1862
1862
  parse$1(shadowRoot);
1863
1863
  var type = typeof (shadowRoot.constructor);
1864
- if (type === "function" /* Constant.Function */ && shadowRoot.constructor.toString().indexOf("[native code]" /* Constant.NativeCode */) >= 0) {
1864
+ if (type === "function" /* Function */ && shadowRoot.constructor.toString().indexOf("[native code]" /* NativeCode */) >= 0) {
1865
1865
  observe$3(shadowRoot);
1866
1866
  // See: https://wicg.github.io/construct-stylesheets/ for more details on adoptedStyleSheets.
1867
1867
  // At the moment, we are only able to capture "open" shadow DOM nodes. If they are closed, they are not accessible.
1868
1868
  // In future we may decide to proxy "attachShadow" call to gain access, but at the moment, we don't want to
1869
1869
  // cause any unintended side effect to the page. We will re-evaluate after we gather more real world data on this.
1870
- var style = "" /* Constant.Empty */;
1870
+ var style = "" /* Empty */;
1871
1871
  var adoptedStyleSheets = "adoptedStyleSheets" in shadowRoot ? shadowRoot["adoptedStyleSheets"] : [];
1872
1872
  for (var _i = 0, adoptedStyleSheets_1 = adoptedStyleSheets; _i < adoptedStyleSheets_1.length; _i++) {
1873
1873
  var styleSheet = adoptedStyleSheets_1[_i];
1874
1874
  style += getCssRules(styleSheet);
1875
1875
  }
1876
- var fragementData = { tag: "*S" /* Constant.ShadowDomTag */, attributes: { style: style } };
1876
+ var fragementData = { tag: "*S" /* ShadowDomTag */, attributes: { style: style } };
1877
1877
  dom[call](node, shadowRoot.host, fragementData, source);
1878
1878
  }
1879
1879
  else {
1880
1880
  // If the browser doesn't support shadow DOM natively, we detect that, and send appropriate tag back.
1881
1881
  // The differentiation is important because we don't have to observe pollyfill shadow DOM nodes,
1882
1882
  // the same way we observe real shadow DOM nodes (encapsulation provided by the browser).
1883
- dom[call](node, shadowRoot.host, { tag: "*P" /* Constant.PolyfillShadowDomTag */, attributes: {} }, source);
1883
+ dom[call](node, shadowRoot.host, { tag: "*P" /* PolyfillShadowDomTag */, attributes: {} }, source);
1884
1884
  }
1885
1885
  }
1886
1886
  break;
@@ -1893,7 +1893,7 @@ function processNode (node, source) {
1893
1893
  // The only exception is when we receive a mutation to remove the text node, in that case
1894
1894
  // parent will be null, but we can still process the node by checking it's an update call.
1895
1895
  if (call === "update" || (parent && has(parent) && parent.tagName !== "STYLE")) {
1896
- var textData = { tag: "*T" /* Constant.TextTag */, value: node.nodeValue };
1896
+ var textData = { tag: "*T" /* TextTag */, value: node.nodeValue };
1897
1897
  dom[call](node, parent, textData, source);
1898
1898
  }
1899
1899
  break;
@@ -1905,20 +1905,20 @@ function processNode (node, source) {
1905
1905
  // For correctness, we first look at parentElement and if it not present then fall back to using parentNode
1906
1906
  parent = node.parentElement ? node.parentElement : (node.parentNode ? node.parentNode : null);
1907
1907
  // If we encounter a node that is part of SVG namespace, prefix the tag with SVG_PREFIX
1908
- if (element.namespaceURI === "http://www.w3.org/2000/svg" /* Constant.SvgNamespace */) {
1909
- tag = "svg:" /* Constant.SvgPrefix */ + tag;
1908
+ if (element.namespaceURI === "http://www.w3.org/2000/svg" /* SvgNamespace */) {
1909
+ tag = "svg:" /* SvgPrefix */ + tag;
1910
1910
  }
1911
1911
  switch (tag) {
1912
1912
  case "HTML":
1913
1913
  parent = insideFrame && parent ? iframe(parent) : null;
1914
- var htmlPrefix = insideFrame ? "iframe:" /* Constant.IFramePrefix */ : "" /* Constant.Empty */;
1914
+ var htmlPrefix = insideFrame ? "iframe:" /* IFramePrefix */ : "" /* Empty */;
1915
1915
  var htmlData = { tag: htmlPrefix + tag, attributes: attributes };
1916
1916
  dom[call](node, parent, htmlData, source);
1917
1917
  break;
1918
1918
  case "SCRIPT":
1919
- if ("type" /* Constant.Type */ in attributes && attributes["type" /* Constant.Type */] === "application/ld+json" /* Constant.JsonLD */) {
1919
+ if ("type" /* Type */ in attributes && attributes["type" /* Type */] === "application/ld+json" /* JsonLD */) {
1920
1920
  try {
1921
- ld(JSON.parse(element.text.replace(newlineRegex, "" /* Constant.Empty */)));
1921
+ ld(JSON.parse(element.text.replace(newlineRegex, "" /* Empty */)));
1922
1922
  }
1923
1923
  catch ( /* do nothing */_a) { /* do nothing */ }
1924
1924
  }
@@ -1926,20 +1926,20 @@ function processNode (node, source) {
1926
1926
  case "NOSCRIPT":
1927
1927
  break;
1928
1928
  case "META":
1929
- var key = ("property" /* Constant.Property */ in attributes ?
1930
- "property" /* Constant.Property */ :
1931
- ("name" /* Constant.Name */ in attributes ? "name" /* Constant.Name */ : null));
1932
- if (key && "content" /* Constant.Content */ in attributes) {
1933
- var content = attributes["content" /* Constant.Content */];
1929
+ var key = ("property" /* Property */ in attributes ?
1930
+ "property" /* Property */ :
1931
+ ("name" /* Name */ in attributes ? "name" /* Name */ : null));
1932
+ if (key && "content" /* Content */ in attributes) {
1933
+ var content = attributes["content" /* Content */];
1934
1934
  switch (attributes[key]) {
1935
- case "og:title" /* Constant.ogTitle */:
1936
- log(20 /* Dimension.MetaTitle */, content);
1935
+ case "og:title" /* ogTitle */:
1936
+ log(20 /* MetaTitle */, content);
1937
1937
  break;
1938
- case "og:type" /* Constant.ogType */:
1939
- log(19 /* Dimension.MetaType */, content);
1938
+ case "og:type" /* ogType */:
1939
+ log(19 /* MetaType */, content);
1940
1940
  break;
1941
- case "generator" /* Constant.Generator */:
1942
- log(21 /* Dimension.Generator */, content);
1941
+ case "generator" /* Generator */:
1942
+ log(21 /* Generator */, content);
1943
1943
  break;
1944
1944
  }
1945
1945
  }
@@ -1947,7 +1947,7 @@ function processNode (node, source) {
1947
1947
  case "HEAD":
1948
1948
  var head = { tag: tag, attributes: attributes };
1949
1949
  if (location) {
1950
- head.attributes["*B" /* Constant.Base */] = location.protocol + "//" + location.hostname;
1950
+ head.attributes["*B" /* Base */] = location.protocol + "//" + location.hostname;
1951
1951
  }
1952
1952
  dom[call](node, parent, head, source);
1953
1953
  break;
@@ -1960,7 +1960,7 @@ function processNode (node, source) {
1960
1960
  var frameData = { tag: tag, attributes: attributes };
1961
1961
  if (sameorigin(iframe$1)) {
1962
1962
  monitor(iframe$1);
1963
- frameData.attributes["*O" /* Constant.SameOrigin */] = "true";
1963
+ frameData.attributes["*O" /* SameOrigin */] = "true";
1964
1964
  if (iframe$1.contentDocument && iframe$1.contentWindow && iframe$1.contentDocument.readyState !== "loading") {
1965
1965
  child = iframe$1.contentDocument;
1966
1966
  }
@@ -1989,7 +1989,7 @@ function observe$3(root) {
1989
1989
  function getStyleValue(style) {
1990
1990
  // Call trim on the text content to ensure we do not process white spaces ( , \n, \r\n, \t, etc.)
1991
1991
  // Also, check if stylesheet has any data-* attribute, if so process rules instead of looking up text
1992
- var value = style.textContent ? style.textContent.trim() : "" /* Constant.Empty */;
1992
+ var value = style.textContent ? style.textContent.trim() : "" /* Empty */;
1993
1993
  var dataset = style.dataset ? Object.keys(style.dataset).length : 0;
1994
1994
  if (value.length === 0 || dataset > 0) {
1995
1995
  value = getCssRules(style.sheet);
@@ -1997,14 +1997,14 @@ function getStyleValue(style) {
1997
1997
  return value;
1998
1998
  }
1999
1999
  function getCssRules(sheet) {
2000
- var value = "" /* Constant.Empty */;
2000
+ var value = "" /* Empty */;
2001
2001
  var cssRules = null;
2002
2002
  // Firefox throws a SecurityError when trying to access cssRules of a stylesheet from a different domain
2003
2003
  try {
2004
2004
  cssRules = sheet ? sheet.cssRules : [];
2005
2005
  }
2006
2006
  catch (e) {
2007
- log$1(1 /* Code.CssRules */, 1 /* Severity.Warning */, e ? e.name : null);
2007
+ log$1(1 /* CssRules */, 1 /* Warning */, e ? e.name : null);
2008
2008
  if (e && e.name !== "SecurityError") {
2009
2009
  throw e;
2010
2010
  }
@@ -2028,8 +2028,8 @@ function getAttributes(element) {
2028
2028
  }
2029
2029
  }
2030
2030
  // For INPUT tags read the dynamic "value" property if an explicit "value" attribute is not set
2031
- if (element.tagName === "INPUT" /* Constant.InputTag */ && !("value" /* Constant.Value */ in output) && element.value) {
2032
- output["value" /* Constant.Value */] = element.value;
2031
+ if (element.tagName === "INPUT" /* InputTag */ && !("value" /* Value */ in output) && element.value) {
2032
+ output["value" /* Value */] = element.value;
2033
2033
  }
2034
2034
  return output;
2035
2035
  }
@@ -2051,13 +2051,13 @@ function traverse (root, timer, source) {
2051
2051
  next = next.nextSibling;
2052
2052
  }
2053
2053
  state = state$8(timer);
2054
- if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 3];
2054
+ if (!(state === 0 /* Wait */)) return [3 /*break*/, 3];
2055
2055
  return [4 /*yield*/, suspend$1(timer)];
2056
2056
  case 2:
2057
2057
  state = _a.sent();
2058
2058
  _a.label = 3;
2059
2059
  case 3:
2060
- if (state === 2 /* Task.Stop */) {
2060
+ if (state === 2 /* Stop */) {
2061
2061
  return [3 /*break*/, 4];
2062
2062
  }
2063
2063
  subnode = processNode(node, source);
@@ -2134,7 +2134,7 @@ function observe$2(node) {
2134
2134
  // For this reason, we need to wire up mutations every time we see a new shadow dom.
2135
2135
  // Also, wrap it inside a try / catch. In certain browsers (e.g. legacy Edge), observer on shadow dom can throw errors
2136
2136
  try {
2137
- var m = api("MutationObserver" /* Constant.MutationObserver */);
2137
+ var m = api("MutationObserver" /* MutationObserver */);
2138
2138
  var observer = m in window ? new window[m](measure(handle$1)) : null;
2139
2139
  if (observer) {
2140
2140
  observer.observe(node, { attributes: true, childList: true, characterData: true, subtree: true });
@@ -2142,7 +2142,7 @@ function observe$2(node) {
2142
2142
  }
2143
2143
  }
2144
2144
  catch (e) {
2145
- log$1(2 /* Code.MutationObserver */, 0 /* Severity.Info */, e ? e.name : null);
2145
+ log$1(2 /* MutationObserver */, 0 /* Info */, e ? e.name : null);
2146
2146
  }
2147
2147
  }
2148
2148
  function monitor(frame) {
@@ -2150,7 +2150,7 @@ function monitor(frame) {
2150
2150
  // This includes cases where iframe location is updated without explicitly updating src attribute
2151
2151
  // E.g. iframe.contentWindow.location.href = "new-location";
2152
2152
  if (has(frame) === false) {
2153
- bind(frame, "load" /* Constant.LoadEvent */, generate.bind(this, frame, "childList" /* Constant.ChildList */), true);
2153
+ bind(frame, "load" /* LoadEvent */, generate.bind(this, frame, "childList" /* ChildList */), true);
2154
2154
  }
2155
2155
  }
2156
2156
  function stop$h() {
@@ -2168,14 +2168,14 @@ function stop$h() {
2168
2168
  timeout$1 = null;
2169
2169
  }
2170
2170
  function active$2() {
2171
- activePeriod = time() + 3000 /* Setting.MutationActivePeriod */;
2171
+ activePeriod = time() + 3000 /* MutationActivePeriod */;
2172
2172
  }
2173
2173
  function handle$1(m) {
2174
2174
  // Queue up mutation records for asynchronous processing
2175
2175
  var now = time();
2176
- track$6(6 /* Event.Mutation */, now);
2176
+ track$6(6 /* Mutation */, now);
2177
2177
  mutations.push({ time: now, mutations: m });
2178
- schedule$1(process$2, 1 /* Priority.High */).then(function () {
2178
+ schedule$1(process$2, 1 /* High */).then(function () {
2179
2179
  setTimeout(compute$7);
2180
2180
  measure(compute$6)();
2181
2181
  });
@@ -2186,7 +2186,7 @@ function process$2() {
2186
2186
  return __generator(this, function (_b) {
2187
2187
  switch (_b.label) {
2188
2188
  case 0:
2189
- timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
2189
+ timer = { id: id(), cost: 3 /* LayoutCost */ };
2190
2190
  start$w(timer);
2191
2191
  _b.label = 1;
2192
2192
  case 1:
@@ -2198,13 +2198,13 @@ function process$2() {
2198
2198
  if (!(_i < _a.length)) return [3 /*break*/, 6];
2199
2199
  mutation = _a[_i];
2200
2200
  state = state$8(timer);
2201
- if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 4];
2201
+ if (!(state === 0 /* Wait */)) return [3 /*break*/, 4];
2202
2202
  return [4 /*yield*/, suspend$1(timer)];
2203
2203
  case 3:
2204
2204
  state = _b.sent();
2205
2205
  _b.label = 4;
2206
2206
  case 4:
2207
- if (state === 2 /* Task.Stop */) {
2207
+ if (state === 2 /* Stop */) {
2208
2208
  return [3 /*break*/, 6];
2209
2209
  }
2210
2210
  target = mutation.target;
@@ -2216,17 +2216,17 @@ function process$2() {
2216
2216
  parse$1(target);
2217
2217
  }
2218
2218
  switch (type) {
2219
- case "attributes" /* Constant.Attributes */:
2220
- processNode(target, 3 /* Source.Attributes */);
2219
+ case "attributes" /* Attributes */:
2220
+ processNode(target, 3 /* Attributes */);
2221
2221
  break;
2222
- case "characterData" /* Constant.CharacterData */:
2223
- processNode(target, 4 /* Source.CharacterData */);
2222
+ case "characterData" /* CharacterData */:
2223
+ processNode(target, 4 /* CharacterData */);
2224
2224
  break;
2225
- case "childList" /* Constant.ChildList */:
2226
- processNodeList(mutation.addedNodes, 1 /* Source.ChildListAdd */, timer);
2227
- processNodeList(mutation.removedNodes, 2 /* Source.ChildListRemove */, timer);
2225
+ case "childList" /* ChildList */:
2226
+ processNodeList(mutation.addedNodes, 1 /* ChildListAdd */, timer);
2227
+ processNodeList(mutation.removedNodes, 2 /* ChildListRemove */, timer);
2228
2228
  break;
2229
- case "suspend" /* Constant.Suspend */:
2229
+ case "suspend" /* Suspend */:
2230
2230
  value = get(target);
2231
2231
  if (value) {
2232
2232
  value.metadata.suspend = true;
@@ -2237,7 +2237,7 @@ function process$2() {
2237
2237
  case 5:
2238
2238
  _i++;
2239
2239
  return [3 /*break*/, 2];
2240
- case 6: return [4 /*yield*/, encode$4(6 /* Event.Mutation */, timer, record.time)];
2240
+ case 6: return [4 /*yield*/, encode$4(6 /* Mutation */, timer, record.time)];
2241
2241
  case 7:
2242
2242
  _b.sent();
2243
2243
  return [3 /*break*/, 1];
@@ -2251,11 +2251,11 @@ function process$2() {
2251
2251
  function track$5(m, timer) {
2252
2252
  var value = m.target ? get(m.target.parentNode) : null;
2253
2253
  // Check if the parent is already discovered and that the parent is not the document root
2254
- if (value && value.data.tag !== "HTML" /* Constant.HTML */) {
2254
+ if (value && value.data.tag !== "HTML" /* HTML */) {
2255
2255
  var inactive = time() > activePeriod;
2256
2256
  var target = get(m.target);
2257
2257
  var element = target && target.selector ? target.selector.join() : m.target.nodeName;
2258
- var parent_1 = value.selector ? value.selector.join() : "" /* Constant.Empty */;
2258
+ var parent_1 = value.selector ? value.selector.join() : "" /* Empty */;
2259
2259
  // We use selector, instead of id, to determine the key (signature for the mutation) because in some cases
2260
2260
  // repeated mutations can cause elements to be destroyed and then recreated as new DOM nodes
2261
2261
  // In those cases, IDs will change however the selector (which is relative to DOM xPath) remains the same
@@ -2264,20 +2264,20 @@ function track$5(m, timer) {
2264
2264
  history$4[key] = key in history$4 ? history$4[key] : [0];
2265
2265
  var h = history$4[key];
2266
2266
  // Lookup any pending nodes queued up for removal, and process them now if we suspended a mutation before
2267
- if (inactive === false && h[0] >= 10 /* Setting.MutationSuspendThreshold */) {
2268
- processNodeList(h[1], 2 /* Source.ChildListRemove */, timer);
2267
+ if (inactive === false && h[0] >= 10 /* MutationSuspendThreshold */) {
2268
+ processNodeList(h[1], 2 /* ChildListRemove */, timer);
2269
2269
  }
2270
2270
  // Update the counter
2271
2271
  h[0] = inactive ? h[0] + 1 : 1;
2272
2272
  // Return updated mutation type based on if we have already hit the threshold or not
2273
- if (h[0] === 10 /* Setting.MutationSuspendThreshold */) {
2273
+ if (h[0] === 10 /* MutationSuspendThreshold */) {
2274
2274
  // Store a reference to removedNodes so we can process them later
2275
2275
  // when we resume mutations again on user interactions
2276
2276
  h[1] = m.removedNodes;
2277
- return "suspend" /* Constant.Suspend */;
2277
+ return "suspend" /* Suspend */;
2278
2278
  }
2279
- else if (h[0] > 10 /* Setting.MutationSuspendThreshold */) {
2280
- return "" /* Constant.Empty */;
2279
+ else if (h[0] > 10 /* MutationSuspendThreshold */) {
2280
+ return "" /* Empty */;
2281
2281
  }
2282
2282
  }
2283
2283
  return m.type;
@@ -2300,18 +2300,18 @@ function processNodeList(list, source, timer) {
2300
2300
  _a.label = 1;
2301
2301
  case 1:
2302
2302
  if (!(i < length)) return [3 /*break*/, 6];
2303
- if (!(source === 1 /* Source.ChildListAdd */)) return [3 /*break*/, 2];
2303
+ if (!(source === 1 /* ChildListAdd */)) return [3 /*break*/, 2];
2304
2304
  traverse(list[i], timer, source);
2305
2305
  return [3 /*break*/, 5];
2306
2306
  case 2:
2307
2307
  state = state$8(timer);
2308
- if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 4];
2308
+ if (!(state === 0 /* Wait */)) return [3 /*break*/, 4];
2309
2309
  return [4 /*yield*/, suspend$1(timer)];
2310
2310
  case 3:
2311
2311
  state = _a.sent();
2312
2312
  _a.label = 4;
2313
2313
  case 4:
2314
- if (state === 2 /* Task.Stop */) {
2314
+ if (state === 2 /* Stop */) {
2315
2315
  return [3 /*break*/, 6];
2316
2316
  }
2317
2317
  processNode(list[i], source);
@@ -2336,7 +2336,7 @@ function schedule(node, fragment) {
2336
2336
  if (timeout$1) {
2337
2337
  clearTimeout(timeout$1);
2338
2338
  }
2339
- timeout$1 = setTimeout(function () { trigger$1(fragment); }, 33 /* Setting.LookAhead */);
2339
+ timeout$1 = setTimeout(function () { trigger$1(fragment); }, 33 /* LookAhead */);
2340
2340
  return node;
2341
2341
  }
2342
2342
  function trigger$1(fragment) {
@@ -2349,7 +2349,7 @@ function trigger$1(fragment) {
2349
2349
  if (shadowRoot && has(node)) {
2350
2350
  continue;
2351
2351
  }
2352
- generate(node, shadowRoot || fragment ? "childList" /* Constant.ChildList */ : "characterData" /* Constant.CharacterData */);
2352
+ generate(node, shadowRoot || fragment ? "childList" /* ChildList */ : "characterData" /* CharacterData */);
2353
2353
  }
2354
2354
  }
2355
2355
  queue$2 = [];
@@ -2399,9 +2399,9 @@ function reset$7() {
2399
2399
  hashMap = {};
2400
2400
  override = [];
2401
2401
  unmask = [];
2402
- maskText = "address,password,contact" /* Mask.Text */.split("," /* Constant.Comma */);
2403
- 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 */);
2404
- maskDisable = "radio,checkbox,range,button,reset,submit" /* Mask.Disable */.split("," /* Constant.Comma */);
2402
+ maskText = "address,password,contact" /* Text */.split("," /* Comma */);
2403
+ 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 */);
2404
+ maskDisable = "radio,checkbox,range,button,reset,submit" /* Disable */.split("," /* Comma */);
2405
2405
  idMap = new WeakMap();
2406
2406
  iframeMap = new WeakMap();
2407
2407
  privacyMap = new WeakMap();
@@ -2417,19 +2417,19 @@ function parse$1(root, init) {
2417
2417
  try {
2418
2418
  // Parse unmask configuration into separate query selectors and override tokens as part of initialization
2419
2419
  if (init) {
2420
- config$1.unmask.forEach(function (x) { return x.indexOf("!" /* Constant.Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
2420
+ config$1.unmask.forEach(function (x) { return x.indexOf("!" /* Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
2421
2421
  }
2422
2422
  // Since mutations may happen on leaf nodes too, e.g. text nodes, which may not support all selector APIs.
2423
2423
  // We ensure that the root note supports querySelectorAll API before executing the code below to identify new regions.
2424
2424
  if ("querySelectorAll" in root) {
2425
- config$1.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, "".concat(x[0])); }); }); // Regions
2426
- config$1.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /* Privacy.TextImage */); }); }); // Masked Elements
2425
+ config$1.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, "" + x[0]); }); }); // Regions
2426
+ config$1.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /* TextImage */); }); }); // Masked Elements
2427
2427
  config$1.fraud.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return fraudMap.set(e, x[0]); }); }); // Fraud Check
2428
- unmask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 0 /* Privacy.None */); }); }); // Unmasked Elements
2428
+ unmask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 0 /* None */); }); }); // Unmasked Elements
2429
2429
  }
2430
2430
  }
2431
2431
  catch (e) {
2432
- log$1(5 /* Code.Selector */, 1 /* Severity.Warning */, e ? e.name : null);
2432
+ log$1(5 /* Selector */, 1 /* Warning */, e ? e.name : null);
2433
2433
  }
2434
2434
  }
2435
2435
  function getId(node, autogen) {
@@ -2452,7 +2452,7 @@ function add(node, parent, data, source) {
2452
2452
  var regionId = exists(node) ? id : null;
2453
2453
  var fragmentId = null;
2454
2454
  var fraudId = fraudMap.has(node) ? fraudMap.get(node) : null;
2455
- var privacyId = config$1.content ? 1 /* Privacy.Sensitive */ : 2 /* Privacy.Text */;
2455
+ var privacyId = config$1.content ? 1 /* Sensitive */ : 3 /* TextImage */;
2456
2456
  if (parentId >= 0 && values[parentId]) {
2457
2457
  parentValue = values[parentId];
2458
2458
  parentValue.children.push(id);
@@ -2462,8 +2462,8 @@ function add(node, parent, data, source) {
2462
2462
  privacyId = parentValue.metadata.privacy;
2463
2463
  }
2464
2464
  // If there's an explicit region attribute set on the element, use it to mark a region on the page
2465
- if (data.attributes && "data-clarity-region" /* Constant.RegionData */ in data.attributes) {
2466
- observe$1(node, data.attributes["data-clarity-region" /* Constant.RegionData */]);
2465
+ if (data.attributes && "data-clarity-region" /* RegionData */ in data.attributes) {
2466
+ observe$1(node, data.attributes["data-clarity-region" /* RegionData */]);
2467
2467
  regionId = id;
2468
2468
  }
2469
2469
  nodes[id] = node;
@@ -2541,7 +2541,7 @@ function update$1(node, parent, data, source) {
2541
2541
  }
2542
2542
  function sameorigin(node) {
2543
2543
  var output = false;
2544
- if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "IFRAME" /* Constant.IFrameTag */) {
2544
+ if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "IFRAME" /* IFrameTag */) {
2545
2545
  var frame = node;
2546
2546
  // To determine if the iframe is same-origin or not, we try accessing it's contentDocument.
2547
2547
  // If the browser throws an exception, we assume it's cross-origin and move on.
@@ -2568,11 +2568,11 @@ function privacy(node, value, parent) {
2568
2568
  var attributes = data.attributes || {};
2569
2569
  var tag = data.tag.toUpperCase();
2570
2570
  switch (true) {
2571
- case "data-clarity-mask" /* Constant.MaskData */ in attributes:
2572
- metadata.privacy = 3 /* Privacy.TextImage */;
2571
+ case "data-clarity-mask" /* MaskData */ in attributes:
2572
+ metadata.privacy = 3 /* TextImage */;
2573
2573
  break;
2574
- case "data-clarity-unmask" /* Constant.UnmaskData */ in attributes:
2575
- metadata.privacy = 0 /* Privacy.None */;
2574
+ case "data-clarity-unmask" /* UnmaskData */ in attributes:
2575
+ metadata.privacy = 0 /* None */;
2576
2576
  break;
2577
2577
  case privacyMap.has(node):
2578
2578
  // If this node was explicitly configured to contain sensitive content, honor that privacy setting
@@ -2580,40 +2580,38 @@ function privacy(node, value, parent) {
2580
2580
  break;
2581
2581
  case fraudMap.has(node):
2582
2582
  // If this node was explicitly configured to be evaluated for fraud, then also mask content
2583
- metadata.privacy = 2 /* Privacy.Text */;
2583
+ metadata.privacy = 2 /* Text */;
2584
2584
  break;
2585
- case tag === "*T" /* Constant.TextTag */:
2585
+ case tag === "*T" /* TextTag */:
2586
2586
  // If it's a text node belonging to a STYLE or TITLE tag or one of scrub exceptions, then capture content
2587
- var pTag = parent && parent.data ? parent.data.tag : "" /* Constant.Empty */;
2588
- var pSelector_1 = parent && parent.selector ? parent.selector[1 /* Selector.Default */] : "" /* Constant.Empty */;
2589
- var tags = ["STYLE" /* Constant.StyleTag */, "TITLE" /* Constant.TitleTag */, "svg:style" /* Constant.SvgStyle */];
2590
- metadata.privacy = tags.includes(pTag) || override.some(function (x) { return pSelector_1.indexOf(x) >= 0; }) ? 0 /* Privacy.None */ : current;
2587
+ var pTag = parent && parent.data ? parent.data.tag : "" /* Empty */;
2588
+ var pSelector_1 = parent && parent.selector ? parent.selector[1 /* Default */] : "" /* Empty */;
2589
+ var tags = ["STYLE" /* StyleTag */, "TITLE" /* TitleTag */, "svg:style" /* SvgStyle */];
2590
+ metadata.privacy = tags.includes(pTag) || override.some(function (x) { return pSelector_1.indexOf(x) >= 0; }) ? 0 /* None */ : current;
2591
2591
  break;
2592
- case "type" /* Constant.Type */ in attributes:
2593
- // If this node has an explicit type assigned to it, go through masking rules to determine right privacy setting
2594
- metadata.privacy = inspect(attributes["type" /* Constant.Type */], maskInput, metadata);
2595
- break;
2596
- case tag === "INPUT" /* Constant.InputTag */ && current === 0 /* Privacy.None */:
2592
+ case tag === "INPUT" /* InputTag */ && current === 0 /* None */:
2597
2593
  // If even default privacy setting is to not mask, we still scan through input fields for any sensitive information
2598
- var field_1 = "" /* Constant.Empty */;
2594
+ var field_1 = "" /* Empty */;
2599
2595
  Object.keys(attributes).forEach(function (x) { return field_1 += attributes[x].toLowerCase(); });
2600
2596
  metadata.privacy = inspect(field_1, maskInput, metadata);
2601
2597
  break;
2602
- case current === 1 /* Privacy.Sensitive */ && tag === "INPUT" /* Constant.InputTag */:
2598
+ case tag === "INPUT" /* InputTag */ && current === 1 /* Sensitive */:
2603
2599
  // Look through class names to aggressively mask content
2604
- metadata.privacy = inspect(attributes["class" /* Constant.Class */], maskText, metadata);
2605
- // If it's a button or an input option, make an exception to disable masking
2606
- metadata.privacy = maskDisable.indexOf(attributes["type" /* Constant.Type */]) >= 0 ? 0 /* Privacy.None */ : current;
2600
+ metadata.privacy = inspect(attributes["class" /* Class */], maskText, metadata);
2601
+ // If this node has an explicit type assigned to it, go through masking rules to determine right privacy setting
2602
+ metadata.privacy = inspect(attributes["type" /* Type */], maskInput, metadata);
2603
+ // If it's a button or an input option, make an exception to disable masking in sensitive mode
2604
+ metadata.privacy = maskDisable.indexOf(attributes["type" /* Type */]) >= 0 ? 0 /* None */ : metadata.privacy;
2607
2605
  break;
2608
- case current === 1 /* Privacy.Sensitive */:
2606
+ case current === 1 /* Sensitive */:
2609
2607
  // In a mode where we mask sensitive information by default, look through class names to aggressively mask content
2610
- metadata.privacy = inspect(attributes["class" /* Constant.Class */], maskText, metadata);
2608
+ metadata.privacy = inspect(attributes["class" /* Class */], maskText, metadata);
2611
2609
  break;
2612
2610
  }
2613
2611
  }
2614
2612
  function inspect(input, lookup, metadata) {
2615
2613
  if (input && lookup.some(function (x) { return input.indexOf(x) >= 0; })) {
2616
- return 2 /* Privacy.Text */;
2614
+ return 2 /* Text */;
2617
2615
  }
2618
2616
  return metadata.privacy;
2619
2617
  }
@@ -2651,7 +2649,7 @@ function updateSelector(value) {
2651
2649
  var d = value.data;
2652
2650
  var p = position(parent, value);
2653
2651
  var s = { id: value.id, tag: d.tag, prefix: prefix, position: p, attributes: d.attributes };
2654
- value.selector = [get$1(s, 0 /* Selector.Alpha */), get$1(s, 1 /* Selector.Beta */)];
2652
+ value.selector = [get$1(s, 0 /* Alpha */), get$1(s, 1 /* Beta */)];
2655
2653
  value.hash = value.selector.map(function (x) { return x ? hash(x) : null; });
2656
2654
  value.hash.forEach(function (h) { return hashMap[h] = value.id; });
2657
2655
  // Match fragment configuration against both alpha and beta hash
@@ -2706,7 +2704,7 @@ function remove(id, source) {
2706
2704
  }
2707
2705
  function size(value) {
2708
2706
  // If this element is a image node, and is masked, then track box model for the current element
2709
- if (value.data.tag === "IMG" /* Constant.ImageTag */ && value.metadata.privacy === 3 /* Privacy.TextImage */) {
2707
+ if (value.data.tag === "IMG" /* ImageTag */ && value.metadata.privacy === 3 /* TextImage */) {
2710
2708
  value.metadata.size = [];
2711
2709
  }
2712
2710
  }
@@ -2741,7 +2739,7 @@ function track$4(id, source, fragment, changed, parentChanged) {
2741
2739
  // Edge case: If an element is added later on, and pre-discovered element is moved as a child.
2742
2740
  // In that case, we need to reorder the pre-discovered element in the update list to keep visualization consistent.
2743
2741
  var uIndex = updateMap.indexOf(id);
2744
- if (uIndex >= 0 && source === 1 /* Source.ChildListAdd */ && parentChanged) {
2742
+ if (uIndex >= 0 && source === 1 /* ChildListAdd */ && parentChanged) {
2745
2743
  updateMap.splice(uIndex, 1);
2746
2744
  updateMap.push(id);
2747
2745
  }
@@ -2787,15 +2785,15 @@ function exists(node) {
2787
2785
  }
2788
2786
  function track$3(id, event) {
2789
2787
  var node = getNode(id);
2790
- var data = id in regions ? regions[id] : { id: id, visibility: 0 /* RegionVisibility.Rendered */, interaction: 16 /* InteractionState.None */, name: regionMap.get(node) };
2788
+ var data = id in regions ? regions[id] : { id: id, visibility: 0 /* Rendered */, interaction: 16 /* None */, name: regionMap.get(node) };
2791
2789
  // Determine the interaction state based on incoming event
2792
- var interaction = 16 /* InteractionState.None */;
2790
+ var interaction = 16 /* None */;
2793
2791
  switch (event) {
2794
- case 9 /* Event.Click */:
2795
- interaction = 20 /* InteractionState.Clicked */;
2792
+ case 9 /* Click */:
2793
+ interaction = 20 /* Clicked */;
2796
2794
  break;
2797
- case 27 /* Event.Input */:
2798
- interaction = 30 /* InteractionState.Input */;
2795
+ case 27 /* Input */:
2796
+ interaction = 30 /* Input */;
2799
2797
  break;
2800
2798
  }
2801
2799
  // Process updates to this region, if applicable
@@ -2823,7 +2821,7 @@ function compute$6() {
2823
2821
  queue$1 = q;
2824
2822
  // Schedule encode only when we have at least one valid data entry
2825
2823
  if (state$1.length > 0) {
2826
- encode$4(7 /* Event.Region */);
2824
+ encode$4(7 /* Region */);
2827
2825
  }
2828
2826
  }
2829
2827
  function handler$1(entries) {
@@ -2839,27 +2837,27 @@ function handler$1(entries) {
2839
2837
  // 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
2840
2838
  if (regionMap.has(target) && rect.width + rect.height > 0 && viewport.width > 0 && viewport.height > 0) {
2841
2839
  var id = target ? getId(target) : null;
2842
- var data = id in regions ? regions[id] : { id: id, name: regionMap.get(target), interaction: 16 /* InteractionState.None */, visibility: 0 /* RegionVisibility.Rendered */ };
2840
+ var data = id in regions ? regions[id] : { id: id, name: regionMap.get(target), interaction: 16 /* None */, visibility: 0 /* Rendered */ };
2843
2841
  // For regions that have relatively smaller area, we look at intersection ratio and see the overlap relative to element's area
2844
2842
  // However, for larger regions, area of regions could be bigger than viewport and therefore comparison is relative to visible area
2845
2843
  var viewportRatio = overlap ? (overlap.width * overlap.height * 1.0) / (viewport.width * viewport.height) : 0;
2846
- var visible = viewportRatio > 0.05 /* Setting.ViewportIntersectionRatio */ || entry.intersectionRatio > 0.8 /* Setting.IntersectionRatio */;
2844
+ var visible = viewportRatio > 0.05 /* ViewportIntersectionRatio */ || entry.intersectionRatio > 0.8 /* IntersectionRatio */;
2847
2845
  // If an element is either visible or was visible and has been scrolled to the end
2848
2846
  // 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.
2849
2847
  // 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
2850
- var scrolledToEnd = (visible || data.visibility == 10 /* RegionVisibility.Visible */) && Math.abs(rect.top) + viewport.height > rect.height;
2848
+ var scrolledToEnd = (visible || data.visibility == 10 /* Visible */) && Math.abs(rect.top) + viewport.height > rect.height;
2851
2849
  // Process updates to this region, if applicable
2852
2850
  process$1(target, data, data.interaction, (scrolledToEnd ?
2853
- 13 /* RegionVisibility.ScrolledToEnd */ :
2854
- (visible ? 10 /* RegionVisibility.Visible */ : 0 /* RegionVisibility.Rendered */)));
2851
+ 13 /* ScrolledToEnd */ :
2852
+ (visible ? 10 /* Visible */ : 0 /* Rendered */)));
2855
2853
  // Stop observing this element now that we have already received scrolled signal
2856
- if (data.visibility >= 13 /* RegionVisibility.ScrolledToEnd */ && observer$1) {
2854
+ if (data.visibility >= 13 /* ScrolledToEnd */ && observer$1) {
2857
2855
  observer$1.unobserve(target);
2858
2856
  }
2859
2857
  }
2860
2858
  }
2861
2859
  if (state$1.length > 0) {
2862
- encode$4(7 /* Event.Region */);
2860
+ encode$4(7 /* Region */);
2863
2861
  }
2864
2862
  }
2865
2863
  function process$1(n, d, s, v) {
@@ -2918,7 +2916,7 @@ function link(node) {
2918
2916
  function metadata$2(node, event, text) {
2919
2917
  if (text === void 0) { text = null; }
2920
2918
  // If the node is null, we return a reserved value for id: 0. Valid assignment of id begins from 1+.
2921
- var output = { id: 0, hash: null, privacy: 2 /* Privacy.Text */, node: node };
2919
+ var output = { id: 0, hash: null, privacy: 2 /* Text */, node: node };
2922
2920
  if (node) {
2923
2921
  var value = get(node);
2924
2922
  if (value !== null) {
@@ -2944,15 +2942,15 @@ function encode$3 (type) {
2944
2942
  t = time();
2945
2943
  tokens = [t, type];
2946
2944
  switch (type) {
2947
- case 13 /* Event.MouseDown */:
2948
- case 14 /* Event.MouseUp */:
2949
- case 12 /* Event.MouseMove */:
2950
- case 15 /* Event.MouseWheel */:
2951
- case 16 /* Event.DoubleClick */:
2952
- case 17 /* Event.TouchStart */:
2953
- case 18 /* Event.TouchEnd */:
2954
- case 19 /* Event.TouchMove */:
2955
- case 20 /* Event.TouchCancel */:
2945
+ case 13 /* MouseDown */:
2946
+ case 14 /* MouseUp */:
2947
+ case 12 /* MouseMove */:
2948
+ case 15 /* MouseWheel */:
2949
+ case 16 /* DoubleClick */:
2950
+ case 17 /* TouchStart */:
2951
+ case 18 /* TouchEnd */:
2952
+ case 19 /* TouchMove */:
2953
+ case 20 /* TouchCancel */:
2956
2954
  for (_i = 0, _a = state$4; _i < _a.length; _i++) {
2957
2955
  entry = _a[_i];
2958
2956
  pTarget = metadata$2(entry.data.target, entry.event);
@@ -2967,12 +2965,12 @@ function encode$3 (type) {
2967
2965
  }
2968
2966
  reset$e();
2969
2967
  break;
2970
- case 9 /* Event.Click */:
2968
+ case 9 /* Click */:
2971
2969
  for (_b = 0, _c = state$7; _b < _c.length; _b++) {
2972
2970
  entry = _c[_b];
2973
2971
  cTarget = metadata$2(entry.data.target, entry.event, entry.data.text);
2974
2972
  tokens = [entry.time, entry.event];
2975
- cHash = cTarget.hash.join("." /* Constant.Dot */);
2973
+ cHash = cTarget.hash.join("." /* Dot */);
2976
2974
  tokens.push(cTarget.id);
2977
2975
  tokens.push(entry.data.x);
2978
2976
  tokens.push(entry.data.y);
@@ -2990,7 +2988,7 @@ function encode$3 (type) {
2990
2988
  }
2991
2989
  reset$h();
2992
2990
  break;
2993
- case 38 /* Event.Clipboard */:
2991
+ case 38 /* Clipboard */:
2994
2992
  for (_d = 0, _e = state$6; _d < _e.length; _d++) {
2995
2993
  entry = _e[_d];
2996
2994
  tokens = [entry.time, entry.event];
@@ -3003,7 +3001,7 @@ function encode$3 (type) {
3003
3001
  }
3004
3002
  reset$g();
3005
3003
  break;
3006
- case 11 /* Event.Resize */:
3004
+ case 11 /* Resize */:
3007
3005
  r = data$b;
3008
3006
  tokens.push(r.width);
3009
3007
  tokens.push(r.height);
@@ -3011,13 +3009,13 @@ function encode$3 (type) {
3011
3009
  reset$d();
3012
3010
  queue(tokens);
3013
3011
  break;
3014
- case 26 /* Event.Unload */:
3012
+ case 26 /* Unload */:
3015
3013
  u = data$9;
3016
3014
  tokens.push(u.name);
3017
3015
  reset$9();
3018
3016
  queue(tokens);
3019
3017
  break;
3020
- case 27 /* Event.Input */:
3018
+ case 27 /* Input */:
3021
3019
  for (_f = 0, _g = state$5; _f < _g.length; _f++) {
3022
3020
  entry = _g[_f];
3023
3021
  iTarget = metadata$2(entry.data.target, entry.event, entry.data.value);
@@ -3028,7 +3026,7 @@ function encode$3 (type) {
3028
3026
  }
3029
3027
  reset$f();
3030
3028
  break;
3031
- case 21 /* Event.Selection */:
3029
+ case 21 /* Selection */:
3032
3030
  s = data$a;
3033
3031
  if (s) {
3034
3032
  startTarget = metadata$2(s.start, type);
@@ -3041,7 +3039,7 @@ function encode$3 (type) {
3041
3039
  queue(tokens);
3042
3040
  }
3043
3041
  break;
3044
- case 10 /* Event.Scroll */:
3042
+ case 10 /* Scroll */:
3045
3043
  for (_h = 0, _j = state$3; _h < _j.length; _h++) {
3046
3044
  entry = _j[_h];
3047
3045
  sTarget = metadata$2(entry.data.target, entry.event);
@@ -3056,7 +3054,7 @@ function encode$3 (type) {
3056
3054
  }
3057
3055
  reset$c();
3058
3056
  break;
3059
- case 39 /* Event.Submit */:
3057
+ case 39 /* Submit */:
3060
3058
  for (_k = 0, _l = state$2; _k < _l.length; _k++) {
3061
3059
  entry = _l[_k];
3062
3060
  tokens = [entry.time, entry.event];
@@ -3068,7 +3066,7 @@ function encode$3 (type) {
3068
3066
  }
3069
3067
  reset$a();
3070
3068
  break;
3071
- case 22 /* Event.Timeline */:
3069
+ case 22 /* Timeline */:
3072
3070
  for (_m = 0, _o = updates$1; _m < _o.length; _m++) {
3073
3071
  entry = _o[_m];
3074
3072
  tokens = [entry.time, entry.event];
@@ -3082,7 +3080,7 @@ function encode$3 (type) {
3082
3080
  }
3083
3081
  reset$5();
3084
3082
  break;
3085
- case 28 /* Event.Visibility */:
3083
+ case 28 /* Visibility */:
3086
3084
  v = data$8;
3087
3085
  tokens.push(v.visible);
3088
3086
  queue(tokens);
@@ -3105,11 +3103,11 @@ function reset$5() {
3105
3103
  updates$1 = [];
3106
3104
  }
3107
3105
  function track$2(time, event, hash, x, y, reaction, context) {
3108
- if (reaction === void 0) { reaction = 1 /* BooleanFlag.True */; }
3109
- if (context === void 0) { context = 0 /* BrowsingContext.Self */; }
3106
+ if (reaction === void 0) { reaction = 1 /* True */; }
3107
+ if (context === void 0) { context = 0 /* Self */; }
3110
3108
  state.push({
3111
3109
  time: time,
3112
- event: 22 /* Event.Timeline */,
3110
+ event: 22 /* Timeline */,
3113
3111
  data: {
3114
3112
  type: event,
3115
3113
  hash: hash,
@@ -3128,7 +3126,7 @@ function compute$5() {
3128
3126
  var temp = [];
3129
3127
  updates$1 = [];
3130
3128
  var max = data$1.start + data$1.duration;
3131
- var min = Math.max(max - 2000 /* Setting.TimelineSpan */, 0);
3129
+ var min = Math.max(max - 2000 /* TimelineSpan */, 0);
3132
3130
  for (var _i = 0, state_1 = state; _i < state_1.length; _i++) {
3133
3131
  var s = state_1[_i];
3134
3132
  if (s.time >= min) {
@@ -3139,7 +3137,7 @@ function compute$5() {
3139
3137
  }
3140
3138
  }
3141
3139
  state = temp; // Drop events less than the min time
3142
- encode$3(22 /* Event.Timeline */);
3140
+ encode$3(22 /* Timeline */);
3143
3141
  }
3144
3142
  function stop$e() {
3145
3143
  state = [];
@@ -3172,10 +3170,10 @@ function queue(tokens, transmit) {
3172
3170
  var type = tokens.length > 1 ? tokens[1] : null;
3173
3171
  var event_1 = JSON.stringify(tokens);
3174
3172
  switch (type) {
3175
- case 5 /* Event.Discover */:
3173
+ case 5 /* Discover */:
3176
3174
  discoverBytes += event_1.length;
3177
- case 37 /* Event.Box */:
3178
- case 6 /* Event.Mutation */:
3175
+ case 37 /* Box */:
3176
+ case 6 /* Mutation */:
3179
3177
  playbackBytes += event_1.length;
3180
3178
  playback.push(event_1);
3181
3179
  break;
@@ -3184,7 +3182,7 @@ function queue(tokens, transmit) {
3184
3182
  break;
3185
3183
  }
3186
3184
  // Increment event count metric
3187
- count$1(25 /* Metric.EventCount */);
3185
+ count$1(25 /* EventCount */);
3188
3186
  // Following two checks are precautionary and act as a fail safe mechanism to get out of unexpected situations.
3189
3187
  // Check 1: If for any reason the upload hasn't happened after waiting for 2x the config.delay time,
3190
3188
  // reset the timer. This allows Clarity to attempt an upload again.
@@ -3197,7 +3195,7 @@ function queue(tokens, transmit) {
3197
3195
  // However, in certain scenarios - like metric calculation - which are triggered as part of an existing upload
3198
3196
  // We enrich the data going out with the existing upload. In these cases, call to upload comes with 'transmit' set to false.
3199
3197
  if (transmit && timeout === null) {
3200
- if (type !== 25 /* Event.Ping */) {
3198
+ if (type !== 25 /* Ping */) {
3201
3199
  reset$n();
3202
3200
  }
3203
3201
  timeout = setTimeout(upload, gap);
@@ -3226,9 +3224,9 @@ function upload(final) {
3226
3224
  switch (_b.label) {
3227
3225
  case 0:
3228
3226
  timeout = null;
3229
- sendPlaybackBytes = config$1.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* Setting.MaxFirstPayloadBytes */ || data$1.sequence > 0);
3227
+ sendPlaybackBytes = config$1.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* MaxFirstPayloadBytes */ || data$1.sequence > 0);
3230
3228
  if (sendPlaybackBytes) {
3231
- max(1 /* Metric.Playback */, 1 /* BooleanFlag.True */);
3229
+ max(1 /* Playback */, 1 /* True */);
3232
3230
  }
3233
3231
  // CAUTION: Ensure "transmit" is set to false in the queue function for following events
3234
3232
  // Otherwise you run a risk of infinite loop.
@@ -3237,8 +3235,8 @@ function upload(final) {
3237
3235
  compute$8();
3238
3236
  last = final === true;
3239
3237
  e = JSON.stringify(envelope(last));
3240
- a = "[".concat(analysis.join(), "]");
3241
- p = sendPlaybackBytes ? "[".concat(playback.join(), "]") : "" /* Constant.Empty */;
3238
+ a = "[" + analysis.join() + "]";
3239
+ p = sendPlaybackBytes ? "[" + playback.join() + "]" : "" /* Empty */;
3242
3240
  encoded = { e: e, a: a, p: p };
3243
3241
  payload = stringify(encoded);
3244
3242
  if (!last) return [3 /*break*/, 1];
@@ -3250,7 +3248,7 @@ function upload(final) {
3250
3248
  _b.label = 3;
3251
3249
  case 3:
3252
3250
  zipped = _a;
3253
- sum(2 /* Metric.TotalBytes */, zipped ? zipped.length : payload.length);
3251
+ sum(2 /* TotalBytes */, zipped ? zipped.length : payload.length);
3254
3252
  send(payload, zipped, data$1.sequence, last);
3255
3253
  // Clear out events now that payload has been dispatched
3256
3254
  analysis = [];
@@ -3265,12 +3263,12 @@ function upload(final) {
3265
3263
  });
3266
3264
  }
3267
3265
  function stringify(encoded) {
3268
- 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, "}");
3266
+ return encoded.p.length > 0 ? "{\"e\":" + encoded.e + ",\"a\":" + encoded.a + ",\"p\":" + encoded.p + "}" : "{\"e\":" + encoded.e + ",\"a\":" + encoded.a + "}";
3269
3267
  }
3270
3268
  function send(payload, zipped, sequence, beacon) {
3271
3269
  if (beacon === void 0) { beacon = false; }
3272
3270
  // Upload data if a valid URL is defined in the config
3273
- if (typeof config$1.upload === "string" /* Constant.String */) {
3271
+ if (typeof config$1.upload === "string" /* String */) {
3274
3272
  var url = config$1.upload;
3275
3273
  var dispatched = false;
3276
3274
  // If it's the last payload, attempt to upload using sendBeacon first.
@@ -3309,7 +3307,7 @@ function send(payload, zipped, sequence, beacon) {
3309
3307
  xhr_1.withCredentials = true;
3310
3308
  if (zipped) {
3311
3309
  // If we do have valid compressed array, send it with appropriate HTTP headers so server can decode it appropriately
3312
- xhr_1.setRequestHeader("Accept" /* Constant.Accept */, "application/x-clarity-gzip" /* Constant.ClarityGzip */);
3310
+ xhr_1.setRequestHeader("Accept" /* Accept */, "application/x-clarity-gzip" /* ClarityGzip */);
3313
3311
  xhr_1.send(zipped);
3314
3312
  }
3315
3313
  else {
@@ -3326,13 +3324,13 @@ function send(payload, zipped, sequence, beacon) {
3326
3324
  }
3327
3325
  function check$3(xhr, sequence) {
3328
3326
  var transitData = transit[sequence];
3329
- if (xhr && xhr.readyState === 4 /* XMLReadyState.Done */ && transitData) {
3327
+ if (xhr && xhr.readyState === 4 /* Done */ && transitData) {
3330
3328
  // Attempt send payload again (as configured in settings) if we do not receive a success (2XX) response code back from the server
3331
- if ((xhr.status < 200 || xhr.status > 208) && transitData.attempts <= 1 /* Setting.RetryLimit */) {
3329
+ if ((xhr.status < 200 || xhr.status > 208) && transitData.attempts <= 1 /* RetryLimit */) {
3332
3330
  // We re-attempt in all cases except when server explicitly rejects our request with 4XX error
3333
3331
  if (xhr.status >= 400 && xhr.status < 500) {
3334
3332
  // In case of a 4XX response from the server, we bail out instead of trying again
3335
- trigger(6 /* Check.Server */);
3333
+ trigger(6 /* Server */);
3336
3334
  }
3337
3335
  else {
3338
3336
  // Browser will send status = 0 when it refuses to put network request over the wire
@@ -3353,7 +3351,7 @@ function check$3(xhr, sequence) {
3353
3351
  track$1 = { sequence: sequence, attempts: transitData.attempts, status: xhr.status };
3354
3352
  // Send back an event only if we were not successful in our first attempt
3355
3353
  if (transitData.attempts > 1) {
3356
- encode$1(2 /* Event.Upload */);
3354
+ encode$1(2 /* Upload */);
3357
3355
  }
3358
3356
  // Handle response if it was a 200 response with a valid body
3359
3357
  if (xhr.status === 200 && xhr.responseText) {
@@ -3364,7 +3362,7 @@ function check$3(xhr, sequence) {
3364
3362
  // And, right before we terminate the session, we will attempt one last time to see if we can use
3365
3363
  // different transport option (sendBeacon vs. XHR) to get this data to the server for analysis purposes
3366
3364
  send(transitData.data, null, sequence, true);
3367
- trigger(3 /* Check.Retry */);
3365
+ trigger(3 /* Retry */);
3368
3366
  }
3369
3367
  // Signal that this request completed successfully
3370
3368
  if (xhr.status >= 200 && xhr.status <= 208) {
@@ -3384,19 +3382,25 @@ function done(sequence) {
3384
3382
  function delay() {
3385
3383
  // Progressively increase delay as we continue to send more payloads from the client to the server
3386
3384
  // If we are not uploading data to a server, and instead invoking UploadCallback, in that case keep returning configured value
3387
- var gap = config$1.lean === false && discoverBytes > 0 ? 100 /* Setting.MinUploadDelay */ : data$1.sequence * config$1.delay;
3388
- return typeof config$1.upload === "string" /* Constant.String */ ? Math.max(Math.min(gap, 30000 /* Setting.MaxUploadDelay */), 100 /* Setting.MinUploadDelay */) : config$1.delay;
3385
+ var gap = config$1.lean === false && discoverBytes > 0 ? 100 /* MinUploadDelay */ : data$1.sequence * config$1.delay;
3386
+ return typeof config$1.upload === "string" /* String */ ? Math.max(Math.min(gap, 30000 /* MaxUploadDelay */), 100 /* MinUploadDelay */) : config$1.delay;
3389
3387
  }
3390
3388
  function response(payload) {
3391
- var key = payload && payload.length > 0 ? payload.split(" ")[0] : "" /* Constant.Empty */;
3392
- switch (key) {
3393
- case "END" /* Constant.End */:
3389
+ var parts = payload && payload.length > 0 ? payload.split(" ") : ["" /* Empty */];
3390
+ switch (parts[0]) {
3391
+ case "END" /* End */:
3394
3392
  // Clear out session storage and end the session so we can start fresh the next time
3395
- trigger(6 /* Check.Server */);
3393
+ trigger(6 /* Server */);
3396
3394
  break;
3397
- case "UPGRADE" /* Constant.Upgrade */:
3395
+ case "UPGRADE" /* Upgrade */:
3398
3396
  // Upgrade current session to send back playback information
3399
- upgrade("Auto" /* Constant.Auto */);
3397
+ upgrade("Auto" /* Auto */);
3398
+ break;
3399
+ case "ACTION" /* Action */:
3400
+ // Invoke action callback, if configured and has a valid value
3401
+ if (config$1.action && parts.length > 1) {
3402
+ config$1.action(parts[1]);
3403
+ }
3400
3404
  break;
3401
3405
  }
3402
3406
  }
@@ -3414,7 +3418,7 @@ function handler(error) {
3414
3418
  if (!(e.message in history$3)) {
3415
3419
  history$3[e.message] = 0;
3416
3420
  }
3417
- if (history$3[e.message]++ >= 5 /* Setting.ScriptErrorLimit */) {
3421
+ if (history$3[e.message]++ >= 5 /* ScriptErrorLimit */) {
3418
3422
  return true;
3419
3423
  }
3420
3424
  // Send back information only if the handled error has valid information
@@ -3426,7 +3430,7 @@ function handler(error) {
3426
3430
  stack: e.stack,
3427
3431
  source: error["filename"]
3428
3432
  };
3429
- encode$2(31 /* Event.ScriptError */);
3433
+ encode$2(31 /* ScriptError */);
3430
3434
  }
3431
3435
  return true;
3432
3436
  }
@@ -3437,7 +3441,7 @@ function encode$2 (type) {
3437
3441
  return __generator(this, function (_a) {
3438
3442
  tokens = [time(), type];
3439
3443
  switch (type) {
3440
- case 31 /* Event.ScriptError */:
3444
+ case 31 /* ScriptError */:
3441
3445
  tokens.push(data$7.message);
3442
3446
  tokens.push(data$7.line);
3443
3447
  tokens.push(data$7.column);
@@ -3445,7 +3449,7 @@ function encode$2 (type) {
3445
3449
  tokens.push(data$7.source);
3446
3450
  queue(tokens);
3447
3451
  break;
3448
- case 33 /* Event.Log */:
3452
+ case 33 /* Log */:
3449
3453
  if (data$6) {
3450
3454
  tokens.push(data$6.code);
3451
3455
  tokens.push(data$6.name);
@@ -3455,7 +3459,7 @@ function encode$2 (type) {
3455
3459
  queue(tokens, false);
3456
3460
  }
3457
3461
  break;
3458
- case 41 /* Event.Fraud */:
3462
+ case 41 /* Fraud */:
3459
3463
  if (data$d) {
3460
3464
  tokens.push(data$d.id);
3461
3465
  tokens.push(data$d.target);
@@ -3478,7 +3482,7 @@ function log$1(code, severity, name, message, stack) {
3478
3482
  if (name === void 0) { name = null; }
3479
3483
  if (message === void 0) { message = null; }
3480
3484
  if (stack === void 0) { stack = null; }
3481
- var key = name ? "".concat(name, "|").concat(message) : "";
3485
+ var key = name ? name + "|" + message : "";
3482
3486
  // While rare, it's possible for code to fail repeatedly during the lifetime of the same page
3483
3487
  // In those cases, we only want to log the failure once and not spam logs with redundant information.
3484
3488
  if (code in history$2 && history$2[code].indexOf(key) >= 0) {
@@ -3492,7 +3496,7 @@ function log$1(code, severity, name, message, stack) {
3492
3496
  else {
3493
3497
  history$2[code] = [key];
3494
3498
  }
3495
- encode$2(33 /* Event.Log */);
3499
+ encode$2(33 /* Log */);
3496
3500
  }
3497
3501
  function stop$c() {
3498
3502
  history$2 = {};
@@ -3513,25 +3517,25 @@ function start$c() {
3513
3517
  var source = e[i];
3514
3518
  var key = e[i + 1];
3515
3519
  switch (source) {
3516
- case 0 /* ExtractSource.Javascript */:
3520
+ case 0 /* Javascript */:
3517
3521
  var variable = e[i + 2];
3518
3522
  variables[key] = parse(variable);
3519
3523
  break;
3520
- case 1 /* ExtractSource.Cookie */:
3524
+ case 1 /* Cookie */:
3521
3525
  /*Todo: Add cookie extract logic*/
3522
3526
  break;
3523
- case 2 /* ExtractSource.Text */:
3527
+ case 2 /* Text */:
3524
3528
  var match_1 = e[i + 2];
3525
3529
  selectors[key] = match_1;
3526
3530
  break;
3527
- case 3 /* ExtractSource.Fragment */:
3531
+ case 3 /* Fragment */:
3528
3532
  fragments = e[i + 2];
3529
3533
  break;
3530
3534
  }
3531
3535
  }
3532
3536
  }
3533
3537
  catch (e) {
3534
- log$1(8 /* Code.Config */, 1 /* Severity.Warning */, e ? e.name : null);
3538
+ log$1(8 /* Config */, 1 /* Warning */, e ? e.name : null);
3535
3539
  }
3536
3540
  }
3537
3541
  function clone(v) {
@@ -3553,9 +3557,9 @@ function compute$4() {
3553
3557
  }
3554
3558
  }
3555
3559
  catch (e) {
3556
- log$1(5 /* Code.Selector */, 1 /* Severity.Warning */, e ? e.name : null);
3560
+ log$1(5 /* Selector */, 1 /* Warning */, e ? e.name : null);
3557
3561
  }
3558
- encode$1(40 /* Event.Extract */);
3562
+ encode$1(40 /* Extract */);
3559
3563
  }
3560
3564
  function reset$4() {
3561
3565
  keys = [];
@@ -3575,15 +3579,15 @@ function stop$b() {
3575
3579
  }
3576
3580
  function parse(variable) {
3577
3581
  var syntax = [];
3578
- var parts = variable.split("." /* Constant.Dot */);
3582
+ var parts = variable.split("." /* Dot */);
3579
3583
  while (parts.length > 0) {
3580
3584
  var part = parts.shift();
3581
- var arrayStart = part.indexOf("[" /* Constant.ArrayStart */);
3582
- var conditionStart = part.indexOf("{" /* Constant.ConditionStart */);
3583
- var conditionEnd = part.indexOf("}" /* Constant.ConditionEnd */);
3585
+ var arrayStart = part.indexOf("[" /* ArrayStart */);
3586
+ var conditionStart = part.indexOf("{" /* ConditionStart */);
3587
+ var conditionEnd = part.indexOf("}" /* ConditionEnd */);
3584
3588
  syntax.push({
3585
3589
  name: arrayStart > 0 ? part.substring(0, arrayStart) : (conditionStart > 0 ? part.substring(0, conditionStart) : part),
3586
- type: arrayStart > 0 ? 1 /* Type.Array */ : (conditionStart > 0 ? 2 /* Type.Object */ : 3 /* Type.Simple */),
3590
+ type: arrayStart > 0 ? 1 /* Array */ : (conditionStart > 0 ? 2 /* Object */ : 3 /* Simple */),
3587
3591
  condition: conditionStart > 0 ? part.substring(conditionStart + 1, conditionEnd) : null
3588
3592
  });
3589
3593
  }
@@ -3601,7 +3605,7 @@ function evaluate(variable, base) {
3601
3605
  var output;
3602
3606
  if (base && base[part.name]) {
3603
3607
  var obj = base[part.name];
3604
- if (part.type !== 1 /* Type.Array */ && match(obj, part.condition)) {
3608
+ if (part.type !== 1 /* Array */ && match(obj, part.condition)) {
3605
3609
  output = evaluate(variable, obj);
3606
3610
  }
3607
3611
  else if (Array.isArray(obj)) {
@@ -3623,7 +3627,7 @@ function evaluate(variable, base) {
3623
3627
  }
3624
3628
  function str(input) {
3625
3629
  // Automatically trim string to max of Setting.ExtractLimit to avoid fetching long strings
3626
- return input ? JSON.stringify(input).substring(0, 10000 /* Setting.ExtractLimit */) : input;
3630
+ return input ? JSON.stringify(input).substring(0, 10000 /* ExtractLimit */) : input;
3627
3631
  }
3628
3632
  function match(base, condition) {
3629
3633
  if (condition) {
@@ -3637,7 +3641,7 @@ function encode$1 (event) {
3637
3641
  var t = time();
3638
3642
  var tokens = [t, event];
3639
3643
  switch (event) {
3640
- case 4 /* Event.Baseline */:
3644
+ case 4 /* Baseline */:
3641
3645
  var b = state$9;
3642
3646
  if (b) {
3643
3647
  tokens = [b.time, b.event];
@@ -3655,30 +3659,30 @@ function encode$1 (event) {
3655
3659
  }
3656
3660
  reset$p();
3657
3661
  break;
3658
- case 25 /* Event.Ping */:
3662
+ case 25 /* Ping */:
3659
3663
  tokens.push(data$h.gap);
3660
3664
  queue(tokens);
3661
3665
  break;
3662
- case 35 /* Event.Limit */:
3666
+ case 35 /* Limit */:
3663
3667
  tokens.push(data$4.check);
3664
3668
  queue(tokens, false);
3665
3669
  break;
3666
- case 3 /* Event.Upgrade */:
3670
+ case 3 /* Upgrade */:
3667
3671
  tokens.push(data$f.key);
3668
3672
  queue(tokens);
3669
3673
  break;
3670
- case 2 /* Event.Upload */:
3674
+ case 2 /* Upload */:
3671
3675
  tokens.push(track$1.sequence);
3672
3676
  tokens.push(track$1.attempts);
3673
3677
  tokens.push(track$1.status);
3674
3678
  queue(tokens, false);
3675
3679
  break;
3676
- case 24 /* Event.Custom */:
3680
+ case 24 /* Custom */:
3677
3681
  tokens.push(data$j.key);
3678
3682
  tokens.push(data$j.value);
3679
3683
  queue(tokens);
3680
3684
  break;
3681
- case 34 /* Event.Variable */:
3685
+ case 34 /* Variable */:
3682
3686
  var variableKeys = Object.keys(data$e);
3683
3687
  if (variableKeys.length > 0) {
3684
3688
  for (var _i = 0, variableKeys_1 = variableKeys; _i < variableKeys_1.length; _i++) {
@@ -3690,7 +3694,7 @@ function encode$1 (event) {
3690
3694
  queue(tokens, false);
3691
3695
  }
3692
3696
  break;
3693
- case 0 /* Event.Metric */:
3697
+ case 0 /* Metric */:
3694
3698
  var metricKeys = Object.keys(updates$3);
3695
3699
  if (metricKeys.length > 0) {
3696
3700
  for (var _a = 0, metricKeys_1 = metricKeys; _a < metricKeys_1.length; _a++) {
@@ -3705,7 +3709,7 @@ function encode$1 (event) {
3705
3709
  queue(tokens, false);
3706
3710
  }
3707
3711
  break;
3708
- case 1 /* Event.Dimension */:
3712
+ case 1 /* Dimension */:
3709
3713
  var dimensionKeys = Object.keys(updates);
3710
3714
  if (dimensionKeys.length > 0) {
3711
3715
  for (var _b = 0, dimensionKeys_1 = dimensionKeys; _b < dimensionKeys_1.length; _b++) {
@@ -3718,7 +3722,7 @@ function encode$1 (event) {
3718
3722
  queue(tokens, false);
3719
3723
  }
3720
3724
  break;
3721
- case 36 /* Event.Summary */:
3725
+ case 36 /* Summary */:
3722
3726
  var eventKeys = Object.keys(data$g);
3723
3727
  if (eventKeys.length > 0) {
3724
3728
  for (var _c = 0, eventKeys_1 = eventKeys; _c < eventKeys_1.length; _c++) {
@@ -3731,7 +3735,7 @@ function encode$1 (event) {
3731
3735
  queue(tokens, false);
3732
3736
  }
3733
3737
  break;
3734
- case 40 /* Event.Extract */:
3738
+ case 40 /* Extract */:
3735
3739
  var extractKeys = keys;
3736
3740
  for (var _d = 0, extractKeys_1 = extractKeys; _d < extractKeys_1.length; _d++) {
3737
3741
  var e = extractKeys_1[_d];
@@ -3745,14 +3749,14 @@ function encode$1 (event) {
3745
3749
 
3746
3750
  var data$4;
3747
3751
  function start$b() {
3748
- data$4 = { check: 0 /* Check.None */ };
3752
+ data$4 = { check: 0 /* None */ };
3749
3753
  }
3750
3754
  function check$2(bytes) {
3751
- if (data$4.check === 0 /* Check.None */) {
3755
+ if (data$4.check === 0 /* None */) {
3752
3756
  var reason = data$4.check;
3753
- reason = data$1.sequence >= 128 /* Setting.PayloadLimit */ ? 1 /* Check.Payload */ : reason;
3754
- reason = time() > 7200000 /* Setting.ShutdownLimit */ ? 2 /* Check.Shutdown */ : reason;
3755
- reason = bytes > 10485760 /* Setting.PlaybackBytesLimit */ ? 2 /* Check.Shutdown */ : reason;
3757
+ reason = data$1.sequence >= 128 /* PayloadLimit */ ? 1 /* Payload */ : reason;
3758
+ reason = time() > 7200000 /* ShutdownLimit */ ? 2 /* Shutdown */ : reason;
3759
+ reason = bytes > 10485760 /* PlaybackBytesLimit */ ? 2 /* Shutdown */ : reason;
3756
3760
  if (reason !== data$4.check) {
3757
3761
  trigger(reason);
3758
3762
  }
@@ -3764,8 +3768,8 @@ function trigger(reason) {
3764
3768
  stop();
3765
3769
  }
3766
3770
  function compute$3() {
3767
- if (data$4.check !== 0 /* Check.None */) {
3768
- encode$1(35 /* Event.Limit */);
3771
+ if (data$4.check !== 0 /* None */) {
3772
+ encode$1(35 /* Limit */);
3769
3773
  }
3770
3774
  }
3771
3775
  function stop$a() {
@@ -3786,7 +3790,7 @@ function log(dimension, value) {
3786
3790
  // Check valid value before moving ahead
3787
3791
  if (value) {
3788
3792
  // Ensure received value is casted into a string if it wasn't a string to begin with
3789
- value = "".concat(value);
3793
+ value = "" + value;
3790
3794
  if (!(dimension in data$3)) {
3791
3795
  data$3[dimension] = [];
3792
3796
  }
@@ -3799,14 +3803,14 @@ function log(dimension, value) {
3799
3803
  }
3800
3804
  updates[dimension].push(value);
3801
3805
  // Limit check to ensure we have a cap on number of dimensions we can collect
3802
- if (data$3[dimension].length > 128 /* Setting.CollectionLimit */) {
3803
- trigger(5 /* Check.Collection */);
3806
+ if (data$3[dimension].length > 128 /* CollectionLimit */) {
3807
+ trigger(5 /* Collection */);
3804
3808
  }
3805
3809
  }
3806
3810
  }
3807
3811
  }
3808
3812
  function compute$2() {
3809
- encode$1(1 /* Event.Dimension */);
3813
+ encode$1(1 /* Dimension */);
3810
3814
  }
3811
3815
  function reset$3() {
3812
3816
  updates = {};
@@ -3817,8 +3821,8 @@ var callbacks = [];
3817
3821
  var rootDomain = null;
3818
3822
  function start$9() {
3819
3823
  rootDomain = null;
3820
- var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Constant.Empty */;
3821
- var title = document && document.title ? document.title : "" /* Constant.Empty */;
3824
+ var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Empty */;
3825
+ var title = document && document.title ? document.title : "" /* Empty */;
3822
3826
  // Populate ids for this page
3823
3827
  var s = session();
3824
3828
  var u = user();
@@ -3829,27 +3833,27 @@ function start$9() {
3829
3833
  pageNum: s.count
3830
3834
  };
3831
3835
  // Override configuration based on what's in the session storage, unless it is blank (e.g. using upload callback, like in devtools)
3832
- config$1.lean = config$1.track && s.upgrade !== null ? s.upgrade === 0 /* BooleanFlag.False */ : config$1.lean;
3833
- 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;
3836
+ config$1.lean = config$1.track && s.upgrade !== null ? s.upgrade === 0 /* False */ : config$1.lean;
3837
+ 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;
3834
3838
  // Log dimensions
3835
- log(0 /* Dimension.UserAgent */, ua);
3836
- log(3 /* Dimension.PageTitle */, title);
3837
- log(1 /* Dimension.Url */, location.href);
3838
- log(2 /* Dimension.Referrer */, document.referrer);
3839
- log(15 /* Dimension.TabId */, tab());
3840
- log(16 /* Dimension.PageLanguage */, document.documentElement.lang);
3841
- log(17 /* Dimension.DocumentDirection */, document.dir);
3839
+ log(0 /* UserAgent */, ua);
3840
+ log(3 /* PageTitle */, title);
3841
+ log(1 /* Url */, location.href);
3842
+ log(2 /* Referrer */, document.referrer);
3843
+ log(15 /* TabId */, tab());
3844
+ log(16 /* PageLanguage */, document.documentElement.lang);
3845
+ log(17 /* DocumentDirection */, document.dir);
3842
3846
  if (navigator) {
3843
- log(9 /* Dimension.Language */, navigator.userLanguage || navigator.language);
3847
+ log(9 /* Language */, navigator.userLanguage || navigator.language);
3844
3848
  userAgentData();
3845
3849
  }
3846
3850
  // Metrics
3847
- max(0 /* Metric.ClientTimestamp */, s.ts);
3848
- max(1 /* Metric.Playback */, 0 /* BooleanFlag.False */);
3851
+ max(0 /* ClientTimestamp */, s.ts);
3852
+ max(1 /* Playback */, 0 /* False */);
3849
3853
  if (screen) {
3850
- max(14 /* Metric.ScreenWidth */, Math.round(screen.width));
3851
- max(15 /* Metric.ScreenHeight */, Math.round(screen.height));
3852
- max(16 /* Metric.ColorDepth */, Math.round(screen.colorDepth));
3854
+ max(14 /* ScreenWidth */, Math.round(screen.width));
3855
+ max(15 /* ScreenHeight */, Math.round(screen.height));
3856
+ max(16 /* ColorDepth */, Math.round(screen.colorDepth));
3853
3857
  }
3854
3858
  // Read cookies specified in configuration
3855
3859
  for (var _i = 0, _a = config$1.cookies; _i < _a.length; _i++) {
@@ -3870,13 +3874,13 @@ function userAgentData() {
3870
3874
  "uaFullVersion"])
3871
3875
  .then(function (ua) {
3872
3876
  var _a;
3873
- log(22 /* Dimension.Platform */, ua.platform);
3874
- log(23 /* Dimension.PlatformVersion */, ua.platformVersion);
3877
+ log(22 /* Platform */, ua.platform);
3878
+ log(23 /* PlatformVersion */, ua.platformVersion);
3875
3879
  (_a = ua.brands) === null || _a === void 0 ? void 0 : _a.forEach(function (brand) {
3876
- log(24 /* Dimension.Brand */, brand.name + "~" /* Constant.Tilde */ + brand.version);
3880
+ log(24 /* Brand */, brand.name + "~" /* Tilde */ + brand.version);
3877
3881
  });
3878
- log(25 /* Dimension.Model */, ua.model);
3879
- max(27 /* Metric.Mobile */, ua.mobile ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
3882
+ log(25 /* Model */, ua.model);
3883
+ max(27 /* Mobile */, ua.mobile ? 1 /* True */ : 0 /* False */);
3880
3884
  });
3881
3885
  }
3882
3886
  }
@@ -3893,33 +3897,33 @@ function metadata(cb, wait) {
3893
3897
  callbacks.push({ callback: cb, wait: wait });
3894
3898
  }
3895
3899
  function id() {
3896
- return data$2 ? [data$2.userId, data$2.sessionId, data$2.pageNum].join("." /* Constant.Dot */) : "" /* Constant.Empty */;
3900
+ return data$2 ? [data$2.userId, data$2.sessionId, data$2.pageNum].join("." /* Dot */) : "" /* Empty */;
3897
3901
  }
3898
3902
  function consent() {
3899
3903
  if (active()) {
3900
3904
  config$1.track = true;
3901
- track(user(), 1 /* BooleanFlag.True */);
3905
+ track(user(), 1 /* True */);
3902
3906
  }
3903
3907
  }
3904
3908
  function clear() {
3905
3909
  // Clear any stored information in the cookie that tracks session information so we can restart fresh the next time
3906
- setCookie("_clsk" /* Constant.SessionKey */, "" /* Constant.Empty */, 0);
3910
+ setCookie("_clsk" /* SessionKey */, "" /* Empty */, 0);
3907
3911
  }
3908
3912
  function tab() {
3909
3913
  var id = shortid();
3910
- if (config$1.track && supported(window, "sessionStorage" /* Constant.SessionStorage */)) {
3911
- var value = sessionStorage.getItem("_cltk" /* Constant.TabKey */);
3914
+ if (config$1.track && supported(window, "sessionStorage" /* SessionStorage */)) {
3915
+ var value = sessionStorage.getItem("_cltk" /* TabKey */);
3912
3916
  id = value ? value : id;
3913
- sessionStorage.setItem("_cltk" /* Constant.TabKey */, id);
3917
+ sessionStorage.setItem("_cltk" /* TabKey */, id);
3914
3918
  }
3915
3919
  return id;
3916
3920
  }
3917
3921
  function save() {
3918
3922
  var ts = Math.round(Date.now());
3919
- var upload = config$1.upload && typeof config$1.upload === "string" /* Constant.String */ ? config$1.upload.replace("https://" /* Constant.HTTPS */, "" /* Constant.Empty */) : "" /* Constant.Empty */;
3920
- var upgrade = config$1.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
3923
+ var upload = config$1.upload && typeof config$1.upload === "string" /* String */ ? config$1.upload.replace("https://" /* HTTPS */, "" /* Empty */) : "" /* Empty */;
3924
+ var upgrade = config$1.lean ? 0 /* False */ : 1 /* True */;
3921
3925
  processCallback(upgrade);
3922
- setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Constant.Pipe */), 1 /* Setting.SessionExpire */);
3926
+ setCookie("_clsk" /* SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Pipe */), 1 /* SessionExpire */);
3923
3927
  }
3924
3928
  function processCallback(upgrade) {
3925
3929
  if (callbacks.length > 0) {
@@ -3944,10 +3948,10 @@ function track(u, consent) {
3944
3948
  consent = consent === null ? u.consent : consent;
3945
3949
  // Convert time precision into days to reduce number of bytes we have to write in a cookie
3946
3950
  // E.g. Math.ceil(1628735962643 / (24*60*60*1000)) => 18852 (days) => ejo in base36 (13 bytes => 3 bytes)
3947
- var end = Math.ceil((Date.now() + (365 /* Setting.Expire */ * 86400000 /* Time.Day */)) / 86400000 /* Time.Day */);
3951
+ var end = Math.ceil((Date.now() + (365 /* Expire */ * 86400000 /* Day */)) / 86400000 /* Day */);
3948
3952
  // To avoid cookie churn, write user id cookie only once every day
3949
- if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* Setting.CookieInterval */ || u.consent !== consent) {
3950
- setCookie("_clck" /* Constant.CookieKey */, [data$2.userId, 1 /* Setting.CookieVersion */, end.toString(36), consent].join("|" /* Constant.Pipe */), 365 /* Setting.Expire */);
3953
+ if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* CookieInterval */ || u.consent !== consent) {
3954
+ setCookie("_clck" /* CookieKey */, [data$2.userId, 1 /* CookieVersion */, end.toString(36), consent].join("|" /* Pipe */), 365 /* Expire */);
3951
3955
  }
3952
3956
  }
3953
3957
  function shortid() {
@@ -3958,17 +3962,17 @@ function shortid() {
3958
3962
  return id.toString(36);
3959
3963
  }
3960
3964
  function session() {
3961
- var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /* Constant.Empty */ };
3962
- var value = getCookie("_clsk" /* Constant.SessionKey */);
3965
+ var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /* Empty */ };
3966
+ var value = getCookie("_clsk" /* SessionKey */);
3963
3967
  if (value) {
3964
- var parts = value.split("|" /* Constant.Pipe */);
3968
+ var parts = value.split("|" /* Pipe */);
3965
3969
  // Making it backward & forward compatible by using greater than comparison (v0.6.21)
3966
3970
  // In future version, we can reduce the parts length to be 5 where the last part contains the full upload URL
3967
- if (parts.length >= 5 && output.ts - num(parts[1]) < 1800000 /* Setting.SessionTimeout */) {
3971
+ if (parts.length >= 5 && output.ts - num(parts[1]) < 1800000 /* SessionTimeout */) {
3968
3972
  output.session = parts[0];
3969
3973
  output.count = num(parts[2]) + 1;
3970
3974
  output.upgrade = num(parts[3]);
3971
- output.upload = parts.length >= 6 ? "".concat("https://" /* Constant.HTTPS */).concat(parts[5], "/").concat(parts[4]) : "".concat("https://" /* Constant.HTTPS */).concat(parts[4]);
3975
+ output.upload = parts.length >= 6 ? "" + "https://" /* HTTPS */ + parts[5] + "/" + parts[4] : "" + "https://" /* HTTPS */ + parts[4];
3972
3976
  }
3973
3977
  }
3974
3978
  return output;
@@ -3978,26 +3982,26 @@ function num(string, base) {
3978
3982
  return parseInt(string, base);
3979
3983
  }
3980
3984
  function user() {
3981
- var output = { id: shortid(), expiry: null, consent: 0 /* BooleanFlag.False */ };
3982
- var cookie = getCookie("_clck" /* Constant.CookieKey */);
3985
+ var output = { id: shortid(), expiry: null, consent: 0 /* False */ };
3986
+ var cookie = getCookie("_clck" /* CookieKey */);
3983
3987
  if (cookie && cookie.length > 0) {
3984
3988
  // Splitting and looking up first part for forward compatibility, in case we wish to store additional information in a cookie
3985
- var parts = cookie.split("|" /* Constant.Pipe */);
3989
+ var parts = cookie.split("|" /* Pipe */);
3986
3990
  // For backward compatibility introduced in v0.6.18; following code can be removed with future iterations
3987
3991
  // 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)
3988
3992
  var count = 0;
3989
- for (var _i = 0, _a = document.cookie.split(";" /* Constant.Semicolon */); _i < _a.length; _i++) {
3993
+ for (var _i = 0, _a = document.cookie.split(";" /* Semicolon */); _i < _a.length; _i++) {
3990
3994
  var c = _a[_i];
3991
- count += c.split("=" /* Constant.Equals */)[0].trim() === "_clck" /* Constant.CookieKey */ ? 1 : 0;
3995
+ count += c.split("=" /* Equals */)[0].trim() === "_clck" /* CookieKey */ ? 1 : 0;
3992
3996
  }
3993
3997
  // Check if we either got version-less cookie value or saw multiple copies of the user cookie crumbs
3994
3998
  // In both these cases, we go ahead and delete the existing cookie set on current domain
3995
3999
  if (parts.length === 1 || count > 1) {
3996
- var deleted = "".concat(";" /* Constant.Semicolon */).concat("expires=" /* Constant.Expires */).concat((new Date(0)).toUTCString()).concat(";path=/" /* Constant.Path */);
4000
+ var deleted = "" + ";" /* Semicolon */ + "expires=" /* Expires */ + (new Date(0)).toUTCString() + ";path=/" /* Path */;
3997
4001
  // First, delete current user cookie which might be set on current sub-domain vs. root domain
3998
- document.cookie = "".concat("_clck" /* Constant.CookieKey */, "=").concat(deleted);
4002
+ document.cookie = "_clck" /* CookieKey */ + "=" + deleted;
3999
4003
  // Second, same thing for current session cookie so it can be re-written later with the root domain
4000
- document.cookie = "".concat("_clsk" /* Constant.SessionKey */, "=").concat(deleted);
4004
+ document.cookie = "_clsk" /* SessionKey */ + "=" + deleted;
4001
4005
  }
4002
4006
  // End code for backward compatibility
4003
4007
  // Read version information and timestamp from cookie, if available
@@ -4006,21 +4010,21 @@ function user() {
4006
4010
  }
4007
4011
  // Check if we have explicit consent to track this user
4008
4012
  if (parts.length > 3 && num(parts[3]) === 1) {
4009
- output.consent = 1 /* BooleanFlag.True */;
4013
+ output.consent = 1 /* True */;
4010
4014
  }
4011
4015
  // Set track configuration to true for this user if we have explicit consent, regardless of project setting
4012
- config$1.track = config$1.track || output.consent === 1 /* BooleanFlag.True */;
4016
+ config$1.track = config$1.track || output.consent === 1 /* True */;
4013
4017
  // Get user id from cookie only if we tracking is enabled, otherwise fallback to a random id
4014
4018
  output.id = config$1.track ? parts[0] : output.id;
4015
4019
  }
4016
4020
  return output;
4017
4021
  }
4018
4022
  function getCookie(key) {
4019
- if (supported(document, "cookie" /* Constant.Cookie */)) {
4020
- var cookies = document.cookie.split(";" /* Constant.Semicolon */);
4023
+ if (supported(document, "cookie" /* Cookie */)) {
4024
+ var cookies = document.cookie.split(";" /* Semicolon */);
4021
4025
  if (cookies) {
4022
4026
  for (var i = 0; i < cookies.length; i++) {
4023
- var pair = cookies[i].split("=" /* Constant.Equals */);
4027
+ var pair = cookies[i].split("=" /* Equals */);
4024
4028
  if (pair.length > 1 && pair[0] && pair[0].trim() === key) {
4025
4029
  return pair[1];
4026
4030
  }
@@ -4030,23 +4034,23 @@ function getCookie(key) {
4030
4034
  return null;
4031
4035
  }
4032
4036
  function setCookie(key, value, time) {
4033
- if (config$1.track && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Constant.Cookie */))) {
4037
+ if (config$1.track && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Cookie */))) {
4034
4038
  var expiry = new Date();
4035
4039
  expiry.setDate(expiry.getDate() + time);
4036
- var expires = expiry ? "expires=" /* Constant.Expires */ + expiry.toUTCString() : "" /* Constant.Empty */;
4037
- var cookie = "".concat(key, "=").concat(value).concat(";" /* Constant.Semicolon */).concat(expires).concat(";path=/" /* Constant.Path */);
4040
+ var expires = expiry ? "expires=" /* Expires */ + expiry.toUTCString() : "" /* Empty */;
4041
+ var cookie = key + "=" + value + ";" /* Semicolon */ + expires + ";path=/" /* Path */;
4038
4042
  try {
4039
4043
  // Attempt to get the root domain only once and fall back to writing cookie on the current domain.
4040
4044
  if (rootDomain === null) {
4041
- var hostname = location.hostname ? location.hostname.split("." /* Constant.Dot */) : [];
4045
+ var hostname = location.hostname ? location.hostname.split("." /* Dot */) : [];
4042
4046
  // Walk backwards on a domain and attempt to set a cookie, until successful
4043
4047
  for (var i = hostname.length - 1; i >= 0; i--) {
4044
- rootDomain = ".".concat(hostname[i]).concat(rootDomain ? rootDomain : "" /* Constant.Empty */);
4048
+ rootDomain = "." + hostname[i] + (rootDomain ? rootDomain : "" /* Empty */);
4045
4049
  // We do not wish to attempt writing a cookie on the absolute last part of the domain, e.g. .com or .net.
4046
4050
  // So we start attempting after second-last part, e.g. .domain.com (PASS) or .co.uk (FAIL)
4047
4051
  if (i < hostname.length - 1) {
4048
4052
  // Write the cookie on the current computed top level domain
4049
- document.cookie = "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain);
4053
+ document.cookie = "" + cookie + ";" /* Semicolon */ + "domain=" /* Domain */ + rootDomain;
4050
4054
  // Once written, check if the cookie exists and its value matches exactly with what we intended to set
4051
4055
  // Checking for exact value match helps us eliminate a corner case where the cookie may already be present with a different value
4052
4056
  // If the check is successful, no more action is required and we can return from the function since rootDomain cookie is already set
@@ -4058,13 +4062,13 @@ function setCookie(key, value, time) {
4058
4062
  }
4059
4063
  // Finally, if we were not successful and gone through all the options, play it safe and reset rootDomain to be empty
4060
4064
  // This forces our code to fall back to always writing cookie to the current domain
4061
- rootDomain = "" /* Constant.Empty */;
4065
+ rootDomain = "" /* Empty */;
4062
4066
  }
4063
4067
  }
4064
4068
  catch (_a) {
4065
- rootDomain = "" /* Constant.Empty */;
4069
+ rootDomain = "" /* Empty */;
4066
4070
  }
4067
- document.cookie = rootDomain ? "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain) : cookie;
4071
+ document.cookie = rootDomain ? "" + cookie + ";" /* Semicolon */ + "domain=" /* Domain */ + rootDomain : cookie;
4068
4072
  }
4069
4073
  }
4070
4074
 
@@ -4080,8 +4084,8 @@ function start$8() {
4080
4084
  userId: m.userId,
4081
4085
  sessionId: m.sessionId,
4082
4086
  pageNum: m.pageNum,
4083
- upload: 0 /* Upload.Async */,
4084
- end: 0 /* BooleanFlag.False */
4087
+ upload: 0 /* Async */,
4088
+ end: 0 /* False */
4085
4089
  };
4086
4090
  }
4087
4091
  function stop$7() {
@@ -4091,8 +4095,8 @@ function envelope(last) {
4091
4095
  data$1.start = data$1.start + data$1.duration;
4092
4096
  data$1.duration = time() - data$1.start;
4093
4097
  data$1.sequence++;
4094
- data$1.upload = last && "sendBeacon" in navigator ? 1 /* Upload.Beacon */ : 0 /* Upload.Async */;
4095
- data$1.end = last ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
4098
+ data$1.upload = last && "sendBeacon" in navigator ? 1 /* Beacon */ : 0 /* Async */;
4099
+ data$1.end = last ? 1 /* True */ : 0 /* False */;
4096
4100
  return [
4097
4101
  data$1.version,
4098
4102
  data$1.sequence,
@@ -4145,10 +4149,10 @@ function measure (method) {
4145
4149
  throw report(ex);
4146
4150
  }
4147
4151
  var duration = performance.now() - start;
4148
- sum(4 /* Metric.TotalCost */, duration);
4149
- if (duration > 30 /* Setting.LongTask */) {
4150
- count$1(7 /* Metric.LongTaskCount */);
4151
- max(6 /* Metric.ThreadBlockedTime */, duration);
4152
+ sum(4 /* TotalCost */, duration);
4153
+ if (duration > 30 /* LongTask */) {
4154
+ count$1(7 /* LongTaskCount */);
4155
+ max(6 /* ThreadBlockedTime */, duration);
4152
4156
  }
4153
4157
  };
4154
4158
  }
@@ -4160,7 +4164,7 @@ function bind(target, event, listener, capture) {
4160
4164
  // Wrapping following lines inside try / catch to cover edge cases where we might try to access an inaccessible element.
4161
4165
  // E.g. Iframe may start off as same-origin but later turn into cross-origin, and the following lines will throw an exception.
4162
4166
  try {
4163
- target[api("addEventListener" /* Constant.AddEventListener */)](event, listener, capture);
4167
+ target[api("addEventListener" /* AddEventListener */)](event, listener, capture);
4164
4168
  bindings.push({ event: event, target: target, listener: listener, capture: capture });
4165
4169
  }
4166
4170
  catch ( /* do nothing */_a) { /* do nothing */ }
@@ -4171,7 +4175,7 @@ function reset$1() {
4171
4175
  var binding = bindings_1[_i];
4172
4176
  // Wrapping inside try / catch to avoid situations where the element may be destroyed before we get a chance to unbind
4173
4177
  try {
4174
- binding.target[api("removeEventListener" /* Constant.RemoveEventListener */)](binding.event, binding.listener, binding.capture);
4178
+ binding.target[api("removeEventListener" /* RemoveEventListener */)](binding.event, binding.listener, binding.capture);
4175
4179
  }
4176
4180
  catch ( /* do nothing */_a) { /* do nothing */ }
4177
4181
  }
@@ -4208,8 +4212,8 @@ function start$7() {
4208
4212
  }
4209
4213
  }
4210
4214
  function check$1() {
4211
- if (count++ > 20 /* Setting.CallStackDepth */) {
4212
- log$1(4 /* Code.CallStackDepth */, 0 /* Severity.Info */);
4215
+ if (count++ > 20 /* CallStackDepth */) {
4216
+ log$1(4 /* CallStackDepth */, 0 /* Info */);
4213
4217
  return false;
4214
4218
  }
4215
4219
  return true;
@@ -4219,15 +4223,15 @@ function compute$1() {
4219
4223
  if (url !== getCurrentUrl()) {
4220
4224
  // If the url changed, start tracking it as a new page
4221
4225
  stop();
4222
- window.setTimeout(restart$1, 250 /* Setting.RestartDelay */);
4226
+ window.setTimeout(restart$1, 250 /* RestartDelay */);
4223
4227
  }
4224
4228
  }
4225
4229
  function restart$1() {
4226
4230
  start();
4227
- max(29 /* Metric.SinglePage */, 1 /* BooleanFlag.True */);
4231
+ max(29 /* SinglePage */, 1 /* True */);
4228
4232
  }
4229
4233
  function getCurrentUrl() {
4230
- return location.href ? location.href.replace(location.hash, "" /* Constant.Empty */) : location.href;
4234
+ return location.href ? location.href.replace(location.hash, "" /* Empty */) : location.href;
4231
4235
  }
4232
4236
  function stop$6() {
4233
4237
  url = null;
@@ -4290,7 +4294,7 @@ function config(override) {
4290
4294
  // not holding the session during inactive time periods.
4291
4295
  function suspend() {
4292
4296
  if (status) {
4293
- event("clarity" /* Constant.Clarity */, "suspend" /* Constant.Suspend */);
4297
+ event("clarity" /* Clarity */, "suspend" /* Suspend */);
4294
4298
  stop();
4295
4299
  ["mousemove", "touchstart"].forEach(function (x) { return bind(document, x, restart); });
4296
4300
  ["resize", "scroll", "pageshow"].forEach(function (x) { return bind(window, x, restart); });
@@ -4298,7 +4302,7 @@ function suspend() {
4298
4302
  }
4299
4303
  function restart() {
4300
4304
  start();
4301
- event("clarity" /* Constant.Clarity */, "restart" /* Constant.Restart */);
4305
+ event("clarity" /* Clarity */, "restart" /* Restart */);
4302
4306
  }
4303
4307
 
4304
4308
  function start$5() {
@@ -4317,7 +4321,7 @@ var diagnostic = /*#__PURE__*/Object.freeze({
4317
4321
  });
4318
4322
 
4319
4323
  function start$4() {
4320
- schedule$1(discover, 1 /* Priority.High */).then(function () {
4324
+ schedule$1(discover, 1 /* High */).then(function () {
4321
4325
  measure(compute$7)();
4322
4326
  measure(compute$6)();
4323
4327
  });
@@ -4329,12 +4333,12 @@ function discover() {
4329
4333
  switch (_a.label) {
4330
4334
  case 0:
4331
4335
  ts = time();
4332
- timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
4336
+ timer = { id: id(), cost: 3 /* LayoutCost */ };
4333
4337
  start$w(timer);
4334
- return [4 /*yield*/, traverse(document, timer, 0 /* Source.Discover */)];
4338
+ return [4 /*yield*/, traverse(document, timer, 0 /* Discover */)];
4335
4339
  case 1:
4336
4340
  _a.sent();
4337
- return [4 /*yield*/, encode$4(5 /* Event.Discover */, timer, ts)];
4341
+ return [4 /*yield*/, encode$4(5 /* Discover */, timer, ts)];
4338
4342
  case 2:
4339
4343
  _a.sent();
4340
4344
  stop$t(timer);
@@ -4373,7 +4377,7 @@ function encode (type) {
4373
4377
  t = time();
4374
4378
  tokens = [t, type];
4375
4379
  switch (type) {
4376
- case 29 /* Event.Navigation */:
4380
+ case 29 /* Navigation */:
4377
4381
  tokens.push(data.fetchStart);
4378
4382
  tokens.push(data.connectStart);
4379
4383
  tokens.push(data.connectEnd);
@@ -4422,11 +4426,11 @@ function compute(entry) {
4422
4426
  encodedSize: entry.encodedBodySize ? entry.encodedBodySize : 0,
4423
4427
  decodedSize: entry.decodedBodySize ? entry.decodedBodySize : 0
4424
4428
  };
4425
- encode(29 /* Event.Navigation */);
4429
+ encode(29 /* Navigation */);
4426
4430
  }
4427
4431
 
4428
4432
  var observer;
4429
- var types = ["navigation" /* Constant.Navigation */, "resource" /* Constant.Resource */, "longtask" /* Constant.LongTask */, "first-input" /* Constant.FID */, "layout-shift" /* Constant.CLS */, "largest-contentful-paint" /* Constant.LCP */];
4433
+ var types = ["navigation" /* Navigation */, "resource" /* Resource */, "longtask" /* LongTask */, "first-input" /* FID */, "layout-shift" /* CLS */, "largest-contentful-paint" /* LCP */];
4430
4434
  function start$2() {
4431
4435
  // Check the browser support performance observer as a pre-requisite for any performance measurement
4432
4436
  if (window["PerformanceObserver"] && PerformanceObserver.supportedEntryTypes) {
@@ -4441,7 +4445,7 @@ function start$2() {
4441
4445
  }
4442
4446
  }
4443
4447
  else {
4444
- log$1(3 /* Code.PerformanceObserver */, 0 /* Severity.Info */);
4448
+ log$1(3 /* PerformanceObserver */, 0 /* Info */);
4445
4449
  }
4446
4450
  }
4447
4451
  function observe() {
@@ -4461,15 +4465,15 @@ function observe() {
4461
4465
  if (PerformanceObserver.supportedEntryTypes.indexOf(x) >= 0) {
4462
4466
  // Initialize CLS with a value of zero. It's possible (and recommended) for sites to not have any cumulative layout shift.
4463
4467
  // In those cases, we want to still initialize the metric in Clarity
4464
- if (x === "layout-shift" /* Constant.CLS */) {
4465
- sum(9 /* Metric.CumulativeLayoutShift */, 0);
4468
+ if (x === "layout-shift" /* CLS */) {
4469
+ sum(9 /* CumulativeLayoutShift */, 0);
4466
4470
  }
4467
4471
  observer.observe({ type: x, buffered: true });
4468
4472
  }
4469
4473
  }
4470
4474
  }
4471
4475
  catch (_a) {
4472
- log$1(3 /* Code.PerformanceObserver */, 1 /* Severity.Warning */);
4476
+ log$1(3 /* PerformanceObserver */, 1 /* Warning */);
4473
4477
  }
4474
4478
  }
4475
4479
  function handle(entries) {
@@ -4480,41 +4484,41 @@ function process(entries) {
4480
4484
  for (var i = 0; i < entries.length; i++) {
4481
4485
  var entry = entries[i];
4482
4486
  switch (entry.entryType) {
4483
- case "navigation" /* Constant.Navigation */:
4487
+ case "navigation" /* Navigation */:
4484
4488
  compute(entry);
4485
4489
  break;
4486
- case "resource" /* Constant.Resource */:
4490
+ case "resource" /* Resource */:
4487
4491
  var name_1 = entry.name;
4488
- log(4 /* Dimension.NetworkHosts */, host(name_1));
4492
+ log(4 /* NetworkHosts */, host(name_1));
4489
4493
  if (name_1 === config$1.upload || name_1 === config$1.fallback) {
4490
- max(28 /* Metric.UploadTime */, entry.duration);
4494
+ max(28 /* UploadTime */, entry.duration);
4491
4495
  }
4492
4496
  break;
4493
- case "longtask" /* Constant.LongTask */:
4494
- count$1(7 /* Metric.LongTaskCount */);
4497
+ case "longtask" /* LongTask */:
4498
+ count$1(7 /* LongTaskCount */);
4495
4499
  break;
4496
- case "first-input" /* Constant.FID */:
4500
+ case "first-input" /* FID */:
4497
4501
  if (visible) {
4498
- max(10 /* Metric.FirstInputDelay */, entry["processingStart"] - entry.startTime);
4502
+ max(10 /* FirstInputDelay */, entry["processingStart"] - entry.startTime);
4499
4503
  }
4500
4504
  break;
4501
- case "layout-shift" /* Constant.CLS */:
4505
+ case "layout-shift" /* CLS */:
4502
4506
  // Scale the value to avoid sending back floating point number
4503
4507
  if (visible && !entry["hadRecentInput"]) {
4504
- sum(9 /* Metric.CumulativeLayoutShift */, entry["value"] * 1000);
4508
+ sum(9 /* CumulativeLayoutShift */, entry["value"] * 1000);
4505
4509
  }
4506
4510
  break;
4507
- case "largest-contentful-paint" /* Constant.LCP */:
4511
+ case "largest-contentful-paint" /* LCP */:
4508
4512
  if (visible) {
4509
- max(8 /* Metric.LargestPaint */, entry.startTime);
4513
+ max(8 /* LargestPaint */, entry.startTime);
4510
4514
  }
4511
4515
  break;
4512
4516
  }
4513
4517
  }
4514
- if (performance && "memory" /* Constant.Memory */ in performance && performance["memory" /* Constant.Memory */].usedJSHeapSize) {
4518
+ if (performance && "memory" /* Memory */ in performance && performance["memory" /* Memory */].usedJSHeapSize) {
4515
4519
  // Track consumed memory (MBs) where "memory" API is available
4516
4520
  // Reference: https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory
4517
- max(30 /* Metric.UsedMemory */, Math.abs(performance["memory" /* Constant.Memory */].usedJSHeapSize / 1048576 /* Setting.MegaByte */));
4521
+ max(30 /* UsedMemory */, Math.abs(performance["memory" /* Memory */].usedJSHeapSize / 1048576 /* MegaByte */));
4518
4522
  }
4519
4523
  }
4520
4524
  function stop$2() {
@@ -4562,7 +4566,7 @@ function start(config$1) {
4562
4566
  // performance impact even further. For reference, we are talking single digit milliseconds optimization here, not seconds.
4563
4567
  function pause() {
4564
4568
  if (active()) {
4565
- event("clarity" /* Constant.Clarity */, "pause" /* Constant.Pause */);
4569
+ event("clarity" /* Clarity */, "pause" /* Pause */);
4566
4570
  pause$1();
4567
4571
  }
4568
4572
  }
@@ -4570,7 +4574,7 @@ function pause() {
4570
4574
  function resume() {
4571
4575
  if (active()) {
4572
4576
  resume$1();
4573
- event("clarity" /* Constant.Clarity */, "resume" /* Constant.Resume */);
4577
+ event("clarity" /* Clarity */, "resume" /* Resume */);
4574
4578
  }
4575
4579
  }
4576
4580
  function stop() {