clarity-js 0.8.43 → 0.8.45

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