clarity-js 0.8.24 → 0.8.26

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,8 +15,8 @@ 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$j; },
19
- get stop () { return stop$h; },
18
+ get start () { return start$k; },
19
+ get stop () { return stop$i; },
20
20
  get update () { return update; },
21
21
  get updates () { return updates$2; }
22
22
  });
@@ -83,13 +83,17 @@ var clarity = /*#__PURE__*/Object.freeze({
83
83
  get event () { return event; },
84
84
  get hashText () { return hashText; },
85
85
  get identify () { return identify; },
86
+ get measure () { return measure; },
86
87
  get metadata () { return metadata; },
87
88
  get pause () { return pause; },
89
+ get queue () { return queue; },
90
+ get register () { return register; },
88
91
  get resume () { return resume; },
89
92
  get set () { return set; },
90
93
  get signal () { return signal; },
91
94
  get start () { return start; },
92
95
  get stop () { return stop; },
96
+ get time () { return time; },
93
97
  get upgrade () { return upgrade; },
94
98
  get version () { return version$1; }
95
99
  });
@@ -169,7 +173,7 @@ var startTime = 0;
169
173
  function computeStartTime() {
170
174
  return performance.now() + performance.timeOrigin;
171
175
  }
172
- function start$J() {
176
+ function start$K() {
173
177
  startTime = computeStartTime();
174
178
  }
175
179
  // event.timestamp is number of milliseconds elapsed since the document was loaded
@@ -185,11 +189,11 @@ function time(event) {
185
189
  var origin = event && event.view ? event.view.performance.timeOrigin : performance.timeOrigin;
186
190
  return Math.max(Math.round(ts + origin - baseline), 0);
187
191
  }
188
- function stop$G() {
192
+ function stop$H() {
189
193
  startTime = 0;
190
194
  }
191
195
 
192
- var version$1 = "0.8.24";
196
+ var version$1 = "0.8.26";
193
197
 
194
198
  // tslint:disable: no-bitwise
195
199
  function hash (input, precision) {
@@ -410,7 +414,7 @@ function redact$1(value) {
410
414
  var state$b = null;
411
415
  var buffer = null;
412
416
  var update$2 = false;
413
- function start$I() {
417
+ function start$J() {
414
418
  update$2 = false;
415
419
  reset$s();
416
420
  }
@@ -547,7 +551,7 @@ function compute$f() {
547
551
  encode$1(4 /* Event.Baseline */);
548
552
  }
549
553
  }
550
- function stop$F() {
554
+ function stop$G() {
551
555
  reset$s();
552
556
  }
553
557
 
@@ -556,19 +560,19 @@ var baseline = /*#__PURE__*/Object.freeze({
556
560
  activity: activity,
557
561
  compute: compute$f,
558
562
  reset: reset$s,
559
- start: start$I,
563
+ start: start$J,
560
564
  get state () { return state$b; },
561
- stop: stop$F,
565
+ stop: stop$G,
562
566
  track: track$8,
563
567
  visibility: visibility
564
568
  });
565
569
 
566
570
  var data$k = null;
567
571
  var updateConsent = true;
568
- function start$H() {
572
+ function start$I() {
569
573
  updateConsent = true;
570
574
  }
571
- function stop$E() {
575
+ function stop$F() {
572
576
  updateConsent = true;
573
577
  }
574
578
  function config$1(consent) {
@@ -601,8 +605,8 @@ var consent$2 = /*#__PURE__*/Object.freeze({
601
605
  consent: consent$1,
602
606
  consentv2: consentv2$1,
603
607
  get data () { return data$k; },
604
- start: start$H,
605
- stop: stop$E
608
+ start: start$I,
609
+ stop: stop$F
606
610
  });
607
611
 
608
612
  var data$j = null;
@@ -625,12 +629,12 @@ function event(a, b) {
625
629
 
626
630
  var data$i = null;
627
631
  var updates$3 = null;
628
- function start$G() {
632
+ function start$H() {
629
633
  data$i = {};
630
634
  updates$3 = {};
631
635
  count$1(5 /* Metric.InvokeCount */);
632
636
  }
633
- function stop$D() {
637
+ function stop$E() {
634
638
  data$i = {};
635
639
  updates$3 = {};
636
640
  }
@@ -686,7 +690,7 @@ var data$h;
686
690
  var last = 0;
687
691
  var interval = 0;
688
692
  var timeout$7 = null;
689
- function start$F() {
693
+ function start$G() {
690
694
  interval = 60000 /* Setting.PingInterval */;
691
695
  last = 0;
692
696
  }
@@ -708,7 +712,7 @@ function ping() {
708
712
  suspend();
709
713
  }
710
714
  }
711
- function stop$C() {
715
+ function stop$D() {
712
716
  clearTimeout$1(timeout$7);
713
717
  last = 0;
714
718
  interval = 0;
@@ -718,15 +722,15 @@ var ping$1 = /*#__PURE__*/Object.freeze({
718
722
  __proto__: null,
719
723
  get data () { return data$h; },
720
724
  reset: reset$q,
721
- start: start$F,
722
- stop: stop$C
725
+ start: start$G,
726
+ stop: stop$D
723
727
  });
724
728
 
725
729
  var data$g = null;
726
- function start$E() {
730
+ function start$F() {
727
731
  data$g = {};
728
732
  }
729
- function stop$B() {
733
+ function stop$C() {
730
734
  data$g = {};
731
735
  }
732
736
  function track$7(event, time) {
@@ -758,8 +762,8 @@ var summary = /*#__PURE__*/Object.freeze({
758
762
  compute: compute$c,
759
763
  get data () { return data$g; },
760
764
  reset: reset$p,
761
- start: start$E,
762
- stop: stop$B,
765
+ start: start$F,
766
+ stop: stop$C,
763
767
  track: track$7
764
768
  });
765
769
 
@@ -877,7 +881,7 @@ function read(stream) {
877
881
  }
878
882
 
879
883
  var data$f = null;
880
- function start$D() {
884
+ function start$E() {
881
885
  reset$o();
882
886
  }
883
887
  function set(variable, value) {
@@ -939,7 +943,7 @@ function compute$b() {
939
943
  function reset$o() {
940
944
  data$f = {};
941
945
  }
942
- function stop$A() {
946
+ function stop$B() {
943
947
  reset$o();
944
948
  }
945
949
  function redact(input) {
@@ -979,8 +983,8 @@ var variable = /*#__PURE__*/Object.freeze({
979
983
  identify: identify,
980
984
  reset: reset$o,
981
985
  set: set,
982
- start: start$D,
983
- stop: stop$A
986
+ start: start$E,
987
+ stop: stop$B
984
988
  });
985
989
 
986
990
  var data$e = {};
@@ -989,7 +993,7 @@ var variables = {};
989
993
  var selectors = {};
990
994
  var hashes = {};
991
995
  var validation = {};
992
- function start$C() {
996
+ function start$D() {
993
997
  reset$n();
994
998
  }
995
999
  // Input string is of the following form:
@@ -1105,7 +1109,7 @@ function update$1(key, subkey, value) {
1105
1109
  }
1106
1110
  return;
1107
1111
  }
1108
- function stop$z() {
1112
+ function stop$A() {
1109
1113
  reset$n();
1110
1114
  }
1111
1115
  function parse$1(variable) {
@@ -1178,8 +1182,8 @@ var extract = /*#__PURE__*/Object.freeze({
1178
1182
  data: data$e,
1179
1183
  keys: keys,
1180
1184
  reset: reset$n,
1181
- start: start$C,
1182
- stop: stop$z,
1185
+ start: start$D,
1186
+ stop: stop$A,
1183
1187
  trigger: trigger$2,
1184
1188
  update: update$1
1185
1189
  });
@@ -1213,18 +1217,18 @@ function signalsEvent(signalsPayload) {
1213
1217
  }
1214
1218
 
1215
1219
  var modules$1 = [baseline, dimension, variable, limit, summary, consent$2, metadata$1, envelope$1, upload$1, ping$1, upgrade$1, extract];
1216
- function start$B() {
1220
+ function start$C() {
1217
1221
  // Metric needs to be initialized before we can start measuring. so metric is not wrapped in measure
1218
- start$G();
1222
+ start$H();
1219
1223
  modules$1.forEach(function (x) { return measure(x.start)(); });
1220
1224
  }
1221
- function stop$y() {
1225
+ function stop$z() {
1222
1226
  // Stop modules in the reverse order of their initialization
1223
1227
  // The ordering below should respect inter-module dependency.
1224
1228
  // E.g. if upgrade depends on upload, then upgrade needs to end before upload.
1225
1229
  // Similarly, if upload depends on metadata, upload needs to end before metadata.
1226
1230
  modules$1.slice().reverse().forEach(function (x) { return measure(x.stop)(); });
1227
- stop$D();
1231
+ stop$E();
1228
1232
  }
1229
1233
  function compute$9() {
1230
1234
  compute$b();
@@ -1239,7 +1243,7 @@ function compute$9() {
1239
1243
 
1240
1244
  var history$5 = [];
1241
1245
  var data$d;
1242
- function start$A() {
1246
+ function start$B() {
1243
1247
  history$5 = [];
1244
1248
  max(26 /* Metric.Automation */, navigator.webdriver ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
1245
1249
  try {
@@ -1263,7 +1267,7 @@ function check$4(id, target, input) {
1263
1267
  }
1264
1268
 
1265
1269
  var state$a = [];
1266
- function start$z() {
1270
+ function start$A() {
1267
1271
  reset$m();
1268
1272
  }
1269
1273
  function observe$c(root) {
@@ -1281,7 +1285,7 @@ function recompute$8(evt) {
1281
1285
  function reset$m() {
1282
1286
  state$a = [];
1283
1287
  }
1284
- function stop$x() {
1288
+ function stop$y() {
1285
1289
  reset$m();
1286
1290
  }
1287
1291
 
@@ -1303,7 +1307,7 @@ function offset(element) {
1303
1307
 
1304
1308
  var UserInputTags = ["input", "textarea", "radio", "button", "canvas", "select"];
1305
1309
  var state$9 = [];
1306
- function start$y() {
1310
+ function start$z() {
1307
1311
  reset$l();
1308
1312
  }
1309
1313
  function observe$b(root) {
@@ -1433,12 +1437,12 @@ function context(a) {
1433
1437
  function reset$l() {
1434
1438
  state$9 = [];
1435
1439
  }
1436
- function stop$w() {
1440
+ function stop$x() {
1437
1441
  reset$l();
1438
1442
  }
1439
1443
 
1440
1444
  var state$8 = [];
1441
- function start$x() {
1445
+ function start$y() {
1442
1446
  reset$k();
1443
1447
  }
1444
1448
  function observe$a(root) {
@@ -1453,13 +1457,13 @@ function recompute$7(action, evt) {
1453
1457
  function reset$k() {
1454
1458
  state$8 = [];
1455
1459
  }
1456
- function stop$v() {
1460
+ function stop$w() {
1457
1461
  reset$k();
1458
1462
  }
1459
1463
 
1460
1464
  var timeout$6 = null;
1461
1465
  var state$7 = [];
1462
- function start$w() {
1466
+ function start$x() {
1463
1467
  reset$j();
1464
1468
  }
1465
1469
  function observe$9(root) {
@@ -1493,7 +1497,7 @@ function process$7(event) {
1493
1497
  function reset$j() {
1494
1498
  state$7 = [];
1495
1499
  }
1496
- function stop$u() {
1500
+ function stop$v() {
1497
1501
  clearTimeout$1(timeout$6);
1498
1502
  reset$j();
1499
1503
  }
@@ -1503,7 +1507,7 @@ var timeout$5 = null;
1503
1507
  var hasPrimaryTouch = false;
1504
1508
  var primaryTouchId = 0;
1505
1509
  var activeTouchPointIds = new Set();
1506
- function start$v() {
1510
+ function start$w() {
1507
1511
  reset$i();
1508
1512
  }
1509
1513
  function observe$8(root) {
@@ -1611,7 +1615,7 @@ function similar$1(last, current) {
1611
1615
  var sameId = current.data.id !== undefined ? current.data.id === last.data.id : true;
1612
1616
  return current.event === last.event && match && distance < 20 /* Setting.Distance */ && gap < 25 /* Setting.PointerInterval */ && sameId;
1613
1617
  }
1614
- function stop$t() {
1618
+ function stop$u() {
1615
1619
  clearTimeout$1(timeout$5);
1616
1620
  // Send out any pending pointer events in the pipeline
1617
1621
  if (state$6.length > 0) {
@@ -1671,7 +1675,7 @@ var data$c;
1671
1675
  var timeout$4 = null;
1672
1676
  var initialStateLogged = false;
1673
1677
  var throttledRecompute$1 = throttle(recompute$5, 500 /* Setting.LookAhead */);
1674
- function start$u() {
1678
+ function start$v() {
1675
1679
  initialStateLogged = false;
1676
1680
  bind(window, "resize", throttledRecompute$1);
1677
1681
  recompute$5();
@@ -1701,7 +1705,7 @@ function reset$h() {
1701
1705
  clearTimeout$1(timeout$4);
1702
1706
  throttledRecompute$1.cleanup();
1703
1707
  }
1704
- function stop$s() {
1708
+ function stop$t() {
1705
1709
  reset$h();
1706
1710
  }
1707
1711
 
@@ -1709,7 +1713,7 @@ var state$5 = [];
1709
1713
  var initialTop = null;
1710
1714
  var initialBottom = null;
1711
1715
  var timeout$3 = null;
1712
- function start$t() {
1716
+ function start$u() {
1713
1717
  state$5 = [];
1714
1718
  recompute$4();
1715
1719
  }
@@ -1805,7 +1809,7 @@ function compute$8() {
1805
1809
  log(32 /* Dimension.InitialScrollBottom */, (_b = bottom === null || bottom === void 0 ? void 0 : bottom.hash) === null || _b === void 0 ? void 0 : _b.join("." /* Constant.Dot */));
1806
1810
  }
1807
1811
  }
1808
- function stop$r() {
1812
+ function stop$s() {
1809
1813
  clearTimeout$1(timeout$3);
1810
1814
  throttledRecompute.cleanup();
1811
1815
  state$5 = [];
@@ -1816,7 +1820,7 @@ function stop$r() {
1816
1820
  var data$b = null;
1817
1821
  var previous = null;
1818
1822
  var timeout$2 = null;
1819
- function start$s() {
1823
+ function start$t() {
1820
1824
  reset$f();
1821
1825
  }
1822
1826
  function observe$6(root) {
@@ -1860,13 +1864,13 @@ function reset$f() {
1860
1864
  previous = null;
1861
1865
  data$b = { start: 0, startOffset: 0, end: 0, endOffset: 0 };
1862
1866
  }
1863
- function stop$q() {
1867
+ function stop$r() {
1864
1868
  reset$f();
1865
1869
  clearTimeout$1(timeout$2);
1866
1870
  }
1867
1871
 
1868
1872
  var state$4 = [];
1869
- function start$r() {
1873
+ function start$s() {
1870
1874
  reset$e();
1871
1875
  }
1872
1876
  function observe$5(root) {
@@ -1879,12 +1883,12 @@ function recompute$2(evt) {
1879
1883
  function reset$e() {
1880
1884
  state$4 = [];
1881
1885
  }
1882
- function stop$p() {
1886
+ function stop$q() {
1883
1887
  reset$e();
1884
1888
  }
1885
1889
 
1886
1890
  var data$a;
1887
- function start$q() {
1891
+ function start$r() {
1888
1892
  bind(window, "pagehide", recompute$1);
1889
1893
  }
1890
1894
  function recompute$1(evt) {
@@ -1895,12 +1899,12 @@ function recompute$1(evt) {
1895
1899
  function reset$d() {
1896
1900
  data$a = null;
1897
1901
  }
1898
- function stop$o() {
1902
+ function stop$p() {
1899
1903
  reset$d();
1900
1904
  }
1901
1905
 
1902
1906
  var data$9;
1903
- function start$p() {
1907
+ function start$q() {
1904
1908
  bind(document, "visibilitychange", recompute);
1905
1909
  recompute();
1906
1910
  }
@@ -1912,37 +1916,37 @@ function recompute(evt) {
1912
1916
  function reset$c() {
1913
1917
  data$9 = null;
1914
1918
  }
1915
- function stop$n() {
1919
+ function stop$o() {
1916
1920
  reset$c();
1917
1921
  }
1918
1922
 
1919
- function start$o() {
1920
- start$h();
1923
+ function start$p() {
1924
+ start$i();
1925
+ start$z();
1921
1926
  start$y();
1927
+ start$w();
1922
1928
  start$x();
1923
1929
  start$v();
1924
- start$w();
1930
+ start$q();
1925
1931
  start$u();
1926
- start$p();
1927
1932
  start$t();
1933
+ start$A();
1928
1934
  start$s();
1929
- start$z();
1930
1935
  start$r();
1931
- start$q();
1932
1936
  }
1933
- function stop$m() {
1934
- stop$f();
1937
+ function stop$n() {
1938
+ stop$g();
1939
+ stop$x();
1935
1940
  stop$w();
1941
+ stop$u();
1936
1942
  stop$v();
1937
1943
  stop$t();
1938
- stop$u();
1944
+ stop$o();
1939
1945
  stop$s();
1940
- stop$n();
1941
1946
  stop$r();
1947
+ stop$y();
1942
1948
  stop$q();
1943
- stop$x();
1944
1949
  stop$p();
1945
- stop$o();
1946
1950
  }
1947
1951
  function observe$4(root) {
1948
1952
  observe$7(root);
@@ -1962,8 +1966,8 @@ function observe$4(root) {
1962
1966
  var interaction = /*#__PURE__*/Object.freeze({
1963
1967
  __proto__: null,
1964
1968
  observe: observe$4,
1965
- start: start$o,
1966
- stop: stop$m
1969
+ start: start$p,
1970
+ stop: stop$n
1967
1971
  });
1968
1972
 
1969
1973
  // Following code takes an array of tokens and transforms it to optimize for repeating tokens and make it efficient to send over the wire
@@ -2052,7 +2056,7 @@ function proxyStyleRules$1(win) {
2052
2056
  }
2053
2057
  }
2054
2058
  }
2055
- function start$n() {
2059
+ function start$o() {
2056
2060
  proxyStyleRules$1(window);
2057
2061
  }
2058
2062
  function checkDocumentStyles(documentNode, timestamp) {
@@ -2108,7 +2112,7 @@ function reset$b() {
2108
2112
  sheetAdoptionState = [];
2109
2113
  sheetUpdateState = [];
2110
2114
  }
2111
- function stop$l() {
2115
+ function stop$m() {
2112
2116
  styleSheetMap = {};
2113
2117
  styleTimeMap = {};
2114
2118
  documentNodes = [];
@@ -2156,7 +2160,7 @@ var animationFinish = null;
2156
2160
  var animationId = 'clarityAnimationId';
2157
2161
  var operationCount = 'clarityOperationCount';
2158
2162
  var maxOperations = 20;
2159
- function start$m() {
2163
+ function start$n() {
2160
2164
  if (window["Animation"] &&
2161
2165
  window["Animation"].prototype &&
2162
2166
  window["KeyframeEffect"] &&
@@ -2211,7 +2215,7 @@ function track$6(time, id, operation, keyFrames, timing, targetId, timeline) {
2211
2215
  });
2212
2216
  encode$5(44 /* Event.Animation */);
2213
2217
  }
2214
- function stop$k() {
2218
+ function stop$l() {
2215
2219
  reset$a();
2216
2220
  }
2217
2221
  function overrideAnimationHelper(functionToOverride, name) {
@@ -2438,7 +2442,7 @@ var data$8;
2438
2442
  function reset$9() {
2439
2443
  data$8 = null;
2440
2444
  }
2441
- function start$l() {
2445
+ function start$m() {
2442
2446
  reset$9();
2443
2447
  compute$6();
2444
2448
  }
@@ -2465,7 +2469,7 @@ function compute$6() {
2465
2469
  encode$5(8 /* Event.Document */);
2466
2470
  }
2467
2471
  }
2468
- function stop$j() {
2472
+ function stop$k() {
2469
2473
  reset$9();
2470
2474
  }
2471
2475
 
@@ -2517,7 +2521,7 @@ var history$4 = {};
2517
2521
  var observedNodes = new WeakMap();
2518
2522
  // We ignore mutations if these attributes are updated
2519
2523
  var IGNORED_ATTRIBUTES = ["data-google-query-id", "data-load-complete", "data-google-container-id"];
2520
- function start$k() {
2524
+ function start$l() {
2521
2525
  observers = new Set();
2522
2526
  queue$2 = [];
2523
2527
  timeout$1 = null;
@@ -2555,7 +2559,7 @@ function monitor(frame) {
2555
2559
  bind(frame, "load" /* Constant.LoadEvent */, generate.bind(this, frame, "childList" /* Constant.ChildList */), true);
2556
2560
  }
2557
2561
  }
2558
- function stop$i() {
2562
+ function stop$j() {
2559
2563
  for (var _i = 0, _a = Array.from(observers); _i < _a.length; _i++) {
2560
2564
  var observer = _a[_i];
2561
2565
  if (observer) {
@@ -2571,7 +2575,7 @@ function stop$i() {
2571
2575
  timeout$1 = null;
2572
2576
  observedNodes = new WeakMap();
2573
2577
  }
2574
- function active$2() {
2578
+ function active$3() {
2575
2579
  activePeriod = time() + 3000 /* Setting.MutationActivePeriod */;
2576
2580
  }
2577
2581
  function disconnect(n) {
@@ -3367,11 +3371,11 @@ var iframeMap = null; // Maps iframe's contentDocument => parent iframe element
3367
3371
  var iframeContentMap = null; // Maps parent iframe element => iframe's contentDocument & contentWindow
3368
3372
  var privacyMap = null; // Maps node => Privacy (enum)
3369
3373
  var fraudMap = null; // Maps node => FraudId (number)
3370
- function start$j() {
3374
+ function start$k() {
3371
3375
  reset$7();
3372
3376
  parse(document, true);
3373
3377
  }
3374
- function stop$h() {
3378
+ function stop$i() {
3375
3379
  reset$7();
3376
3380
  }
3377
3381
  function reset$7() {
@@ -3766,7 +3770,7 @@ var regions = {};
3766
3770
  var queue$1 = [];
3767
3771
  var watch = false;
3768
3772
  var observer$1 = null;
3769
- function start$i() {
3773
+ function start$j() {
3770
3774
  reset$6();
3771
3775
  observer$1 = null;
3772
3776
  regionMap = new WeakMap();
@@ -3894,7 +3898,7 @@ function clone(r) {
3894
3898
  function reset$6() {
3895
3899
  state$2 = [];
3896
3900
  }
3897
- function stop$g() {
3901
+ function stop$h() {
3898
3902
  reset$6();
3899
3903
  regionMap = null;
3900
3904
  regions = {};
@@ -3909,7 +3913,7 @@ function stop$g() {
3909
3913
  function target(evt) {
3910
3914
  var path = evt.composed && evt.composedPath ? evt.composedPath() : null;
3911
3915
  var node = (path && path.length > 0 ? path[0] : evt.target);
3912
- active$2(); // Mark active periods of time so mutations can continue uninterrupted
3916
+ active$3(); // Mark active periods of time so mutations can continue uninterrupted
3913
3917
  return node && node.nodeType === Node.DOCUMENT_NODE ? node.documentElement : node;
3914
3918
  }
3915
3919
  function metadata$2(node, event, text) {
@@ -4129,7 +4133,7 @@ function encode$4 (type, ts) {
4129
4133
 
4130
4134
  var state$1 = [];
4131
4135
  var updates$1 = [];
4132
- function start$h() {
4136
+ function start$i() {
4133
4137
  state$1 = [];
4134
4138
  reset$5();
4135
4139
  }
@@ -4176,7 +4180,7 @@ function compute$4() {
4176
4180
  state$1 = temp; // Drop events less than the min time
4177
4181
  encode$4(22 /* Event.Timeline */);
4178
4182
  }
4179
- function stop$f() {
4183
+ function stop$g() {
4180
4184
  state$1 = [];
4181
4185
  reset$5();
4182
4186
  }
@@ -4314,6 +4318,53 @@ function add(node, parent, data) {
4314
4318
  }
4315
4319
  }
4316
4320
 
4321
+ var stopCallbacks = [];
4322
+ var active$2 = false;
4323
+ function start$h() {
4324
+ active$2 = true;
4325
+ }
4326
+ function stop$f() {
4327
+ stopCallbacks.reverse().forEach(function (callback) {
4328
+ try {
4329
+ callback();
4330
+ }
4331
+ catch (error) {
4332
+ // Do nothing
4333
+ }
4334
+ });
4335
+ stopCallbacks = [];
4336
+ active$2 = false;
4337
+ }
4338
+ function register(stopCallback) {
4339
+ if (active$2 && typeof stopCallback === "function") {
4340
+ stopCallbacks.push(stopCallback);
4341
+ }
4342
+ }
4343
+ function dynamicEvent(url) {
4344
+ load(url);
4345
+ }
4346
+ function load(url) {
4347
+ if (!active$2)
4348
+ return;
4349
+ try {
4350
+ var script = document.createElement("script");
4351
+ script.src = url;
4352
+ script.async = true;
4353
+ document.head.appendChild(script);
4354
+ }
4355
+ catch (error) {
4356
+ // Do nothing
4357
+ }
4358
+ }
4359
+
4360
+ var dynamic = /*#__PURE__*/Object.freeze({
4361
+ __proto__: null,
4362
+ dynamicEvent: dynamicEvent,
4363
+ register: register,
4364
+ start: start$h,
4365
+ stop: stop$f
4366
+ });
4367
+
4317
4368
  var discoverBytes = 0;
4318
4369
  var playbackBytes = 0;
4319
4370
  var playback;
@@ -4434,6 +4485,10 @@ function upload(final) {
4434
4485
  e = JSON.stringify(envelope(last));
4435
4486
  a = "[".concat(analysis.join(), "]");
4436
4487
  p = sendPlaybackBytes ? "[".concat(playback.join(), "]") : "" /* Constant.Empty */;
4488
+ // For final (beacon) payloads, If size is too large, we need to remove playback data
4489
+ if (last && p.length > 0 && (e.length + a.length + p.length > 65536 /* Setting.MaxBeaconPayloadBytes */)) {
4490
+ p = "" /* Constant.Empty */;
4491
+ }
4437
4492
  encoded = { e: e, a: a, p: p };
4438
4493
  payload = stringify(encoded);
4439
4494
  if (!last) return [3 /*break*/, 1];
@@ -4621,6 +4676,11 @@ function response(payload) {
4621
4676
  signalsEvent(parts[1]);
4622
4677
  }
4623
4678
  break;
4679
+ case "MODULE" /* Constant.Module */:
4680
+ if (parts.length > 1) {
4681
+ dynamicEvent(parts[1]);
4682
+ }
4683
+ break;
4624
4684
  case "SNAPSHOT" /* Constant.Snapshot */:
4625
4685
  config$2.lean = false; // Disable lean mode to ensure we can send playback information to server.
4626
4686
  snapshot();
@@ -4980,7 +5040,7 @@ function upgrade(key) {
4980
5040
  encode$1(3 /* Event.Upgrade */);
4981
5041
  if (config$2.lite) {
4982
5042
  start$c();
4983
- start$n();
5043
+ start$o();
4984
5044
  }
4985
5045
  }
4986
5046
  }
@@ -5402,7 +5462,7 @@ function save() {
5402
5462
  var ts = Math.round(Date.now());
5403
5463
  var upload = config$2.upload && typeof config$2.upload === "string" /* Constant.String */ ? config$2.upload.replace("https://" /* Constant.HTTPS */, "" /* Constant.Empty */) : "" /* Constant.Empty */;
5404
5464
  var upgrade = config$2.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
5405
- setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Constant.Pipe */), 1 /* Setting.SessionExpire */);
5465
+ setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("^" /* Constant.Caret */), 1 /* Setting.SessionExpire */);
5406
5466
  }
5407
5467
  function processCallback(upgrade, consentUpdate) {
5408
5468
  if (consentUpdate === void 0) { consentUpdate = false; }
@@ -5442,7 +5502,7 @@ function track(u, consent) {
5442
5502
  // To avoid cookie churn, write user id cookie only once every day
5443
5503
  if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* Setting.CookieInterval */ || u.consent !== consent || u.dob !== dob) {
5444
5504
  var cookieParts = [data$2.userId, 2 /* Setting.CookieVersion */, end.toString(36), consent, dob];
5445
- setCookie("_clck" /* Constant.CookieKey */, cookieParts.join("|" /* Constant.Pipe */), 365 /* Setting.Expire */);
5505
+ setCookie("_clck" /* Constant.CookieKey */, cookieParts.join("^" /* Constant.Caret */), 365 /* Setting.Expire */);
5446
5506
  }
5447
5507
  }
5448
5508
  function shortid() {
@@ -5676,6 +5736,7 @@ function measure (method) {
5676
5736
  if (duration > 30 /* Setting.LongTask */) {
5677
5737
  count$1(7 /* Metric.LongTaskCount */);
5678
5738
  max(6 /* Metric.ThreadBlockedTime */, duration);
5739
+ log$1(9 /* Code.FunctionExecutionTime */, 0 /* Severity.Info */, "".concat(method.dn || method.name, "-").concat(duration));
5679
5740
  }
5680
5741
  };
5681
5742
  }
@@ -5786,7 +5847,7 @@ function stop$6() {
5786
5847
  var status = false;
5787
5848
  function start$5() {
5788
5849
  status = true;
5789
- start$J();
5850
+ start$K();
5790
5851
  reset$4();
5791
5852
  reset$1();
5792
5853
  reset$2();
@@ -5797,7 +5858,7 @@ function stop$5() {
5797
5858
  reset$2();
5798
5859
  reset$1();
5799
5860
  reset$4();
5800
- stop$G();
5861
+ stop$H();
5801
5862
  status = false;
5802
5863
  }
5803
5864
  function active() {
@@ -5853,7 +5914,7 @@ function restart() {
5853
5914
  }
5854
5915
 
5855
5916
  function start$4() {
5856
- start$A();
5917
+ start$B();
5857
5918
  start$f();
5858
5919
  start$e();
5859
5920
  }
@@ -5870,29 +5931,29 @@ var diagnostic = /*#__PURE__*/Object.freeze({
5870
5931
  function start$3() {
5871
5932
  // The order below is important
5872
5933
  // and is determined by interdependencies of modules
5873
- start$l();
5874
- start$i();
5934
+ start$m();
5875
5935
  start$j();
5936
+ start$k();
5876
5937
  if (config$2.delayDom) {
5877
5938
  // Lazy load layout module as part of page load time performance improvements experiment
5878
5939
  bind(window, 'load', function () {
5879
- start$k();
5940
+ start$l();
5880
5941
  });
5881
5942
  }
5882
5943
  else {
5883
- start$k();
5944
+ start$l();
5884
5945
  }
5885
5946
  start$c();
5947
+ start$o();
5886
5948
  start$n();
5887
- start$m();
5888
5949
  }
5889
5950
  function stop$3() {
5890
- stop$g();
5891
5951
  stop$h();
5892
5952
  stop$i();
5893
5953
  stop$j();
5894
- stop$l();
5895
5954
  stop$k();
5955
+ stop$m();
5956
+ stop$l();
5896
5957
  }
5897
5958
 
5898
5959
  var layout = /*#__PURE__*/Object.freeze({
@@ -6186,14 +6247,14 @@ var performance$1 = /*#__PURE__*/Object.freeze({
6186
6247
  stop: stop$1
6187
6248
  });
6188
6249
 
6189
- var modules = [diagnostic, layout, interaction, performance$1];
6250
+ var modules = [diagnostic, layout, interaction, performance$1, dynamic];
6190
6251
  function start(config$1) {
6191
6252
  if (config$1 === void 0) { config$1 = null; }
6192
6253
  // Check that browser supports required APIs and we do not attempt to start Clarity multiple times
6193
6254
  if (check()) {
6194
6255
  config(config$1);
6195
6256
  start$5();
6196
- start$B();
6257
+ start$C();
6197
6258
  modules.forEach(function (x) { return measure(x.start)(); });
6198
6259
  // If it's an internal call to start, without explicit configuration,
6199
6260
  // re-process any newly accumulated items in the queue
@@ -6224,7 +6285,7 @@ function stop() {
6224
6285
  if (active()) {
6225
6286
  // Stop modules in the reverse order of their initialization and start queuing up items again
6226
6287
  modules.slice().reverse().forEach(function (x) { return measure(x.stop)(); });
6227
- stop$y();
6288
+ stop$z();
6228
6289
  stop$5();
6229
6290
  setup();
6230
6291
  }