clarity-js 0.8.43 → 0.8.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/clarity.js CHANGED
@@ -15,43 +15,53 @@ var dom = /*#__PURE__*/Object.freeze({
15
15
  get parse () { return parse; },
16
16
  get removeIFrame () { return removeIFrame; },
17
17
  get sameorigin () { return sameorigin; },
18
- get start () { return start$k; },
19
- get stop () { return stop$i; },
18
+ get start () { return start$l; },
19
+ get stop () { return stop$j; },
20
20
  get update () { return update; },
21
21
  get updates () { return updates$2; }
22
22
  });
23
23
  var upload$1 = /*#__PURE__*/Object.freeze({
24
24
  __proto__: null,
25
25
  get queue () { return queue; },
26
- get start () { return start$g; },
27
- get stop () { return stop$e; },
26
+ get start () { return start$h; },
27
+ get stop () { return stop$f; },
28
28
  get track () { return track$1; }
29
29
  });
30
30
  var upgrade$1 = /*#__PURE__*/Object.freeze({
31
31
  __proto__: null,
32
- get data () { return data$5; },
33
- get start () { return start$b; },
34
- get stop () { return stop$b; },
32
+ get data () { return data$6; },
33
+ get start () { return start$c; },
34
+ get stop () { return stop$c; },
35
35
  get upgrade () { return upgrade; }
36
36
  });
37
37
  var limit = /*#__PURE__*/Object.freeze({
38
38
  __proto__: null,
39
39
  get check () { return check$2; },
40
+ get compute () { return compute$4; },
41
+ get data () { return data$5; },
42
+ get start () { return start$b; },
43
+ get stop () { return stop$b; },
44
+ get trigger () { return trigger; }
45
+ });
46
+ var dimension = /*#__PURE__*/Object.freeze({
47
+ __proto__: null,
40
48
  get compute () { return compute$3; },
41
49
  get data () { return data$4; },
50
+ get log () { return log; },
51
+ get reset () { return reset$3; },
42
52
  get start () { return start$a; },
43
53
  get stop () { return stop$a; },
44
- get trigger () { return trigger; }
54
+ get updates () { return updates; }
45
55
  });
