mixpanel-browser 2.54.0 → 2.54.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ **2.54.1** (30 Jul 2024)
2
+ - Fixes and improvements for user-idleness detection in session recording
3
+
1
4
  **2.54.0** (23 Jul 2024)
2
5
  - Provides optional builds without session recording module and without asynchronous script loading.
3
6
  - Integrates request batcher with session recording module for increased reliability.
@@ -2,7 +2,7 @@
2
2
 
3
3
  var Config = {
4
4
  DEBUG: false,
5
- LIB_VERSION: '2.54.0'
5
+ LIB_VERSION: '2.54.1'
6
6
  };
7
7
 
8
8
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -2422,7 +2422,11 @@ RequestBatcher.prototype.resetFlush = function() {
2422
2422
  RequestBatcher.prototype.scheduleFlush = function(flushMS) {
2423
2423
  this.flushInterval = flushMS;
2424
2424
  if (!this.stopped) { // don't schedule anymore if batching has been stopped
2425
- this.timeoutID = setTimeout(_.bind(this.flush, this), this.flushInterval);
2425
+ this.timeoutID = setTimeout(_.bind(function() {
2426
+ if (!this.stopped) {
2427
+ this.flush();
2428
+ }
2429
+ }, this), this.flushInterval);
2426
2430
  }
2427
2431
  };
2428
2432
 
@@ -4510,7 +4510,7 @@
4510
4510
 
4511
4511
  var Config = {
4512
4512
  DEBUG: false,
4513
- LIB_VERSION: '2.54.0'
4513
+ LIB_VERSION: '2.54.1'
4514
4514
  };
4515
4515
 
4516
4516
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -6917,7 +6917,11 @@
6917
6917
  RequestBatcher.prototype.scheduleFlush = function(flushMS) {
6918
6918
  this.flushInterval = flushMS;
6919
6919
  if (!this.stopped) { // don't schedule anymore if batching has been stopped
6920
- this.timeoutID = setTimeout(_.bind(this.flush, this), this.flushInterval);
6920
+ this.timeoutID = setTimeout(_.bind(function() {
6921
+ if (!this.stopped) {
6922
+ this.flush();
6923
+ }
6924
+ }, this), this.flushInterval);
6921
6925
  }
6922
6926
  };
6923
6927
 
@@ -7146,7 +7150,7 @@
7146
7150
  ]);
7147
7151
 
7148
7152
  function isUserEvent(ev) {
7149
- return ev.type === EventType.IncrementalSnapshot && ACTIVE_SOURCES.has(ev.source);
7153
+ return ev.type === EventType.IncrementalSnapshot && ACTIVE_SOURCES.has(ev.data.source);
7150
7154
  }
7151
7155
 
7152
7156
  var MixpanelRecorder = function(mixpanelInstance) {
@@ -7184,7 +7188,7 @@
7184
7188
  return this._mixpanel.get_config(configVar);
7185
7189
  };
7186
7190
 
