clarity-js 0.6.42 → 0.6.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,6 +8,7 @@ var dom = /*#__PURE__*/Object.freeze({
8
8
  get update () { return update$1; },
9
9
  get sameorigin () { return sameorigin; },
10
10
  get iframe () { return iframe; },
11
+ get hashText () { return hashText; },
11
12
  get getNode () { return getNode; },
12
13
  get getValue () { return getValue; },
13
14
  get get () { return get; },
@@ -75,7 +76,7 @@ var envelope$1 = /*#__PURE__*/Object.freeze({
75
76
 
76
77
  var config$1 = {
77
78
  projectId: null,
78
- delay: 1 * 1000 /* Second */,
79
+ delay: 1 * 1000 /* Time.Second */,
79
80
  lean: false,
80
81
  track: true,
81
82
  content: true,
@@ -96,7 +97,7 @@ function api(method) {
96
97
  // Zone.js, a popular package for Angular, overrides native browser APIs which can lead to inconsistent state for single page applications.
97
98
  // Example issue: https://github.com/angular/angular/issues/31712
98
99
  // As a work around, we ensuring Clarity access APIs outside of Zone (and use native implementation instead)
99
- return window["Zone" /* Zone */] && "__symbol__" /* Symbol */ in window["Zone" /* Zone */] ? window["Zone" /* Zone */]["__symbol__" /* Symbol */](method) : method;
100
+ return window["Zone" /* Constant.Zone */] && "__symbol__" /* Constant.Symbol */ in window["Zone" /* Constant.Zone */] ? window["Zone" /* Constant.Zone */]["__symbol__" /* Constant.Symbol */](method) : method;
100
101
  }
101
102
 
102
103
  var startTime = 0;
@@ -112,7 +113,7 @@ function stop$B() {
112
113
  startTime = 0;
113
114
  }
114
115
 
115
- var version$1 = "0.6.42";
116
+ var version$1 = "0.6.43";
116
117
 
117
118
  // tslint:disable: no-bitwise
118
119
  function hash (input) {
@@ -145,7 +146,7 @@ function reset$p() {
145
146
  // Baseline state holds the previous values - if it is updated in the current payload,
146
147
  // reset the state to current value after sending the previous state
147
148
  if (update$2) {
148
- state$9 = { time: time(), event: 4 /* Baseline */, data: {
149
+ state$9 = { time: time(), event: 4 /* Event.Baseline */, data: {
149
150
  visible: buffer.visible,
150
151
  docWidth: buffer.docWidth,
151
152
  docHeight: buffer.docHeight,
@@ -160,7 +161,7 @@ function reset$p() {
160
161
  };
161
162
  }
162
163
  buffer = buffer ? buffer : {
163
- visible: 1 /* True */,
164
+ visible: 1 /* BooleanFlag.True */,
164
165
  docWidth: 0,
165
166
  docHeight: 0,
166
167
  screenWidth: 0,
@@ -174,15 +175,15 @@ function reset$p() {
174
175
  }
175
176
  function track$7(event, x, y) {
176
177
  switch (event) {
177
- case 8 /* Document */:
178
+ case 8 /* Event.Document */:
178
179
  buffer.docWidth = x;
179
180
  buffer.docHeight = y;
180
181
  break;
181
- case 11 /* Resize */:
182
+ case 11 /* Event.Resize */:
182
183
  buffer.screenWidth = x;
183
184
  buffer.screenHeight = y;
184
185
  break;
185
- case 10 /* Scroll */:
186
+ case 10 /* Event.Scroll */:
186
187
  buffer.scrollX = x;
187
188
  buffer.scrollY = y;
188
189
  break;
@@ -197,7 +198,7 @@ function activity(t) {
197
198
  buffer.activityTime = t;
198
199
  }
199
200
  function visibility(t, visible) {
200
- buffer.visible = visible === "visible" ? 1 /* True */ : 0 /* False */;
201
+ buffer.visible = visible === "visible" ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
201
202
  if (!buffer.visible) {
202
203
  activity(t);
203
204
  }
@@ -205,7 +206,7 @@ function visibility(t, visible) {
205
206
  }
206
207
  function compute$c() {
207
208
  if (update$2) {
208
- encode$1(4 /* Baseline */);
209
+ encode$1(4 /* Event.Baseline */);
209
210
  }
210
211
  }
211
212
  function stop$A() {
@@ -229,12 +230,12 @@ function event(key, value) {
229
230
  if (active() &&
230
231
  key &&
231
232
  value &&
232
- typeof key === "string" /* String */ &&
233
- typeof value === "string" /* String */ &&
233
+ typeof key === "string" /* Constant.String */ &&
234
+ typeof value === "string" /* Constant.String */ &&
234
235
  key.length < 255 &&
235
236
  value.length < 255) {
236
237
  data$j = { key: key, value: value };
237
- encode$1(24 /* Custom */);
238
+ encode$1(24 /* Event.Custom */);
238
239
  }
239
240
  }
240
241
 
@@ -243,7 +244,7 @@ var updates$3 = null;
243
244
  function start$D() {
244
245
  data$i = {};
245
246
  updates$3 = {};
246
- count$1(5 /* InvokeCount */);
247
+ count$1(5 /* Metric.InvokeCount */);
247
248
  }
248
249
  function stop$z() {
249
250
  data$i = {};
@@ -284,7 +285,7 @@ function max(metric, value) {
284
285
  }
285
286
  }
286
287
  function compute$b() {
287
- encode$1(0 /* Metric */);
288
+ encode$1(0 /* Event.Metric */);
288
289
  }
289
290
  function reset$o() {
290
291
  updates$3 = {};
@@ -302,7 +303,7 @@ var last = 0;
302
303
  var interval = 0;
303
304
  var timeout$6 = null;
304
305
  function start$C() {
305
- interval = 60000 /* PingInterval */;
306
+ interval = 60000 /* Setting.PingInterval */;
306
307
  last = 0;
307
308
  }
308
309
  function reset$n() {
@@ -315,8 +316,8 @@ function reset$n() {
315
316
  function ping() {
316
317
  var now = time();
317
318
  data$h = { gap: now - last };
318
- encode$1(25 /* Ping */);
319
- if (data$h.gap < 300000 /* PingTimeout */) {
319
+ encode$1(25 /* Event.Ping */);
320
+ if (data$h.gap < 300000 /* Setting.PingTimeout */) {
320
321
  timeout$6 = setTimeout(ping, interval);
321
322
  }
322
323
  else {
@@ -353,7 +354,7 @@ function track$6(event, time) {
353
354
  var last = e[e.length - 1];
354
355
  // Add a new entry only if the new event occurs after configured interval
355
356
  // Otherwise, extend the duration of the previous entry
356
- if (time - last[0] > 100 /* SummaryInterval */) {
357
+ if (time - last[0] > 100 /* Setting.SummaryInterval */) {
357
358
  data$g[event].push([time, 0]);
358
359
  }
359
360
  else {
@@ -362,7 +363,7 @@ function track$6(event, time) {
362
363
  }
363
364
  }
364
365
  function compute$a() {
365
- encode$1(36 /* Summary */);
366
+ encode$1(36 /* Event.Summary */);
366
367
  }
367
368
  function reset$m() {
368
369
  data$g = {};
@@ -381,7 +382,7 @@ var summary = /*#__PURE__*/Object.freeze({
381
382
  var data$f = null;
382
383
  function start$A() {
383
384
  if (!config$1.lean && config$1.upgrade) {
384
- config$1.upgrade("Config" /* Config */);
385
+ config$1.upgrade("Config" /* Constant.Config */);
385
386
  }
386
387
  data$f = null;
387
388
  }
@@ -400,7 +401,7 @@ function upgrade(key) {
400
401
  if (config$1.upgrade) {
401
402
  config$1.upgrade(key);
402
403
  }
403
- encode$1(3 /* Upgrade */);
404
+ encode$1(3 /* Event.Upgrade */);
404
405
  }
405
406
  }
406
407
  function stop$w() {
@@ -420,25 +421,25 @@ function start$z() {
420
421
  reset$l();
421
422
  }
422
423
  function set(variable, value) {
423
- var values = typeof value === "string" /* String */ ? [value] : value;
424
+ var values = typeof value === "string" /* Constant.String */ ? [value] : value;
424
425
  log$2(variable, values);
425
426
  }
426
427
  function identify(userId, sessionId, pageId) {
427
428
  if (sessionId === void 0) { sessionId = null; }
428
429
  if (pageId === void 0) { pageId = null; }
429
- log$2("userId" /* UserId */, [userId]);
430
- log$2("sessionId" /* SessionId */, [sessionId]);
431
- log$2("pageId" /* PageId */, [pageId]);
430
+ log$2("userId" /* Constant.UserId */, [userId]);
431
+ log$2("sessionId" /* Constant.SessionId */, [sessionId]);
432
+ log$2("pageId" /* Constant.PageId */, [pageId]);
432
433
  }
433
434
  function log$2(variable, value) {
434
435
  if (active() &&
435
436
  variable &&
436
437
  value &&
437
- typeof variable === "string" /* String */ &&
438
+ typeof variable === "string" /* Constant.String */ &&
438
439
  variable.length < 255) {
439
440
  var validValues = variable in data$e ? data$e[variable] : [];
440
441
  for (var i = 0; i < value.length; i++) {
441
- if (typeof value[i] === "string" /* String */ && value[i].length < 255) {
442
+ if (typeof value[i] === "string" /* Constant.String */ && value[i].length < 255) {
442
443
  validValues.push(value[i]);
443
444
  }
444
445
  }
@@ -446,7 +447,7 @@ function log$2(variable, value) {
446
447
  }
447
448
  }
448
449
  function compute$9() {
449
- encode$1(34 /* Variable */);
450
+ encode$1(34 /* Event.Variable */);
450
451
  }
451
452
  function reset$l() {
452
453
  data$e = {};
@@ -466,7 +467,7 @@ var variable = /*#__PURE__*/Object.freeze({
466
467
  stop: stop$v
467
468
  });
468
469
 
469
- /*! *****************************************************************************
470
+ /******************************************************************************
470
471
  Copyright (c) Microsoft Corporation.
471
472
 
472
473
  Permission to use, copy, modify, and/or distribute this software for any
@@ -519,7 +520,7 @@ function __generator(thisArg, body) {
519
520
  }
520
521
  }
521
522
 
522
- var supported$1 = "CompressionStream" /* CompressionStream */ in window;
523
+ var supported$1 = "CompressionStream" /* Constant.CompressionStream */ in window;
523
524
  function compress (input) {
524
525
  return __awaiter(this, void 0, void 0, function () {
525
526
  var stream, _a;
@@ -536,7 +537,7 @@ function compress (input) {
536
537
  return [2 /*return*/];
537
538
  });
538
539
  });
539
- } }).pipeThrough(new TextEncoderStream()).pipeThrough(new window["CompressionStream" /* CompressionStream */]("gzip"));
540
+ } }).pipeThrough(new TextEncoderStream()).pipeThrough(new window["CompressionStream" /* Constant.CompressionStream */]("gzip"));
540
541
  _a = Uint8Array.bind;
541
542
  return [4 /*yield*/, read(stream)];
542
543
  case 1: return [2 /*return*/, new (_a.apply(Uint8Array, [void 0, _c.sent()]))()];
@@ -610,11 +611,11 @@ function scrub (value, hint, privacy, mangle) {
610
611
  if (mangle === void 0) { mangle = false; }
611
612
  if (value) {
612
613
  switch (privacy) {
613
- case 0 /* None */:
614
+ case 0 /* Privacy.None */:
614
615
  return value;
615
- case 1 /* Sensitive */:
616
+ case 1 /* Privacy.Sensitive */:
616
617
  switch (hint) {
617
- case "*T" /* TextTag */:
618
+ case "*T" /* Layout.Constant.TextTag */:
618
619
  case "value":
619
620
  case "placeholder":
620
621
  case "click":
@@ -622,16 +623,16 @@ function scrub (value, hint, privacy, mangle) {
622
623
  return redact(value);
623
624
  }
624
625
  return value;
625
- case 2 /* Text */:
626
- case 3 /* TextImage */:
626
+ case 2 /* Privacy.Text */:
627
+ case 3 /* Privacy.TextImage */:
627
628
  switch (hint) {
628
- case "*T" /* TextTag */:
629
+ case "*T" /* Layout.Constant.TextTag */:
629
630
  return mangle ? mangleText(value) : mask(value);
630
631
  case "src":
631
632
  case "srcset":
632
633
  case "title":
633
634
  case "alt":
634
- return privacy === 3 /* TextImage */ ? "" /* Empty */ : value;
635
+ return privacy === 3 /* Privacy.TextImage */ ? "" /* Data.Constant.Empty */ : value;
635
636
  case "value":
636
637
  case "click":
637
638
  case "input":
@@ -651,18 +652,18 @@ function mangleText(value) {
651
652
  var index = value.indexOf(first);
652
653
  var prefix = value.substr(0, index);
653
654
  var suffix = value.substr(index + trimmed.length);
654
- return "" + prefix + trimmed.length.toString(36) + suffix;
655
+ return "".concat(prefix).concat(trimmed.length.toString(36)).concat(suffix);
655
656
  }
656
657
  return value;
657
658
  }
658
659
  function mask(value) {
659
- return value.replace(catchallRegex, "\u2022" /* Mask */);
660
+ return value.replace(catchallRegex, "\u2022" /* Data.Constant.Mask */);
660
661
  }
661
662
  function mangleToken(value) {
662
- var length = ((Math.floor(value.length / 5 /* WordLength */) + 1) * 5 /* WordLength */);
663
- var output = "" /* Empty */;
663
+ var length = ((Math.floor(value.length / 5 /* Data.Setting.WordLength */) + 1) * 5 /* Data.Setting.WordLength */);
664
+ var output = "" /* Layout.Constant.Empty */;
664
665
  for (var i = 0; i < length; i++) {
665
- output += i > 0 && i % 5 /* WordLength */ === 0 ? " " /* Space */ : "\u2022" /* Mask */;
666
+ output += i > 0 && i % 5 /* Data.Setting.WordLength */ === 0 ? " " /* Data.Constant.Space */ : "\u2022" /* Data.Constant.Mask */;
666
667
  }
667
668
  return output;
668
669
  }
@@ -687,22 +688,22 @@ function redact(value) {
687
688
  }
688
689
  for (var i = 0; i < value.length; i++) {
689
690
  var c = value.charCodeAt(i);
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 */;
691
+ hasDigit = hasDigit || (c >= 48 /* Data.Character.Zero */ && c <= 57 /* Data.Character.Nine */); // Check for digits in the current word
692
+ hasEmail = hasEmail || c === 64 /* Data.Character.At */; // Check for @ sign anywhere within the current word
693
+ hasWhitespace = c === 9 /* Data.Character.Tab */ || c === 10 /* Data.Character.NewLine */ || c === 13 /* Data.Character.Return */ || c === 32 /* Data.Character.Blank */;
693
694
  // Process each word as an individual token to redact any sensitive information
694
695
  if (i === 0 || i === value.length - 1 || hasWhitespace) {
695
696
  // Performance optimization: Lazy load string -> array conversion only when required
696
697
  if (hasDigit || hasEmail) {
697
698
  if (array === null) {
698
- array = value.split("" /* Empty */);
699
+ array = value.split("" /* Data.Constant.Empty */);
699
700
  }
700
701
  // Work on a token at a time so we don't have to apply regex to a larger string
701
702
  var token = value.substring(spaceIndex + 1, hasWhitespace ? i : i + 1);
702
703
  // Check if unicode regex is supported, otherwise fallback to calling mask function on this token
703
704
  if (unicodeRegex && currencyRegex !== null) {
704
705
  // Do not redact information if the token contains a currency symbol
705
- token = token.match(currencyRegex) ? token : token.replace(letterRegex, "\u25AA" /* Letter */).replace(digitRegex, "\u25AB" /* Digit */);
706
+ token = token.match(currencyRegex) ? token : token.replace(letterRegex, "\u25AA" /* Data.Constant.Letter */).replace(digitRegex, "\u25AB" /* Data.Constant.Digit */);
706
707
  }
707
708
  else {
708
709
  token = mask(token);
@@ -719,28 +720,34 @@ function redact(value) {
719
720
  }
720
721
  }
721
722
  }
722
- return array ? array.join("" /* Empty */) : value;
723
+ return array ? array.join("" /* Data.Constant.Empty */) : value;
723
724
  }
724
725
 
725
726
  var history$5 = [];
726
727
  var data$d;
727
728
  function start$x() {
728
729
  history$5 = [];
729
- max(26 /* Automation */, navigator.webdriver ? 1 /* True */ : 0 /* False */);
730
+ max(26 /* Metric.Automation */, navigator.webdriver ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
731
+ try {
732
+ max(31 /* Metric.Iframed */, window.top == window.self ? 1 /* IframeStatus.TopFrame */ : 2 /* IframeStatus.Iframe */);
733
+ }
734
+ catch (ex) {
735
+ max(31 /* Metric.Iframed */, 0 /* IframeStatus.Unknown */);
736
+ }
730
737
  }
731
738
  function check$4(id, target, input) {
732
739
  // Compute hash for fraud detection. Hash is computed only if input meets the minimum length criteria
733
- if (id !== null && input && input.length >= 5 /* WordLength */) {
740
+ if (id !== null && input && input.length >= 5 /* Setting.WordLength */) {
734
741
  data$d = { id: id, target: target, hash: hash(input) };
735
742
  // Only encode this event if we haven't already reported this hash
736
743
  if (history$5.indexOf(data$d.hash) < 0) {
737
744
  history$5.push(data$d.hash);
738
- encode$2(41 /* Fraud */);
745
+ encode$2(41 /* Event.Fraud */);
739
746
  }
740
747
  }
741
748
  }
742
749
 
743
- var excludeClassNames = "load,active,fixed,visible,focus,show,collaps,animat" /* ExcludeClassNames */.split("," /* Comma */);
750
+ var excludeClassNames = "load,active,fixed,visible,focus,show,collaps,animat" /* Constant.ExcludeClassNames */.split("," /* Constant.Comma */);
744
751
  var selectorMap = {};
745
752
  function reset$k() {
746
753
  selectorMap = {};
@@ -748,68 +755,68 @@ function reset$k() {
748
755
  function get$1(input, type) {
749
756
  var a = input.attributes;
750
757
  var prefix = input.prefix ? input.prefix[type] : null;
751
- var suffix = type === 0 /* Alpha */ ? "" + "~" /* Tilde */ + (input.position - 1) : ":nth-of-type(" + input.position + ")";
758
+ var suffix = type === 0 /* Selector.Alpha */ ? "".concat("~" /* Constant.Tilde */).concat(input.position - 1) : ":nth-of-type(".concat(input.position, ")");
752
759
  switch (input.tag) {
753
760
  case "STYLE":
754
761
  case "TITLE":
755
762
  case "LINK":
756
763
  case "META":
757
- case "*T" /* TextTag */:
758
- case "*D" /* DocumentTag */:
759
- return "" /* Empty */;
764
+ case "*T" /* Constant.TextTag */:
765
+ case "*D" /* Constant.DocumentTag */:
766
+ return "" /* Constant.Empty */;
760
767
  case "HTML":
761
- return "HTML" /* HTML */;
768
+ return "HTML" /* Constant.HTML */;
762
769
  default:
763
770
  if (prefix === null) {
764
- return "" /* Empty */;
771
+ return "" /* Constant.Empty */;
765
772
  }
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;
773
+ prefix = "".concat(prefix).concat(">" /* Constant.Separator */);
774
+ input.tag = input.tag.indexOf("svg:" /* Constant.SvgPrefix */) === 0 ? input.tag.substr("svg:" /* Constant.SvgPrefix */.length) : input.tag;
775
+ var selector = "".concat(prefix).concat(input.tag).concat(suffix);
776
+ var id = "id" /* Constant.Id */ in a && a["id" /* Constant.Id */].length > 0 ? a["id" /* Constant.Id */] : null;
777
+ 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;
771
778
  if (classes && classes.length > 0) {
772
- if (type === 0 /* Alpha */) {
779
+ if (type === 0 /* Selector.Alpha */) {
773
780
  // In Alpha mode, update selector to use class names, with relative positioning within the parent id container.
774
781
  // If the node has valid class name(s) then drop relative positioning within the parent path to keep things simple.
775
- var key = "" + getDomPath(prefix) + input.tag + "." /* Dot */ + classes;
782
+ var key = "".concat(getDomPath(prefix)).concat(input.tag).concat("." /* Constant.Dot */).concat(classes);
776
783
  if (!(key in selectorMap)) {
777
784
  selectorMap[key] = [];
778
785
  }
779
786
  if (selectorMap[key].indexOf(input.id) < 0) {
780
787
  selectorMap[key].push(input.id);
781
788
  }
782
- selector = "" + key + "~" /* Tilde */ + selectorMap[key].indexOf(input.id);
789
+ selector = "".concat(key).concat("~" /* Constant.Tilde */).concat(selectorMap[key].indexOf(input.id));
783
790
  }
784
791
  else {
785
792
  // In Beta mode, we continue to look at query selectors in context of the full page
786
- selector = "" + prefix + input.tag + "." + classes + suffix;
793
+ selector = "".concat(prefix).concat(input.tag, ".").concat(classes).concat(suffix);
787
794
  }
788
795
  }
789
796
  // Update selector to use "id" field when available. There are two exceptions:
790
797
  // (1) if "id" appears to be an auto generated string token, e.g. guid or a random id containing digits
791
798
  // (2) if "id" appears inside a shadow DOM, in which case we continue to prefix up to shadow DOM to prevent conflicts
792
- selector = id && filter(id) ? "" + getDomPrefix(prefix) + "#" /* Hash */ + id : selector;
799
+ selector = id && filter(id) ? "".concat(getDomPrefix(prefix)).concat("#" /* Constant.Hash */).concat(id) : selector;
793
800
  return selector;
794
801
  }
795
802
  }
796
803
  function getDomPrefix(prefix) {
797
- var shadowDomStart = prefix.lastIndexOf("*S" /* ShadowDomTag */);
798
- var iframeDomStart = prefix.lastIndexOf("" + "iframe:" /* IFramePrefix */ + "HTML" /* HTML */);
804
+ var shadowDomStart = prefix.lastIndexOf("*S" /* Constant.ShadowDomTag */);
805
+ var iframeDomStart = prefix.lastIndexOf("".concat("iframe:" /* Constant.IFramePrefix */).concat("HTML" /* Constant.HTML */));
799
806
  var domStart = Math.max(shadowDomStart, iframeDomStart);
800
807
  if (domStart < 0) {
801
- return "" /* Empty */;
808
+ return "" /* Constant.Empty */;
802
809
  }
803
- return prefix.substring(0, prefix.indexOf(">" /* Separator */, domStart) + 1);
810
+ return prefix.substring(0, prefix.indexOf(">" /* Constant.Separator */, domStart) + 1);
804
811
  }
805
812
  function getDomPath(input) {
806
- var parts = input.split(">" /* Separator */);
813
+ var parts = input.split(">" /* Constant.Separator */);
807
814
  for (var i = 0; i < parts.length; i++) {
808
- var tIndex = parts[i].indexOf("~" /* Tilde */);
809
- var dIndex = parts[i].indexOf("." /* Dot */);
815
+ var tIndex = parts[i].indexOf("~" /* Constant.Tilde */);
816
+ var dIndex = parts[i].indexOf("." /* Constant.Dot */);
810
817
  parts[i] = parts[i].substring(0, dIndex > 0 ? dIndex : (tIndex > 0 ? tIndex : parts[i].length));
811
818
  }
812
- return parts.join(">" /* Separator */);
819
+ return parts.join(">" /* Constant.Separator */);
813
820
  }
814
821
  // Check if the given input string has digits or excluded class names
815
822
  function filter(value) {
@@ -821,7 +828,7 @@ function filter(value) {
821
828
  }
822
829
  for (var i = 0; i < value.length; i++) {
823
830
  var c = value.charCodeAt(i);
824
- if (c >= 48 /* Zero */ && c <= 57 /* Nine */) {
831
+ if (c >= 48 /* Character.Zero */ && c <= 57 /* Character.Nine */) {
825
832
  return false;
826
833
  }
827
834
  }
@@ -864,7 +871,7 @@ function reset$j() {
864
871
  pauseTask = null;
865
872
  }
866
873
  function schedule$1(task, priority) {
867
- if (priority === void 0) { priority = 0 /* Normal */; }
874
+ if (priority === void 0) { priority = 0 /* Priority.Normal */; }
868
875
  return __awaiter(this, void 0, void 0, function () {
869
876
  var _i, queuedTasks_1, q, promise;
870
877
  return __generator(this, function (_a) {
@@ -876,7 +883,7 @@ function schedule$1(task, priority) {
876
883
  }
877
884
  }
878
885
  promise = new Promise(function (resolve) {
879
- var insert = priority === 1 /* High */ ? "unshift" : "push";
886
+ var insert = priority === 1 /* Priority.High */ ? "unshift" : "push";
880
887
  // Queue this task for asynchronous execution later
881
888
  // We also store a unique page identifier (id) along with the task to ensure
882
889
  // ensure that we do not accidentally execute this task in context of a different page
@@ -911,7 +918,7 @@ function run() {
911
918
  return;
912
919
  }
913
920
  if (error) {
914
- log$1(0 /* RunTask */, 1 /* Warning */, error.name, error.message, error.stack);
921
+ log$1(0 /* Code.RunTask */, 1 /* Severity.Warning */, error.name, error.message, error.stack);
915
922
  }
916
923
  activeTask = null;
917
924
  run();
@@ -922,13 +929,13 @@ function state$8(timer) {
922
929
  var id = key(timer);
923
930
  if (id in tracker) {
924
931
  var elapsed = performance.now() - tracker[id].start;
925
- return (elapsed > tracker[id].yield) ? 0 /* Wait */ : 1 /* Run */;
932
+ return (elapsed > tracker[id].yield) ? 0 /* Task.Wait */ : 1 /* Task.Run */;
926
933
  }
927
934
  // If this task is no longer being tracked, send stop message to the caller
928
- return 2 /* Stop */;
935
+ return 2 /* Task.Stop */;
929
936
  }
930
937
  function start$w(timer) {
931
- tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* LongTask */ };
938
+ tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* Setting.LongTask */ };
932
939
  }
933
940
  function restart$2(timer) {
934
941
  var id = key(timer);
@@ -945,11 +952,11 @@ function stop$t(timer) {
945
952
  var id = key(timer);
946
953
  var duration = end - tracker[id].start;
947
954
  sum(timer.cost, duration);
948
- count$1(5 /* InvokeCount */);
955
+ count$1(5 /* Metric.InvokeCount */);
949
956
  // For the first execution, which is synchronous, time is automatically counted towards TotalDuration.
950
957
  // However, for subsequent asynchronous runs, we need to manually update TotalDuration metric.
951
958
  if (tracker[id].calls > 0) {
952
- sum(4 /* TotalCost */, duration);
959
+ sum(4 /* Metric.TotalCost */, duration);
953
960
  }
954
961
  }
955
962
  function suspend$1(timer) {
@@ -970,13 +977,13 @@ function suspend$1(timer) {
970
977
  case 2:
971
978
  // After we are done with suspending task, ensure that we are still operating in the right context
972
979
  // If the task is still being tracked, continue running the task, otherwise ask caller to stop execution
973
- return [2 /*return*/, id in tracker ? 1 /* Run */ : 2 /* Stop */];
980
+ return [2 /*return*/, id in tracker ? 1 /* Task.Run */ : 2 /* Task.Stop */];
974
981
  }
975
982
  });
976
983
  });
977
984
  }
978
985
  function key(timer) {
979
- return timer.id + "." + timer.cost;
986
+ return "".concat(timer.id, ".").concat(timer.cost);
980
987
  }
981
988
  function wait() {
982
989
  return __awaiter(this, void 0, void 0, function () {
@@ -1014,14 +1021,14 @@ function requestIdleCallbackPolyfill(callback, options) {
1014
1021
  var currentTime = performance.now();
1015
1022
  var elapsed = currentTime - startTime;
1016
1023
  var duration = currentTime - event.data;
1017
- if (duration > 30 /* LongTask */ && elapsed < options.timeout) {
1024
+ if (duration > 30 /* Setting.LongTask */ && elapsed < options.timeout) {
1018
1025
  requestAnimationFrame(function () { outgoing.postMessage(currentTime); });
1019
1026
  }
1020
1027
  else {
1021
1028
  var didTimeout_1 = elapsed > options.timeout;
1022
1029
  callback({
1023
1030
  didTimeout: didTimeout_1,
1024
- timeRemaining: function () { return didTimeout_1 ? 30 /* LongTask */ : Math.max(0, 30 /* LongTask */ - duration); }
1031
+ timeRemaining: function () { return didTimeout_1 ? 30 /* Setting.LongTask */ : Math.max(0, 30 /* Setting.LongTask */ - duration); }
1025
1032
  });
1026
1033
  }
1027
1034
  };
@@ -1042,7 +1049,7 @@ function tokenize (tokens) {
1042
1049
  var reference = null;
1043
1050
  for (var i = 0; i < tokens.length; i++) {
1044
1051
  // Only optimize for string values
1045
- if (typeof tokens[i] === "string" /* String */) {
1052
+ if (typeof tokens[i] === "string" /* Constant.String */) {
1046
1053
  var token = tokens[i];
1047
1054
  var index = lookup[token] || -1;
1048
1055
  if (index >= 0) {
@@ -1084,10 +1091,10 @@ function encode$4 (type, timer, ts) {
1084
1091
  tokens = [eventTime, type];
1085
1092
  _a = type;
1086
1093
  switch (_a) {
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];
1094
+ case 8 /* Event.Document */: return [3 /*break*/, 1];
1095
+ case 7 /* Event.Region */: return [3 /*break*/, 2];
1096
+ case 5 /* Event.Discover */: return [3 /*break*/, 3];
1097
+ case 6 /* Event.Mutation */: return [3 /*break*/, 3];
1091
1098
  }
1092
1099
  return [3 /*break*/, 10];
1093
1100
  case 1:
@@ -1100,7 +1107,7 @@ function encode$4 (type, timer, ts) {
1100
1107
  case 2:
1101
1108
  for (_i = 0, _b = state$1; _i < _b.length; _i++) {
1102
1109
  r = _b[_i];
1103
- tokens = [r.time, 7 /* Region */];
1110
+ tokens = [r.time, 7 /* Event.Region */];
1104
1111
  tokens.push(r.data.id);
1105
1112
  tokens.push(r.data.interaction);
1106
1113
  tokens.push(r.data.visibility);
@@ -1111,7 +1118,7 @@ function encode$4 (type, timer, ts) {
1111
1118
  return [3 /*break*/, 10];
1112
1119
  case 3:
1113
1120
  // Check if we are operating within the context of the current page
1114
- if (state$8(timer) === 2 /* Stop */) {
1121
+ if (state$8(timer) === 2 /* Task.Stop */) {
1115
1122
  return [3 /*break*/, 10];
1116
1123
  }
1117
1124
  values = updates$2();
@@ -1122,13 +1129,13 @@ function encode$4 (type, timer, ts) {
1122
1129
  if (!(_c < values_1.length)) return [3 /*break*/, 8];
1123
1130
  value = values_1[_c];
1124
1131
  state = state$8(timer);
1125
- if (!(state === 0 /* Wait */)) return [3 /*break*/, 6];
1132
+ if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 6];
1126
1133
  return [4 /*yield*/, suspend$1(timer)];
1127
1134
  case 5:
1128
1135
  state = _e.sent();
1129
1136
  _e.label = 6;
1130
1137
  case 6:
1131
- if (state === 2 /* Stop */) {
1138
+ if (state === 2 /* Task.Stop */) {
1132
1139
  return [3 /*break*/, 8];
1133
1140
  }
1134
1141
  data = value.data;
@@ -1151,9 +1158,9 @@ function encode$4 (type, timer, ts) {
1151
1158
  if (value.previous && active) {
1152
1159
  tokens.push(value.previous);
1153
1160
  }
1154
- tokens.push(suspend ? "*M" /* SuspendMutationTag */ : data[key]);
1161
+ tokens.push(suspend ? "*M" /* Constant.SuspendMutationTag */ : data[key]);
1155
1162
  if (box && box.length === 2) {
1156
- tokens.push("" + "#" /* Hash */ + str$1(box[0]) + "." + str$1(box[1]));
1163
+ tokens.push("".concat("#" /* Constant.Hash */).concat(str$1(box[0]), ".").concat(str$1(box[1])));
1157
1164
  }
1158
1165
  break;
1159
1166
  case "attributes":
@@ -1175,7 +1182,7 @@ function encode$4 (type, timer, ts) {
1175
1182
  _c++;
1176
1183
  return [3 /*break*/, 4];
1177
1184
  case 8:
1178
- if (type === 6 /* Mutation */) {
1185
+ if (type === 6 /* Event.Mutation */) {
1179
1186
  activity(eventTime);
1180
1187
  }
1181
1188
  queue(tokenize(tokens), !config$1.lean);
@@ -1188,13 +1195,13 @@ function encode$4 (type, timer, ts) {
1188
1195
  }
1189
1196
  function shouldMangle(value) {
1190
1197
  var privacy = value.metadata.privacy;
1191
- return value.data.tag === "*T" /* TextTag */ && !(privacy === 0 /* None */ || privacy === 1 /* Sensitive */);
1198
+ return value.data.tag === "*T" /* Constant.TextTag */ && !(privacy === 0 /* Privacy.None */ || privacy === 1 /* Privacy.Sensitive */);
1192
1199
  }
1193
1200
  function size$1(value) {
1194
1201
  if (value.metadata.size !== null && value.metadata.size.length === 0) {
1195
1202
  var img = getNode(value.id);
1196
1203
  if (img) {
1197
- return [Math.floor(img.offsetWidth * 100 /* BoxPrecision */), Math.floor(img.offsetHeight * 100 /* BoxPrecision */)];
1204
+ return [Math.floor(img.offsetWidth * 100 /* Setting.BoxPrecision */), Math.floor(img.offsetHeight * 100 /* Setting.BoxPrecision */)];
1198
1205
  }
1199
1206
  }
1200
1207
  return value.metadata.size;
@@ -1203,7 +1210,7 @@ function str$1(input) {
1203
1210
  return input.toString(36);
1204
1211
  }
1205
1212
  function attribute(key, value, privacy) {
1206
- return key + "=" + scrub(value, key, privacy);
1213
+ return "".concat(key, "=").concat(scrub(value, key, privacy));
1207
1214
  }
1208
1215
 
1209
1216
  var data$c;
@@ -1234,7 +1241,7 @@ function compute$7() {
1234
1241
  // Check that width or height has changed from before, and also that width & height are not null values
1235
1242
  if ((data$c === null || width !== data$c.width || height !== data$c.height) && width !== null && height !== null) {
1236
1243
  data$c = { width: width, height: height };
1237
- encode$4(8 /* Document */);
1244
+ encode$4(8 /* Event.Document */);
1238
1245
  }
1239
1246
  }
1240
1247
  function end() {
@@ -1263,7 +1270,7 @@ function start$u() {
1263
1270
  reset$h();
1264
1271
  }
1265
1272
  function observe$b(root) {
1266
- bind(root, "click", handler$3.bind(this, 9 /* Click */, root), true);
1273
+ bind(root, "click", handler$3.bind(this, 9 /* Event.Click */, root), true);
1267
1274
  }
1268
1275
  function handler$3(event, root, evt) {
1269
1276
  var frame = iframe(root);
@@ -1289,13 +1296,14 @@ function handler$3(event, root, evt) {
1289
1296
  x = Math.round(l.x + (l.w / 2));
1290
1297
  y = Math.round(l.y + (l.h / 2));
1291
1298
  }
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;
1299
+ var eX = l ? Math.max(Math.floor(((x - l.x) / l.w) * 32767 /* Setting.ClickPrecision */), 0) : 0;
1300
+ var eY = l ? Math.max(Math.floor(((y - l.y) / l.h) * 32767 /* Setting.ClickPrecision */), 0) : 0;
1294
1301
  // Check for null values before processing this event
1295
1302
  if (x !== null && y !== null) {
1296
1303
  state$7.push({
1297
1304
  time: time(),
1298
- event: event, data: {
1305
+ event: event,
1306
+ data: {
1299
1307
  target: t,
1300
1308
  x: x,
1301
1309
  y: y,
@@ -1307,7 +1315,7 @@ function handler$3(event, root, evt) {
1307
1315
  text: text(t),
1308
1316
  link: a ? a.href : null,
1309
1317
  hash: null,
1310
- trust: evt.isTrusted ? 1 /* True */ : 0 /* False */
1318
+ trust: evt.isTrusted ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */
1311
1319
  }
1312
1320
  });
1313
1321
  schedule$1(encode$3.bind(this, event));
@@ -1322,7 +1330,7 @@ function text(element) {
1322
1330
  // Trim any spaces at the beginning or at the end of string
1323
1331
  // Also, replace multiple occurrence of space characters with a single white space
1324
1332
  // Finally, send only first few characters as specified by the Setting
1325
- output = t.trim().replace(/\s+/g, " " /* Space */).substr(0, 25 /* ClickText */);
1333
+ output = t.trim().replace(/\s+/g, " " /* Constant.Space */).substr(0, 25 /* Setting.ClickText */);
1326
1334
  }
1327
1335
  }
1328
1336
  return output;
@@ -1331,10 +1339,10 @@ function reaction(element) {
1331
1339
  if (element.nodeType === Node.ELEMENT_NODE) {
1332
1340
  var tag = element.tagName.toLowerCase();
1333
1341
  if (UserInputTags.indexOf(tag) >= 0) {
1334
- return 0 /* False */;
1342
+ return 0 /* BooleanFlag.False */;
1335
1343
  }
1336
1344
  }
1337
- return 1 /* True */;
1345
+ return 1 /* BooleanFlag.True */;
1338
1346
  }
1339
1347
  function layout$1(element) {
1340
1348
  var box = null;
@@ -1358,14 +1366,14 @@ function layout$1(element) {
1358
1366
  return box;
1359
1367
  }
1360
1368
  function context(a) {
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 */;
1369
+ if (a && a.hasAttribute("target" /* Constant.Target */)) {
1370
+ switch (a.getAttribute("target" /* Constant.Target */)) {
1371
+ case "_blank" /* Constant.Blank */: return 1 /* BrowsingContext.Blank */;
1372
+ case "_parent" /* Constant.Parent */: return 2 /* BrowsingContext.Parent */;
1373
+ case "_top" /* Constant.Top */: return 3 /* BrowsingContext.Top */;
1366
1374
  }
1367
1375
  }
1368
- return 0 /* Self */;
1376
+ return 0 /* BrowsingContext.Self */;
1369
1377
  }
1370
1378
  function reset$h() {
1371
1379
  state$7 = [];
@@ -1379,13 +1387,13 @@ function start$t() {
1379
1387
  reset$g();
1380
1388
  }
1381
1389
  function observe$a(root) {
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);
1390
+ bind(root, "cut", recompute$7.bind(this, 0 /* Clipboard.Cut */), true);
1391
+ bind(root, "copy", recompute$7.bind(this, 1 /* Clipboard.Copy */), true);
1392
+ bind(root, "paste", recompute$7.bind(this, 2 /* Clipboard.Paste */), true);
1385
1393
  }
1386
1394
  function recompute$7(action, evt) {
1387
- state$6.push({ time: time(), event: 38 /* Clipboard */, data: { target: target(evt), action: action } });
1388
- schedule$1(encode$3.bind(this, 38 /* Clipboard */));
1395
+ state$6.push({ time: time(), event: 38 /* Event.Clipboard */, data: { target: target(evt), action: action } });
1396
+ schedule$1(encode$3.bind(this, 38 /* Event.Clipboard */));
1389
1397
  }
1390
1398
  function reset$g() {
1391
1399
  state$6 = [];
@@ -1418,9 +1426,9 @@ function recompute$6(evt) {
1418
1426
  if (state$5.length > 0 && (state$5[state$5.length - 1].data.target === data.target)) {
1419
1427
  state$5.pop();
1420
1428
  }
1421
- state$5.push({ time: time(), event: 27 /* Input */, data: data });
1429
+ state$5.push({ time: time(), event: 27 /* Event.Input */, data: data });
1422
1430
  clearTimeout(timeout$5);
1423
- timeout$5 = setTimeout(process$6, 500 /* LookAhead */, 27 /* Input */);
1431
+ timeout$5 = setTimeout(process$6, 500 /* Setting.LookAhead */, 27 /* Event.Input */);
1424
1432
  }
1425
1433
  }
1426
1434
  function process$6(event) {
@@ -1440,15 +1448,15 @@ function start$r() {
1440
1448
  reset$e();
1441
1449
  }
1442
1450
  function observe$8(root) {
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);
1451
+ bind(root, "mousedown", mouse.bind(this, 13 /* Event.MouseDown */, root), true);
1452
+ bind(root, "mouseup", mouse.bind(this, 14 /* Event.MouseUp */, root), true);
1453
+ bind(root, "mousemove", mouse.bind(this, 12 /* Event.MouseMove */, root), true);
1454
+ bind(root, "wheel", mouse.bind(this, 15 /* Event.MouseWheel */, root), true);
1455
+ bind(root, "dblclick", mouse.bind(this, 16 /* Event.DoubleClick */, root), true);
1456
+ bind(root, "touchstart", touch.bind(this, 17 /* Event.TouchStart */, root), true);
1457
+ bind(root, "touchend", touch.bind(this, 18 /* Event.TouchEnd */, root), true);
1458
+ bind(root, "touchmove", touch.bind(this, 19 /* Event.TouchMove */, root), true);
1459
+ bind(root, "touchcancel", touch.bind(this, 20 /* Event.TouchCancel */, root), true);
1452
1460
  }
1453
1461
  function mouse(event, root, evt) {
1454
1462
  var frame = iframe(root);
@@ -1487,9 +1495,9 @@ function touch(event, root, evt) {
1487
1495
  }
1488
1496
  function handler$2(current) {
1489
1497
  switch (current.event) {
1490
- case 12 /* MouseMove */:
1491
- case 15 /* MouseWheel */:
1492
- case 19 /* TouchMove */:
1498
+ case 12 /* Event.MouseMove */:
1499
+ case 15 /* Event.MouseWheel */:
1500
+ case 19 /* Event.TouchMove */:
1493
1501
  var length_1 = state$4.length;
1494
1502
  var last = length_1 > 1 ? state$4[length_1 - 2] : null;
1495
1503
  if (last && similar$1(last, current)) {
@@ -1497,7 +1505,7 @@ function handler$2(current) {
1497
1505
  }
1498
1506
  state$4.push(current);
1499
1507
  clearTimeout(timeout$4);
1500
- timeout$4 = setTimeout(process$5, 500 /* LookAhead */, current.event);
1508
+ timeout$4 = setTimeout(process$5, 500 /* Setting.LookAhead */, current.event);
1501
1509
  break;
1502
1510
  default:
1503
1511
  state$4.push(current);
@@ -1517,7 +1525,7 @@ function similar$1(last, current) {
1517
1525
  var distance = Math.sqrt(dx * dx + dy * dy);
1518
1526
  var gap = current.time - last.time;
1519
1527
  var match = current.data.target === last.data.target;
1520
- return current.event === last.event && match && distance < 20 /* Distance */ && gap < 25 /* Interval */;
1528
+ return current.event === last.event && match && distance < 20 /* Setting.Distance */ && gap < 25 /* Setting.Interval */;
1521
1529
  }
1522
1530
  function stop$p() {
1523
1531
  clearTimeout(timeout$4);
@@ -1540,7 +1548,7 @@ function recompute$5() {
1540
1548
  width: de && "clientWidth" in de ? Math.min(de.clientWidth, window.innerWidth) : window.innerWidth,
1541
1549
  height: de && "clientHeight" in de ? Math.min(de.clientHeight, window.innerHeight) : window.innerHeight,
1542
1550
  };
1543
- encode$3(11 /* Resize */);
1551
+ encode$3(11 /* Event.Resize */);
1544
1552
  }
1545
1553
  function reset$d() {
1546
1554
  data$b = null;
@@ -1576,7 +1584,7 @@ function recompute$4(event) {
1576
1584
  // And, if for some reason that is not available, fall back to looking up scrollTop on document.documentElement.
1577
1585
  var x = element === de && "pageXOffset" in w ? Math.round(w.pageXOffset) : Math.round(element.scrollLeft);
1578
1586
  var y = element === de && "pageYOffset" in w ? Math.round(w.pageYOffset) : Math.round(element.scrollTop);
1579
- var current = { time: time(), event: 10 /* Scroll */, data: { target: element, x: x, y: y } };
1587
+ var current = { time: time(), event: 10 /* Event.Scroll */, data: { target: element, x: x, y: y } };
1580
1588
  // We don't send any scroll events if this is the first event and the current position is top (0,0)
1581
1589
  if ((event === null && x === 0 && y === 0) || (x === null || y === null)) {
1582
1590
  return;
@@ -1588,7 +1596,7 @@ function recompute$4(event) {
1588
1596
  }
1589
1597
  state$3.push(current);
1590
1598
  clearTimeout(timeout$3);
1591
- timeout$3 = setTimeout(process$4, 500 /* LookAhead */, 10 /* Scroll */);
1599
+ timeout$3 = setTimeout(process$4, 500 /* Setting.LookAhead */, 10 /* Event.Scroll */);
1592
1600
  }
1593
1601
  function reset$c() {
1594
1602
  state$3 = [];
@@ -1599,7 +1607,7 @@ function process$4(event) {
1599
1607
  function similar(last, current) {
1600
1608
  var dx = last.data.x - current.data.x;
1601
1609
  var dy = last.data.y - current.data.y;
1602
- return (dx * dx + dy * dy < 20 /* Distance */ * 20 /* Distance */) && (current.time - last.time < 25 /* Interval */);
1610
+ return (dx * dx + dy * dy < 20 /* Setting.Distance */ * 20 /* Setting.Distance */) && (current.time - last.time < 25 /* Setting.Interval */);
1603
1611
  }
1604
1612
  function stop$n() {
1605
1613
  clearTimeout(timeout$3);
@@ -1634,7 +1642,7 @@ function recompute$3(root) {
1634
1642
  var startNode = data$a.start ? data$a.start : null;
1635
1643
  if (previous !== null && data$a.start !== null && startNode !== current.anchorNode) {
1636
1644
  clearTimeout(timeout$2);
1637
- process$3(21 /* Selection */);
1645
+ process$3(21 /* Event.Selection */);
1638
1646
  }
1639
1647
  data$a = {
1640
1648
  start: current.anchorNode,
@@ -1644,7 +1652,7 @@ function recompute$3(root) {
1644
1652
  };
1645
1653
  previous = current;
1646
1654
  clearTimeout(timeout$2);
1647
- timeout$2 = setTimeout(process$3, 500 /* LookAhead */, 21 /* Selection */);
1655
+ timeout$2 = setTimeout(process$3, 500 /* Setting.LookAhead */, 21 /* Event.Selection */);
1648
1656
  }
1649
1657
  function process$3(event) {
1650
1658
  schedule$1(encode$3.bind(this, event));
@@ -1666,8 +1674,8 @@ function observe$5(root) {
1666
1674
  bind(root, "submit", recompute$2, true);
1667
1675
  }
1668
1676
  function recompute$2(evt) {
1669
- state$2.push({ time: time(), event: 39 /* Submit */, data: { target: target(evt) } });
1670
- schedule$1(encode$3.bind(this, 39 /* Submit */));
1677
+ state$2.push({ time: time(), event: 39 /* Event.Submit */, data: { target: target(evt) } });
1678
+ schedule$1(encode$3.bind(this, 39 /* Event.Submit */));
1671
1679
  }
1672
1680
  function reset$a() {
1673
1681
  state$2 = [];
@@ -1682,7 +1690,7 @@ function start$m() {
1682
1690
  }
1683
1691
  function recompute$1(evt) {
1684
1692
  data$9 = { name: evt.type };
1685
- encode$3(26 /* Unload */);
1693
+ encode$3(26 /* Event.Unload */);
1686
1694
  stop();
1687
1695
  }
1688
1696
  function reset$9() {
@@ -1699,7 +1707,7 @@ function start$l() {
1699
1707
  }
1700
1708
  function recompute() {
1701
1709
  data$8 = { visible: "visibilityState" in document ? document.visibilityState : "default" };
1702
- encode$3(28 /* Visibility */);
1710
+ encode$3(28 /* Event.Visibility */);
1703
1711
  }
1704
1712
  function reset$8() {
1705
1713
  data$8 = null;
@@ -1761,51 +1769,51 @@ function ld(json) {
1761
1769
  for (var _i = 0, _a = Object.keys(json); _i < _a.length; _i++) {
1762
1770
  var key = _a[_i];
1763
1771
  var value = json[key];
1764
- if (key === "@type" /* Type */ && typeof value === "string") {
1772
+ if (key === "@type" /* JsonLD.Type */ && typeof value === "string") {
1765
1773
  value = value.toLowerCase();
1766
1774
  /* Normalizations */
1767
- value = value.indexOf("article" /* Article */) >= 0 || value.indexOf("posting" /* Posting */) >= 0 ? "article" /* Article */ : value;
1775
+ value = value.indexOf("article" /* JsonLD.Article */) >= 0 || value.indexOf("posting" /* JsonLD.Posting */) >= 0 ? "article" /* JsonLD.Article */ : value;
1768
1776
  switch (value) {
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 */]);
1777
+ case "article" /* JsonLD.Article */:
1778
+ case "recipe" /* JsonLD.Recipe */:
1779
+ log(5 /* Dimension.SchemaType */, json[key]);
1780
+ log(8 /* Dimension.AuthorName */, json["creator" /* JsonLD.Creator */]);
1781
+ log(18 /* Dimension.Headline */, json["headline" /* JsonLD.Headline */]);
1774
1782
  break;
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 */]);
1783
+ case "product" /* JsonLD.Product */:
1784
+ log(5 /* Dimension.SchemaType */, json[key]);
1785
+ log(10 /* Dimension.ProductName */, json["name" /* JsonLD.Name */]);
1786
+ log(12 /* Dimension.ProductSku */, json["sku" /* JsonLD.Sku */]);
1787
+ if (json["brand" /* JsonLD.Brand */]) {
1788
+ log(6 /* Dimension.ProductBrand */, json["brand" /* JsonLD.Brand */]["name" /* JsonLD.Name */]);
1781
1789
  }
1782
1790
  break;
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 */]));
1791
+ case "aggregaterating" /* JsonLD.AggregateRating */:
1792
+ if (json["ratingValue" /* JsonLD.RatingValue */]) {
1793
+ max(11 /* Metric.RatingValue */, num$1(json["ratingValue" /* JsonLD.RatingValue */], 100 /* Setting.RatingScale */));
1794
+ max(18 /* Metric.BestRating */, num$1(json["bestRating" /* JsonLD.BestRating */]));
1795
+ max(19 /* Metric.WorstRating */, num$1(json["worstRating" /* JsonLD.WorstRating */]));
1788
1796
  }
1789
- max(12 /* RatingCount */, num$1(json["ratingCount" /* RatingCount */]));
1790
- max(17 /* ReviewCount */, num$1(json["reviewCount" /* ReviewCount */]));
1797
+ max(12 /* Metric.RatingCount */, num$1(json["ratingCount" /* JsonLD.RatingCount */]));
1798
+ max(17 /* Metric.ReviewCount */, num$1(json["reviewCount" /* JsonLD.ReviewCount */]));
1791
1799
  break;
1792
- case "person" /* Author */:
1793
- log(8 /* AuthorName */, json["name" /* Name */]);
1800
+ case "person" /* JsonLD.Author */:
1801
+ log(8 /* Dimension.AuthorName */, json["name" /* JsonLD.Name */]);
1794
1802
  break;
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 */]));
1803
+ case "offer" /* JsonLD.Offer */:
1804
+ log(7 /* Dimension.ProductAvailability */, json["availability" /* JsonLD.Availability */]);
1805
+ log(14 /* Dimension.ProductCondition */, json["itemCondition" /* JsonLD.ItemCondition */]);
1806
+ log(13 /* Dimension.ProductCurrency */, json["priceCurrency" /* JsonLD.PriceCurrency */]);
1807
+ log(12 /* Dimension.ProductSku */, json["sku" /* JsonLD.Sku */]);
1808
+ max(13 /* Metric.ProductPrice */, num$1(json["price" /* JsonLD.Price */]));
1801
1809
  break;
1802
- case "brand" /* Brand */:
1803
- log(6 /* ProductBrand */, json["name" /* Name */]);
1810
+ case "brand" /* JsonLD.Brand */:
1811
+ log(6 /* Dimension.ProductBrand */, json["name" /* JsonLD.Name */]);
1804
1812
  break;
1805
1813
  }
1806
1814
  }
1807
1815
  // Continue parsing nested objects
1808
- if (value !== null && typeof (value) === "object" /* Object */) {
1816
+ if (value !== null && typeof (value) === "object" /* Constant.Object */) {
1809
1817
  ld(value);
1810
1818
  }
1811
1819
  }
@@ -1814,8 +1822,8 @@ function num$1(input, scale) {
1814
1822
  if (scale === void 0) { scale = 1; }
1815
1823
  if (input !== null) {
1816
1824
  switch (typeof input) {
1817
- case "number" /* Number */: return Math.round(input * scale);
1818
- case "string" /* String */: return Math.round(parseFloat(input.replace(digitsRegex, "" /* Empty */)) * scale);
1825
+ case "number" /* Constant.Number */: return Math.round(input * scale);
1826
+ case "string" /* Constant.String */: return Math.round(parseFloat(input.replace(digitsRegex, "" /* Constant.Empty */)) * scale);
1819
1827
  }
1820
1828
  }
1821
1829
  return null;
@@ -1826,11 +1834,11 @@ var newlineRegex = /[\r\n]+/g;
1826
1834
  function processNode (node, source) {
1827
1835
  var child = null;
1828
1836
  // Do not track this change if we are attempting to remove a node before discovering it
1829
- if (source === 2 /* ChildListRemove */ && has(node) === false) {
1837
+ if (source === 2 /* Source.ChildListRemove */ && has(node) === false) {
1830
1838
  return child;
1831
1839
  }
1832
1840
  // Special handling for text nodes that belong to style nodes
1833
- if (source !== 0 /* Discover */ &&
1841
+ if (source !== 0 /* Source.Discover */ &&
1834
1842
  node.nodeType === Node.TEXT_NODE &&
1835
1843
  node.parentElement &&
1836
1844
  node.parentElement.tagName === "STYLE") {
@@ -1843,10 +1851,10 @@ function processNode (node, source) {
1843
1851
  switch (node.nodeType) {
1844
1852
  case Node.DOCUMENT_TYPE_NODE:
1845
1853
  parent = insideFrame && node.parentNode ? iframe(node.parentNode) : parent;
1846
- var docTypePrefix = insideFrame ? "iframe:" /* IFramePrefix */ : "" /* Empty */;
1854
+ var docTypePrefix = insideFrame ? "iframe:" /* Constant.IFramePrefix */ : "" /* Constant.Empty */;
1847
1855
  var doctype = node;
1848
1856
  var docAttributes = { name: doctype.name, publicId: doctype.publicId, systemId: doctype.systemId };
1849
- var docData = { tag: docTypePrefix + "*D" /* DocumentTag */, attributes: docAttributes };
1857
+ var docData = { tag: docTypePrefix + "*D" /* Constant.DocumentTag */, attributes: docAttributes };
1850
1858
  dom[call](node, parent, docData, source);
1851
1859
  break;
1852
1860
  case Node.DOCUMENT_NODE:
@@ -1861,26 +1869,26 @@ function processNode (node, source) {
1861
1869
  if (shadowRoot.host) {
1862
1870
  parse$1(shadowRoot);
1863
1871
  var type = typeof (shadowRoot.constructor);
1864
- if (type === "function" /* Function */ && shadowRoot.constructor.toString().indexOf("[native code]" /* NativeCode */) >= 0) {
1872
+ if (type === "function" /* Constant.Function */ && shadowRoot.constructor.toString().indexOf("[native code]" /* Constant.NativeCode */) >= 0) {
1865
1873
  observe$3(shadowRoot);
1866
1874
  // See: https://wicg.github.io/construct-stylesheets/ for more details on adoptedStyleSheets.
1867
1875
  // At the moment, we are only able to capture "open" shadow DOM nodes. If they are closed, they are not accessible.
1868
1876
  // In future we may decide to proxy "attachShadow" call to gain access, but at the moment, we don't want to
1869
1877
  // cause any unintended side effect to the page. We will re-evaluate after we gather more real world data on this.
1870
- var style = "" /* Empty */;
1878
+ var style = "" /* Constant.Empty */;
1871
1879
  var adoptedStyleSheets = "adoptedStyleSheets" in shadowRoot ? shadowRoot["adoptedStyleSheets"] : [];
1872
1880
  for (var _i = 0, adoptedStyleSheets_1 = adoptedStyleSheets; _i < adoptedStyleSheets_1.length; _i++) {
1873
1881
  var styleSheet = adoptedStyleSheets_1[_i];
1874
1882
  style += getCssRules(styleSheet);
1875
1883
  }
1876
- var fragementData = { tag: "*S" /* ShadowDomTag */, attributes: { style: style } };
1884
+ var fragementData = { tag: "*S" /* Constant.ShadowDomTag */, attributes: { style: style } };
1877
1885
  dom[call](node, shadowRoot.host, fragementData, source);
1878
1886
  }
1879
1887
  else {
1880
1888
  // If the browser doesn't support shadow DOM natively, we detect that, and send appropriate tag back.
1881
1889
  // The differentiation is important because we don't have to observe pollyfill shadow DOM nodes,
1882
1890
  // the same way we observe real shadow DOM nodes (encapsulation provided by the browser).
1883
- dom[call](node, shadowRoot.host, { tag: "*P" /* PolyfillShadowDomTag */, attributes: {} }, source);
1891
+ dom[call](node, shadowRoot.host, { tag: "*P" /* Constant.PolyfillShadowDomTag */, attributes: {} }, source);
1884
1892
  }
1885
1893
  }
1886
1894
  break;
@@ -1893,7 +1901,7 @@ function processNode (node, source) {
1893
1901
  // The only exception is when we receive a mutation to remove the text node, in that case
1894
1902
  // parent will be null, but we can still process the node by checking it's an update call.
1895
1903
  if (call === "update" || (parent && has(parent) && parent.tagName !== "STYLE")) {
1896
- var textData = { tag: "*T" /* TextTag */, value: node.nodeValue };
1904
+ var textData = { tag: "*T" /* Constant.TextTag */, value: node.nodeValue };
1897
1905
  dom[call](node, parent, textData, source);
1898
1906
  }
1899
1907
  break;
@@ -1905,20 +1913,20 @@ function processNode (node, source) {
1905
1913
  // For correctness, we first look at parentElement and if it not present then fall back to using parentNode
1906
1914
  parent = node.parentElement ? node.parentElement : (node.parentNode ? node.parentNode : null);
1907
1915
  // 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" /* SvgNamespace */) {
1909
- tag = "svg:" /* SvgPrefix */ + tag;
1916
+ if (element.namespaceURI === "http://www.w3.org/2000/svg" /* Constant.SvgNamespace */) {
1917
+ tag = "svg:" /* Constant.SvgPrefix */ + tag;
1910
1918
  }
1911
1919
  switch (tag) {
1912
1920
  case "HTML":
1913
1921
  parent = insideFrame && parent ? iframe(parent) : null;
1914
- var htmlPrefix = insideFrame ? "iframe:" /* IFramePrefix */ : "" /* Empty */;
1922
+ var htmlPrefix = insideFrame ? "iframe:" /* Constant.IFramePrefix */ : "" /* Constant.Empty */;
1915
1923
  var htmlData = { tag: htmlPrefix + tag, attributes: attributes };
1916
1924
  dom[call](node, parent, htmlData, source);
1917
1925
  break;
1918
1926
  case "SCRIPT":
1919
- if ("type" /* Type */ in attributes && attributes["type" /* Type */] === "application/ld+json" /* JsonLD */) {
1927
+ if ("type" /* Constant.Type */ in attributes && attributes["type" /* Constant.Type */] === "application/ld+json" /* Constant.JsonLD */) {
1920
1928
  try {
1921
- ld(JSON.parse(element.text.replace(newlineRegex, "" /* Empty */)));
1929
+ ld(JSON.parse(element.text.replace(newlineRegex, "" /* Constant.Empty */)));
1922
1930
  }
1923
1931
  catch ( /* do nothing */_a) { /* do nothing */ }
1924
1932
  }
@@ -1926,20 +1934,20 @@ function processNode (node, source) {
1926
1934
  case "NOSCRIPT":
1927
1935
  break;
1928
1936
  case "META":
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 */];
1937
+ var key = ("property" /* Constant.Property */ in attributes ?
1938
+ "property" /* Constant.Property */ :
1939
+ ("name" /* Constant.Name */ in attributes ? "name" /* Constant.Name */ : null));
1940
+ if (key && "content" /* Constant.Content */ in attributes) {
1941
+ var content = attributes["content" /* Constant.Content */];
1934
1942
  switch (attributes[key]) {
1935
- case "og:title" /* ogTitle */:
1936
- log(20 /* MetaTitle */, content);
1943
+ case "og:title" /* Constant.ogTitle */:
1944
+ log(20 /* Dimension.MetaTitle */, content);
1937
1945
  break;
1938
- case "og:type" /* ogType */:
1939
- log(19 /* MetaType */, content);
1946
+ case "og:type" /* Constant.ogType */:
1947
+ log(19 /* Dimension.MetaType */, content);
1940
1948
  break;
1941
- case "generator" /* Generator */:
1942
- log(21 /* Generator */, content);
1949
+ case "generator" /* Constant.Generator */:
1950
+ log(21 /* Dimension.Generator */, content);
1943
1951
  break;
1944
1952
  }
1945
1953
  }
@@ -1947,7 +1955,7 @@ function processNode (node, source) {
1947
1955
  case "HEAD":
1948
1956
  var head = { tag: tag, attributes: attributes };
1949
1957
  if (location) {
1950
- head.attributes["*B" /* Base */] = location.protocol + "//" + location.hostname;
1958
+ head.attributes["*B" /* Constant.Base */] = location.protocol + "//" + location.hostname;
1951
1959
  }
1952
1960
  dom[call](node, parent, head, source);
1953
1961
  break;
@@ -1960,7 +1968,7 @@ function processNode (node, source) {
1960
1968
  var frameData = { tag: tag, attributes: attributes };
1961
1969
  if (sameorigin(iframe$1)) {
1962
1970
  monitor(iframe$1);
1963
- frameData.attributes["*O" /* SameOrigin */] = "true";
1971
+ frameData.attributes["*O" /* Constant.SameOrigin */] = "true";
1964
1972
  if (iframe$1.contentDocument && iframe$1.contentWindow && iframe$1.contentDocument.readyState !== "loading") {
1965
1973
  child = iframe$1.contentDocument;
1966
1974
  }
@@ -1989,7 +1997,7 @@ function observe$3(root) {
1989
1997
  function getStyleValue(style) {
1990
1998
  // Call trim on the text content to ensure we do not process white spaces ( , \n, \r\n, \t, etc.)
1991
1999
  // 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() : "" /* Empty */;
2000
+ var value = style.textContent ? style.textContent.trim() : "" /* Constant.Empty */;
1993
2001
  var dataset = style.dataset ? Object.keys(style.dataset).length : 0;
1994
2002
  if (value.length === 0 || dataset > 0) {
1995
2003
  value = getCssRules(style.sheet);
@@ -1997,14 +2005,14 @@ function getStyleValue(style) {
1997
2005
  return value;
1998
2006
  }
1999
2007
  function getCssRules(sheet) {
2000
- var value = "" /* Empty */;
2008
+ var value = "" /* Constant.Empty */;
2001
2009
  var cssRules = null;
2002
2010
  // Firefox throws a SecurityError when trying to access cssRules of a stylesheet from a different domain
2003
2011
  try {
2004
2012
  cssRules = sheet ? sheet.cssRules : [];
2005
2013
  }
2006
2014
  catch (e) {
2007
- log$1(1 /* CssRules */, 1 /* Warning */, e ? e.name : null);
2015
+ log$1(1 /* Code.CssRules */, 1 /* Severity.Warning */, e ? e.name : null);
2008
2016
  if (e && e.name !== "SecurityError") {
2009
2017
  throw e;
2010
2018
  }
@@ -2028,8 +2036,8 @@ function getAttributes(element) {
2028
2036
  }
2029
2037
  }
2030
2038
  // For INPUT tags read the dynamic "value" property if an explicit "value" attribute is not set
2031
- if (element.tagName === "INPUT" /* InputTag */ && !("value" /* Value */ in output) && element.value) {
2032
- output["value" /* Value */] = element.value;
2039
+ if (element.tagName === "INPUT" /* Constant.InputTag */ && !("value" /* Constant.Value */ in output) && element.value) {
2040
+ output["value" /* Constant.Value */] = element.value;
2033
2041
  }
2034
2042
  return output;
2035
2043
  }
@@ -2051,13 +2059,13 @@ function traverse (root, timer, source) {
2051
2059
  next = next.nextSibling;
2052
2060
  }
2053
2061
  state = state$8(timer);
2054
- if (!(state === 0 /* Wait */)) return [3 /*break*/, 3];
2062
+ if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 3];
2055
2063
  return [4 /*yield*/, suspend$1(timer)];
2056
2064
  case 2:
2057
2065
  state = _a.sent();
2058
2066
  _a.label = 3;
2059
2067
  case 3:
2060
- if (state === 2 /* Stop */) {
2068
+ if (state === 2 /* Task.Stop */) {
2061
2069
  return [3 /*break*/, 4];
2062
2070
  }
2063
2071
  subnode = processNode(node, source);
@@ -2134,7 +2142,7 @@ function observe$2(node) {
2134
2142
  // For this reason, we need to wire up mutations every time we see a new shadow dom.
2135
2143
  // Also, wrap it inside a try / catch. In certain browsers (e.g. legacy Edge), observer on shadow dom can throw errors
2136
2144
  try {
2137
- var m = api("MutationObserver" /* MutationObserver */);
2145
+ var m = api("MutationObserver" /* Constant.MutationObserver */);
2138
2146
  var observer = m in window ? new window[m](measure(handle$1)) : null;
2139
2147
  if (observer) {
2140
2148
  observer.observe(node, { attributes: true, childList: true, characterData: true, subtree: true });
@@ -2142,7 +2150,7 @@ function observe$2(node) {
2142
2150
  }
2143
2151
  }
2144
2152
  catch (e) {
2145
- log$1(2 /* MutationObserver */, 0 /* Info */, e ? e.name : null);
2153
+ log$1(2 /* Code.MutationObserver */, 0 /* Severity.Info */, e ? e.name : null);
2146
2154
  }
2147
2155
  }
2148
2156
  function monitor(frame) {
@@ -2150,7 +2158,7 @@ function monitor(frame) {
2150
2158
  // This includes cases where iframe location is updated without explicitly updating src attribute
2151
2159
  // E.g. iframe.contentWindow.location.href = "new-location";
2152
2160
  if (has(frame) === false) {
2153
- bind(frame, "load" /* LoadEvent */, generate.bind(this, frame, "childList" /* ChildList */), true);
2161
+ bind(frame, "load" /* Constant.LoadEvent */, generate.bind(this, frame, "childList" /* Constant.ChildList */), true);
2154
2162
  }
2155
2163
  }
2156
2164
  function stop$h() {
@@ -2168,14 +2176,14 @@ function stop$h() {
2168
2176
  timeout$1 = null;
2169
2177
  }
2170
2178
  function active$2() {
2171
- activePeriod = time() + 3000 /* MutationActivePeriod */;
2179
+ activePeriod = time() + 3000 /* Setting.MutationActivePeriod */;
2172
2180
  }
2173
2181
  function handle$1(m) {
2174
2182
  // Queue up mutation records for asynchronous processing
2175
2183
  var now = time();
2176
- track$6(6 /* Mutation */, now);
2184
+ track$6(6 /* Event.Mutation */, now);
2177
2185
  mutations.push({ time: now, mutations: m });
2178
- schedule$1(process$2, 1 /* High */).then(function () {
2186
+ schedule$1(process$2, 1 /* Priority.High */).then(function () {
2179
2187
  setTimeout(compute$7);
2180
2188
  measure(compute$6)();
2181
2189
  });
@@ -2186,7 +2194,7 @@ function process$2() {
2186
2194
  return __generator(this, function (_b) {
2187
2195
  switch (_b.label) {
2188
2196
  case 0:
2189
- timer = { id: id(), cost: 3 /* LayoutCost */ };
2197
+ timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
2190
2198
  start$w(timer);
2191
2199
  _b.label = 1;
2192
2200
  case 1:
@@ -2198,13 +2206,13 @@ function process$2() {
2198
2206
  if (!(_i < _a.length)) return [3 /*break*/, 6];
2199
2207
  mutation = _a[_i];
2200
2208
  state = state$8(timer);
2201
- if (!(state === 0 /* Wait */)) return [3 /*break*/, 4];
2209
+ if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 4];
2202
2210
  return [4 /*yield*/, suspend$1(timer)];
2203
2211
  case 3:
2204
2212
  state = _b.sent();
2205
2213
  _b.label = 4;
2206
2214
  case 4:
2207
- if (state === 2 /* Stop */) {
2215
+ if (state === 2 /* Task.Stop */) {
2208
2216
  return [3 /*break*/, 6];
2209
2217
  }
2210
2218
  target = mutation.target;
@@ -2216,17 +2224,17 @@ function process$2() {
2216
2224
  parse$1(target);
2217
2225
  }
2218
2226
  switch (type) {
2219
- case "attributes" /* Attributes */:
2220
- processNode(target, 3 /* Attributes */);
2227
+ case "attributes" /* Constant.Attributes */:
2228
+ processNode(target, 3 /* Source.Attributes */);
2221
2229
  break;
2222
- case "characterData" /* CharacterData */:
2223
- processNode(target, 4 /* CharacterData */);
2230
+ case "characterData" /* Constant.CharacterData */:
2231
+ processNode(target, 4 /* Source.CharacterData */);
2224
2232
  break;
2225
- case "childList" /* ChildList */:
2226
- processNodeList(mutation.addedNodes, 1 /* ChildListAdd */, timer);
2227
- processNodeList(mutation.removedNodes, 2 /* ChildListRemove */, timer);
2233
+ case "childList" /* Constant.ChildList */:
2234
+ processNodeList(mutation.addedNodes, 1 /* Source.ChildListAdd */, timer);
2235
+ processNodeList(mutation.removedNodes, 2 /* Source.ChildListRemove */, timer);
2228
2236
  break;
2229
- case "suspend" /* Suspend */:
2237
+ case "suspend" /* Constant.Suspend */:
2230
2238
  value = get(target);
2231
2239
  if (value) {
2232
2240
  value.metadata.suspend = true;
@@ -2237,7 +2245,7 @@ function process$2() {
2237
2245
  case 5:
2238
2246
  _i++;
2239
2247
  return [3 /*break*/, 2];
2240
- case 6: return [4 /*yield*/, encode$4(6 /* Mutation */, timer, record.time)];
2248
+ case 6: return [4 /*yield*/, encode$4(6 /* Event.Mutation */, timer, record.time)];
2241
2249
  case 7:
2242
2250
  _b.sent();
2243
2251
  return [3 /*break*/, 1];
@@ -2251,11 +2259,11 @@ function process$2() {
2251
2259
  function track$5(m, timer) {
2252
2260
  var value = m.target ? get(m.target.parentNode) : null;
2253
2261
  // Check if the parent is already discovered and that the parent is not the document root
2254
- if (value && value.data.tag !== "HTML" /* HTML */) {
2262
+ if (value && value.data.tag !== "HTML" /* Constant.HTML */) {
2255
2263
  var inactive = time() > activePeriod;
2256
2264
  var target = get(m.target);
2257
2265
  var element = target && target.selector ? target.selector.join() : m.target.nodeName;
2258
- var parent_1 = value.selector ? value.selector.join() : "" /* Empty */;
2266
+ var parent_1 = value.selector ? value.selector.join() : "" /* Constant.Empty */;
2259
2267
  // We use selector, instead of id, to determine the key (signature for the mutation) because in some cases
2260
2268
  // repeated mutations can cause elements to be destroyed and then recreated as new DOM nodes
2261
2269
  // In those cases, IDs will change however the selector (which is relative to DOM xPath) remains the same
@@ -2264,20 +2272,20 @@ function track$5(m, timer) {
2264
2272
  history$4[key] = key in history$4 ? history$4[key] : [0];
2265
2273
  var h = history$4[key];
2266
2274
  // 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 /* MutationSuspendThreshold */) {
2268
- processNodeList(h[1], 2 /* ChildListRemove */, timer);
2275
+ if (inactive === false && h[0] >= 10 /* Setting.MutationSuspendThreshold */) {
2276
+ processNodeList(h[1], 2 /* Source.ChildListRemove */, timer);
2269
2277
  }
2270
2278
  // Update the counter
2271
2279
  h[0] = inactive ? h[0] + 1 : 1;
2272
2280
  // Return updated mutation type based on if we have already hit the threshold or not
2273
- if (h[0] === 10 /* MutationSuspendThreshold */) {
2281
+ if (h[0] === 10 /* Setting.MutationSuspendThreshold */) {
2274
2282
  // Store a reference to removedNodes so we can process them later
2275
2283
  // when we resume mutations again on user interactions
2276
2284
  h[1] = m.removedNodes;
2277
- return "suspend" /* Suspend */;
2285
+ return "suspend" /* Constant.Suspend */;
2278
2286
  }
2279
- else if (h[0] > 10 /* MutationSuspendThreshold */) {
2280
- return "" /* Empty */;
2287
+ else if (h[0] > 10 /* Setting.MutationSuspendThreshold */) {
2288
+ return "" /* Constant.Empty */;
2281
2289
  }
2282
2290
  }
2283
2291
  return m.type;
@@ -2300,18 +2308,18 @@ function processNodeList(list, source, timer) {
2300
2308
  _a.label = 1;
2301
2309
  case 1:
2302
2310
  if (!(i < length)) return [3 /*break*/, 6];
2303
- if (!(source === 1 /* ChildListAdd */)) return [3 /*break*/, 2];
2311
+ if (!(source === 1 /* Source.ChildListAdd */)) return [3 /*break*/, 2];
2304
2312
  traverse(list[i], timer, source);
2305
2313
  return [3 /*break*/, 5];
2306
2314
  case 2:
2307
2315
  state = state$8(timer);
2308
- if (!(state === 0 /* Wait */)) return [3 /*break*/, 4];
2316
+ if (!(state === 0 /* Task.Wait */)) return [3 /*break*/, 4];
2309
2317
  return [4 /*yield*/, suspend$1(timer)];
2310
2318
  case 3:
2311
2319
  state = _a.sent();
2312
2320
  _a.label = 4;
2313
2321
  case 4:
2314
- if (state === 2 /* Stop */) {
2322
+ if (state === 2 /* Task.Stop */) {
2315
2323
  return [3 /*break*/, 6];
2316
2324
  }
2317
2325
  processNode(list[i], source);
@@ -2336,7 +2344,7 @@ function schedule(node, fragment) {
2336
2344
  if (timeout$1) {
2337
2345
  clearTimeout(timeout$1);
2338
2346
  }
2339
- timeout$1 = setTimeout(function () { trigger$1(fragment); }, 33 /* LookAhead */);
2347
+ timeout$1 = setTimeout(function () { trigger$1(fragment); }, 33 /* Setting.LookAhead */);
2340
2348
  return node;
2341
2349
  }
2342
2350
  function trigger$1(fragment) {
@@ -2349,7 +2357,7 @@ function trigger$1(fragment) {
2349
2357
  if (shadowRoot && has(node)) {
2350
2358
  continue;
2351
2359
  }
2352
- generate(node, shadowRoot || fragment ? "childList" /* ChildList */ : "characterData" /* CharacterData */);
2360
+ generate(node, shadowRoot || fragment ? "childList" /* Constant.ChildList */ : "characterData" /* Constant.CharacterData */);
2353
2361
  }
2354
2362
  }
2355
2363
  queue$2 = [];
@@ -2399,9 +2407,9 @@ function reset$7() {
2399
2407
  hashMap = {};
2400
2408
  override = [];
2401
2409
  unmask = [];
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 */);
2410
+ maskText = "address,password,contact" /* Mask.Text */.split("," /* Constant.Comma */);
2411
+ 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 */);
2412
+ maskDisable = "radio,checkbox,range,button,reset,submit" /* Mask.Disable */.split("," /* Constant.Comma */);
2405
2413
  idMap = new WeakMap();
2406
2414
  iframeMap = new WeakMap();
2407
2415
  privacyMap = new WeakMap();
@@ -2417,19 +2425,19 @@ function parse$1(root, init) {
2417
2425
  try {
2418
2426
  // Parse unmask configuration into separate query selectors and override tokens as part of initialization
2419
2427
  if (init) {
2420
- config$1.unmask.forEach(function (x) { return x.indexOf("!" /* Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
2428
+ config$1.unmask.forEach(function (x) { return x.indexOf("!" /* Constant.Bang */) < 0 ? unmask.push(x) : override.push(x.substr(1)); });
2421
2429
  }
2422
2430
  // Since mutations may happen on leaf nodes too, e.g. text nodes, which may not support all selector APIs.
2423
2431
  // We ensure that the root note supports querySelectorAll API before executing the code below to identify new regions.
2424
2432
  if ("querySelectorAll" in root) {
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
2433
+ config$1.regions.forEach(function (x) { return root.querySelectorAll(x[1]).forEach(function (e) { return observe$1(e, "".concat(x[0])); }); }); // Regions
2434
+ config$1.mask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 3 /* Privacy.TextImage */); }); }); // Masked Elements
2427
2435
  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 /* None */); }); }); // Unmasked Elements
2436
+ unmask.forEach(function (x) { return root.querySelectorAll(x).forEach(function (e) { return privacyMap.set(e, 0 /* Privacy.None */); }); }); // Unmasked Elements
2429
2437
  }
2430
2438
  }
2431
2439
  catch (e) {
2432
- log$1(5 /* Selector */, 1 /* Warning */, e ? e.name : null);
2440
+ log$1(5 /* Code.Selector */, 1 /* Severity.Warning */, e ? e.name : null);
2433
2441
  }
2434
2442
  }
2435
2443
  function getId(node, autogen) {
@@ -2452,7 +2460,7 @@ function add(node, parent, data, source) {
2452
2460
  var regionId = exists(node) ? id : null;
2453
2461
  var fragmentId = null;
2454
2462
  var fraudId = fraudMap.has(node) ? fraudMap.get(node) : null;
2455
- var privacyId = config$1.content ? 1 /* Sensitive */ : 3 /* TextImage */;
2463
+ var privacyId = config$1.content ? 1 /* Privacy.Sensitive */ : 3 /* Privacy.TextImage */;
2456
2464
  if (parentId >= 0 && values[parentId]) {
2457
2465
  parentValue = values[parentId];
2458
2466
  parentValue.children.push(id);
@@ -2462,8 +2470,8 @@ function add(node, parent, data, source) {
2462
2470
  privacyId = parentValue.metadata.privacy;
2463
2471
  }
2464
2472
  // 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" /* RegionData */ in data.attributes) {
2466
- observe$1(node, data.attributes["data-clarity-region" /* RegionData */]);
2473
+ if (data.attributes && "data-clarity-region" /* Constant.RegionData */ in data.attributes) {
2474
+ observe$1(node, data.attributes["data-clarity-region" /* Constant.RegionData */]);
2467
2475
  regionId = id;
2468
2476
  }
2469
2477
  nodes[id] = node;
@@ -2541,7 +2549,7 @@ function update$1(node, parent, data, source) {
2541
2549
  }
2542
2550
  function sameorigin(node) {
2543
2551
  var output = false;
2544
- if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "IFRAME" /* IFrameTag */) {
2552
+ if (node.nodeType === Node.ELEMENT_NODE && node.tagName === "IFRAME" /* Constant.IFrameTag */) {
2545
2553
  var frame = node;
2546
2554
  // To determine if the iframe is same-origin or not, we try accessing it's contentDocument.
2547
2555
  // If the browser throws an exception, we assume it's cross-origin and move on.
@@ -2568,11 +2576,11 @@ function privacy(node, value, parent) {
2568
2576
  var attributes = data.attributes || {};
2569
2577
  var tag = data.tag.toUpperCase();
2570
2578
  switch (true) {
2571
- case "data-clarity-mask" /* MaskData */ in attributes:
2572
- metadata.privacy = 3 /* TextImage */;
2579
+ case "data-clarity-mask" /* Constant.MaskData */ in attributes:
2580
+ metadata.privacy = 3 /* Privacy.TextImage */;
2573
2581
  break;
2574
- case "data-clarity-unmask" /* UnmaskData */ in attributes:
2575
- metadata.privacy = 0 /* None */;
2582
+ case "data-clarity-unmask" /* Constant.UnmaskData */ in attributes:
2583
+ metadata.privacy = 0 /* Privacy.None */;
2576
2584
  break;
2577
2585
  case privacyMap.has(node):
2578
2586
  // If this node was explicitly configured to contain sensitive content, honor that privacy setting
@@ -2580,38 +2588,38 @@ function privacy(node, value, parent) {
2580
2588
  break;
2581
2589
  case fraudMap.has(node):
2582
2590
  // If this node was explicitly configured to be evaluated for fraud, then also mask content
2583
- metadata.privacy = 2 /* Text */;
2591
+ metadata.privacy = 2 /* Privacy.Text */;
2584
2592
  break;
2585
- case tag === "*T" /* TextTag */:
2593
+ case tag === "*T" /* Constant.TextTag */:
2586
2594
  // 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 : "" /* 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;
2595
+ var pTag = parent && parent.data ? parent.data.tag : "" /* Constant.Empty */;
2596
+ var pSelector_1 = parent && parent.selector ? parent.selector[1 /* Selector.Default */] : "" /* Constant.Empty */;
2597
+ var tags = ["STYLE" /* Constant.StyleTag */, "TITLE" /* Constant.TitleTag */, "svg:style" /* Constant.SvgStyle */];
2598
+ metadata.privacy = tags.includes(pTag) || override.some(function (x) { return pSelector_1.indexOf(x) >= 0; }) ? 0 /* Privacy.None */ : current;
2591
2599
  break;
2592
- case tag === "INPUT" /* InputTag */ && current === 0 /* None */:
2600
+ case tag === "INPUT" /* Constant.InputTag */ && current === 0 /* Privacy.None */:
2593
2601
  // If even default privacy setting is to not mask, we still scan through input fields for any sensitive information
2594
- var field_1 = "" /* Empty */;
2602
+ var field_1 = "" /* Constant.Empty */;
2595
2603
  Object.keys(attributes).forEach(function (x) { return field_1 += attributes[x].toLowerCase(); });
2596
2604
  metadata.privacy = inspect(field_1, maskInput, metadata);
2597
2605
  break;
2598
- case tag === "INPUT" /* InputTag */ && current === 1 /* Sensitive */:
2606
+ case tag === "INPUT" /* Constant.InputTag */ && current === 1 /* Privacy.Sensitive */:
2599
2607
  // Look through class names to aggressively mask content
2600
- metadata.privacy = inspect(attributes["class" /* Class */], maskText, metadata);
2608
+ metadata.privacy = inspect(attributes["class" /* Constant.Class */], maskText, metadata);
2601
2609
  // 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);
2610
+ metadata.privacy = inspect(attributes["type" /* Constant.Type */], maskInput, metadata);
2603
2611
  // 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;
2612
+ metadata.privacy = maskDisable.indexOf(attributes["type" /* Constant.Type */]) >= 0 ? 0 /* Privacy.None */ : metadata.privacy;
2605
2613
  break;
2606
- case current === 1 /* Sensitive */:
2614
+ case current === 1 /* Privacy.Sensitive */:
2607
2615
  // In a mode where we mask sensitive information by default, look through class names to aggressively mask content
2608
- metadata.privacy = inspect(attributes["class" /* Class */], maskText, metadata);
2616
+ metadata.privacy = inspect(attributes["class" /* Constant.Class */], maskText, metadata);
2609
2617
  break;
2610
2618
  }
2611
2619
  }
2612
2620
  function inspect(input, lookup, metadata) {
2613
2621
  if (input && lookup.some(function (x) { return input.indexOf(x) >= 0; })) {
2614
- return 2 /* Text */;
2622
+ return 2 /* Privacy.Text */;
2615
2623
  }
2616
2624
  return metadata.privacy;
2617
2625
  }
@@ -2649,7 +2657,7 @@ function updateSelector(value) {
2649
2657
  var d = value.data;
2650
2658
  var p = position(parent, value);
2651
2659
  var s = { id: value.id, tag: d.tag, prefix: prefix, position: p, attributes: d.attributes };
2652
- value.selector = [get$1(s, 0 /* Alpha */), get$1(s, 1 /* Beta */)];
2660
+ value.selector = [get$1(s, 0 /* Selector.Alpha */), get$1(s, 1 /* Selector.Beta */)];
2653
2661
  value.hash = value.selector.map(function (x) { return x ? hash(x) : null; });
2654
2662
  value.hash.forEach(function (h) { return hashMap[h] = value.id; });
2655
2663
  // Match fragment configuration against both alpha and beta hash
@@ -2657,6 +2665,11 @@ function updateSelector(value) {
2657
2665
  value.fragment = value.id;
2658
2666
  }
2659
2667
  }
2668
+ function hashText(hash) {
2669
+ var id = lookup(hash);
2670
+ var node = getNode(id);
2671
+ return node !== null && node.textContent !== null ? node.textContent.substr(0, 25 /* Setting.ClickText */) : '';
2672
+ }
2660
2673
  function getNode(id) {
2661
2674
  if (id in nodes) {
2662
2675
  return nodes[id];
@@ -2704,7 +2717,7 @@ function remove(id, source) {
2704
2717
  }
2705
2718
  function size(value) {
2706
2719
  // If this element is a image node, and is masked, then track box model for the current element
2707
- if (value.data.tag === "IMG" /* ImageTag */ && value.metadata.privacy === 3 /* TextImage */) {
2720
+ if (value.data.tag === "IMG" /* Constant.ImageTag */ && value.metadata.privacy === 3 /* Privacy.TextImage */) {
2708
2721
  value.metadata.size = [];
2709
2722
  }
2710
2723
  }
@@ -2739,7 +2752,7 @@ function track$4(id, source, fragment, changed, parentChanged) {
2739
2752
  // Edge case: If an element is added later on, and pre-discovered element is moved as a child.
2740
2753
  // In that case, we need to reorder the pre-discovered element in the update list to keep visualization consistent.
2741
2754
  var uIndex = updateMap.indexOf(id);
2742
- if (uIndex >= 0 && source === 1 /* ChildListAdd */ && parentChanged) {
2755
+ if (uIndex >= 0 && source === 1 /* Source.ChildListAdd */ && parentChanged) {
2743
2756
  updateMap.splice(uIndex, 1);
2744
2757
  updateMap.push(id);
2745
2758
  }
@@ -2785,15 +2798,15 @@ function exists(node) {
2785
2798
  }
2786
2799
  function track$3(id, event) {
2787
2800
  var node = getNode(id);
2788
- var data = id in regions ? regions[id] : { id: id, visibility: 0 /* Rendered */, interaction: 16 /* None */, name: regionMap.get(node) };
2801
+ var data = id in regions ? regions[id] : { id: id, visibility: 0 /* RegionVisibility.Rendered */, interaction: 16 /* InteractionState.None */, name: regionMap.get(node) };
2789
2802
  // Determine the interaction state based on incoming event
2790
- var interaction = 16 /* None */;
2803
+ var interaction = 16 /* InteractionState.None */;
2791
2804
  switch (event) {
2792
- case 9 /* Click */:
2793
- interaction = 20 /* Clicked */;
2805
+ case 9 /* Event.Click */:
2806
+ interaction = 20 /* InteractionState.Clicked */;
2794
2807
  break;
2795
- case 27 /* Input */:
2796
- interaction = 30 /* Input */;
2808
+ case 27 /* Event.Input */:
2809
+ interaction = 30 /* InteractionState.Input */;
2797
2810
  break;
2798
2811
  }
2799
2812
  // Process updates to this region, if applicable
@@ -2821,7 +2834,7 @@ function compute$6() {
2821
2834
  queue$1 = q;
2822
2835
  // Schedule encode only when we have at least one valid data entry
2823
2836
  if (state$1.length > 0) {
2824
- encode$4(7 /* Region */);
2837
+ encode$4(7 /* Event.Region */);
2825
2838
  }
2826
2839
  }
2827
2840
  function handler$1(entries) {
@@ -2837,27 +2850,27 @@ function handler$1(entries) {
2837
2850
  // 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
2838
2851
  if (regionMap.has(target) && rect.width + rect.height > 0 && viewport.width > 0 && viewport.height > 0) {
2839
2852
  var id = target ? getId(target) : null;
2840
- var data = id in regions ? regions[id] : { id: id, name: regionMap.get(target), interaction: 16 /* None */, visibility: 0 /* Rendered */ };
2853
+ var data = id in regions ? regions[id] : { id: id, name: regionMap.get(target), interaction: 16 /* InteractionState.None */, visibility: 0 /* RegionVisibility.Rendered */ };
2841
2854
  // For regions that have relatively smaller area, we look at intersection ratio and see the overlap relative to element's area
2842
2855
  // However, for larger regions, area of regions could be bigger than viewport and therefore comparison is relative to visible area
2843
2856
  var viewportRatio = overlap ? (overlap.width * overlap.height * 1.0) / (viewport.width * viewport.height) : 0;
2844
- var visible = viewportRatio > 0.05 /* ViewportIntersectionRatio */ || entry.intersectionRatio > 0.8 /* IntersectionRatio */;
2857
+ var visible = viewportRatio > 0.05 /* Setting.ViewportIntersectionRatio */ || entry.intersectionRatio > 0.8 /* Setting.IntersectionRatio */;
2845
2858
  // If an element is either visible or was visible and has been scrolled to the end
2846
2859
  // 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.
2847
2860
  // 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
2848
- var scrolledToEnd = (visible || data.visibility == 10 /* Visible */) && Math.abs(rect.top) + viewport.height > rect.height;
2861
+ var scrolledToEnd = (visible || data.visibility == 10 /* RegionVisibility.Visible */) && Math.abs(rect.top) + viewport.height > rect.height;
2849
2862
  // Process updates to this region, if applicable
2850
2863
  process$1(target, data, data.interaction, (scrolledToEnd ?
2851
- 13 /* ScrolledToEnd */ :
2852
- (visible ? 10 /* Visible */ : 0 /* Rendered */)));
2864
+ 13 /* RegionVisibility.ScrolledToEnd */ :
2865
+ (visible ? 10 /* RegionVisibility.Visible */ : 0 /* RegionVisibility.Rendered */)));
2853
2866
  // Stop observing this element now that we have already received scrolled signal
2854
- if (data.visibility >= 13 /* ScrolledToEnd */ && observer$1) {
2867
+ if (data.visibility >= 13 /* RegionVisibility.ScrolledToEnd */ && observer$1) {
2855
2868
  observer$1.unobserve(target);
2856
2869
  }
2857
2870
  }
2858
2871
  }
2859
2872
  if (state$1.length > 0) {
2860
- encode$4(7 /* Region */);
2873
+ encode$4(7 /* Event.Region */);
2861
2874
  }
2862
2875
  }
2863
2876
  function process$1(n, d, s, v) {
@@ -2916,7 +2929,7 @@ function link(node) {
2916
2929
  function metadata$2(node, event, text) {
2917
2930
  if (text === void 0) { text = null; }
2918
2931
  // If the node is null, we return a reserved value for id: 0. Valid assignment of id begins from 1+.
2919
- var output = { id: 0, hash: null, privacy: 2 /* Text */, node: node };
2932
+ var output = { id: 0, hash: null, privacy: 2 /* Privacy.Text */, node: node };
2920
2933
  if (node) {
2921
2934
  var value = get(node);
2922
2935
  if (value !== null) {
@@ -2942,15 +2955,15 @@ function encode$3 (type) {
2942
2955
  t = time();
2943
2956
  tokens = [t, type];
2944
2957
  switch (type) {
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 */:
2958
+ case 13 /* Event.MouseDown */:
2959
+ case 14 /* Event.MouseUp */:
2960
+ case 12 /* Event.MouseMove */:
2961
+ case 15 /* Event.MouseWheel */:
2962
+ case 16 /* Event.DoubleClick */:
2963
+ case 17 /* Event.TouchStart */:
2964
+ case 18 /* Event.TouchEnd */:
2965
+ case 19 /* Event.TouchMove */:
2966
+ case 20 /* Event.TouchCancel */:
2954
2967
  for (_i = 0, _a = state$4; _i < _a.length; _i++) {
2955
2968
  entry = _a[_i];
2956
2969
  pTarget = metadata$2(entry.data.target, entry.event);
@@ -2965,12 +2978,12 @@ function encode$3 (type) {
2965
2978
  }
2966
2979
  reset$e();
2967
2980
  break;
2968
- case 9 /* Click */:
2981
+ case 9 /* Event.Click */:
2969
2982
  for (_b = 0, _c = state$7; _b < _c.length; _b++) {
2970
2983
  entry = _c[_b];
2971
2984
  cTarget = metadata$2(entry.data.target, entry.event, entry.data.text);
2972
2985
  tokens = [entry.time, entry.event];
2973
- cHash = cTarget.hash.join("." /* Dot */);
2986
+ cHash = cTarget.hash.join("." /* Constant.Dot */);
2974
2987
  tokens.push(cTarget.id);
2975
2988
  tokens.push(entry.data.x);
2976
2989
  tokens.push(entry.data.y);
@@ -2988,7 +3001,7 @@ function encode$3 (type) {
2988
3001
  }
2989
3002
  reset$h();
2990
3003
  break;
2991
- case 38 /* Clipboard */:
3004
+ case 38 /* Event.Clipboard */:
2992
3005
  for (_d = 0, _e = state$6; _d < _e.length; _d++) {
2993
3006
  entry = _e[_d];
2994
3007
  tokens = [entry.time, entry.event];
@@ -3001,7 +3014,7 @@ function encode$3 (type) {
3001
3014
  }
3002
3015
  reset$g();
3003
3016
  break;
3004
- case 11 /* Resize */:
3017
+ case 11 /* Event.Resize */:
3005
3018
  r = data$b;
3006
3019
  tokens.push(r.width);
3007
3020
  tokens.push(r.height);
@@ -3009,13 +3022,13 @@ function encode$3 (type) {
3009
3022
  reset$d();
3010
3023
  queue(tokens);
3011
3024
  break;
3012
- case 26 /* Unload */:
3025
+ case 26 /* Event.Unload */:
3013
3026
  u = data$9;
3014
3027
  tokens.push(u.name);
3015
3028
  reset$9();
3016
3029
  queue(tokens);
3017
3030
  break;
3018
- case 27 /* Input */:
3031
+ case 27 /* Event.Input */:
3019
3032
  for (_f = 0, _g = state$5; _f < _g.length; _f++) {
3020
3033
  entry = _g[_f];
3021
3034
  iTarget = metadata$2(entry.data.target, entry.event, entry.data.value);
@@ -3026,7 +3039,7 @@ function encode$3 (type) {
3026
3039
  }
3027
3040
  reset$f();
3028
3041
  break;
3029
- case 21 /* Selection */:
3042
+ case 21 /* Event.Selection */:
3030
3043
  s = data$a;
3031
3044
  if (s) {
3032
3045
  startTarget = metadata$2(s.start, type);
@@ -3039,7 +3052,7 @@ function encode$3 (type) {
3039
3052
  queue(tokens);
3040
3053
  }
3041
3054
  break;
3042
- case 10 /* Scroll */:
3055
+ case 10 /* Event.Scroll */:
3043
3056
  for (_h = 0, _j = state$3; _h < _j.length; _h++) {
3044
3057
  entry = _j[_h];
3045
3058
  sTarget = metadata$2(entry.data.target, entry.event);
@@ -3054,7 +3067,7 @@ function encode$3 (type) {
3054
3067
  }
3055
3068
  reset$c();
3056
3069
  break;
3057
- case 39 /* Submit */:
3070
+ case 39 /* Event.Submit */:
3058
3071
  for (_k = 0, _l = state$2; _k < _l.length; _k++) {
3059
3072
  entry = _l[_k];
3060
3073
  tokens = [entry.time, entry.event];
@@ -3066,7 +3079,7 @@ function encode$3 (type) {
3066
3079
  }
3067
3080
  reset$a();
3068
3081
  break;
3069
- case 22 /* Timeline */:
3082
+ case 22 /* Event.Timeline */:
3070
3083
  for (_m = 0, _o = updates$1; _m < _o.length; _m++) {
3071
3084
  entry = _o[_m];
3072
3085
  tokens = [entry.time, entry.event];
@@ -3080,7 +3093,7 @@ function encode$3 (type) {
3080
3093
  }
3081
3094
  reset$5();
3082
3095
  break;
3083
- case 28 /* Visibility */:
3096
+ case 28 /* Event.Visibility */:
3084
3097
  v = data$8;
3085
3098
  tokens.push(v.visible);
3086
3099
  queue(tokens);
@@ -3103,11 +3116,11 @@ function reset$5() {
3103
3116
  updates$1 = [];
3104
3117
  }
3105
3118
  function track$2(time, event, hash, x, y, reaction, context) {
3106
- if (reaction === void 0) { reaction = 1 /* True */; }
3107
- if (context === void 0) { context = 0 /* Self */; }
3119
+ if (reaction === void 0) { reaction = 1 /* BooleanFlag.True */; }
3120
+ if (context === void 0) { context = 0 /* BrowsingContext.Self */; }
3108
3121
  state.push({
3109
3122
  time: time,
3110
- event: 22 /* Timeline */,
3123
+ event: 22 /* Event.Timeline */,
3111
3124
  data: {
3112
3125
  type: event,
3113
3126
  hash: hash,
@@ -3126,7 +3139,7 @@ function compute$5() {
3126
3139
  var temp = [];
3127
3140
  updates$1 = [];
3128
3141
  var max = data$1.start + data$1.duration;
3129
- var min = Math.max(max - 2000 /* TimelineSpan */, 0);
3142
+ var min = Math.max(max - 2000 /* Setting.TimelineSpan */, 0);
3130
3143
  for (var _i = 0, state_1 = state; _i < state_1.length; _i++) {
3131
3144
  var s = state_1[_i];
3132
3145
  if (s.time >= min) {
@@ -3137,7 +3150,7 @@ function compute$5() {
3137
3150
  }
3138
3151
  }
3139
3152
  state = temp; // Drop events less than the min time
3140
- encode$3(22 /* Timeline */);
3153
+ encode$3(22 /* Event.Timeline */);
3141
3154
  }
3142
3155
  function stop$e() {
3143
3156
  state = [];
@@ -3170,10 +3183,10 @@ function queue(tokens, transmit) {
3170
3183
  var type = tokens.length > 1 ? tokens[1] : null;
3171
3184
  var event_1 = JSON.stringify(tokens);
3172
3185
  switch (type) {
3173
- case 5 /* Discover */:
3186
+ case 5 /* Event.Discover */:
3174
3187
  discoverBytes += event_1.length;
3175
- case 37 /* Box */:
3176
- case 6 /* Mutation */:
3188
+ case 37 /* Event.Box */:
3189
+ case 6 /* Event.Mutation */:
3177
3190
  playbackBytes += event_1.length;
3178
3191
  playback.push(event_1);
3179
3192
  break;
@@ -3182,7 +3195,7 @@ function queue(tokens, transmit) {
3182
3195
  break;
3183
3196
  }
3184
3197
  // Increment event count metric
3185
- count$1(25 /* EventCount */);
3198
+ count$1(25 /* Metric.EventCount */);
3186
3199
  // Following two checks are precautionary and act as a fail safe mechanism to get out of unexpected situations.
3187
3200
  // Check 1: If for any reason the upload hasn't happened after waiting for 2x the config.delay time,
3188
3201
  // reset the timer. This allows Clarity to attempt an upload again.
@@ -3195,7 +3208,7 @@ function queue(tokens, transmit) {
3195
3208
  // However, in certain scenarios - like metric calculation - which are triggered as part of an existing upload
3196
3209
  // We enrich the data going out with the existing upload. In these cases, call to upload comes with 'transmit' set to false.
3197
3210
  if (transmit && timeout === null) {
3198
- if (type !== 25 /* Ping */) {
3211
+ if (type !== 25 /* Event.Ping */) {
3199
3212
  reset$n();
3200
3213
  }
3201
3214
  timeout = setTimeout(upload, gap);
@@ -3224,9 +3237,9 @@ function upload(final) {
3224
3237
  switch (_b.label) {
3225
3238
  case 0:
3226
3239
  timeout = null;
3227
- sendPlaybackBytes = config$1.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* MaxFirstPayloadBytes */ || data$1.sequence > 0);
3240
+ sendPlaybackBytes = config$1.lean === false && playbackBytes > 0 && (playbackBytes < 1048576 /* Setting.MaxFirstPayloadBytes */ || data$1.sequence > 0);
3228
3241
  if (sendPlaybackBytes) {
3229
- max(1 /* Playback */, 1 /* True */);
3242
+ max(1 /* Metric.Playback */, 1 /* BooleanFlag.True */);
3230
3243
  }
3231
3244
  // CAUTION: Ensure "transmit" is set to false in the queue function for following events
3232
3245
  // Otherwise you run a risk of infinite loop.
@@ -3235,8 +3248,8 @@ function upload(final) {
3235
3248
  compute$8();
3236
3249
  last = final === true;
3237
3250
  e = JSON.stringify(envelope(last));
3238
- a = "[" + analysis.join() + "]";
3239
- p = sendPlaybackBytes ? "[" + playback.join() + "]" : "" /* Empty */;
3251
+ a = "[".concat(analysis.join(), "]");
3252
+ p = sendPlaybackBytes ? "[".concat(playback.join(), "]") : "" /* Constant.Empty */;
3240
3253
  encoded = { e: e, a: a, p: p };
3241
3254
  payload = stringify(encoded);
3242
3255
  if (!last) return [3 /*break*/, 1];
@@ -3248,7 +3261,7 @@ function upload(final) {
3248
3261
  _b.label = 3;
3249
3262
  case 3:
3250
3263
  zipped = _a;
3251
- sum(2 /* TotalBytes */, zipped ? zipped.length : payload.length);
3264
+ sum(2 /* Metric.TotalBytes */, zipped ? zipped.length : payload.length);
3252
3265
  send(payload, zipped, data$1.sequence, last);
3253
3266
  // Clear out events now that payload has been dispatched
3254
3267
  analysis = [];
@@ -3263,12 +3276,12 @@ function upload(final) {
3263
3276
  });
3264
3277
  }
3265
3278
  function stringify(encoded) {
3266
- return encoded.p.length > 0 ? "{\"e\":" + encoded.e + ",\"a\":" + encoded.a + ",\"p\":" + encoded.p + "}" : "{\"e\":" + encoded.e + ",\"a\":" + encoded.a + "}";
3279
+ 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, "}");
3267
3280
  }
3268
3281
  function send(payload, zipped, sequence, beacon) {
3269
3282
  if (beacon === void 0) { beacon = false; }
3270
3283
  // Upload data if a valid URL is defined in the config
3271
- if (typeof config$1.upload === "string" /* String */) {
3284
+ if (typeof config$1.upload === "string" /* Constant.String */) {
3272
3285
  var url = config$1.upload;
3273
3286
  var dispatched = false;
3274
3287
  // If it's the last payload, attempt to upload using sendBeacon first.
@@ -3307,7 +3320,7 @@ function send(payload, zipped, sequence, beacon) {
3307
3320
  xhr_1.withCredentials = true;
3308
3321
  if (zipped) {
3309
3322
  // If we do have valid compressed array, send it with appropriate HTTP headers so server can decode it appropriately
3310
- xhr_1.setRequestHeader("Accept" /* Accept */, "application/x-clarity-gzip" /* ClarityGzip */);
3323
+ xhr_1.setRequestHeader("Accept" /* Constant.Accept */, "application/x-clarity-gzip" /* Constant.ClarityGzip */);
3311
3324
  xhr_1.send(zipped);
3312
3325
  }
3313
3326
  else {
@@ -3324,13 +3337,13 @@ function send(payload, zipped, sequence, beacon) {
3324
3337
  }
3325
3338
  function check$3(xhr, sequence) {
3326
3339
  var transitData = transit[sequence];
3327
- if (xhr && xhr.readyState === 4 /* Done */ && transitData) {
3340
+ if (xhr && xhr.readyState === 4 /* XMLReadyState.Done */ && transitData) {
3328
3341
  // Attempt send payload again (as configured in settings) if we do not receive a success (2XX) response code back from the server
3329
- if ((xhr.status < 200 || xhr.status > 208) && transitData.attempts <= 1 /* RetryLimit */) {
3342
+ if ((xhr.status < 200 || xhr.status > 208) && transitData.attempts <= 1 /* Setting.RetryLimit */) {
3330
3343
  // We re-attempt in all cases except when server explicitly rejects our request with 4XX error
3331
3344
  if (xhr.status >= 400 && xhr.status < 500) {
3332
3345
  // In case of a 4XX response from the server, we bail out instead of trying again
3333
- trigger(6 /* Server */);
3346
+ trigger(6 /* Check.Server */);
3334
3347
  }
3335
3348
  else {
3336
3349
  // Browser will send status = 0 when it refuses to put network request over the wire
@@ -3351,7 +3364,7 @@ function check$3(xhr, sequence) {
3351
3364
  track$1 = { sequence: sequence, attempts: transitData.attempts, status: xhr.status };
3352
3365
  // Send back an event only if we were not successful in our first attempt
3353
3366
  if (transitData.attempts > 1) {
3354
- encode$1(2 /* Upload */);
3367
+ encode$1(2 /* Event.Upload */);
3355
3368
  }
3356
3369
  // Handle response if it was a 200 response with a valid body
3357
3370
  if (xhr.status === 200 && xhr.responseText) {
@@ -3362,7 +3375,7 @@ function check$3(xhr, sequence) {
3362
3375
  // And, right before we terminate the session, we will attempt one last time to see if we can use
3363
3376
  // different transport option (sendBeacon vs. XHR) to get this data to the server for analysis purposes
3364
3377
  send(transitData.data, null, sequence, true);
3365
- trigger(3 /* Retry */);
3378
+ trigger(3 /* Check.Retry */);
3366
3379
  }
3367
3380
  // Signal that this request completed successfully
3368
3381
  if (xhr.status >= 200 && xhr.status <= 208) {
@@ -3382,21 +3395,21 @@ function done(sequence) {
3382
3395
  function delay() {
3383
3396
  // Progressively increase delay as we continue to send more payloads from the client to the server
3384
3397
  // If we are not uploading data to a server, and instead invoking UploadCallback, in that case keep returning configured value
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;
3398
+ var gap = config$1.lean === false && discoverBytes > 0 ? 100 /* Setting.MinUploadDelay */ : data$1.sequence * config$1.delay;
3399
+ return typeof config$1.upload === "string" /* Constant.String */ ? Math.max(Math.min(gap, 30000 /* Setting.MaxUploadDelay */), 100 /* Setting.MinUploadDelay */) : config$1.delay;
3387
3400
  }
3388
3401
  function response(payload) {
3389
- var parts = payload && payload.length > 0 ? payload.split(" ") : ["" /* Empty */];
3402
+ var parts = payload && payload.length > 0 ? payload.split(" ") : ["" /* Constant.Empty */];
3390
3403
  switch (parts[0]) {
3391
- case "END" /* End */:
3404
+ case "END" /* Constant.End */:
3392
3405
  // Clear out session storage and end the session so we can start fresh the next time
3393
- trigger(6 /* Server */);
3406
+ trigger(6 /* Check.Server */);
3394
3407
  break;
3395
- case "UPGRADE" /* Upgrade */:
3408
+ case "UPGRADE" /* Constant.Upgrade */:
3396
3409
  // Upgrade current session to send back playback information
3397
- upgrade("Auto" /* Auto */);
3410
+ upgrade("Auto" /* Constant.Auto */);
3398
3411
  break;
3399
- case "ACTION" /* Action */:
3412
+ case "ACTION" /* Constant.Action */:
3400
3413
  // Invoke action callback, if configured and has a valid value
3401
3414
  if (config$1.action && parts.length > 1) {
3402
3415
  config$1.action(parts[1]);
@@ -3418,7 +3431,7 @@ function handler(error) {
3418
3431
  if (!(e.message in history$3)) {
3419
3432
  history$3[e.message] = 0;
3420
3433
  }
3421
- if (history$3[e.message]++ >= 5 /* ScriptErrorLimit */) {
3434
+ if (history$3[e.message]++ >= 5 /* Setting.ScriptErrorLimit */) {
3422
3435
  return true;
3423
3436
  }
3424
3437
  // Send back information only if the handled error has valid information
@@ -3430,7 +3443,7 @@ function handler(error) {
3430
3443
  stack: e.stack,
3431
3444
  source: error["filename"]
3432
3445
  };
3433
- encode$2(31 /* ScriptError */);
3446
+ encode$2(31 /* Event.ScriptError */);
3434
3447
  }
3435
3448
  return true;
3436
3449
  }
@@ -3441,7 +3454,7 @@ function encode$2 (type) {
3441
3454
  return __generator(this, function (_a) {
3442
3455
  tokens = [time(), type];
3443
3456
  switch (type) {
3444
- case 31 /* ScriptError */:
3457
+ case 31 /* Event.ScriptError */:
3445
3458
  tokens.push(data$7.message);
3446
3459
  tokens.push(data$7.line);
3447
3460
  tokens.push(data$7.column);
@@ -3449,7 +3462,7 @@ function encode$2 (type) {
3449
3462
  tokens.push(data$7.source);
3450
3463
  queue(tokens);
3451
3464
  break;
3452
- case 33 /* Log */:
3465
+ case 33 /* Event.Log */:
3453
3466
  if (data$6) {
3454
3467
  tokens.push(data$6.code);
3455
3468
  tokens.push(data$6.name);
@@ -3459,7 +3472,7 @@ function encode$2 (type) {
3459
3472
  queue(tokens, false);
3460
3473
  }
3461
3474
  break;
3462
- case 41 /* Fraud */:
3475
+ case 41 /* Event.Fraud */:
3463
3476
  if (data$d) {
3464
3477
  tokens.push(data$d.id);
3465
3478
  tokens.push(data$d.target);
@@ -3482,7 +3495,7 @@ function log$1(code, severity, name, message, stack) {
3482
3495
  if (name === void 0) { name = null; }
3483
3496
  if (message === void 0) { message = null; }
3484
3497
  if (stack === void 0) { stack = null; }
3485
- var key = name ? name + "|" + message : "";
3498
+ var key = name ? "".concat(name, "|").concat(message) : "";
3486
3499
  // While rare, it's possible for code to fail repeatedly during the lifetime of the same page
3487
3500
  // In those cases, we only want to log the failure once and not spam logs with redundant information.
3488
3501
  if (code in history$2 && history$2[code].indexOf(key) >= 0) {
@@ -3496,7 +3509,7 @@ function log$1(code, severity, name, message, stack) {
3496
3509
  else {
3497
3510
  history$2[code] = [key];
3498
3511
  }
3499
- encode$2(33 /* Log */);
3512
+ encode$2(33 /* Event.Log */);
3500
3513
  }
3501
3514
  function stop$c() {
3502
3515
  history$2 = {};
@@ -3517,25 +3530,25 @@ function start$c() {
3517
3530
  var source = e[i];
3518
3531
  var key = e[i + 1];
3519
3532
  switch (source) {
3520
- case 0 /* Javascript */:
3533
+ case 0 /* ExtractSource.Javascript */:
3521
3534
  var variable = e[i + 2];
3522
3535
  variables[key] = parse(variable);
3523
3536
  break;
3524
- case 1 /* Cookie */:
3537
+ case 1 /* ExtractSource.Cookie */:
3525
3538
  /*Todo: Add cookie extract logic*/
3526
3539
  break;
3527
- case 2 /* Text */:
3540
+ case 2 /* ExtractSource.Text */:
3528
3541
  var match_1 = e[i + 2];
3529
3542
  selectors[key] = match_1;
3530
3543
  break;
3531
- case 3 /* Fragment */:
3544
+ case 3 /* ExtractSource.Fragment */:
3532
3545
  fragments = e[i + 2];
3533
3546
  break;
3534
3547
  }
3535
3548
  }
3536
3549
  }
3537
3550
  catch (e) {
3538
- log$1(8 /* Config */, 1 /* Warning */, e ? e.name : null);
3551
+ log$1(8 /* Code.Config */, 1 /* Severity.Warning */, e ? e.name : null);
3539
3552
  }
3540
3553
  }
3541
3554
  function clone(v) {
@@ -3557,9 +3570,9 @@ function compute$4() {
3557
3570
  }
3558
3571
  }
3559
3572
  catch (e) {
3560
- log$1(5 /* Selector */, 1 /* Warning */, e ? e.name : null);
3573
+ log$1(5 /* Code.Selector */, 1 /* Severity.Warning */, e ? e.name : null);
3561
3574
  }
3562
- encode$1(40 /* Extract */);
3575
+ encode$1(40 /* Event.Extract */);
3563
3576
  }
3564
3577
  function reset$4() {
3565
3578
  keys = [];
@@ -3579,15 +3592,15 @@ function stop$b() {
3579
3592
  }
3580
3593
  function parse(variable) {
3581
3594
  var syntax = [];
3582
- var parts = variable.split("." /* Dot */);
3595
+ var parts = variable.split("." /* Constant.Dot */);
3583
3596
  while (parts.length > 0) {
3584
3597
  var part = parts.shift();
3585
- var arrayStart = part.indexOf("[" /* ArrayStart */);
3586
- var conditionStart = part.indexOf("{" /* ConditionStart */);
3587
- var conditionEnd = part.indexOf("}" /* ConditionEnd */);
3598
+ var arrayStart = part.indexOf("[" /* Constant.ArrayStart */);
3599
+ var conditionStart = part.indexOf("{" /* Constant.ConditionStart */);
3600
+ var conditionEnd = part.indexOf("}" /* Constant.ConditionEnd */);
3588
3601
  syntax.push({
3589
3602
  name: arrayStart > 0 ? part.substring(0, arrayStart) : (conditionStart > 0 ? part.substring(0, conditionStart) : part),
3590
- type: arrayStart > 0 ? 1 /* Array */ : (conditionStart > 0 ? 2 /* Object */ : 3 /* Simple */),
3603
+ type: arrayStart > 0 ? 1 /* Type.Array */ : (conditionStart > 0 ? 2 /* Type.Object */ : 3 /* Type.Simple */),
3591
3604
  condition: conditionStart > 0 ? part.substring(conditionStart + 1, conditionEnd) : null
3592
3605
  });
3593
3606
  }
@@ -3605,7 +3618,7 @@ function evaluate(variable, base) {
3605
3618
  var output;
3606
3619
  if (base && base[part.name]) {
3607
3620
  var obj = base[part.name];
3608
- if (part.type !== 1 /* Array */ && match(obj, part.condition)) {
3621
+ if (part.type !== 1 /* Type.Array */ && match(obj, part.condition)) {
3609
3622
  output = evaluate(variable, obj);
3610
3623
  }
3611
3624
  else if (Array.isArray(obj)) {
@@ -3627,7 +3640,7 @@ function evaluate(variable, base) {
3627
3640
  }
3628
3641
  function str(input) {
3629
3642
  // Automatically trim string to max of Setting.ExtractLimit to avoid fetching long strings
3630
- return input ? JSON.stringify(input).substring(0, 10000 /* ExtractLimit */) : input;
3643
+ return input ? JSON.stringify(input).substring(0, 10000 /* Setting.ExtractLimit */) : input;
3631
3644
  }
3632
3645
  function match(base, condition) {
3633
3646
  if (condition) {
@@ -3641,7 +3654,7 @@ function encode$1 (event) {
3641
3654
  var t = time();
3642
3655
  var tokens = [t, event];
3643
3656
  switch (event) {
3644
- case 4 /* Baseline */:
3657
+ case 4 /* Event.Baseline */:
3645
3658
  var b = state$9;
3646
3659
  if (b) {
3647
3660
  tokens = [b.time, b.event];
@@ -3659,30 +3672,30 @@ function encode$1 (event) {
3659
3672
  }
3660
3673
  reset$p();
3661
3674
  break;
3662
- case 25 /* Ping */:
3675
+ case 25 /* Event.Ping */:
3663
3676
  tokens.push(data$h.gap);
3664
3677
  queue(tokens);
3665
3678
  break;
3666
- case 35 /* Limit */:
3679
+ case 35 /* Event.Limit */:
3667
3680
  tokens.push(data$4.check);
3668
3681
  queue(tokens, false);
3669
3682
  break;
3670
- case 3 /* Upgrade */:
3683
+ case 3 /* Event.Upgrade */:
3671
3684
  tokens.push(data$f.key);
3672
3685
  queue(tokens);
3673
3686
  break;
3674
- case 2 /* Upload */:
3687
+ case 2 /* Event.Upload */:
3675
3688
  tokens.push(track$1.sequence);
3676
3689
  tokens.push(track$1.attempts);
3677
3690
  tokens.push(track$1.status);
3678
3691
  queue(tokens, false);
3679
3692
  break;
3680
- case 24 /* Custom */:
3693
+ case 24 /* Event.Custom */:
3681
3694
  tokens.push(data$j.key);
3682
3695
  tokens.push(data$j.value);
3683
3696
  queue(tokens);
3684
3697
  break;
3685
- case 34 /* Variable */:
3698
+ case 34 /* Event.Variable */:
3686
3699
  var variableKeys = Object.keys(data$e);
3687
3700
  if (variableKeys.length > 0) {
3688
3701
  for (var _i = 0, variableKeys_1 = variableKeys; _i < variableKeys_1.length; _i++) {
@@ -3694,7 +3707,7 @@ function encode$1 (event) {
3694
3707
  queue(tokens, false);
3695
3708
  }
3696
3709
  break;
3697
- case 0 /* Metric */:
3710
+ case 0 /* Event.Metric */:
3698
3711
  var metricKeys = Object.keys(updates$3);
3699
3712
  if (metricKeys.length > 0) {
3700
3713
  for (var _a = 0, metricKeys_1 = metricKeys; _a < metricKeys_1.length; _a++) {
@@ -3709,7 +3722,7 @@ function encode$1 (event) {
3709
3722
  queue(tokens, false);
3710
3723
  }
3711
3724
  break;
3712
- case 1 /* Dimension */:
3725
+ case 1 /* Event.Dimension */:
3713
3726
  var dimensionKeys = Object.keys(updates);
3714
3727
  if (dimensionKeys.length > 0) {
3715
3728
  for (var _b = 0, dimensionKeys_1 = dimensionKeys; _b < dimensionKeys_1.length; _b++) {
@@ -3722,7 +3735,7 @@ function encode$1 (event) {
3722
3735
  queue(tokens, false);
3723
3736
  }
3724
3737
  break;
3725
- case 36 /* Summary */:
3738
+ case 36 /* Event.Summary */:
3726
3739
  var eventKeys = Object.keys(data$g);
3727
3740
  if (eventKeys.length > 0) {
3728
3741
  for (var _c = 0, eventKeys_1 = eventKeys; _c < eventKeys_1.length; _c++) {
@@ -3735,7 +3748,7 @@ function encode$1 (event) {
3735
3748
  queue(tokens, false);
3736
3749
  }
3737
3750
  break;
3738
- case 40 /* Extract */:
3751
+ case 40 /* Event.Extract */:
3739
3752
  var extractKeys = keys;
3740
3753
  for (var _d = 0, extractKeys_1 = extractKeys; _d < extractKeys_1.length; _d++) {
3741
3754
  var e = extractKeys_1[_d];
@@ -3749,14 +3762,14 @@ function encode$1 (event) {
3749
3762
 
3750
3763
  var data$4;
3751
3764
  function start$b() {
3752
- data$4 = { check: 0 /* None */ };
3765
+ data$4 = { check: 0 /* Check.None */ };
3753
3766
  }
3754
3767
  function check$2(bytes) {
3755
- if (data$4.check === 0 /* None */) {
3768
+ if (data$4.check === 0 /* Check.None */) {
3756
3769
  var reason = data$4.check;
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;
3770
+ reason = data$1.sequence >= 128 /* Setting.PayloadLimit */ ? 1 /* Check.Payload */ : reason;
3771
+ reason = time() > 7200000 /* Setting.ShutdownLimit */ ? 2 /* Check.Shutdown */ : reason;
3772
+ reason = bytes > 10485760 /* Setting.PlaybackBytesLimit */ ? 2 /* Check.Shutdown */ : reason;
3760
3773
  if (reason !== data$4.check) {
3761
3774
  trigger(reason);
3762
3775
  }
@@ -3768,8 +3781,8 @@ function trigger(reason) {
3768
3781
  stop();
3769
3782
  }
3770
3783
  function compute$3() {
3771
- if (data$4.check !== 0 /* None */) {
3772
- encode$1(35 /* Limit */);
3784
+ if (data$4.check !== 0 /* Check.None */) {
3785
+ encode$1(35 /* Event.Limit */);
3773
3786
  }
3774
3787
  }
3775
3788
  function stop$a() {
@@ -3790,7 +3803,7 @@ function log(dimension, value) {
3790
3803
  // Check valid value before moving ahead
3791
3804
  if (value) {
3792
3805
  // Ensure received value is casted into a string if it wasn't a string to begin with
3793
- value = "" + value;
3806
+ value = "".concat(value);
3794
3807
  if (!(dimension in data$3)) {
3795
3808
  data$3[dimension] = [];
3796
3809
  }
@@ -3803,14 +3816,14 @@ function log(dimension, value) {
3803
3816
  }
3804
3817
  updates[dimension].push(value);
3805
3818
  // Limit check to ensure we have a cap on number of dimensions we can collect
3806
- if (data$3[dimension].length > 128 /* CollectionLimit */) {
3807
- trigger(5 /* Collection */);
3819
+ if (data$3[dimension].length > 128 /* Setting.CollectionLimit */) {
3820
+ trigger(5 /* Check.Collection */);
3808
3821
  }
3809
3822
  }
3810
3823
  }
3811
3824
  }
3812
3825
  function compute$2() {
3813
- encode$1(1 /* Dimension */);
3826
+ encode$1(1 /* Event.Dimension */);
3814
3827
  }
3815
3828
  function reset$3() {
3816
3829
  updates = {};
@@ -3821,8 +3834,8 @@ var callbacks = [];
3821
3834
  var rootDomain = null;
3822
3835
  function start$9() {
3823
3836
  rootDomain = null;
3824
- var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Empty */;
3825
- var title = document && document.title ? document.title : "" /* Empty */;
3837
+ var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Constant.Empty */;
3838
+ var title = document && document.title ? document.title : "" /* Constant.Empty */;
3826
3839
  // Populate ids for this page
3827
3840
  var s = session();
3828
3841
  var u = user();
@@ -3833,27 +3846,27 @@ function start$9() {
3833
3846
  pageNum: s.count
3834
3847
  };
3835
3848
  // Override configuration based on what's in the session storage, unless it is blank (e.g. using upload callback, like in devtools)
3836
- config$1.lean = config$1.track && s.upgrade !== null ? s.upgrade === 0 /* 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;
3849
+ config$1.lean = config$1.track && s.upgrade !== null ? s.upgrade === 0 /* BooleanFlag.False */ : config$1.lean;
3850
+ 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;
3838
3851
  // Log dimensions
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);
3852
+ log(0 /* Dimension.UserAgent */, ua);
3853
+ log(3 /* Dimension.PageTitle */, title);
3854
+ log(1 /* Dimension.Url */, location.href);
3855
+ log(2 /* Dimension.Referrer */, document.referrer);
3856
+ log(15 /* Dimension.TabId */, tab());
3857
+ log(16 /* Dimension.PageLanguage */, document.documentElement.lang);
3858
+ log(17 /* Dimension.DocumentDirection */, document.dir);
3846
3859
  if (navigator) {
3847
- log(9 /* Language */, navigator.userLanguage || navigator.language);
3860
+ log(9 /* Dimension.Language */, navigator.userLanguage || navigator.language);
3848
3861
  userAgentData();
3849
3862
  }
3850
3863
  // Metrics
3851
- max(0 /* ClientTimestamp */, s.ts);
3852
- max(1 /* Playback */, 0 /* False */);
3864
+ max(0 /* Metric.ClientTimestamp */, s.ts);
3865
+ max(1 /* Metric.Playback */, 0 /* BooleanFlag.False */);
3853
3866
  if (screen) {
3854
- max(14 /* ScreenWidth */, Math.round(screen.width));
3855
- max(15 /* ScreenHeight */, Math.round(screen.height));
3856
- max(16 /* ColorDepth */, Math.round(screen.colorDepth));
3867
+ max(14 /* Metric.ScreenWidth */, Math.round(screen.width));
3868
+ max(15 /* Metric.ScreenHeight */, Math.round(screen.height));
3869
+ max(16 /* Metric.ColorDepth */, Math.round(screen.colorDepth));
3857
3870
  }
3858
3871
  // Read cookies specified in configuration
3859
3872
  for (var _i = 0, _a = config$1.cookies; _i < _a.length; _i++) {
@@ -3874,13 +3887,13 @@ function userAgentData() {
3874
3887
  "uaFullVersion"])
3875
3888
  .then(function (ua) {
3876
3889
  var _a;
3877
- log(22 /* Platform */, ua.platform);
3878
- log(23 /* PlatformVersion */, ua.platformVersion);
3890
+ log(22 /* Dimension.Platform */, ua.platform);
3891
+ log(23 /* Dimension.PlatformVersion */, ua.platformVersion);
3879
3892
  (_a = ua.brands) === null || _a === void 0 ? void 0 : _a.forEach(function (brand) {
3880
- log(24 /* Brand */, brand.name + "~" /* Tilde */ + brand.version);
3893
+ log(24 /* Dimension.Brand */, brand.name + "~" /* Constant.Tilde */ + brand.version);
3881
3894
  });
3882
- log(25 /* Model */, ua.model);
3883
- max(27 /* Mobile */, ua.mobile ? 1 /* True */ : 0 /* False */);
3895
+ log(25 /* Dimension.Model */, ua.model);
3896
+ max(27 /* Metric.Mobile */, ua.mobile ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
3884
3897
  });
3885
3898
  }
3886
3899
  }
@@ -3897,33 +3910,33 @@ function metadata(cb, wait) {
3897
3910
  callbacks.push({ callback: cb, wait: wait });
3898
3911
  }
3899
3912
  function id() {
3900
- return data$2 ? [data$2.userId, data$2.sessionId, data$2.pageNum].join("." /* Dot */) : "" /* Empty */;
3913
+ return data$2 ? [data$2.userId, data$2.sessionId, data$2.pageNum].join("." /* Constant.Dot */) : "" /* Constant.Empty */;
3901
3914
  }
3902
3915
  function consent() {
3903
3916
  if (active()) {
3904
3917
  config$1.track = true;
3905
- track(user(), 1 /* True */);
3918
+ track(user(), 1 /* BooleanFlag.True */);
3906
3919
  }
3907
3920
  }
3908
3921
  function clear() {
3909
3922
  // Clear any stored information in the cookie that tracks session information so we can restart fresh the next time
3910
- setCookie("_clsk" /* SessionKey */, "" /* Empty */, 0);
3923
+ setCookie("_clsk" /* Constant.SessionKey */, "" /* Constant.Empty */, 0);
3911
3924
  }
3912
3925
  function tab() {
3913
3926
  var id = shortid();
3914
- if (config$1.track && supported(window, "sessionStorage" /* SessionStorage */)) {
3915
- var value = sessionStorage.getItem("_cltk" /* TabKey */);
3927
+ if (config$1.track && supported(window, "sessionStorage" /* Constant.SessionStorage */)) {
3928
+ var value = sessionStorage.getItem("_cltk" /* Constant.TabKey */);
3916
3929
  id = value ? value : id;
3917
- sessionStorage.setItem("_cltk" /* TabKey */, id);
3930
+ sessionStorage.setItem("_cltk" /* Constant.TabKey */, id);
3918
3931
  }
3919
3932
  return id;
3920
3933
  }
3921
3934
  function save() {
3922
3935
  var ts = Math.round(Date.now());
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 */;
3936
+ var upload = config$1.upload && typeof config$1.upload === "string" /* Constant.String */ ? config$1.upload.replace("https://" /* Constant.HTTPS */, "" /* Constant.Empty */) : "" /* Constant.Empty */;
3937
+ var upgrade = config$1.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
3925
3938
  processCallback(upgrade);
3926
- setCookie("_clsk" /* SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Pipe */), 1 /* SessionExpire */);
3939
+ setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Constant.Pipe */), 1 /* Setting.SessionExpire */);
3927
3940
  }
3928
3941
  function processCallback(upgrade) {
3929
3942
  if (callbacks.length > 0) {
@@ -3948,10 +3961,10 @@ function track(u, consent) {
3948
3961
  consent = consent === null ? u.consent : consent;
3949
3962
  // Convert time precision into days to reduce number of bytes we have to write in a cookie
3950
3963
  // E.g. Math.ceil(1628735962643 / (24*60*60*1000)) => 18852 (days) => ejo in base36 (13 bytes => 3 bytes)
3951
- var end = Math.ceil((Date.now() + (365 /* Expire */ * 86400000 /* Day */)) / 86400000 /* Day */);
3964
+ var end = Math.ceil((Date.now() + (365 /* Setting.Expire */ * 86400000 /* Time.Day */)) / 86400000 /* Time.Day */);
3952
3965
  // To avoid cookie churn, write user id cookie only once every day
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 */);
3966
+ if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* Setting.CookieInterval */ || u.consent !== consent) {
3967
+ setCookie("_clck" /* Constant.CookieKey */, [data$2.userId, 1 /* Setting.CookieVersion */, end.toString(36), consent].join("|" /* Constant.Pipe */), 365 /* Setting.Expire */);
3955
3968
  }
3956
3969
  }
3957
3970
  function shortid() {
@@ -3962,17 +3975,17 @@ function shortid() {
3962
3975
  return id.toString(36);
3963
3976
  }
3964
3977
  function session() {
3965
- var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /* Empty */ };
3966
- var value = getCookie("_clsk" /* SessionKey */);
3978
+ var output = { session: shortid(), ts: Math.round(Date.now()), count: 1, upgrade: null, upload: "" /* Constant.Empty */ };
3979
+ var value = getCookie("_clsk" /* Constant.SessionKey */);
3967
3980
  if (value) {
3968
- var parts = value.split("|" /* Pipe */);
3981
+ var parts = value.split("|" /* Constant.Pipe */);
3969
3982
  // Making it backward & forward compatible by using greater than comparison (v0.6.21)
3970
3983
  // In future version, we can reduce the parts length to be 5 where the last part contains the full upload URL
3971
- if (parts.length >= 5 && output.ts - num(parts[1]) < 1800000 /* SessionTimeout */) {
3984
+ if (parts.length >= 5 && output.ts - num(parts[1]) < 1800000 /* Setting.SessionTimeout */) {
3972
3985
  output.session = parts[0];
3973
3986
  output.count = num(parts[2]) + 1;
3974
3987
  output.upgrade = num(parts[3]);
3975
- output.upload = parts.length >= 6 ? "" + "https://" /* HTTPS */ + parts[5] + "/" + parts[4] : "" + "https://" /* HTTPS */ + parts[4];
3988
+ output.upload = parts.length >= 6 ? "".concat("https://" /* Constant.HTTPS */).concat(parts[5], "/").concat(parts[4]) : "".concat("https://" /* Constant.HTTPS */).concat(parts[4]);
3976
3989
  }
3977
3990
  }
3978
3991
  return output;
@@ -3982,26 +3995,26 @@ function num(string, base) {
3982
3995
  return parseInt(string, base);
3983
3996
  }
3984
3997
  function user() {
3985
- var output = { id: shortid(), expiry: null, consent: 0 /* False */ };
3986
- var cookie = getCookie("_clck" /* CookieKey */);
3998
+ var output = { id: shortid(), expiry: null, consent: 0 /* BooleanFlag.False */ };
3999
+ var cookie = getCookie("_clck" /* Constant.CookieKey */);
3987
4000
  if (cookie && cookie.length > 0) {
3988
4001
  // Splitting and looking up first part for forward compatibility, in case we wish to store additional information in a cookie
3989
- var parts = cookie.split("|" /* Pipe */);
4002
+ var parts = cookie.split("|" /* Constant.Pipe */);
3990
4003
  // For backward compatibility introduced in v0.6.18; following code can be removed with future iterations
3991
4004
  // Count number of times Clarity's user cookie crumb appears in document.cookie (could be on different sub-domains e.g. www.domain.com and .domain.com)
3992
4005
  var count = 0;
3993
- for (var _i = 0, _a = document.cookie.split(";" /* Semicolon */); _i < _a.length; _i++) {
4006
+ for (var _i = 0, _a = document.cookie.split(";" /* Constant.Semicolon */); _i < _a.length; _i++) {
3994
4007
  var c = _a[_i];
3995
- count += c.split("=" /* Equals */)[0].trim() === "_clck" /* CookieKey */ ? 1 : 0;
4008
+ count += c.split("=" /* Constant.Equals */)[0].trim() === "_clck" /* Constant.CookieKey */ ? 1 : 0;
3996
4009
  }
3997
4010
  // Check if we either got version-less cookie value or saw multiple copies of the user cookie crumbs
3998
4011
  // In both these cases, we go ahead and delete the existing cookie set on current domain
3999
4012
  if (parts.length === 1 || count > 1) {
4000
- var deleted = "" + ";" /* Semicolon */ + "expires=" /* Expires */ + (new Date(0)).toUTCString() + ";path=/" /* Path */;
4013
+ var deleted = "".concat(";" /* Constant.Semicolon */).concat("expires=" /* Constant.Expires */).concat((new Date(0)).toUTCString()).concat(";path=/" /* Constant.Path */);
4001
4014
  // First, delete current user cookie which might be set on current sub-domain vs. root domain
4002
- document.cookie = "_clck" /* CookieKey */ + "=" + deleted;
4015
+ document.cookie = "".concat("_clck" /* Constant.CookieKey */, "=").concat(deleted);
4003
4016
  // Second, same thing for current session cookie so it can be re-written later with the root domain
4004
- document.cookie = "_clsk" /* SessionKey */ + "=" + deleted;
4017
+ document.cookie = "".concat("_clsk" /* Constant.SessionKey */, "=").concat(deleted);
4005
4018
  }
4006
4019
  // End code for backward compatibility
4007
4020
  // Read version information and timestamp from cookie, if available
@@ -4010,21 +4023,21 @@ function user() {
4010
4023
  }
4011
4024
  // Check if we have explicit consent to track this user
4012
4025
  if (parts.length > 3 && num(parts[3]) === 1) {
4013
- output.consent = 1 /* True */;
4026
+ output.consent = 1 /* BooleanFlag.True */;
4014
4027
  }
4015
4028
  // Set track configuration to true for this user if we have explicit consent, regardless of project setting
4016
- config$1.track = config$1.track || output.consent === 1 /* True */;
4029
+ config$1.track = config$1.track || output.consent === 1 /* BooleanFlag.True */;
4017
4030
  // Get user id from cookie only if we tracking is enabled, otherwise fallback to a random id
4018
4031
  output.id = config$1.track ? parts[0] : output.id;
4019
4032
  }
4020
4033
  return output;
4021
4034
  }
4022
4035
  function getCookie(key) {
4023
- if (supported(document, "cookie" /* Cookie */)) {
4024
- var cookies = document.cookie.split(";" /* Semicolon */);
4036
+ if (supported(document, "cookie" /* Constant.Cookie */)) {
4037
+ var cookies = document.cookie.split(";" /* Constant.Semicolon */);
4025
4038
  if (cookies) {
4026
4039
  for (var i = 0; i < cookies.length; i++) {
4027
- var pair = cookies[i].split("=" /* Equals */);
4040
+ var pair = cookies[i].split("=" /* Constant.Equals */);
4028
4041
  if (pair.length > 1 && pair[0] && pair[0].trim() === key) {
4029
4042
  return pair[1];
4030
4043
  }
@@ -4034,23 +4047,23 @@ function getCookie(key) {
4034
4047
  return null;
4035
4048
  }
4036
4049
  function setCookie(key, value, time) {
4037
- if (config$1.track && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Cookie */))) {
4050
+ if (config$1.track && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Constant.Cookie */))) {
4038
4051
  var expiry = new Date();
4039
4052
  expiry.setDate(expiry.getDate() + time);
4040
- var expires = expiry ? "expires=" /* Expires */ + expiry.toUTCString() : "" /* Empty */;
4041
- var cookie = key + "=" + value + ";" /* Semicolon */ + expires + ";path=/" /* Path */;
4053
+ var expires = expiry ? "expires=" /* Constant.Expires */ + expiry.toUTCString() : "" /* Constant.Empty */;
4054
+ var cookie = "".concat(key, "=").concat(value).concat(";" /* Constant.Semicolon */).concat(expires).concat(";path=/" /* Constant.Path */);
4042
4055
  try {
4043
4056
  // Attempt to get the root domain only once and fall back to writing cookie on the current domain.
4044
4057
  if (rootDomain === null) {
4045
- var hostname = location.hostname ? location.hostname.split("." /* Dot */) : [];
4058
+ var hostname = location.hostname ? location.hostname.split("." /* Constant.Dot */) : [];
4046
4059
  // Walk backwards on a domain and attempt to set a cookie, until successful
4047
4060
  for (var i = hostname.length - 1; i >= 0; i--) {
4048
- rootDomain = "." + hostname[i] + (rootDomain ? rootDomain : "" /* Empty */);
4061
+ rootDomain = ".".concat(hostname[i]).concat(rootDomain ? rootDomain : "" /* Constant.Empty */);
4049
4062
  // We do not wish to attempt writing a cookie on the absolute last part of the domain, e.g. .com or .net.
4050
4063
  // So we start attempting after second-last part, e.g. .domain.com (PASS) or .co.uk (FAIL)
4051
4064
  if (i < hostname.length - 1) {
4052
4065
  // Write the cookie on the current computed top level domain
4053
- document.cookie = "" + cookie + ";" /* Semicolon */ + "domain=" /* Domain */ + rootDomain;
4066
+ document.cookie = "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain);
4054
4067
  // Once written, check if the cookie exists and its value matches exactly with what we intended to set
4055
4068
  // Checking for exact value match helps us eliminate a corner case where the cookie may already be present with a different value
4056
4069
  // If the check is successful, no more action is required and we can return from the function since rootDomain cookie is already set
@@ -4062,13 +4075,13 @@ function setCookie(key, value, time) {
4062
4075
  }
4063
4076
  // Finally, if we were not successful and gone through all the options, play it safe and reset rootDomain to be empty
4064
4077
  // This forces our code to fall back to always writing cookie to the current domain
4065
- rootDomain = "" /* Empty */;
4078
+ rootDomain = "" /* Constant.Empty */;
4066
4079
  }
4067
4080
  }
4068
4081
  catch (_a) {
4069
- rootDomain = "" /* Empty */;
4082
+ rootDomain = "" /* Constant.Empty */;
4070
4083
  }
4071
- document.cookie = rootDomain ? "" + cookie + ";" /* Semicolon */ + "domain=" /* Domain */ + rootDomain : cookie;
4084
+ document.cookie = rootDomain ? "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain) : cookie;
4072
4085
  }
4073
4086
  }
4074
4087
 
@@ -4084,8 +4097,8 @@ function start$8() {
4084
4097
  userId: m.userId,
4085
4098
  sessionId: m.sessionId,
4086
4099
  pageNum: m.pageNum,
4087
- upload: 0 /* Async */,
4088
- end: 0 /* False */
4100
+ upload: 0 /* Upload.Async */,
4101
+ end: 0 /* BooleanFlag.False */
4089
4102
  };
4090
4103
  }
4091
4104
  function stop$7() {
@@ -4095,8 +4108,8 @@ function envelope(last) {
4095
4108
  data$1.start = data$1.start + data$1.duration;
4096
4109
  data$1.duration = time() - data$1.start;
4097
4110
  data$1.sequence++;
4098
- data$1.upload = last && "sendBeacon" in navigator ? 1 /* Beacon */ : 0 /* Async */;
4099
- data$1.end = last ? 1 /* True */ : 0 /* False */;
4111
+ data$1.upload = last && "sendBeacon" in navigator ? 1 /* Upload.Beacon */ : 0 /* Upload.Async */;
4112
+ data$1.end = last ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
4100
4113
  return [
4101
4114
  data$1.version,
4102
4115
  data$1.sequence,
@@ -4149,10 +4162,10 @@ function measure (method) {
4149
4162
  throw report(ex);
4150
4163
  }
4151
4164
  var duration = performance.now() - start;
4152
- sum(4 /* TotalCost */, duration);
4153
- if (duration > 30 /* LongTask */) {
4154
- count$1(7 /* LongTaskCount */);
4155
- max(6 /* ThreadBlockedTime */, duration);
4165
+ sum(4 /* Metric.TotalCost */, duration);
4166
+ if (duration > 30 /* Setting.LongTask */) {
4167
+ count$1(7 /* Metric.LongTaskCount */);
4168
+ max(6 /* Metric.ThreadBlockedTime */, duration);
4156
4169
  }
4157
4170
  };
4158
4171
  }
@@ -4164,7 +4177,7 @@ function bind(target, event, listener, capture) {
4164
4177
  // Wrapping following lines inside try / catch to cover edge cases where we might try to access an inaccessible element.
4165
4178
  // E.g. Iframe may start off as same-origin but later turn into cross-origin, and the following lines will throw an exception.
4166
4179
  try {
4167
- target[api("addEventListener" /* AddEventListener */)](event, listener, capture);
4180
+ target[api("addEventListener" /* Constant.AddEventListener */)](event, listener, capture);
4168
4181
  bindings.push({ event: event, target: target, listener: listener, capture: capture });
4169
4182
  }
4170
4183
  catch ( /* do nothing */_a) { /* do nothing */ }
@@ -4175,7 +4188,7 @@ function reset$1() {
4175
4188
  var binding = bindings_1[_i];
4176
4189
  // Wrapping inside try / catch to avoid situations where the element may be destroyed before we get a chance to unbind
4177
4190
  try {
4178
- binding.target[api("removeEventListener" /* RemoveEventListener */)](binding.event, binding.listener, binding.capture);
4191
+ binding.target[api("removeEventListener" /* Constant.RemoveEventListener */)](binding.event, binding.listener, binding.capture);
4179
4192
  }
4180
4193
  catch ( /* do nothing */_a) { /* do nothing */ }
4181
4194
  }
@@ -4212,8 +4225,8 @@ function start$7() {
4212
4225
  }
4213
4226
  }
4214
4227
  function check$1() {
4215
- if (count++ > 20 /* CallStackDepth */) {
4216
- log$1(4 /* CallStackDepth */, 0 /* Info */);
4228
+ if (count++ > 20 /* Setting.CallStackDepth */) {
4229
+ log$1(4 /* Code.CallStackDepth */, 0 /* Severity.Info */);
4217
4230
  return false;
4218
4231
  }
4219
4232
  return true;
@@ -4223,15 +4236,15 @@ function compute$1() {
4223
4236
  if (url !== getCurrentUrl()) {
4224
4237
  // If the url changed, start tracking it as a new page
4225
4238
  stop();
4226
- window.setTimeout(restart$1, 250 /* RestartDelay */);
4239
+ window.setTimeout(restart$1, 250 /* Setting.RestartDelay */);
4227
4240
  }
4228
4241
  }
4229
4242
  function restart$1() {
4230
4243
  start();
4231
- max(29 /* SinglePage */, 1 /* True */);
4244
+ max(29 /* Metric.SinglePage */, 1 /* BooleanFlag.True */);
4232
4245
  }
4233
4246
  function getCurrentUrl() {
4234
- return location.href ? location.href.replace(location.hash, "" /* Empty */) : location.href;
4247
+ return location.href ? location.href.replace(location.hash, "" /* Constant.Empty */) : location.href;
4235
4248
  }
4236
4249
  function stop$6() {
4237
4250
  url = null;
@@ -4294,7 +4307,7 @@ function config(override) {
4294
4307
  // not holding the session during inactive time periods.
4295
4308
  function suspend() {
4296
4309
  if (status) {
4297
- event("clarity" /* Clarity */, "suspend" /* Suspend */);
4310
+ event("clarity" /* Constant.Clarity */, "suspend" /* Constant.Suspend */);
4298
4311
  stop();
4299
4312
  ["mousemove", "touchstart"].forEach(function (x) { return bind(document, x, restart); });
4300
4313
  ["resize", "scroll", "pageshow"].forEach(function (x) { return bind(window, x, restart); });
@@ -4302,7 +4315,7 @@ function suspend() {
4302
4315
  }
4303
4316
  function restart() {
4304
4317
  start();
4305
- event("clarity" /* Clarity */, "restart" /* Restart */);
4318
+ event("clarity" /* Constant.Clarity */, "restart" /* Constant.Restart */);
4306
4319
  }
4307
4320
 
4308
4321
  function start$5() {
@@ -4321,7 +4334,7 @@ var diagnostic = /*#__PURE__*/Object.freeze({
4321
4334
  });
4322
4335
 
4323
4336
  function start$4() {
4324
- schedule$1(discover, 1 /* High */).then(function () {
4337
+ schedule$1(discover, 1 /* Priority.High */).then(function () {
4325
4338
  measure(compute$7)();
4326
4339
  measure(compute$6)();
4327
4340
  });
@@ -4333,12 +4346,12 @@ function discover() {
4333
4346
  switch (_a.label) {
4334
4347
  case 0:
4335
4348
  ts = time();
4336
- timer = { id: id(), cost: 3 /* LayoutCost */ };
4349
+ timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
4337
4350
  start$w(timer);
4338
- return [4 /*yield*/, traverse(document, timer, 0 /* Discover */)];
4351
+ return [4 /*yield*/, traverse(document, timer, 0 /* Source.Discover */)];
4339
4352
  case 1:
4340
4353
  _a.sent();
4341
- return [4 /*yield*/, encode$4(5 /* Discover */, timer, ts)];
4354
+ return [4 /*yield*/, encode$4(5 /* Event.Discover */, timer, ts)];
4342
4355
  case 2:
4343
4356
  _a.sent();
4344
4357
  stop$t(timer);
@@ -4367,7 +4380,8 @@ function stop$3() {
4367
4380
  var layout = /*#__PURE__*/Object.freeze({
4368
4381
  __proto__: null,
4369
4382
  start: start$3,
4370
- stop: stop$3
4383
+ stop: stop$3,
4384
+ hashText: hashText
4371
4385
  });
4372
4386
 
4373
4387
  function encode (type) {
@@ -4377,7 +4391,7 @@ function encode (type) {
4377
4391
  t = time();
4378
4392
  tokens = [t, type];
4379
4393
  switch (type) {
4380
- case 29 /* Navigation */:
4394
+ case 29 /* Event.Navigation */:
4381
4395
  tokens.push(data.fetchStart);
4382
4396
  tokens.push(data.connectStart);
4383
4397
  tokens.push(data.connectEnd);
@@ -4426,11 +4440,11 @@ function compute(entry) {
4426
4440
  encodedSize: entry.encodedBodySize ? entry.encodedBodySize : 0,
4427
4441
  decodedSize: entry.decodedBodySize ? entry.decodedBodySize : 0
4428
4442
  };
4429
- encode(29 /* Navigation */);
4443
+ encode(29 /* Event.Navigation */);
4430
4444
  }
4431
4445
 
4432
4446
  var observer;
4433
- var types = ["navigation" /* Navigation */, "resource" /* Resource */, "longtask" /* LongTask */, "first-input" /* FID */, "layout-shift" /* CLS */, "largest-contentful-paint" /* LCP */];
4447
+ var types = ["navigation" /* Constant.Navigation */, "resource" /* Constant.Resource */, "longtask" /* Constant.LongTask */, "first-input" /* Constant.FID */, "layout-shift" /* Constant.CLS */, "largest-contentful-paint" /* Constant.LCP */];
4434
4448
  function start$2() {
4435
4449
  // Check the browser support performance observer as a pre-requisite for any performance measurement
4436
4450
  if (window["PerformanceObserver"] && PerformanceObserver.supportedEntryTypes) {
@@ -4445,7 +4459,7 @@ function start$2() {
4445
4459
  }
4446
4460
  }
4447
4461
  else {
4448
- log$1(3 /* PerformanceObserver */, 0 /* Info */);
4462
+ log$1(3 /* Code.PerformanceObserver */, 0 /* Severity.Info */);
4449
4463
  }
4450
4464
  }
4451
4465
  function observe() {
@@ -4465,15 +4479,15 @@ function observe() {
4465
4479
  if (PerformanceObserver.supportedEntryTypes.indexOf(x) >= 0) {
4466
4480
  // Initialize CLS with a value of zero. It's possible (and recommended) for sites to not have any cumulative layout shift.
4467
4481
  // In those cases, we want to still initialize the metric in Clarity
4468
- if (x === "layout-shift" /* CLS */) {
4469
- sum(9 /* CumulativeLayoutShift */, 0);
4482
+ if (x === "layout-shift" /* Constant.CLS */) {
4483
+ sum(9 /* Metric.CumulativeLayoutShift */, 0);
4470
4484
  }
4471
4485
  observer.observe({ type: x, buffered: true });
4472
4486
  }
4473
4487
  }
4474
4488
  }
4475
4489
  catch (_a) {
4476
- log$1(3 /* PerformanceObserver */, 1 /* Warning */);
4490
+ log$1(3 /* Code.PerformanceObserver */, 1 /* Severity.Warning */);
4477
4491
  }
4478
4492
  }
4479
4493
  function handle(entries) {
@@ -4484,41 +4498,41 @@ function process(entries) {
4484
4498
  for (var i = 0; i < entries.length; i++) {
4485
4499
  var entry = entries[i];
4486
4500
  switch (entry.entryType) {
4487
- case "navigation" /* Navigation */:
4501
+ case "navigation" /* Constant.Navigation */:
4488
4502
  compute(entry);
4489
4503
  break;
4490
- case "resource" /* Resource */:
4504
+ case "resource" /* Constant.Resource */:
4491
4505
  var name_1 = entry.name;
4492
- log(4 /* NetworkHosts */, host(name_1));
4506
+ log(4 /* Dimension.NetworkHosts */, host(name_1));
4493
4507
  if (name_1 === config$1.upload || name_1 === config$1.fallback) {
4494
- max(28 /* UploadTime */, entry.duration);
4508
+ max(28 /* Metric.UploadTime */, entry.duration);
4495
4509
  }
4496
4510
  break;
4497
- case "longtask" /* LongTask */:
4498
- count$1(7 /* LongTaskCount */);
4511
+ case "longtask" /* Constant.LongTask */:
4512
+ count$1(7 /* Metric.LongTaskCount */);
4499
4513
  break;
4500
- case "first-input" /* FID */:
4514
+ case "first-input" /* Constant.FID */:
4501
4515
  if (visible) {
4502
- max(10 /* FirstInputDelay */, entry["processingStart"] - entry.startTime);
4516
+ max(10 /* Metric.FirstInputDelay */, entry["processingStart"] - entry.startTime);
4503
4517
  }
4504
4518
  break;
4505
- case "layout-shift" /* CLS */:
4519
+ case "layout-shift" /* Constant.CLS */:
4506
4520
  // Scale the value to avoid sending back floating point number
4507
4521
  if (visible && !entry["hadRecentInput"]) {
4508
- sum(9 /* CumulativeLayoutShift */, entry["value"] * 1000);
4522
+ sum(9 /* Metric.CumulativeLayoutShift */, entry["value"] * 1000);
4509
4523
  }
4510
4524
  break;
4511
- case "largest-contentful-paint" /* LCP */:
4525
+ case "largest-contentful-paint" /* Constant.LCP */:
4512
4526
  if (visible) {
4513
- max(8 /* LargestPaint */, entry.startTime);
4527
+ max(8 /* Metric.LargestPaint */, entry.startTime);
4514
4528
  }
4515
4529
  break;
4516
4530
  }
4517
4531
  }
4518
- if (performance && "memory" /* Memory */ in performance && performance["memory" /* Memory */].usedJSHeapSize) {
4532
+ if (performance && "memory" /* Constant.Memory */ in performance && performance["memory" /* Constant.Memory */].usedJSHeapSize) {
4519
4533
  // Track consumed memory (MBs) where "memory" API is available
4520
4534
  // Reference: https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory
4521
- max(30 /* UsedMemory */, Math.abs(performance["memory" /* Memory */].usedJSHeapSize / 1048576 /* MegaByte */));
4535
+ max(30 /* Metric.UsedMemory */, Math.abs(performance["memory" /* Constant.Memory */].usedJSHeapSize / 1048576 /* Setting.MegaByte */));
4522
4536
  }
4523
4537
  }
4524
4538
  function stop$2() {
@@ -4566,7 +4580,7 @@ function start(config$1) {
4566
4580
  // performance impact even further. For reference, we are talking single digit milliseconds optimization here, not seconds.
4567
4581
  function pause() {
4568
4582
  if (active()) {
4569
- event("clarity" /* Clarity */, "pause" /* Pause */);
4583
+ event("clarity" /* Constant.Clarity */, "pause" /* Constant.Pause */);
4570
4584
  pause$1();
4571
4585
  }
4572
4586
  }
@@ -4574,7 +4588,7 @@ function pause() {
4574
4588
  function resume() {
4575
4589
  if (active()) {
4576
4590
  resume$1();
4577
- event("clarity" /* Clarity */, "resume" /* Resume */);
4591
+ event("clarity" /* Constant.Clarity */, "resume" /* Constant.Resume */);
4578
4592
  }
4579
4593
  }
4580
4594
  function stop() {
@@ -4598,7 +4612,8 @@ var clarity = /*#__PURE__*/Object.freeze({
4598
4612
  identify: identify,
4599
4613
  set: set,
4600
4614
  upgrade: upgrade,
4601
- metadata: metadata
4615
+ metadata: metadata,
4616
+ hashText: hashText
4602
4617
  });
4603
4618
 
4604
4619
  var helper = { hash: hash, selector: selector, get: get, getNode: getNode, lookup: lookup };