clarity-js 0.8.24 → 0.8.25

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,8 +13,8 @@ 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$j; },
17
- get stop () { return stop$h; },
16
+ get start () { return start$k; },
17
+ get stop () { return stop$i; },
18
18
  get update () { return update; },
19
19
  get updates () { return updates$2; }
20
20
  });
@@ -83,11 +83,14 @@ var clarity = /*#__PURE__*/Object.freeze({
83
83
  get identify () { return identify; },
84
84
  get metadata () { return metadata; },
85
85
  get pause () { return pause; },
86
+ get queue () { return queue; },
87
+ get register () { return register; },
86
88
  get resume () { return resume; },
87
89
  get set () { return set; },
88
90
  get signal () { return signal; },
89
91
  get start () { return start; },
90
92
  get stop () { return stop; },
93
+ get time () { return time; },
91
94
  get upgrade () { return upgrade; },
92
95
  get version () { return version$1; }
93
96
  });
@@ -167,7 +170,7 @@ var startTime = 0;
167
170
  function computeStartTime() {
168
171
  return performance.now() + performance.timeOrigin;
169
172
  }
170
- function start$J() {
173
+ function start$K() {
171
174
  startTime = computeStartTime();
172
175
  }
173
176
  // event.timestamp is number of milliseconds elapsed since the document was loaded
@@ -183,11 +186,11 @@ function time(event) {
183
186
  var origin = event && event.view ? event.view.performance.timeOrigin : performance.timeOrigin;
184
187
  return Math.max(Math.round(ts + origin - baseline), 0);
185
188
  }
186
- function stop$G() {
189
+ function stop$H() {
187
190
  startTime = 0;
188
191
  }
189
192
 
190
- var version$1 = "0.8.24";
193
+ var version$1 = "0.8.25";
191
194
 
192
195
  // tslint:disable: no-bitwise
193
196
  function hash (input, precision) {
@@ -408,7 +411,7 @@ function redact$1(value) {
408
411
  var state$b = null;
409
412
  var buffer = null;
410
413
  var update$2 = false;
411
- function start$I() {
414
+ function start$J() {
412
415
  update$2 = false;
413
416
  reset$s();
414
417
  }
@@ -545,7 +548,7 @@ function compute$f() {
545
548
  encode$1(4 /* Event.Baseline */);
546
549
  }
547
550
  }
548
- function stop$F() {
551
+ function stop$G() {
549
552
  reset$s();
550
553
  }
551
554
 
@@ -554,19 +557,19 @@ var baseline = /*#__PURE__*/Object.freeze({
554
557
  activity: activity,
555
558
  compute: compute$f,
556
559
  reset: reset$s,
557
- start: start$I,
560
+ start: start$J,
558
561
  get state () { return state$b; },
559
- stop: stop$F,
562
+ stop: stop$G,
560
563
  track: track$8,
561
564
  visibility: visibility
562
565
  });
563
566
 
564
567
  var data$k = null;
565
568
  var updateConsent = true;
566
- function start$H() {
569
+ function start$I() {
567
570
  updateConsent = true;
568
571
  }
569
- function stop$E() {
572
+ function stop$F() {
570
573
  updateConsent = true;
571
574
  }
572
575
  function config$1(consent) {
@@ -599,8 +602,8 @@ var consent$2 = /*#__PURE__*/Object.freeze({
599
602
  consent: consent$1,
600
603
  consentv2: consentv2$1,
601
604
  get data () { return data$k; },
602
- start: start$H,
603
- stop: stop$E
605
+ start: start$I,
606
+ stop: stop$F
604
607
  });
605
608
 
606
609
  var data$j = null;
@@ -623,12 +626,12 @@ function event(a, b) {
623
626
 
624
627
  var data$i = null;
625
628
  var updates$3 = null;
626
- function start$G() {
629
+ function start$H() {
627
630
  data$i = {};
628
631
  updates$3 = {};
629
632
  count$1(5 /* Metric.InvokeCount */);
630
633
  }
631
- function stop$D() {
634
+ function stop$E() {
632
635
  data$i = {};
633
636
  updates$3 = {};
634
637
  }
@@ -684,7 +687,7 @@ var data$h;
684
687
  var last = 0;
685
688
  var interval = 0;
686
689
  var timeout$7 = null;
687
- function start$F() {
690
+ function start$G() {
688
691
  interval = 60000 /* Setting.PingInterval */;
689
692
  last = 0;
690
693
  }
@@ -706,7 +709,7 @@ function ping() {
706
709
  suspend();
707
710
  }
708
711
  }
709
- function stop$C() {
712
+ function stop$D() {
710
713
  clearTimeout$1(timeout$7);
711
714
  last = 0;
712
715
  interval = 0;
@@ -716,15 +719,15 @@ var ping$1 = /*#__PURE__*/Object.freeze({
716
719
  __proto__: null,
717
720
  get data () { return data$h; },
718
721
  reset: reset$q,
719
- start: start$F,
720
- stop: stop$C
722
+ start: start$G,
723
+ stop: stop$D
721
724
  });
722
725
 
723
726
  var data$g = null;
724
- function start$E() {
727
+ function start$F() {
725
728
  data$g = {};
726
729
  }
727
- function stop$B() {
730
+ function stop$C() {
728
731
  data$g = {};
729
732
  }
730
733
  function track$7(event, time) {
@@ -756,8 +759,8 @@ var summary = /*#__PURE__*/Object.freeze({
756
759
  compute: compute$c,
757
760
  get data () { return data$g; },
758
761
  reset: reset$p,
759
- start: start$E,
760
- stop: stop$B,
762
+ start: start$F,
763
+ stop: stop$C,
761
764
  track: track$7
762
765
  });
763
766
 
@@ -875,7 +878,7 @@ function read(stream) {
875
878
  }
876
879
 
877
880
  var data$f = null;
878
- function start$D() {
881
+ function start$E() {
879
882
  reset$o();
880
883
  }
881
884
  function set(variable, value) {
@@ -937,7 +940,7 @@ function compute$b() {
937
940
  function reset$o() {
938
941
  data$f = {};
939
942
  }
940
- function stop$A() {
943
+ function stop$B() {
941
944
  reset$o();
942
945
  }
943
946
  function redact(input) {
@@ -977,8 +980,8 @@ var variable = /*#__PURE__*/Object.freeze({
977
980
  identify: identify,
978
981
  reset: reset$o,
979
982
  set: set,
980
- start: start$D,
981
- stop: stop$A
983
+ start: start$E,
984
+ stop: stop$B
982
985
  });
983
986
 
984
987
  var data$e = {};
@@ -987,7 +990,7 @@ var variables = {};
987
990
  var selectors = {};
988
991
  var hashes = {};
989
992
  var validation = {};
990
- function start$C() {
993
+ function start$D() {
991
994
  reset$n();
992
995
  }
993
996
  // Input string is of the following form:
@@ -1103,7 +1106,7 @@ function update$1(key, subkey, value) {
1103
1106
  }
1104
1107
  return;
1105
1108
  }
1106
- function stop$z() {
1109
+ function stop$A() {
1107
1110
  reset$n();
1108
1111
  }
1109
1112
  function parse$1(variable) {
@@ -1176,8 +1179,8 @@ var extract = /*#__PURE__*/Object.freeze({
1176
1179
  data: data$e,
1177
1180
  keys: keys,
1178
1181
  reset: reset$n,
1179
- start: start$C,
1180
- stop: stop$z,
1182
+ start: start$D,
1183
+ stop: stop$A,
1181
1184
  trigger: trigger$2,
1182
1185
  update: update$1
1183
1186
  });
@@ -1211,18 +1214,18 @@ function signalsEvent(signalsPayload) {
1211
1214
  }
1212
1215
 
1213
1216
  var modules$1 = [baseline, dimension, variable, limit, summary, consent$2, metadata$1, envelope$1, upload$1, ping$1, upgrade$1, extract];
1214
- function start$B() {
1217
+ function start$C() {
1215
1218
  // Metric needs to be initialized before we can start measuring. so metric is not wrapped in measure
1216
- start$G();
1219
+ start$H();
1217
1220
  modules$1.forEach(function (x) { return measure(x.start)(); });
1218
1221
  }
1219
- function stop$y() {
1222
+ function stop$z() {
1220
1223
  // Stop modules in the reverse order of their initialization
1221
1224
  // The ordering below should respect inter-module dependency.
1222
1225
  // E.g. if upgrade depends on upload, then upgrade needs to end before upload.
1223
1226
  // Similarly, if upload depends on metadata, upload needs to end before metadata.
1224
1227
  modules$1.slice().reverse().forEach(function (x) { return measure(x.stop)(); });
1225
- stop$D();
1228
+ stop$E();
1226
1229
  }
1227
1230
  function compute$9() {
1228
1231
  compute$b();
@@ -1237,7 +1240,7 @@ function compute$9() {
1237
1240
 
1238
1241
  var history$5 = [];
1239
1242
  var data$d;
1240
- function start$A() {
1243
+ function start$B() {
1241
1244
  history$5 = [];
1242
1245
  max(26 /* Metric.Automation */, navigator.webdriver ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */);
1243
1246
  try {
@@ -1261,7 +1264,7 @@ function check$4(id, target, input) {
1261
1264
  }
1262
1265
 
1263
1266
  var state$a = [];
1264
- function start$z() {
1267
+ function start$A() {
1265
1268
  reset$m();
1266
1269
  }
1267
1270
  function observe$c(root) {
@@ -1279,7 +1282,7 @@ function recompute$8(evt) {
1279
1282
  function reset$m() {
1280
1283
  state$a = [];
1281
1284
  }
1282
- function stop$x() {
1285
+ function stop$y() {
1283
1286
  reset$m();
1284
1287
  }
1285
1288
 
@@ -1301,7 +1304,7 @@ function offset(element) {
1301
1304
 
1302
1305
  var UserInputTags = ["input", "textarea", "radio", "button", "canvas", "select"];
1303
1306
  var state$9 = [];
1304
- function start$y() {
1307
+ function start$z() {
1305
1308
  reset$l();
1306
1309
  }
1307
1310
  function observe$b(root) {
@@ -1431,12 +1434,12 @@ function context(a) {
1431
1434
  function reset$l() {
1432
1435
  state$9 = [];
1433
1436
  }
1434
- function stop$w() {
1437
+ function stop$x() {
1435
1438
  reset$l();
1436
1439
  }
1437
1440
 
1438
1441
  var state$8 = [];
1439
- function start$x() {
1442
+ function start$y() {
1440
1443
  reset$k();
1441
1444
  }
1442
1445
  function observe$a(root) {
@@ -1451,13 +1454,13 @@ function recompute$7(action, evt) {
1451
1454
  function reset$k() {
1452
1455
  state$8 = [];
1453
1456
  }
1454
- function stop$v() {
1457
+ function stop$w() {
1455
1458
  reset$k();
1456
1459
  }
1457
1460
 
1458
1461
  var timeout$6 = null;
1459
1462
  var state$7 = [];
1460
- function start$w() {
1463
+ function start$x() {
1461
1464
  reset$j();
1462
1465
  }
1463
1466
  function observe$9(root) {
@@ -1491,7 +1494,7 @@ function process$7(event) {
1491
1494
  function reset$j() {
1492
1495
  state$7 = [];
1493
1496
  }
1494
- function stop$u() {
1497
+ function stop$v() {
1495
1498
  clearTimeout$1(timeout$6);
1496
1499
  reset$j();
1497
1500
  }
@@ -1501,7 +1504,7 @@ var timeout$5 = null;
1501
1504
  var hasPrimaryTouch = false;
1502
1505
  var primaryTouchId = 0;
1503
1506
  var activeTouchPointIds = new Set();
1504
- function start$v() {
1507
+ function start$w() {
1505
1508
  reset$i();
1506
1509
  }
1507
1510
  function observe$8(root) {
@@ -1609,7 +1612,7 @@ function similar$1(last, current) {
1609
1612
  var sameId = current.data.id !== undefined ? current.data.id === last.data.id : true;
1610
1613
  return current.event === last.event && match && distance < 20 /* Setting.Distance */ && gap < 25 /* Setting.PointerInterval */ && sameId;
1611
1614
  }
1612
- function stop$t() {
1615
+ function stop$u() {
1613
1616
  clearTimeout$1(timeout$5);
1614
1617
  // Send out any pending pointer events in the pipeline
1615
1618
  if (state$6.length > 0) {
@@ -1669,7 +1672,7 @@ var data$c;
1669
1672
  var timeout$4 = null;
1670
1673
  var initialStateLogged = false;
1671
1674
  var throttledRecompute$1 = throttle(recompute$5, 500 /* Setting.LookAhead */);
1672
- function start$u() {
1675
+ function start$v() {
1673
1676
  initialStateLogged = false;
1674
1677
  bind(window, "resize", throttledRecompute$1);
1675
1678
  recompute$5();
@@ -1699,7 +1702,7 @@ function reset$h() {
1699
1702
  clearTimeout$1(timeout$4);
1700
1703
  throttledRecompute$1.cleanup();
1701
1704
  }
1702
- function stop$s() {
1705
+ function stop$t() {
1703
1706
  reset$h();
1704
1707
  }
1705
1708
 
@@ -1707,7 +1710,7 @@ var state$5 = [];
1707
1710
  var initialTop = null;
1708
1711
  var initialBottom = null;
1709
1712
  var timeout$3 = null;
1710
- function start$t() {
1713
+ function start$u() {
1711
1714
  state$5 = [];
1712
1715
  recompute$4();
1713
1716
  }
@@ -1803,7 +1806,7 @@ function compute$8() {
1803
1806
  log(32 /* Dimension.InitialScrollBottom */, (_b = bottom === null || bottom === void 0 ? void 0 : bottom.hash) === null || _b === void 0 ? void 0 : _b.join("." /* Constant.Dot */));
1804
1807
  }
1805
1808
  }
1806
- function stop$r() {
1809
+ function stop$s() {
1807
1810
  clearTimeout$1(timeout$3);
1808
1811
  throttledRecompute.cleanup();
1809
1812
  state$5 = [];
@@ -1814,7 +1817,7 @@ function stop$r() {
1814
1817
  var data$b = null;
1815
1818
  var previous = null;
1816
1819
  var timeout$2 = null;
1817
- function start$s() {
1820
+ function start$t() {
1818
1821
  reset$f();
1819
1822
  }
1820
1823
  function observe$6(root) {
@@ -1858,13 +1861,13 @@ function reset$f() {
1858
1861
  previous = null;
1859
1862
  data$b = { start: 0, startOffset: 0, end: 0, endOffset: 0 };
1860
1863
  }
1861
- function stop$q() {
1864
+ function stop$r() {
1862
1865
  reset$f();
1863
1866
  clearTimeout$1(timeout$2);
1864
1867
  }
1865
1868
 
1866
1869
  var state$4 = [];
1867
- function start$r() {
1870
+ function start$s() {
1868
1871
  reset$e();
1869
1872
  }
1870
1873
  function observe$5(root) {
@@ -1877,12 +1880,12 @@ function recompute$2(evt) {
1877
1880
  function reset$e() {
1878
1881
  state$4 = [];
1879
1882
  }
1880
- function stop$p() {
1883
+ function stop$q() {
1881
1884
  reset$e();
1882
1885
  }
1883
1886
 
1884
1887
  var data$a;
1885
- function start$q() {
1888
+ function start$r() {
1886
1889
  bind(window, "pagehide", recompute$1);
1887
1890
  }
1888
1891
  function recompute$1(evt) {
@@ -1893,12 +1896,12 @@ function recompute$1(evt) {
1893
1896
  function reset$d() {
1894
1897
  data$a = null;
1895
1898
  }
1896
- function stop$o() {
1899
+ function stop$p() {
1897
1900
  reset$d();
1898
1901
  }
1899
1902
 
1900
1903
  var data$9;
1901
- function start$p() {
1904
+ function start$q() {
1902
1905
  bind(document, "visibilitychange", recompute);
1903
1906
  recompute();
1904
1907
  }
@@ -1910,37 +1913,37 @@ function recompute(evt) {
1910
1913
  function reset$c() {
1911
1914
  data$9 = null;
1912
1915
  }
1913
- function stop$n() {
1916
+ function stop$o() {
1914
1917
  reset$c();
1915
1918
  }
1916
1919
 
1917
- function start$o() {
1918
- start$h();
1920
+ function start$p() {
1921
+ start$i();
1922
+ start$z();
1919
1923
  start$y();
1924
+ start$w();
1920
1925
  start$x();
1921
1926
  start$v();
1922
- start$w();
1927
+ start$q();
1923
1928
  start$u();
1924
- start$p();
1925
1929
  start$t();
1930
+ start$A();
1926
1931
  start$s();
1927
- start$z();
1928
1932
  start$r();
1929
- start$q();
1930
1933
  }
1931
- function stop$m() {
1932
- stop$f();
1934
+ function stop$n() {
1935
+ stop$g();
1936
+ stop$x();
1933
1937
  stop$w();
1938
+ stop$u();
1934
1939
  stop$v();
1935
1940
  stop$t();
1936
- stop$u();
1941
+ stop$o();
1937
1942
  stop$s();
1938
- stop$n();
1939
1943
  stop$r();
1944
+ stop$y();
1940
1945
  stop$q();
1941
- stop$x();
1942
1946
  stop$p();
1943
- stop$o();
1944
1947
  }
1945
1948
  function observe$4(root) {
1946
1949
  observe$7(root);
@@ -1960,8 +1963,8 @@ function observe$4(root) {
1960
1963
  var interaction = /*#__PURE__*/Object.freeze({
1961
1964
  __proto__: null,
1962
1965
  observe: observe$4,
1963
- start: start$o,
1964
- stop: stop$m
1966
+ start: start$p,
1967
+ stop: stop$n
1965
1968
  });
1966
1969
 
1967
1970
  // Following code takes an array of tokens and transforms it to optimize for repeating tokens and make it efficient to send over the wire
@@ -2050,7 +2053,7 @@ function proxyStyleRules$1(win) {
2050
2053
  }
2051
2054
  }
2052
2055
  }
2053
- function start$n() {
2056
+ function start$o() {
2054
2057
  proxyStyleRules$1(window);
2055
2058
  }
2056
2059
  function checkDocumentStyles(documentNode, timestamp) {
@@ -2106,7 +2109,7 @@ function reset$b() {
2106
2109
  sheetAdoptionState = [];
2107
2110
  sheetUpdateState = [];
2108
2111
  }
2109
- function stop$l() {
2112
+ function stop$m() {
2110
2113
  styleSheetMap = {};
2111
2114
  styleTimeMap = {};
2112
2115
  documentNodes = [];
@@ -2154,7 +2157,7 @@ var animationFinish = null;
2154
2157
  var animationId = 'clarityAnimationId';
2155
2158
  var operationCount = 'clarityOperationCount';
2156
2159
  var maxOperations = 20;
2157
- function start$m() {
2160
+ function start$n() {
2158
2161
  if (window["Animation"] &&
2159
2162
  window["Animation"].prototype &&
2160
2163
  window["KeyframeEffect"] &&
@@ -2209,7 +2212,7 @@ function track$6(time, id, operation, keyFrames, timing, targetId, timeline) {
2209
2212
  });
2210
2213
  encode$5(44 /* Event.Animation */);
2211
2214
  }
2212
- function stop$k() {
2215
+ function stop$l() {
2213
2216
  reset$a();
2214
2217
  }
2215
2218
  function overrideAnimationHelper(functionToOverride, name) {
@@ -2436,7 +2439,7 @@ var data$8;
2436
2439
  function reset$9() {
2437
2440
  data$8 = null;
2438
2441
  }
2439
- function start$l() {
2442
+ function start$m() {
2440
2443
  reset$9();
2441
2444
  compute$6();
2442
2445
  }
@@ -2463,7 +2466,7 @@ function compute$6() {
2463
2466
  encode$5(8 /* Event.Document */);
2464
2467
  }
2465
2468
  }
2466
- function stop$j() {
2469
+ function stop$k() {
2467
2470
  reset$9();
2468
2471
  }
2469
2472
 
@@ -2515,7 +2518,7 @@ var history$4 = {};
2515
2518
  var observedNodes = new WeakMap();
2516
2519
  // We ignore mutations if these attributes are updated
2517
2520
  var IGNORED_ATTRIBUTES = ["data-google-query-id", "data-load-complete", "data-google-container-id"];
2518
- function start$k() {
2521
+ function start$l() {
2519
2522
  observers = new Set();
2520
2523
  queue$2 = [];
2521
2524
  timeout$1 = null;
@@ -2553,7 +2556,7 @@ function monitor(frame) {
2553
2556
  bind(frame, "load" /* Constant.LoadEvent */, generate.bind(this, frame, "childList" /* Constant.ChildList */), true);
2554
2557
  }
2555
2558
  }
2556
- function stop$i() {
2559
+ function stop$j() {
2557
2560
  for (var _i = 0, _a = Array.from(observers); _i < _a.length; _i++) {
2558
2561
  var observer = _a[_i];
2559
2562
  if (observer) {
@@ -2569,7 +2572,7 @@ function stop$i() {
2569
2572
  timeout$1 = null;
2570
2573
  observedNodes = new WeakMap();
2571
2574
  }
2572
- function active$2() {
2575
+ function active$3() {
2573
2576
  activePeriod = time() + 3000 /* Setting.MutationActivePeriod */;
2574
2577
  }
2575
2578
  function disconnect(n) {
@@ -3365,11 +3368,11 @@ var iframeMap = null; // Maps iframe's contentDocument => parent iframe element
3365
3368
  var iframeContentMap = null; // Maps parent iframe element => iframe's contentDocument & contentWindow
3366
3369
  var privacyMap = null; // Maps node => Privacy (enum)
3367
3370
  var fraudMap = null; // Maps node => FraudId (number)
3368
- function start$j() {
3371
+ function start$k() {
3369
3372
  reset$7();
3370
3373
  parse(document, true);
3371
3374
  }
3372
- function stop$h() {
3375
+ function stop$i() {
3373
3376
  reset$7();
3374
3377
  }
3375
3378
  function reset$7() {
@@ -3764,7 +3767,7 @@ var regions = {};
3764
3767
  var queue$1 = [];
3765
3768
  var watch = false;
3766
3769
  var observer$1 = null;
3767
- function start$i() {
3770
+ function start$j() {
3768
3771
  reset$6();
3769
3772
  observer$1 = null;
3770
3773
  regionMap = new WeakMap();
@@ -3892,7 +3895,7 @@ function clone(r) {
3892
3895
  function reset$6() {
3893
3896
  state$2 = [];
3894
3897
  }
3895
- function stop$g() {
3898
+ function stop$h() {
3896
3899
  reset$6();
3897
3900
  regionMap = null;
3898
3901
  regions = {};
@@ -3907,7 +3910,7 @@ function stop$g() {
3907
3910
  function target(evt) {
3908
3911
  var path = evt.composed && evt.composedPath ? evt.composedPath() : null;
3909
3912
  var node = (path && path.length > 0 ? path[0] : evt.target);
3910
- active$2(); // Mark active periods of time so mutations can continue uninterrupted
3913
+ active$3(); // Mark active periods of time so mutations can continue uninterrupted
3911
3914
  return node && node.nodeType === Node.DOCUMENT_NODE ? node.documentElement : node;
3912
3915
  }
3913
3916
  function metadata$2(node, event, text) {
@@ -4127,7 +4130,7 @@ function encode$4 (type, ts) {
4127
4130
 
4128
4131
  var state$1 = [];
4129
4132
  var updates$1 = [];
4130
- function start$h() {
4133
+ function start$i() {
4131
4134
  state$1 = [];
4132
4135
  reset$5();
4133
4136
  }
@@ -4174,7 +4177,7 @@ function compute$4() {
4174
4177
  state$1 = temp; // Drop events less than the min time
4175
4178
  encode$4(22 /* Event.Timeline */);
4176
4179
  }
4177
- function stop$f() {
4180
+ function stop$g() {
4178
4181
  state$1 = [];
4179
4182
  reset$5();
4180
4183
  }
@@ -4312,6 +4315,53 @@ function add(node, parent, data) {
4312
4315
  }
4313
4316
  }
4314
4317
 
4318
+ var stopCallbacks = [];
4319
+ var active$2 = false;
4320
+ function start$h() {
4321
+ active$2 = true;
4322
+ }
4323
+ function stop$f() {
4324
+ stopCallbacks.reverse().forEach(function (callback) {
4325
+ try {
4326
+ callback();
4327
+ }
4328
+ catch (error) {
4329
+ // Do nothing
4330
+ }
4331
+ });
4332
+ stopCallbacks = [];
4333
+ active$2 = false;
4334
+ }
4335
+ function register(stopCallback) {
4336
+ if (active$2 && typeof stopCallback === "function") {
4337
+ stopCallbacks.push(stopCallback);
4338
+ }
4339
+ }
4340
+ function dynamicEvent(url) {
4341
+ load(url);
4342
+ }
4343
+ function load(url) {
4344
+ if (!active$2)
4345
+ return;
4346
+ try {
4347
+ var script = document.createElement("script");
4348
+ script.src = url;
4349
+ script.async = true;
4350
+ document.head.appendChild(script);
4351
+ }
4352
+ catch (error) {
4353
+ // Do nothing
4354
+ }
4355
+ }
4356
+
4357
+ var dynamic = /*#__PURE__*/Object.freeze({
4358
+ __proto__: null,
4359
+ dynamicEvent: dynamicEvent,
4360
+ register: register,
4361
+ start: start$h,
4362
+ stop: stop$f
4363
+ });
4364
+
4315
4365
  var discoverBytes = 0;
4316
4366
  var playbackBytes = 0;
4317
4367
  var playback;
@@ -4619,6 +4669,11 @@ function response(payload) {
4619
4669
  signalsEvent(parts[1]);
4620
4670
  }
4621
4671
  break;
4672
+ case "MODULE" /* Constant.Module */:
4673
+ if (parts.length > 1) {
4674
+ dynamicEvent(parts[1]);
4675
+ }
4676
+ break;
4622
4677
  case "SNAPSHOT" /* Constant.Snapshot */:
4623
4678
  config$2.lean = false; // Disable lean mode to ensure we can send playback information to server.
4624
4679
  snapshot();
@@ -4978,7 +5033,7 @@ function upgrade(key) {
4978
5033
  encode$1(3 /* Event.Upgrade */);
4979
5034
  if (config$2.lite) {
4980
5035
  start$c();
4981
- start$n();
5036
+ start$o();
4982
5037
  }
4983
5038
  }
4984
5039
  }
@@ -5400,7 +5455,7 @@ function save() {
5400
5455
  var ts = Math.round(Date.now());
5401
5456
  var upload = config$2.upload && typeof config$2.upload === "string" /* Constant.String */ ? config$2.upload.replace("https://" /* Constant.HTTPS */, "" /* Constant.Empty */) : "" /* Constant.Empty */;
5402
5457
  var upgrade = config$2.lean ? 0 /* BooleanFlag.False */ : 1 /* BooleanFlag.True */;
5403
- setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("|" /* Constant.Pipe */), 1 /* Setting.SessionExpire */);
5458
+ setCookie("_clsk" /* Constant.SessionKey */, [data$2.sessionId, ts, data$2.pageNum, upgrade, upload].join("^" /* Constant.Caret */), 1 /* Setting.SessionExpire */);
5404
5459
  }
5405
5460
  function processCallback(upgrade, consentUpdate) {
5406
5461
  if (consentUpdate === void 0) { consentUpdate = false; }
@@ -5440,7 +5495,7 @@ function track(u, consent) {
5440
5495
  // To avoid cookie churn, write user id cookie only once every day
5441
5496
  if (u.expiry === null || Math.abs(end - u.expiry) >= 1 /* Setting.CookieInterval */ || u.consent !== consent || u.dob !== dob) {
5442
5497
  var cookieParts = [data$2.userId, 2 /* Setting.CookieVersion */, end.toString(36), consent, dob];
5443
- setCookie("_clck" /* Constant.CookieKey */, cookieParts.join("|" /* Constant.Pipe */), 365 /* Setting.Expire */);
5498
+ setCookie("_clck" /* Constant.CookieKey */, cookieParts.join("^" /* Constant.Caret */), 365 /* Setting.Expire */);
5444
5499
  }
5445
5500
  }
5446
5501
  function shortid() {
@@ -5784,7 +5839,7 @@ function stop$6() {
5784
5839
  var status = false;
5785
5840
  function start$5() {
5786
5841
  status = true;
5787
- start$J();
5842
+ start$K();
5788
5843
  reset$4();
5789
5844
  reset$1();
5790
5845
  reset$2();
@@ -5795,7 +5850,7 @@ function stop$5() {
5795
5850
  reset$2();
5796
5851
  reset$1();
5797
5852
  reset$4();
5798
- stop$G();
5853
+ stop$H();
5799
5854
  status = false;
5800
5855
  }
5801
5856
  function active() {
@@ -5851,7 +5906,7 @@ function restart() {
5851
5906
  }
5852
5907
 
5853
5908
  function start$4() {
5854
- start$A();
5909
+ start$B();
5855
5910
  start$f();
5856
5911
  start$e();
5857
5912
  }
@@ -5868,29 +5923,29 @@ var diagnostic = /*#__PURE__*/Object.freeze({
5868
5923
  function start$3() {
5869
5924
  // The order below is important
5870
5925
  // and is determined by interdependencies of modules
5871
- start$l();
5872
- start$i();
5926
+ start$m();
5873
5927
  start$j();
5928
+ start$k();
5874
5929
  if (config$2.delayDom) {
5875
5930
  // Lazy load layout module as part of page load time performance improvements experiment
5876
5931
  bind(window, 'load', function () {
5877
- start$k();
5932
+ start$l();
5878
5933
  });
5879
5934
  }
5880
5935
  else {
5881
- start$k();
5936
+ start$l();
5882
5937
  }
5883
5938
  start$c();
5939
+ start$o();
5884
5940
  start$n();
5885
- start$m();
5886
5941
  }
5887
5942
  function stop$3() {
5888
- stop$g();
5889
5943
  stop$h();
5890
5944
  stop$i();
5891
5945
  stop$j();
5892
- stop$l();
5893
5946
  stop$k();
5947
+ stop$m();
5948
+ stop$l();
5894
5949
  }
5895
5950
 
5896
5951
  var layout = /*#__PURE__*/Object.freeze({
@@ -6184,14 +6239,14 @@ var performance$1 = /*#__PURE__*/Object.freeze({
6184
6239
  stop: stop$1
6185
6240
  });
6186
6241
 
6187
- var modules = [diagnostic, layout, interaction, performance$1];
6242
+ var modules = [diagnostic, layout, interaction, performance$1, dynamic];
6188
6243
  function start(config$1) {
6189
6244
  if (config$1 === void 0) { config$1 = null; }
6190
6245
  // Check that browser supports required APIs and we do not attempt to start Clarity multiple times
6191
6246
  if (check()) {
6192
6247
  config(config$1);
6193
6248
  start$5();
6194
- start$B();
6249
+ start$C();
6195
6250
  modules.forEach(function (x) { return measure(x.start)(); });
6196
6251
  // If it's an internal call to start, without explicit configuration,
6197
6252
  // re-process any newly accumulated items in the queue
@@ -6222,7 +6277,7 @@ function stop() {
6222
6277
  if (active()) {
6223
6278
  // Stop modules in the reverse order of their initialization and start queuing up items again
6224
6279
  modules.slice().reverse().forEach(function (x) { return measure(x.stop)(); });
6225
- stop$y();
6280
+ stop$z();
6226
6281
  stop$5();
6227
6282
  setup();
6228
6283
  }