7187
- MixpanelRecorder.prototype.startRecording = function () {
7191
+ MixpanelRecorder.prototype.startRecording = function (shouldStopBatcher) {
7188
7192
  if (this._stopRecording !== null) {
7189
7193
  logger.log('Recording already in progress, skipping startRecording.');
7190
7194
  return;
@@ -7202,7 +7206,14 @@
7202
7206
 
7203
7207
  this.replayId = _.UUID();
7204
7208
 
7205
- this.batcher.start();
7209
+ if (shouldStopBatcher) {
7210
+ // this is the case when we're starting recording after a reset
7211
+ // and don't want to send anything over the network until there's
7212
+ // actual user activity
7213
+ this.batcher.stop();
7214
+ } else {
7215
+ this.batcher.start();
7216
+ }
7206
7217
 
7207
7218
  var resetIdleTimeout = _.bind(function () {
7208
7219
  clearTimeout(this.idleTimeoutId);
@@ -7216,6 +7227,10 @@
7216
7227
  'emit': _.bind(function (ev) {
7217
7228
  this.batcher.enqueue(ev);
7218
7229
  if (isUserEvent(ev)) {
7230
+ if (this.batcher.stopped) {
7231
+ // start flushing again after user activity
7232
+ this.batcher.start();
7233
+ }
7219
7234
  resetIdleTimeout();
7220
7235
  }
7221
7236
  }, this),
@@ -7235,7 +7250,7 @@
7235
7250
 
7236
7251
  MixpanelRecorder.prototype.resetRecording = function () {
7237
7252
  this.stopRecording();
7238
- this.startRecording();
7253
+ this.startRecording(true);
7239
7254
  };
7240
7255
 
7241
7256
  MixpanelRecorder.prototype.stopRecording = function () {
@@ -7244,7 +7259,14 @@
7244
7259
  this._stopRecording = null;
7245
7260
  }
7246
7261
 
7247
- this.batcher.flush(); // flush any remaining events
7262
+ if (this.batcher.stopped) {
7263
+ // never got user activity to flush after reset, so just clear the batcher
7264
+ this.batcher.clear();
7265
+ } else {
7266
+ // flush any remaining events from running batcher
7267
+ this.batcher.flush();
7268
+ this.batcher.stop();
7269
+ }
7248
7270
  this.replayId = null;
7249
7271
 
7250
7272
  clearTimeout(this.idleTimeoutId);
@@ -29,10 +29,10 @@ or you can use record.mirror to access the mirror instance during recording.`;le
29
29
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
30
30
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
31
31
  PERFORMANCE OF THIS SOFTWARE.
32
- ***************************************************************************** */function e(c,u,f,m){function h(g){return g instanceof f?g:new f(function(p){p(g)})}return new(f||(f=Promise))(function(g,p){function y(v){try{S(m.next(v))}catch(b){p(b)}}function w(v){try{S(m.throw(v))}catch(b){p(b)}}function S(v){v.done?g(v.value):h(v.value).then(y,w)}S((m=m.apply(c,u||[])).next())})}for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=typeof Uint8Array>"u"?[]:new Uint8Array(256),n=0;n<t.length;n++)r[t.charCodeAt(n)]=n;var i=function(c){var u=new Uint8Array(c),f,m=u.length,h="";for(f=0;f<m;f+=3)h+=t[u[f]>>2],h+=t[(u[f]&3)<<4|u[f+1]>>4],h+=t[(u[f+1]&15)<<2|u[f+2]>>6],h+=t[u[f+2]&63];return m%3===2?h=h.substring(0,h.length-1)+"=":m%3===1&&(h=h.substring(0,h.length-2)+"=="),h};const o=new Map,a=new Map;function l(c,u,f){return e(this,void 0,void 0,function*(){const m=`${c}-${u}`;if("OffscreenCanvas"in globalThis){if(a.has(m))return a.get(m);const h=new OffscreenCanvas(c,u);h.getContext("2d");const p=yield(yield h.convertToBlob(f)).arrayBuffer(),y=i(p);return a.set(m,y),y}else return""})}const s=self;s.onmessage=function(c){return e(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:u,bitmap:f,width:m,height:h,dataURLOptions:g}=c.data,p=l(m,h,g),y=new OffscreenCanvas(m,h);y.getContext("2d").drawImage(f,0,0),f.close();const S=yield y.convertToBlob(g),v=S.type,b=yield S.arrayBuffer(),I=i(b);if(!o.has(u)&&(yield p)===I)return o.set(u,I),s.postMessage({id:u});if(o.get(u)===I)return s.postMessage({id:u});s.postMessage({id:u,type:v,base64:I,width:m,height:h}),o.set(u,I)}else return s.postMessage({id:c.data.id})})}})()},null);class Tn{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(s,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(s)||this.pendingCanvasMutations.set(s,[]),this.pendingCanvasMutations.get(s).push(c)};const{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:a,dataURLOptions:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,i,o),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:l})}initCanvasFPSObserver(t,r,n,i,o){const a=Zt(r,n,i,!0),l=new Map,s=new Rn;s.onmessage=g=>{const{id:p}=g.data;if(l.set(p,!1),!("base64"in g.data))return;const{base64:y,type:w,width:S,height:v}=g.data;this.mutationCb({id:p,type:ye["2D"],commands:[{property:"clearRect",args:[0,0,S,v]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:w}]},0,0]}]})};const c=1e3/t;let u=0,f;const m=()=>{const g=[];return r.document.querySelectorAll("canvas").forEach(p=>{U(p,n,i,!0)||g.push(p)}),g},h=g=>{if(u&&g-u<c){f=requestAnimationFrame(h);return}u=g,m().forEach(p=>bn(this,void 0,void 0,function*(){var y;const w=this.mirror.getId(p);if(l.get(w)||p.width===0||p.height===0)return;if(l.set(w,!0),["webgl","webgl2"].includes(p.__context)){const v=p.getContext(p.__context);((y=v?.getContextAttributes())===null||y===void 0?void 0:y.preserveDrawingBuffer)===!1&&v.clear(v.COLOR_BUFFER_BIT)}const S=yield createImageBitmap(p);s.postMessage({id:w,bitmap:S,width:p.width,height:p.height,dataURLOptions:o.dataURLOptions},[S])})),f=requestAnimationFrame(h)};f=requestAnimationFrame(h),this.resetObservers=()=>{a(),cancelAnimationFrame(f)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=Zt(t,r,n,!1),o=Cn(this.processMutation.bind(this),t,r,n),a=On(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const i=n.map(a=>Sn(a,["type"])),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class Dn{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Kr,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},i=[];for(const o of t){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),i.push({styleId:a,rules:Array.from(o.rules||CSSRule,(l,s)=>({rule:St(l),index:s}))})),n.styleIds.push(a)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Nn{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function L(e){return Object.assign(Object.assign({},e),{timestamp:Le()})}let N,ze,lt,He=!1;const V=_r();function Oe(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:f,maskInputOptions:m,slimDOMOptions:h,maskInputFn:g,maskTextFn:p,hooks:y,packFn:w,sampling:S={},dataURLOptions:v={},mousemoveWait:b,recordDOM:I=!0,recordCanvas:B=!1,recordCrossOriginIframes:F=!1,recordAfter:x=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:R=!1,collectFonts:j=!1,inlineImages:G=!1,plugins:E,keepIframeSrcFn:le=()=>!1,ignoreCSSAttributes:z=new Set([]),errorHandler:ne}=e;tn(ne);const Z=F?window.parent===window:!0;let Qe=!1;if(!Z)try{window.parent.document&&(Qe=!1)}catch{Qe=!0}if(Z&&!t)throw new Error("emit function is required");b!==void 0&&S.mousemove===void 0&&(S.mousemove=b),V.reset();const pt=f===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:m!==void 0?m:{password:!0},mt=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};Xr();let mr,gt=0;const gr=M=>{for(const K of E||[])K.eventProcessor&&(M=K.eventProcessor(M));return w&&!Qe&&(M=w(M)),M};N=(M,K)=>{var D;if(!((D=oe[0])===null||D===void 0)&&D.isFrozen()&&M.type!==O.FullSnapshot&&!(M.type===O.IncrementalSnapshot&&M.data.source===C.Mutation)&&oe.forEach(H=>H.unfreeze()),Z)t?.(gr(M),K);else if(Qe){const H={type:"rrweb",event:gr(M),origin:window.location.origin,isCheckout:K};window.parent.postMessage(H,"*")}if(M.type===O.FullSnapshot)mr=M,gt=0;else if(M.type===O.IncrementalSnapshot){if(M.data.source===C.Mutation&&M.data.isAttachIframe)return;gt++;const H=n&&gt>=n,de=r&&M.timestamp-mr.timestamp>r;(H||de)&&ze(!0)}};const Ze=M=>{N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Mutation},M)}))},yr=M=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Scroll},M)})),vr=M=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.CanvasMutation},M)})),ei=M=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.AdoptedStyleSheet},M)})),ue=new Dn({mutationCb:Ze,adoptedStyleSheetCb:ei}),ce=new yn({mirror:V,mutationCb:Ze,stylesheetManager:ue,recordCrossOriginIframes:F,wrappedEmit:N});for(const M of E||[])M.getMirror&&M.getMirror({nodeMirror:V,crossOriginIframeMirror:ce.crossOriginIframeMirror,crossOriginIframeStyleMirror:ce.crossOriginIframeStyleMirror});const yt=new Nn;lt=new Tn({recordCanvas:B,mutationCb:vr,win:window,blockClass:i,blockSelector:o,mirror:V,sampling:S.canvas,dataURLOptions:v});const et=new vn({mutationCb:Ze,scrollCb:yr,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:pt,dataURLOptions:v,maskTextFn:p,maskInputFn:g,recordCanvas:B,inlineImages:G,sampling:S,slimDOMOptions:mt,iframeManager:ce,stylesheetManager:ue,canvasManager:lt,keepIframeSrcFn:le,processedNodeManager:yt},mirror:V});ze=(M=!1)=>{if(!I)return;N(L({type:O.Meta,data:{href:window.location.href,width:Tt(),height:Rt()}}),M),ue.reset(),et.init(),oe.forEach(D=>D.lock());const K=Vr(document,{mirror:V,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:pt,maskTextFn:p,slimDOM:mt,dataURLOptions:v,recordCanvas:B,inlineImages:G,onSerialize:D=>{At(D,V)&&ce.addIframe(D),Lt(D,V)&&ue.trackLinkElement(D),st(D)&&et.addShadowRoot(D.shadowRoot,document)},onIframeLoad:(D,H)=>{ce.attachIframe(D,H),et.observeAttachShadow(D)},onStylesheetLoad:(D,H)=>{ue.attachLinkElement(D,H)},keepIframeSrcFn:le});if(!K)return console.warn("Failed to snapshot the document");N(L({type:O.FullSnapshot,data:{node:K,initialOffset:xt(window)}}),M),oe.forEach(D=>D.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ue.adoptStyleSheets(document.adoptedStyleSheets,V.getId(document))};try{const M=[],K=H=>{var de;return _(gn)({mutationCb:Ze,mousemoveCb:(T,vt)=>N(L({type:O.IncrementalSnapshot,data:{source:vt,positions:T}})),mouseInteractionCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.MouseInteraction},T)})),scrollCb:yr,viewportResizeCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.ViewportResize},T)})),inputCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Input},T)})),mediaInteractionCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.MediaInteraction},T)})),styleSheetRuleCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.StyleSheetRule},T)})),styleDeclarationCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.StyleDeclaration},T)})),canvasMutationCb:vr,fontCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Font},T)})),selectionCb:T=>{N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Selection},T)}))},customElementCb:T=>{N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.CustomElement},T)}))},blockClass:i,ignoreClass:a,ignoreSelector:l,maskTextClass:s,maskTextSelector:c,maskInputOptions:pt,inlineStylesheet:u,sampling:S,recordDOM:I,recordCanvas:B,inlineImages:G,userTriggeredOnInput:R,collectFonts:j,doc:H,maskInputFn:g,maskTextFn:p,keepIframeSrcFn:le,blockSelector:o,slimDOMOptions:mt,dataURLOptions:v,mirror:V,iframeManager:ce,stylesheetManager:ue,shadowDomManager:et,processedNodeManager:yt,canvasManager:lt,ignoreCSSAttributes:z,plugins:((de=E?.filter(T=>T.observer))===null||de===void 0?void 0:de.map(T=>({observer:T.observer,options:T.options,callback:vt=>N(L({type:O.Plugin,data:{plugin:T.name,payload:vt}}))})))||[]},y)};ce.addLoadListener(H=>{try{M.push(K(H.contentDocument))}catch(de){console.warn(de)}});const D=()=>{ze(),M.push(K(document)),He=!0};return document.readyState==="interactive"||document.readyState==="complete"?D():(M.push(W("DOMContentLoaded",()=>{N(L({type:O.DomContentLoaded,data:{}})),x==="DOMContentLoaded"&&D()})),M.push(W("load",()=>{N(L({type:O.Load,data:{}})),x==="load"&&D()},window))),()=>{M.forEach(H=>H()),yt.destroy(),He=!1,rn()}}catch(M){console.warn(M)}}Oe.addCustomEvent=(e,t)=>{if(!He)throw new Error("please add custom event after start recording");N(L({type:O.Custom,data:{tag:e,payload:t}}))},Oe.freezePage=()=>{oe.forEach(e=>e.freeze())},Oe.takeFullSnapshot=e=>{if(!He)throw new Error("please take full snapshot after start recording");ze(e)},Oe.mirror=V;var tr=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(tr||{}),Y=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Y||{}),rr={DEBUG:!1,LIB_VERSION:"2.54.0"},P;if(typeof window>"u"){var nr={hostname:""};P={navigator:{userAgent:""},document:{location:nr,referrer:""},screen:{width:0,height:0},location:nr}}else P=window;var $e=24*60*60*1e3,qe=Array.prototype,An=Function.prototype,ir=Object.prototype,se=qe.slice,Ee=ir.toString,je=ir.hasOwnProperty,ke=P.console,xe=P.navigator,q=P.document,Ge=P.opera,Ve=P.screen,ae=xe.userAgent,ut=An.bind,or=qe.forEach,sr=qe.indexOf,ar=qe.map,Ln=Array.isArray,ct={},d={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},J={log:function(){},warn:function(){},error:function(){},critical:function(){if(!d.isUndefined(ke)&&ke){var e=["Mixpanel error:"].concat(d.toArray(arguments));try{ke.error.apply(ke,e)}catch{d.each(e,function(r){ke.error(r)})}}}},dt=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(J,arguments)}},Je=function(e){return{log:dt(J.log,e),error:dt(J.error,e),critical:dt(J.critical,e)}};d.bind=function(e,t){var r,n;if(ut&&e.bind===ut)return ut.apply(e,se.call(arguments,1));if(!d.isFunction(e))throw new TypeError;return r=se.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(se.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var a=e.apply(o,r.concat(se.call(arguments)));return Object(a)===a?a:o},n},d.each=function(e,t,r){if(e!=null){if(or&&e.forEach===or)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n,e)===ct)return}else for(var o in e)if(je.call(e,o)&&t.call(r,e[o],o,e)===ct)return}},d.extend=function(e){return d.each(se.call(arguments,1),function(t){for(var r in t)t[r]!==void 0&&(e[r]=t[r])}),e},d.isArray=Ln||function(e){return Ee.call(e)==="[object Array]"},d.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}},d.isArguments=function(e){return!!(e&&je.call(e,"callee"))},d.toArray=function(e){return e?e.toArray?e.toArray():d.isArray(e)||d.isArguments(e)?se.call(e):d.values(e):[]},d.map=function(e,t,r){if(ar&&e.map===ar)return e.map(t,r);var n=[];return d.each(e,function(i){n.push(t.call(r,i))}),n},d.keys=function(e){var t=[];return e===null||d.each(e,function(r,n){t[t.length]=n}),t},d.values=function(e){var t=[];return e===null||d.each(e,function(r){t[t.length]=r}),t},d.include=function(e,t){var r=!1;return e===null?r:sr&&e.indexOf===sr?e.indexOf(t)!=-1:(d.each(e,function(n){if(r||(r=n===t))return ct}),r)},d.includes=function(e,t){return e.indexOf(t)!==-1},d.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},d.isObject=function(e){return e===Object(e)&&!d.isArray(e)},d.isEmptyObject=function(e){if(d.isObject(e)){for(var t in e)if(je.call(e,t))return!1;return!0}return!1},d.isUndefined=function(e){return e===void 0},d.isString=function(e){return Ee.call(e)=="[object String]"},d.isDate=function(e){return Ee.call(e)=="[object Date]"},d.isNumber=function(e){return Ee.call(e)=="[object Number]"},d.isElement=function(e){return!!(e&&e.nodeType===1)},d.encodeDates=function(e){return d.each(e,function(t,r){d.isDate(t)?e[r]=d.formatDate(t):d.isObject(t)&&(e[r]=d.encodeDates(t))}),e},d.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},d.formatDate=function(e){function t(r){return r<10?"0"+r:r}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},d.strip_empty_properties=function(e){var t={};return d.each(e,function(r,n){d.isString(r)&&r.length>0&&(t[n]=r)}),t},d.truncate=function(e,t){var r;return typeof e=="string"?r=e.slice(0,t):d.isArray(e)?(r=[],d.each(e,function(n){r.push(d.truncate(n,t))})):d.isObject(e)?(r={},d.each(e,function(n,i){r[i]=d.truncate(n,t)})):r=e,r},d.JSONEncode=function(){return function(e){var t=e,r=function(i){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(l){var s=a[l];return typeof s=="string"?s:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},n=function(i,o){var a="",l=" ",s=0,c="",u="",f=0,m=a,h=[],g=o[i];switch(g&&typeof g=="object"&&typeof g.toJSON=="function"&&(g=g.toJSON(i)),typeof g){case"string":return r(g);case"number":return isFinite(g)?String(g):"null";case"boolean":case"null":return String(g);case"object":if(!g)return"null";if(a+=l,h=[],Ee.apply(g)==="[object Array]"){for(f=g.length,s=0;s<f;s+=1)h[s]=n(s,g)||"null";return u=h.length===0?"[]":a?`[
32
+ ***************************************************************************** */function e(c,u,f,m){function h(g){return g instanceof f?g:new f(function(p){p(g)})}return new(f||(f=Promise))(function(g,p){function y(v){try{S(m.next(v))}catch(b){p(b)}}function w(v){try{S(m.throw(v))}catch(b){p(b)}}function S(v){v.done?g(v.value):h(v.value).then(y,w)}S((m=m.apply(c,u||[])).next())})}for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=typeof Uint8Array>"u"?[]:new Uint8Array(256),n=0;n<t.length;n++)r[t.charCodeAt(n)]=n;var i=function(c){var u=new Uint8Array(c),f,m=u.length,h="";for(f=0;f<m;f+=3)h+=t[u[f]>>2],h+=t[(u[f]&3)<<4|u[f+1]>>4],h+=t[(u[f+1]&15)<<2|u[f+2]>>6],h+=t[u[f+2]&63];return m%3===2?h=h.substring(0,h.length-1)+"=":m%3===1&&(h=h.substring(0,h.length-2)+"=="),h};const o=new Map,a=new Map;function l(c,u,f){return e(this,void 0,void 0,function*(){const m=`${c}-${u}`;if("OffscreenCanvas"in globalThis){if(a.has(m))return a.get(m);const h=new OffscreenCanvas(c,u);h.getContext("2d");const p=yield(yield h.convertToBlob(f)).arrayBuffer(),y=i(p);return a.set(m,y),y}else return""})}const s=self;s.onmessage=function(c){return e(this,void 0,void 0,function*(){if("OffscreenCanvas"in globalThis){const{id:u,bitmap:f,width:m,height:h,dataURLOptions:g}=c.data,p=l(m,h,g),y=new OffscreenCanvas(m,h);y.getContext("2d").drawImage(f,0,0),f.close();const S=yield y.convertToBlob(g),v=S.type,b=yield S.arrayBuffer(),I=i(b);if(!o.has(u)&&(yield p)===I)return o.set(u,I),s.postMessage({id:u});if(o.get(u)===I)return s.postMessage({id:u});s.postMessage({id:u,type:v,base64:I,width:m,height:h}),o.set(u,I)}else return s.postMessage({id:c.data.id})})}})()},null);class Tn{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(s,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(s)||this.pendingCanvasMutations.set(s,[]),this.pendingCanvasMutations.get(s).push(c)};const{sampling:r="all",win:n,blockClass:i,blockSelector:o,recordCanvas:a,dataURLOptions:l}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&r==="all"&&this.initCanvasMutationObserver(n,i,o),a&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,i,o,{dataURLOptions:l})}initCanvasFPSObserver(t,r,n,i,o){const a=Zt(r,n,i,!0),l=new Map,s=new Rn;s.onmessage=g=>{const{id:p}=g.data;if(l.set(p,!1),!("base64"in g.data))return;const{base64:y,type:w,width:S,height:v}=g.data;this.mutationCb({id:p,type:ye["2D"],commands:[{property:"clearRect",args:[0,0,S,v]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:w}]},0,0]}]})};const c=1e3/t;let u=0,f;const m=()=>{const g=[];return r.document.querySelectorAll("canvas").forEach(p=>{U(p,n,i,!0)||g.push(p)}),g},h=g=>{if(u&&g-u<c){f=requestAnimationFrame(h);return}u=g,m().forEach(p=>bn(this,void 0,void 0,function*(){var y;const w=this.mirror.getId(p);if(l.get(w)||p.width===0||p.height===0)return;if(l.set(w,!0),["webgl","webgl2"].includes(p.__context)){const v=p.getContext(p.__context);((y=v?.getContextAttributes())===null||y===void 0?void 0:y.preserveDrawingBuffer)===!1&&v.clear(v.COLOR_BUFFER_BIT)}const S=yield createImageBitmap(p);s.postMessage({id:w,bitmap:S,width:p.width,height:p.height,dataURLOptions:o.dataURLOptions},[S])})),f=requestAnimationFrame(h)};f=requestAnimationFrame(h),this.resetObservers=()=>{a(),cancelAnimationFrame(f)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=Zt(t,r,n,!1),o=Cn(this.processMutation.bind(this),t,r,n),a=On(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{i(),o(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const i=n.map(a=>Sn(a,["type"])),{type:o}=n[0];this.mutationCb({id:r,type:o,commands:i}),this.pendingCanvasMutations.delete(t)}}class Dn{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new Kr,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},i=[];for(const o of t){let a;this.styleMirror.has(o)?a=this.styleMirror.getId(o):(a=this.styleMirror.add(o),i.push({styleId:a,rules:Array.from(o.rules||CSSRule,(l,s)=>({rule:St(l),index:s}))})),n.styleIds.push(a)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Nn{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(i=>i!==r)}add(t,r){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function L(e){return Object.assign(Object.assign({},e),{timestamp:Le()})}let N,ze,lt,He=!1;const V=_r();function Oe(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:i="rr-block",blockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:l=null,maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:f,maskInputOptions:m,slimDOMOptions:h,maskInputFn:g,maskTextFn:p,hooks:y,packFn:w,sampling:S={},dataURLOptions:v={},mousemoveWait:b,recordDOM:I=!0,recordCanvas:B=!1,recordCrossOriginIframes:F=!1,recordAfter:x=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:R=!1,collectFonts:j=!1,inlineImages:G=!1,plugins:E,keepIframeSrcFn:le=()=>!1,ignoreCSSAttributes:z=new Set([]),errorHandler:ne}=e;tn(ne);const Z=F?window.parent===window:!0;let Qe=!1;if(!Z)try{window.parent.document&&(Qe=!1)}catch{Qe=!0}if(Z&&!t)throw new Error("emit function is required");b!==void 0&&S.mousemove===void 0&&(S.mousemove=b),V.reset();const pt=f===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:m!==void 0?m:{password:!0},mt=h===!0||h==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:h==="all",headMetaDescKeywords:h==="all"}:h||{};Xr();let mr,gt=0;const gr=M=>{for(const K of E||[])K.eventProcessor&&(M=K.eventProcessor(M));return w&&!Qe&&(M=w(M)),M};N=(M,K)=>{var D;if(!((D=oe[0])===null||D===void 0)&&D.isFrozen()&&M.type!==O.FullSnapshot&&!(M.type===O.IncrementalSnapshot&&M.data.source===C.Mutation)&&oe.forEach(H=>H.unfreeze()),Z)t?.(gr(M),K);else if(Qe){const H={type:"rrweb",event:gr(M),origin:window.location.origin,isCheckout:K};window.parent.postMessage(H,"*")}if(M.type===O.FullSnapshot)mr=M,gt=0;else if(M.type===O.IncrementalSnapshot){if(M.data.source===C.Mutation&&M.data.isAttachIframe)return;gt++;const H=n&&gt>=n,de=r&&M.timestamp-mr.timestamp>r;(H||de)&&ze(!0)}};const Ze=M=>{N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Mutation},M)}))},yr=M=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Scroll},M)})),vr=M=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.CanvasMutation},M)})),ei=M=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.AdoptedStyleSheet},M)})),ue=new Dn({mutationCb:Ze,adoptedStyleSheetCb:ei}),ce=new yn({mirror:V,mutationCb:Ze,stylesheetManager:ue,recordCrossOriginIframes:F,wrappedEmit:N});for(const M of E||[])M.getMirror&&M.getMirror({nodeMirror:V,crossOriginIframeMirror:ce.crossOriginIframeMirror,crossOriginIframeStyleMirror:ce.crossOriginIframeStyleMirror});const yt=new Nn;lt=new Tn({recordCanvas:B,mutationCb:vr,win:window,blockClass:i,blockSelector:o,mirror:V,sampling:S.canvas,dataURLOptions:v});const et=new vn({mutationCb:Ze,scrollCb:yr,bypassOptions:{blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:pt,dataURLOptions:v,maskTextFn:p,maskInputFn:g,recordCanvas:B,inlineImages:G,sampling:S,slimDOMOptions:mt,iframeManager:ce,stylesheetManager:ue,canvasManager:lt,keepIframeSrcFn:le,processedNodeManager:yt},mirror:V});ze=(M=!1)=>{if(!I)return;N(L({type:O.Meta,data:{href:window.location.href,width:Tt(),height:Rt()}}),M),ue.reset(),et.init(),oe.forEach(D=>D.lock());const K=Vr(document,{mirror:V,blockClass:i,blockSelector:o,maskTextClass:s,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:pt,maskTextFn:p,slimDOM:mt,dataURLOptions:v,recordCanvas:B,inlineImages:G,onSerialize:D=>{At(D,V)&&ce.addIframe(D),Lt(D,V)&&ue.trackLinkElement(D),st(D)&&et.addShadowRoot(D.shadowRoot,document)},onIframeLoad:(D,H)=>{ce.attachIframe(D,H),et.observeAttachShadow(D)},onStylesheetLoad:(D,H)=>{ue.attachLinkElement(D,H)},keepIframeSrcFn:le});if(!K)return console.warn("Failed to snapshot the document");N(L({type:O.FullSnapshot,data:{node:K,initialOffset:xt(window)}}),M),oe.forEach(D=>D.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ue.adoptStyleSheets(document.adoptedStyleSheets,V.getId(document))};try{const M=[],K=H=>{var de;return _(gn)({mutationCb:Ze,mousemoveCb:(T,vt)=>N(L({type:O.IncrementalSnapshot,data:{source:vt,positions:T}})),mouseInteractionCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.MouseInteraction},T)})),scrollCb:yr,viewportResizeCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.ViewportResize},T)})),inputCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Input},T)})),mediaInteractionCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.MediaInteraction},T)})),styleSheetRuleCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.StyleSheetRule},T)})),styleDeclarationCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.StyleDeclaration},T)})),canvasMutationCb:vr,fontCb:T=>N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Font},T)})),selectionCb:T=>{N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.Selection},T)}))},customElementCb:T=>{N(L({type:O.IncrementalSnapshot,data:Object.assign({source:C.CustomElement},T)}))},blockClass:i,ignoreClass:a,ignoreSelector:l,maskTextClass:s,maskTextSelector:c,maskInputOptions:pt,inlineStylesheet:u,sampling:S,recordDOM:I,recordCanvas:B,inlineImages:G,userTriggeredOnInput:R,collectFonts:j,doc:H,maskInputFn:g,maskTextFn:p,keepIframeSrcFn:le,blockSelector:o,slimDOMOptions:mt,dataURLOptions:v,mirror:V,iframeManager:ce,stylesheetManager:ue,shadowDomManager:et,processedNodeManager:yt,canvasManager:lt,ignoreCSSAttributes:z,plugins:((de=E?.filter(T=>T.observer))===null||de===void 0?void 0:de.map(T=>({observer:T.observer,options:T.options,callback:vt=>N(L({type:O.Plugin,data:{plugin:T.name,payload:vt}}))})))||[]},y)};ce.addLoadListener(H=>{try{M.push(K(H.contentDocument))}catch(de){console.warn(de)}});const D=()=>{ze(),M.push(K(document)),He=!0};return document.readyState==="interactive"||document.readyState==="complete"?D():(M.push(W("DOMContentLoaded",()=>{N(L({type:O.DomContentLoaded,data:{}})),x==="DOMContentLoaded"&&D()})),M.push(W("load",()=>{N(L({type:O.Load,data:{}})),x==="load"&&D()},window))),()=>{M.forEach(H=>H()),yt.destroy(),He=!1,rn()}}catch(M){console.warn(M)}}Oe.addCustomEvent=(e,t)=>{if(!He)throw new Error("please add custom event after start recording");N(L({type:O.Custom,data:{tag:e,payload:t}}))},Oe.freezePage=()=>{oe.forEach(e=>e.freeze())},Oe.takeFullSnapshot=e=>{if(!He)throw new Error("please take full snapshot after start recording");ze(e)},Oe.mirror=V;var tr=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(tr||{}),Y=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(Y||{}),rr={DEBUG:!1,LIB_VERSION:"2.54.1"},P;if(typeof window>"u"){var nr={hostname:""};P={navigator:{userAgent:""},document:{location:nr,referrer:""},screen:{width:0,height:0},location:nr}}else P=window;var $e=24*60*60*1e3,qe=Array.prototype,An=Function.prototype,ir=Object.prototype,se=qe.slice,Ee=ir.toString,je=ir.hasOwnProperty,ke=P.console,xe=P.navigator,q=P.document,Ge=P.opera,Ve=P.screen,ae=xe.userAgent,ut=An.bind,or=qe.forEach,sr=qe.indexOf,ar=qe.map,Ln=Array.isArray,ct={},d={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},J={log:function(){},warn:function(){},error:function(){},critical:function(){if(!d.isUndefined(ke)&&ke){var e=["Mixpanel error:"].concat(d.toArray(arguments));try{ke.error.apply(ke,e)}catch{d.each(e,function(r){ke.error(r)})}}}},dt=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(J,arguments)}},Je=function(e){return{log:dt(J.log,e),error:dt(J.error,e),critical:dt(J.critical,e)}};d.bind=function(e,t){var r,n;if(ut&&e.bind===ut)return ut.apply(e,se.call(arguments,1));if(!d.isFunction(e))throw new TypeError;return r=se.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(se.call(arguments)));var i={};i.prototype=e.prototype;var o=new i;i.prototype=null;var a=e.apply(o,r.concat(se.call(arguments)));return Object(a)===a?a:o},n},d.each=function(e,t,r){if(e!=null){if(or&&e.forEach===or)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,i=e.length;n<i;n++)if(n in e&&t.call(r,e[n],n,e)===ct)return}else for(var o in e)if(je.call(e,o)&&t.call(r,e[o],o,e)===ct)return}},d.extend=function(e){return d.each(se.call(arguments,1),function(t){for(var r in t)t[r]!==void 0&&(e[r]=t[r])}),e},d.isArray=Ln||function(e){return Ee.call(e)==="[object Array]"},d.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}},d.isArguments=function(e){return!!(e&&je.call(e,"callee"))},d.toArray=function(e){return e?e.toArray?e.toArray():d.isArray(e)||d.isArguments(e)?se.call(e):d.values(e):[]},d.map=function(e,t,r){if(ar&&e.map===ar)return e.map(t,r);var n=[];return d.each(e,function(i){n.push(t.call(r,i))}),n},d.keys=function(e){var t=[];return e===null||d.each(e,function(r,n){t[t.length]=n}),t},d.values=function(e){var t=[];return e===null||d.each(e,function(r){t[t.length]=r}),t},d.include=function(e,t){var r=!1;return e===null?r:sr&&e.indexOf===sr?e.indexOf(t)!=-1:(d.each(e,function(n){if(r||(r=n===t))return ct}),r)},d.includes=function(e,t){return e.indexOf(t)!==-1},d.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},d.isObject=function(e){return e===Object(e)&&!d.isArray(e)},d.isEmptyObject=function(e){if(d.isObject(e)){for(var t in e)if(je.call(e,t))return!1;return!0}return!1},d.isUndefined=function(e){return e===void 0},d.isString=function(e){return Ee.call(e)=="[object String]"},d.isDate=function(e){return Ee.call(e)=="[object Date]"},d.isNumber=function(e){return Ee.call(e)=="[object Number]"},d.isElement=function(e){return!!(e&&e.nodeType===1)},d.encodeDates=function(e){return d.each(e,function(t,r){d.isDate(t)?e[r]=d.formatDate(t):d.isObject(t)&&(e[r]=d.encodeDates(t))}),e},d.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},d.formatDate=function(e){function t(r){return r<10?"0"+r:r}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())},d.strip_empty_properties=function(e){var t={};return d.each(e,function(r,n){d.isString(r)&&r.length>0&&(t[n]=r)}),t},d.truncate=function(e,t){var r;return typeof e=="string"?r=e.slice(0,t):d.isArray(e)?(r=[],d.each(e,function(n){r.push(d.truncate(n,t))})):d.isObject(e)?(r={},d.each(e,function(n,i){r[i]=d.truncate(n,t)})):r=e,r},d.JSONEncode=function(){return function(e){var t=e,r=function(i){var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return o.lastIndex=0,o.test(i)?'"'+i.replace(o,function(l){var s=a[l];return typeof s=="string"?s:"\\u"+("0000"+l.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+i+'"'},n=function(i,o){var a="",l=" ",s=0,c="",u="",f=0,m=a,h=[],g=o[i];switch(g&&typeof g=="object"&&typeof g.toJSON=="function"&&(g=g.toJSON(i)),typeof g){case"string":return r(g);case"number":return isFinite(g)?String(g):"null";case"boolean":case"null":return String(g);case"object":if(!g)return"null";if(a+=l,h=[],Ee.apply(g)==="[object Array]"){for(f=g.length,s=0;s<f;s+=1)h[s]=n(s,g)||"null";return u=h.length===0?"[]":a?`[
33
33
  `+a+h.join(`,
34
34
  `+a)+`
35
35
  `+m+"]":"["+h.join(",")+"]",a=m,u}for(c in g)je.call(g,c)&&(u=n(c,g),u&&h.push(r(c)+(a?": ":":")+u));return u=h.length===0?"{}":a?"{"+h.join(",")+m+"}":"{"+h.join(",")+"}",a=m,u}};return n("",{"":t})}}(),d.JSONDecode=function(){var e,t,r={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
36
36
  `,r:"\r",t:" "},n,i=function(h){var g=new SyntaxError(h);throw g.at=e,g.text=n,g},o=function(h){return h&&h!==t&&i("Expected '"+h+"' instead of '"+t+"'"),t=n.charAt(e),e+=1,t},a=function(){var h,g="";for(t==="-"&&(g="-",o("-"));t>="0"&&t<="9";)g+=t,o();if(t===".")for(g+=".";o()&&t>="0"&&t<="9";)g+=t;if(t==="e"||t==="E")for(g+=t,o(),(t==="-"||t==="+")&&(g+=t,o());t>="0"&&t<="9";)g+=t,o();if(h=+g,!isFinite(h))i("Bad number");else return h},l=function(){var h,g,p="",y;if(t==='"')for(;o();){if(t==='"')return o(),p;if(t==="\\")if(o(),t==="u"){for(y=0,g=0;g<4&&(h=parseInt(o(),16),!!isFinite(h));g+=1)y=y*16+h;p+=String.fromCharCode(y)}else if(typeof r[t]=="string")p+=r[t];else break;else p+=t}i("Bad string")},s=function(){for(;t&&t<=" ";)o()},c=function(){switch(t){case"t":return o("t"),o("r"),o("u"),o("e"),!0;case"f":return o("f"),o("a"),o("l"),o("s"),o("e"),!1;case"n":return o("n"),o("u"),o("l"),o("l"),null}i('Unexpected "'+t+'"')},u,f=function(){var h=[];if(t==="["){if(o("["),s(),t==="]")return o("]"),h;for(;t;){if(h.push(u()),s(),t==="]")return o("]"),h;o(","),s()}}i("Bad array")},m=function(){var h,g={};if(t==="{"){if(o("{"),s(),t==="}")return o("}"),g;for(;t;){if(h=l(),s(),o(":"),Object.hasOwnProperty.call(g,h)&&i('Duplicate key "'+h+'"'),g[h]=u(),s(),t==="}")return o("}"),g;o(","),s()}}i("Bad object")};return u=function(){switch(s(),t){case"{":return m();case"[":return f();case'"':return l();case"-":return a();default:return t>="0"&&t<="9"?a():c()}},function(h){var g;return n=h,e=0,t=" ",g=u(),s(),t&&i("Syntax error"),g}}(),d.base64Encode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,n,i,o,a,l,s,c,u=0,f=0,m="",h=[];if(!e)return e;e=d.utf8Encode(e);do r=e.charCodeAt(u++),n=e.charCodeAt(u++),i=e.charCodeAt(u++),c=r<<16|n<<8|i,o=c>>18&63,a=c>>12&63,l=c>>6&63,s=c&63,h[f++]=t.charAt(o)+t.charAt(a)+t.charAt(l)+t.charAt(s);while(u<e.length);switch(m=h.join(""),e.length%3){case 1:m=m.slice(0,-2)+"==";break;case 2:m=m.slice(0,-1)+"=";break}return m},d.utf8Encode=function(e){e=(e+"").replace(/\r\n/g,`
37
37
  `).replace(/\r/g,`
38
- `);var t="",r,n,i=0,o;for(r=n=0,i=e.length,o=0;o<i;o++){var a=e.charCodeAt(o),l=null;a<128?n++:a>127&&a<2048?l=String.fromCharCode(a>>6|192,a&63|128):l=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),l!==null&&(n>r&&(t+=e.substring(r,n)),t+=l,r=n=o+1)}return n>r&&(t+=e.substring(r,e.length)),t},d.UUID=function(){var e=function(){var n=1*new Date,i;if(P.performance&&P.performance.now)i=P.performance.now();else for(i=0;n==1*new Date;)i++;return n.toString(16)+Math.floor(i).toString(16)},t=function(){return Math.random().toString(16).replace(".","")},r=function(){var n=ae,i,o,a=[],l=0;function s(c,u){var f,m=0;for(f=0;f<u.length;f++)m|=a[f]<<f*8;return c^m}for(i=0;i<n.length;i++)o=n.charCodeAt(i),a.unshift(o&255),a.length>=4&&(l=s(l,a),a=[]);return a.length>0&&(l=s(l,a)),l.toString(16)};return function(){var n=(Ve.height*Ve.width).toString(16);return e()+"-"+t()+"-"+r()+"-"+n+"-"+e()}}();var lr=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];d.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<lr.length;t++)if(e.indexOf(lr[t])!==-1)return!0;return!1},d.HTTPBuildQuery=function(e,t){var r,n,i=[];return d.isUndefined(t)&&(t="&"),d.each(e,function(o,a){r=encodeURIComponent(o.toString()),n=encodeURIComponent(a),i[i.length]=n+"="+r}),i.join(t)},d.getQueryParam=function(e,t){t=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]");var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),i=n.exec(e);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch{J.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},d.cookie={get:function(e){for(var t=e+"=",r=q.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}return null},parse:function(e){var t;try{t=d.JSONDecode(d.cookie.get(e))||{}}catch{}return t},set_seconds:function(e,t,r,n,i,o,a){var l="",s="",c="";if(a)l="; domain="+a;else if(n){var u=ur(q.location.hostname);l=u?"; domain=."+u:""}if(r){var f=new Date;f.setTime(f.getTime()+r*1e3),s="; expires="+f.toGMTString()}o&&(i=!0,c="; SameSite=None"),i&&(c+="; secure"),q.cookie=e+"="+encodeURIComponent(t)+s+"; path=/"+l+c},set:function(e,t,r,n,i,o,a){var l="",s="",c="";if(a)l="; domain="+a;else if(n){var u=ur(q.location.hostname);l=u?"; domain=."+u:""}if(r){var f=new Date;f.setTime(f.getTime()+r*24*60*60*1e3),s="; expires="+f.toGMTString()}o&&(i=!0,c="; SameSite=None"),i&&(c+="; secure");var m=e+"="+encodeURIComponent(t)+s+"; path=/"+l+c;return q.cookie=m,m},remove:function(e,t,r){d.cookie.set(e,"",-1,t,!1,!1,r)}};var ft=null,Xe=function(e,t){if(ft!==null&&!t)return ft;var r=!0;try{e=e||window.localStorage;var n="__mplss_"+ht(8),i="xyz";e.setItem(n,i),e.getItem(n)!==i&&(r=!1),e.removeItem(n)}catch{r=!1}return ft=r,r};d.localStorage={is_supported:function(e){var t=Xe(null,e);return t||J.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){J.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){d.localStorage.error(t)}return null},parse:function(e){try{return d.JSONDecode(d.localStorage.get(e))||{}}catch{}return null},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){d.localStorage.error(r)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){d.localStorage.error(t)}}},d.register_event=function(){var e=function(n,i,o,a,l){if(!n){J.error("No valid element provided to register_event");return}if(n.addEventListener&&!a)n.addEventListener(i,o,!!l);else{var s="on"+i,c=n[s];n[s]=t(n,o,c)}};function t(n,i,o){var a=function(l){if(l=l||r(window.event),!!l){var s=!0,c,u;return d.isFunction(o)&&(c=o(l)),u=i.call(n,l),(c===!1||u===!1)&&(s=!1),s}};return a}function r(n){return n&&(n.preventDefault=r.preventDefault,n.stopPropagation=r.stopPropagation),n}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},e}();var Fn=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');d.dom_query=function(){function e(i){return i.all?i.all:i.getElementsByTagName("*")}var t=/[\t\r\n]/g;function r(i,o){var a=" "+o+" ";return(" "+i.className+" ").replace(t," ").indexOf(a)>=0}function n(i){if(!q.getElementsByTagName)return[];var o=i.split(" "),a,l,s,c,u,f,m,h,g,p,y=[q];for(f=0;f<o.length;f++){if(a=o[f].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){l=a.split("#"),s=l[0];var w=l[1],S=q.getElementById(w);if(!S||s&&S.nodeName.toLowerCase()!=s)return[];y=[S];continue}if(a.indexOf(".")>-1){l=a.split("."),s=l[0];var v=l[1];for(s||(s="*"),c=[],u=0,m=0;m<y.length;m++)for(s=="*"?g=e(y[m]):g=y[m].getElementsByTagName(s),h=0;h<g.length;h++)c[u++]=g[h];for(y=[],p=0,m=0;m<c.length;m++)c[m].className&&d.isString(c[m].className)&&r(c[m],v)&&(y[p++]=c[m]);continue}var b=a.match(Fn);if(b){s=b[1];var I=b[2],B=b[3],F=b[4];for(s||(s="*"),c=[],u=0,m=0;m<y.length;m++)for(s=="*"?g=e(y[m]):g=y[m].getElementsByTagName(s),h=0;h<g.length;h++)c[u++]=g[h];y=[],p=0;var x;switch(B){case"=":x=function(R){return R.getAttribute(I)==F};break;case"~":x=function(R){return R.getAttribute(I).match(new RegExp("\\b"+F+"\\b"))};break;case"|":x=function(R){return R.getAttribute(I).match(new RegExp("^"+F+"-?"))};break;case"^":x=function(R){return R.getAttribute(I).indexOf(F)===0};break;case"$":x=function(R){return R.getAttribute(I).lastIndexOf(F)==R.getAttribute(I).length-F.length};break;case"*":x=function(R){return R.getAttribute(I).indexOf(F)>-1};break;default:x=function(R){return R.getAttribute(I)}}for(y=[],p=0,m=0;m<c.length;m++)x(c[m])&&(y[p++]=c[m]);continue}for(s=a,c=[],u=0,m=0;m<y.length;m++)for(g=y[m].getElementsByTagName(s),h=0;h<g.length;h++)c[u++]=g[h];y=c}return y}return function(i){return d.isElement(i)?[i]:d.isObject(i)&&!d.isUndefined(i.length)?i:n.call(this,i)}}();var Pn=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],Bn=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","ttclid","twclid","wbraid"];d.info={campaignParams:function(e){var t="",r={};return d.each(Pn,function(n){t=d.getQueryParam(q.URL,n),t.length?r[n]=t:e!==void 0&&(r[n]=e)}),r},clickParams:function(){var e="",t={};return d.each(Bn,function(r){e=d.getQueryParam(q.URL,r),e.length&&(t[r]=e)}),t},marketingParams:function(){return d.extend(d.info.campaignParams(),d.info.clickParams())},searchEngine:function(e){return e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(e){var t=d.info.searchEngine(e),r=t!="yahoo"?"q":"p",n={};if(t!==null){n.$search_engine=t;var i=d.getQueryParam(e,r);i.length&&(n.mp_keyword=i)}return n},browser:function(e,t,r){return t=t||"",r||d.includes(e," OPR/")?d.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":d.includes(e,"IEMobile")||d.includes(e,"WPDesktop")?"Internet Explorer Mobile":d.includes(e,"SamsungBrowser/")?"Samsung Internet":d.includes(e,"Edge")||d.includes(e,"Edg/")?"Microsoft Edge":d.includes(e,"FBIOS")?"Facebook Mobile":d.includes(e,"Chrome")?"Chrome":d.includes(e,"CriOS")?"Chrome iOS":d.includes(e,"UCWEB")||d.includes(e,"UCBrowser")?"UC Browser":d.includes(e,"FxiOS")?"Firefox iOS":d.includes(t,"Apple")?d.includes(e,"Mobile")?"Mobile Safari":"Safari":d.includes(e,"Android")?"Android Mobile":d.includes(e,"Konqueror")?"Konqueror":d.includes(e,"Firefox")?"Firefox":d.includes(e,"MSIE")||d.includes(e,"Trident/")?"Internet Explorer":d.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,r){var n=d.info.browser(e,t,r),i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/},o=i[n];if(o===void 0)return null;var a=e.match(o);return a?parseFloat(a[a.length-2]):null},os:function(){var e=ae;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return P.location.href},properties:function(e){return typeof e!="object"&&(e={}),d.extend(d.strip_empty_properties({$os:d.info.os(),$browser:d.info.browser(ae,xe.vendor,Ge),$referrer:q.referrer,$referring_domain:d.info.referringDomain(q.referrer),$device:d.info.device(ae)}),{$current_url:d.info.currentUrl(),$browser_version:d.info.browserVersion(ae,xe.vendor,Ge),$screen_height:Ve.height,$screen_width:Ve.width,mp_lib:"web",$lib_version:rr.LIB_VERSION,$insert_id:ht(),time:d.timestamp()/1e3},d.strip_empty_properties(e))},people_properties:function(){return d.extend(d.strip_empty_properties({$os:d.info.os(),$browser:d.info.browser(ae,xe.vendor,Ge)}),{$browser_version:d.info.browserVersion(ae,xe.vendor,Ge)})},mpPageViewProperties:function(){return d.strip_empty_properties({current_page_title:q.title,current_domain:P.location.hostname,current_url_path:P.location.pathname,current_url_protocol:P.location.protocol,current_url_search:P.location.search})}};var ht=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},Wn=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Un=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,ur=function(e){var t=Un,r=e.split("."),n=r[r.length-1];(n.length>4||n==="com"||n==="org")&&(t=Wn);var i=e.match(t);return i?i[0]:""},Ke=null,Ye=null;typeof JSON<"u"&&(Ke=JSON.stringify,Ye=JSON.parse),Ke=Ke||d.JSONEncode,Ye=Ye||d.JSONDecode,d.toArray=d.toArray,d.isObject=d.isObject,d.JSONEncode=d.JSONEncode,d.JSONDecode=d.JSONDecode,d.isBlockedUA=d.isBlockedUA,d.isEmptyObject=d.isEmptyObject,d.info=d.info,d.info.device=d.info.device,d.info.browser=d.info.browser,d.info.browserVersion=d.info.browserVersion,d.info.properties=d.info.properties;var zn="__mp_opt_in_out_";function Hn(e,t){if(Vn(t))return J.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r=Gn(e,t)==="0";return r&&J.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function $n(e){return Jn(e,function(t){return this.get_config(t)})}function qn(e){return e=e||{},e.persistenceType==="localStorage"?d.localStorage:d.cookie}function jn(e,t){return t=t||{},(t.persistencePrefix||zn)+e}function Gn(e,t){return qn(t).get(jn(e,t))}function Vn(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||P,r=t.navigator||{},n=!1;return d.each([r.doNotTrack,r.msDoNotTrack,t.doNotTrack],function(i){d.includes([!0,1,"1","yes"],i)&&(n=!0)}),n}function Jn(e,t){return function(){var r=!1;try{var n=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),a=t.call(this,"opt_out_tracking_cookie_prefix"),l=t.call(this,"window");n&&(r=Hn(n,{ignoreDnt:i,persistenceType:o,persistencePrefix:a,window:l}))}catch(c){J.error("Unexpected error when checking tracking opt-out status: "+c)}if(!r)return e.apply(this,arguments);var s=arguments[arguments.length-1];typeof s=="function"&&s(0)}}var Xn=Je("lock"),cr=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};cr.prototype.withLock=function(e,t,r){!r&&typeof t!="function"&&(r=t,t=null);var n=r||new Date().getTime()+"|"+Math.random(),i=new Date().getTime(),o=this.storageKey,a=this.pollIntervalMS,l=this.timeoutMS,s=this.storage,c=o+":X",u=o+":Y",f=o+":Z",m=function(S){t&&t(S)},h=function(S){if(new Date().getTime()-i>l){Xn.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+n+"]"),s.removeItem(f),s.removeItem(u),y();return}setTimeout(function(){try{S()}catch(v){m(v)}},a*(Math.random()+.1))},g=function(S,v){S()?v():h(function(){g(S,v)})},p=function(){var S=s.getItem(u);if(S&&S!==n)return!1;if(s.setItem(u,n),s.getItem(u)===n)return!0;if(!Xe(s,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},y=function(){s.setItem(c,n),g(p,function(){if(s.getItem(c)===n){w();return}h(function(){if(s.getItem(u)!==n){y();return}g(function(){return!s.getItem(f)},w)})})},w=function(){s.setItem(f,"1");try{e()}finally{s.removeItem(f),s.getItem(u)===n&&s.removeItem(u),s.getItem(c)===n&&s.removeItem(c)}};try{if(Xe(s,!0))y();else throw new Error("localStorage support check failed")}catch(S){m(S)}};var dr=Je("batch"),re=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||d.bind(dr.error,dr),this.lock=new cr(e,{storage:this.storage}),this.usePersistence=t.usePersistence,this.pid=t.pid||null,this.memQueue=[]};re.prototype.enqueue=function(e,t,r){var n={id:ht(),flushAfter:new Date().getTime()+t*2,payload:e};this.usePersistence?this.lock.withLock(d.bind(function(){var o;try{var a=this.readFromStorage();a.push(n),o=this.saveToStorage(a),o&&this.memQueue.push(n)}catch{this.reportError("Error enqueueing item",e),o=!1}r&&r(o)},this),d.bind(function(o){this.reportError("Error acquiring storage lock",o),r&&r(!1)},this),this.pid):(this.memQueue.push(n),r&&r(!0))},re.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(this.usePersistence&&t.length<e){var r=this.readFromStorage();if(r.length){var n={};d.each(t,function(a){n[a.id]=!0});for(var i=0;i<r.length;i++){var o=r[i];if(new Date().getTime()>o.flushAfter&&!n[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}}return t};var fr=function(e,t){var r=[];return d.each(e,function(n){n.id&&!t[n.id]&&r.push(n)}),r};re.prototype.removeItemsByID=function(e,t){var r={};if(d.each(e,function(i){r[i]=!0}),this.memQueue=fr(this.memQueue,r),!this.usePersistence)t&&t(!0);else{var n=d.bind(function(){var i;try{var o=this.readFromStorage();if(o=fr(o,r),i=this.saveToStorage(o),i){o=this.readFromStorage();for(var a=0;a<o.length;a++){var l=o[a];if(l.id&&r[l.id])return this.reportError("Item not removed from storage"),!1}}}catch{this.reportError("Error removing items",e),i=!1}return i},this);this.lock.withLock(function(){var o=n();t&&t(o)},d.bind(function(o){var a=!1;if(this.reportError("Error acquiring storage lock",o),!Xe(this.storage,!0)&&(a=n(),!a))try{this.storage.removeItem(this.storageKey)}catch(l){this.reportError("Error clearing queue",l)}t&&t(a)},this),this.pid)}};var hr=function(e,t){var r=[];return d.each(e,function(n){var i=n.id;if(i in t){var o=t[i];o!==null&&(n.payload=o,r.push(n))}else r.push(n)}),r};re.prototype.updatePayloads=function(e,t){this.memQueue=hr(this.memQueue,e),this.usePersistence?this.lock.withLock(d.bind(function(){var n;try{var i=this.readFromStorage();i=hr(i,e),n=this.saveToStorage(i)}catch{this.reportError("Error updating items",e),n=!1}t&&t(n)},this),d.bind(function(n){this.reportError("Error acquiring storage lock",n),t&&t(!1)},this),this.pid):t&&t(!0)},re.prototype.readFromStorage=function(){var e;try{e=this.storage.getItem(this.storageKey),e&&(e=Ye(e),d.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null))}catch(t){this.reportError("Error retrieving queue",t),e=null}return e||[]},re.prototype.saveToStorage=function(e){try{return this.storage.setItem(this.storageKey,Ke(e)),!0}catch(t){return this.reportError("Error saving queue",t),!1}},re.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var Kn=10*60*1e3,Re=Je("batch"),Q=function(e,t){this.errorReporter=t.errorReporter,this.queue=new re(e,{errorReporter:d.bind(this.reportError,this),storage:t.storage,usePersistence:t.usePersistence}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1};Q.prototype.enqueue=function(e,t){this.queue.enqueue(e,this.flushInterval,t)},Q.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},Q.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},Q.prototype.clear=function(){this.queue.clear()},Q.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},Q.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},Q.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(d.bind(this.flush,this),this.flushInterval))},Q.prototype.flush=function(e){try{if(this.requestInProgress){Re.log("Flush: Request already in progress");return}e=e||{};var t=this.libConfig.batch_request_timeout_ms,r=new Date().getTime(),n=this.batchSize,i=this.queue.fillBatch(n),o=i.length===n,a=[],l={};if(d.each(i,function(u){var f=u.payload;if(this.beforeSendHook&&!u.orphaned&&(f=this.beforeSendHook(f)),f){f.event&&f.properties&&(f.properties=d.extend({},f.properties,{mp_sent_by_lib_version:rr.LIB_VERSION}));var m=!0,h=u.id;h?(this.itemIdsSentSuccessfully[h]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:u,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[h]}),m=!1):this.reportError("[dupe] found item with no ID",{item:u}),m&&a.push(f)}l[u.id]=f},this),a.length<1){this.resetFlush();return}this.requestInProgress=!0;var s=d.bind(function(u){this.requestInProgress=!1;try{var f=!1;if(e.unloading)this.queue.updatePayloads(l);else if(d.isObject(u)&&u.error==="timeout"&&new Date().getTime()-r>=t)this.reportError("Network timeout; retrying"),this.flush();else if(d.isObject(u)&&(u.httpStatusCode>=500||u.httpStatusCode===429||u.error==="timeout")){var m=this.flushInterval*2;u.retryAfter&&(m=parseInt(u.retryAfter,10)*1e3||m),m=Math.min(Kn,m),this.reportError("Error; retry in "+m+" ms"),this.scheduleFlush(m)}else if(d.isObject(u)&&u.httpStatusCode===413)if(i.length>1){var h=Math.max(1,Math.floor(n/2));this.batchSize=Math.min(this.batchSize,h,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),f=!0;else f=!0;f&&(this.queue.removeItemsByID(d.map(i,function(g){return g.id}),d.bind(function(g){g?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!o?this.resetFlush():this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this)),d.each(i,d.bind(function(g){var p=g.id;p?(this.itemIdsSentSuccessfully[p]=this.itemIdsSentSuccessfully[p]||0,this.itemIdsSentSuccessfully[p]++,this.itemIdsSentSuccessfully[p]>5&&this.reportError("[dupe] item ID sent too many times",{item:g,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[p]})):this.reportError("[dupe] found item with no ID while removing",{item:g})},this)))}catch(g){this.reportError("Error handling API response",g),this.resetFlush()}},this),c={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(c.transport="sendBeacon"),Re.log("MIXPANEL REQUEST:",a),this.sendRequest(a,c,s)}catch(u){this.reportError("Error flushing request queue",u),this.resetFlush()}},Q.prototype.reportError=function(e,t){if(Re.error.apply(Re.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(r){Re.error(r)}};var Se=Je("recorder"),pr=P.CompressionStream,Yn={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},Qn=new Set([Y.MouseMove,Y.MouseInteraction,Y.Scroll,Y.ViewportResize,Y.Input,Y.TouchMove,Y.MediaInteraction,Y.Drag,Y.Selection]);function Zn(e){return e.type===tr.IncrementalSnapshot&&Qn.has(e.source)}var X=function(e){this._mixpanel=e,this._stopRecording=null,this.recEvents=[],this.seqNo=0,this.replayId=null,this.replayStartTime=null,this.sendBatchId=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=$e,this._initBatcher()};X.prototype._initBatcher=function(){this.batcher=new Q("__mprec",{libConfig:Yn,sendRequestFunc:d.bind(this.flushEventsWithOptOut,this),errorReporter:d.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},X.prototype.get_config=function(e){return this._mixpanel.get_config(e)},X.prototype.startRecording=function(){if(this._stopRecording!==null){Se.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>$e&&(this.recordMaxMs=$e,Se.critical("record_max_ms cannot be greater than "+$e+"ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=null,this.replayId=d.UUID(),this.batcher.start();var e=d.bind(function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(d.bind(function(){Se.log("Idle timeout reached, restarting recording."),this.resetRecording()},this),this.get_config("record_idle_timeout_ms"))},this);this._stopRecording=Oe({emit:d.bind(function(t){this.batcher.enqueue(t),Zn(t)&&e()},this),blockClass:this.get_config("record_block_class"),blockSelector:this.get_config("record_block_selector"),collectFonts:this.get_config("record_collect_fonts"),inlineImages:this.get_config("record_inline_images"),maskAllInputs:!0,maskTextClass:this.get_config("record_mask_text_class"),maskTextSelector:this.get_config("record_mask_text_selector")}),e(),this.maxTimeoutId=setTimeout(d.bind(this.resetRecording,this),this.recordMaxMs)},X.prototype.resetRecording=function(){this.stopRecording(),this.startRecording()},X.prototype.stopRecording=function(){this._stopRecording!==null&&(this._stopRecording(),this._stopRecording=null),this.batcher.flush(),this.replayId=null,clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},X.prototype.flushEventsWithOptOut=function(e,t,r){this._flushEvents(e,t,r,d.bind(this._onOptOut,this))},X.prototype._onOptOut=function(e){e===0&&(this.recEvents=[],this.stopRecording())},X.prototype._sendRequest=function(e,t,r){var n=d.bind(function(i,o){i.status===200&&this.seqNo++,r({status:0,httpStatusCode:i.status,responseBody:o,retryAfter:i.headers.get("Retry-After")})},this);P.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record+"?"+new URLSearchParams(e),{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/octet-stream"},body:t}).then(function(i){i.json().then(function(o){n(i,o)}).catch(function(o){r({error:o})})}).catch(function(i){r({error:i})})},X.prototype._flushEvents=$n(function(e,t,r){const n=e.length;if(n>0){var i=e[0].timestamp;this.seqNo===0&&(this.replayStartTime=i);var o=e[n-1].timestamp-this.replayStartTime,a={distinct_id:String(this._mixpanel.get_distinct_id()),seq:this.seqNo,batch_start_time:i/1e3,replay_id:this.replayId,replay_length_ms:o,replay_start_time:this.replayStartTime/1e3},l=d.JSONEncode(e),s=this._mixpanel.get_property("$device_id");s&&(a.$device_id=s);var c=this._mixpanel.get_property("$user_id");if(c&&(a.$user_id=c),pr){var u=new Blob([l],{type:"application/json"}).stream(),f=u.pipeThrough(new pr("gzip"));new Response(f).blob().then(d.bind(function(m){a.format="gzip",this._sendRequest(a,m,r)},this))}else a.format="body",this._sendRequest(a,l,r)}}),X.prototype.reportError=function(e,t){Se.error.apply(Se.error,arguments);try{!t&&!(e instanceof Error)&&(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(r){Se.error(r)}},P.__mp_recorder=X})();
38
+ `);var t="",r,n,i=0,o;for(r=n=0,i=e.length,o=0;o<i;o++){var a=e.charCodeAt(o),l=null;a<128?n++:a>127&&a<2048?l=String.fromCharCode(a>>6|192,a&63|128):l=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),l!==null&&(n>r&&(t+=e.substring(r,n)),t+=l,r=n=o+1)}return n>r&&(t+=e.substring(r,e.length)),t},d.UUID=function(){var e=function(){var n=1*new Date,i;if(P.performance&&P.performance.now)i=P.performance.now();else for(i=0;n==1*new Date;)i++;return n.toString(16)+Math.floor(i).toString(16)},t=function(){return Math.random().toString(16).replace(".","")},r=function(){var n=ae,i,o,a=[],l=0;function s(c,u){var f,m=0;for(f=0;f<u.length;f++)m|=a[f]<<f*8;return c^m}for(i=0;i<n.length;i++)o=n.charCodeAt(i),a.unshift(o&255),a.length>=4&&(l=s(l,a),a=[]);return a.length>0&&(l=s(l,a)),l.toString(16)};return function(){var n=(Ve.height*Ve.width).toString(16);return e()+"-"+t()+"-"+r()+"-"+n+"-"+e()}}();var lr=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];d.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<lr.length;t++)if(e.indexOf(lr[t])!==-1)return!0;return!1},d.HTTPBuildQuery=function(e,t){var r,n,i=[];return d.isUndefined(t)&&(t="&"),d.each(e,function(o,a){r=encodeURIComponent(o.toString()),n=encodeURIComponent(a),i[i.length]=n+"="+r}),i.join(t)},d.getQueryParam=function(e,t){t=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]");var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),i=n.exec(e);if(i===null||i&&typeof i[1]!="string"&&i[1].length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch{J.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},d.cookie={get:function(e){for(var t=e+"=",r=q.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}return null},parse:function(e){var t;try{t=d.JSONDecode(d.cookie.get(e))||{}}catch{}return t},set_seconds:function(e,t,r,n,i,o,a){var l="",s="",c="";if(a)l="; domain="+a;else if(n){var u=ur(q.location.hostname);l=u?"; domain=."+u:""}if(r){var f=new Date;f.setTime(f.getTime()+r*1e3),s="; expires="+f.toGMTString()}o&&(i=!0,c="; SameSite=None"),i&&(c+="; secure"),q.cookie=e+"="+encodeURIComponent(t)+s+"; path=/"+l+c},set:function(e,t,r,n,i,o,a){var l="",s="",c="";if(a)l="; domain="+a;else if(n){var u=ur(q.location.hostname);l=u?"; domain=."+u:""}if(r){var f=new Date;f.setTime(f.getTime()+r*24*60*60*1e3),s="; expires="+f.toGMTString()}o&&(i=!0,c="; SameSite=None"),i&&(c+="; secure");var m=e+"="+encodeURIComponent(t)+s+"; path=/"+l+c;return q.cookie=m,m},remove:function(e,t,r){d.cookie.set(e,"",-1,t,!1,!1,r)}};var ft=null,Xe=function(e,t){if(ft!==null&&!t)return ft;var r=!0;try{e=e||window.localStorage;var n="__mplss_"+ht(8),i="xyz";e.setItem(n,i),e.getItem(n)!==i&&(r=!1),e.removeItem(n)}catch{r=!1}return ft=r,r};d.localStorage={is_supported:function(e){var t=Xe(null,e);return t||J.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){J.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){d.localStorage.error(t)}return null},parse:function(e){try{return d.JSONDecode(d.localStorage.get(e))||{}}catch{}return null},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){d.localStorage.error(r)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){d.localStorage.error(t)}}},d.register_event=function(){var e=function(n,i,o,a,l){if(!n){J.error("No valid element provided to register_event");return}if(n.addEventListener&&!a)n.addEventListener(i,o,!!l);else{var s="on"+i,c=n[s];n[s]=t(n,o,c)}};function t(n,i,o){var a=function(l){if(l=l||r(window.event),!!l){var s=!0,c,u;return d.isFunction(o)&&(c=o(l)),u=i.call(n,l),(c===!1||u===!1)&&(s=!1),s}};return a}function r(n){return n&&(n.preventDefault=r.preventDefault,n.stopPropagation=r.stopPropagation),n}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},e}();var Fn=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');d.dom_query=function(){function e(i){return i.all?i.all:i.getElementsByTagName("*")}var t=/[\t\r\n]/g;function r(i,o){var a=" "+o+" ";return(" "+i.className+" ").replace(t," ").indexOf(a)>=0}function n(i){if(!q.getElementsByTagName)return[];var o=i.split(" "),a,l,s,c,u,f,m,h,g,p,y=[q];for(f=0;f<o.length;f++){if(a=o[f].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){l=a.split("#"),s=l[0];var w=l[1],S=q.getElementById(w);if(!S||s&&S.nodeName.toLowerCase()!=s)return[];y=[S];continue}if(a.indexOf(".")>-1){l=a.split("."),s=l[0];var v=l[1];for(s||(s="*"),c=[],u=0,m=0;m<y.length;m++)for(s=="*"?g=e(y[m]):g=y[m].getElementsByTagName(s),h=0;h<g.length;h++)c[u++]=g[h];for(y=[],p=0,m=0;m<c.length;m++)c[m].className&&d.isString(c[m].className)&&r(c[m],v)&&(y[p++]=c[m]);continue}var b=a.match(Fn);if(b){s=b[1];var I=b[2],B=b[3],F=b[4];for(s||(s="*"),c=[],u=0,m=0;m<y.length;m++)for(s=="*"?g=e(y[m]):g=y[m].getElementsByTagName(s),h=0;h<g.length;h++)c[u++]=g[h];y=[],p=0;var x;switch(B){case"=":x=function(R){return R.getAttribute(I)==F};break;case"~":x=function(R){return R.getAttribute(I).match(new RegExp("\\b"+F+"\\b"))};break;case"|":x=function(R){return R.getAttribute(I).match(new RegExp("^"+F+"-?"))};break;case"^":x=function(R){return R.getAttribute(I).indexOf(F)===0};break;case"$":x=function(R){return R.getAttribute(I).lastIndexOf(F)==R.getAttribute(I).length-F.length};break;case"*":x=function(R){return R.getAttribute(I).indexOf(F)>-1};break;default:x=function(R){return R.getAttribute(I)}}for(y=[],p=0,m=0;m<c.length;m++)x(c[m])&&(y[p++]=c[m]);continue}for(s=a,c=[],u=0,m=0;m<y.length;m++)for(g=y[m].getElementsByTagName(s),h=0;h<g.length;h++)c[u++]=g[h];y=c}return y}return function(i){return d.isElement(i)?[i]:d.isObject(i)&&!d.isUndefined(i.length)?i:n.call(this,i)}}();var Pn=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],Bn=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","ttclid","twclid","wbraid"];d.info={campaignParams:function(e){var t="",r={};return d.each(Pn,function(n){t=d.getQueryParam(q.URL,n),t.length?r[n]=t:e!==void 0&&(r[n]=e)}),r},clickParams:function(){var e="",t={};return d.each(Bn,function(r){e=d.getQueryParam(q.URL,r),e.length&&(t[r]=e)}),t},marketingParams:function(){return d.extend(d.info.campaignParams(),d.info.clickParams())},searchEngine:function(e){return e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(e){var t=d.info.searchEngine(e),r=t!="yahoo"?"q":"p",n={};if(t!==null){n.$search_engine=t;var i=d.getQueryParam(e,r);i.length&&(n.mp_keyword=i)}return n},browser:function(e,t,r){return t=t||"",r||d.includes(e," OPR/")?d.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":d.includes(e,"IEMobile")||d.includes(e,"WPDesktop")?"Internet Explorer Mobile":d.includes(e,"SamsungBrowser/")?"Samsung Internet":d.includes(e,"Edge")||d.includes(e,"Edg/")?"Microsoft Edge":d.includes(e,"FBIOS")?"Facebook Mobile":d.includes(e,"Chrome")?"Chrome":d.includes(e,"CriOS")?"Chrome iOS":d.includes(e,"UCWEB")||d.includes(e,"UCBrowser")?"UC Browser":d.includes(e,"FxiOS")?"Firefox iOS":d.includes(t,"Apple")?d.includes(e,"Mobile")?"Mobile Safari":"Safari":d.includes(e,"Android")?"Android Mobile":d.includes(e,"Konqueror")?"Konqueror":d.includes(e,"Firefox")?"Firefox":d.includes(e,"MSIE")||d.includes(e,"Trident/")?"Internet Explorer":d.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,r){var n=d.info.browser(e,t,r),i={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/},o=i[n];if(o===void 0)return null;var a=e.match(o);return a?parseFloat(a[a.length-2]):null},os:function(){var e=ae;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},currentUrl:function(){return P.location.href},properties:function(e){return typeof e!="object"&&(e={}),d.extend(d.strip_empty_properties({$os:d.info.os(),$browser:d.info.browser(ae,xe.vendor,Ge),$referrer:q.referrer,$referring_domain:d.info.referringDomain(q.referrer),$device:d.info.device(ae)}),{$current_url:d.info.currentUrl(),$browser_version:d.info.browserVersion(ae,xe.vendor,Ge),$screen_height:Ve.height,$screen_width:Ve.width,mp_lib:"web",$lib_version:rr.LIB_VERSION,$insert_id:ht(),time:d.timestamp()/1e3},d.strip_empty_properties(e))},people_properties:function(){return d.extend(d.strip_empty_properties({$os:d.info.os(),$browser:d.info.browser(ae,xe.vendor,Ge)}),{$browser_version:d.info.browserVersion(ae,xe.vendor,Ge)})},mpPageViewProperties:function(){return d.strip_empty_properties({current_page_title:q.title,current_domain:P.location.hostname,current_url_path:P.location.pathname,current_url_protocol:P.location.protocol,current_url_search:P.location.search})}};var ht=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},Wn=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Un=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,ur=function(e){var t=Un,r=e.split("."),n=r[r.length-1];(n.length>4||n==="com"||n==="org")&&(t=Wn);var i=e.match(t);return i?i[0]:""},Ke=null,Ye=null;typeof JSON<"u"&&(Ke=JSON.stringify,Ye=JSON.parse),Ke=Ke||d.JSONEncode,Ye=Ye||d.JSONDecode,d.toArray=d.toArray,d.isObject=d.isObject,d.JSONEncode=d.JSONEncode,d.JSONDecode=d.JSONDecode,d.isBlockedUA=d.isBlockedUA,d.isEmptyObject=d.isEmptyObject,d.info=d.info,d.info.device=d.info.device,d.info.browser=d.info.browser,d.info.browserVersion=d.info.browserVersion,d.info.properties=d.info.properties;var zn="__mp_opt_in_out_";function Hn(e,t){if(Vn(t))return J.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r=Gn(e,t)==="0";return r&&J.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function $n(e){return Jn(e,function(t){return this.get_config(t)})}function qn(e){return e=e||{},e.persistenceType==="localStorage"?d.localStorage:d.cookie}function jn(e,t){return t=t||{},(t.persistencePrefix||zn)+e}function Gn(e,t){return qn(t).get(jn(e,t))}function Vn(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||P,r=t.navigator||{},n=!1;return d.each([r.doNotTrack,r.msDoNotTrack,t.doNotTrack],function(i){d.includes([!0,1,"1","yes"],i)&&(n=!0)}),n}function Jn(e,t){return function(){var r=!1;try{var n=t.call(this,"token"),i=t.call(this,"ignore_dnt"),o=t.call(this,"opt_out_tracking_persistence_type"),a=t.call(this,"opt_out_tracking_cookie_prefix"),l=t.call(this,"window");n&&(r=Hn(n,{ignoreDnt:i,persistenceType:o,persistencePrefix:a,window:l}))}catch(c){J.error("Unexpected error when checking tracking opt-out status: "+c)}if(!r)return e.apply(this,arguments);var s=arguments[arguments.length-1];typeof s=="function"&&s(0)}}var Xn=Je("lock"),cr=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};cr.prototype.withLock=function(e,t,r){!r&&typeof t!="function"&&(r=t,t=null);var n=r||new Date().getTime()+"|"+Math.random(),i=new Date().getTime(),o=this.storageKey,a=this.pollIntervalMS,l=this.timeoutMS,s=this.storage,c=o+":X",u=o+":Y",f=o+":Z",m=function(S){t&&t(S)},h=function(S){if(new Date().getTime()-i>l){Xn.error("Timeout waiting for mutex on "+o+"; clearing lock. ["+n+"]"),s.removeItem(f),s.removeItem(u),y();return}setTimeout(function(){try{S()}catch(v){m(v)}},a*(Math.random()+.1))},g=function(S,v){S()?v():h(function(){g(S,v)})},p=function(){var S=s.getItem(u);if(S&&S!==n)return!1;if(s.setItem(u,n),s.getItem(u)===n)return!0;if(!Xe(s,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},y=function(){s.setItem(c,n),g(p,function(){if(s.getItem(c)===n){w();return}h(function(){if(s.getItem(u)!==n){y();return}g(function(){return!s.getItem(f)},w)})})},w=function(){s.setItem(f,"1");try{e()}finally{s.removeItem(f),s.getItem(u)===n&&s.removeItem(u),s.getItem(c)===n&&s.removeItem(c)}};try{if(Xe(s,!0))y();else throw new Error("localStorage support check failed")}catch(S){m(S)}};var dr=Je("batch"),re=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||d.bind(dr.error,dr),this.lock=new cr(e,{storage:this.storage}),this.usePersistence=t.usePersistence,this.pid=t.pid||null,this.memQueue=[]};re.prototype.enqueue=function(e,t,r){var n={id:ht(),flushAfter:new Date().getTime()+t*2,payload:e};this.usePersistence?this.lock.withLock(d.bind(function(){var o;try{var a=this.readFromStorage();a.push(n),o=this.saveToStorage(a),o&&this.memQueue.push(n)}catch{this.reportError("Error enqueueing item",e),o=!1}r&&r(o)},this),d.bind(function(o){this.reportError("Error acquiring storage lock",o),r&&r(!1)},this),this.pid):(this.memQueue.push(n),r&&r(!0))},re.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(this.usePersistence&&t.length<e){var r=this.readFromStorage();if(r.length){var n={};d.each(t,function(a){n[a.id]=!0});for(var i=0;i<r.length;i++){var o=r[i];if(new Date().getTime()>o.flushAfter&&!n[o.id]&&(o.orphaned=!0,t.push(o),t.length>=e))break}}}return t};var fr=function(e,t){var r=[];return d.each(e,function(n){n.id&&!t[n.id]&&r.push(n)}),r};re.prototype.removeItemsByID=function(e,t){var r={};if(d.each(e,function(i){r[i]=!0}),this.memQueue=fr(this.memQueue,r),!this.usePersistence)t&&t(!0);else{var n=d.bind(function(){var i;try{var o=this.readFromStorage();if(o=fr(o,r),i=this.saveToStorage(o),i){o=this.readFromStorage();for(var a=0;a<o.length;a++){var l=o[a];if(l.id&&r[l.id])return this.reportError("Item not removed from storage"),!1}}}catch{this.reportError("Error removing items",e),i=!1}return i},this);this.lock.withLock(function(){var o=n();t&&t(o)},d.bind(function(o){var a=!1;if(this.reportError("Error acquiring storage lock",o),!Xe(this.storage,!0)&&(a=n(),!a))try{this.storage.removeItem(this.storageKey)}catch(l){this.reportError("Error clearing queue",l)}t&&t(a)},this),this.pid)}};var hr=function(e,t){var r=[];return d.each(e,function(n){var i=n.id;if(i in t){var o=t[i];o!==null&&(n.payload=o,r.push(n))}else r.push(n)}),r};re.prototype.updatePayloads=function(e,t){this.memQueue=hr(this.memQueue,e),this.usePersistence?this.lock.withLock(d.bind(function(){var n;try{var i=this.readFromStorage();i=hr(i,e),n=this.saveToStorage(i)}catch{this.reportError("Error updating items",e),n=!1}t&&t(n)},this),d.bind(function(n){this.reportError("Error acquiring storage lock",n),t&&t(!1)},this),this.pid):t&&t(!0)},re.prototype.readFromStorage=function(){var e;try{e=this.storage.getItem(this.storageKey),e&&(e=Ye(e),d.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null))}catch(t){this.reportError("Error retrieving queue",t),e=null}return e||[]},re.prototype.saveToStorage=function(e){try{return this.storage.setItem(this.storageKey,Ke(e)),!0}catch(t){return this.reportError("Error saving queue",t),!1}},re.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var Kn=10*60*1e3,Re=Je("batch"),Q=function(e,t){this.errorReporter=t.errorReporter,this.queue=new re(e,{errorReporter:d.bind(this.reportError,this),storage:t.storage,usePersistence:t.usePersistence}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=t.flushOnlyOnInterval||!1};Q.prototype.enqueue=function(e,t){this.queue.enqueue(e,this.flushInterval,t)},Q.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},Q.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},Q.prototype.clear=function(){this.queue.clear()},Q.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},Q.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},Q.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(d.bind(function(){this.stopped||this.flush()},this),this.flushInterval))},Q.prototype.flush=function(e){try{if(this.requestInProgress){Re.log("Flush: Request already in progress");return}e=e||{};var t=this.libConfig.batch_request_timeout_ms,r=new Date().getTime(),n=this.batchSize,i=this.queue.fillBatch(n),o=i.length===n,a=[],l={};if(d.each(i,function(u){var f=u.payload;if(this.beforeSendHook&&!u.orphaned&&(f=this.beforeSendHook(f)),f){f.event&&f.properties&&(f.properties=d.extend({},f.properties,{mp_sent_by_lib_version:rr.LIB_VERSION}));var m=!0,h=u.id;h?(this.itemIdsSentSuccessfully[h]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:u,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[h]}),m=!1):this.reportError("[dupe] found item with no ID",{item:u}),m&&a.push(f)}l[u.id]=f},this),a.length<1){this.resetFlush();return}this.requestInProgress=!0;var s=d.bind(function(u){this.requestInProgress=!1;try{var f=!1;if(e.unloading)this.queue.updatePayloads(l);else if(d.isObject(u)&&u.error==="timeout"&&new Date().getTime()-r>=t)this.reportError("Network timeout; retrying"),this.flush();else if(d.isObject(u)&&(u.httpStatusCode>=500||u.httpStatusCode===429||u.error==="timeout")){var m=this.flushInterval*2;u.retryAfter&&(m=parseInt(u.retryAfter,10)*1e3||m),m=Math.min(Kn,m),this.reportError("Error; retry in "+m+" ms"),this.scheduleFlush(m)}else if(d.isObject(u)&&u.httpStatusCode===413)if(i.length>1){var h=Math.max(1,Math.floor(n/2));this.batchSize=Math.min(this.batchSize,h,i.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",i),this.resetBatchSize(),f=!0;else f=!0;f&&(this.queue.removeItemsByID(d.map(i,function(g){return g.id}),d.bind(function(g){g?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!o?this.resetFlush():this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this)),d.each(i,d.bind(function(g){var p=g.id;p?(this.itemIdsSentSuccessfully[p]=this.itemIdsSentSuccessfully[p]||0,this.itemIdsSentSuccessfully[p]++,this.itemIdsSentSuccessfully[p]>5&&this.reportError("[dupe] item ID sent too many times",{item:g,batchSize:i.length,timesSent:this.itemIdsSentSuccessfully[p]})):this.reportError("[dupe] found item with no ID while removing",{item:g})},this)))}catch(g){this.reportError("Error handling API response",g),this.resetFlush()}},this),c={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(c.transport="sendBeacon"),Re.log("MIXPANEL REQUEST:",a),this.sendRequest(a,c,s)}catch(u){this.reportError("Error flushing request queue",u),this.resetFlush()}},Q.prototype.reportError=function(e,t){if(Re.error.apply(Re.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(r){Re.error(r)}};var Se=Je("recorder"),pr=P.CompressionStream,Yn={batch_size:1e3,batch_flush_interval_ms:10*1e3,batch_request_timeout_ms:90*1e3,batch_autostart:!0},Qn=new Set([Y.MouseMove,Y.MouseInteraction,Y.Scroll,Y.ViewportResize,Y.Input,Y.TouchMove,Y.MediaInteraction,Y.Drag,Y.Selection]);function Zn(e){return e.type===tr.IncrementalSnapshot&&Qn.has(e.data.source)}var X=function(e){this._mixpanel=e,this._stopRecording=null,this.recEvents=[],this.seqNo=0,this.replayId=null,this.replayStartTime=null,this.sendBatchId=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=$e,this._initBatcher()};X.prototype._initBatcher=function(){this.batcher=new Q("__mprec",{libConfig:Yn,sendRequestFunc:d.bind(this.flushEventsWithOptOut,this),errorReporter:d.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},X.prototype.get_config=function(e){return this._mixpanel.get_config(e)},X.prototype.startRecording=function(e){if(this._stopRecording!==null){Se.log("Recording already in progress, skipping startRecording.");return}this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>$e&&(this.recordMaxMs=$e,Se.critical("record_max_ms cannot be greater than "+$e+"ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=null,this.replayId=d.UUID(),e?this.batcher.stop():this.batcher.start();var t=d.bind(function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(d.bind(function(){Se.log("Idle timeout reached, restarting recording."),this.resetRecording()},this),this.get_config("record_idle_timeout_ms"))},this);this._stopRecording=Oe({emit:d.bind(function(r){this.batcher.enqueue(r),Zn(r)&&(this.batcher.stopped&&this.batcher.start(),t())},this),blockClass:this.get_config("record_block_class"),blockSelector:this.get_config("record_block_selector"),collectFonts:this.get_config("record_collect_fonts"),inlineImages:this.get_config("record_inline_images"),maskAllInputs:!0,maskTextClass:this.get_config("record_mask_text_class"),maskTextSelector:this.get_config("record_mask_text_selector")}),t(),this.maxTimeoutId=setTimeout(d.bind(this.resetRecording,this),this.recordMaxMs)},X.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},X.prototype.stopRecording=function(){this._stopRecording!==null&&(this._stopRecording(),this._stopRecording=null),this.batcher.stopped?this.batcher.clear():(this.batcher.flush(),this.batcher.stop()),this.replayId=null,clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},X.prototype.flushEventsWithOptOut=function(e,t,r){this._flushEvents(e,t,r,d.bind(this._onOptOut,this))},X.prototype._onOptOut=function(e){e===0&&(this.recEvents=[],this.stopRecording())},X.prototype._sendRequest=function(e,t,r){var n=d.bind(function(i,o){i.status===200&&this.seqNo++,r({status:0,httpStatusCode:i.status,responseBody:o,retryAfter:i.headers.get("Retry-After")})},this);P.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record+"?"+new URLSearchParams(e),{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/octet-stream"},body:t}).then(function(i){i.json().then(function(o){n(i,o)}).catch(function(o){r({error:o})})}).catch(function(i){r({error:i})})},X.prototype._flushEvents=$n(function(e,t,r){const n=e.length;if(n>0){var i=e[0].timestamp;this.seqNo===0&&(this.replayStartTime=i);var o=e[n-1].timestamp-this.replayStartTime,a={distinct_id:String(this._mixpanel.get_distinct_id()),seq:this.seqNo,batch_start_time:i/1e3,replay_id:this.replayId,replay_length_ms:o,replay_start_time:this.replayStartTime/1e3},l=d.JSONEncode(e),s=this._mixpanel.get_property("$device_id");s&&(a.$device_id=s);var c=this._mixpanel.get_property("$user_id");if(c&&(a.$user_id=c),pr){var u=new Blob([l],{type:"application/json"}).stream(),f=u.pipeThrough(new pr("gzip"));new Response(f).blob().then(d.bind(function(m){a.format="gzip",this._sendRequest(a,m,r)},this))}else a.format="body",this._sendRequest(a,l,r)}}),X.prototype.reportError=function(e,t){Se.error.apply(Se.error,arguments);try{!t&&!(e instanceof Error)&&(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(r){Se.error(r)}},P.__mp_recorder=X})();
@@ -2,7 +2,7 @@
2
2
 
