clarity-js 0.7.62 → 0.7.64

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.
@@ -135,8 +135,11 @@ var config$2 = {
135
135
  delayDom: false,
136
136
  throttleDom: true,
137
137
  conversions: false,
138
- longTask: 30,
139
138
  includeSubdomains: true,
139
+ throttleMutations: false,
140
+ dropMutations: false,
141
+ criticalMs: 200,
142
+ discard: [],
140
143
  };
141
144
 
142
145
  function api(method) {
@@ -164,7 +167,7 @@ function stop$F() {
164
167
  startTime = 0;
165
168
  }
166
169
 
167
- var version$1 = "0.7.58";
170
+ var version$1 = "0.7.64";
168
171
 
169
172
  // tslint:disable: no-bitwise
170
173
  function hash (input, precision) {
@@ -1136,7 +1139,7 @@ function getId(node, autogen) {
1136
1139
  function add(node, parent, data, source) {
1137
1140
  var parentId = parent ? getId(parent) : null;
1138
1141
  // Do not add detached nodes
1139
- if ((!parent || !parentId) && node.host == null) {
1142
+ if ((!parent || !parentId) && node.host == null && node.nodeType !== Node.DOCUMENT_TYPE_NODE) {
1140
1143
  return;
1141
1144
  }
1142
1145
  var id = getId(node, true);
@@ -1558,7 +1561,7 @@ function state$a(timer) {
1558
1561
  return 2 /* Task.Stop */;
1559
1562
  }
1560
1563
  function start$y(timer) {
1561
- tracker[key(timer)] = { start: performance.now(), calls: 0, yield: config$2.longTask };
1564
+ tracker[key(timer)] = { start: performance.now(), calls: 0, yield: 30 /* Setting.LongTask */ };
1562
1565
  }
1563
1566
  function restart$2(timer) {
1564
1567
  var id = key(timer);
@@ -1644,14 +1647,14 @@ function requestIdleCallbackPolyfill(callback, options) {
1644
1647
  var currentTime = performance.now();
1645
1648
  var elapsed = currentTime - startTime;
1646
1649
  var duration = currentTime - event.data;
1647
- if (duration > config$2.longTask && elapsed < options.timeout) {
1650
+ if (duration > 30 /* Setting.LongTask */ && elapsed < options.timeout) {
1648
1651
  requestAnimationFrame(function () { outgoing.postMessage(currentTime); });
1649
1652
  }
1650
1653
  else {
1651
1654
  var didTimeout_1 = elapsed > options.timeout;
1652
1655
  callback({
1653
1656
  didTimeout: didTimeout_1,
1654
- timeRemaining: function () { return didTimeout_1 ? config$2.longTask : Math.max(0, config$2.longTask - duration); }
1657
+ timeRemaining: function () { return didTimeout_1 ? 30 /* Setting.LongTask */ : Math.max(0, 30 /* Setting.LongTask */ - duration); }
1655
1658
  });
1656
1659
  }
1657
1660
  };
@@ -2442,12 +2445,14 @@ var timeout$1 = null;
2442
2445
  var throttleDelay = null;
2443
2446
  var activePeriod = null;
2444
2447
  var history$4 = {};
2448
+ var criticalPeriod = null;
2445
2449
  function start$k() {
2446
2450
  observers = [];
2447
2451
  queue$2 = [];
2448
2452
  timeout$1 = null;
2449
2453
  activePeriod = 0;
2450
2454
  history$4 = {};
2455
+ criticalPeriod = 0;
2451
2456
  // Some popular open source libraries, like styled-components, optimize performance
2452
2457
  // by injecting CSS using insertRule API vs. appending text node. A side effect of
2453
2458
  // using javascript API is that it doesn't trigger DOM mutation and therefore we
@@ -2548,9 +2553,11 @@ function stop$i() {
2548
2553
  queue$2 = [];
2549
2554
  activePeriod = 0;
2550
2555
  timeout$1 = null;
2556
+ criticalPeriod = 0;
2551
2557
  }
2552
2558
  function active$2() {
2553
2559
  activePeriod = time() + 3000 /* Setting.MutationActivePeriod */;
2560
+ criticalPeriod = time() + config$2.criticalMs;
2554
2561
  }
2555
2562
  function handle$1(m) {
2556
2563
  // Queue up mutation records for asynchronous processing
@@ -2670,13 +2677,19 @@ function track$5(m, timer, instance, timestamp) {
2670
2677
  if (value && value.data.tag !== "HTML" /* Constant.HTML */) {
2671
2678
  // calculate inactive period based on the timestamp of the mutation not when the mutation is processed
2672
2679
  var inactive = timestamp > activePeriod;
2680
+ // Calculate critical period based on when mutation is processed
2681
+ var critical = instance < criticalPeriod;
2673
2682
  var target = get(m.target);
2674
- var element = target && target.selector ? target.selector.join() : m.target.nodeName;
2683
+ var element_1 = target && target.selector ? target.selector.join() : m.target.nodeName;
2675
2684
  var parent_1 = value.selector ? value.selector.join() : "" /* Constant.Empty */;
2685
+ // Check if its a low priority (e.g., ads related) element mutation happening during critical period
2686
+ // If the discard list is empty, we discard all mutations during critical period
2687
+ var lowPriMutation = config$2.throttleMutations && critical &&
2688
+ (config$2.discard.length === 0 || config$2.discard.some(function (key) { return element_1.includes(key); }));
2676
2689
  // We use selector, instead of id, to determine the key (signature for the mutation) because in some cases
2677
2690
  // repeated mutations can cause elements to be destroyed and then recreated as new DOM nodes
2678
2691
  // In those cases, IDs will change however the selector (which is relative to DOM xPath) remains the same
2679
- var key = [parent_1, element, m.attributeName, names(m.addedNodes), names(m.removedNodes)].join();
2692
+ var key = [parent_1, element_1, m.attributeName, names(m.addedNodes), names(m.removedNodes)].join();
2680
2693
  // Initialize an entry if it doesn't already exist
2681
2694
  history$4[key] = key in history$4 ? history$4[key] : [0, instance];
2682
2695
  var h = history$4[key];
@@ -2684,19 +2697,23 @@ function track$5(m, timer, instance, timestamp) {
2684
2697
  if (inactive === false && h[0] >= 10 /* Setting.MutationSuspendThreshold */) {
2685
2698
  processNodeList(h[2], 2 /* Source.ChildListRemove */, timer, timestamp);
2686
2699
  }
2687
- // Update the counter
2688
- h[0] = inactive ? (h[1] === instance ? h[0] : h[0] + 1) : 1;
2700
+ // Update the counter, do not reset counter if its critical period
2701
+ h[0] = inactive || lowPriMutation ? (h[1] === instance ? h[0] : h[0] + 1) : 1;
2689
2702
  h[1] = instance;
2690
- // Return updated mutation type based on if we have already hit the threshold or not
2691
- if (h[0] >= 10 /* Setting.MutationSuspendThreshold */) {
2703
+ // Return updated mutation type based on,
2704
+ // 1. if we have already hit the threshold or not
2705
+ // 2. if its a low priority mutation happening during critical time period
2706
+ if (h[0] >= 10 /* Setting.MutationSuspendThreshold */ || lowPriMutation) {
2692
2707
  // Store a reference to removedNodes so we can process them later
2693
2708
  // when we resume mutations again on user interactions
2694
2709
  h[2] = m.removedNodes;
2695
2710
  if (instance > timestamp + 3000 /* Setting.MutationActivePeriod */) {
2696
2711
  return m.type;
2697
2712
  }
2698
- // we only store the most recent mutation for a given key if it is being throttled
2699
- throttledMutations[key] = { mutation: m, timestamp: timestamp };
2713
+ if (!config$2.dropMutations) {
2714
+ // we only store the most recent mutation for a given key if it is being throttled
2715
+ throttledMutations[key] = { mutation: m, timestamp: timestamp };
2716
+ }
2700
2717
  return "throttle" /* Constant.Throttle */;
2701
2718
  }
2702
2719
  }
@@ -2711,7 +2728,7 @@ function names(nodes) {
2711
2728
  }
2712
2729
  function processNodeList(list, source, timer, timestamp) {
2713
2730
  return __awaiter(this, void 0, void 0, function () {
2714
- var length, i, state;
2731
+ var length, i, node, state;
2715
2732
  return __generator(this, function (_a) {
2716
2733
  switch (_a.label) {
2717
2734
  case 0:
@@ -2720,8 +2737,9 @@ function processNodeList(list, source, timer, timestamp) {
2720
2737
  _a.label = 1;
2721
2738
  case 1:
2722
2739
  if (!(i < length)) return [3 /*break*/, 6];
2740
+ node = list[i];
2723
2741
  if (!(source === 1 /* Source.ChildListAdd */)) return [3 /*break*/, 2];
2724
- traverse(list[i], timer, source, timestamp);
2742
+ traverse(node, timer, source, timestamp);
2725
2743
  return [3 /*break*/, 5];
2726
2744
  case 2:
2727
2745
  state = state$a(timer);
@@ -2734,7 +2752,7 @@ function processNodeList(list, source, timer, timestamp) {
2734
2752
  if (state === 2 /* Task.Stop */) {
2735
2753
  return [3 /*break*/, 6];
2736
2754
  }
2737
- processNode(list[i], source, timestamp);
2755
+ processNode(node, source, timestamp);
2738
2756
  _a.label = 5;
2739
2757
  case 5:
2740
2758
  i++;
@@ -5140,7 +5158,7 @@ function measure (method) {
5140
5158
  }
5141
5159
  var duration = performance.now() - start;
5142
5160
  sum(4 /* Metric.TotalCost */, duration);
5143
- if (duration > config$2.longTask) {
5161
+ if (duration > 30 /* Setting.LongTask */) {
5144
5162
  count$1(7 /* Metric.LongTaskCount */);
5145
5163
  max(6 /* Metric.ThreadBlockedTime */, duration);
5146
5164
  log$1(9 /* Code.FunctionExecutionTime */, 0 /* Severity.Info */, "".concat(method.dn || method.name, "-").concat(duration));
@@ -1 +1 @@
1
- !function(){"use strict";var t=Object.freeze({__proto__:null,get queue(){return yt},get start(){return mt},get stop(){return bt},get track(){return dt}}),n=Object.freeze({__proto__:null,get check(){return Mt},get compute(){return Tt},get data(){return ft},get start(){return It},get stop(){return xt},get trigger(){return Ot}}),e=Object.freeze({__proto__:null,get compute(){return Pt},get data(){return jt},get log(){return Nt},get reset(){return Dt},get start(){return At},get stop(){return qt},get updates(){return zt}}),r=Object.freeze({__proto__:null,get callback(){return Ft},get callbacks(){return Ht},get clear(){return Gt},get consent(){return Zt},get data(){return Ut},get electron(){return Lt},get id(){return Jt},get metadata(){return Wt},get save(){return Yt},get shortid(){return $t},get start(){return Bt},get stop(){return Xt}}),o=Object.freeze({__proto__:null,get data(){return cn},get envelope(){return ln},get start(){return un},get stop(){return sn}}),a={projectId:null,delay:1e3,lean:!1,track:!0,content:!0,drop:[],mask:[],unmask:[],regions:[],cookies:[],fraud:!0,checksum:[],report:null,upload:null,fallback:null,upgrade:null,action:null,dob:null,delayDom:!1,throttleDom:!0,conversions:!1,longTask:30,includeSubdomains:!0};function i(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}var c=0;function u(t){void 0===t&&(t=null);var n=t&&t.timeStamp>0?t.timeStamp:performance.now(),e=t&&t.view?t.view.performance.timeOrigin:performance.timeOrigin;return Math.max(Math.round(n+e-c),0)}var s="0.7.58";var l=255,d=!0,f=null,p=null;function h(t,n,e){void 0===n&&(n=!1),void 0===e&&(e=!1);var r=t;if(n)r="".concat("https://").concat("Electron");else{var o=a.drop;if(o&&o.length>0&&t&&t.indexOf("?")>0){var i=t.split("?"),c=i[0],u=i[1];r=c+"?"+u.split("&").map((function(t){return o.some((function(n){return 0===t.indexOf("".concat(n,"="))}))?"".concat(t.split("=")[0],"=").concat("*na*"):t})).join("&")}}return e&&(r=r.substring(0,l)),r}function v(t,n,e){return function(){if(d&&null===f)try{f=new RegExp("\\p{N}","gu"),p=new RegExp("\\p{L}","gu"),new RegExp("\\p{Sc}","gu")}catch(t){d=!1}}(),t?t.replace(p,n).replace(f,e):t}var g=[],m=null;function y(){}var b=[];function w(){}function k(){}var S=Object.freeze({__proto__:null,checkDocumentStyles:function(t){},compute:function(){},data:m,hashText:w,keys:b,log:y,observe:function(){},reset:function(){},sheetAdoptionState:[],sheetUpdateState:[],start:function(){},state:g,stop:function(){},trigger:k}),_=null;function E(t,n){Nn()&&t&&"string"==typeof t&&t.length<255&&(_=n&&"string"==typeof n&&n.length<255?{key:t,value:n}:{value:t},Et(24))}var I,M=null,O=null;function T(t){t in M||(M[t]=0),t in O||(O[t]=0),M[t]++,O[t]++}function x(t,n){null!==n&&(t in M||(M[t]=0),t in O||(O[t]=0),M[t]+=n,O[t]+=n)}function j(t,n){null!==n&&!1===isNaN(n)&&(t in M||(M[t]=0),(n>M[t]||0===M[t])&&(O[t]=n,M[t]=n))}function z(t,n,e){return window.setTimeout(pn(t),n,e)}function C(t){return window.clearTimeout(t)}var A=0,q=0,N=null;function P(){N&&C(N),N=z(D,q),A=u()}function D(){var t=u();I={gap:t-A},Et(25),I.gap<3e5?N=z(D,q):Cn&&(E("clarity","suspend"),oe(),["mousemove","touchstart"].forEach((function(t){return vn(document,t,Pn)})),["resize","scroll","pageshow"].forEach((function(t){return vn(window,t,Pn)})))}var R=Object.freeze({__proto__:null,get data(){return I},reset:P,start:function(){q=6e4,A=0},stop:function(){C(N),A=0,q=0}}),U=null;function H(t){Nn()&&a.lean&&(a.lean=!1,U={key:t},Ft(),Yt(),a.upgrade&&a.upgrade(t),Et(3))}var L=Object.freeze({__proto__:null,get data(){return U},start:function(){!a.lean&&a.upgrade&&a.upgrade("Config"),U=null},stop:function(){U=null},upgrade:H});function V(t,n,e,r){return new(e||(e=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(i,c)}u((r=r.apply(t,n||[])).next())}))}function B(t,n){var e,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(u){return function(c){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(e=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(t,i)}catch(t){c=[6,t],r=0}finally{e=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}var X=null;function W(t,n){Z(t,"string"==typeof n?[n]:n)}function J(t,n,e,r){return void 0===n&&(n=null),void 0===e&&(e=null),void 0===r&&(r=null),V(this,void 0,void 0,(function(){var o,a;return B(this,(function(i){switch(i.label){case 0:return a={},[4,Y(t)];case 1:return a.userId=i.sent(),a.userHint=r||((c=t)&&c.length>=5?"".concat(c.substring(0,2)).concat(v(c.substring(2),"*","*")):v(c,"*","*")),Z("userId",[(o=a).userId]),Z("userHint",[o.userHint]),Z("userType",[K(t)]),n&&(Z("sessionId",[n]),o.sessionId=n),e&&(Z("pageId",[e]),o.pageId=e),[2,o]}var c}))}))}function Z(t,n){if(Nn()&&t&&n&&"string"==typeof t&&t.length<255){for(var e=(t in X?X[t]:[]),r=0;r<n.length;r++)"string"==typeof n[r]&&n[r].length<255&&e.push(n[r]);X[t]=e}}function G(){Et(34)}function F(){X={}}function Y(t){return V(this,void 0,void 0,(function(){var n;return B(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),crypto&&t?[4,crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t))]:[3,2];case 1:return n=e.sent(),[2,Array.prototype.map.call(new Uint8Array(n),(function(t){return("00"+t.toString(16)).slice(-2)})).join("")];case 2:return[2,""];case 3:return[3,5];case 4:return e.sent(),[2,""];case 5:return[2]}}))}))}function K(t){return t&&t.indexOf("@")>0?"email":"string"}var Q="CompressionStream"in window;function $(t){return V(this,void 0,void 0,(function(){var n,e;return B(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),Q?(n=new ReadableStream({start:function(n){return V(this,void 0,void 0,(function(){return B(this,(function(e){return n.enqueue(t),n.close(),[2]}))}))}}).pipeThrough(new TextEncoderStream).pipeThrough(new window.CompressionStream("gzip")),e=Uint8Array.bind,[4,tt(n)]):[3,2];case 1:return[2,new(e.apply(Uint8Array,[void 0,r.sent()]))];case 2:return[3,4];case 3:return r.sent(),[3,4];case 4:return[2,null]}}))}))}function tt(t){return V(this,void 0,void 0,(function(){var n,e,r,o,a;return B(this,(function(i){switch(i.label){case 0:n=t.getReader(),e=[],r=!1,o=[],i.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return a=i.sent(),r=a.done,o=a.value,r?[2,e]:(e.push.apply(e,o),[3,1]);case 3:return[2,e]}}))}))}var nt=null;function et(t){try{if(!nt)return;var n=function(t){try{return JSON.parse(t)}catch(t){return[]}}(t);n.forEach((function(t){nt(t)}))}catch(t){}}var rt=[S,e,Object.freeze({__proto__:null,compute:G,get data(){return X},identify:J,reset:F,set:W,start:function(){F()},stop:function(){F()}}),n,S,r,o,t,R,L,S];function ot(){M={},O={},T(5),rt.forEach((function(t){return pn(t.start)()}))}function at(){rt.slice().reverse().forEach((function(t){return pn(t.stop)()})),M={},O={}}function it(){G(),Pt(),Et(0),Tt()}var ct,ut,st,lt,dt,ft,pt=0,ht=0,vt=null,gt=0;function mt(){lt=!0,pt=0,ht=0,gt=0,ct=[],ut=[],st={},dt=null}function yt(t,n){if(void 0===n&&(n=!0),lt){var e=u(),r=t.length>1?t[1]:null,o=JSON.stringify(t);switch(r){case 5:pt+=o.length;case 37:case 6:case 43:case 45:case 46:ht+=o.length,ct.push(o);break;default:ut.push(o)}T(25);var i=function(){var t=!1===a.lean&&pt>0?100:cn.sequence*a.delay;return"string"==typeof a.upload?Math.max(Math.min(t,3e4),100):a.delay}();e-gt>2*i&&(C(vt),vt=null),n&&null===vt&&(25!==r&&P(),vt=z(wt,i),gt=e,Mt(ht))}}function bt(){C(vt),wt(!0),pt=0,ht=0,gt=0,ct=[],ut=[],st={},dt=null,lt=!1}function wt(t){return void 0===t&&(t=!1),V(this,void 0,void 0,(function(){var n,e,r,o,i,c,u,s;return B(this,(function(l){switch(l.label){case 0:return vt=null,(n=!1===a.lean&&ht>0&&(ht<1048576||cn.sequence>0))&&j(1,1),it(),e=!0===t,r=JSON.stringify(ln(e)),o="[".concat(ut.join(),"]"),i=n?"[".concat(ct.join(),"]"):"",c=function(t){return t.p.length>0?'{"e":'.concat(t.e,',"a":').concat(t.a,',"p":').concat(t.p,"}"):'{"e":'.concat(t.e,',"a":').concat(t.a,"}")}({e:r,a:o,p:i}),e?(s=null,[3,3]):[3,1];case 1:return[4,$(c)];case 2:s=l.sent(),l.label=3;case 3:return x(2,(u=s)?u.length:c.length),kt(c,u,cn.sequence,e),ut=[],n&&(ct=[],ht=0,pt=0),[2]}}))}))}function kt(t,n,e,r){if(void 0===r&&(r=!1),"string"==typeof a.upload){var o=a.upload,i=!1;if(r&&"sendBeacon"in navigator)try{(i=navigator.sendBeacon.bind(navigator)(o,t))&&_t(e)}catch(t){}if(!1===i){e in st?st[e].attempts++:st[e]={data:t,attempts:1};var c=new XMLHttpRequest;c.open("POST",o,!0),c.timeout=15e3,c.ontimeout=function(){fn(new Error("".concat("Timeout"," : ").concat(o)))},null!==e&&(c.onreadystatechange=function(){pn(St)(c,e)}),c.withCredentials=!0,n?(c.setRequestHeader("Accept","application/x-clarity-gzip"),c.send(n)):c.send(t)}}else if(a.upload){(0,a.upload)(t),_t(e)}}function St(t,n){var e=st[n];t&&4===t.readyState&&e&&((t.status<200||t.status>208)&&e.attempts<=1?t.status>=400&&t.status<500?Ot(6):(0===t.status&&(a.upload=a.fallback?a.fallback:a.upload),kt(e.data,null,n)):(dt={sequence:n,attempts:e.attempts,status:t.status},e.attempts>1&&Et(2),200===t.status&&t.responseText&&function(t){for(var n=t&&t.length>0?t.split("\n"):[],e=0,r=n;e<r.length;e++){var o=r[e],i=o&&o.length>0?o.split(/ (.*)/):[""];switch(i[0]){case"END":Ot(6);break;case"UPGRADE":H("Auto");break;case"ACTION":a.action&&i.length>1&&a.action(i[1]);break;case"EXTRACT":i.length>1&&i[1];break;case"SIGNAL":i.length>1&&et(i[1])}}}(t.responseText),0===t.status&&(kt(e.data,null,n,!0),Ot(3)),t.status>=200&&t.status<=208&&_t(n),delete st[n]))}function _t(t){1===t&&(Yt(),Ft())}function Et(t){var n=[u(),t];switch(t){case 4:var e=g;e&&((n=[e.time,e.event]).push(e.data.visible),n.push(e.data.docWidth),n.push(e.data.docHeight),n.push(e.data.screenWidth),n.push(e.data.screenHeight),n.push(e.data.scrollX),n.push(e.data.scrollY),n.push(e.data.pointerX),n.push(e.data.pointerY),n.push(e.data.activityTime),n.push(e.data.scrollTime),yt(n,!1));break;case 25:n.push(I.gap),yt(n);break;case 35:n.push(ft.check),yt(n,!1);break;case 3:n.push(U.key),yt(n);break;case 2:n.push(dt.sequence),n.push(dt.attempts),n.push(dt.status),yt(n,!1);break;case 24:_.key&&n.push(_.key),n.push(_.value),yt(n);break;case 34:var r=Object.keys(X);if(r.length>0){for(var o=0,a=r;o<a.length;o++){var i=a[o];n.push(i),n.push(X[i])}F(),yt(n,!1)}break;case 0:var c=Object.keys(O);if(c.length>0){for(var s=0,l=c;s<l.length;s++){var d=l[s],f=parseInt(d,10);n.push(f),n.push(Math.round(O[d]))}O={},yt(n,!1)}break;case 1:var p=Object.keys(zt);if(p.length>0){for(var h=0,v=p;h<v.length;h++){var y=v[h];f=parseInt(y,10);n.push(f),n.push(zt[y])}Dt(),yt(n,!1)}break;case 36:var w=Object.keys(m);if(w.length>0){for(var k=0,S=w;k<S.length;k++){var E=S[k];f=parseInt(E,10);n.push(f),n.push([].concat.apply([],m[E]))}yt(n,!1)}break;case 40:b.forEach((function(t){n.push(t);var e=[];for(var r in m[t]){var o=parseInt(r,10);e.push(o),e.push(m[t][r])}n.push(e)})),yt(n,!1)}}function It(){ft={check:0}}function Mt(t){if(0===ft.check){var n=ft.check;n=cn.sequence>=128?1:n,n=cn.pageNum>=128?7:n,n=u()>72e5?2:n,(n=t>10485760?2:n)!==ft.check&&Ot(n)}}function Ot(t){ft.check=t,5!==t&&(Gt(),oe())}function Tt(){0!==ft.check&&Et(35)}function xt(){ft=null}var jt=null,zt=null,Ct=!1;function At(){jt={},zt={},Ct=!1}function qt(){jt={},zt={},Ct=!1}function Nt(t,n){if(n&&(n="".concat(n),t in jt||(jt[t]=[]),jt[t].indexOf(n)<0)){if(jt[t].length>128)return void(Ct||(Ct=!0,Ot(5)));jt[t].push(n),t in zt||(zt[t]=[]),zt[t].push(n)}}function Pt(){Et(1)}function Dt(){zt={},Ct=!1}function Rt(t){Nt(36,t.toString())}var Ut=null,Ht=[],Lt=0,Vt=null;function Bt(){var t,n,e;Vt=null;var r=navigator&&"userAgent"in navigator?navigator.userAgent:"",o=null!==(e=null===(n=null===(t=null===Intl||void 0===Intl?void 0:Intl.DateTimeFormat())||void 0===t?void 0:t.resolvedOptions())||void 0===n?void 0:n.timeZone)&&void 0!==e?e:"",i=(new Date).getTimezoneOffset().toString(),c=window.location.ancestorOrigins?Array.from(window.location.ancestorOrigins).toString():"",u=document&&document.title?document.title:"";Lt=r.indexOf("Electron")>0?1:0;var s,l=function(){var t={session:$t(),ts:Math.round(Date.now()),count:1,upgrade:null,upload:""},n=en("_clsk",!a.includeSubdomains);if(n){var e=n.split("|");e.length>=5&&t.ts-tn(e[1])<18e5&&(t.session=e[0],t.count=tn(e[2])+1,t.upgrade=tn(e[3]),t.upload=e.length>=6?"".concat("https://").concat(e[5],"/").concat(e[4]):"".concat("https://").concat(e[4]))}return t}(),d=nn(),f=a.projectId||function(t,n){void 0===n&&(n=null);for(var e,r=5381,o=r,a=0;a<t.length;a+=2)r=(r<<5)+r^t.charCodeAt(a),a+1<t.length&&(o=(o<<5)+o^t.charCodeAt(a+1));return e=Math.abs(r+11579*o),(n?e%Math.pow(2,n):e).toString(36)}(location.host);Ut={projectId:f,userId:d.id,sessionId:l.session,pageNum:l.count},a.lean=a.track&&null!==l.upgrade?0===l.upgrade:a.lean,a.upload=a.track&&"string"==typeof a.upload&&l.upload&&l.upload.length>"https://".length?l.upload:a.upload,Nt(0,r),Nt(3,u),Nt(1,h(location.href,!!Lt)),Nt(2,document.referrer),Nt(15,function(){var t=$t();if(a.track&&Kt(window,"sessionStorage")){var n=sessionStorage.getItem("_cltk");t=n||t,sessionStorage.setItem("_cltk",t)}return t}()),Nt(16,document.documentElement.lang),Nt(17,document.dir),Nt(26,"".concat(window.devicePixelRatio)),Nt(28,d.dob.toString()),Nt(29,d.version.toString()),Nt(33,c),Nt(34,o),Nt(35,i),j(0,l.ts),j(1,0),j(35,Lt),navigator&&(Nt(9,navigator.language),j(33,navigator.hardwareConcurrency),j(32,navigator.maxTouchPoints),j(34,Math.round(navigator.deviceMemory)),(s=navigator.userAgentData)&&s.getHighEntropyValues?s.getHighEntropyValues(["model","platform","platformVersion","uaFullVersion"]).then((function(t){var n;Nt(22,t.platform),Nt(23,t.platformVersion),null===(n=t.brands)||void 0===n||n.forEach((function(t){Nt(24,t.name+"~"+t.version)})),Nt(25,t.model),j(27,t.mobile?1:0)})):Nt(22,navigator.platform)),screen&&(j(14,Math.round(screen.width)),j(15,Math.round(screen.height)),j(16,Math.round(screen.colorDepth)));for(var p=0,v=a.cookies;p<v.length;p++){var g=v[p],m=en(g);m&&W(g,m)}!function(t){Rt(t?1:0)}(a.track),Qt(d)}function Xt(){Vt=null,Ut=null,Ht.forEach((function(t){t.called=!1}))}function Wt(t,n,e){void 0===n&&(n=!0),void 0===e&&(e=!1);var r=a.lean?0:1,o=!1;Ut&&(r||!1===n)&&(t(Ut,!a.lean),o=!0),!e&&o||Ht.push({callback:t,wait:n,recall:e,called:o})}function Jt(){return Ut?[Ut.userId,Ut.sessionId,Ut.pageNum].join("."):""}function Zt(t){if(void 0===t&&(t=!0),!t)return a.track=!1,on("_clsk","",-Number.MAX_VALUE),on("_clck","",-Number.MAX_VALUE),oe(),void window.setTimeout(re,250);Nn()&&(a.track=!0,Qt(nn(),1),Yt(),Rt(2))}function Gt(){on("_clsk","",0)}function Ft(){!function(t){if(Ht.length>0)for(var n=0;n<Ht.length;n++){var e=Ht[n];!e.callback||e.called||e.wait&&!t||(e.callback(Ut,!a.lean),e.called=!0,e.recall||(Ht.splice(n,1),n--))}}(a.lean?0:1)}function Yt(){if(Ut){var t=Math.round(Date.now()),n=a.upload&&"string"==typeof a.upload?a.upload.replace("https://",""):"",e=a.lean?0:1;on("_clsk",[Ut.sessionId,t,Ut.pageNum,e,n].join("|"),1)}}function Kt(t,n){try{return!!t[n]}catch(t){return!1}}function Qt(t,n){void 0===n&&(n=null),n=null===n?t.consent:n;var e=Math.ceil((Date.now()+31536e6)/864e5),r=0===t.dob?null===a.dob?0:a.dob:t.dob;(null===t.expiry||Math.abs(e-t.expiry)>=1||t.consent!==n||t.dob!==r)&&on("_clck",[Ut.userId,2,e.toString(36),n,r].join("|"),365)}function $t(){var t=Math.floor(Math.random()*Math.pow(2,32));return window&&window.crypto&&window.crypto.getRandomValues&&Uint32Array&&(t=window.crypto.getRandomValues(new Uint32Array(1))[0]),t.toString(36)}function tn(t,n){return void 0===n&&(n=10),parseInt(t,n)}function nn(){var t={id:$t(),version:0,expiry:null,consent:0,dob:0},n=en("_clck",!a.includeSubdomains);if(n&&n.length>0){for(var e=n.split("|"),r=0,o=0,i=document.cookie.split(";");o<i.length;o++){r+="_clck"===i[o].split("=")[0].trim()?1:0}if(1===e.length||r>1){var c="".concat(";").concat("expires=").concat(new Date(0).toUTCString()).concat(";path=/");document.cookie="".concat("_clck","=").concat(c),document.cookie="".concat("_clsk","=").concat(c)}e.length>1&&(t.version=tn(e[1])),e.length>2&&(t.expiry=tn(e[2],36)),e.length>3&&1===tn(e[3])&&(t.consent=1),e.length>4&&tn(e[1])>1&&(t.dob=tn(e[4])),a.track=a.track||1===t.consent,t.id=a.track?e[0]:t.id}return t}function en(t,n){var e;if(void 0===n&&(n=!1),Kt(document,"cookie")){var r=document.cookie.split(";");if(r)for(var o=0;o<r.length;o++){var a=r[o].split("=");if(a.length>1&&a[0]&&a[0].trim()===t){for(var i=rn(a[1]),c=i[0],u=i[1];c;)c=(e=rn(u))[0],u=e[1];return n?u.endsWith("".concat("~","1"))?u.substring(0,u.length-2):null:u}}}return null}function rn(t){try{var n=decodeURIComponent(t);return[n!=t,n]}catch(t){}return[!1,t]}function on(t,n,e){if((a.track||""==n)&&(navigator&&navigator.cookieEnabled||Kt(document,"cookie"))){var r=function(t){return encodeURIComponent(t)}(n),o=new Date;o.setDate(o.getDate()+e);var i=o?"expires="+o.toUTCString():"",c="".concat(t,"=").concat(r).concat(";").concat(i).concat(";path=/");try{if(null===Vt){for(var u=location.hostname?location.hostname.split("."):[],s=u.length-1;s>=0;s--)if(Vt=".".concat(u[s]).concat(Vt||""),s<u.length-1&&(document.cookie="".concat(c).concat(";").concat("domain=").concat(Vt),en(t)===n))return;Vt=""}}catch(t){Vt=""}document.cookie=Vt?"".concat(c).concat(";").concat("domain=").concat(Vt):c}}var an,cn=null;function un(){var t=Ut;cn={version:s,sequence:0,start:0,duration:0,projectId:t.projectId,userId:t.userId,sessionId:t.sessionId,pageNum:t.pageNum,upload:0,end:0,applicationPlatform:0,url:""}}function sn(){cn=null}function ln(t){return cn.start=cn.start+cn.duration,cn.duration=u()-cn.start,cn.sequence++,cn.upload=t&&"sendBeacon"in navigator?1:0,cn.end=t?1:0,cn.applicationPlatform=0,cn.url=h(location.href,!1,!0),[cn.version,cn.sequence,cn.start,cn.duration,cn.projectId,cn.userId,cn.sessionId,cn.pageNum,cn.upload,cn.end,cn.applicationPlatform,cn.url]}function dn(){an=[]}function fn(t){if(an&&-1===an.indexOf(t.message)){var n=a.report;if(n&&n.length>0){var e={v:cn.version,p:cn.projectId,u:cn.userId,s:cn.sessionId,n:cn.pageNum};t.message&&(e.m=t.message),t.stack&&(e.e=t.stack);var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(JSON.stringify(e)),an.push(t.message)}}return t}function pn(t){return function(){var n=performance.now();try{t.apply(this,arguments)}catch(t){throw fn(t)}var e=performance.now()-n;x(4,e),e>a.longTask&&(T(7),j(6,e),"".concat(t.dn||t.name,"-").concat(e))}}var hn=[];function vn(t,n,e,r){void 0===r&&(r=!1),e=pn(e);try{t[i("addEventListener")](n,e,r),hn.push({event:n,target:t,listener:e,capture:r})}catch(t){}}function gn(){for(var t=0,n=hn;t<n.length;t++){var e=n[t];try{e.target[i("removeEventListener")](e.event,e.listener,e.capture)}catch(t){}}hn=[]}var mn=null,yn=null,bn=null,wn=0;function kn(){return!(wn++>20)}function Sn(){wn=0,bn!==En()&&(oe(),window.setTimeout(_n,250))}function _n(){re(),j(29,1)}function En(){return location.href?location.href.replace(location.hash,""):location.href}Sn.dn=1;var In=[],Mn=null,On=null,Tn=null;function xn(){On&&(Tn(),On=null,null===Mn&&zn())}function jn(){In=[],Mn=null,On=null}function zn(){var t=In.shift();t&&(Mn=t,t.task().then((function(){t.id===Jt()&&(t.resolve(),Mn=null,zn())})).catch((function(n){t.id===Jt()&&(n&&(n.name,n.message,n.stack),Mn=null,zn())})))}var Cn=!1;function An(){Cn=!0,c=performance.now()+performance.timeOrigin,jn(),gn(),dn(),bn=En(),wn=0,vn(window,"popstate",Sn),null===mn&&(mn=history.pushState,history.pushState=function(){mn.apply(this,arguments),Nn()&&kn()&&Sn()}),null===yn&&(yn=history.replaceState,history.replaceState=function(){yn.apply(this,arguments),Nn()&&kn()&&Sn()})}function qn(){bn=null,wn=0,dn(),gn(),jn(),c=0,Cn=!1}function Nn(){return Cn}function Pn(){re(),E("clarity","restart")}Pn.dn=2;var Dn=null;function Rn(){Dn=null}function Un(t){Dn={fetchStart:Math.round(t.fetchStart),connectStart:Math.round(t.connectStart),connectEnd:Math.round(t.connectEnd),requestStart:Math.round(t.requestStart),responseStart:Math.round(t.responseStart),responseEnd:Math.round(t.responseEnd),domInteractive:Math.round(t.domInteractive),domComplete:Math.round(t.domComplete),loadEventStart:Math.round(t.loadEventStart),loadEventEnd:Math.round(t.loadEventEnd),redirectCount:Math.round(t.redirectCount),size:t.transferSize?t.transferSize:0,type:t.type,protocol:t.nextHopProtocol,encodedSize:t.encodedBodySize?t.encodedBodySize:0,decodedSize:t.decodedBodySize?t.decodedBodySize:0},function(t){V(this,void 0,void 0,(function(){var n,e;return B(this,(function(r){return n=u(),e=[n,t],29===t&&(e.push(Dn.fetchStart),e.push(Dn.connectStart),e.push(Dn.connectEnd),e.push(Dn.requestStart),e.push(Dn.responseStart),e.push(Dn.responseEnd),e.push(Dn.domInteractive),e.push(Dn.domComplete),e.push(Dn.loadEventStart),e.push(Dn.loadEventEnd),e.push(Dn.redirectCount),e.push(Dn.size),e.push(Dn.type),e.push(Dn.protocol),e.push(Dn.encodedSize),e.push(Dn.decodedSize),Rn(),yt(e)),[2]}))}))}(29)}var Hn,Ln=0,Vn=1/0,Bn=0,Xn=0,Wn=[],Jn=new Map,Zn=function(){return Ln||0},Gn=function(){if(!Wn.length)return-1;var t=Math.min(Wn.length-1,Math.floor((Zn()-Xn)/50));return Wn[t].latency},Fn=function(){Xn=Zn(),Wn.length=0,Jn.clear()},Yn=function(t){if(t.interactionId&&!(t.duration<40)){!function(t){"interactionCount"in performance?Ln=performance.interactionCount:t.interactionId&&(Vn=Math.min(Vn,t.interactionId),Bn=Math.max(Bn,t.interactionId),Ln=Bn?(Bn-Vn)/7+1:0)}(t);var n=Wn[Wn.length-1],e=Jn.get(t.interactionId);if(e||Wn.length<10||t.duration>(null==n?void 0:n.latency)){if(e)t.duration>e.latency&&(e.latency=t.duration);else{var r={id:t.interactionId,latency:t.duration};Jn.set(r.id,r),Wn.push(r)}Wn.sort((function(t,n){return n.latency-t.latency})),Wn.length>10&&Wn.splice(10).forEach((function(t){return Jn.delete(t.id)}))}}},Kn=["navigation","resource","longtask","first-input","layout-shift","largest-contentful-paint","event"];function Qn(){try{Hn&&Hn.disconnect(),Hn=new PerformanceObserver(pn($n));for(var t=0,n=Kn;t<n.length;t++){var e=n[t];PerformanceObserver.supportedEntryTypes.indexOf(e)>=0&&("layout-shift"===e&&x(9,0),Hn.observe({type:e,buffered:!0}))}}catch(t){}}function $n(t){!function(t){for(var n=(!("visibilityState"in document)||"visible"===document.visibilityState),e=0;e<t.length;e++){var r=t[e];switch(r.entryType){case"navigation":Un(r);break;case"resource":var o=r.name;Nt(4,te(o)),o!==a.upload&&o!==a.fallback||j(28,r.duration);break;case"longtask":T(7);break;case"first-input":n&&j(10,r.processingStart-r.startTime);break;case"event":n&&"PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&(Yn(r),Nt(37,Gn().toString()));break;case"layout-shift":n&&!r.hadRecentInput&&x(9,1e3*r.value);break;case"largest-contentful-paint":n&&j(8,r.startTime)}}}(t.getEntries())}function te(t){var n=document.createElement("a");return n.href=t,n.host}function ne(){Rn(),function(){navigator&&"connection"in navigator&&Nt(27,navigator.connection.effectiveType),window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&("complete"!==document.readyState?vn(window,"load",z.bind(this,Qn,0)):Qn())}()}Qn.dn=26,$n.dn=27,ne.dn=25;var ee=[S,S,S,Object.freeze({__proto__:null,start:ne,stop:function(){Hn&&Hn.disconnect(),Hn=null,Fn(),Rn()}})];function re(t){void 0===t&&(t=null),function(){try{var t=navigator&&"globalPrivacyControl"in navigator&&1==navigator.globalPrivacyControl;return!1===Cn&&"undefined"!=typeof Promise&&window.MutationObserver&&document.createTreeWalker&&"now"in Date&&"now"in performance&&"undefined"!=typeof WeakMap&&!t}catch(t){return!1}}()&&(!function(t){if(null===t||Cn)return!1;for(var n in t)n in a&&(a[n]=t[n])}(t),An(),ot(),ee.forEach((function(t){return pn(t.start)()})),null===t&&ue())}function oe(){Nn()&&(ee.slice().reverse().forEach((function(t){return pn(t.stop)()})),at(),qn(),void 0!==ie&&(ie[ce]=function(){(ie[ce].q=ie[ce].q||[]).push(arguments),"start"===arguments[0]&&ie[ce].q.unshift(ie[ce].q.pop())&&ue()}))}var ae=Object.freeze({__proto__:null,consent:Zt,event:E,hashText:w,identify:J,metadata:Wt,pause:function(){Nn()&&(E("clarity","pause"),null===On&&(On=new Promise((function(t){Tn=t}))))},resume:function(){Nn()&&(xn(),E("clarity","resume"))},set:W,signal:function(t){nt=t},start:re,stop:oe,upgrade:H,version:s}),ie=window,ce="clarity";function ue(){if(void 0!==ie){if(ie[ce]&&ie[ce].v)return console.warn("Error CL001: Multiple Clarity tags detected.");var t=ie[ce]&&ie[ce].q||[];for(ie[ce]=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return ae[t].apply(ae,n)},ie[ce].v=s;t.length>0;)ie[ce].apply(ie,t.shift())}}ue()}();
1
+ !function(){"use strict";var t=Object.freeze({__proto__:null,get queue(){return yt},get start(){return mt},get stop(){return bt},get track(){return dt}}),n=Object.freeze({__proto__:null,get check(){return Mt},get compute(){return Tt},get data(){return ft},get start(){return It},get stop(){return xt},get trigger(){return Ot}}),e=Object.freeze({__proto__:null,get compute(){return Pt},get data(){return jt},get log(){return Nt},get reset(){return Dt},get start(){return At},get stop(){return qt},get updates(){return zt}}),r=Object.freeze({__proto__:null,get callback(){return Ft},get callbacks(){return Ht},get clear(){return Gt},get consent(){return Zt},get data(){return Ut},get electron(){return Lt},get id(){return Jt},get metadata(){return Wt},get save(){return Yt},get shortid(){return $t},get start(){return Bt},get stop(){return Xt}}),o=Object.freeze({__proto__:null,get data(){return cn},get envelope(){return ln},get start(){return un},get stop(){return sn}}),a={projectId:null,delay:1e3,lean:!1,track:!0,content:!0,drop:[],mask:[],unmask:[],regions:[],cookies:[],fraud:!0,checksum:[],report:null,upload:null,fallback:null,upgrade:null,action:null,dob:null,delayDom:!1,throttleDom:!0,conversions:!1,includeSubdomains:!0,throttleMutations:!1,dropMutations:!1,criticalMs:200,discard:[]};function i(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}var c=0;function u(t){void 0===t&&(t=null);var n=t&&t.timeStamp>0?t.timeStamp:performance.now(),e=t&&t.view?t.view.performance.timeOrigin:performance.timeOrigin;return Math.max(Math.round(n+e-c),0)}var s="0.7.64";var l=255,d=!0,f=null,p=null;function h(t,n,e){void 0===n&&(n=!1),void 0===e&&(e=!1);var r=t;if(n)r="".concat("https://").concat("Electron");else{var o=a.drop;if(o&&o.length>0&&t&&t.indexOf("?")>0){var i=t.split("?"),c=i[0],u=i[1];r=c+"?"+u.split("&").map((function(t){return o.some((function(n){return 0===t.indexOf("".concat(n,"="))}))?"".concat(t.split("=")[0],"=").concat("*na*"):t})).join("&")}}return e&&(r=r.substring(0,l)),r}function v(t,n,e){return function(){if(d&&null===f)try{f=new RegExp("\\p{N}","gu"),p=new RegExp("\\p{L}","gu"),new RegExp("\\p{Sc}","gu")}catch(t){d=!1}}(),t?t.replace(p,n).replace(f,e):t}var g=[],m=null;function y(){}var b=[];function w(){}function k(){}var S=Object.freeze({__proto__:null,checkDocumentStyles:function(t){},compute:function(){},data:m,hashText:w,keys:b,log:y,observe:function(){},reset:function(){},sheetAdoptionState:[],sheetUpdateState:[],start:function(){},state:g,stop:function(){},trigger:k}),_=null;function E(t,n){Nn()&&t&&"string"==typeof t&&t.length<255&&(_=n&&"string"==typeof n&&n.length<255?{key:t,value:n}:{value:t},Et(24))}var I,M=null,O=null;function T(t){t in M||(M[t]=0),t in O||(O[t]=0),M[t]++,O[t]++}function x(t,n){null!==n&&(t in M||(M[t]=0),t in O||(O[t]=0),M[t]+=n,O[t]+=n)}function j(t,n){null!==n&&!1===isNaN(n)&&(t in M||(M[t]=0),(n>M[t]||0===M[t])&&(O[t]=n,M[t]=n))}function z(t,n,e){return window.setTimeout(pn(t),n,e)}function C(t){return window.clearTimeout(t)}var A=0,q=0,N=null;function P(){N&&C(N),N=z(D,q),A=u()}function D(){var t=u();I={gap:t-A},Et(25),I.gap<3e5?N=z(D,q):Cn&&(E("clarity","suspend"),oe(),["mousemove","touchstart"].forEach((function(t){return vn(document,t,Pn)})),["resize","scroll","pageshow"].forEach((function(t){return vn(window,t,Pn)})))}var R=Object.freeze({__proto__:null,get data(){return I},reset:P,start:function(){q=6e4,A=0},stop:function(){C(N),A=0,q=0}}),U=null;function H(t){Nn()&&a.lean&&(a.lean=!1,U={key:t},Ft(),Yt(),a.upgrade&&a.upgrade(t),Et(3))}var L=Object.freeze({__proto__:null,get data(){return U},start:function(){!a.lean&&a.upgrade&&a.upgrade("Config"),U=null},stop:function(){U=null},upgrade:H});function V(t,n,e,r){return new(e||(e=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(i,c)}u((r=r.apply(t,n||[])).next())}))}function B(t,n){var e,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(u){return function(c){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(e=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(t,i)}catch(t){c=[6,t],r=0}finally{e=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}var X=null;function W(t,n){Z(t,"string"==typeof n?[n]:n)}function J(t,n,e,r){return void 0===n&&(n=null),void 0===e&&(e=null),void 0===r&&(r=null),V(this,void 0,void 0,(function(){var o,a;return B(this,(function(i){switch(i.label){case 0:return a={},[4,Y(t)];case 1:return a.userId=i.sent(),a.userHint=r||((c=t)&&c.length>=5?"".concat(c.substring(0,2)).concat(v(c.substring(2),"*","*")):v(c,"*","*")),Z("userId",[(o=a).userId]),Z("userHint",[o.userHint]),Z("userType",[K(t)]),n&&(Z("sessionId",[n]),o.sessionId=n),e&&(Z("pageId",[e]),o.pageId=e),[2,o]}var c}))}))}function Z(t,n){if(Nn()&&t&&n&&"string"==typeof t&&t.length<255){for(var e=(t in X?X[t]:[]),r=0;r<n.length;r++)"string"==typeof n[r]&&n[r].length<255&&e.push(n[r]);X[t]=e}}function G(){Et(34)}function F(){X={}}function Y(t){return V(this,void 0,void 0,(function(){var n;return B(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),crypto&&t?[4,crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t))]:[3,2];case 1:return n=e.sent(),[2,Array.prototype.map.call(new Uint8Array(n),(function(t){return("00"+t.toString(16)).slice(-2)})).join("")];case 2:return[2,""];case 3:return[3,5];case 4:return e.sent(),[2,""];case 5:return[2]}}))}))}function K(t){return t&&t.indexOf("@")>0?"email":"string"}var Q="CompressionStream"in window;function $(t){return V(this,void 0,void 0,(function(){var n,e;return B(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),Q?(n=new ReadableStream({start:function(n){return V(this,void 0,void 0,(function(){return B(this,(function(e){return n.enqueue(t),n.close(),[2]}))}))}}).pipeThrough(new TextEncoderStream).pipeThrough(new window.CompressionStream("gzip")),e=Uint8Array.bind,[4,tt(n)]):[3,2];case 1:return[2,new(e.apply(Uint8Array,[void 0,r.sent()]))];case 2:return[3,4];case 3:return r.sent(),[3,4];case 4:return[2,null]}}))}))}function tt(t){return V(this,void 0,void 0,(function(){var n,e,r,o,a;return B(this,(function(i){switch(i.label){case 0:n=t.getReader(),e=[],r=!1,o=[],i.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return a=i.sent(),r=a.done,o=a.value,r?[2,e]:(e.push.apply(e,o),[3,1]);case 3:return[2,e]}}))}))}var nt=null;function et(t){try{if(!nt)return;var n=function(t){try{return JSON.parse(t)}catch(t){return[]}}(t);n.forEach((function(t){nt(t)}))}catch(t){}}var rt=[S,e,Object.freeze({__proto__:null,compute:G,get data(){return X},identify:J,reset:F,set:W,start:function(){F()},stop:function(){F()}}),n,S,r,o,t,R,L,S];function ot(){M={},O={},T(5),rt.forEach((function(t){return pn(t.start)()}))}function at(){rt.slice().reverse().forEach((function(t){return pn(t.stop)()})),M={},O={}}function it(){G(),Pt(),Et(0),Tt()}var ct,ut,st,lt,dt,ft,pt=0,ht=0,vt=null,gt=0;function mt(){lt=!0,pt=0,ht=0,gt=0,ct=[],ut=[],st={},dt=null}function yt(t,n){if(void 0===n&&(n=!0),lt){var e=u(),r=t.length>1?t[1]:null,o=JSON.stringify(t);switch(r){case 5:pt+=o.length;case 37:case 6:case 43:case 45:case 46:ht+=o.length,ct.push(o);break;default:ut.push(o)}T(25);var i=function(){var t=!1===a.lean&&pt>0?100:cn.sequence*a.delay;return"string"==typeof a.upload?Math.max(Math.min(t,3e4),100):a.delay}();e-gt>2*i&&(C(vt),vt=null),n&&null===vt&&(25!==r&&P(),vt=z(wt,i),gt=e,Mt(ht))}}function bt(){C(vt),wt(!0),pt=0,ht=0,gt=0,ct=[],ut=[],st={},dt=null,lt=!1}function wt(t){return void 0===t&&(t=!1),V(this,void 0,void 0,(function(){var n,e,r,o,i,c,u,s;return B(this,(function(l){switch(l.label){case 0:return vt=null,(n=!1===a.lean&&ht>0&&(ht<1048576||cn.sequence>0))&&j(1,1),it(),e=!0===t,r=JSON.stringify(ln(e)),o="[".concat(ut.join(),"]"),i=n?"[".concat(ct.join(),"]"):"",c=function(t){return t.p.length>0?'{"e":'.concat(t.e,',"a":').concat(t.a,',"p":').concat(t.p,"}"):'{"e":'.concat(t.e,',"a":').concat(t.a,"}")}({e:r,a:o,p:i}),e?(s=null,[3,3]):[3,1];case 1:return[4,$(c)];case 2:s=l.sent(),l.label=3;case 3:return x(2,(u=s)?u.length:c.length),kt(c,u,cn.sequence,e),ut=[],n&&(ct=[],ht=0,pt=0),[2]}}))}))}function kt(t,n,e,r){if(void 0===r&&(r=!1),"string"==typeof a.upload){var o=a.upload,i=!1;if(r&&"sendBeacon"in navigator)try{(i=navigator.sendBeacon.bind(navigator)(o,t))&&_t(e)}catch(t){}if(!1===i){e in st?st[e].attempts++:st[e]={data:t,attempts:1};var c=new XMLHttpRequest;c.open("POST",o,!0),c.timeout=15e3,c.ontimeout=function(){fn(new Error("".concat("Timeout"," : ").concat(o)))},null!==e&&(c.onreadystatechange=function(){pn(St)(c,e)}),c.withCredentials=!0,n?(c.setRequestHeader("Accept","application/x-clarity-gzip"),c.send(n)):c.send(t)}}else if(a.upload){(0,a.upload)(t),_t(e)}}function St(t,n){var e=st[n];t&&4===t.readyState&&e&&((t.status<200||t.status>208)&&e.attempts<=1?t.status>=400&&t.status<500?Ot(6):(0===t.status&&(a.upload=a.fallback?a.fallback:a.upload),kt(e.data,null,n)):(dt={sequence:n,attempts:e.attempts,status:t.status},e.attempts>1&&Et(2),200===t.status&&t.responseText&&function(t){for(var n=t&&t.length>0?t.split("\n"):[],e=0,r=n;e<r.length;e++){var o=r[e],i=o&&o.length>0?o.split(/ (.*)/):[""];switch(i[0]){case"END":Ot(6);break;case"UPGRADE":H("Auto");break;case"ACTION":a.action&&i.length>1&&a.action(i[1]);break;case"EXTRACT":i.length>1&&i[1];break;case"SIGNAL":i.length>1&&et(i[1])}}}(t.responseText),0===t.status&&(kt(e.data,null,n,!0),Ot(3)),t.status>=200&&t.status<=208&&_t(n),delete st[n]))}function _t(t){1===t&&(Yt(),Ft())}function Et(t){var n=[u(),t];switch(t){case 4:var e=g;e&&((n=[e.time,e.event]).push(e.data.visible),n.push(e.data.docWidth),n.push(e.data.docHeight),n.push(e.data.screenWidth),n.push(e.data.screenHeight),n.push(e.data.scrollX),n.push(e.data.scrollY),n.push(e.data.pointerX),n.push(e.data.pointerY),n.push(e.data.activityTime),n.push(e.data.scrollTime),yt(n,!1));break;case 25:n.push(I.gap),yt(n);break;case 35:n.push(ft.check),yt(n,!1);break;case 3:n.push(U.key),yt(n);break;case 2:n.push(dt.sequence),n.push(dt.attempts),n.push(dt.status),yt(n,!1);break;case 24:_.key&&n.push(_.key),n.push(_.value),yt(n);break;case 34:var r=Object.keys(X);if(r.length>0){for(var o=0,a=r;o<a.length;o++){var i=a[o];n.push(i),n.push(X[i])}F(),yt(n,!1)}break;case 0:var c=Object.keys(O);if(c.length>0){for(var s=0,l=c;s<l.length;s++){var d=l[s],f=parseInt(d,10);n.push(f),n.push(Math.round(O[d]))}O={},yt(n,!1)}break;case 1:var p=Object.keys(zt);if(p.length>0){for(var h=0,v=p;h<v.length;h++){var y=v[h];f=parseInt(y,10);n.push(f),n.push(zt[y])}Dt(),yt(n,!1)}break;case 36:var w=Object.keys(m);if(w.length>0){for(var k=0,S=w;k<S.length;k++){var E=S[k];f=parseInt(E,10);n.push(f),n.push([].concat.apply([],m[E]))}yt(n,!1)}break;case 40:b.forEach((function(t){n.push(t);var e=[];for(var r in m[t]){var o=parseInt(r,10);e.push(o),e.push(m[t][r])}n.push(e)})),yt(n,!1)}}function It(){ft={check:0}}function Mt(t){if(0===ft.check){var n=ft.check;n=cn.sequence>=128?1:n,n=cn.pageNum>=128?7:n,n=u()>72e5?2:n,(n=t>10485760?2:n)!==ft.check&&Ot(n)}}function Ot(t){ft.check=t,5!==t&&(Gt(),oe())}function Tt(){0!==ft.check&&Et(35)}function xt(){ft=null}var jt=null,zt=null,Ct=!1;function At(){jt={},zt={},Ct=!1}function qt(){jt={},zt={},Ct=!1}function Nt(t,n){if(n&&(n="".concat(n),t in jt||(jt[t]=[]),jt[t].indexOf(n)<0)){if(jt[t].length>128)return void(Ct||(Ct=!0,Ot(5)));jt[t].push(n),t in zt||(zt[t]=[]),zt[t].push(n)}}function Pt(){Et(1)}function Dt(){zt={},Ct=!1}function Rt(t){Nt(36,t.toString())}var Ut=null,Ht=[],Lt=0,Vt=null;function Bt(){var t,n,e;Vt=null;var r=navigator&&"userAgent"in navigator?navigator.userAgent:"",o=null!==(e=null===(n=null===(t=null===Intl||void 0===Intl?void 0:Intl.DateTimeFormat())||void 0===t?void 0:t.resolvedOptions())||void 0===n?void 0:n.timeZone)&&void 0!==e?e:"",i=(new Date).getTimezoneOffset().toString(),c=window.location.ancestorOrigins?Array.from(window.location.ancestorOrigins).toString():"",u=document&&document.title?document.title:"";Lt=r.indexOf("Electron")>0?1:0;var s,l=function(){var t={session:$t(),ts:Math.round(Date.now()),count:1,upgrade:null,upload:""},n=en("_clsk",!a.includeSubdomains);if(n){var e=n.split("|");e.length>=5&&t.ts-tn(e[1])<18e5&&(t.session=e[0],t.count=tn(e[2])+1,t.upgrade=tn(e[3]),t.upload=e.length>=6?"".concat("https://").concat(e[5],"/").concat(e[4]):"".concat("https://").concat(e[4]))}return t}(),d=nn(),f=a.projectId||function(t,n){void 0===n&&(n=null);for(var e,r=5381,o=r,a=0;a<t.length;a+=2)r=(r<<5)+r^t.charCodeAt(a),a+1<t.length&&(o=(o<<5)+o^t.charCodeAt(a+1));return e=Math.abs(r+11579*o),(n?e%Math.pow(2,n):e).toString(36)}(location.host);Ut={projectId:f,userId:d.id,sessionId:l.session,pageNum:l.count},a.lean=a.track&&null!==l.upgrade?0===l.upgrade:a.lean,a.upload=a.track&&"string"==typeof a.upload&&l.upload&&l.upload.length>"https://".length?l.upload:a.upload,Nt(0,r),Nt(3,u),Nt(1,h(location.href,!!Lt)),Nt(2,document.referrer),Nt(15,function(){var t=$t();if(a.track&&Kt(window,"sessionStorage")){var n=sessionStorage.getItem("_cltk");t=n||t,sessionStorage.setItem("_cltk",t)}return t}()),Nt(16,document.documentElement.lang),Nt(17,document.dir),Nt(26,"".concat(window.devicePixelRatio)),Nt(28,d.dob.toString()),Nt(29,d.version.toString()),Nt(33,c),Nt(34,o),Nt(35,i),j(0,l.ts),j(1,0),j(35,Lt),navigator&&(Nt(9,navigator.language),j(33,navigator.hardwareConcurrency),j(32,navigator.maxTouchPoints),j(34,Math.round(navigator.deviceMemory)),(s=navigator.userAgentData)&&s.getHighEntropyValues?s.getHighEntropyValues(["model","platform","platformVersion","uaFullVersion"]).then((function(t){var n;Nt(22,t.platform),Nt(23,t.platformVersion),null===(n=t.brands)||void 0===n||n.forEach((function(t){Nt(24,t.name+"~"+t.version)})),Nt(25,t.model),j(27,t.mobile?1:0)})):Nt(22,navigator.platform)),screen&&(j(14,Math.round(screen.width)),j(15,Math.round(screen.height)),j(16,Math.round(screen.colorDepth)));for(var p=0,v=a.cookies;p<v.length;p++){var g=v[p],m=en(g);m&&W(g,m)}!function(t){Rt(t?1:0)}(a.track),Qt(d)}function Xt(){Vt=null,Ut=null,Ht.forEach((function(t){t.called=!1}))}function Wt(t,n,e){void 0===n&&(n=!0),void 0===e&&(e=!1);var r=a.lean?0:1,o=!1;Ut&&(r||!1===n)&&(t(Ut,!a.lean),o=!0),!e&&o||Ht.push({callback:t,wait:n,recall:e,called:o})}function Jt(){return Ut?[Ut.userId,Ut.sessionId,Ut.pageNum].join("."):""}function Zt(t){if(void 0===t&&(t=!0),!t)return a.track=!1,on("_clsk","",-Number.MAX_VALUE),on("_clck","",-Number.MAX_VALUE),oe(),void window.setTimeout(re,250);Nn()&&(a.track=!0,Qt(nn(),1),Yt(),Rt(2))}function Gt(){on("_clsk","",0)}function Ft(){!function(t){if(Ht.length>0)for(var n=0;n<Ht.length;n++){var e=Ht[n];!e.callback||e.called||e.wait&&!t||(e.callback(Ut,!a.lean),e.called=!0,e.recall||(Ht.splice(n,1),n--))}}(a.lean?0:1)}function Yt(){if(Ut){var t=Math.round(Date.now()),n=a.upload&&"string"==typeof a.upload?a.upload.replace("https://",""):"",e=a.lean?0:1;on("_clsk",[Ut.sessionId,t,Ut.pageNum,e,n].join("|"),1)}}function Kt(t,n){try{return!!t[n]}catch(t){return!1}}function Qt(t,n){void 0===n&&(n=null),n=null===n?t.consent:n;var e=Math.ceil((Date.now()+31536e6)/864e5),r=0===t.dob?null===a.dob?0:a.dob:t.dob;(null===t.expiry||Math.abs(e-t.expiry)>=1||t.consent!==n||t.dob!==r)&&on("_clck",[Ut.userId,2,e.toString(36),n,r].join("|"),365)}function $t(){var t=Math.floor(Math.random()*Math.pow(2,32));return window&&window.crypto&&window.crypto.getRandomValues&&Uint32Array&&(t=window.crypto.getRandomValues(new Uint32Array(1))[0]),t.toString(36)}function tn(t,n){return void 0===n&&(n=10),parseInt(t,n)}function nn(){var t={id:$t(),version:0,expiry:null,consent:0,dob:0},n=en("_clck",!a.includeSubdomains);if(n&&n.length>0){for(var e=n.split("|"),r=0,o=0,i=document.cookie.split(";");o<i.length;o++){r+="_clck"===i[o].split("=")[0].trim()?1:0}if(1===e.length||r>1){var c="".concat(";").concat("expires=").concat(new Date(0).toUTCString()).concat(";path=/");document.cookie="".concat("_clck","=").concat(c),document.cookie="".concat("_clsk","=").concat(c)}e.length>1&&(t.version=tn(e[1])),e.length>2&&(t.expiry=tn(e[2],36)),e.length>3&&1===tn(e[3])&&(t.consent=1),e.length>4&&tn(e[1])>1&&(t.dob=tn(e[4])),a.track=a.track||1===t.consent,t.id=a.track?e[0]:t.id}return t}function en(t,n){var e;if(void 0===n&&(n=!1),Kt(document,"cookie")){var r=document.cookie.split(";");if(r)for(var o=0;o<r.length;o++){var a=r[o].split("=");if(a.length>1&&a[0]&&a[0].trim()===t){for(var i=rn(a[1]),c=i[0],u=i[1];c;)c=(e=rn(u))[0],u=e[1];return n?u.endsWith("".concat("~","1"))?u.substring(0,u.length-2):null:u}}}return null}function rn(t){try{var n=decodeURIComponent(t);return[n!=t,n]}catch(t){}return[!1,t]}function on(t,n,e){if((a.track||""==n)&&(navigator&&navigator.cookieEnabled||Kt(document,"cookie"))){var r=function(t){return encodeURIComponent(t)}(n),o=new Date;o.setDate(o.getDate()+e);var i=o?"expires="+o.toUTCString():"",c="".concat(t,"=").concat(r).concat(";").concat(i).concat(";path=/");try{if(null===Vt){for(var u=location.hostname?location.hostname.split("."):[],s=u.length-1;s>=0;s--)if(Vt=".".concat(u[s]).concat(Vt||""),s<u.length-1&&(document.cookie="".concat(c).concat(";").concat("domain=").concat(Vt),en(t)===n))return;Vt=""}}catch(t){Vt=""}document.cookie=Vt?"".concat(c).concat(";").concat("domain=").concat(Vt):c}}var an,cn=null;function un(){var t=Ut;cn={version:s,sequence:0,start:0,duration:0,projectId:t.projectId,userId:t.userId,sessionId:t.sessionId,pageNum:t.pageNum,upload:0,end:0,applicationPlatform:0,url:""}}function sn(){cn=null}function ln(t){return cn.start=cn.start+cn.duration,cn.duration=u()-cn.start,cn.sequence++,cn.upload=t&&"sendBeacon"in navigator?1:0,cn.end=t?1:0,cn.applicationPlatform=0,cn.url=h(location.href,!1,!0),[cn.version,cn.sequence,cn.start,cn.duration,cn.projectId,cn.userId,cn.sessionId,cn.pageNum,cn.upload,cn.end,cn.applicationPlatform,cn.url]}function dn(){an=[]}function fn(t){if(an&&-1===an.indexOf(t.message)){var n=a.report;if(n&&n.length>0){var e={v:cn.version,p:cn.projectId,u:cn.userId,s:cn.sessionId,n:cn.pageNum};t.message&&(e.m=t.message),t.stack&&(e.e=t.stack);var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(JSON.stringify(e)),an.push(t.message)}}return t}function pn(t){return function(){var n=performance.now();try{t.apply(this,arguments)}catch(t){throw fn(t)}var e=performance.now()-n;x(4,e),e>30&&(T(7),j(6,e),"".concat(t.dn||t.name,"-").concat(e))}}var hn=[];function vn(t,n,e,r){void 0===r&&(r=!1),e=pn(e);try{t[i("addEventListener")](n,e,r),hn.push({event:n,target:t,listener:e,capture:r})}catch(t){}}function gn(){for(var t=0,n=hn;t<n.length;t++){var e=n[t];try{e.target[i("removeEventListener")](e.event,e.listener,e.capture)}catch(t){}}hn=[]}var mn=null,yn=null,bn=null,wn=0;function kn(){return!(wn++>20)}function Sn(){wn=0,bn!==En()&&(oe(),window.setTimeout(_n,250))}function _n(){re(),j(29,1)}function En(){return location.href?location.href.replace(location.hash,""):location.href}Sn.dn=1;var In=[],Mn=null,On=null,Tn=null;function xn(){On&&(Tn(),On=null,null===Mn&&zn())}function jn(){In=[],Mn=null,On=null}function zn(){var t=In.shift();t&&(Mn=t,t.task().then((function(){t.id===Jt()&&(t.resolve(),Mn=null,zn())})).catch((function(n){t.id===Jt()&&(n&&(n.name,n.message,n.stack),Mn=null,zn())})))}var Cn=!1;function An(){Cn=!0,c=performance.now()+performance.timeOrigin,jn(),gn(),dn(),bn=En(),wn=0,vn(window,"popstate",Sn),null===mn&&(mn=history.pushState,history.pushState=function(){mn.apply(this,arguments),Nn()&&kn()&&Sn()}),null===yn&&(yn=history.replaceState,history.replaceState=function(){yn.apply(this,arguments),Nn()&&kn()&&Sn()})}function qn(){bn=null,wn=0,dn(),gn(),jn(),c=0,Cn=!1}function Nn(){return Cn}function Pn(){re(),E("clarity","restart")}Pn.dn=2;var Dn=null;function Rn(){Dn=null}function Un(t){Dn={fetchStart:Math.round(t.fetchStart),connectStart:Math.round(t.connectStart),connectEnd:Math.round(t.connectEnd),requestStart:Math.round(t.requestStart),responseStart:Math.round(t.responseStart),responseEnd:Math.round(t.responseEnd),domInteractive:Math.round(t.domInteractive),domComplete:Math.round(t.domComplete),loadEventStart:Math.round(t.loadEventStart),loadEventEnd:Math.round(t.loadEventEnd),redirectCount:Math.round(t.redirectCount),size:t.transferSize?t.transferSize:0,type:t.type,protocol:t.nextHopProtocol,encodedSize:t.encodedBodySize?t.encodedBodySize:0,decodedSize:t.decodedBodySize?t.decodedBodySize:0},function(t){V(this,void 0,void 0,(function(){var n,e;return B(this,(function(r){return n=u(),e=[n,t],29===t&&(e.push(Dn.fetchStart),e.push(Dn.connectStart),e.push(Dn.connectEnd),e.push(Dn.requestStart),e.push(Dn.responseStart),e.push(Dn.responseEnd),e.push(Dn.domInteractive),e.push(Dn.domComplete),e.push(Dn.loadEventStart),e.push(Dn.loadEventEnd),e.push(Dn.redirectCount),e.push(Dn.size),e.push(Dn.type),e.push(Dn.protocol),e.push(Dn.encodedSize),e.push(Dn.decodedSize),Rn(),yt(e)),[2]}))}))}(29)}var Hn,Ln=0,Vn=1/0,Bn=0,Xn=0,Wn=[],Jn=new Map,Zn=function(){return Ln||0},Gn=function(){if(!Wn.length)return-1;var t=Math.min(Wn.length-1,Math.floor((Zn()-Xn)/50));return Wn[t].latency},Fn=function(){Xn=Zn(),Wn.length=0,Jn.clear()},Yn=function(t){if(t.interactionId&&!(t.duration<40)){!function(t){"interactionCount"in performance?Ln=performance.interactionCount:t.interactionId&&(Vn=Math.min(Vn,t.interactionId),Bn=Math.max(Bn,t.interactionId),Ln=Bn?(Bn-Vn)/7+1:0)}(t);var n=Wn[Wn.length-1],e=Jn.get(t.interactionId);if(e||Wn.length<10||t.duration>(null==n?void 0:n.latency)){if(e)t.duration>e.latency&&(e.latency=t.duration);else{var r={id:t.interactionId,latency:t.duration};Jn.set(r.id,r),Wn.push(r)}Wn.sort((function(t,n){return n.latency-t.latency})),Wn.length>10&&Wn.splice(10).forEach((function(t){return Jn.delete(t.id)}))}}},Kn=["navigation","resource","longtask","first-input","layout-shift","largest-contentful-paint","event"];function Qn(){try{Hn&&Hn.disconnect(),Hn=new PerformanceObserver(pn($n));for(var t=0,n=Kn;t<n.length;t++){var e=n[t];PerformanceObserver.supportedEntryTypes.indexOf(e)>=0&&("layout-shift"===e&&x(9,0),Hn.observe({type:e,buffered:!0}))}}catch(t){}}function $n(t){!function(t){for(var n=(!("visibilityState"in document)||"visible"===document.visibilityState),e=0;e<t.length;e++){var r=t[e];switch(r.entryType){case"navigation":Un(r);break;case"resource":var o=r.name;Nt(4,te(o)),o!==a.upload&&o!==a.fallback||j(28,r.duration);break;case"longtask":T(7);break;case"first-input":n&&j(10,r.processingStart-r.startTime);break;case"event":n&&"PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&(Yn(r),Nt(37,Gn().toString()));break;case"layout-shift":n&&!r.hadRecentInput&&x(9,1e3*r.value);break;case"largest-contentful-paint":n&&j(8,r.startTime)}}}(t.getEntries())}function te(t){var n=document.createElement("a");return n.href=t,n.host}function ne(){Rn(),function(){navigator&&"connection"in navigator&&Nt(27,navigator.connection.effectiveType),window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&("complete"!==document.readyState?vn(window,"load",z.bind(this,Qn,0)):Qn())}()}Qn.dn=26,$n.dn=27,ne.dn=25;var ee=[S,S,S,Object.freeze({__proto__:null,start:ne,stop:function(){Hn&&Hn.disconnect(),Hn=null,Fn(),Rn()}})];function re(t){void 0===t&&(t=null),function(){try{var t=navigator&&"globalPrivacyControl"in navigator&&1==navigator.globalPrivacyControl;return!1===Cn&&"undefined"!=typeof Promise&&window.MutationObserver&&document.createTreeWalker&&"now"in Date&&"now"in performance&&"undefined"!=typeof WeakMap&&!t}catch(t){return!1}}()&&(!function(t){if(null===t||Cn)return!1;for(var n in t)n in a&&(a[n]=t[n])}(t),An(),ot(),ee.forEach((function(t){return pn(t.start)()})),null===t&&ue())}function oe(){Nn()&&(ee.slice().reverse().forEach((function(t){return pn(t.stop)()})),at(),qn(),void 0!==ie&&(ie[ce]=function(){(ie[ce].q=ie[ce].q||[]).push(arguments),"start"===arguments[0]&&ie[ce].q.unshift(ie[ce].q.pop())&&ue()}))}var ae=Object.freeze({__proto__:null,consent:Zt,event:E,hashText:w,identify:J,metadata:Wt,pause:function(){Nn()&&(E("clarity","pause"),null===On&&(On=new Promise((function(t){Tn=t}))))},resume:function(){Nn()&&(xn(),E("clarity","resume"))},set:W,signal:function(t){nt=t},start:re,stop:oe,upgrade:H,version:s}),ie=window,ce="clarity";function ue(){if(void 0!==ie){if(ie[ce]&&ie[ce].v)return console.warn("Error CL001: Multiple Clarity tags detected.");var t=ie[ce]&&ie[ce].q||[];for(ie[ce]=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return ae[t].apply(ae,n)},ie[ce].v=s;t.length>0;)ie[ce].apply(ie,t.shift())}}ue()}();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clarity-js",
3
- "version": "0.7.62",
3
+ "version": "0.7.64",
4
4
  "description": "An analytics library that uses web page interactions to generate aggregated insights",
5
5
  "author": "Microsoft Corp.",
6
6
  "license": "MIT",
@@ -22,8 +22,11 @@ let config: Config = {
22
22
  delayDom: false,
23
23
  throttleDom: true,
24
24
  conversions: false,
25
- longTask: 30,
26
25
  includeSubdomains: true,
26
+ throttleMutations: false,
27
+ dropMutations: false,
28
+ criticalMs: 200,
29
+ discard: [],
27
30
  };
28
31
 
29
32
  export default config;
@@ -1,8 +1,7 @@
1
- import { Code, Metric, Severity } from "@clarity-types/data";
1
+ import { Code, Metric, Setting, Severity } from "@clarity-types/data";
2
2
  import { report } from "@src/core/report";
3
3
  import * as metric from "@src/data/metric";
4
4
  import * as internal from "@src/diagnostic/internal";
5
- import config from "./config";
6
5
 
7
6
  // tslint:disable-next-line: ban-types
8
7
  export default function (method: Function): Function {
@@ -11,7 +10,7 @@ export default function (method: Function): Function {
11
10
  try { method.apply(this, arguments); } catch (ex) { throw report(ex); }
12
11
  let duration = performance.now() - start;
13
12
  metric.sum(Metric.TotalCost, duration);
14
- if (duration > config.longTask) {
13
+ if (duration > Setting.LongTask) {
15
14
  metric.count(Metric.LongTaskCount);
16
15
  metric.max(Metric.ThreadBlockedTime, duration);
17
16
  internal.log(Code.FunctionExecutionTime, Severity.Info, `${method.dn || method.name}-${duration}`);
package/src/core/task.ts CHANGED
@@ -1,10 +1,9 @@
1
1
  import { AsyncTask, Priority, RequestIdleCallbackDeadline, RequestIdleCallbackOptions, Task, Timer } from "@clarity-types/core";
2
2
  import { TaskFunction, TaskResolve, Tasks } from "@clarity-types/core";
3
- import { Code, Metric, Severity } from "@clarity-types/data";
3
+ import { Code, Metric, Setting, Severity } from "@clarity-types/data";
4
4
  import * as metadata from "@src/data/metadata";
5
5
  import * as metric from "@src/data/metric";
6
6
  import * as internal from "@src/diagnostic/internal";
7
- import config from "./config";
8
7
 
9
8
  // Track the start time to be able to compute duration at the end of the task
10
9
  const idleTimeout = 5000;
@@ -93,7 +92,7 @@ export function state(timer: Timer): Task {
93
92
  }
94
93
 
95
94
  export function start(timer: Timer): void {
96
- tracker[key(timer)] = { start: performance.now(), calls: 0, yield: config.longTask };
95
+ tracker[key(timer)] = { start: performance.now(), calls: 0, yield: Setting.LongTask };
97
96
  }
98
97
 
99
98
  function restart(timer: Timer): void {
@@ -165,13 +164,13 @@ function requestIdleCallbackPolyfill(callback: (deadline: RequestIdleCallbackDea
165
164
  let currentTime = performance.now();
166
165
  let elapsed = currentTime - startTime;
167
166
  let duration = currentTime - event.data;
168
- if (duration > config.longTask && elapsed < options.timeout) {
167
+ if (duration > Setting.LongTask && elapsed < options.timeout) {
169
168
  requestAnimationFrame((): void => { outgoing.postMessage(currentTime); });
170
169
  } else {
171
170
  let didTimeout = elapsed > options.timeout;
172
171
  callback({
173
172
  didTimeout,
174
- timeRemaining: (): number => didTimeout ? config.longTask : Math.max(0, config.longTask - duration)
173
+ timeRemaining: (): number => didTimeout ? Setting.LongTask : Math.max(0, Setting.LongTask - duration)
175
174
  });
176
175
  }
177
176
  };
@@ -1,2 +1,2 @@
1
- let version = "0.7.58";
1
+ let version = "0.7.64";
2
2
  export default version;
package/src/layout/dom.ts CHANGED
@@ -89,7 +89,7 @@ export function add(node: Node, parent: Node, data: NodeInfo, source: Source): v
89
89
  let parentId = parent ? getId(parent) : null;
90
90
 
91
91
  // Do not add detached nodes
92
- if ((!parent || !parentId) && (node as ShadowRoot).host == null) {
92
+ if ((!parent || !parentId) && (node as ShadowRoot).host == null && node.nodeType !== Node.DOCUMENT_TYPE_NODE) {
93
93
  return;
94
94
  }
95
95
 
@@ -34,6 +34,7 @@ let timeout: number = null;
34
34
  let throttleDelay: number = null;
35
35
  let activePeriod = null;
36
36
  let history: MutationHistory = {};
37
+ let criticalPeriod = null;
37
38
 
38
39
  export function start(): void {
39
40
  observers = [];
@@ -41,6 +42,7 @@ export function start(): void {
41
42
  timeout = null;
42
43
  activePeriod = 0;
43
44
  history = {};
45
+ criticalPeriod = 0;
44
46
 
45
47
  // Some popular open source libraries, like styled-components, optimize performance
46
48
  // by injecting CSS using insertRule API vs. appending text node. A side effect of
@@ -126,10 +128,12 @@ export function stop(): void {
126
128
  queue = [];
127
129
  activePeriod = 0;
128
130
  timeout = null;
131
+ criticalPeriod = 0;
129
132
  }
130
133
 
131
134
  export function active(): void {
132
135
  activePeriod = time() + Setting.MutationActivePeriod;
136
+ criticalPeriod = time() + config.criticalMs;
133
137
  }
134
138
 
135
139
  function handle(m: MutationRecord[]): void {
@@ -223,9 +227,16 @@ function track(m: MutationRecord, timer: Timer, instance: number, timestamp: num
223
227
  if (value && value.data.tag !== Constant.HTML) {
224
228
  // calculate inactive period based on the timestamp of the mutation not when the mutation is processed
225
229
  let inactive = timestamp > activePeriod;
230
+ // Calculate critical period based on when mutation is processed
231
+ const critical = instance < criticalPeriod;
226
232
  let target = dom.get(m.target);
227
233
  let element = target && target.selector ? target.selector.join() : m.target.nodeName;
228
234
  let parent = value.selector ? value.selector.join() : Constant.Empty;
235
+ // Check if its a low priority (e.g., ads related) element mutation happening during critical period
236
+ // If the discard list is empty, we discard all mutations during critical period
237
+ const lowPriMutation =
238
+ config.throttleMutations && critical &&
239
+ (config.discard.length === 0 || config.discard.some((key) => element.includes(key)));
229
240
  // We use selector, instead of id, to determine the key (signature for the mutation) because in some cases
230
241
  // repeated mutations can cause elements to be destroyed and then recreated as new DOM nodes
231
242
  // In those cases, IDs will change however the selector (which is relative to DOM xPath) remains the same
@@ -235,19 +246,24 @@ function track(m: MutationRecord, timer: Timer, instance: number, timestamp: num
235
246
  let h = history[key];
236
247
  // Lookup any pending nodes queued up for removal, and process them now if we suspended a mutation before
237
248
  if (inactive === false && h[0] >= Setting.MutationSuspendThreshold) { processNodeList(h[2], Source.ChildListRemove, timer, timestamp); }
238
- // Update the counter
239
- h[0] = inactive ? (h[1] === instance ? h[0] : h[0] + 1) : 1;
249
+
250
+ // Update the counter, do not reset counter if its critical period
251
+ h[0] = inactive || lowPriMutation ? (h[1] === instance ? h[0] : h[0] + 1) : 1;
240
252
  h[1] = instance;
241
- // Return updated mutation type based on if we have already hit the threshold or not
242
- if (h[0] >= Setting.MutationSuspendThreshold) {
253
+ // Return updated mutation type based on,
254
+ // 1. if we have already hit the threshold or not
255
+ // 2. if its a low priority mutation happening during critical time period
256
+ if (h[0] >= Setting.MutationSuspendThreshold || lowPriMutation) {
243
257
  // Store a reference to removedNodes so we can process them later
244
258
  // when we resume mutations again on user interactions
245
259
  h[2] = m.removedNodes;
246
260
  if (instance > timestamp + Setting.MutationActivePeriod) {
247
261
  return m.type;
248
262
  }
249
- // we only store the most recent mutation for a given key if it is being throttled
250
- throttledMutations[key] = {mutation: m, timestamp};
263
+ if (!config.dropMutations) {
264
+ // we only store the most recent mutation for a given key if it is being throttled
265
+ throttledMutations[key] = {mutation: m, timestamp};
266
+ }
251
267
  return Constant.Throttle;
252
268
  }
253
269
  }
@@ -263,13 +279,14 @@ function names(nodes: NodeList): string {
263
279
  async function processNodeList(list: NodeList, source: Source, timer: Timer, timestamp: number): Promise<void> {
264
280
  let length = list ? list.length : 0;
265
281
  for (let i = 0; i < length; i++) {
282
+ const node = list[i];
266
283
  if (source === Source.ChildListAdd) {
267
- traverse(list[i], timer, source, timestamp);
284
+ traverse(node, timer, source, timestamp);
268
285
  } else {
269
286
  let state = task.state(timer);
270
287
  if (state === Task.Wait) { state = await task.suspend(timer); }
271
288
  if (state === Task.Stop) { break; }
272
- processNode(list[i], source, timestamp);
289
+ processNode(node, source, timestamp);
273
290
  }
274
291
  }
275
292
  }
package/types/core.d.ts CHANGED
@@ -136,8 +136,11 @@ export interface Config {
136
136
  delayDom?: boolean;
137
137
  throttleDom?: boolean;
138
138
  conversions?: boolean;
139
- longTask?: number;
140
139
  includeSubdomains?: boolean;
140
+ throttleMutations?: boolean;
141
+ dropMutations?: boolean;
142
+ criticalMs?: number;
143
+ discard?: string[];
141
144
  }
142
145
 
143
146
  export const enum Constant {
package/types/data.d.ts CHANGED
@@ -255,7 +255,8 @@ export const enum Setting {
255
255
  MaxUploadDelay = 30 * Time.Second, // Do flush out payload once every 30s,
256
256
  ExtractLimit = 10000, // Do not extract more than 10000 characters
257
257
  ChecksumPrecision = 28, // n-bit integer to represent token hash
258
- UploadTimeout = 15000 // Timeout in ms for XHR requests
258
+ UploadTimeout = 15000, // Timeout in ms for XHR requests
259
+ LongTask = 30, // Long Task threshold in ms
259
260
  }
260
261
 
261
262
  export const enum Character {