46
- var dimension = /*#__PURE__*/Object.freeze({
56
+ var consent$2 = /*#__PURE__*/Object.freeze({
47
57
  __proto__: null,
48
58
  get compute () { return compute$2; },
59
+ get config () { return config$1; },
60
+ get consent () { return consent$1; },
49
61
  get data () { return data$3; },
50
- get log () { return log; },
51
- get reset () { return reset$3; },
52
62
  get start () { return start$9; },
53
63
  get stop () { return stop$9; },
54
- get updates () { return updates; }
64
+ get trackConsentv2 () { return trackConsentv2; }
55
65
  });
56
66
  var metadata$1 = /*#__PURE__*/Object.freeze({
57
67
  __proto__: null,
@@ -176,7 +186,7 @@ var startTime = 0;
176
186
  function computeStartTime() {
177
187
  return performance.now() + performance.timeOrigin;
178
188
  }
179
- function start$M() {
189
+ function start$N() {
180
190
  startTime = computeStartTime();
181
191
  }
182
192
  // event.timestamp is number of milliseconds elapsed since the document was loaded
@@ -192,11 +202,11 @@ function time(event) {
192
202
  var origin = event && event.view ? event.view.performance.timeOrigin : performance.timeOrigin;
193
203
  return Math.max(Math.round(ts + origin - baseline), 0);
194
204
  }
195
- function stop$J() {
205
+ function stop$K() {
196
206
  startTime = 0;
197
207
  }
198
208
 
199
- var version$1 = "0.8.43";
209
+ var version$1 = "0.8.44";
200
210
 
201
211
  // tslint:disable: no-bitwise
202
212
  function hash (input, precision) {
@@ -419,7 +429,7 @@ function redact$1(value) {
419
429
  var state$b = null;
420
430
  var buffer = null;
421
431
  var update$2 = false;
422
- function start$L() {
432
+ function start$M() {
423
433
  update$2 = false;
424
434
  reset$u();
425
435
  }
@@ -562,7 +572,7 @@ function compute$g() {
562
572
  encode$1(4 /* Event.Baseline */);
563
573
  }
564
574
  }
565
- function stop$I() {
575
+ function stop$J() {
566
576
  reset$u();
567
577
  }
568
578
 
@@ -572,86 +582,14 @@ var baseline = /*#__PURE__*/Object.freeze({
572
582
  compute: compute$g,
573
583
  dynamic: dynamic$1,
574
584
  reset: reset$u,
575
- start: start$L,
585
+ start: start$M,
576
586
  get state () { return state$b; },
577
- stop: stop$I,
587
+ stop: stop$J,
578
588
  track: track$8,
579
589
  visibility: visibility
580
590
  });
581
591
 
582
592
  var data$l = null;
583
- var updateConsent = true;
584
- function start$K() {
585
- var _a;
586
- var ics = (_a = window.google_tag_data) === null || _a === void 0 ? void 0 : _a.ics;
587
- updateConsent = true;
588
- if (ics === null || ics === void 0 ? void 0 : ics.addListener) {
589
- ics.addListener(["ad_storage" /* Constant.AdStorage */, "analytics_storage" /* Constant.AnalyticsStorage */], processConsent);
590
- }
591
- }
592
- function stop$H() {
593
- updateConsent = true;
594
- }
595
- function processConsent() {
596
- var _a;
597
- var ics = (_a = window.google_tag_data) === null || _a === void 0 ? void 0 : _a.ics;
598
- if (!(ics === null || ics === void 0 ? void 0 : ics.getConsentState)) {
599
- return;
600
- }
601
- var analytics_storage = ics.getConsentState("analytics_storage" /* Constant.AnalyticsStorage */);
602
- var ad_storage = ics.getConsentState("ad_storage" /* Constant.AdStorage */);
603
- var consentState = getConsentState({ ad_Storage: ad_storage, analytics_Storage: analytics_storage });
604
- consentv2(consentState, 2 /* ConsentSource.GCM */);
605
- }
606
- function getConsentState(googleConsent) {
607
- var consentState = {
608
- ad_Storage: googleConsent.ad_Storage === 1 /* GCMConsent.Granted */ ? "granted" /* Constant.Granted */ : "denied" /* Constant.Denied */,
609
- analytics_Storage: googleConsent.analytics_Storage === 1 /* GCMConsent.Granted */ ? "granted" /* Constant.Granted */ : "denied" /* Constant.Denied */,
610
- };
611
- return consentState;
612
- }
613
- function config$1(consent) {
614
- trackConsent(consent.analytics_Storage ? 1 /* ConsentType.Implicit */ : 0 /* ConsentType.None */);
615
- data$l = consent;
616
- }
617
- // When we get consent signal as false, we restart the service and track config as false.
618
- function consent$1() {
619
- trackConsent(2 /* ConsentType.General */);
620
- }
621
- function trackConsent(consent) {
622
- log(36 /* Dimension.Consent */, consent.toString());
623
- }
624
- function trackConsentv2(consent) {
625
- data$l = consent;
626
- encode$1(47 /* Event.Consent */);
627
- }
628
- // Compute function is called every upload, but we only want to send consent data once.
629
- function compute$f() {
630
- var _a;
631
- if (updateConsent) {
632
- encode$1(47 /* Event.Consent */);
633
- updateConsent = false;
634
- if (!config$2.track) {
635
- var ics = (_a = window.google_tag_data) === null || _a === void 0 ? void 0 : _a.ics;
636
- if (ics === null || ics === void 0 ? void 0 : ics.usedUpdate) {
637
- processConsent();
638
- }
639
- }
640
- }
641
- }
642
-
643
- var consent$2 = /*#__PURE__*/Object.freeze({
644
- __proto__: null,
645
- compute: compute$f,
646
- config: config$1,
647
- consent: consent$1,
648
- get data () { return data$l; },
649
- start: start$K,
650
- stop: stop$H,
651
- trackConsentv2: trackConsentv2
652
- });
653
-
654
- var data$k = null;
655
593
  // custom events allow 2 parameters or 1 parameter to be passed. If 2 are passed we
656
594
  // consider it a key value pair. If only 1 is passed we only consider the event to have a value.
657
595
  function event$1(a, b) {
@@ -660,61 +598,61 @@ function event$1(a, b) {
660
598
  typeof a === "string" /* Constant.String */ &&
661
599
  a.length < 255) {
662
600
  if (b && typeof b === "string" /* Constant.String */ && b.length < 255) {
663
- data$k = { key: a, value: b };
601
+ data$l = { key: a, value: b };
664
602
  }
665
603
  else {
666
- data$k = { value: a };
604
+ data$l = { value: a };
667
605
  }
668
606
  encode$1(24 /* Event.Custom */);
669
607
  }
670
608
  }
671
609
 
672
- var data$j = null;
610
+ var data$k = null;
673
611
  var updates$3 = null;
674
- function start$J() {
675
- data$j = {};
612
+ function start$L() {
613
+ data$k = {};
676
614
  updates$3 = {};
677
615
  count$1(5 /* Metric.InvokeCount */);
678
616
  }
679
- function stop$G() {
680
- data$j = {};
617
+ function stop$I() {
618
+ data$k = {};
681
619
  updates$3 = {};
682
620
  }
683
621
  function count$1(metric) {
684
- if (!(metric in data$j)) {
685
- data$j[metric] = 0;
622
+ if (!(metric in data$k)) {
623
+ data$k[metric] = 0;
686
624
  }
687
625
  if (!(metric in updates$3)) {
688
626
  updates$3[metric] = 0;
689
627
  }
690
- data$j[metric]++;
628
+ data$k[metric]++;
691
629
  updates$3[metric]++;
692
630
  }
693
631
  function sum(metric, value) {
694
632
  if (value !== null) {
695
- if (!(metric in data$j)) {
696
- data$j[metric] = 0;
633
+ if (!(metric in data$k)) {
634
+ data$k[metric] = 0;
697
635
  }
698
636
  if (!(metric in updates$3)) {
699
637
  updates$3[metric] = 0;
700
638
  }
701
- data$j[metric] += value;
639
+ data$k[metric] += value;
702
640
  updates$3[metric] += value;
703
641
  }
704
642
  }
705
643
  function max(metric, value) {
706
644
  // Ensure that we do not process null or NaN values
707
645
  if (value !== null && isNaN(value) === false) {
708
- if (!(metric in data$j)) {
709
- data$j[metric] = 0;
646
+ if (!(metric in data$k)) {
647
+ data$k[metric] = 0;
710
648
  }
711
- if (value > data$j[metric] || data$j[metric] === 0) {
649
+ if (value > data$k[metric] || data$k[metric] === 0) {
712
650
  updates$3[metric] = value;
713
- data$j[metric] = value;
651
+ data$k[metric] = value;
714
652
  }
715
653
  }
716
654
  }
717
- function compute$e() {
655
+ function compute$f() {
718
656
  encode$1(0 /* Event.Metric */);
719
657
  }
720
658
  function reset$t() {
@@ -728,11 +666,11 @@ function clearTimeout$1(handle) {
728
666
  return window.clearTimeout(handle);
729
667
  }
730
668
 
731
- var data$i;
669
+ var data$j;
732
670
  var last = 0;
733
671
  var interval = 0;
734
672
  var timeout$7 = null;
735
- function start$I() {
673
+ function start$K() {
736
674
  interval = 60000 /* Setting.PingInterval */;
737
675
  last = 0;
738
676
  }
@@ -745,16 +683,16 @@ function reset$s() {
745
683
  }
746
684
  function ping() {
747
685
  var now = time();
748
- data$i = { gap: now - last };
686
+ data$j = { gap: now - last };
749
687
  encode$1(25 /* Event.Ping */);
750
- if (data$i.gap < 300000 /* Setting.PingTimeout */) {
688
+ if (data$j.gap < 300000 /* Setting.PingTimeout */) {
751
689
  timeout$7 = setTimeout$1(ping, interval);
752
690
  }
753
691
  else {
754
692
  suspend();
755
693
  }
756
694
  }
757
- function stop$F() {
695
+ function stop$H() {
758
696
  clearTimeout$1(timeout$7);
759
697
  last = 0;
760
698
  interval = 0;
@@ -762,50 +700,50 @@ function stop$F() {
762
700
 
763
701
  var ping$1 = /*#__PURE__*/Object.freeze({
764
702
  __proto__: null,
765
- get data () { return data$i; },
703
+ get data () { return data$j; },
766
704
  reset: reset$s,
767
- start: start$I,
768
- stop: stop$F
705
+ start: start$K,
706
+ stop: stop$H
769
707
  });
770
708
 
771
- var data$h = null;
772
- function start$H() {
773
- data$h = {};
709
+ var data$i = null;
710
+ function start$J() {
711
+ data$i = {};
774
712
  }
775
- function stop$E() {
776
- data$h = {};
713
+ function stop$G() {
714
+ data$i = {};
777
715
  }
778
716
  function track$7(event, time) {
779
- if (!(event in data$h)) {
780
- data$h[event] = [[time, 0]];
717
+ if (!(event in data$i)) {
718
+ data$i[event] = [[time, 0]];
781
719
  }
782
720
  else {
783
- var e = data$h[event];
721
+ var e = data$i[event];
784
722
  var last = e[e.length - 1];
785
723
  // Add a new entry only if the new event occurs after configured interval
786
724
  // Otherwise, extend the duration of the previous entry
787
725
  if (time - last[0] > 100 /* Setting.SummaryInterval */) {
788
- data$h[event].push([time, 0]);
726
+ data$i[event].push([time, 0]);
789
727
  }
790
728
  else {
791
729
  last[1] = time - last[0];
792
730
  }
793
731
  }
794
732
  }
795
- function compute$d() {
733
+ function compute$e() {
796
734
  encode$1(36 /* Event.Summary */);
797
735
  }
798
736
  function reset$r() {
799
- data$h = {};
737
+ data$i = {};
800
738
  }
801
739
 
802
740
  var summary = /*#__PURE__*/Object.freeze({
803
741
  __proto__: null,
804
- compute: compute$d,
805
- get data () { return data$h; },
742
+ compute: compute$e,
743
+ get data () { return data$i; },
806
744
  reset: reset$r,
807
- start: start$H,
808
- stop: stop$E,
745
+ start: start$J,
746
+ stop: stop$G,
809
747
  track: track$7
810
748
  });
811
749
 
@@ -922,8 +860,8 @@ function read(stream) {
922
860
  });
923
861
  }
924
862
 
925
- var data$g = null;
926
- function start$G() {
863
+ var data$h = null;
864
+ function start$I() {
927
865
  reset$q();
928
866
  }
929
867
  function set(variable, value) {
@@ -970,22 +908,22 @@ function log$2(variable, value) {
970
908
  value &&
971
909
  typeof variable === "string" /* Constant.String */ &&
972
910
  variable.length < 255) {
973
- var validValues = variable in data$g ? data$g[variable] : [];
911
+ var validValues = variable in data$h ? data$h[variable] : [];
974
912
  for (var i = 0; i < value.length; i++) {
975
913
  if (typeof value[i] === "string" /* Constant.String */ && value[i].length < 255) {
976
914
  validValues.push(value[i]);
977
915
  }
978
916
  }
979
- data$g[variable] = validValues;
917
+ data$h[variable] = validValues;
980
918
  }
981
919
  }
982
- function compute$c() {
920
+ function compute$d() {
983
921
  encode$1(34 /* Event.Variable */);
984
922
  }
985
923
  function reset$q() {
986
- data$g = {};
924
+ data$h = {};
987
925
  }
988
- function stop$D() {
926
+ function stop$F() {
989
927
  reset$q();
990
928
  }
991
929
  function redact(input) {
@@ -1020,22 +958,22 @@ function detect(input) {
1020
958
 
1021
959
  var variable = /*#__PURE__*/Object.freeze({
1022
960
  __proto__: null,
1023
- compute: compute$c,
1024
- get data () { return data$g; },
961
+ compute: compute$d,
962
+ get data () { return data$h; },
1025
963
  identify: identify,
1026
964
  reset: reset$q,
1027
965
  set: set,
1028
- start: start$G,
1029
- stop: stop$D
966
+ start: start$I,
967
+ stop: stop$F
1030
968
  });
1031
969
 
1032
- var data$f = {};
970
+ var data$g = {};
1033
971
  var keys = new Set();
1034
972
  var variables = {};
1035
973
  var selectors = {};
1036
974
  var hashes = {};
1037
975
  var validation = {};
1038
- function start$F() {
976
+ function start$H() {
1039
977
  reset$p();
1040
978
  }
1041
979
  // Input string is of the following form:
@@ -1088,7 +1026,7 @@ function trigger$2(input) {
1088
1026
  function clone$1(v) {
1089
1027
  return JSON.parse(JSON.stringify(v));
1090
1028
  }
1091
- function compute$b() {
1029
+ function compute$c() {
1092
1030
  try {
1093
1031
  for (var v in variables) {
1094
1032
  var key = parseInt(v);
@@ -1137,21 +1075,21 @@ function reset$p() {
1137
1075
  }
1138
1076
  function update$1(key, subkey, value) {
1139
1077
  var update = false;
1140
- if (!(key in data$f)) {
1141
- data$f[key] = {};
1078
+ if (!(key in data$g)) {
1079
+ data$g[key] = {};
1142
1080
  update = true;
1143
1081
  }
1144
1082
  if (!isEmpty(hashes[key])
1145
- && (!(subkey in data$f[key]) || data$f[key][subkey] != value)) {
1083
+ && (!(subkey in data$g[key]) || data$g[key][subkey] != value)) {
1146
1084
  update = true;
1147
1085
  }
1148
- data$f[key][subkey] = value;
1086
+ data$g[key][subkey] = value;
1149
1087
  if (update) {
1150
1088
  keys.add(key);
1151
1089
  }
1152
1090
  return;
1153
1091
  }
1154
- function stop$C() {
1092
+ function stop$E() {
1155
1093
  reset$p();
1156
1094
  }
1157
1095
  function parse$1(variable) {
@@ -1220,16 +1158,128 @@ function isEmpty(obj) {
1220
1158
  var extract = /*#__PURE__*/Object.freeze({
1221
1159
  __proto__: null,
1222
1160
  clone: clone$1,
1223
- compute: compute$b,
1224
- data: data$f,
1161
+ compute: compute$c,
1162
+ data: data$g,
1225
1163
  keys: keys,
1226
1164
  reset: reset$p,
1227
- start: start$F,
1228
- stop: stop$C,
1165
+ start: start$H,
1166
+ stop: stop$E,
1229
1167
  trigger: trigger$2,
1230
1168
  update: update$1
1231
1169
  });
1232
1170
 
1171
+ function supported(target, api) {
1172
+ try {
1173
+ return !!target[api];
1174
+ }
1175
+ catch (_a) {
1176
+ return false;
1177
+ }
1178
+ }
1179
+ function encodeCookieValue(value) {
1180
+ return encodeURIComponent(value);
1181
+ }
1182
+ function decodeCookieValue(value) {
1183
+ try {
1184
+ var decodedValue = decodeURIComponent(value);
1185
+ return [decodedValue != value, decodedValue];
1186
+ }
1187
+ catch (_a) {
1188
+ }
1189
+ return [false, value];
1190
+ }
1191
+
1192
+ var rootDomain = null;
1193
+ var COOKIE_SEP = "^" /* Constant.Caret */;
1194
+ function start$G() {
1195
+ rootDomain = null;
1196
+ }
1197
+ function stop$D() {
1198
+ rootDomain = null;
1199
+ }
1200
+ function getCookie(key, limit) {
1201
+ var _a;
1202
+ if (limit === void 0) { limit = false; }
1203
+ if (supported(document, "cookie" /* Constant.Cookie */)) {
1204
+ var cookies = document.cookie.split(";" /* Constant.Semicolon */);
1205
+ if (cookies) {
1206
+ for (var i = 0; i < cookies.length; i++) {
1207
+ var pair = cookies[i].split("=" /* Constant.Equals */);
1208
+ if (pair.length > 1 && pair[0] && pair[0].trim() === key) {
1209
+ // Some browsers automatically url encode cookie values if they are not url encoded.
1210
+ // We therefore encode and decode cookie values ourselves.
1211
+ // For backwards compatability we need to consider 3 cases:
1212
+ // * Cookie was previously not encoded by Clarity and browser did not encode it
1213
+ // * Cookie was previously not encoded by Clarity and browser encoded it once or more
1214
+ // * Cookie was previously encoded by Clarity and browser did not encode it
1215
+ var _b = decodeCookieValue(pair[1]), isEncoded = _b[0], decodedValue = _b[1];
1216
+ while (isEncoded) {
1217
+ _a = decodeCookieValue(decodedValue), isEncoded = _a[0], decodedValue = _a[1];
1218
+ }
1219
+ // If we are limiting cookies, check if the cookie value is limited
1220
+ if (limit) {
1221
+ return decodedValue.endsWith("".concat("~" /* Constant.Tilde */, "1")) ? decodedValue.substring(0, decodedValue.length - 2) : null;
1222
+ }
1223
+ return decodedValue;
1224
+ }
1225
+ }
1226
+ }
1227
+ }
1228
+ return null;
1229
+ }
1230
+ function setCookie(key, value, time) {
1231
+ // only write cookies if we are currently in a cookie writing mode (and they are supported)
1232
+ // OR if we are trying to write an empty cookie (i.e. clear the cookie value out)
1233
+ if ((config$2.track || value == "" /* Constant.Empty */) && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Constant.Cookie */))) {
1234
+ // Some browsers automatically url encode cookie values if they are not url encoded.
1235
+ // We therefore encode and decode cookie values ourselves.
1236
+ var encodedValue = encodeCookieValue(value);
1237
+ var expiry = new Date();
1238
+ expiry.setDate(expiry.getDate() + time);
1239
+ var expires = expiry ? "expires=" /* Constant.Expires */ + expiry.toUTCString() : "" /* Constant.Empty */;
1240
+ var cookie = "".concat(key, "=").concat(encodedValue).concat(";" /* Constant.Semicolon */).concat(expires).concat(";path=/" /* Constant.Path */);
1241
+ try {
1242
+ // Attempt to get the root domain only once and fall back to writing cookie on the current domain.
1243
+ if (rootDomain === null) {
1244
+ var hostname = location.hostname ? location.hostname.split("." /* Constant.Dot */) : [];
1245
+ // Walk backwards on a domain and attempt to set a cookie, until successful
1246
+ for (var i = hostname.length - 1; i >= 0; i--) {
1247
+ rootDomain = ".".concat(hostname[i]).concat(rootDomain ? rootDomain : "" /* Constant.Empty */);
1248
+ // We do not wish to attempt writing a cookie on the absolute last part of the domain, e.g. .com or .net.
1249
+ // So we start attempting after second-last part, e.g. .domain.com (PASS) or .co.uk (FAIL)
1250
+ if (i < hostname.length - 1) {
1251
+ // Write the cookie on the current computed top level domain
1252
+ document.cookie = "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain);
1253
+ // Once written, check if the cookie exists and its value matches exactly with what we intended to set
1254
+ // Checking for exact value match helps us eliminate a corner case where the cookie may already be present with a different value
1255
+ // If the check is successful, no more action is required and we can return from the function since rootDomain cookie is already set
1256
+ // If the check fails, continue with the for loop until we can successfully set and verify the cookie
1257
+ if (getCookie(key) === value) {
1258
+ return;
1259
+ }
1260
+ }
1261
+ }
1262
+ // Finally, if we were not successful and gone through all the options, play it safe and reset rootDomain to be empty
1263
+ // This forces our code to fall back to always writing cookie to the current domain
1264
+ rootDomain = "" /* Constant.Empty */;
1265
+ }
1266
+ }
1267
+ catch (_a) {
1268
+ rootDomain = "" /* Constant.Empty */;
1269
+ }
1270
+ document.cookie = rootDomain ? "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain) : cookie;
1271
+ }
1272
+ }
1273
+
1274
+ var cookie = /*#__PURE__*/Object.freeze({
1275
+ __proto__: null,
1276
+ COOKIE_SEP: COOKIE_SEP,
1277
+ getCookie: getCookie,
1278
+ setCookie: setCookie,
1279
+ start: start$G,
1280
+ stop: stop$D
1281
+ });
1282
+
1233
1283
  var signalCallback = null;
1234
1284
  function signal(cb) {
1235
1285
  signalCallback = cb;
@@ -1258,34 +1308,34 @@ function signalsEvent(signalsPayload) {
1258
1308
  }
1259
1309
  }
1260
1310
 
1261
- var modules$2 = [baseline, dimension, variable, limit, summary, consent$2, metadata$1, envelope$1, upload$1, ping$1, upgrade$1, extract];
1262
- function start$E() {
1311
+ var modules$2 = [baseline, dimension, variable, limit, summary, cookie, consent$2, metadata$1, envelope$1, upload$1, ping$1, upgrade$1, extract];
1312
+ function start$F() {
1263
1313
  // Metric needs to be initialized before we can start measuring. so metric is not wrapped in measure
1264
- start$J();
1314
+ start$L();
1265
1315
  modules$2.forEach(function (x) { return measure(x.start)(); });
1266
1316
  }
1267
- function stop$B() {
1317
+ function stop$C() {
1268
1318
  // Stop modules in the reverse order of their initialization
1269
1319
  // The ordering below should respect inter-module dependency.
1270
1320
  // E.g. if upgrade depends on upload, then upgrade needs to end before upload.
1271
1321
  // Similarly, if upload depends on metadata, upload needs to end before metadata.
1272
1322
  modules$2.slice().reverse().forEach(function (x) { return measure(x.stop)(); });
1273
- stop$G();
1323
+ stop$I();
1274
1324
  }
1275
- function compute$a() {
1276
- compute$c();
1277
- compute$g();
1278
- compute$2();
1279
- compute$e();
1325
+ function compute$b() {
1280
1326
  compute$d();
1327
+ compute$g();
1281
1328
  compute$3();
1282
- compute$b();
1283
1329
  compute$f();
1330
+ compute$e();
1331
+ compute$4();
1332
+ compute$c();
1333
+ compute$2();
1284
1334
  }
1285
1335
 
1286
1336
  var history$5 = [];
1287
- var data$e;
1288
- function start$D() {
1337
+ var data$f;
1338
+ function start$E() {
1289
1339
  history$5 = [];
1290
1340
  max(26 /* Metric.Automation */, navigator.webdriver ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
1291
1341
  try {
@@ -1299,17 +1349,17 @@ function start$D() {
1299
1349
  function check$5(id, target, input) {
1300
1350
  // Compute hash for fraud detection, if enabled. Hash is computed only if input meets the minimum length criteria
1301
1351
  if (config$2.fraud && id !== null && input && input.length >= 5 /* Setting.WordLength */) {
1302
- data$e = { id: id, target: target, checksum: hash(input, 28 /* Setting.ChecksumPrecision */) };
1352
+ data$f = { id: id, target: target, checksum: hash(input, 28 /* Setting.ChecksumPrecision */) };
1303
1353
  // Only encode this event if we haven't already reported this hash
1304
- if (history$5.indexOf(data$e.checksum) < 0) {
1305
- history$5.push(data$e.checksum);
1354
+ if (history$5.indexOf(data$f.checksum) < 0) {
1355
+ history$5.push(data$f.checksum);
1306
1356
  encode$2(41 /* Event.Fraud */);
1307
1357
  }
1308
1358
  }
1309
1359
  }
1310
1360
 
1311
1361
  var state$a = [];
1312
- function start$C() {
1362
+ function start$D() {
1313
1363
  reset$o();
1314
1364
  }
1315
1365
  function observe$c(root) {
@@ -1327,7 +1377,7 @@ function recompute$8(evt) {
1327
1377
  function reset$o() {
1328
1378
  state$a = [];
1329
1379
  }
1330
- function stop$A() {
1380
+ function stop$B() {
1331
1381
  reset$o();
1332
1382
  }
1333
1383
 
@@ -1349,7 +1399,7 @@ function offset(element) {
1349
1399
 
1350
1400
  var UserInputTags = ["input", "textarea", "radio", "button", "canvas", "select"];
1351
1401
  var state$9 = [];
1352
- function start$B() {
1402
+ function start$C() {
1353
1403
  reset$n();
1354
1404
  }
1355
1405
  function observe$b(root) {
@@ -1490,12 +1540,12 @@ function context(a) {
1490
1540
  function reset$n() {
1491
1541
  state$9 = [];
1492
1542
  }
1493
- function stop$z() {
1543
+ function stop$A() {
1494
1544
  reset$n();
1495
1545
  }
1496
1546
 
1497
1547
  var state$8 = [];
1498
- function start$A() {
1548
+ function start$B() {
1499
1549
  reset$m();
1500
1550
  }
1501
1551
  function observe$a(root) {
@@ -1510,13 +1560,13 @@ function recompute$7(action, evt) {
1510
1560
  function reset$m() {
1511
1561
  state$8 = [];
1512
1562
  }
1513
- function stop$y() {
1563
+ function stop$z() {
1514
1564
  reset$m();
1515
1565
  }
1516
1566
 
1517
1567
  var timeout$6 = null;
1518
1568
  var state$7 = [];
1519
- function start$z() {
1569
+ function start$A() {
1520
1570
  reset$l();
1521
1571
  }
1522
1572
  function observe$9(root) {
@@ -1550,7 +1600,7 @@ function process$7(event) {
1550
1600
  function reset$l() {
1551
1601
  state$7 = [];
1552
1602
  }
1553
- function stop$x() {
1603
+ function stop$y() {
1554
1604
  clearTimeout$1(timeout$6);
1555
1605
  reset$l();
1556
1606
  }
@@ -1560,7 +1610,7 @@ var timeout$5 = null;
1560
1610
  var hasPrimaryTouch = false;
1561
1611
  var primaryTouchId = 0;
1562
1612
  var activeTouchPointIds = new Set();
1563
- function start$y() {
1613
+ function start$z() {
1564
1614
  reset$k();
1565
1615
  }
1566
1616
  function observe$8(root) {
@@ -1668,7 +1718,7 @@ function similar$1(last, current) {
1668
1718
  var sameId = current.data.id !== undefined ? current.data.id === last.data.id : true;
1669
1719
  return current.event === last.event && match && distance < 20 /* Setting.Distance */ && gap < 25 /* Setting.PointerInterval */ && sameId;
1670
1720
  }
1671
- function stop$w() {
1721
+ function stop$x() {
1672
1722
  clearTimeout$1(timeout$5);
1673
1723
  // Send out any pending pointer events in the pipeline
1674
1724
  if (state$6.length > 0) {
@@ -1724,11 +1774,11 @@ function throttle(func, duration) {
1724
1774
  return throttledFunction;
1725
1775
  }
1726
1776
 
1727
- var data$d;
1777
+ var data$e;
1728
1778
  var timeout$4 = null;
1729
1779
  var initialStateLogged = false;
1730
1780
  var throttledRecompute$1 = throttle(recompute$5, 500 /* Setting.LookAhead */);
1731
- function start$x() {
1781
+ function start$y() {
1732
1782
  initialStateLogged = false;
1733
1783
  bind(window, "resize", throttledRecompute$1);
1734
1784
  recompute$5();
@@ -1737,7 +1787,7 @@ function recompute$5() {
1737
1787
  var de = document.documentElement;
1738
1788
  // window.innerWidth includes width of the scrollbar and is not a true representation of the viewport width.
1739
1789
  // Therefore, when possible, use documentElement's clientWidth property.
1740
- data$d = {
1790
+ data$e = {
1741
1791
  width: de && "clientWidth" in de ? Math.min(de.clientWidth, window.innerWidth) : window.innerWidth,
1742
1792
  height: de && "clientHeight" in de ? Math.min(de.clientHeight, window.innerHeight) : window.innerHeight,
1743
1793
  };
@@ -1754,11 +1804,11 @@ function process$5(event) {
1754
1804
  schedule(encode$4.bind(this, event));
1755
1805
  }
1756
1806
  function reset$j() {
1757
- data$d = null;
1807
+ data$e = null;
1758
1808
  clearTimeout$1(timeout$4);
1759
1809
  throttledRecompute$1.cleanup();
1760
1810
  }
1761
- function stop$v() {
1811
+ function stop$w() {
1762
1812
  reset$j();
1763
1813
  }
1764
1814
 
@@ -1766,7 +1816,7 @@ var state$5 = [];
1766
1816
  var initialTop = null;
1767
1817
  var initialBottom = null;
1768
1818
  var timeout$3 = null;
1769
- function start$w() {
1819
+ function start$x() {
1770
1820
  state$5 = [];
1771
1821
  recompute$4();
1772
1822
  }
@@ -1851,7 +1901,7 @@ function similar(last, current) {
1851
1901
  var dy = last.data.y - current.data.y;
1852
1902
  return (dx * dx + dy * dy < 20 /* Setting.Distance */ * 20 /* Setting.Distance */) && (current.time - last.time < 50 /* Setting.ScrollInterval */);
1853
1903
  }
1854
- function compute$9() {
1904
+ function compute$a() {
1855
1905
  var _a, _b;
1856
1906
  if (initialTop) {
1857
1907
  var top_1 = metadata$2(initialTop, null);
@@ -1862,7 +1912,7 @@ function compute$9() {
1862
1912
  log(32 /* Dimension.InitialScrollBottom */, (_b = bottom === null || bottom === void 0 ? void 0 : bottom.hash) === null || _b === void 0 ? void 0 : _b.join("." /* Constant.Dot */));
1863
1913
  }
1864
1914
  }
1865
- function stop$u() {
1915
+ function stop$v() {
1866
1916
  clearTimeout$1(timeout$3);
1867
1917
  throttledRecompute.cleanup();
1868
1918
  state$5 = [];
@@ -1870,10 +1920,10 @@ function stop$u() {
1870
1920
  initialBottom = null;
1871
1921
  }
1872
1922
 
1873
- var data$c = null;
1923
+ var data$d = null;
1874
1924
  var previous = null;
1875
1925
  var timeout$2 = null;
1876
- function start$v() {
1926
+ function start$w() {
1877
1927
  reset$h();
1878
1928
  }
1879
1929
  function observe$6(root) {
@@ -1895,12 +1945,12 @@ function recompute$3(root) {
1895
1945
  (current.anchorNode === current.focusNode && current.anchorOffset === current.focusOffset)) {
1896
1946
  return;
1897
1947
  }
1898
- var startNode = data$c.start ? data$c.start : null;
1899
- if (previous !== null && data$c.start !== null && startNode !== current.anchorNode) {
1948
+ var startNode = data$d.start ? data$d.start : null;
1949
+ if (previous !== null && data$d.start !== null && startNode !== current.anchorNode) {
1900
1950
  clearTimeout$1(timeout$2);
1901
1951
  process$3(21 /* Event.Selection */);
1902
1952
  }
1903
- data$c = {
1953
+ data$d = {
1904
1954
  start: current.anchorNode,
1905
1955
  startOffset: current.anchorOffset,
1906
1956
  end: current.focusNode,
@@ -1915,15 +1965,15 @@ function process$3(event) {
1915
1965
  }
1916
1966
  function reset$h() {
1917
1967
  previous = null;
1918
- data$c = { start: 0, startOffset: 0, end: 0, endOffset: 0 };
1968
+ data$d = { start: 0, startOffset: 0, end: 0, endOffset: 0 };
1919
1969
  }
1920
- function stop$t() {
1970
+ function stop$u() {
1921
1971
  reset$h();
1922
1972
  clearTimeout$1(timeout$2);
1923
1973
  }
1924
1974
 
1925
1975
  var state$4 = [];
1926
- function start$u() {
1976
+ function start$v() {
1927
1977
  reset$g();
1928
1978
  }
1929
1979
  function observe$5(root) {
@@ -1936,28 +1986,28 @@ function recompute$2(evt) {
1936
1986
  function reset$g() {
1937
1987
  state$4 = [];
1938
1988
  }
1939
- function stop$s() {
1989
+ function stop$t() {
1940
1990
  reset$g();
1941
1991
  }
1942
1992
 
1943
- var data$b;
1944
- function start$t() {
1993
+ var data$c;
1994
+ function start$u() {
1945
1995
  bind(window, "pagehide", recompute$1);
1946
1996
  }
1947
1997
  function recompute$1(evt) {
1948
- data$b = { name: evt.type, persisted: evt.persisted ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */ };
1998
+ data$c = { name: evt.type, persisted: evt.persisted ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */ };
1949
1999
  encode$4(26 /* Event.Unload */, time(evt));
1950
2000
  stop();
1951
2001
  }
1952
2002
  function reset$f() {
1953
- data$b = null;
2003
+ data$c = null;
1954
2004
  }
1955
- function stop$r() {
2005
+ function stop$s() {
1956
2006
  reset$f();
1957
2007
  }
1958
2008
 
1959
- var data$a;
1960
- function start$s() {
2009
+ var data$b;
2010
+ function start$t() {
1961
2011
  bind(document, "visibilitychange", recompute);
1962
2012
  recompute();
1963
2013
  }
@@ -1965,62 +2015,62 @@ function recompute(evt) {
1965
2015
  if (evt === void 0) { evt = null; }
1966
2016
  if ("visibilityState" in document) {
1967
2017
  var visible = document.visibilityState === "visible" ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
1968
- data$a = { visible: visible };
2018
+ data$b = { visible: visible };
1969
2019
  encode$4(28 /* Event.Visibility */, time(evt));
1970
2020
  }
1971
2021
  }
1972
2022
  function reset$e() {
1973
- data$a = null;
2023
+ data$b = null;
1974
2024
  }
1975
- function stop$q() {
2025
+ function stop$r() {
1976
2026
  reset$e();
1977
2027
  }
1978
2028
 
1979
- var data$9;
1980
- function start$r() {
1981
- bind(window, "focus", function () { return compute$8(1 /* BooleanFlag.True */); });
1982
- bind(window, "blur", function () { return compute$8(0 /* BooleanFlag.False */); });
2029
+ var data$a;
2030
+ function start$s() {
2031
+ bind(window, "focus", function () { return compute$9(1 /* BooleanFlag.True */); });
2032
+ bind(window, "blur", function () { return compute$9(0 /* BooleanFlag.False */); });
1983
2033
  }
1984
- function stop$p() {
2034
+ function stop$q() {
1985
2035
  reset$d();
1986
2036
  }
1987
2037
  function reset$d() {
1988
- data$9 = null;
2038
+ data$a = null;
1989
2039
  }
1990
- function compute$8(focus) {
1991
- data$9 = { focused: focus };
2040
+ function compute$9(focus) {
2041
+ data$a = { focused: focus };
1992
2042
  encode$4(50 /* Event.Focus */);
1993
2043
  }
1994
2044
 
1995
- function start$q() {
1996
- start$i();
2045
+ function start$r() {
2046
+ start$j();
2047
+ start$C();
1997
2048
  start$B();
2049
+ start$z();
1998
2050
  start$A();
1999
2051
  start$y();
2000
- start$z();
2001
- start$x();
2052
+ start$t();
2002
2053
  start$s();
2003
- start$r();
2054
+ start$x();
2004
2055
  start$w();
2056
+ start$D();
2005
2057
  start$v();
2006
- start$C();
2007
2058
  start$u();
2008
- start$t();
2009
2059
  }
2010
- function stop$o() {
2011
- stop$g();
2060
+ function stop$p() {
2061
+ stop$h();
2062
+ stop$A();
2012
2063
  stop$z();
2064
+ stop$x();
2013
2065
  stop$y();
2014
2066
  stop$w();
2015
- stop$x();
2016
- stop$v();
2067
+ stop$r();
2017
2068
  stop$q();
2018
- stop$p();
2069
+ stop$v();
2019
2070
  stop$u();
2071
+ stop$B();
2020
2072
  stop$t();
2021
- stop$A();
2022
2073
  stop$s();
2023
- stop$r();
2024
2074
  }
2025
2075
  function observe$4(root) {
2026
2076
  observe$7(root);
@@ -2040,8 +2090,8 @@ function observe$4(root) {
2040
2090
  var interaction = /*#__PURE__*/Object.freeze({
2041
2091
  __proto__: null,
2042
2092
  observe: observe$4,
2043
- start: start$q,
2044
- stop: stop$o
2093
+ start: start$r,
2094
+ stop: stop$p
2045
2095
  });
2046
2096
 
2047
2097
  // Following code takes an array of tokens and transforms it to optimize for repeating tokens and make it efficient to send over the wire
@@ -2130,7 +2180,7 @@ function proxyStyleRules$1(win) {
2130
2180
  }
2131
2181
  }
2132
2182
  }
2133
- function start$p() {
2183
+ function start$q() {
2134
2184
  proxyStyleRules$1(window);
2135
2185
  }
2136
2186
  function checkDocumentStyles(documentNode, timestamp) {
@@ -2174,7 +2224,7 @@ function checkDocumentStyles(documentNode, timestamp) {
2174
2224
  styleTimeMap[documentId] = timestamp;
2175
2225
  }
2176
2226
  }
2177
- function compute$7() {
2227
+ function compute$8() {
2178
2228
  for (var _i = 0, documentNodes_1 = documentNodes; _i < documentNodes_1.length; _i++) {
2179
2229
  var documentNode = documentNodes_1[_i];
2180
2230
  var docId = documentNode == document ? -1 : getId$1(documentNode);
@@ -2186,7 +2236,7 @@ function reset$c() {
2186
2236
  sheetAdoptionState = [];
2187
2237
  sheetUpdateState = [];
2188
2238
  }
2189
- function stop$n() {
2239
+ function stop$o() {
2190
2240
  styleSheetMap = {};
2191
2241
  styleTimeMap = {};
2192
2242
  documentNodes = [];
@@ -2234,7 +2284,7 @@ var animationFinish = null;
2234
2284
  var animationId = 'clarityAnimationId';
2235
2285
  var operationCount = 'clarityOperationCount';
2236
2286
  var maxOperations = 20;
2237
- function start$o() {
2287
+ function start$p() {
2238
2288
  if (window["Animation"] &&
2239
2289
  window["Animation"].prototype &&
2240
2290
  window["KeyframeEffect"] &&
@@ -2289,7 +2339,7 @@ function track$6(time, id, operation, keyFrames, timing, targetId, timeline) {
2289
2339
  });
2290
2340
  encode$5(44 /* Event.Animation */);
2291
2341
  }
2292
- function stop$m() {
2342
+ function stop$n() {
2293
2343
  reset$b();
2294
2344
  }
2295
2345
  function overrideAnimationHelper(functionToOverride, name) {
@@ -2355,7 +2405,7 @@ function check$4(tag) {
2355
2405
  register$1(tag);
2356
2406
  }
2357
2407
  }
2358
- function start$n() {
2408
+ function start$o() {
2359
2409
  var _a;
2360
2410
  window.clarityOverrides = window.clarityOverrides || {};
2361
2411
  if (((_a = window.customElements) === null || _a === void 0 ? void 0 : _a.define) && !window.clarityOverrides.define) {
@@ -2371,7 +2421,7 @@ function start$n() {
2371
2421
  function reset$a() {
2372
2422
  elements.length = 0;
2373
2423
  }
2374
- function stop$l() {
2424
+ function stop$m() {
2375
2425
  reset$a();
2376
2426
  definedElements.clear();
2377
2427
  }
@@ -2399,7 +2449,7 @@ function encode$5 (type, timer, ts) {
2399
2449
  }
2400
2450
  return [3 /*break*/, 13];
2401
2451
  case 1:
2402
- d = data$8;
2452
+ d = data$9;
2403
2453
  tokens.push(d.width);
2404
2454
  tokens.push(d.height);
2405
2455
  track$8(type, d.width, d.height);
@@ -2556,15 +2606,15 @@ function attribute$1(key, value, privacy) {
2556
2606
  return "".concat(key, "=").concat(text$1(value, key.indexOf("data-" /* Constant.DataAttribute */) === 0 ? "data-" /* Constant.DataAttribute */ : key, privacy));
2557
2607
  }
2558
2608
 
2559
- var data$8;
2609
+ var data$9;
2560
2610
  function reset$9() {
2561
- data$8 = null;
2611
+ data$9 = null;
2562
2612
  }
2563
- function start$m() {
2613
+ function start$n() {
2564
2614
  reset$9();
2565
- compute$6();
2615
+ compute$7();
2566
2616
  }
2567
- function compute$6() {
2617
+ function compute$7() {
2568
2618
  var body = document.body;
2569
2619
  var d = document.documentElement;
2570
2620
  var bodyClientWidth = body ? body.clientWidth : null;
@@ -2582,12 +2632,12 @@ function compute$6() {
2582
2632
  var documentOffsetHeight = d ? d.offsetHeight : null;
2583
2633
  var height = Math.max(bodyClientHeight, bodyScrollHeight, bodyOffsetHeight, documentClientHeight, documentScrollHeight, documentOffsetHeight);
2584
2634
  // Check that width or height has changed from before, and also that width & height are not null values
2585
- if ((data$8 === null || width !== data$8.width || height !== data$8.height) && width !== null && height !== null) {
2586
- data$8 = { width: width, height: height };
2635
+ if ((data$9 === null || width !== data$9.width || height !== data$9.height) && width !== null && height !== null) {
2636
+ data$9 = { width: width, height: height };
2587
2637
  encode$5(8 /* Event.Document */);
2588
2638
  }
2589
2639
  }
2590
- function stop$k() {
2640
+ function stop$l() {
2591
2641
  reset$9();
2592
2642
  }
2593
2643
 
@@ -2639,7 +2689,7 @@ var history$4 = {};
2639
2689
  var observedNodes = new WeakMap();
2640
2690
  // We ignore mutations if these attributes are updated
2641
2691
  var IGNORED_ATTRIBUTES = ["data-google-query-id", "data-load-complete", "data-google-container-id"];
2642
- function start$l() {
2692
+ function start$m() {
2643
2693
  observers = new Set();
2644
2694
  queue$2 = [];
2645
2695
  timeout$1 = null;
@@ -2677,7 +2727,7 @@ function monitor(frame) {
2677
2727
  bind(frame, "load" /* Constant.LoadEvent */, generate.bind(this, frame, "childList" /* Constant.ChildList */), true);
2678
2728
  }
2679
2729
  }
2680
- function stop$j() {
2730
+ function stop$k() {
2681
2731
  for (var _i = 0, _a = Array.from(observers); _i < _a.length; _i++) {
2682
2732
  var observer = _a[_i];
2683
2733
  if (observer) {
@@ -2710,8 +2760,8 @@ function handle$1(m) {
2710
2760
  track$7(6 /* Event.Mutation */, now);
2711
2761
  mutations.push({ time: now, mutations: m });
2712
2762
  schedule(process$2, 1 /* Priority.High */).then(function () {
2713
- setTimeout$1(compute$6);
2714
- measure(compute$5)();
2763
+ setTimeout$1(compute$7);
2764
+ measure(compute$6)();
2715
2765
  });
2716
2766
  }
2717
2767
  function processMutation(timer, mutation, instance, timestamp) {
@@ -2764,7 +2814,7 @@ function process$2() {
2764
2814
  switch (_d.label) {
2765
2815
  case 0:
2766
2816
  timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
2767
- start$d(timer);
2817
+ start$e(timer);
2768
2818
  _d.label = 1;
2769
2819
  case 1:
2770
2820
  if (!(mutations.length > 0)) return [3 /*break*/, 7];
@@ -2814,7 +2864,7 @@ function process$2() {
2814
2864
  _d.label = 13;
2815
2865
  case 13:
2816
2866
  cleanHistory();
2817
- stop$c(timer);
2867
+ stop$d(timer);
2818
2868
  return [2 /*return*/];
2819
2869
  }
2820
2870
  });
@@ -3490,11 +3540,11 @@ var iframeMap = null; // Maps iframe's contentDocument => parent iframe element
3490
3540
  var iframeContentMap = null; // Maps parent iframe element => iframe's contentDocument & contentWindow
3491
3541
  var privacyMap = null; // Maps node => Privacy (enum)
3492
3542
  var fraudMap = null; // Maps node => FraudId (number)
3493
- function start$k() {
3543
+ function start$l() {
3494
3544
  reset$7();
3495
3545
  parse(document, true);
3496
3546
  }
3497
- function stop$i() {
3547
+ function stop$j() {
3498
3548
  reset$7();
3499
3549
  }
3500
3550
  function reset$7() {
@@ -3889,7 +3939,7 @@ var regions = {};
3889
3939
  var queue$1 = [];
3890
3940
  var watch = false;
3891
3941
  var observer$1 = null;
3892
- function start$j() {
3942
+ function start$k() {
3893
3943
  reset$6();
3894
3944
  observer$1 = null;
3895
3945
  regionMap = new WeakMap();
@@ -3934,7 +3984,7 @@ function track$3(id, event) {
3934
3984
  // Process updates to this region, if applicable
3935
3985
  process$1(node, data, interaction, data.visibility);
3936
3986
  }
3937
- function compute$5() {
3987
+ function compute$6() {
3938
3988
  // Process any regions where we couldn't resolve an "id" for at the time of last intersection observer event
3939
3989
  // This could happen in cases where elements are not yet processed by Clarity's virtual DOM but browser reports a change, regardless.
3940
3990
  // For those cases we add them to the queue and re-process them below
@@ -4017,7 +4067,7 @@ function clone(r) {
4017
4067
  function reset$6() {
4018
4068
  state$2 = [];
4019
4069
  }
4020
- function stop$h() {
4070
+ function stop$i() {
4021
4071
  reset$6();
4022
4072
  regionMap = null;
4023
4073
  regions = {};
@@ -4140,7 +4190,7 @@ function encode$4 (type, ts) {
4140
4190
  reset$m();
4141
4191
  break;
4142
4192
  case 11 /* Event.Resize */:
4143
- r = data$d;
4193
+ r = data$e;
4144
4194
  tokens.push(r.width);
4145
4195
  tokens.push(r.height);
4146
4196
  track$8(type, r.width, r.height);
@@ -4148,7 +4198,7 @@ function encode$4 (type, ts) {
4148
4198
  queue(tokens);
4149
4199
  break;
4150
4200
  case 26 /* Event.Unload */:
4151
- u = data$b;
4201
+ u = data$c;
4152
4202
  tokens.push(u.name);
4153
4203
  tokens.push(u.persisted);
4154
4204
  reset$f();
@@ -4167,7 +4217,7 @@ function encode$4 (type, ts) {
4167
4217
  reset$l();
4168
4218
  break;
4169
4219
  case 21 /* Event.Selection */:
4170
- s = data$c;
4220
+ s = data$d;
4171
4221
  if (s) {
4172
4222
  startTarget = metadata$2(s.start, type);
4173
4223
  endTarget = metadata$2(s.end, type);
@@ -4243,14 +4293,14 @@ function encode$4 (type, ts) {
4243
4293
  reset$5();
4244
4294
  break;
4245
4295
  case 28 /* Event.Visibility */:
4246
- v = data$a;
4296
+ v = data$b;
4247
4297
  tokens.push(v.visible);
4248
4298
  queue(tokens);
4249
4299
  visibility(t, v.visible);
4250
4300
  reset$e();
4251
4301
  break;
4252
4302
  case 50 /* Event.Focus */: {
4253
- f = data$9;
4303
+ f = data$a;
4254
4304
  tokens.push(f.focused);
4255
4305
  queue(tokens, false);
4256
4306
  reset$d();
@@ -4264,7 +4314,7 @@ function encode$4 (type, ts) {
4264
4314
 
4265
4315
  var state$1 = [];
4266
4316
  var updates$1 = [];
4267
- function start$i() {
4317
+ function start$j() {
4268
4318
  state$1 = [];
4269
4319
  reset$5();
4270
4320
  }
@@ -4291,7 +4341,7 @@ function track$2(time, event, hash, x, y, reaction, context) {
4291
4341
  // We would still need to capture the last scroll position as part of the baseline event, even when timeline will be empty.
4292
4342
  track$8(event, x, y, time);
4293
4343
  }
4294
- function compute$4() {
4344
+ function compute$5() {
4295
4345
  if (!data$1) {
4296
4346
  return;
4297
4347
  }
@@ -4311,7 +4361,7 @@ function compute$4() {
4311
4361
  state$1 = temp; // Drop events less than the min time
4312
4362
  encode$4(22 /* Event.Timeline */);
4313
4363
  }
4314
- function stop$g() {
4364
+ function stop$h() {
4315
4365
  state$1 = [];
4316
4366
  reset$5();
4317
4367
  }
@@ -4324,7 +4374,7 @@ function encode$3 (type) {
4324
4374
  tokens = [eventTime, type];
4325
4375
  switch (type) {
4326
4376
  case 8 /* Event.Document */:
4327
- d = data$8;
4377
+ d = data$9;
4328
4378
  tokens.push(d.width);
4329
4379
  tokens.push(d.height);
4330
4380
  track$8(type, d.width, d.height);
@@ -4452,11 +4502,11 @@ function add(node, parent, data) {
4452
4502
  var stopCallbacks = [];
4453
4503
  var active$2 = false;
4454
4504
  var modules$1 = null;
4455
- function start$h() {
4505
+ function start$i() {
4456
4506
  active$2 = true;
4457
4507
  modules$1 = new Set();
4458
4508
  }
4459
- function stop$f() {
4509
+ function stop$g() {
4460
4510
  stopCallbacks.reverse().forEach(function (callback) {
4461
4511
  try {
4462
4512
  callback();
@@ -4508,8 +4558,8 @@ var dynamic = /*#__PURE__*/Object.freeze({
4508
4558
  __proto__: null,
4509
4559
  event: event,
4510
4560
  register: register,
4511
- start: start$h,
4512
- stop: stop$f
4561
+ start: start$i,
4562
+ stop: stop$g
4513
4563
  });
4514
4564
 
4515
4565
  var discoverBytes = 0;
@@ -4522,7 +4572,7 @@ var active$1;
4522
4572
  var queuedTime = 0;
4523
4573
  var leanLimit = false;
4524
4574
  var track$1;
4525
- function start$g() {
4575
+ function start$h() {
4526
4576
  active$1 = true;
4527
4577
  discoverBytes = 0;
4528
4578
  playbackBytes = 0;
@@ -4593,7 +4643,7 @@ function queue(tokens, transmit) {
4593
4643
  check$2(playbackBytes);
4594
4644
  }
4595
4645
  }
4596
- function stop$e() {
4646
+ function stop$f() {
4597
4647
  clearTimeout$1(timeout);
4598
4648
  upload(true);
4599
4649
  discoverBytes = 0;
@@ -4623,10 +4673,10 @@ function upload(final) {
4623
4673
  }
4624
4674
  // CAUTION: Ensure "transmit" is set to false in the queue function for following events
4625
4675
  // Otherwise you run a risk of infinite loop.
4676
+ compute$6();
4626
4677
  compute$5();
4627
- compute$4();
4628
- compute$a();
4629
- compute$7();
4678
+ compute$b();
4679
+ compute$8();
4630
4680
  last = final === true;
4631
4681
  // In some cases envelope has null data because it's part of the shutdown process while there's one upload call queued which might introduce runtime error
4632
4682
  if (!data$1)
@@ -4839,8 +4889,8 @@ function response(payload) {
4839
4889
  }
4840
4890
 
4841
4891
  var history$3 = {};
4842
- var data$7;
4843
- function start$f() {
4892
+ var data$8;
4893
+ function start$g() {
4844
4894
  bind(window, "error", handler);
4845
4895
  history$3 = {};
4846
4896
  }
@@ -4856,7 +4906,7 @@ function handler(error) {
4856
4906
  }
4857
4907
  // Send back information only if the handled error has valid information
4858
4908
  if (e && e.message) {
4859
- data$7 = {
4909
+ data$8 = {
4860
4910
  message: e.message,
4861
4911
  line: error["lineno"],
4862
4912
  column: error["colno"],
@@ -4875,28 +4925,28 @@ function encode$2 (type) {
4875
4925
  tokens = [time(), type];
4876
4926
  switch (type) {
4877
4927
  case 31 /* Event.ScriptError */:
4878
- tokens.push(data$7.message);
4879
- tokens.push(data$7.line);
4880
- tokens.push(data$7.column);
4881
- tokens.push(data$7.stack);
4882
- tokens.push(url$1(data$7.source));
4928
+ tokens.push(data$8.message);
4929
+ tokens.push(data$8.line);
4930
+ tokens.push(data$8.column);
4931
+ tokens.push(data$8.stack);
4932
+ tokens.push(url$1(data$8.source));
4883
4933
  queue(tokens);
4884
4934
  break;
4885
4935
  case 33 /* Event.Log */:
4886
- if (data$6) {
4887
- tokens.push(data$6.code);
4888
- tokens.push(data$6.name);
4889
- tokens.push(data$6.message);
4890
- tokens.push(data$6.stack);
4891
- tokens.push(data$6.severity);
4936
+ if (data$7) {
4937
+ tokens.push(data$7.code);
4938
+ tokens.push(data$7.name);
4939
+ tokens.push(data$7.message);
4940
+ tokens.push(data$7.stack);
4941
+ tokens.push(data$7.severity);
4892
4942
  queue(tokens, false);
4893
4943
  }
4894
4944
  break;
4895
4945
  case 41 /* Event.Fraud */:
4896
- if (data$e) {
4897
- tokens.push(data$e.id);
4898
- tokens.push(data$e.target);
4899
- tokens.push(data$e.checksum);
4946
+ if (data$f) {
4947
+ tokens.push(data$f.id);
4948
+ tokens.push(data$f.target);
4949
+ tokens.push(data$f.checksum);
4900
4950
  queue(tokens, false);
4901
4951
  }
4902
4952
  break;
@@ -4907,8 +4957,8 @@ function encode$2 (type) {
4907
4957
  }
4908
4958
 
4909
4959
  var history$2 = {};
4910
- var data$6;
4911
- function start$e() {
4960
+ var data$7;
4961
+ function start$f() {
4912
4962
  history$2 = {};
4913
4963
  }
4914
4964
  function log$1(code, severity, name, message, stack) {
@@ -4921,7 +4971,7 @@ function log$1(code, severity, name, message, stack) {
4921
4971
  if (code in history$2 && history$2[code].indexOf(key) >= 0) {
4922
4972
  return;
4923
4973
  }
4924
- data$6 = { code: code, name: name, message: message, stack: stack, severity: severity };
4974
+ data$7 = { code: code, name: name, message: message, stack: stack, severity: severity };
4925
4975
  // Maintain history of errors in memory to avoid sending redundant information
4926
4976
  if (code in history$2) {
4927
4977
  history$2[code].push(key);
@@ -4931,7 +4981,7 @@ function log$1(code, severity, name, message, stack) {
4931
4981
  }
4932
4982
  encode$2(33 /* Event.Log */);
4933
4983
  }
4934
- function stop$d() {
4984
+ function stop$e() {
4935
4985
  history$2 = {};
4936
4986
  }
4937
4987
 
@@ -5028,7 +5078,7 @@ function state(timer) {
5028
5078
  // If this task is no longer being tracked, send stop message to the caller
5029
5079
  return 2 /* Task.Stop */;
5030
5080
  }
5031
- function start$d(timer) {
5081
+ function start$e(timer) {
5032
5082
  tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* Setting.LongTask */ };
5033
5083
  }
5034
5084
  function restart$2(timer) {
@@ -5036,12 +5086,12 @@ function restart$2(timer) {
5036
5086
  if (tracker && tracker[id]) {
5037
5087
  var c = tracker[id].calls;
5038
5088
  var y = tracker[id].yield;
5039
- start$d(timer);
5089
+ start$e(timer);
5040
5090
  tracker[id].calls = c + 1;
5041
5091
  tracker[id].yield = y;
5042
5092
  }
5043
5093
  }
5044
- function stop$c(timer) {
5094
+ function stop$d(timer) {
5045
5095
  var end = performance.now();
5046
5096
  var id = key(timer);
5047
5097
  var duration = end - tracker[id].start;
@@ -5062,7 +5112,7 @@ function suspend$1(timer) {
5062
5112
  case 0:
5063
5113
  id = key(timer);
5064
5114
  if (!(id in tracker)) return [3 /*break*/, 2];
5065
- stop$c(timer);
5115
+ stop$d(timer);
5066
5116
  // some customer polyfills for requestIdleCallback return null
5067
5117
  _b = tracker[id];
5068
5118
  return [4 /*yield*/, wait()];
@@ -5133,11 +5183,11 @@ function requestIdleCallbackPolyfill(callback, options) {
5133
5183
  }
5134
5184
  var requestIdleCallback = window["requestIdleCallback"] || requestIdleCallbackPolyfill;
5135
5185
 
5136
- function start$c() {
5186
+ function start$d() {
5137
5187
  schedule(discover, 1 /* Priority.High */).then(function () {
5188
+ measure(compute$7)();
5138
5189
  measure(compute$6)();
5139
- measure(compute$5)();
5140
- measure(compute$9)();
5190
+ measure(compute$a)();
5141
5191
  });
5142
5192
  }
5143
5193
  function discover() {
@@ -5148,7 +5198,7 @@ function discover() {
5148
5198
  case 0:
5149
5199
  ts = time();
5150
5200
  timer = { id: id(), cost: 3 /* Metric.LayoutCost */ };
5151
- start$d(timer);
5201
+ start$e(timer);
5152
5202
  return [4 /*yield*/, traverse$1(document, timer, 0 /* Source.Discover */, ts)];
5153
5203
  case 1:
5154
5204
  _a.sent();
@@ -5156,19 +5206,19 @@ function discover() {
5156
5206
  return [4 /*yield*/, encode$5(5 /* Event.Discover */, timer, ts)];
5157
5207
  case 2:
5158
5208
  _a.sent();
5159
- stop$c(timer);
5209
+ stop$d(timer);
5160
5210
  return [2 /*return*/];
5161
5211
  }
5162
5212
  });
5163
5213
  });
5164
5214
  }
5165
5215
 
5166
- var data$5 = null;
5167
- function start$b() {
5216
+ var data$6 = null;
5217
+ function start$c() {
5168
5218
  if (!config$2.lean && config$2.upgrade) {
5169
5219
  config$2.upgrade("Config" /* Constant.Config */);
5170
5220
  }
5171
- data$5 = null;
5221
+ data$6 = null;
5172
5222
  }
5173
5223
  // Following call will upgrade the session from lean mode into the full mode retroactively from the start of the page.
5174
5224
  // As part of the lean mode, we do not send back any layout information - including discovery of DOM and mutations.
@@ -5178,7 +5228,7 @@ function upgrade(key) {
5178
5228
  // Upgrade only if Clarity was successfully activated on the page
5179
5229
  if (active() && config$2.lean) {
5180
5230
  config$2.lean = false;
5181
- data$5 = { key: key };
5231
+ data$6 = { key: key };
5182
5232
  // Update metadata to track we have upgraded this session
5183
5233
  callback();
5184
5234
  save();
@@ -5188,13 +5238,13 @@ function upgrade(key) {
5188
5238
  }
5189
5239
  encode$1(3 /* Event.Upgrade */);
5190
5240
  if (config$2.lite) {
5191
- start$c();
5192
- start$p();
5241
+ start$d();
5242
+ start$q();
5193
5243
  }
5194
5244
  }
5195
5245
  }
5196
- function stop$b() {
5197
- data$5 = null;
5246
+ function stop$c() {
5247
+ data$6 = null;
5198
5248
  }
5199
5249
 
5200
5250
  function encode$1 (event) {
@@ -5236,15 +5286,15 @@ function encode$1 (event) {
5236
5286
  break;
5237
5287
  }
5238
5288
  case 25 /* Event.Ping */:
5239
- tokens.push(data$i.gap);
5289
+ tokens.push(data$j.gap);
5240
5290
  queue(tokens);
5241
5291
  break;
5242
5292
  case 35 /* Event.Limit */:
5243
- tokens.push(data$4.check);
5293
+ tokens.push(data$5.check);
5244
5294
  queue(tokens, false);
5245
5295
  break;
5246
5296
  case 3 /* Event.Upgrade */:
5247
- tokens.push(data$5.key);
5297
+ tokens.push(data$6.key);
5248
5298
  queue(tokens);
5249
5299
  break;
5250
5300
  case 2 /* Event.Upload */:
@@ -5255,17 +5305,17 @@ function encode$1 (event) {
5255
5305
  break;
5256
5306
  case 24 /* Event.Custom */:
5257
5307
  // not all custom events have a key - if it wasn't passed server handles just value
5258
- data$k.key && tokens.push(data$k.key);
5259
- tokens.push(data$k.value);
5308
+ data$l.key && tokens.push(data$l.key);
5309
+ tokens.push(data$l.value);
5260
5310
  queue(tokens);
5261
5311
  break;
5262
5312
  case 34 /* Event.Variable */: {
5263
- var variableKeys = Object.keys(data$g);
5313
+ var variableKeys = Object.keys(data$h);
5264
5314
  if (variableKeys.length > 0) {
5265
5315
  for (var _i = 0, variableKeys_1 = variableKeys; _i < variableKeys_1.length; _i++) {
5266
5316
  var v = variableKeys_1[_i];
5267
5317
  tokens.push(v);
5268
- tokens.push(data$g[v]);
5318
+ tokens.push(data$h[v]);
5269
5319
  }
5270
5320
  reset$q();
5271
5321
  queue(tokens, false);
@@ -5303,13 +5353,13 @@ function encode$1 (event) {
5303
5353
  break;
5304
5354
  }
5305
5355
  case 36 /* Event.Summary */: {
5306
- var eventKeys = Object.keys(data$h);
5356
+ var eventKeys = Object.keys(data$i);
5307
5357
  if (eventKeys.length > 0) {
5308
5358
  for (var _c = 0, eventKeys_1 = eventKeys; _c < eventKeys_1.length; _c++) {
5309
5359
  var e = eventKeys_1[_c];
5310
5360
  var key = parseInt(e, 10);
5311
5361
  tokens.push(key);
5312
- tokens.push([].concat.apply([], data$h[e]));
5362
+ tokens.push([].concat.apply([], data$i[e]));
5313
5363
  }
5314
5364
  reset$r();
5315
5365
  queue(tokens, false);
@@ -5321,10 +5371,10 @@ function encode$1 (event) {
5321
5371
  extractKeys.forEach(function (e) {
5322
5372
  tokens.push(e);
5323
5373
  var token = [];
5324
- for (var d in data$f[e]) {
5374
+ for (var d in data$g[e]) {
5325
5375
  var key = parseInt(d, 10);
5326
5376
  token.push(key);
5327
- token.push(data$f[e][d]);
5377
+ token.push(data$g[e][d]);
5328
5378
  }
5329
5379
  tokens.push(token);
5330
5380
  });
@@ -5333,57 +5383,57 @@ function encode$1 (event) {
5333
5383
  break;
5334
5384
  }
5335
5385
  case 47 /* Event.Consent */:
5336
- tokens.push(data$l.source);
5337
- tokens.push(data$l.ad_Storage);
5338
- tokens.push(data$l.analytics_Storage);
5386
+ tokens.push(data$3.source);
5387
+ tokens.push(data$3.ad_Storage);
5388
+ tokens.push(data$3.analytics_Storage);
5339
5389
  queue(tokens, false);
5340
5390
  break;
5341
5391
  }
5342
5392
  }
5343
5393
 
5344
- var data$4;
5345
- function start$a() {
5346
- data$4 = { check: 0 /* Check.None */ };
5394
+ var data$5;
5395
+ function start$b() {
5396
+ data$5 = { check: 0 /* Check.None */ };
5347
5397
  }
5348
5398
  function check$2(bytes) {
5349
- if (data$4.check === 0 /* Check.None */) {
5350
- var reason = data$4.check;
5399
+ if (data$5.check === 0 /* Check.None */) {
5400
+ var reason = data$5.check;
5351
5401
  reason = data$1.sequence >= 128 /* Setting.PayloadLimit */ ? 1 /* Check.Payload */ : reason;
5352
5402
  reason = data$1.pageNum >= 128 /* Setting.PageLimit */ ? 7 /* Check.Page */ : reason;
5353
5403
  reason = time() > 7200000 /* Setting.ShutdownLimit */ ? 2 /* Check.Shutdown */ : reason;
5354
5404
  reason = bytes > 10485760 /* Setting.PlaybackBytesLimit */ ? 2 /* Check.Shutdown */ : reason;
5355
- if (reason !== data$4.check) {
5405
+ if (reason !== data$5.check) {
5356
5406
  trigger(reason);
5357
5407
  }
5358
5408
  }
5359
5409
  }
5360
5410
  function trigger(reason) {
5361
- data$4.check = reason;
5411
+ data$5.check = reason;
5362
5412
  // limit the dimensions we collect, but we don't need to stop Clarity entirely if we hit the limit
5363
5413
  if (reason !== 5 /* Check.Collection */) {
5364
5414
  clear();
5365
5415
  stop();
5366
5416
  }
5367
5417
  }
5368
- function compute$3() {
5369
- if (data$4.check !== 0 /* Check.None */) {
5418
+ function compute$4() {
5419
+ if (data$5.check !== 0 /* Check.None */) {
5370
5420
  encode$1(35 /* Event.Limit */);
5371
5421
  }
5372
5422
  }
5373
- function stop$a() {
5374
- data$4 = null;
5423
+ function stop$b() {
5424
+ data$5 = null;
5375
5425
  }
5376
5426
 
5377
- var data$3 = null;
5427
+ var data$4 = null;
5378
5428
  var updates = null;
5379
5429
  var limited = false;
5380
- function start$9() {
5381
- data$3 = {};
5430
+ function start$a() {
5431
+ data$4 = {};
5382
5432
  updates = {};
5383
5433
  limited = false;
5384
5434
  }
5385
- function stop$9() {
5386
- data$3 = {};
5435
+ function stop$a() {
5436
+ data$4 = {};
5387
5437
  updates = {};
5388
5438
  limited = false;
5389
5439
  }
@@ -5392,19 +5442,19 @@ function log(dimension, value) {
5392
5442
  if (value) {
5393
5443
  // Ensure received value is casted into a string if it wasn't a string to begin with
5394
5444
  value = "".concat(value);
5395
- if (!(dimension in data$3)) {
5396
- data$3[dimension] = [];
5445
+ if (!(dimension in data$4)) {
5446
+ data$4[dimension] = [];
5397
5447
  }
5398
- if (data$3[dimension].indexOf(value) < 0) {
5448
+ if (data$4[dimension].indexOf(value) < 0) {
5399
5449
  // Limit check to ensure we have a cap on number of dimensions we can collect
5400
- if (data$3[dimension].length > 128 /* Setting.CollectionLimit */) {
5450
+ if (data$4[dimension].length > 128 /* Setting.CollectionLimit */) {
5401
5451
  if (!limited) {
5402
5452
  limited = true;
5403
5453
  trigger(5 /* Check.Collection */);
5404
5454
  }
5405
5455
  return;
5406
5456
  }
5407
- data$3[dimension].push(value);
5457
+ data$4[dimension].push(value);
5408
5458
  // If this is a new value, track it as part of updates object
5409
5459
  // This allows us to only send back new values in subsequent payloads
5410
5460
  if (!(dimension in updates)) {
@@ -5414,7 +5464,7 @@ function log(dimension, value) {
5414
5464
  }
5415
5465
  }
5416
5466
  }
5417
- function compute$2() {
5467
+ function compute$3() {
5418
5468
  encode$1(1 /* Event.Dimension */);
5419
5469
  }
5420
5470
  function reset$3() {
@@ -5422,15 +5472,74 @@ function reset$3() {
5422
5472
  limited = false;
5423
5473
  }
5424
5474
 
5475
+ var data$3 = null;
5476
+ var updateConsent = true;
5477
+ function start$9() {
5478
+ var _a;
5479
+ var ics = (_a = window.google_tag_data) === null || _a === void 0 ? void 0 : _a.ics;
5480
+ updateConsent = true;
5481
+ if (ics === null || ics === void 0 ? void 0 : ics.addListener) {
5482
+ ics.addListener(["ad_storage" /* Constant.AdStorage */, "analytics_storage" /* Constant.AnalyticsStorage */], processConsent);
5483
+ }
5484
+ }
5485
+ function stop$9() {
5486
+ updateConsent = true;
5487
+ }
5488
+ function processConsent() {
5489
+ var _a;
5490
+ var ics = (_a = window.google_tag_data) === null || _a === void 0 ? void 0 : _a.ics;
5491
+ if (!(ics === null || ics === void 0 ? void 0 : ics.getConsentState)) {
5492
+ return;
5493
+ }
5494
+ var analytics_storage = ics.getConsentState("analytics_storage" /* Constant.AnalyticsStorage */);
5495
+ var ad_storage = ics.getConsentState("ad_storage" /* Constant.AdStorage */);
5496
+ var consentState = getConsentState({ ad_Storage: ad_storage, analytics_Storage: analytics_storage });
5497
+ consentv2(consentState, 2 /* ConsentSource.GCM */);
5498
+ }
5499
+ function getConsentState(googleConsent) {
5500
+ var consentState = {
5501
+ ad_Storage: googleConsent.ad_Storage === 1 /* GCMConsent.Granted */ ? "granted" /* Constant.Granted */ : "denied" /* Constant.Denied */,
5502
+ analytics_Storage: googleConsent.analytics_Storage === 1 /* GCMConsent.Granted */ ? "granted" /* Constant.Granted */ : "denied" /* Constant.Denied */,
5503
+ };
5504
+ return consentState;
5505
+ }
5506
+ function config$1(consent) {
5507
+ trackConsent(consent.analytics_Storage ? 1 /* ConsentType.Implicit */ : 0 /* ConsentType.None */);
5508
+ data$3 = consent;
5509
+ }
5510
+ // When we get consent signal as false, we restart the service and track config as false.
5511
+ function consent$1() {
5512
+ trackConsent(2 /* ConsentType.General */);
5513
+ }
5514
+ function trackConsent(consent) {
5515
+ log(36 /* Dimension.Consent */, consent.toString());
5516
+ }
5517
+ function trackConsentv2(consent) {
5518
+ data$3 = consent;
5519
+ encode$1(47 /* Event.Consent */);
5520
+ }
5521
+ // Compute function is called every upload, but we only want to send consent data once.
5522
+ function compute$2() {
5523
+ var _a;
5524
+ if (updateConsent) {
5525
+ encode$1(47 /* Event.Consent */);
5526
+ updateConsent = false;
5527
+ if (!config$2.track) {
5528
+ var ics = (_a = window.google_tag_data) === null || _a === void 0 ? void 0 : _a.ics;
5529
+ if (ics === null || ics === void 0 ? void 0 : ics.usedUpdate) {
5530
+ processConsent();
5531
+ }
5532
+ }
5533
+ }
5534
+ }
5535
+
5425
5536
  var data$2 = null;
5426
5537
  var callbacks = [];
5427
5538
  var electron = 0 /* BooleanFlag.False */;
5428
- var rootDomain = null;
5429
5539
  var consentStatus = null;
5430
5540
  var defaultStatus = { source: 1 /* ConsentSource.API */, ad_Storage: "denied" /* Constant.Denied */, analytics_Storage: "denied" /* Constant.Denied */ };
5431
5541
  function start$8() {
5432
5542
  var _a, _b, _c;
5433
- rootDomain = null;
5434
5543
  var ua = navigator && "userAgent" in navigator ? navigator.userAgent : "" /* Constant.Empty */;
5435
5544
  var timezone = (_c = (typeof Intl !== 'undefined' && ((_b = (_a = Intl === null || Intl === void 0 ? void 0 : Intl.DateTimeFormat()) === null || _a === void 0 ? void 0 : _a.resolvedOptions()) === null || _b === void 0 ? void 0 : _b.timeZone))) !== null && _c !== void 0 ? _c : '';
5436
5545
  var timezoneOffset = new Date().getTimezoneOffset().toString();
@@ -5520,7 +5629,6 @@ function userAgentData() {
5520
5629
  }
5521
5630
  }
5522
5631
  function stop$8() {
5523
- rootDomain = null;
5524
5632
  data$2 = null;
5525
5633
  callbacks.forEach(function (cb) { cb.called = false; });
5526
5634
  }
@@ -5574,8 +5682,7 @@ function consentv2(consentState, source) {
5574
5682
  var consentData = getConsentData(consentStatus);
5575
5683
  if (!consentData.analytics_Storage && config$2.track) {
5576
5684
  config$2.track = false;
5577
- setCookie("_clsk" /* Constant.SessionKey */, "" /* Constant.Empty */, -Number.MAX_VALUE);
5578
- setCookie("_clck" /* Constant.CookieKey */, "" /* Constant.Empty */, -Number.MAX_VALUE);
5685
+ clear(true);
5579
5686
  stop();
5580
5687
  window.setTimeout(start, 250 /* Setting.RestartDelay */);
5581
5688
  return;
@@ -5601,9 +5708,14 @@ function normalizeConsent(value, fallback) {
5601
5708
  if (fallback === void 0) { fallback = "denied" /* Constant.Denied */; }
5602
5709
  return typeof value === 'string' ? value.toLowerCase() : fallback;
5603
5710
  }
5604
- function clear() {
5711
+ function clear(all) {
5712
+ if (all === void 0) { all = false; }
5605
5713
  // Clear any stored information in the cookie that tracks session information so we can restart fresh the next time
5606
- setCookie("_clsk" /* Constant.SessionKey */, "" /* Constant.Empty */, 0);
5714
+ setCookie("_clsk" /* Constant.SessionKey */, "" /* Constant.Empty */, -Number.MAX_VALUE);
5715
+ // Clear user cookie as well if all flag is set
5716
+ if (all) {
5717
+ setCookie("_clck" /* Constant.CookieKey */, "" /* Constant.Empty */, -Number.MAX_VALUE);
5718
+ }
5607
5719
  }
5608
5720
  function tab() {
5609
5721
  var id = shortid();
@@ -5625,7 +5737,7 @@ function save() {
5625
5737
  var ts = Math.round(Date.now());
5626
5738
  var upload = config$2.upload && typeof config$2.upload === "string" /* Constant.String */ ? config$2.upload.replace("https://" /* Constant.HTTPS */, "" /* Constant.Empty */) : "" /* Constant.Empty */;
5627
5739
  var upgrade = config$2.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
5628
- setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("^" /* Constant.Caret */), 1 /* Setting.SessionExpire */);
5740
+ setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join(COOKIE_SEP), 1 /* Setting.SessionExpire */);
5629
5741
  }
5630
5742
  function processCallback(upgrade, consentUpdate) {
5631
5743
  if (consentUpdate === void 0) { consentUpdate = false; }
@@ -5645,14 +5757,6 @@ function processCallback(upgrade, consentUpdate) {
5645
5757
  }
5646
5758
  }
5647
5759
  }
5648
- function supported(target, api) {
5649
- try {
5650
- return !!target[api];
5651
- }
5652
- catch (_a) {
5653
- return false;
5654
- }
5655
- }
5656
5760
  function track(u, consent) {
5657
5761
  if (consent === void 0) { consent = null; }
5658
5762
  // If consent is not explicitly specified, infer it from the user object
@@ -5665,7 +5769,7 @@ function track(u, consent) {
5665
5769
  // To avoid cookie churn, write user id cookie only once every day
5666
5770
  if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* Setting.CookieInterval */ || u.consent !== consent || u.dob !== dob) {
5667
5771
  var cookieParts = [data$2.userId, 2 /* Setting.CookieVersion */, end.toString(36), consent, dob];
5668
- setCookie("_clck" /* Constant.CookieKey */, cookieParts.join("^" /* Constant.Caret */), 365 /* Setting.Expire */);
5772
+ setCookie("_clck" /* Constant.CookieKey */, cookieParts.join(COOKIE_SEP), 365 /* Setting.Expire */);
5669
5773
  }
5670
5774
  }
5671
5775
  function shortid() {
@@ -5724,93 +5828,6 @@ function user() {
5724
5828
  }
5725
5829
  return output;
5726
5830
  }
5727
- function getCookie(key, limit) {
5728
- var _a;
5729
- if (limit === void 0) { limit = false; }
5730
- if (supported(document, "cookie" /* Constant.Cookie */)) {
5731
- var cookies = document.cookie.split(";" /* Constant.Semicolon */);
5732
- if (cookies) {
5733
- for (var i = 0; i < cookies.length; i++) {
5734
- var pair = cookies[i].split("=" /* Constant.Equals */);
5735
- if (pair.length > 1 && pair[0] && pair[0].trim() === key) {
5736
- // Some browsers automatically url encode cookie values if they are not url encoded.
5737
- // We therefore encode and decode cookie values ourselves.
5738
- // For backwards compatability we need to consider 3 cases:
5739
- // * Cookie was previously not encoded by Clarity and browser did not encode it
5740
- // * Cookie was previously not encoded by Clarity and browser encoded it once or more
5741
- // * Cookie was previously encoded by Clarity and browser did not encode it
5742
- var _b = decodeCookieValue(pair[1]), isEncoded = _b[0], decodedValue = _b[1];
5743
- while (isEncoded) {
5744
- _a = decodeCookieValue(decodedValue), isEncoded = _a[0], decodedValue = _a[1];
5745
- }
5746
- // If we are limiting cookies, check if the cookie value is limited
5747
- if (limit) {
5748
- return decodedValue.endsWith("".concat("~" /* Constant.Tilde */, "1"))
5749
- ? decodedValue.substring(0, decodedValue.length - 2)
5750
- : null;
5751
- }
5752
- return decodedValue;
5753
- }
5754
- }
5755
- }
5756
- }
5757
- return null;
5758
- }
5759
- function decodeCookieValue(value) {
5760
- try {
5761
- var decodedValue = decodeURIComponent(value);
5762
- return [decodedValue != value, decodedValue];
5763
- }
5764
- catch (_a) {
5765
- }
5766
- return [false, value];
5767
- }
5768
- function encodeCookieValue(value) {
5769
- return encodeURIComponent(value);
5770
- }
5771
- function setCookie(key, value, time) {
5772
- // only write cookies if we are currently in a cookie writing mode (and they are supported)
5773
- // OR if we are trying to write an empty cookie (i.e. clear the cookie value out)
5774
- if ((config$2.track || value == "" /* Constant.Empty */) && ((navigator && navigator.cookieEnabled) || supported(document, "cookie" /* Constant.Cookie */))) {
5775
- // Some browsers automatically url encode cookie values if they are not url encoded.
5776
- // We therefore encode and decode cookie values ourselves.
5777
- var encodedValue = encodeCookieValue(value);
5778
- var expiry = new Date();
5779
- expiry.setDate(expiry.getDate() + time);
5780
- var expires = expiry ? "expires=" /* Constant.Expires */ + expiry.toUTCString() : "" /* Constant.Empty */;
5781
- var cookie = "".concat(key, "=").concat(encodedValue).concat(";" /* Constant.Semicolon */).concat(expires).concat(";path=/" /* Constant.Path */);
5782
- try {
5783
- // Attempt to get the root domain only once and fall back to writing cookie on the current domain.
5784
- if (rootDomain === null) {
5785
- var hostname = location.hostname ? location.hostname.split("." /* Constant.Dot */) : [];
5786
- // Walk backwards on a domain and attempt to set a cookie, until successful
5787
- for (var i = hostname.length - 1; i >= 0; i--) {
5788
- rootDomain = ".".concat(hostname[i]).concat(rootDomain ? rootDomain : "" /* Constant.Empty */);
5789
- // We do not wish to attempt writing a cookie on the absolute last part of the domain, e.g. .com or .net.
5790
- // So we start attempting after second-last part, e.g. .domain.com (PASS) or .co.uk (FAIL)
5791
- if (i < hostname.length - 1) {
5792
- // Write the cookie on the current computed top level domain
5793
- document.cookie = "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain);
5794
- // Once written, check if the cookie exists and its value matches exactly with what we intended to set
5795
- // Checking for exact value match helps us eliminate a corner case where the cookie may already be present with a different value
5796
- // If the check is successful, no more action is required and we can return from the function since rootDomain cookie is already set
5797
- // If the check fails, continue with the for loop until we can successfully set and verify the cookie
5798
- if (getCookie(key) === value) {
5799
- return;
5800
- }
5801
- }
5802
- }
5803
- // Finally, if we were not successful and gone through all the options, play it safe and reset rootDomain to be empty
5804
- // This forces our code to fall back to always writing cookie to the current domain
5805
- rootDomain = "" /* Constant.Empty */;
5806
- }
5807
- }
5808
- catch (_a) {
5809
- rootDomain = "" /* Constant.Empty */;
5810
- }
5811
- document.cookie = rootDomain ? "".concat(cookie).concat(";" /* Constant.Semicolon */).concat("domain=" /* Constant.Domain */).concat(rootDomain) : cookie;
5812
- }
5813
- }
5814
5831
 
5815
5832
  var data$1 = null;
5816
5833
  function start$7() {
@@ -6010,7 +6027,7 @@ function stop$6() {
6010
6027
  var status = false;
6011
6028
  function start$5() {
6012
6029
  status = true;
6013
- start$M();
6030
+ start$N();
6014
6031
  reset$4();
6015
6032
  reset$1();
6016
6033
  reset$2();
@@ -6021,7 +6038,7 @@ function stop$5() {
6021
6038
  reset$2();
6022
6039
  reset$1();
6023
6040
  reset$4();
6024
- stop$J();
6041
+ stop$K();
6025
6042
  status = false;
6026
6043
  }
6027
6044
  function active() {
@@ -6077,12 +6094,12 @@ function restart() {
6077
6094
  }
6078
6095
 
6079
6096
  function start$4() {
6080
- start$D();
6097
+ start$E();
6098
+ start$g();
6081
6099
  start$f();
6082
- start$e();
6083
6100
  }
6084
6101
  function stop$4() {
6085
- stop$d();
6102
+ stop$e();
6086
6103
  }
6087
6104
 
6088
6105
  var diagnostic = /*#__PURE__*/Object.freeze({
@@ -6094,31 +6111,31 @@ var diagnostic = /*#__PURE__*/Object.freeze({
6094
6111
  function start$3() {
6095
6112
  // The order below is important
6096
6113
  // and is determined by interdependencies of modules
6097
- start$m();
6098
- start$j();
6114
+ start$n();
6099
6115
  start$k();
6116
+ start$l();
6100
6117
  if (config$2.delayDom) {
6101
6118
  // Lazy load layout module as part of page load time performance improvements experiment
6102
6119
  bind(window, 'load', function () {
6103
- start$l();
6120
+ start$m();
6104
6121
  });
6105
6122
  }
6106
6123
  else {
6107
- start$l();
6124
+ start$m();
6108
6125
  }
6109
- start$c();
6126
+ start$d();
6127
+ start$q();
6110
6128
  start$p();
6111
6129
  start$o();
6112
- start$n();
6113
6130
  }
6114
6131
  function stop$3() {
6115
- stop$h();
6116
6132
  stop$i();
6117
6133
  stop$j();
6118
6134
  stop$k();
6135
+ stop$l();
6136
+ stop$o();
6119
6137
  stop$n();
6120
6138
  stop$m();
6121
- stop$l();
6122
6139
  }
6123
6140
 
6124
6141
  var layout = /*#__PURE__*/Object.freeze({
@@ -6419,7 +6436,7 @@ function start(config$1) {
6419
6436
  if (check()) {
6420
6437
  config(config$1);
6421
6438
  start$5();
6422
- start$E();
6439
+ start$F();
6423
6440
  modules.forEach(function (x) { return measure(x.start)(); });
6424
6441
  // If it's an internal call to start, without explicit configuration,
6425
6442
  // re-process any newly accumulated items in the queue
@@ -6450,7 +6467,7 @@ function stop() {
6450
6467
  if (active()) {
6451
6468
  // Stop modules in the reverse order of their initialization and start queuing up items again
6452
6469
  modules.slice().reverse().forEach(function (x) { return measure(x.stop)(); });
6453
- stop$B();
6470
+ stop$C();
6454
6471
  stop$5();
6455
6472
  setup();
6456
6473
  }