3
3
  var Config = {
4
4
  DEBUG: false,
5
- LIB_VERSION: '2.54.0'
5
+ LIB_VERSION: '2.54.1'
6
6
  };
7
7
 
8
8
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -2422,7 +2422,11 @@ RequestBatcher.prototype.resetFlush = function() {
2422
2422
  RequestBatcher.prototype.scheduleFlush = function(flushMS) {
2423
2423
  this.flushInterval = flushMS;
2424
2424
  if (!this.stopped) { // don't schedule anymore if batching has been stopped
2425
- this.timeoutID = setTimeout(_.bind(this.flush, this), this.flushInterval);
2425
+ this.timeoutID = setTimeout(_.bind(function() {
2426
+ if (!this.stopped) {
2427
+ this.flush();
2428
+ }
2429
+ }, this), this.flushInterval);
2426
2430
  }
2427
2431
  };
2428
2432
 
@@ -4509,7 +4509,7 @@ define((function () { 'use strict';
4509
4509
 
4510
4510
  var Config = {
4511
4511
  DEBUG: false,
4512
- LIB_VERSION: '2.54.0'
4512
+ LIB_VERSION: '2.54.1'
4513
4513
  };
4514
4514
 
4515
4515
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -7077,7 +7077,11 @@ define((function () { 'use strict';
7077
7077
  RequestBatcher.prototype.scheduleFlush = function(flushMS) {
7078
7078
  this.flushInterval = flushMS;
7079
7079
  if (!this.stopped) { // don't schedule anymore if batching has been stopped
7080
- this.timeoutID = setTimeout(_.bind(this.flush, this), this.flushInterval);
7080
+ this.timeoutID = setTimeout(_.bind(function() {
7081
+ if (!this.stopped) {
7082
+ this.flush();
7083
+ }
7084
+ }, this), this.flushInterval);
7081
7085
  }
7082
7086
  };
7083
7087
 
@@ -7306,7 +7310,7 @@ define((function () { 'use strict';
7306
7310
  ]);
7307
7311
 
7308
7312
  function isUserEvent(ev) {
7309
- return ev.type === EventType.IncrementalSnapshot && ACTIVE_SOURCES.has(ev.source);
7313
+ return ev.type === EventType.IncrementalSnapshot && ACTIVE_SOURCES.has(ev.data.source);
7310
7314
  }
7311
7315
 
7312
7316
  var MixpanelRecorder = function(mixpanelInstance) {
@@ -7344,7 +7348,7 @@ define((function () { 'use strict';
7344
7348
  return this._mixpanel.get_config(configVar);
7345
7349
  };
7346
7350
 
7347
- MixpanelRecorder.prototype.startRecording = function () {
7351
+ MixpanelRecorder.prototype.startRecording = function (shouldStopBatcher) {
7348
7352
  if (this._stopRecording !== null) {
7349
7353
  logger.log('Recording already in progress, skipping startRecording.');
7350
7354
  return;
@@ -7362,7 +7366,14 @@ define((function () { 'use strict';
7362
7366
 
7363
7367
  this.replayId = _.UUID();
7364
7368
 
7365
- this.batcher.start();
7369
+ if (shouldStopBatcher) {
7370
+ // this is the case when we're starting recording after a reset
7371
+ // and don't want to send anything over the network until there's
7372
+ // actual user activity
7373
+ this.batcher.stop();
7374
+ } else {
7375
+ this.batcher.start();
7376
+ }
7366
7377
 
7367
7378
  var resetIdleTimeout = _.bind(function () {
7368
7379
  clearTimeout(this.idleTimeoutId);
@@ -7376,6 +7387,10 @@ define((function () { 'use strict';
7376
7387
  'emit': _.bind(function (ev) {
7377
7388
  this.batcher.enqueue(ev);
7378
7389
  if (isUserEvent(ev)) {
7390
+ if (this.batcher.stopped) {
7391
+ // start flushing again after user activity
7392
+ this.batcher.start();
7393
+ }
7379
7394
  resetIdleTimeout();
7380
7395
  }
7381
7396
  }, this),
@@ -7395,7 +7410,7 @@ define((function () { 'use strict';
7395
7410
 
7396
7411
  MixpanelRecorder.prototype.resetRecording = function () {
7397
7412
  this.stopRecording();
7398
- this.startRecording();
7413
+ this.startRecording(true);
7399
7414
  };
7400
7415
 
7401
7416
  MixpanelRecorder.prototype.stopRecording = function () {
@@ -7404,7 +7419,14 @@ define((function () { 'use strict';
7404
7419
  this._stopRecording = null;
7405
7420
  }
7406
7421
 
7407
- this.batcher.flush(); // flush any remaining events
7422
+ if (this.batcher.stopped) {
7423
+ // never got user activity to flush after reset, so just clear the batcher
7424
+ this.batcher.clear();
7425
+ } else {
7426
+ // flush any remaining events from running batcher
7427
+ this.batcher.flush();
7428
+ this.batcher.stop();
7429
+ }
7408
7430
  this.replayId = null;
7409
7431
 
7410
7432
  clearTimeout(this.idleTimeoutId);
@@ -4509,7 +4509,7 @@ var IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {
4509
4509
 
4510
4510
  var Config = {
4511
4511
  DEBUG: false,
4512
- LIB_VERSION: '2.54.0'
4512
+ LIB_VERSION: '2.54.1'
4513
4513
  };
4514
4514
 
4515
4515
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -7077,7 +7077,11 @@ RequestBatcher.prototype.resetFlush = function() {
7077
7077
  RequestBatcher.prototype.scheduleFlush = function(flushMS) {
7078
7078
  this.flushInterval = flushMS;
7079
7079
  if (!this.stopped) { // don't schedule anymore if batching has been stopped
7080
- this.timeoutID = setTimeout(_.bind(this.flush, this), this.flushInterval);
7080
+ this.timeoutID = setTimeout(_.bind(function() {
7081
+ if (!this.stopped) {
7082
+ this.flush();
7083
+ }
7084
+ }, this), this.flushInterval);
7081
7085
  }
7082
7086
  };
7083
7087
 
@@ -7306,7 +7310,7 @@ var ACTIVE_SOURCES = new Set([
7306
7310
  ]);
7307
7311
 
7308
7312
  function isUserEvent(ev) {
7309
- return ev.type === EventType.IncrementalSnapshot && ACTIVE_SOURCES.has(ev.source);
7313
+ return ev.type === EventType.IncrementalSnapshot && ACTIVE_SOURCES.has(ev.data.source);
7310
7314
  }
7311
7315
 
7312
7316
  var MixpanelRecorder = function(mixpanelInstance) {
@@ -7344,7 +7348,7 @@ MixpanelRecorder.prototype.get_config = function(configVar) {
7344
7348
  return this._mixpanel.get_config(configVar);
7345
7349
  };
7346
7350
 
7347
- MixpanelRecorder.prototype.startRecording = function () {
7351
+ MixpanelRecorder.prototype.startRecording = function (shouldStopBatcher) {
7348
7352
  if (this._stopRecording !== null) {
7349
7353
  logger.log('Recording already in progress, skipping startRecording.');
7350
7354
  return;
@@ -7362,7 +7366,14 @@ MixpanelRecorder.prototype.startRecording = function () {
7362
7366
 
7363
7367
  this.replayId = _.UUID();
7364
7368
 
7365
- this.batcher.start();
7369
+ if (shouldStopBatcher) {
7370
+ // this is the case when we're starting recording after a reset
7371
+ // and don't want to send anything over the network until there's
7372
+ // actual user activity
7373
+ this.batcher.stop();
7374
+ } else {
7375
+ this.batcher.start();
7376
+ }
7366
7377
 
7367
7378
  var resetIdleTimeout = _.bind(function () {
7368
7379
  clearTimeout(this.idleTimeoutId);
@@ -7376,6 +7387,10 @@ MixpanelRecorder.prototype.startRecording = function () {
7376
7387
  'emit': _.bind(function (ev) {
7377
7388
  this.batcher.enqueue(ev);
7378
7389
  if (isUserEvent(ev)) {
7390
+ if (this.batcher.stopped) {
7391
+ // start flushing again after user activity
7392
+ this.batcher.start();
7393
+ }
7379
7394
  resetIdleTimeout();
7380
7395
  }
7381
7396
  }, this),
@@ -7395,7 +7410,7 @@ MixpanelRecorder.prototype.startRecording = function () {
7395
7410
 
7396
7411
  MixpanelRecorder.prototype.resetRecording = function () {
7397
7412
  this.stopRecording();
7398
- this.startRecording();
7413
+ this.startRecording(true);
7399
7414
  };
7400
7415
 
7401
7416
  MixpanelRecorder.prototype.stopRecording = function () {
@@ -7404,7 +7419,14 @@ MixpanelRecorder.prototype.stopRecording = function () {
7404
7419
  this._stopRecording = null;
7405
7420
  }
7406
7421
 
7407
- this.batcher.flush(); // flush any remaining events
7422
+ if (this.batcher.stopped) {
7423
+ // never got user activity to flush after reset, so just clear the batcher
7424
+ this.batcher.clear();
7425
+ } else {
7426
+ // flush any remaining events from running batcher
7427
+ this.batcher.flush();
7428
+ this.batcher.stop();
7429
+ }
7408
7430
  this.replayId = null;
7409
7431
 
7410
7432
  clearTimeout(this.idleTimeoutId);
@@ -3,7 +3,7 @@
3
3
 
4
4
  var Config = {
5
5
  DEBUG: false,
6
- LIB_VERSION: '2.54.0'
6
+ LIB_VERSION: '2.54.1'
7
7
  };
8
8
 
9
9
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -2423,7 +2423,11 @@
2423
2423
  RequestBatcher.prototype.scheduleFlush = function(flushMS) {
2424
2424
  this.flushInterval = flushMS;
2425
2425
  if (!this.stopped) { // don't schedule anymore if batching has been stopped
2426
- this.timeoutID = setTimeout(_.bind(this.flush, this), this.flushInterval);
2426
+ this.timeoutID = setTimeout(_.bind(function() {
2427
+ if (!this.stopped) {
2428
+ this.flush();
2429
+ }
2430
+ }, this), this.flushInterval);
2427
2431
  }
2428
2432
  };
2429
2433
 
@@ -1,10 +1,10 @@
1
1
  (function() {
2
2
  var l=void 0,m=!0,r=null,D=!1;
3
3
  (function(){function Ba(){function a(){if(!a.Gc)la=a.Gc=m,ma=D,c.a(F,function(a){a.tc()})}function b(){try{v.documentElement.doScroll("left")}catch(d){setTimeout(b,1);return}a()}if(v.addEventListener)"complete"===v.readyState?a():v.addEventListener("DOMContentLoaded",a,D);else if(v.attachEvent){v.attachEvent("onreadystatechange",a);var d=D;try{d=o.frameElement===r}catch(f){}v.documentElement.doScroll&&d&&b()}c.Vb(o,"load",a,m)}function Ca(){x.init=function(a,b,d){if(d)return x[d]||(x[d]=F[d]=S(a,
4
- b,d),x[d].ka()),x[d];d=x;if(F.mixpanel)d=F.mixpanel;else if(a)d=S(a,b,"mixpanel"),d.ka(),F.mixpanel=d;x=d;1===ca&&(o.mixpanel=x);Da()}}function Da(){c.a(F,function(a,b){"mixpanel"!==b&&(x[b]=a)});x._=c}function da(a){a=c.e(a)?a:c.g(a)?{}:{days:a};return c.extend({},Ea,a)}function S(a,b,d){var f,h="mixpanel"===d?x:x[d];if(h&&0===ca)f=h;else{if(h&&!c.isArray(h)){n.error("You have already initialized "+d);return}f=new e}f.lb={};f.Y(a,b,d);f.people=new j;f.people.Y(f);if(!f.c("skip_first_touch_marketing")){var a=
4
+ b,d),x[d].la()),x[d];d=x;if(F.mixpanel)d=F.mixpanel;else if(a)d=S(a,b,"mixpanel"),d.la(),F.mixpanel=d;x=d;1===ca&&(o.mixpanel=x);Da()}}function Da(){c.a(F,function(a,b){"mixpanel"!==b&&(x[b]=a)});x._=c}function da(a){a=c.e(a)?a:c.g(a)?{}:{days:a};return c.extend({},Ea,a)}function S(a,b,d){var f,h="mixpanel"===d?x:x[d];if(h&&0===ca)f=h;else{if(h&&!c.isArray(h)){n.error("You have already initialized "+d);return}f=new e}f.lb={};f.Y(a,b,d);f.people=new j;f.people.Y(f);if(!f.c("skip_first_touch_marketing")){var a=
5
5
  c.info.Z(r),g={},t=D;c.a(a,function(a,b){(g["initial_"+b]=a)&&(t=m)});t&&f.people.O(g)}J=J||f.c("debug");!c.g(h)&&c.isArray(h)&&(f.Aa.call(f.people,h.people),f.Aa(h));return f}function e(){}function P(){}function Fa(a){return a}function na(a){throw Error(a+" not available in this build.");}function q(a){this.props={};this.Dd=D;this.name=a.persistence_name?"mp_"+a.persistence_name:"mp_"+a.token+"_mixpanel";var b=a.persistence;if("cookie"!==b&&"localStorage"!==b)n.B("Unknown persistence type "+b+"; falling back to cookie"),
6
- b=a.persistence="cookie";this.j="localStorage"===b&&c.localStorage.sa()?c.localStorage:c.cookie;this.load();this.nc(a);this.zd();this.save()}function j(){}function u(){}function C(a,b){this.K=b.K;this.ca=new G(a,{K:c.bind(this.h,this),j:b.j,z:b.z});this.C=b.C;this.bd=b.cd;this.la=b.la;this.md=b.nd;this.G=this.C.batch_size;this.pa=this.C.batch_flush_interval_ms;this.va=!this.C.batch_autostart;this.Ja=0;this.I={};this.Db=b.Db||D}function oa(a,b){var d=[];c.a(a,function(a){var c=a.id;if(c in b){if(c=
7
- b[c],c!==r)a.payload=c,d.push(a)}else d.push(a)});return d}function pa(a,b){var d=[];c.a(a,function(a){a.id&&!b[a.id]&&d.push(a)});return d}function G(a,b){b=b||{};this.P=a;this.j=b.j||window.localStorage;this.h=b.K||c.bind(qa.error,qa);this.Ya=new ra(a,{j:this.j});this.z=b.z;this.ua=b.ua||r;this.D=[]}function ra(a,b){b=b||{};this.P=a;this.j=b.j||window.localStorage;this.Tb=b.Tb||100;this.hc=b.hc||2E3}function T(){this.Qb="submit"}function M(){this.Qb="click"}function E(){}function sa(a){var b=Ga,
6
+ b=a.persistence="cookie";this.j="localStorage"===b&&c.localStorage.ta()?c.localStorage:c.cookie;this.load();this.nc(a);this.zd();this.save()}function j(){}function u(){}function C(a,b){this.K=b.K;this.ca=new G(a,{K:c.bind(this.h,this),j:b.j,z:b.z});this.C=b.C;this.bd=b.cd;this.ma=b.ma;this.md=b.nd;this.G=this.C.batch_size;this.qa=this.C.batch_flush_interval_ms;this.fa=!this.C.batch_autostart;this.Ja=0;this.I={};this.Db=b.Db||D}function oa(a,b){var d=[];c.a(a,function(a){var c=a.id;if(c in b){if(c=
7
+ b[c],c!==r)a.payload=c,d.push(a)}else d.push(a)});return d}function pa(a,b){var d=[];c.a(a,function(a){a.id&&!b[a.id]&&d.push(a)});return d}function G(a,b){b=b||{};this.P=a;this.j=b.j||window.localStorage;this.h=b.K||c.bind(qa.error,qa);this.Ya=new ra(a,{j:this.j});this.z=b.z;this.va=b.va||r;this.D=[]}function ra(a,b){b=b||{};this.P=a;this.j=b.j||window.localStorage;this.Tb=b.Tb||100;this.hc=b.hc||2E3}function T(){this.Qb="submit"}function M(){this.Qb="click"}function E(){}function sa(a){var b=Ga,
8
8
  d=a.split("."),d=d[d.length-1];if(4<d.length||"com"===d||"org"===d)b=Ha;return(a=a.match(b))?a[0]:""}function ea(a){var b=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return a?b.substring(0,a):b}function U(a,b){if(fa!==r&&!b)return fa;var d=m;try{var a=a||window.localStorage,c="__mplss_"+ea(8);a.setItem(c,"xyz");"xyz"!==a.getItem(c)&&(d=D);a.removeItem(c)}catch(h){d=D}return fa=d}function ga(a){return{log:ha(n.log,a),error:ha(n.error,a),B:ha(n.B,a)}}function ha(a,
9
9
  b){return function(){arguments[0]="["+b+"] "+arguments[0];return a.apply(n,arguments)}}function Ia(a,b){ta(m,a,b)}function Ja(a,b){ta(D,a,b)}function Ka(a,b){return"1"===V(b).get(W(a,b))}function ua(a,b){if(La(b))return n.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),m;var d="0"===V(b).get(W(a,b));d&&n.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data.");
10
10
  return d}function K(a){return ia(a,function(a){return this.c(a)})}function H(a){return ia(a,function(a){return this.p(a)})}function N(a){return ia(a,function(a){return this.p(a)})}function Ma(a,b){b=b||{};V(b).remove(W(a,b),!!b.yb,b.wb)}function V(a){a=a||{};return"localStorage"===a.Sb?c.localStorage:c.cookie}function W(a,b){b=b||{};return(b.Rb||Na)+a}function La(a){if(a&&a.Hb)return D;var a=a&&a.window||o,b=a.navigator||{},d=D;c.a([b.doNotTrack,b.msDoNotTrack,a.doNotTrack],function(a){c.i([m,1,"1",
@@ -14,9 +14,9 @@ Y=o.opera,Z=o.screen,z=I.userAgent,ja=Function.prototype.bind,wa=A.forEach,xa=A.
14
14
  ["Mixpanel error:"].concat(c.Q(arguments));try{y.error.apply(y,a)}catch(b){c.a(a,function(a){y.error(a)})}}},B:function(){if(!c.g(y)&&y){var a=["Mixpanel error:"].concat(c.Q(arguments));try{y.error.apply(y,a)}catch(b){c.a(a,function(a){y.error(a)})}}}};c.bind=function(a,b){var d,f;if(ja&&a.bind===ja)return ja.apply(a,L.call(arguments,1));if(!c.Wa(a))throw new TypeError;d=L.call(arguments,2);return f=function(){if(!(this instanceof f))return a.apply(b,d.concat(L.call(arguments)));var c={};c.prototype=
15
15
  a.prototype;var g=new c;c.prototype=r;c=a.apply(g,d.concat(L.call(arguments)));return Object(c)===c?c:g}};c.a=function(a,b,d){if(!(a===r||a===l))if(wa&&a.forEach===wa)a.forEach(b,d);else if(a.length===+a.length)for(var c=0,h=a.length;c<h&&!(c in a&&b.call(d,a[c],c,a)===ka);c++);else for(c in a)if(X.call(a,c)&&b.call(d,a[c],c,a)===ka)break};c.extend=function(a){c.a(L.call(arguments,1),function(b){for(var d in b)b[d]!==l&&(a[d]=b[d])});return a};c.isArray=A||function(a){return"[object Array]"===Q.call(a)};
16
16
  c.Wa=function(a){try{return/^\s*\bfunction\b/.test(a)}catch(b){return D}};c.Oc=function(a){return!(!a||!X.call(a,"callee"))};c.Q=function(a){return!a?[]:a.Q?a.Q():c.isArray(a)||c.Oc(a)?L.call(a):c.Bd(a)};c.map=function(a,b,d){if(ya&&a.map===ya)return a.map(b,d);var f=[];c.a(a,function(a){f.push(b.call(d,a))});return f};c.keys=function(a){var b=[];if(a===r)return b;c.a(a,function(a,c){b[b.length]=c});return b};c.Bd=function(a){var b=[];if(a===r)return b;c.a(a,function(a){b[b.length]=a});return b};
17
- c.Ua=function(a,b){var d=D;if(a===r)return d;if(xa&&a.indexOf===xa)return-1!=a.indexOf(b);c.a(a,function(a){if(d||(d=a===b))return ka});return d};c.i=function(a,b){return-1!==a.indexOf(b)};c.Jb=function(a,b){a.prototype=new b;a.pd=b.prototype};c.e=function(a){return a===Object(a)&&!c.isArray(a)};c.ra=function(a){if(c.e(a)){for(var b in a)if(X.call(a,b))return D;return m}return D};c.g=function(a){return a===l};c.Xa=function(a){return"[object String]"==Q.call(a)};c.Pc=function(a){return"[object Date]"==
18
- Q.call(a)};c.Lb=function(a){return"[object Number]"==Q.call(a)};c.Qc=function(a){return!!(a&&1===a.nodeType)};c.Ma=function(a){c.a(a,function(b,d){c.Pc(b)?a[d]=c.Ic(b):c.e(b)&&(a[d]=c.Ma(b))});return a};c.timestamp=function(){Date.now=Date.now||function(){return+new Date};return Date.now()};c.Ic=function(a){function b(a){return 10>a?"0"+a:a}return a.getUTCFullYear()+"-"+b(a.getUTCMonth()+1)+"-"+b(a.getUTCDate())+"T"+b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds())};c.fa=function(a){var b=
19
- {};c.a(a,function(a,f){c.Xa(a)&&0<a.length&&(b[f]=a)});return b};c.truncate=function(a,b){var d;"string"===typeof a?d=a.slice(0,b):c.isArray(a)?(d=[],c.a(a,function(a){d.push(c.truncate(a,b))})):c.e(a)?(d={},c.a(a,function(a,h){d[h]=c.truncate(a,b)})):d=a;return d};c.ha=function(){return function(a){function b(a,c){var g="",t=0,i=t="",i=0,e=g,p=[],s=c[a];s&&"object"===typeof s&&"function"===typeof s.toJSON&&(s=s.toJSON(a));switch(typeof s){case "string":return d(s);case "number":return isFinite(s)?
17
+ c.Ua=function(a,b){var d=D;if(a===r)return d;if(xa&&a.indexOf===xa)return-1!=a.indexOf(b);c.a(a,function(a){if(d||(d=a===b))return ka});return d};c.i=function(a,b){return-1!==a.indexOf(b)};c.Jb=function(a,b){a.prototype=new b;a.pd=b.prototype};c.e=function(a){return a===Object(a)&&!c.isArray(a)};c.sa=function(a){if(c.e(a)){for(var b in a)if(X.call(a,b))return D;return m}return D};c.g=function(a){return a===l};c.Xa=function(a){return"[object String]"==Q.call(a)};c.Pc=function(a){return"[object Date]"==
18
+ Q.call(a)};c.Lb=function(a){return"[object Number]"==Q.call(a)};c.Qc=function(a){return!!(a&&1===a.nodeType)};c.Ma=function(a){c.a(a,function(b,d){c.Pc(b)?a[d]=c.Ic(b):c.e(b)&&(a[d]=c.Ma(b))});return a};c.timestamp=function(){Date.now=Date.now||function(){return+new Date};return Date.now()};c.Ic=function(a){function b(a){return 10>a?"0"+a:a}return a.getUTCFullYear()+"-"+b(a.getUTCMonth()+1)+"-"+b(a.getUTCDate())+"T"+b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds())};c.ga=function(a){var b=
19
+ {};c.a(a,function(a,f){c.Xa(a)&&0<a.length&&(b[f]=a)});return b};c.truncate=function(a,b){var d;"string"===typeof a?d=a.slice(0,b):c.isArray(a)?(d=[],c.a(a,function(a){d.push(c.truncate(a,b))})):c.e(a)?(d={},c.a(a,function(a,h){d[h]=c.truncate(a,b)})):d=a;return d};c.ia=function(){return function(a){function b(a,c){var g="",t=0,i=t="",i=0,e=g,p=[],s=c[a];s&&"object"===typeof s&&"function"===typeof s.toJSON&&(s=s.toJSON(a));switch(typeof s){case "string":return d(s);case "number":return isFinite(s)?
20
20
  ""+s:"null";case "boolean":case "null":return""+s;case "object":if(!s)return"null";g+=" ";p=[];if("[object Array]"===Q.apply(s)){i=s.length;for(t=0;t<i;t+=1)p[t]=b(t,s)||"null";return i=0===p.length?"[]":g?"[\n"+g+p.join(",\n"+g)+"\n"+e+"]":"["+p.join(",")+"]"}for(t in s)X.call(s,t)&&(i=b(t,s))&&p.push(d(t)+(g?": ":":")+i);return i=0===p.length?"{}":g?"{"+p.join(",")+""+e+"}":"{"+p.join(",")+"}"}}function d(a){var b=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
21
21
  d={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};b.lastIndex=0;return b.test(a)?'"'+a.replace(b,function(a){var b=d[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}return b("",{"":a})}}();c.T=function(){function a(){switch(i){case "t":return h("t"),h("r"),h("u"),h("e"),m;case "f":return h("f"),h("a"),h("l"),h("s"),h("e"),D;case "n":return h("n"),h("u"),h("l"),h("l"),r}g('Unexpected "'+i+'"')}function b(){for(;i&&
22
22
  " ">=i;)h()}function d(){var a,b,d="",c;if('"'===i)for(;h();){if('"'===i)return h(),d;if("\\"===i)if(h(),"u"===i){for(b=c=0;4>b;b+=1){a=parseInt(h(),16);if(!isFinite(a))break;c=16*c+a}d+=String.fromCharCode(c)}else if("string"===typeof k[i])d+=k[i];else break;else d+=i}g("Bad string")}function c(){var a;a="";"-"===i&&(a="-",h("-"));for(;"0"<=i&&"9">=i;)a+=i,h();if("."===i)for(a+=".";h()&&"0"<=i&&"9">=i;)a+=i;if("e"===i||"E"===i){a+=i;h();if("-"===i||"+"===i)a+=i,h();for(;"0"<=i&&"9">=i;)a+=i,h()}a=
@@ -28,59 +28,59 @@ h=b<<16|d<<8|f,b=h>>18&63,d=h>>12&63,f=h>>6&63,h&=63,i[e++]="ABCDEFGHIJKLMNOPQRS
28
28
  c.Kb=function(a){var b,a=a.toLowerCase();for(b=0;b<za.length;b++)if(-1!==a.indexOf(za[b]))return m;return D};c.qc=function(a){var b,d,f,h=[];c.g(b)&&(b="&");c.a(a,function(a,b){d=encodeURIComponent(a.toString());f=encodeURIComponent(b);h[h.length]=f+"="+d});return h.join(b)};c.Qa=function(a,b){var b=b.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),c=RegExp("[\\?&]"+b+"=([^&#]*)").exec(a);if(c===r||c&&"string"!==typeof c[1]&&c[1].length)return"";c=c[1];try{c=decodeURIComponent(c)}catch(f){n.error("Skipping decoding for malformed query param: "+
29
29
  c)}return c.replace(/\+/g," ")};c.cookie={get:function(a){for(var a=a+"=",b=v.cookie.split(";"),c=0;c<b.length;c++){for(var f=b[c];" "==f.charAt(0);)f=f.substring(1,f.length);if(0===f.indexOf(a))return decodeURIComponent(f.substring(a.length,f.length))}return r},parse:function(a){var b;try{b=c.T(c.cookie.get(a))||{}}catch(d){}return b},Gd:function(a,b,c,f,h,g,e){var i="",k="",p="";e?i="; domain="+e:f&&(i=(i=sa(v.location.hostname))?"; domain=."+i:"");c&&(k=new Date,k.setTime(k.getTime()+1E3*c),k=
30
30
  "; expires="+k.toGMTString());g&&(h=m,p="; SameSite=None");h&&(p+="; secure");v.cookie=a+"="+encodeURIComponent(b)+k+"; path=/"+i+p},set:function(a,b,c,f,h,g,e){var i="",k="",p="";e?i="; domain="+e:f&&(i=(i=sa(v.location.hostname))?"; domain=."+i:"");c&&(k=new Date,k.setTime(k.getTime()+864E5*c),k="; expires="+k.toGMTString());g&&(h=m,p="; SameSite=None");h&&(p+="; secure");a=a+"="+encodeURIComponent(b)+k+"; path=/"+i+p;return v.cookie=a},remove:function(a,b,d){c.cookie.set(a,"",-1,b,D,D,d)}};var fa=
31
- r;c.localStorage={sa:function(a){(a=U(r,a))||n.error("localStorage unsupported; falling back to cookie store");return a},error:function(a){n.error("localStorage error: "+a)},get:function(a){try{return window.localStorage.getItem(a)}catch(b){c.localStorage.error(b)}return r},parse:function(a){try{return c.T(c.localStorage.get(a))||{}}catch(b){}return r},set:function(a,b){try{window.localStorage.setItem(a,b)}catch(d){c.localStorage.error(d)}},remove:function(a){try{window.localStorage.removeItem(a)}catch(b){c.localStorage.error(b)}}};
31
+ r;c.localStorage={ta:function(a){(a=U(r,a))||n.error("localStorage unsupported; falling back to cookie store");return a},error:function(a){n.error("localStorage error: "+a)},get:function(a){try{return window.localStorage.getItem(a)}catch(b){c.localStorage.error(b)}return r},parse:function(a){try{return c.T(c.localStorage.get(a))||{}}catch(b){}return r},set:function(a,b){try{window.localStorage.setItem(a,b)}catch(d){c.localStorage.error(d)}},remove:function(a){try{window.localStorage.removeItem(a)}catch(b){c.localStorage.error(b)}}};
32
32
  c.Vb=function(){function a(a,f,h){return function(g){if(g=g||b(window.event)){var e=m,i;c.Wa(h)&&(i=h(g));g=f.call(a,g);if(D===i||D===g)e=D;return e}}}function b(a){if(a)a.preventDefault=b.preventDefault,a.stopPropagation=b.stopPropagation;return a}b.preventDefault=function(){this.returnValue=D};b.stopPropagation=function(){this.cancelBubble=m};return function(b,c,h,g,e){b?b.addEventListener&&!g?b.addEventListener(c,h,!!e):(c="on"+c,b[c]=a(b,h,b[c])):n.error("No valid element provided to register_event")}}();
33
33
  var Oa=/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/;c.Fc=function(){function a(a,b){return 0<=(" "+a.className+" ").replace(d," ").indexOf(" "+b+" ")}function b(b){if(!v.getElementsByTagName)return[];var b=b.split(" "),d,g,e,i,k,p,s,w=[v];for(i=0;i<b.length;i++)if(d=b[i].replace(/^\s+/,"").replace(/\s+$/,""),-1<d.indexOf("#")){g=d.split("#");d=g[0];w=v.getElementById(g[1]);if(!w||d&&w.nodeName.toLowerCase()!=d)return[];w=[w]}else if(-1<d.indexOf(".")){g=d.split(".");d=g[0];var B=g[1];d||(d="*");
34
34
  g=[];for(k=e=0;k<w.length;k++){s="*"==d?w[k].all?w[k].all:w[k].getElementsByTagName("*"):w[k].getElementsByTagName(d);for(p=0;p<s.length;p++)g[e++]=s[p]}w=[];for(k=d=0;k<g.length;k++)g[k].className&&c.Xa(g[k].className)&&a(g[k],B)&&(w[d++]=g[k])}else if(g=d.match(Oa)){d=g[1];var j=g[2],B=g[3],o=g[4];d||(d="*");g=[];for(k=e=0;k<w.length;k++){s="*"==d?w[k].all?w[k].all:w[k].getElementsByTagName("*"):w[k].getElementsByTagName(d);for(p=0;p<s.length;p++)g[e++]=s[p]}w=[];d=0;switch(B){case "=":B=function(a){return a.getAttribute(j)==
35
35
  o};break;case "~":B=function(a){return a.getAttribute(j).match(RegExp("\\b"+o+"\\b"))};break;case "|":B=function(a){return a.getAttribute(j).match(RegExp("^"+o+"-?"))};break;case "^":B=function(a){return 0===a.getAttribute(j).indexOf(o)};break;case "$":B=function(a){return a.getAttribute(j).lastIndexOf(o)==a.getAttribute(j).length-o.length};break;case "*":B=function(a){return-1<a.getAttribute(j).indexOf(o)};break;default:B=function(a){return a.getAttribute(j)}}w=[];for(k=d=0;k<g.length;k++)B(g[k])&&
36
36
  (w[d++]=g[k])}else{g=[];for(k=e=0;k<w.length;k++){s=w[k].getElementsByTagName(d);for(p=0;p<s.length;p++)g[e++]=s[p]}w=g}return w}var d=/[\t\r\n]/g;return function(a){return c.Qc(a)?[a]:c.e(a)&&!c.g(a.length)?a:b.call(this,a)}}();var Pa=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],Qa="dclid,fbclid,gclid,ko_click_id,li_fat_id,msclkid,ttclid,twclid,wbraid".split(",");c.info={Z:function(a){var b="",d={};c.a(Pa,function(f){b=c.Qa(v.URL,f);b.length?d[f]=b:a!==l&&(d[f]=a)});return d},
37
37
  vb:function(){var a="",b={};c.a(Qa,function(d){a=c.Qa(v.URL,d);a.length&&(b[d]=a)});return b},Rc:function(){return c.extend(c.info.Z(),c.info.vb())},Zc:function(a){return 0===a.search("https?://(.*)google.([^/?]*)")?"google":0===a.search("https?://(.*)bing.com")?"bing":0===a.search("https?://(.*)yahoo.com")?"yahoo":0===a.search("https?://(.*)duckduckgo.com")?"duckduckgo":r},$c:function(a){var b=c.info.Zc(a),d={};if(b!==r)d.$search_engine=b,a=c.Qa(a,"yahoo"!=b?"q":"p"),a.length&&(d.mp_keyword=a);return d},
38
- ma:function(a,b,d){return d||c.i(a," OPR/")?c.i(a,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(a)?"BlackBerry":c.i(a,"IEMobile")||c.i(a,"WPDesktop")?"Internet Explorer Mobile":c.i(a,"SamsungBrowser/")?"Samsung Internet":c.i(a,"Edge")||c.i(a,"Edg/")?"Microsoft Edge":c.i(a,"FBIOS")?"Facebook Mobile":c.i(a,"Chrome")?"Chrome":c.i(a,"CriOS")?"Chrome iOS":c.i(a,"UCWEB")||c.i(a,"UCBrowser")?"UC Browser":c.i(a,"FxiOS")?"Firefox iOS":c.i(b||"","Apple")?c.i(a,"Mobile")?"Mobile Safari":"Safari":
38
+ na:function(a,b,d){return d||c.i(a," OPR/")?c.i(a,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(a)?"BlackBerry":c.i(a,"IEMobile")||c.i(a,"WPDesktop")?"Internet Explorer Mobile":c.i(a,"SamsungBrowser/")?"Samsung Internet":c.i(a,"Edge")||c.i(a,"Edg/")?"Microsoft Edge":c.i(a,"FBIOS")?"Facebook Mobile":c.i(a,"Chrome")?"Chrome":c.i(a,"CriOS")?"Chrome iOS":c.i(a,"UCWEB")||c.i(a,"UCBrowser")?"UC Browser":c.i(a,"FxiOS")?"Firefox iOS":c.i(b||"","Apple")?c.i(a,"Mobile")?"Mobile Safari":"Safari":
39
39
  c.i(a,"Android")?"Android Mobile":c.i(a,"Konqueror")?"Konqueror":c.i(a,"Firefox")?"Firefox":c.i(a,"MSIE")||c.i(a,"Trident/")?"Internet Explorer":c.i(a,"Gecko")?"Mozilla":""},Ia:function(a,b,d){b={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,
40
- Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[c.info.ma(a,b,d)];if(b===l)return r;a=a.match(b);return!a?r:parseFloat(a[a.length-2])},Pb:function(){return/Windows/i.test(z)?/Phone/.test(z)||/WPDesktop/.test(z)?"Windows Phone":"Windows":
40
+ Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[c.info.na(a,b,d)];if(b===l)return r;a=a.match(b);return!a?r:parseFloat(a[a.length-2])},Pb:function(){return/Windows/i.test(z)?/Phone/.test(z)||/WPDesktop/.test(z)?"Windows Phone":"Windows":
41
41
  /(iPhone|iPad|iPod)/.test(z)?"iOS":/Android/.test(z)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(z)?"BlackBerry":/Mac/i.test(z)?"Mac OS X":/Linux/.test(z)?"Linux":/CrOS/.test(z)?"Chrome OS":""},Cb:function(a){return/Windows Phone/i.test(a)||/WPDesktop/.test(a)?"Windows Phone":/iPad/.test(a)?"iPad":/iPod/.test(a)?"iPod Touch":/iPhone/.test(a)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(a)?"BlackBerry":/Android/.test(a)?"Android":""},Ub:function(a){a=a.split("/");return 3<=a.length?a[2]:""},La:function(){return o.location.href},
42
- ba:function(a){"object"!==typeof a&&(a={});return c.extend(c.fa({$os:c.info.Pb(),$browser:c.info.ma(z,I.vendor,Y),$referrer:v.referrer,$referring_domain:c.info.Ub(v.referrer),$device:c.info.Cb(z)}),{$current_url:c.info.La(),$browser_version:c.info.Ia(z,I.vendor,Y),$screen_height:Z.height,$screen_width:Z.width,mp_lib:"web",$lib_version:"2.54.0",$insert_id:ea(),time:c.timestamp()/1E3},c.fa(a))},Vc:function(){return c.extend(c.fa({$os:c.info.Pb(),$browser:c.info.ma(z,I.vendor,Y)}),{$browser_version:c.info.Ia(z,
43
- I.vendor,Y)})},Sc:function(){return c.fa({current_page_title:v.title,current_domain:o.location.hostname,current_url_path:o.location.pathname,current_url_protocol:o.location.protocol,current_url_search:o.location.search})}};var Ha=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Ga=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,$=r,aa=r;if("undefined"!==typeof JSON)$=JSON.stringify,aa=JSON.parse;$=$||c.ha;aa=aa||c.T;c.toArray=c.Q;c.isObject=c.e;c.JSONEncode=c.ha;c.JSONDecode=c.T;c.isBlockedUA=c.Kb;c.isEmptyObject=c.ra;c.info=
44
- c.info;c.info.device=c.info.Cb;c.info.browser=c.info.ma;c.info.browserVersion=c.info.Ia;c.info.properties=c.info.ba;E.prototype.oa=function(){};E.prototype.Oa=function(){};E.prototype.Ga=function(){};E.prototype.Va=function(a){this.Mb=a;return this};E.prototype.o=function(a,b,d,f){var h=this,g=c.Fc(a);if(0===g.length)n.error("The DOM query ("+a+") returned 0 elements");else return c.a(g,function(a){c.Vb(a,this.Qb,function(a){var c={},g=h.oa(d,this),e=h.Mb.c("track_links_timeout");h.Oa(a,this,c);window.setTimeout(h.jc(f,
45
- g,c,m),e);h.Mb.o(b,g,h.jc(f,g,c))})},this),m};E.prototype.jc=function(a,b,c,f){var f=f||D,h=this;return function(){if(!c.Cc)c.Cc=m,a&&a(f,b)===D||h.Ga(b,c,f)}};E.prototype.oa=function(a,b){return"function"===typeof a?a(b):c.extend({},a)};c.Jb(M,E);M.prototype.oa=function(a,b){var c=M.pd.oa.apply(this,arguments);if(b.href)c.url=b.href;return c};M.prototype.Oa=function(a,b,c){c.Nb=2===a.which||a.metaKey||a.ctrlKey||"_blank"===b.target;c.href=b.href;c.Nb||a.preventDefault()};M.prototype.Ga=function(a,
42
+ ba:function(a){"object"!==typeof a&&(a={});return c.extend(c.ga({$os:c.info.Pb(),$browser:c.info.na(z,I.vendor,Y),$referrer:v.referrer,$referring_domain:c.info.Ub(v.referrer),$device:c.info.Cb(z)}),{$current_url:c.info.La(),$browser_version:c.info.Ia(z,I.vendor,Y),$screen_height:Z.height,$screen_width:Z.width,mp_lib:"web",$lib_version:"2.54.1",$insert_id:ea(),time:c.timestamp()/1E3},c.ga(a))},Vc:function(){return c.extend(c.ga({$os:c.info.Pb(),$browser:c.info.na(z,I.vendor,Y)}),{$browser_version:c.info.Ia(z,
43
+ I.vendor,Y)})},Sc:function(){return c.ga({current_page_title:v.title,current_domain:o.location.hostname,current_url_path:o.location.pathname,current_url_protocol:o.location.protocol,current_url_search:o.location.search})}};var Ha=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Ga=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,$=r,aa=r;if("undefined"!==typeof JSON)$=JSON.stringify,aa=JSON.parse;$=$||c.ia;aa=aa||c.T;c.toArray=c.Q;c.isObject=c.e;c.JSONEncode=c.ia;c.JSONDecode=c.T;c.isBlockedUA=c.Kb;c.isEmptyObject=c.sa;c.info=
44
+ c.info;c.info.device=c.info.Cb;c.info.browser=c.info.na;c.info.browserVersion=c.info.Ia;c.info.properties=c.info.ba;E.prototype.pa=function(){};E.prototype.Oa=function(){};E.prototype.Ga=function(){};E.prototype.Va=function(a){this.Mb=a;return this};E.prototype.o=function(a,b,d,f){var h=this,g=c.Fc(a);if(0===g.length)n.error("The DOM query ("+a+") returned 0 elements");else return c.a(g,function(a){c.Vb(a,this.Qb,function(a){var c={},g=h.pa(d,this),e=h.Mb.c("track_links_timeout");h.Oa(a,this,c);window.setTimeout(h.jc(f,
45
+ g,c,m),e);h.Mb.o(b,g,h.jc(f,g,c))})},this),m};E.prototype.jc=function(a,b,c,f){var f=f||D,h=this;return function(){if(!c.Cc)c.Cc=m,a&&a(f,b)===D||h.Ga(b,c,f)}};E.prototype.pa=function(a,b){return"function"===typeof a?a(b):c.extend({},a)};c.Jb(M,E);M.prototype.pa=function(a,b){var c=M.pd.pa.apply(this,arguments);if(b.href)c.url=b.href;return c};M.prototype.Oa=function(a,b,c){c.Nb=2===a.which||a.metaKey||a.ctrlKey||"_blank"===b.target;c.href=b.href;c.Nb||a.preventDefault()};M.prototype.Ga=function(a,
46
46
  b){b.Nb||setTimeout(function(){window.location=b.href},0)};c.Jb(T,E);T.prototype.Oa=function(a,b,c){c.element=b;a.preventDefault()};T.prototype.Ga=function(a,b){setTimeout(function(){b.element.submit()},0)};var Ra=ga("lock");ra.prototype.ib=function(a,b,c){function f(){j.setItem(n,"1");try{a()}finally{j.removeItem(n),j.getItem(q)===k&&j.removeItem(q),j.getItem(o)===k&&j.removeItem(o)}}function h(){j.setItem(o,k);e(g,function(){j.getItem(o)===k?f():i(function(){j.getItem(q)!==k?h():e(function(){return!j.getItem(n)},
47
47
  f)})})}function g(){var a=j.getItem(q);if(a&&a!==k)return D;j.setItem(q,k);if(j.getItem(q)===k)return m;if(!U(j,m))throw Error("localStorage support dropped while acquiring lock");return D}function e(a,b){a()?b():i(function(){e(a,b)})}function i(a){(new Date).getTime()-p>B?(Ra.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+k+"]"),j.removeItem(n),j.removeItem(q),h()):setTimeout(function(){try{a()}catch(c){b&&b(c)}},w*(Math.random()+0.1))}!c&&"function"!==typeof b&&(c=b,b=r);var k=c||
48
48
  (new Date).getTime()+"|"+Math.random(),p=(new Date).getTime(),s=this.P,w=this.Tb,B=this.hc,j=this.j,o=s+":X",q=s+":Y",n=s+":Z";try{if(U(j,m))h();else throw Error("localStorage support check failed");}catch(v){b&&b(v)}};var qa=ga("batch");G.prototype.Na=function(a,b,d){var f={id:ea(),flushAfter:(new Date).getTime()+2*b,payload:a};this.z?this.Ya.ib(c.bind(function(){var b;try{var c=this.ea();c.push(f);(b=this.ab(c))&&this.D.push(f)}catch(e){this.h("Error enqueueing item",a),b=D}d&&d(b)},this),c.bind(function(a){this.h("Error acquiring storage lock",
49
- a);d&&d(D)},this),this.ua):(this.D.push(f),d&&d(m))};G.prototype.Hc=function(a){var b=this.D.slice(0,a);if(this.z&&b.length<a){var d=this.ea();if(d.length){var f={};c.a(b,function(a){f[a.id]=m});for(var h=0;h<d.length;h++){var g=d[h];if((new Date).getTime()>g.flushAfter&&!f[g.id]&&(g.Uc=m,b.push(g),b.length>=a))break}}}return b};G.prototype.Wc=function(a,b){var d={};c.a(a,function(a){d[a]=m});this.D=pa(this.D,d);if(this.z){var f=c.bind(function(){var b;try{var c=this.ea(),c=pa(c,d);if(b=this.ab(c))for(var c=
50
- this.ea(),f=0;f<c.length;f++){var e=c[f];if(e.id&&d[e.id])return this.h("Item not removed from storage"),D}}catch(k){this.h("Error removing items",a),b=D}return b},this);this.Ya.ib(function(){var a=f();b&&b(a)},c.bind(function(a){var c=D;this.h("Error acquiring storage lock",a);if(!U(this.j,m)&&(c=f(),!c))try{this.j.removeItem(this.P)}catch(d){this.h("Error clearing queue",d)}b&&b(c)},this),this.ua)}else b&&b(m)};G.prototype.yd=function(a){this.D=oa(this.D,a);this.z&&this.Ya.ib(c.bind(function(){try{var b=
51
- this.ea(),b=oa(b,a);this.ab(b)}catch(c){this.h("Error updating items",a)}},this),c.bind(function(a){this.h("Error acquiring storage lock",a)},this),this.ua)};G.prototype.ea=function(){var a;try{if(a=this.j.getItem(this.P))a=aa(a),c.isArray(a)||(this.h("Invalid storage entry:",a),a=r)}catch(b){this.h("Error retrieving queue",b),a=r}return a||[]};G.prototype.ab=function(a){try{return this.j.setItem(this.P,$(a)),m}catch(b){return this.h("Error saving queue",b),D}};G.prototype.clear=function(){this.D=
52
- [];this.z&&this.j.removeItem(this.P)};var R=ga("batch");C.prototype.Na=function(a,b){this.ca.Na(a,this.pa,b)};C.prototype.start=function(){this.va=D;this.Ja=0;this.flush()};C.prototype.stop=function(){this.va=m;if(this.eb)clearTimeout(this.eb),this.eb=r};C.prototype.clear=function(){this.ca.clear()};C.prototype.Yb=function(){this.G=this.C.batch_size};C.prototype.N=function(){this.$b(this.C.batch_flush_interval_ms)};C.prototype.$b=function(a){this.pa=a;if(!this.va)this.eb=setTimeout(c.bind(this.flush,
53
- this),this.pa)};C.prototype.flush=function(a){try{if(this.Xb)R.log("Flush: Request already in progress");else{var a=a||{},b=this.C.batch_request_timeout_ms,d=(new Date).getTime(),f=this.G,h=this.ca.Hc(f),e=h.length===f,t=[],i={};c.a(h,function(a){var b=a.payload;this.la&&!a.Uc&&(b=this.la(b));if(b){b.event&&b.properties&&(b.properties=c.extend({},b.properties,{mp_sent_by_lib_version:"2.54.0"}));var d=m,f=a.id;if(f){if(5<(this.I[f]||0))this.h("[dupe] item ID sent too many times, not sending",{item:a,
54
- G:h.length,rd:this.I[f]}),d=D}else this.h("[dupe] found item with no ID",{item:a});d&&t.push(b)}i[a.id]=b},this);if(1>t.length)this.N();else{this.Xb=m;var k=c.bind(function(k){this.Xb=D;try{var t=D;if(a.lc)this.ca.yd(i);else if(c.e(k)&&"timeout"===k.error&&(new Date).getTime()-d>=b)this.h("Network timeout; retrying"),this.flush();else if(c.e(k)&&(500<=k.Sa||429===k.Sa||"timeout"===k.error)){var j=2*this.pa;k.Zb&&(j=1E3*parseInt(k.Zb,10)||j);j=Math.min(6E5,j);this.h("Error; retry in "+j+" ms");this.$b(j)}else if(c.e(k)&&
55
- 413===k.Sa)if(1<h.length){var p=Math.max(1,Math.floor(f/2));this.G=Math.min(this.G,p,h.length-1);this.h("413 response; reducing batch size to "+this.G);this.N()}else this.h("Single-event request too large; dropping",h),this.Yb(),t=m;else t=m;t&&(this.ca.Wc(c.map(h,function(a){return a.id}),c.bind(function(a){a?(this.Ja=0,this.Db&&!e?this.N():this.flush()):(this.h("Failed to remove items from queue"),5<++this.Ja?(this.h("Too many queue failures; disabling batching system."),this.md()):this.N())},this)),
56
- c.a(h,c.bind(function(a){var b=a.id;b?(this.I[b]=this.I[b]||0,this.I[b]++,5<this.I[b]&&this.h("[dupe] item ID sent too many times",{item:a,G:h.length,rd:this.I[b]})):this.h("[dupe] found item with no ID while removing",{item:a})},this)))}catch(s){this.h("Error handling API response",s),this.N()}},this),j={method:"POST",pc:m,Mc:m,ic:b};if(a.lc)j.gb="sendBeacon";R.log("MIXPANEL REQUEST:",t);this.bd(t,j,k)}}}catch(s){this.h("Error flushing request queue",s),this.N()}};C.prototype.h=function(a,b){R.error.apply(R.error,
57
- arguments);if(this.K)try{b instanceof Error||(b=Error(a)),this.K(a,b)}catch(c){R.error(c)}};var Na="__mp_opt_in_out_",A={bc:function(a,b){var d={},f={};c.e(a)?c.a(a,function(a,b){this.A(b)||(f[b]=a)},this):f[a]=b;d.$set=f;return d},mc:function(a){var b={},d=[];c.isArray(a)||(a=[a]);c.a(a,function(a){this.A(a)||d.push(a)},this);b.$unset=d;return b},ec:function(a,b){var d={},f={};c.e(a)?c.a(a,function(a,b){this.A(b)||(f[b]=a)},this):f[a]=b;d.$set_once=f;return d},kc:function(a,b){var d={},f={};c.e(a)?
58
- c.a(a,function(a,b){this.A(b)||(f[b]=c.isArray(a)?a:[a])},this):f[a]=c.isArray(b)?b:[b];d.$union=f;return d},Ac:function(a,b){var d={},f={};c.e(a)?c.a(a,function(a,b){this.A(b)||(f[b]=a)},this):f[a]=b;d.$append=f;return d},Wb:function(a,b){var d={},f={};c.e(a)?c.a(a,function(a,b){this.A(b)||(f[b]=a)},this):f[a]=b;d.$remove=f;return d},Ed:function(){return{$delete:""}}};c.extend(u.prototype,A);u.prototype.Y=function(a,b,c){this.d=a;this.Ca=b;this.Ba=c};u.prototype.set=N(function(a,b,d){var f=this.bc(a,
59
- b);c.e(a)&&(d=b);return this.k(f,d)});u.prototype.O=N(function(a,b,d){var f=this.ec(a,b);c.e(a)&&(d=b);return this.k(f,d)});u.prototype.wa=N(function(a,b){return this.k(this.mc(a),b)});u.prototype.ga=N(function(a,b,d){c.e(a)&&(d=b);return this.k(this.kc(a,b),d)});u.prototype["delete"]=N(function(a){return this.k({$delete:""},a)});u.prototype.remove=N(function(a,b,c){return this.k(this.Wb(a,b),c)});u.prototype.k=function(a,b){a.$group_key=this.Ca;a.$group_id=this.Ba;a.$token=this.p("token");return this.d.Fa({type:"groups",
60
- data:c.Ma(a),H:this.p("api_host")+"/"+this.p("api_routes").groups,Ha:this.d.u.Ra},b)};u.prototype.A=function(a){return"$group_key"===a||"$group_id"===a};u.prototype.p=function(a){return this.d.c(a)};u.prototype.toString=function(){return this.d.toString()+".group."+this.Ca+"."+this.Ba};u.prototype.remove=u.prototype.remove;u.prototype.set=u.prototype.set;u.prototype.set_once=u.prototype.O;u.prototype.union=u.prototype.ga;u.prototype.unset=u.prototype.wa;u.prototype.toString=u.prototype.toString;c.extend(j.prototype,
61
- A);j.prototype.Y=function(a){this.d=a};j.prototype.set=H(function(a,b,d){var f=this.bc(a,b);c.e(a)&&(d=b);this.p("save_referrer")&&this.d.persistence.hb(document.referrer);f.$set=c.extend({},c.info.Vc(),f.$set);return this.k(f,d)});j.prototype.O=H(function(a,b,d){var f=this.ec(a,b);c.e(a)&&(d=b);return this.k(f,d)});j.prototype.wa=H(function(a,b){return this.k(this.mc(a),b)});j.prototype.Ib=H(function(a,b,d){var f={},e={};c.e(a)?(c.a(a,function(a,b){this.A(b)||(isNaN(parseFloat(a))?n.error("Invalid increment value passed to mixpanel.people.increment - must be a number"):
62
- e[b]=a)},this),d=b):(c.g(b)&&(b=1),e[a]=b);f.$add=e;return this.k(f,d)});j.prototype.append=H(function(a,b,d){c.e(a)&&(d=b);return this.k(this.Ac(a,b),d)});j.prototype.remove=H(function(a,b,d){c.e(a)&&(d=b);return this.k(this.Wb(a,b),d)});j.prototype.ga=H(function(a,b,d){c.e(a)&&(d=b);return this.k(this.kc(a,b),d)});j.prototype.ud=H(function(a,b,d){if(!c.Lb(a)&&(a=parseFloat(a),isNaN(a))){n.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",
63
- c.extend({$amount:a},b),d)});j.prototype.tb=function(a){return this.set("$transactions",[],a)};j.prototype.Bb=function(){if(this.Da())return this.k({$delete:this.d.M()});n.error("mixpanel.people.delete_user() requires you to call identify() first")};j.prototype.toString=function(){return this.d.toString()+".people"};j.prototype.k=function(a,b){a.$token=this.p("token");a.$distinct_id=this.d.M();var d=this.d.s("$device_id"),f=this.d.s("$user_id"),e=this.d.s("$had_persisted_distinct_id");d&&(a.$device_id=
64
- d);f&&(a.$user_id=f);e&&(a.$had_persisted_distinct_id=e);d=c.Ma(a);return!this.Da()?(this.uc(a),c.g(b)||(this.p("verbose")?b({status:-1,error:r}):b(-1)),c.truncate(d,255)):this.d.Fa({type:"people",data:d,H:this.p("api_host")+"/"+this.p("api_routes").engage,Ha:this.d.u.$a},b)};j.prototype.p=function(a){return this.d.c(a)};j.prototype.Da=function(){return this.d.V.Gb===m};j.prototype.uc=function(a){"$set"in a?this.d.persistence.q("$set",a):"$set_once"in a?this.d.persistence.q("$set_once",a):"$unset"in
65
- a?this.d.persistence.q("$unset",a):"$add"in a?this.d.persistence.q("$add",a):"$append"in a?this.d.persistence.q("$append",a):"$remove"in a?this.d.persistence.q("$remove",a):"$union"in a?this.d.persistence.q("$union",a):n.error("Invalid call to _enqueue():",a)};j.prototype.W=function(a,b,d,f){var e=this,g=c.extend({},this.d.persistence.aa(a)),j=g;!c.g(g)&&c.e(g)&&!c.ra(g)&&(e.d.persistence.v(a,g),e.d.persistence.save(),f&&(j=f(g)),b.call(e,j,function(b,f){0===b&&e.d.persistence.q(a,g);c.g(d)||d(b,
66
- f)}))};j.prototype.vc=function(a,b,d,f,e,g,j){var i=this;this.W("$set",this.set,a);this.W("$set_once",this.O,f);this.W("$unset",this.wa,g,function(a){return c.keys(a)});this.W("$add",this.Ib,b);this.W("$union",this.ga,e);a=this.d.persistence.aa("$append");if(!c.g(a)&&c.isArray(a)&&a.length)for(var k,b=function(a,b){0===a&&i.d.persistence.q("$append",k);c.g(d)||d(a,b)},f=a.length-1;0<=f;f--)a=this.d.persistence.aa("$append"),k=a.pop(),i.d.persistence.save(),c.ra(k)||i.append(k,b);a=this.d.persistence.aa("$remove");
67
- if(!c.g(a)&&c.isArray(a)&&a.length)for(var p,b=function(a,b){0===a&&i.d.persistence.q("$remove",p);c.g(j)||j(a,b)},f=a.length-1;0<=f;f--)a=this.d.persistence.aa("$remove"),p=a.pop(),i.d.persistence.save(),c.ra(p)||i.remove(p,b)};j.prototype.A=function(a){return"$distinct_id"===a||"$token"===a||"$device_id"===a||"$user_id"===a||"$had_persisted_distinct_id"===a};j.prototype.set=j.prototype.set;j.prototype.set_once=j.prototype.O;j.prototype.unset=j.prototype.wa;j.prototype.increment=j.prototype.Ib;j.prototype.append=
68
- j.prototype.append;j.prototype.remove=j.prototype.remove;j.prototype.union=j.prototype.ga;j.prototype.track_charge=j.prototype.ud;j.prototype.clear_charges=j.prototype.tb;j.prototype.delete_user=j.prototype.Bb;j.prototype.toString=j.prototype.toString;var Sa="__mps,__mpso,__mpus,__mpa,__mpap,__mpr,__mpu,$people_distinct_id,__alias,__timers".split(",");q.prototype.ba=function(){var a={};this.load();c.a(this.props,function(b,d){c.Ua(Sa,d)||(a[d]=b)});return a};q.prototype.load=function(){if(!this.disabled){var a=
69
- this.j.parse(this.name);a&&(this.props=c.extend({},a))}};q.prototype.zd=function(){var a;this.j===c.localStorage?(a=c.cookie.parse(this.name),c.cookie.remove(this.name),c.cookie.remove(this.name,m),a&&this.w(a)):this.j===c.cookie&&(a=c.localStorage.parse(this.name),c.localStorage.remove(this.name),a&&this.w(a))};q.prototype.save=function(){this.disabled||this.j.set(this.name,c.ha(this.props),this.Pa,this.Ka,this.ac,this.zb,this.na)};q.prototype.ta=function(a){this.load();return this.props[a]};q.prototype.remove=
70
- function(){this.j.remove(this.name,D,this.na);this.j.remove(this.name,m,this.na)};q.prototype.clear=function(){this.remove();this.props={}};q.prototype.w=function(a,b,d){return c.e(a)?("undefined"===typeof b&&(b="None"),this.Pa="undefined"===typeof d?this.Ab:d,this.load(),c.a(a,function(a,c){if(!this.props.hasOwnProperty(c)||this.props[c]===b)this.props[c]=a},this),this.save(),m):D};q.prototype.m=function(a,b){return c.e(a)?(this.Pa="undefined"===typeof b?this.Ab:b,this.load(),c.extend(this.props,
71
- a),this.save(),m):D};q.prototype.S=function(a){this.load();a in this.props&&(delete this.props[a],this.save())};q.prototype.oc=function(a){this.m(c.info.$c(a))};q.prototype.hb=function(a){this.w({$initial_referrer:a||"$direct",$initial_referring_domain:c.info.Ub(a)||"$direct"},"")};q.prototype.Lc=function(){return c.fa({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})};q.prototype.nc=function(a){this.Ab=this.Pa=a.cookie_expiration;this.dc(a.disable_persistence);
72
- this.ed(a.cookie_domain);this.fd(a.cross_site_cookie);this.gd(a.cross_subdomain_cookie);this.kd(a.secure_cookie)};q.prototype.dc=function(a){(this.disabled=a)?this.remove():this.save()};q.prototype.ed=function(a){if(a!==this.na)this.remove(),this.na=a,this.save()};q.prototype.fd=function(a){if(a!==this.zb)this.zb=a,this.remove(),this.save()};q.prototype.gd=function(a){if(a!==this.Ka)this.Ka=a,this.remove(),this.save()};q.prototype.Jc=function(){return this.Ka};q.prototype.kd=function(a){if(a!==this.ac)this.ac=
73
- a?m:D,this.remove(),this.save()};q.prototype.q=function(a,b){var d=this.ja(a),f=b[a],e=this.F("$set"),g=this.F("$set_once"),j=this.F("$unset"),i=this.F("$add"),k=this.F("$union"),p=this.F("$remove",[]),o=this.F("$append",[]);"__mps"===d?(c.extend(e,f),this.v("$add",f),this.v("$union",f),this.v("$unset",f)):"__mpso"===d?(c.a(f,function(a,b){b in g||(g[b]=a)}),this.v("$unset",f)):"__mpus"===d?c.a(f,function(a){c.a([e,g,i,k],function(b){a in b&&delete b[a]});c.a(o,function(b){a in b&&delete b[a]});j[a]=
74
- m}):"__mpa"===d?(c.a(f,function(a,b){b in e?e[b]+=a:(b in i||(i[b]=0),i[b]+=a)},this),this.v("$unset",f)):"__mpu"===d?(c.a(f,function(a,b){c.isArray(a)&&(b in k||(k[b]=[]),k[b]=k[b].concat(a))}),this.v("$unset",f)):"__mpr"===d?(p.push(f),this.v("$append",f)):"__mpap"===d&&(o.push(f),this.v("$unset",f));n.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):");n.log(b);this.save()};q.prototype.v=function(a,b){var d=this.props[this.ja(a)];c.g(d)||c.a(b,function(b,e){"$append"===a||"$remove"===a?
75
- c.a(d,function(a){a[e]===b&&delete a[e]}):delete d[e]},this)};q.prototype.aa=function(a){return this.ta(this.ja(a))};q.prototype.ja=function(a){if("$set"===a)return"__mps";if("$set_once"===a)return"__mpso";if("$unset"===a)return"__mpus";if("$add"===a)return"__mpa";if("$append"===a)return"__mpap";if("$remove"===a)return"__mpr";if("$union"===a)return"__mpu";n.error("Invalid queue:",a)};q.prototype.F=function(a,b){var d=this.ja(a),b=c.g(b)?{}:b;return this.props[d]||(this.props[d]=b)};q.prototype.hd=
76
- function(a){var b=(new Date).getTime(),c=this.ta("__timers")||{};c[a]=b;this.props.__timers=c;this.save()};q.prototype.Xc=function(a){var b=(this.ta("__timers")||{})[a];c.g(b)||(delete this.props.__timers[a],this.save());return b};var ca,x,O=o.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,ma=!O&&-1===z.indexOf("MSIE")&&-1===z.indexOf("Mozilla"),ba=r;I.sendBeacon&&(ba=function(){return I.sendBeacon.apply(I,arguments)});var A={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},
77
- Aa={api_host:"https://api-js.mixpanel.com",api_routes:A,api_method:"POST",api_transport:"XHR",api_payload_format:"base64",app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:D,cross_subdomain_cookie:m,error_reporter:P,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:P,mp_loader:r,track_marketing:m,track_pageview:D,skip_first_touch_marketing:D,store_google:m,stop_utm_persistence:D,save_referrer:m,test:D,verbose:D,img:D,debug:D,track_links_timeout:300,
78
- cookie_expiration:365,upgrade:D,disable_persistence:D,disable_cookie:D,secure_cookie:D,ip:m,opt_out_tracking_by_default:D,opt_out_persistence_by_default:D,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:r,property_blacklist:[],xhr_headers:{},ignore_dnt:D,batch_requests:m,batch_size:50,batch_flush_interval_ms:5E3,batch_request_timeout_ms:9E4,batch_autostart:m,hooks:{},record_block_class:/^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$/,record_block_selector:"img, video",
79
- record_collect_fonts:D,record_idle_timeout_ms:18E5,record_inline_images:D,record_mask_text_class:/^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$/,record_mask_text_selector:"*",record_max_ms:864E5,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},la=D;e.prototype.Va=function(a,b,d){if(c.g(d))this.l("You must name your new library: init(token, config, name)");else if("mixpanel"===d)this.l("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");
80
- else return a=S(a,b,d),x[d]=a,a.ka(),a};e.prototype.Y=function(a,b,d){b=b||{};this.__loaded=m;this.config={};var f={};"api_payload_format"in b||(b.api_host||Aa.api_host).match(/\.mixpanel\.com/)&&(f.api_payload_format="json");this.cc(c.extend({},Aa,f,b,{name:d,token:a,callback_fn:("mixpanel"===d?d:"mixpanel."+d)+"._jsc"}));this._jsc=P;this.ya=[];this.za=[];this.xa=[];this.V={disable_all_events:D,identify_called:D};this.u={};if(this.U=this.c("batch_requests"))if(!c.localStorage.sa(m)||!O)this.U=D,
81
- n.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),c.a(this.Eb(),function(a){n.log("Clearing batch queue "+a.da);c.localStorage.remove(a.da)});else if(this.Nc(),ba&&o.addEventListener){var e=c.bind(function(){this.u.L.va||this.u.L.flush({lc:m})},this);o.addEventListener("pagehide",function(a){a.persisted&&e()});o.addEventListener("visibilitychange",function(){"hidden"===v.visibilityState&&e()})}this.persistence=this.cookie=new q(this.config);this.R={};this.wc();a=c.jb();
49
+ a);d&&d(D)},this),this.va):(this.D.push(f),d&&d(m))};G.prototype.Hc=function(a){var b=this.D.slice(0,a);if(this.z&&b.length<a){var d=this.ea();if(d.length){var f={};c.a(b,function(a){f[a.id]=m});for(var h=0;h<d.length;h++){var g=d[h];if((new Date).getTime()>g.flushAfter&&!f[g.id]&&(g.Uc=m,b.push(g),b.length>=a))break}}}return b};G.prototype.Wc=function(a,b){var d={};c.a(a,function(a){d[a]=m});this.D=pa(this.D,d);if(this.z){var f=c.bind(function(){var b;try{var c=this.ea(),c=pa(c,d);if(b=this.ab(c))for(var c=
50
+ this.ea(),f=0;f<c.length;f++){var e=c[f];if(e.id&&d[e.id])return this.h("Item not removed from storage"),D}}catch(k){this.h("Error removing items",a),b=D}return b},this);this.Ya.ib(function(){var a=f();b&&b(a)},c.bind(function(a){var c=D;this.h("Error acquiring storage lock",a);if(!U(this.j,m)&&(c=f(),!c))try{this.j.removeItem(this.P)}catch(d){this.h("Error clearing queue",d)}b&&b(c)},this),this.va)}else b&&b(m)};G.prototype.yd=function(a){this.D=oa(this.D,a);this.z&&this.Ya.ib(c.bind(function(){try{var b=
51
+ this.ea(),b=oa(b,a);this.ab(b)}catch(c){this.h("Error updating items",a)}},this),c.bind(function(a){this.h("Error acquiring storage lock",a)},this),this.va)};G.prototype.ea=function(){var a;try{if(a=this.j.getItem(this.P))a=aa(a),c.isArray(a)||(this.h("Invalid storage entry:",a),a=r)}catch(b){this.h("Error retrieving queue",b),a=r}return a||[]};G.prototype.ab=function(a){try{return this.j.setItem(this.P,$(a)),m}catch(b){return this.h("Error saving queue",b),D}};G.prototype.clear=function(){this.D=
52
+ [];this.z&&this.j.removeItem(this.P)};var R=ga("batch");C.prototype.Na=function(a,b){this.ca.Na(a,this.qa,b)};C.prototype.start=function(){this.fa=D;this.Ja=0;this.flush()};C.prototype.stop=function(){this.fa=m;if(this.eb)clearTimeout(this.eb),this.eb=r};C.prototype.clear=function(){this.ca.clear()};C.prototype.Yb=function(){this.G=this.C.batch_size};C.prototype.N=function(){this.$b(this.C.batch_flush_interval_ms)};C.prototype.$b=function(a){this.qa=a;if(!this.fa)this.eb=setTimeout(c.bind(function(){this.fa||
53
+ this.flush()},this),this.qa)};C.prototype.flush=function(a){try{if(this.Xb)R.log("Flush: Request already in progress");else{var a=a||{},b=this.C.batch_request_timeout_ms,d=(new Date).getTime(),f=this.G,h=this.ca.Hc(f),e=h.length===f,t=[],i={};c.a(h,function(a){var b=a.payload;this.ma&&!a.Uc&&(b=this.ma(b));if(b){b.event&&b.properties&&(b.properties=c.extend({},b.properties,{mp_sent_by_lib_version:"2.54.1"}));var d=m,f=a.id;if(f){if(5<(this.I[f]||0))this.h("[dupe] item ID sent too many times, not sending",
54
+ {item:a,G:h.length,rd:this.I[f]}),d=D}else this.h("[dupe] found item with no ID",{item:a});d&&t.push(b)}i[a.id]=b},this);if(1>t.length)this.N();else{this.Xb=m;var k=c.bind(function(k){this.Xb=D;try{var t=D;if(a.lc)this.ca.yd(i);else if(c.e(k)&&"timeout"===k.error&&(new Date).getTime()-d>=b)this.h("Network timeout; retrying"),this.flush();else if(c.e(k)&&(500<=k.Sa||429===k.Sa||"timeout"===k.error)){var j=2*this.qa;k.Zb&&(j=1E3*parseInt(k.Zb,10)||j);j=Math.min(6E5,j);this.h("Error; retry in "+j+" ms");
55
+ this.$b(j)}else if(c.e(k)&&413===k.Sa)if(1<h.length){var p=Math.max(1,Math.floor(f/2));this.G=Math.min(this.G,p,h.length-1);this.h("413 response; reducing batch size to "+this.G);this.N()}else this.h("Single-event request too large; dropping",h),this.Yb(),t=m;else t=m;t&&(this.ca.Wc(c.map(h,function(a){return a.id}),c.bind(function(a){a?(this.Ja=0,this.Db&&!e?this.N():this.flush()):(this.h("Failed to remove items from queue"),5<++this.Ja?(this.h("Too many queue failures; disabling batching system."),
56
+ this.md()):this.N())},this)),c.a(h,c.bind(function(a){var b=a.id;b?(this.I[b]=this.I[b]||0,this.I[b]++,5<this.I[b]&&this.h("[dupe] item ID sent too many times",{item:a,G:h.length,rd:this.I[b]})):this.h("[dupe] found item with no ID while removing",{item:a})},this)))}catch(s){this.h("Error handling API response",s),this.N()}},this),j={method:"POST",pc:m,Mc:m,ic:b};if(a.lc)j.gb="sendBeacon";R.log("MIXPANEL REQUEST:",t);this.bd(t,j,k)}}}catch(s){this.h("Error flushing request queue",s),this.N()}};C.prototype.h=
57
+ function(a,b){R.error.apply(R.error,arguments);if(this.K)try{b instanceof Error||(b=Error(a)),this.K(a,b)}catch(c){R.error(c)}};var Na="__mp_opt_in_out_",A={bc:function(a,b){var d={},f={};c.e(a)?c.a(a,function(a,b){this.A(b)||(f[b]=a)},this):f[a]=b;d.$set=f;return d},mc:function(a){var b={},d=[];c.isArray(a)||(a=[a]);c.a(a,function(a){this.A(a)||d.push(a)},this);b.$unset=d;return b},ec:function(a,b){var d={},f={};c.e(a)?c.a(a,function(a,b){this.A(b)||(f[b]=a)},this):f[a]=b;d.$set_once=f;return d},
58
+ kc:function(a,b){var d={},f={};c.e(a)?c.a(a,function(a,b){this.A(b)||(f[b]=c.isArray(a)?a:[a])},this):f[a]=c.isArray(b)?b:[b];d.$union=f;return d},Ac:function(a,b){var d={},f={};c.e(a)?c.a(a,function(a,b){this.A(b)||(f[b]=a)},this):f[a]=b;d.$append=f;return d},Wb:function(a,b){var d={},f={};c.e(a)?c.a(a,function(a,b){this.A(b)||(f[b]=a)},this):f[a]=b;d.$remove=f;return d},Ed:function(){return{$delete:""}}};c.extend(u.prototype,A);u.prototype.Y=function(a,b,c){this.d=a;this.Ca=b;this.Ba=c};u.prototype.set=
59
+ N(function(a,b,d){var f=this.bc(a,b);c.e(a)&&(d=b);return this.k(f,d)});u.prototype.O=N(function(a,b,d){var f=this.ec(a,b);c.e(a)&&(d=b);return this.k(f,d)});u.prototype.wa=N(function(a,b){return this.k(this.mc(a),b)});u.prototype.ha=N(function(a,b,d){c.e(a)&&(d=b);return this.k(this.kc(a,b),d)});u.prototype["delete"]=N(function(a){return this.k({$delete:""},a)});u.prototype.remove=N(function(a,b,c){return this.k(this.Wb(a,b),c)});u.prototype.k=function(a,b){a.$group_key=this.Ca;a.$group_id=this.Ba;
60
+ a.$token=this.p("token");return this.d.Fa({type:"groups",data:c.Ma(a),H:this.p("api_host")+"/"+this.p("api_routes").groups,Ha:this.d.u.Ra},b)};u.prototype.A=function(a){return"$group_key"===a||"$group_id"===a};u.prototype.p=function(a){return this.d.c(a)};u.prototype.toString=function(){return this.d.toString()+".group."+this.Ca+"."+this.Ba};u.prototype.remove=u.prototype.remove;u.prototype.set=u.prototype.set;u.prototype.set_once=u.prototype.O;u.prototype.union=u.prototype.ha;u.prototype.unset=u.prototype.wa;
61
+ u.prototype.toString=u.prototype.toString;c.extend(j.prototype,A);j.prototype.Y=function(a){this.d=a};j.prototype.set=H(function(a,b,d){var f=this.bc(a,b);c.e(a)&&(d=b);this.p("save_referrer")&&this.d.persistence.hb(document.referrer);f.$set=c.extend({},c.info.Vc(),f.$set);return this.k(f,d)});j.prototype.O=H(function(a,b,d){var f=this.ec(a,b);c.e(a)&&(d=b);return this.k(f,d)});j.prototype.wa=H(function(a,b){return this.k(this.mc(a),b)});j.prototype.Ib=H(function(a,b,d){var f={},e={};c.e(a)?(c.a(a,
62
+ function(a,b){this.A(b)||(isNaN(parseFloat(a))?n.error("Invalid increment value passed to mixpanel.people.increment - must be a number"):e[b]=a)},this),d=b):(c.g(b)&&(b=1),e[a]=b);f.$add=e;return this.k(f,d)});j.prototype.append=H(function(a,b,d){c.e(a)&&(d=b);return this.k(this.Ac(a,b),d)});j.prototype.remove=H(function(a,b,d){c.e(a)&&(d=b);return this.k(this.Wb(a,b),d)});j.prototype.ha=H(function(a,b,d){c.e(a)&&(d=b);return this.k(this.kc(a,b),d)});j.prototype.ud=H(function(a,b,d){if(!c.Lb(a)&&
63
+ (a=parseFloat(a),isNaN(a))){n.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",c.extend({$amount:a},b),d)});j.prototype.tb=function(a){return this.set("$transactions",[],a)};j.prototype.Bb=function(){if(this.Da())return this.k({$delete:this.d.M()});n.error("mixpanel.people.delete_user() requires you to call identify() first")};j.prototype.toString=function(){return this.d.toString()+".people"};j.prototype.k=function(a,b){a.$token=
64
+ this.p("token");a.$distinct_id=this.d.M();var d=this.d.s("$device_id"),f=this.d.s("$user_id"),e=this.d.s("$had_persisted_distinct_id");d&&(a.$device_id=d);f&&(a.$user_id=f);e&&(a.$had_persisted_distinct_id=e);d=c.Ma(a);return!this.Da()?(this.uc(a),c.g(b)||(this.p("verbose")?b({status:-1,error:r}):b(-1)),c.truncate(d,255)):this.d.Fa({type:"people",data:d,H:this.p("api_host")+"/"+this.p("api_routes").engage,Ha:this.d.u.$a},b)};j.prototype.p=function(a){return this.d.c(a)};j.prototype.Da=function(){return this.d.V.Gb===
65
+ m};j.prototype.uc=function(a){"$set"in a?this.d.persistence.q("$set",a):"$set_once"in a?this.d.persistence.q("$set_once",a):"$unset"in a?this.d.persistence.q("$unset",a):"$add"in a?this.d.persistence.q("$add",a):"$append"in a?this.d.persistence.q("$append",a):"$remove"in a?this.d.persistence.q("$remove",a):"$union"in a?this.d.persistence.q("$union",a):n.error("Invalid call to _enqueue():",a)};j.prototype.W=function(a,b,d,f){var e=this,g=c.extend({},this.d.persistence.aa(a)),j=g;!c.g(g)&&c.e(g)&&!c.sa(g)&&
66
+ (e.d.persistence.v(a,g),e.d.persistence.save(),f&&(j=f(g)),b.call(e,j,function(b,f){0===b&&e.d.persistence.q(a,g);c.g(d)||d(b,f)}))};j.prototype.vc=function(a,b,d,f,e,g,j){var i=this;this.W("$set",this.set,a);this.W("$set_once",this.O,f);this.W("$unset",this.wa,g,function(a){return c.keys(a)});this.W("$add",this.Ib,b);this.W("$union",this.ha,e);a=this.d.persistence.aa("$append");if(!c.g(a)&&c.isArray(a)&&a.length)for(var k,b=function(a,b){0===a&&i.d.persistence.q("$append",k);c.g(d)||d(a,b)},f=a.length-
67
+ 1;0<=f;f--)a=this.d.persistence.aa("$append"),k=a.pop(),i.d.persistence.save(),c.sa(k)||i.append(k,b);a=this.d.persistence.aa("$remove");if(!c.g(a)&&c.isArray(a)&&a.length)for(var p,b=function(a,b){0===a&&i.d.persistence.q("$remove",p);c.g(j)||j(a,b)},f=a.length-1;0<=f;f--)a=this.d.persistence.aa("$remove"),p=a.pop(),i.d.persistence.save(),c.sa(p)||i.remove(p,b)};j.prototype.A=function(a){return"$distinct_id"===a||"$token"===a||"$device_id"===a||"$user_id"===a||"$had_persisted_distinct_id"===a};j.prototype.set=
68
+ j.prototype.set;j.prototype.set_once=j.prototype.O;j.prototype.unset=j.prototype.wa;j.prototype.increment=j.prototype.Ib;j.prototype.append=j.prototype.append;j.prototype.remove=j.prototype.remove;j.prototype.union=j.prototype.ha;j.prototype.track_charge=j.prototype.ud;j.prototype.clear_charges=j.prototype.tb;j.prototype.delete_user=j.prototype.Bb;j.prototype.toString=j.prototype.toString;var Sa="__mps,__mpso,__mpus,__mpa,__mpap,__mpr,__mpu,$people_distinct_id,__alias,__timers".split(",");q.prototype.ba=
69
+ function(){var a={};this.load();c.a(this.props,function(b,d){c.Ua(Sa,d)||(a[d]=b)});return a};q.prototype.load=function(){if(!this.disabled){var a=this.j.parse(this.name);a&&(this.props=c.extend({},a))}};q.prototype.zd=function(){var a;this.j===c.localStorage?(a=c.cookie.parse(this.name),c.cookie.remove(this.name),c.cookie.remove(this.name,m),a&&this.w(a)):this.j===c.cookie&&(a=c.localStorage.parse(this.name),c.localStorage.remove(this.name),a&&this.w(a))};q.prototype.save=function(){this.disabled||
70
+ this.j.set(this.name,c.ia(this.props),this.Pa,this.Ka,this.ac,this.zb,this.oa)};q.prototype.ua=function(a){this.load();return this.props[a]};q.prototype.remove=function(){this.j.remove(this.name,D,this.oa);this.j.remove(this.name,m,this.oa)};q.prototype.clear=function(){this.remove();this.props={}};q.prototype.w=function(a,b,d){return c.e(a)?("undefined"===typeof b&&(b="None"),this.Pa="undefined"===typeof d?this.Ab:d,this.load(),c.a(a,function(a,c){if(!this.props.hasOwnProperty(c)||this.props[c]===
71
+ b)this.props[c]=a},this),this.save(),m):D};q.prototype.m=function(a,b){return c.e(a)?(this.Pa="undefined"===typeof b?this.Ab:b,this.load(),c.extend(this.props,a),this.save(),m):D};q.prototype.S=function(a){this.load();a in this.props&&(delete this.props[a],this.save())};q.prototype.oc=function(a){this.m(c.info.$c(a))};q.prototype.hb=function(a){this.w({$initial_referrer:a||"$direct",$initial_referring_domain:c.info.Ub(a)||"$direct"},"")};q.prototype.Lc=function(){return c.ga({$initial_referrer:this.props.$initial_referrer,
72
+ $initial_referring_domain:this.props.$initial_referring_domain})};q.prototype.nc=function(a){this.Ab=this.Pa=a.cookie_expiration;this.dc(a.disable_persistence);this.ed(a.cookie_domain);this.fd(a.cross_site_cookie);this.gd(a.cross_subdomain_cookie);this.kd(a.secure_cookie)};q.prototype.dc=function(a){(this.disabled=a)?this.remove():this.save()};q.prototype.ed=function(a){if(a!==this.oa)this.remove(),this.oa=a,this.save()};q.prototype.fd=function(a){if(a!==this.zb)this.zb=a,this.remove(),this.save()};
73
+ q.prototype.gd=function(a){if(a!==this.Ka)this.Ka=a,this.remove(),this.save()};q.prototype.Jc=function(){return this.Ka};q.prototype.kd=function(a){if(a!==this.ac)this.ac=a?m:D,this.remove(),this.save()};q.prototype.q=function(a,b){var d=this.ka(a),f=b[a],e=this.F("$set"),g=this.F("$set_once"),j=this.F("$unset"),i=this.F("$add"),k=this.F("$union"),p=this.F("$remove",[]),o=this.F("$append",[]);"__mps"===d?(c.extend(e,f),this.v("$add",f),this.v("$union",f),this.v("$unset",f)):"__mpso"===d?(c.a(f,function(a,
74
+ b){b in g||(g[b]=a)}),this.v("$unset",f)):"__mpus"===d?c.a(f,function(a){c.a([e,g,i,k],function(b){a in b&&delete b[a]});c.a(o,function(b){a in b&&delete b[a]});j[a]=m}):"__mpa"===d?(c.a(f,function(a,b){b in e?e[b]+=a:(b in i||(i[b]=0),i[b]+=a)},this),this.v("$unset",f)):"__mpu"===d?(c.a(f,function(a,b){c.isArray(a)&&(b in k||(k[b]=[]),k[b]=k[b].concat(a))}),this.v("$unset",f)):"__mpr"===d?(p.push(f),this.v("$append",f)):"__mpap"===d&&(o.push(f),this.v("$unset",f));n.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):");
75
+ n.log(b);this.save()};q.prototype.v=function(a,b){var d=this.props[this.ka(a)];c.g(d)||c.a(b,function(b,e){"$append"===a||"$remove"===a?c.a(d,function(a){a[e]===b&&delete a[e]}):delete d[e]},this)};q.prototype.aa=function(a){return this.ua(this.ka(a))};q.prototype.ka=function(a){if("$set"===a)return"__mps";if("$set_once"===a)return"__mpso";if("$unset"===a)return"__mpus";if("$add"===a)return"__mpa";if("$append"===a)return"__mpap";if("$remove"===a)return"__mpr";if("$union"===a)return"__mpu";n.error("Invalid queue:",
76
+ a)};q.prototype.F=function(a,b){var d=this.ka(a),b=c.g(b)?{}:b;return this.props[d]||(this.props[d]=b)};q.prototype.hd=function(a){var b=(new Date).getTime(),c=this.ua("__timers")||{};c[a]=b;this.props.__timers=c;this.save()};q.prototype.Xc=function(a){var b=(this.ua("__timers")||{})[a];c.g(b)||(delete this.props.__timers[a],this.save());return b};var ca,x,O=o.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,ma=!O&&-1===z.indexOf("MSIE")&&-1===z.indexOf("Mozilla"),ba=r;I.sendBeacon&&(ba=function(){return I.sendBeacon.apply(I,
77
+ arguments)});var A={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},Aa={api_host:"https://api-js.mixpanel.com",api_routes:A,api_method:"POST",api_transport:"XHR",api_payload_format:"base64",app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:D,cross_subdomain_cookie:m,error_reporter:P,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:P,mp_loader:r,track_marketing:m,track_pageview:D,skip_first_touch_marketing:D,store_google:m,
78
+ stop_utm_persistence:D,save_referrer:m,test:D,verbose:D,img:D,debug:D,track_links_timeout:300,cookie_expiration:365,upgrade:D,disable_persistence:D,disable_cookie:D,secure_cookie:D,ip:m,opt_out_tracking_by_default:D,opt_out_persistence_by_default:D,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:r,property_blacklist:[],xhr_headers:{},ignore_dnt:D,batch_requests:m,batch_size:50,batch_flush_interval_ms:5E3,batch_request_timeout_ms:9E4,batch_autostart:m,hooks:{},record_block_class:/^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$/,
79
+ record_block_selector:"img, video",record_collect_fonts:D,record_idle_timeout_ms:18E5,record_inline_images:D,record_mask_text_class:/^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$/,record_mask_text_selector:"*",record_max_ms:864E5,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},la=D;e.prototype.Va=function(a,b,d){if(c.g(d))this.l("You must name your new library: init(token, config, name)");else if("mixpanel"===d)this.l("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");
80
+ else return a=S(a,b,d),x[d]=a,a.la(),a};e.prototype.Y=function(a,b,d){b=b||{};this.__loaded=m;this.config={};var f={};"api_payload_format"in b||(b.api_host||Aa.api_host).match(/\.mixpanel\.com/)&&(f.api_payload_format="json");this.cc(c.extend({},Aa,f,b,{name:d,token:a,callback_fn:("mixpanel"===d?d:"mixpanel."+d)+"._jsc"}));this._jsc=P;this.ya=[];this.za=[];this.xa=[];this.V={disable_all_events:D,identify_called:D};this.u={};if(this.U=this.c("batch_requests"))if(!c.localStorage.ta(m)||!O)this.U=D,
81
+ n.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),c.a(this.Eb(),function(a){n.log("Clearing batch queue "+a.da);c.localStorage.remove(a.da)});else if(this.Nc(),ba&&o.addEventListener){var e=c.bind(function(){this.u.L.fa||this.u.L.flush({lc:m})},this);o.addEventListener("pagehide",function(a){a.persisted&&e()});o.addEventListener("visibilitychange",function(){"hidden"===v.visibilityState&&e()})}this.persistence=this.cookie=new q(this.config);this.R={};this.wc();a=c.jb();
82
82
  this.M()||this.w({distinct_id:"$device:"+a,$device_id:a},"");(a=this.c("track_pageview"))&&this.xc(a);0<this.c("record_sessions_percent")&&100*Math.random()<=this.c("record_sessions_percent")&&this.gc()};e.prototype.gc=K(function(){if(o.MutationObserver){var a=c.bind(function(){this.J=this.J||new o.__mp_recorder(this);this.J.startRecording()},this);c.g(o.__mp_recorder)?na(this.c("recorder_src"),a):a()}else n.B("Browser does not support MutationObserver; skipping session recording")});e.prototype.od=
83
- function(){this.J?this.J.stopRecording():n.B("Session recorder module not loaded")};e.prototype.Fb=function(){var a={};if(this.J){var b=this.J.replayId;b&&(a.$mp_replay_id=b)}return a};e.prototype.ka=function(){this.c("loaded")(this);this.rb();this.people.O(this.persistence.Lc());if(this.c("store_google")&&this.c("stop_utm_persistence")){var a=c.info.Z(r);c.a(a,function(a,c){this.S(c)}.bind(this))}};e.prototype.rb=function(){this.persistence.oc(v.referrer);this.c("store_google")&&!this.c("stop_utm_persistence")&&
83
+ function(){this.J?this.J.stopRecording():n.B("Session recorder module not loaded")};e.prototype.Fb=function(){var a={};if(this.J){var b=this.J.replayId;b&&(a.$mp_replay_id=b)}return a};e.prototype.la=function(){this.c("loaded")(this);this.rb();this.people.O(this.persistence.Lc());if(this.c("store_google")&&this.c("stop_utm_persistence")){var a=c.info.Z(r);c.a(a,function(a,c){this.S(c)}.bind(this))}};e.prototype.rb=function(){this.persistence.oc(v.referrer);this.c("store_google")&&!this.c("stop_utm_persistence")&&
84
84
  this.m(c.info.Z());this.c("save_referrer")&&this.persistence.hb(v.referrer)};e.prototype.tc=function(){c.a(this.ya,function(a){this.Ea.apply(this,a)},this);this.$()||c.a(this.za,function(a){this.k.apply(this,a)},this);delete this.ya;delete this.za};e.prototype.Ea=function(a,b){if(this.c("img"))return this.l("You can't use DOM tracking functions with img = true."),D;if(!la)return this.ya.push([a,b]),D;var c=(new a).Va(this);return c.o.apply(c,b)};e.prototype.xc=function(a){var b="";this.fb()&&(b=c.info.La());
85
85
  if(c.Ua(["full-url","url-with-path-and-query-string","url-with-path"],a)){o.addEventListener("popstate",function(){o.dispatchEvent(new Event("mp_locationchange"))});o.addEventListener("hashchange",function(){o.dispatchEvent(new Event("mp_locationchange"))});var d=o.history.pushState;if("function"===typeof d)o.history.pushState=function(a,b,c){d.call(o.history,a,b,c);o.dispatchEvent(new Event("mp_locationchange"))};var f=o.history.replaceState;if("function"===typeof f)o.history.replaceState=function(a,
86
86
  b,c){f.call(o.history,a,b,c);o.dispatchEvent(new Event("mp_locationchange"))};o.addEventListener("mp_locationchange",function(){var d=c.info.La(),f=D;"full-url"===a?f=d!==b:"url-with-path-and-query-string"===a?f=d.split("#")[0]!==b.split("#")[0]:"url-with-path"===a&&(f=d.split("#")[0].split("?")[0]!==b.split("#")[0].split("?")[0]);f&&this.fb()&&(b=d)}.bind(this))}};e.prototype.ob=function(a,b){if(c.g(a))return r;if(O)return function(c){a(c,b)};var d=this._jsc,f=""+Math.floor(1E8*Math.random()),e=
@@ -89,24 +89,24 @@ f;else if(k||this.c("test"))b.callback="(function(){})";b.ip=this.c("ip")?1:0;b.
89
89
  b){n.setRequestHeader(b,a)});if(d.ic&&"undefined"!==typeof n.timeout){n.timeout=d.ic;var x=(new Date).getTime()}n.withCredentials=m;n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){if(f)if(k){var a;try{a=c.T(n.responseText)}catch(b){if(p.l(b),d.Mc)a=n.responseText;else return}f(a)}else f(Number(n.responseText))}else a=n.timeout&&!n.status&&(new Date).getTime()-x>=n.timeout?"timeout":"Bad HTTP status: "+n.status+" "+n.statusText,p.l(a),f&&(k?f({status:0,Sa:n.status,error:a,Zb:(n.responseHeaders||
90
90
  {})["Retry-After"]}):f(0))};n.send(j)}catch(y){p.l(y),e=D}else j=v.createElement("script"),j.type="text/javascript",j.async=m,j.defer=m,j.src=a,u=v.getElementsByTagName("script")[0],u.parentNode.insertBefore(j,u);return e};e.prototype.Aa=function(a){function b(a,b){c.a(a,function(a){if(c.isArray(a[0])){var d=b;c.a(a,function(a){d=d[a[0]].apply(d,a.slice(1))})}else this[a[0]].apply(this,a.slice(1))},b)}var d,e=[],h=[],g=[];c.a(a,function(a){a&&(d=a[0],c.isArray(d)?g.push(a):"function"===typeof a?a.call(this):
91
91
  c.isArray(a)&&"alias"===d?e.push(a):c.isArray(a)&&-1!==d.indexOf("track")&&"function"===typeof this[d]?g.push(a):h.push(a))},this);b(e,this);b(h,this);b(g,this)};e.prototype.sb=function(){return!!this.u.L};e.prototype.Eb=function(){var a="__mpq_"+this.c("token"),b=this.c("api_routes");return this.kb=this.kb||{L:{type:"events",H:"/"+b.track,da:a+"_ev"},$a:{type:"people",H:"/"+b.engage,da:a+"_pp"},Ra:{type:"groups",H:"/"+b.groups,da:a+"_gr"}}};e.prototype.Nc=function(){if(!this.sb()){var a=c.bind(function(a){return new C(a.da,
92
- {C:this.config,K:this.c("error_reporter"),cd:c.bind(function(b,c,e){this.k(this.c("api_host")+a.H,this.mb(b),c,this.ob(e,b))},this),la:c.bind(function(b){return this.qb("before_send_"+a.type,b)},this),nd:c.bind(this.cb,this),z:m})},this),b=this.Eb();this.u={L:a(b.L),$a:a(b.$a),Ra:a(b.Ra)}}this.c("batch_autostart")&&this.bb()};e.prototype.bb=function(){this.rc=m;if(this.sb())this.U=m,c.a(this.u,function(a){a.start()})};e.prototype.cb=function(){this.U=D;c.a(this.u,function(a){a.stop();a.clear()})};
93
- e.prototype.push=function(a){this.Aa([a])};e.prototype.disable=function(a){"undefined"===typeof a?this.V.Ec=m:this.xa=this.xa.concat(a)};e.prototype.mb=function(a){a=c.ha(a);"base64"===this.c("api_payload_format")&&(a=c.Bc(a));return{data:a}};e.prototype.Fa=function(a,b){var d=c.truncate(a.data,255),e=a.H,h=a.Ha,g=a.ld,j=a.dd||{},b=b||P,i=m,k=c.bind(function(){j.fc||(d=this.qb("before_send_"+a.type,d));return d?(n.log("MIXPANEL REQUEST:"),n.log(d),this.k(e,this.mb(d),j,this.ob(b,d))):r},this);this.U&&
92
+ {C:this.config,K:this.c("error_reporter"),cd:c.bind(function(b,c,e){this.k(this.c("api_host")+a.H,this.mb(b),c,this.ob(e,b))},this),ma:c.bind(function(b){return this.qb("before_send_"+a.type,b)},this),nd:c.bind(this.cb,this),z:m})},this),b=this.Eb();this.u={L:a(b.L),$a:a(b.$a),Ra:a(b.Ra)}}this.c("batch_autostart")&&this.bb()};e.prototype.bb=function(){this.rc=m;if(this.sb())this.U=m,c.a(this.u,function(a){a.start()})};e.prototype.cb=function(){this.U=D;c.a(this.u,function(a){a.stop();a.clear()})};
93
+ e.prototype.push=function(a){this.Aa([a])};e.prototype.disable=function(a){"undefined"===typeof a?this.V.Ec=m:this.xa=this.xa.concat(a)};e.prototype.mb=function(a){a=c.ia(a);"base64"===this.c("api_payload_format")&&(a=c.Bc(a));return{data:a}};e.prototype.Fa=function(a,b){var d=c.truncate(a.data,255),e=a.H,h=a.Ha,g=a.ld,j=a.dd||{},b=b||P,i=m,k=c.bind(function(){j.fc||(d=this.qb("before_send_"+a.type,d));return d?(n.log("MIXPANEL REQUEST:"),n.log(d),this.k(e,this.mb(d),j,this.ob(b,d))):r},this);this.U&&
94
94
  !g?h.Na(d,function(a){a?b(1,d):k()}):i=k();return i&&d};e.prototype.o=K(function(a,b,d,e){!e&&"function"===typeof d&&(e=d,d=r);var d=d||{},h=d.transport;if(h)d.gb=h;h=d.send_immediately;"function"!==typeof e&&(e=P);if(c.g(a))this.l("No event name provided to mixpanel.track");else if(this.nb(a))e(0);else{b=c.extend({},b);b.token=this.c("token");var g=this.persistence.Xc(a);c.g(g)||(b.$duration=parseFloat((((new Date).getTime()-g)/1E3).toFixed(3)));this.rb();g=this.c("track_marketing")?c.info.Rc():
95
95
  {};b=c.extend({},c.info.ba({mp_loader:this.c("mp_loader")}),g,this.persistence.ba(),this.R,this.Fb(),b);g=this.c("property_blacklist");c.isArray(g)?c.a(g,function(a){delete b[a]}):this.l("Invalid value for property_blacklist config: "+g);return this.Fa({type:"events",data:{event:a,properties:b},H:this.c("api_host")+"/"+this.c("api_routes").track,Ha:this.u.L,ld:h,dd:d},e)}});e.prototype.jd=K(function(a,b,d){c.isArray(b)||(b=[b]);var e={};e[a]=b;this.m(e);return this.people.set(a,b,d)});e.prototype.yc=
96
- K(function(a,b,c){var e=this.s(a),h={};e===l?(h[a]=[b],this.m(h)):-1===e.indexOf(b)&&(e.push(b),h[a]=e,this.m(h));return this.people.ga(a,b,c)});e.prototype.Yc=K(function(a,b,c){var e=this.s(a);if(e!==l){var h=e.indexOf(b);-1<h&&(e.splice(h,1),this.m({Fd:e}));0===e.length&&this.S(a)}return this.people.remove(a,b,c)});e.prototype.xd=K(function(a,b,d,e){var h=c.extend({},b||{});c.a(d,function(a,b){a!==r&&a!==l&&(h[b]=a)});return this.o(a,h,e)});e.prototype.sc=function(a,b){return a+"_"+JSON.stringify(b)};
96
+ K(function(a,b,c){var e=this.s(a),h={};e===l?(h[a]=[b],this.m(h)):-1===e.indexOf(b)&&(e.push(b),h[a]=e,this.m(h));return this.people.ha(a,b,c)});e.prototype.Yc=K(function(a,b,c){var e=this.s(a);if(e!==l){var h=e.indexOf(b);-1<h&&(e.splice(h,1),this.m({Fd:e}));0===e.length&&this.S(a)}return this.people.remove(a,b,c)});e.prototype.xd=K(function(a,b,d,e){var h=c.extend({},b||{});c.a(d,function(a,b){a!==r&&a!==l&&(h[b]=a)});return this.o(a,h,e)});e.prototype.sc=function(a,b){return a+"_"+JSON.stringify(b)};
97
97
  e.prototype.Kc=function(a,b){var c=this.sc(a,b),e=this.lb[c];if(e===l||e.Ca!==a||e.Ba!==b)e=new u,e.Y(this,a,b),this.lb[c]=e;return e};e.prototype.fb=K(function(a,b){"object"!==typeof a&&(a={});var b=b||{},d=b.event_name||"$mp_web_page_view",e=c.extend(c.info.Sc(),c.info.Z(),c.info.vb()),e=c.extend({},e,a);return this.o(d,e)});e.prototype.wd=function(){return this.Ea.call(this,M,arguments)};e.prototype.vd=function(){return this.Ea.call(this,T,arguments)};e.prototype.qd=function(a){c.g(a)?this.l("No event name provided to mixpanel.time_event"):
98
98
  this.nb(a)||this.persistence.hd(a)};var Ea={persistent:m};e.prototype.m=function(a,b){var d=da(b);d.persistent?this.persistence.m(a,d.days):c.extend(this.R,a)};e.prototype.w=function(a,b,d){d=da(d);d.persistent?this.persistence.w(a,b,d.days):("undefined"===typeof b&&(b="None"),c.a(a,function(a,c){if(!this.R.hasOwnProperty(c)||this.R[c]===b)this.R[c]=a},this))};e.prototype.S=function(a,b){b=da(b);b.persistent?this.persistence.S(a):delete this.R[a]};e.prototype.pb=function(a,b){var c={};c[a]=b;this.m(c)};
99
99
  e.prototype.Ta=function(a,b,c,e,h,g,j,i){var k=this.M();if(a&&k!==a){if("string"===typeof a&&0===a.indexOf("$device:"))return this.l("distinct_id cannot have $device: prefix"),-1;this.m({$user_id:a})}this.s("$device_id")||this.w({$had_persisted_distinct_id:m,$device_id:k},"");a!==k&&a!==this.s("__alias")&&(this.S("__alias"),this.m({distinct_id:a}));this.V.Gb=m;this.people.vc(b,c,e,h,g,j,i);a!==k&&this.o("$identify",{distinct_id:a,$anon_distinct_id:k},{fc:m})};e.prototype.reset=function(){this.persistence.clear();
100
100
  this.V.Gb=D;var a=c.jb();this.w({distinct_id:"$device:"+a,$device_id:a},"")};e.prototype.M=function(){return this.s("distinct_id")};e.prototype.zc=function(a,b){if(a===this.s("$people_distinct_id"))return this.l("Attempting to create alias for existing People user - aborting."),-2;var d=this;c.g(b)&&(b=this.M());if(a!==b)return this.pb("__alias",a),this.o("$create_alias",{alias:a,distinct_id:b},{fc:m},function(){d.Ta(a)});this.l("alias matches current distinct_id - skipping api call.");this.Ta(a);
101
101
  return-1};e.prototype.Tc=function(a){this.pb("mp_name_tag",a)};e.prototype.cc=function(a){if(c.e(a))c.extend(this.config,a),a.batch_size&&c.a(this.u,function(a){a.Yb()}),this.c("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.c("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.nc(this.config),J=J||this.c("debug")};e.prototype.c=function(a){return this.config[a]};e.prototype.qb=function(a){var b=(this.config.hooks[a]||
102
- Fa).apply(this,L.call(arguments,1));"undefined"===typeof b&&(this.l(a+" hook did not return a value"),b=r);return b};e.prototype.s=function(a){return this.persistence.ta([a])};e.prototype.toString=function(){var a=this.c("name");"mixpanel"!==a&&(a="mixpanel."+a);return a};e.prototype.nb=function(a){return c.Kb(z)||this.V.Ec||c.Ua(this.xa,a)};e.prototype.wc=function(){"localStorage"===this.c("opt_out_tracking_persistence_type")&&c.localStorage.sa()&&(!this.qa()&&this.qa({persistence_type:"cookie"})&&
103
- this.Ob({enable_persistence:D}),!this.$()&&this.$({persistence_type:"cookie"})&&this.Za({clear_persistence:D}),this.ub({persistence_type:"cookie",enable_persistence:D}));if(this.$())this.ia({clear_persistence:m});else if(!this.qa()&&(this.c("opt_out_tracking_by_default")||c.cookie.get("mp_optout")))c.cookie.remove("mp_optout"),this.Za({clear_persistence:this.c("opt_out_persistence_by_default")})};e.prototype.ia=function(a){if(a&&a.clear_persistence)a=m;else if(a&&a.enable_persistence)a=D;else return;
102
+ Fa).apply(this,L.call(arguments,1));"undefined"===typeof b&&(this.l(a+" hook did not return a value"),b=r);return b};e.prototype.s=function(a){return this.persistence.ua([a])};e.prototype.toString=function(){var a=this.c("name");"mixpanel"!==a&&(a="mixpanel."+a);return a};e.prototype.nb=function(a){return c.Kb(z)||this.V.Ec||c.Ua(this.xa,a)};e.prototype.wc=function(){"localStorage"===this.c("opt_out_tracking_persistence_type")&&c.localStorage.ta()&&(!this.ra()&&this.ra({persistence_type:"cookie"})&&
103
+ this.Ob({enable_persistence:D}),!this.$()&&this.$({persistence_type:"cookie"})&&this.Za({clear_persistence:D}),this.ub({persistence_type:"cookie",enable_persistence:D}));if(this.$())this.ja({clear_persistence:m});else if(!this.ra()&&(this.c("opt_out_tracking_by_default")||c.cookie.get("mp_optout")))c.cookie.remove("mp_optout"),this.Za({clear_persistence:this.c("opt_out_persistence_by_default")})};e.prototype.ja=function(a){if(a&&a.clear_persistence)a=m;else if(a&&a.enable_persistence)a=D;else return;
104
104
  !this.c("disable_persistence")&&this.persistence.disabled!==a&&this.persistence.dc(a);a?this.cb():this.rc&&this.bb()};e.prototype.X=function(a,b){b=c.extend({track:c.bind(this.o,this),persistence_type:this.c("opt_out_tracking_persistence_type"),cookie_prefix:this.c("opt_out_tracking_cookie_prefix"),cookie_expiration:this.c("cookie_expiration"),cross_site_cookie:this.c("cross_site_cookie"),cross_subdomain_cookie:this.c("cross_subdomain_cookie"),cookie_domain:this.c("cookie_domain"),secure_cookie:this.c("secure_cookie"),
105
- ignore_dnt:this.c("ignore_dnt")},b);c.localStorage.sa()||(b.persistence_type="cookie");return a(this.c("token"),{o:b.track,sd:b.track_event_name,td:b.track_properties,Sb:b.persistence_type,Rb:b.cookie_prefix,wb:b.cookie_domain,xb:b.cookie_expiration,Dc:b.cross_site_cookie,yb:b.cross_subdomain_cookie,ad:b.secure_cookie,Hb:b.ignore_dnt})};e.prototype.Ob=function(a){a=c.extend({enable_persistence:m},a);this.X(Ia,a);this.ia(a)};e.prototype.Za=function(a){a=c.extend({clear_persistence:m,delete_user:m},
106
- a);a.delete_user&&this.people&&this.people.Da()&&(this.people.Bb(),this.people.tb());this.X(Ja,a);this.ia(a)};e.prototype.qa=function(a){return this.X(Ka,a)};e.prototype.$=function(a){return this.X(ua,a)};e.prototype.ub=function(a){a=c.extend({enable_persistence:m},a);this.X(Ma,a);this.ia(a)};e.prototype.l=function(a,b){n.error.apply(n.error,arguments);try{!b&&!(a instanceof Error)&&(a=Error(a)),this.c("error_reporter")(a,b)}catch(c){n.error(c)}};e.prototype.init=e.prototype.Va;e.prototype.reset=
105
+ ignore_dnt:this.c("ignore_dnt")},b);c.localStorage.ta()||(b.persistence_type="cookie");return a(this.c("token"),{o:b.track,sd:b.track_event_name,td:b.track_properties,Sb:b.persistence_type,Rb:b.cookie_prefix,wb:b.cookie_domain,xb:b.cookie_expiration,Dc:b.cross_site_cookie,yb:b.cross_subdomain_cookie,ad:b.secure_cookie,Hb:b.ignore_dnt})};e.prototype.Ob=function(a){a=c.extend({enable_persistence:m},a);this.X(Ia,a);this.ja(a)};e.prototype.Za=function(a){a=c.extend({clear_persistence:m,delete_user:m},
106
+ a);a.delete_user&&this.people&&this.people.Da()&&(this.people.Bb(),this.people.tb());this.X(Ja,a);this.ja(a)};e.prototype.ra=function(a){return this.X(Ka,a)};e.prototype.$=function(a){return this.X(ua,a)};e.prototype.ub=function(a){a=c.extend({enable_persistence:m},a);this.X(Ma,a);this.ja(a)};e.prototype.l=function(a,b){n.error.apply(n.error,arguments);try{!b&&!(a instanceof Error)&&(a=Error(a)),this.c("error_reporter")(a,b)}catch(c){n.error(c)}};e.prototype.init=e.prototype.Va;e.prototype.reset=
107
107
  e.prototype.reset;e.prototype.disable=e.prototype.disable;e.prototype.time_event=e.prototype.qd;e.prototype.track=e.prototype.o;e.prototype.track_links=e.prototype.wd;e.prototype.track_forms=e.prototype.vd;e.prototype.track_pageview=e.prototype.fb;e.prototype.register=e.prototype.m;e.prototype.register_once=e.prototype.w;e.prototype.unregister=e.prototype.S;e.prototype.identify=e.prototype.Ta;e.prototype.alias=e.prototype.zc;e.prototype.name_tag=e.prototype.Tc;e.prototype.set_config=e.prototype.cc;
108
- e.prototype.get_config=e.prototype.c;e.prototype.get_property=e.prototype.s;e.prototype.get_distinct_id=e.prototype.M;e.prototype.toString=e.prototype.toString;e.prototype.opt_out_tracking=e.prototype.Za;e.prototype.opt_in_tracking=e.prototype.Ob;e.prototype.has_opted_out_tracking=e.prototype.$;e.prototype.has_opted_in_tracking=e.prototype.qa;e.prototype.clear_opt_in_out_tracking=e.prototype.ub;e.prototype.get_group=e.prototype.Kc;e.prototype.set_group=e.prototype.jd;e.prototype.add_group=e.prototype.yc;
108
+ e.prototype.get_config=e.prototype.c;e.prototype.get_property=e.prototype.s;e.prototype.get_distinct_id=e.prototype.M;e.prototype.toString=e.prototype.toString;e.prototype.opt_out_tracking=e.prototype.Za;e.prototype.opt_in_tracking=e.prototype.Ob;e.prototype.has_opted_out_tracking=e.prototype.$;e.prototype.has_opted_in_tracking=e.prototype.ra;e.prototype.clear_opt_in_out_tracking=e.prototype.ub;e.prototype.get_group=e.prototype.Kc;e.prototype.set_group=e.prototype.jd;e.prototype.add_group=e.prototype.yc;
109
109
  e.prototype.remove_group=e.prototype.Yc;e.prototype.track_with_groups=e.prototype.xd;e.prototype.start_batch_senders=e.prototype.bb;e.prototype.stop_batch_senders=e.prototype.cb;e.prototype.start_session_recording=e.prototype.gc;e.prototype.stop_session_recording=e.prototype.od;e.prototype.get_session_recording_properties=e.prototype.Fb;e.prototype.DEFAULT_API_ROUTES=A;q.prototype.properties=q.prototype.ba;q.prototype.update_search_keyword=q.prototype.oc;q.prototype.update_referrer_info=q.prototype.hb;
110
110
  q.prototype.get_cross_subdomain=q.prototype.Jc;q.prototype.clear=q.prototype.clear;var F={};(function(a){na=a;ca=1;x=o.mixpanel;c.g(x)?n.B('"mixpanel" object not initialized. Ensure you are using the latest version of the Mixpanel JS Library along with the snippet we provide.'):x.__loaded||x.config&&x.persistence?n.B("The Mixpanel library has already been downloaded at least once. Ensure that the Mixpanel code snippet only appears once on the page (and is not double-loaded by a tag manager) in order to avoid errors."):
111
- 1.1>(x.__SV||0)?n.B("Version mismatch; please ensure you're using the latest version of the Mixpanel code snippet."):(c.a(x._i,function(a){a&&c.isArray(a)&&(F[a[a.length-1]]=S.apply(this,a))}),Ca(),x.init(),c.a(F,function(a){a.ka()}),Ba())})(function(a,b){var c=document.createElement("script");c.type="text/javascript";c.async=m;c.onload=b;c.src=a;document.head.appendChild(c)})})();
111
+ 1.1>(x.__SV||0)?n.B("Version mismatch; please ensure you're using the latest version of the Mixpanel code snippet."):(c.a(x._i,function(a){a&&c.isArray(a)&&(F[a[a.length-1]]=S.apply(this,a))}),Ca(),x.init(),c.a(F,function(a){a.la()}),Ba())})(function(a,b){var c=document.createElement("script");c.type="text/javascript";c.async=m;c.onload=b;c.src=a;document.head.appendChild(c)})})();
112
112
  })();
@@ -4513,7 +4513,7 @@
4513
4513
 
4514
4514
  var Config = {
4515
4515
  DEBUG: false,
4516
- LIB_VERSION: '2.54.0'
4516
+ LIB_VERSION: '2.54.1'
4517
4517
  };
4518
4518
 
4519
4519
  /* eslint camelcase: "off", eqeqeq: "off" */
@@ -7081,7 +7081,11 @@
7081
7081
  RequestBatcher.prototype.scheduleFlush = function(flushMS) {
7082
7082
  this.flushInterval = flushMS;
7083
7083
  if (!this.stopped) { // don't schedule anymore if batching has been stopped
7084
- this.timeoutID = setTimeout(_.bind(this.flush, this), this.flushInterval);
7084
+ this.timeoutID = setTimeout(_.bind(function() {
7085
+ if (!this.stopped) {
7086
+ this.flush();
7087
+ }
7088
+ }, this), this.flushInterval);
7085
7089
  }
7086
7090
  };
7087
7091
 
@@ -7310,7 +7314,7 @@
7310
7314
  ]);
7311
7315
 
7312
7316
  function isUserEvent(ev) {
7313
- return ev.type === EventType.IncrementalSnapshot && ACTIVE_SOURCES.has(ev.source);
7317
+ return ev.type === EventType.IncrementalSnapshot && ACTIVE_SOURCES.has(ev.data.source);
7314
7318
  }
7315
7319
 
7316
7320
  var MixpanelRecorder = function(mixpanelInstance) {
@@ -7348,7 +7352,7 @@
7348
7352
  return this._mixpanel.get_config(configVar);
7349
7353
  };
7350
7354
 
7351
- MixpanelRecorder.prototype.startRecording = function () {
7355
+ MixpanelRecorder.prototype.startRecording = function (shouldStopBatcher) {
7352
7356
  if (this._stopRecording !== null) {
7353
7357
  logger.log('Recording already in progress, skipping startRecording.');
7354
7358
  return;
@@ -7366,7 +7370,14 @@
7366
7370
 
7367
7371
  this.replayId = _.UUID();
7368
7372
 
7369
- this.batcher.start();
7373
+ if (shouldStopBatcher) {
7374
+ // this is the case when we're starting recording after a reset
7375
+ // and don't want to send anything over the network until there's
7376
+ // actual user activity
7377
+ this.batcher.stop();
7378
+ } else {
7379
+ this.batcher.start();
7380
+ }
7370
7381
 
7371
7382
  var resetIdleTimeout = _.bind(function () {
7372
7383
  clearTimeout(this.idleTimeoutId);
@@ -7380,6 +7391,10 @@
7380
7391
  'emit': _.bind(function (ev) {
7381
7392
  this.batcher.enqueue(ev);
7382
7393
  if (isUserEvent(ev)) {
7394
+ if (this.batcher.stopped) {
7395
+ // start flushing again after user activity
7396
+ this.batcher.start();
7397
+ }
7383
7398
  resetIdleTimeout();
7384
7399
  }
7385
7400
  }, this),
@@ -7399,7 +7414,7 @@
7399
7414
 
7400
7415
  MixpanelRecorder.prototype.resetRecording = function () {
7401
7416
  this.stopRecording();
7402
- this.startRecording();
7417
+ this.startRecording(true);
7403
7418
  };
7404
7419
 
7405
7420
  MixpanelRecorder.prototype.stopRecording = function () {
@@ -7408,7 +7423,14 @@
7408
7423
  this._stopRecording = null;
7409
7424
  }
7410
7425
 
7411
- this.batcher.flush(); // flush any remaining events
7426
+ if (this.batcher.stopped) {
7427
+ // never got user activity to flush after reset, so just clear the batcher
7428
+ this.batcher.clear();
7429
+ } else {
7430
+ // flush any remaining events from running batcher
7431
+ this.batcher.flush();
7432
+ this.batcher.stop();
7433
+ }
7412
7434
  this.replayId = null;
7413
7435
 
7414
7436
  clearTimeout(this.idleTimeoutId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mixpanel-browser",
3
- "version": "2.54.0",
3
+ "version": "2.54.1",
4
4
  "description": "The official Mixpanel JavaScript browser client library",
5
5
  "main": "dist/mixpanel.cjs.js",
6
6
  "directories": {
package/src/config.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var Config = {
2
2
  DEBUG: false,
3
- LIB_VERSION: '2.54.0'
3
+ LIB_VERSION: '2.54.1'
4
4
  };
5
5
 
6
6
  export default Config;
@@ -28,7 +28,7 @@ var ACTIVE_SOURCES = new Set([
28
28
  ]);
29
29
 
30
30
  function isUserEvent(ev) {
31
- return ev.type === EventType.IncrementalSnapshot && ACTIVE_SOURCES.has(ev.source);
31
+ return ev.type === EventType.IncrementalSnapshot && ACTIVE_SOURCES.has(ev.data.source);
32
32
  }
33
33
 
34
34
  var MixpanelRecorder = function(mixpanelInstance) {
@@ -66,7 +66,7 @@ MixpanelRecorder.prototype.get_config = function(configVar) {
66
66
  return this._mixpanel.get_config(configVar);
67
67
  };
68
68
 
69
- MixpanelRecorder.prototype.startRecording = function () {
69
+ MixpanelRecorder.prototype.startRecording = function (shouldStopBatcher) {
70
70
  if (this._stopRecording !== null) {
71
71
  logger.log('Recording already in progress, skipping startRecording.');
72
72
  return;
@@ -84,7 +84,14 @@ MixpanelRecorder.prototype.startRecording = function () {
84
84
 
85
85
  this.replayId = _.UUID();
86
86
 
87
- this.batcher.start();
87
+ if (shouldStopBatcher) {
88
+ // this is the case when we're starting recording after a reset
89
+ // and don't want to send anything over the network until there's
90
+ // actual user activity
91
+ this.batcher.stop();
92
+ } else {
93
+ this.batcher.start();
94
+ }
88
95
 
89
96
  var resetIdleTimeout = _.bind(function () {
90
97
  clearTimeout(this.idleTimeoutId);
@@ -98,6 +105,10 @@ MixpanelRecorder.prototype.startRecording = function () {
98
105
  'emit': _.bind(function (ev) {
99
106
  this.batcher.enqueue(ev);
100
107
  if (isUserEvent(ev)) {
108
+ if (this.batcher.stopped) {
109
+ // start flushing again after user activity
110
+ this.batcher.start();
111
+ }
101
112
  resetIdleTimeout();
102
113
  }
103
114
  }, this),
@@ -117,7 +128,7 @@ MixpanelRecorder.prototype.startRecording = function () {
117
128
 
118
129
  MixpanelRecorder.prototype.resetRecording = function () {
119
130
  this.stopRecording();
120
- this.startRecording();
131
+ this.startRecording(true);
121
132
  };
122
133
 
123
134
  MixpanelRecorder.prototype.stopRecording = function () {
@@ -126,7 +137,14 @@ MixpanelRecorder.prototype.stopRecording = function () {
126
137
  this._stopRecording = null;
127
138
  }
128
139
 
129
- this.batcher.flush(); // flush any remaining events
140
+ if (this.batcher.stopped) {
141
+ // never got user activity to flush after reset, so just clear the batcher
142
+ this.batcher.clear();
143
+ } else {
144
+ // flush any remaining events from running batcher
145
+ this.batcher.flush();
146
+ this.batcher.stop();
147
+ }
130
148
  this.replayId = null;
131
149
 
132
150
  clearTimeout(this.idleTimeoutId);
@@ -97,7 +97,11 @@ RequestBatcher.prototype.resetFlush = function() {
97
97
  RequestBatcher.prototype.scheduleFlush = function(flushMS) {
98
98
  this.flushInterval = flushMS;
99
99
  if (!this.stopped) { // don't schedule anymore if batching has been stopped
100
- this.timeoutID = setTimeout(_.bind(this.flush, this), this.flushInterval);
100
+ this.timeoutID = setTimeout(_.bind(function() {
101
+ if (!this.stopped) {
102
+ this.flush();
103
+ }
104
+ }, this), this.flushInterval);
101
105
  }
102
106
  };
103
107