@reservamos/browser-analytics 0.1.4-alpha.11 → 0.1.4-alpha.12

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.
@@ -27,4 +27,4 @@ PERFORMANCE OF THIS SOFTWARE.
27
27
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
28
28
  PERFORMANCE OF THIS SOFTWARE.
29
29
  ***************************************************************************** */
30
- function __awaiter2(e,t,n,i){return new(n||(n=Promise))((function(t,s){function fulfilled(e){try{step(i.next(e))}catch(t){s(t)}}function rejected(e){try{step(i.throw(e))}catch(t){s(t)}}function step(e){e.done?t(e.value):function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((i=i.apply(e,[])).next())}))}for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),n=0;n<64;n++)t[e.charCodeAt(n)]=n;var encode2=function(t){var n,i=new Uint8Array(t),s=i.length,a="";for(n=0;n<s;n+=3)a+=e[i[n]>>2],a+=e[(3&i[n])<<4|i[n+1]>>4],a+=e[(15&i[n+1])<<2|i[n+2]>>6],a+=e[63&i[n+2]];return s%3==2?a=a.substring(0,a.length-1)+"=":s%3==1&&(a=a.substring(0,a.length-2)+"=="),a};const i=new Map,s=new Map;const a=self;a.onmessage=function(e){return __awaiter2(this,0,void 0,(function*(){if(!("OffscreenCanvas"in globalThis))return a.postMessage({id:e.data.id});{const{id:t,bitmap:n,width:c,height:d,dataURLOptions:u}=e.data,l=function getTransparentBlobFor(e,t,n){return __awaiter2(this,0,void 0,(function*(){const i=`${e}-${t}`;if("OffscreenCanvas"in globalThis){if(s.has(i))return s.get(i);const a=new OffscreenCanvas(e,t);a.getContext("2d");const c=yield a.convertToBlob(n),d=yield c.arrayBuffer(),u=encode2(d);return s.set(i,u),u}return""}))}(c,d,u),p=new OffscreenCanvas(c,d);p.getContext("2d").drawImage(n,0,0),n.close();const h=yield p.convertToBlob(u),f=h.type,m=yield h.arrayBuffer(),g=encode2(m);if(!i.has(t)&&(yield l)===g)return i.set(t,g),a.postMessage({id:t});if(i.get(t)===g)return a.postMessage({id:t});a.postMessage({id:t,type:f,base64:g,width:c,height:d}),i.set(t,g)}}))}}()}));class CanvasManager{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(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:i,blockSelector:s,recordCanvas:a,dataURLOptions:c}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&"all"===t&&this.initCanvasMutationObserver(n,i,s),a&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,i,s,{dataURLOptions:c})}initCanvasFPSObserver(e,t,n,i,s){const a=initCanvasContextObserver(t,n,i,!0),c=new Map,d=new Lt;d.onmessage=e=>{const{id:t}=e.data;if(c.set(t,!1),!("base64"in e.data))return;const{base64:n,type:i,width:s,height:a}=e.data;this.mutationCb({id:t,type:Ot["2D"],commands:[{property:"clearRect",args:[0,0,s,a]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0]}]})};const u=1e3/e;let l,p=0;const takeCanvasSnapshots=e=>{p&&e-p<u||(p=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{isBlocked(t,n,i,!0)||e.push(t)})),e})().forEach((e=>__awaiter(this,0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(c.get(n))return;if(0===e.width||0===e.height)return;if(c.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const i=yield createImageBitmap(e);d.postMessage({id:n,bitmap:i,width:e.width,height:e.height,dataURLOptions:s.dataURLOptions},[i])}))))),l=requestAnimationFrame(takeCanvasSnapshots)};l=requestAnimationFrame(takeCanvasSnapshots),this.resetObservers=()=>{a(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=initCanvasContextObserver(e,t,n,!1),s=function initCanvas2DMutationObserver(e,t,n,i){const s=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const d of a)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[d])continue;const a=patch(t.CanvasRenderingContext2D.prototype,d,(function(s){return function(...a){return isBlocked(this.canvas,n,i,!0)||setTimeout((()=>{const n=serializeArgs(a,t,this);e(this.canvas,{type:Ot["2D"],property:d,args:n})}),0),s.apply(this,a)}}));s.push(a)}catch(c){const n=hookSetter(t.CanvasRenderingContext2D.prototype,d,{set(t){e(this.canvas,{type:Ot["2D"],property:d,args:[t],setter:!0})}});s.push(n)}return()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),a=function initCanvasWebGLMutationObserver(e,t,n,i,s){const a=[];return a.push(...patchGLPrototype(t.WebGLRenderingContext.prototype,Ot.WebGL,e,n,i,0,t)),void 0!==t.WebGL2RenderingContext&&a.push(...patchGLPrototype(t.WebGL2RenderingContext.prototype,Ot.WebGL2,e,n,i,0,t)),()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{i(),s(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const setLatestRAFTimestamp=e=>{this.rafStamps.latestId=e,requestAnimationFrame(setLatestRAFTimestamp)};requestAnimationFrame(setLatestRAFTimestamp)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const i=n.map((e=>{const t=function __rest(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n}(e,["type"]);return t})),{type:s}=n[0];this.mutationCb({id:t,type:s,commands:i}),this.pendingCanvasMutations.delete(e)}}class StylesheetManager{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new StyleSheetMirror,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},i=[];for(const s of e){let e;this.styleMirror.has(s)?e=this.styleMirror.getId(s):(e=this.styleMirror.add(s),i.push({styleId:e,rules:Array.from(s.rules||CSSRule,((e,t)=>({rule:stringifyRule(e),index:t})))})),n.styleIds.push(e)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class ProcessedNodeManager{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function wrapEvent(e){return Object.assign(Object.assign({},e),{timestamp:wt()})}let jt,Ft,qt,Ut=!1;const $t=function createMirror(){return new Mirror}();function record(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:s="rr-block",blockSelector:a=null,ignoreClass:c="rr-ignore",ignoreSelector:d=null,maskTextClass:u="rr-mask",maskTextSelector:l=null,inlineStylesheet:p=!0,maskAllInputs:h,maskInputOptions:f,slimDOMOptions:m,maskInputFn:g,maskTextFn:_,hooks:y,packFn:v,sampling:b={},dataURLOptions:S={},mousemoveWait:w,recordDOM:I=!0,recordCanvas:x=!1,recordCrossOriginIframes:C=!1,recordAfter:O=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:T=!1,collectFonts:R=!1,inlineImages:N=!1,plugins:D,keepIframeSrcFn:Z=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:A}=e;!function registerErrorHandler(e){Tt=e}(A);const L=!C||window.parent===window;let j=!1;if(!L)try{window.parent.document&&(j=!1)}catch(G){j=!0}if(L&&!t)throw new Error("emit function is required");void 0!==w&&void 0===b.mousemove&&(b.mousemove=w),$t.reset();const q=!0===h?{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}:void 0!==f?f:{password:!0},U=!0===m||"all"===m?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===m,headMetaDescKeywords:"all"===m}:m||{};let $;!function polyfill(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let B=0;const eventProcessor=e=>{for(const t of D||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!j&&(e=v(e)),e};jt=(e,s)=>{var a;if(!(null===(a=Rt[0])||void 0===a?void 0:a.isFrozen())||e.type===It.FullSnapshot||e.type===It.IncrementalSnapshot&&e.data.source===xt.Mutation||Rt.forEach((e=>e.unfreeze())),L)null==t||t(eventProcessor(e),s);else if(j){const t={type:"rrweb",event:eventProcessor(e),origin:window.location.origin,isCheckout:s};window.parent.postMessage(t,"*")}if(e.type===It.FullSnapshot)$=e,B=0;else if(e.type===It.IncrementalSnapshot){if(e.data.source===xt.Mutation&&e.data.isAttachIframe)return;B++;const t=i&&B>=i,s=n&&e.timestamp-$.timestamp>n;(t||s)&&Ft(!0)}};const wrappedMutationEmit=e=>{jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.Mutation},e)}))},wrappedScrollEmit=e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.Scroll},e)})),wrappedCanvasMutationEmit=e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.CanvasMutation},e)})),z=new StylesheetManager({mutationCb:wrappedMutationEmit,adoptedStyleSheetCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.AdoptedStyleSheet},e)}))}),W=new IframeManager({mirror:$t,mutationCb:wrappedMutationEmit,stylesheetManager:z,recordCrossOriginIframes:C,wrappedEmit:jt});for(const Y of D||[])Y.getMirror&&Y.getMirror({nodeMirror:$t,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});const K=new ProcessedNodeManager;qt=new CanvasManager({recordCanvas:x,mutationCb:wrappedCanvasMutationEmit,win:window,blockClass:s,blockSelector:a,mirror:$t,sampling:b.canvas,dataURLOptions:S});const H=new ShadowDomManager({mutationCb:wrappedMutationEmit,scrollCb:wrappedScrollEmit,bypassOptions:{blockClass:s,blockSelector:a,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskInputOptions:q,dataURLOptions:S,maskTextFn:_,maskInputFn:g,recordCanvas:x,inlineImages:N,sampling:b,slimDOMOptions:U,iframeManager:W,stylesheetManager:z,canvasManager:qt,keepIframeSrcFn:Z,processedNodeManager:K},mirror:$t});Ft=(e=!1)=>{if(!I)return;jt(wrapEvent({type:It.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e),z.reset(),H.init(),Rt.forEach((e=>e.lock()));const t=function snapshot(e,t){const{mirror:n=new Mirror,blockClass:i="rr-block",blockSelector:s=null,maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:p=!1,maskTextFn:h,maskInputFn:f,slimDOM:m=!1,dataURLOptions:g,preserveWhiteSpace:_,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:w,keepIframeSrcFn:I=()=>!1}=t||{};return serializeNodeWithId(e,{doc:e,mirror:n,blockClass:i,blockSelector:s,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===p?{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}:!1===p?{password:!0}:p,maskTextFn:h,maskInputFn:f,slimDOMOptions:!0===m||"all"===m?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===m,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===m?{}:m,dataURLOptions:g,inlineImages:u,recordCanvas:l,preserveWhiteSpace:_,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:w,keepIframeSrcFn:I,newlyAddedElement:!1})}(document,{mirror:$t,blockClass:s,blockSelector:a,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskAllInputs:q,maskTextFn:_,slimDOM:U,dataURLOptions:S,recordCanvas:x,inlineImages:N,onSerialize:e=>{isSerializedIframe(e,$t)&&W.addIframe(e),isSerializedStylesheet(e,$t)&&z.trackLinkElement(e),hasShadowRoot(e)&&H.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{W.attachIframe(e,t),H.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:Z});if(!t)return console.warn("Failed to snapshot the document");jt(wrapEvent({type:It.FullSnapshot,data:{node:t,initialOffset:getWindowScroll(window)}}),e),Rt.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,$t.getId(document))};try{const e=[],observe=e=>{var t;return callbackWrapper(initObservers)({mutationCb:wrappedMutationEmit,mousemoveCb:(e,t)=>jt(wrapEvent({type:It.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.MouseInteraction},e)})),scrollCb:wrappedScrollEmit,viewportResizeCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.ViewportResize},e)})),inputCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.Input},e)})),mediaInteractionCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.MediaInteraction},e)})),styleSheetRuleCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.StyleSheetRule},e)})),styleDeclarationCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.StyleDeclaration},e)})),canvasMutationCb:wrappedCanvasMutationEmit,fontCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.Font},e)})),selectionCb:e=>{jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.Selection},e)}))},customElementCb:e=>{jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.CustomElement},e)}))},blockClass:s,ignoreClass:c,ignoreSelector:d,maskTextClass:u,maskTextSelector:l,maskInputOptions:q,inlineStylesheet:p,sampling:b,recordDOM:I,recordCanvas:x,inlineImages:N,userTriggeredOnInput:T,collectFonts:R,doc:e,maskInputFn:g,maskTextFn:_,keepIframeSrcFn:Z,blockSelector:a,slimDOMOptions:U,dataURLOptions:S,mirror:$t,iframeManager:W,stylesheetManager:z,shadowDomManager:H,processedNodeManager:K,canvasManager:qt,ignoreCSSAttributes:P,plugins:(null===(t=null==D?void 0:D.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>jt(wrapEvent({type:It.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},y)};W.addLoadListener((t=>{try{e.push(observe(t.contentDocument))}catch(Qt){console.warn(Qt)}}));const init2=()=>{Ft(),e.push(observe(document)),Ut=!0};return"interactive"===document.readyState||"complete"===document.readyState?init2():(e.push(on("DOMContentLoaded",(()=>{jt(wrapEvent({type:It.DomContentLoaded,data:{}})),"DOMContentLoaded"===O&&init2()}))),e.push(on("load",(()=>{jt(wrapEvent({type:It.Load,data:{}})),"load"===O&&init2()}),window))),()=>{e.forEach((e=>e())),K.destroy(),Ut=!1,function unregisterErrorHandler(){Tt=void 0}()}}catch(Qt){console.warn(Qt)}}record.addCustomEvent=(e,t)=>{if(!Ut)throw new Error("please add custom event after start recording");jt(wrapEvent({type:It.Custom,data:{tag:e,payload:t}}))},record.freezePage=()=>{Rt.forEach((e=>e.freeze()))},record.takeFullSnapshot=e=>{if(!Ut)throw new Error("please take full snapshot after start recording");Ft(e)},record.mirror=$t;var Bt,zt=(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))(zt||{}),Wt=(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))(Wt||{}),Vt={DEBUG:!1,LIB_VERSION:"2.55.1"};if("undefined"==typeof window){var Kt={hostname:""};Bt={navigator:{userAgent:"",onLine:!0},document:{location:Kt,referrer:""},screen:{width:0,height:0},location:Kt}}else Bt=window;var Ht,Gt,Yt,Jt,Xt,Qt,er,tr,rr,nr,ir=864e5,or=8e3,sr=Array.prototype,ar=Function.prototype,cr=Object.prototype,dr=sr.slice,ur=cr.toString,lr=cr.hasOwnProperty,pr=Bt.console,hr=Bt.navigator,fr=Bt.document,mr=Bt.opera,gr=Bt.screen,_r=hr.userAgent,yr=ar.bind,vr=sr.forEach,br=sr.indexOf,Sr=sr.map,kr=Array.isArray,wr={},Ir={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},xr={log:function(){if(Vt.DEBUG&&!Ir.isUndefined(pr)&&pr)try{pr.log.apply(pr,arguments)}catch(e){Ir.each(arguments,(function(e){pr.log(e)}))}},warn:function(){if(Vt.DEBUG&&!Ir.isUndefined(pr)&&pr){var e=["Mixpanel warning:"].concat(Ir.toArray(arguments));try{pr.warn.apply(pr,e)}catch(t){Ir.each(e,(function(e){pr.warn(e)}))}}},error:function(){if(Vt.DEBUG&&!Ir.isUndefined(pr)&&pr){var e=["Mixpanel error:"].concat(Ir.toArray(arguments));try{pr.error.apply(pr,e)}catch(t){Ir.each(e,(function(e){pr.error(e)}))}}},critical:function(){if(!Ir.isUndefined(pr)&&pr){var e=["Mixpanel error:"].concat(Ir.toArray(arguments));try{pr.error.apply(pr,e)}catch(t){Ir.each(e,(function(e){pr.error(e)}))}}}},log_func_with_prefix=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(xr,arguments)}},console_with_prefix=function(e){return{log:log_func_with_prefix(xr.log,e),error:log_func_with_prefix(xr.error,e),critical:log_func_with_prefix(xr.critical,e)}};Ir.bind=function(e,t){var n,i;if(yr&&e.bind===yr)return yr.apply(e,dr.call(arguments,1));if(!Ir.isFunction(e))throw new TypeError;return n=dr.call(arguments,2),i=function(){if(!(this instanceof i))return e.apply(t,n.concat(dr.call(arguments)));var s={};s.prototype=e.prototype;var a=new s;s.prototype=null;var c=e.apply(a,n.concat(dr.call(arguments)));return Object(c)===c?c:a},i},Ir.each=function(e,t,n){if(null!=e)if(vr&&e.forEach===vr)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(i in e&&t.call(n,e[i],i,e)===wr)return}else for(var a in e)if(lr.call(e,a)&&t.call(n,e[a],a,e)===wr)return},Ir.extend=function(e){return Ir.each(dr.call(arguments,1),(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},Ir.isArray=kr||function(e){return"[object Array]"===ur.call(e)},Ir.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(t){return!1}},Ir.isArguments=function(e){return!(!e||!lr.call(e,"callee"))},Ir.toArray=function(e){return e?e.toArray?e.toArray():Ir.isArray(e)||Ir.isArguments(e)?dr.call(e):Ir.values(e):[]},Ir.map=function(e,t,n){if(Sr&&e.map===Sr)return e.map(t,n);var i=[];return Ir.each(e,(function(e){i.push(t.call(n,e))})),i},Ir.keys=function(e){var t=[];return null===e||Ir.each(e,(function(e,n){t[t.length]=n})),t},Ir.values=function(e){var t=[];return null===e||Ir.each(e,(function(e){t[t.length]=e})),t},Ir.include=function(e,t){var n=!1;return null===e?n:br&&e.indexOf===br?-1!=e.indexOf(t):(Ir.each(e,(function(e){if(n||(n=e===t))return wr})),n)},Ir.includes=function(e,t){return-1!==e.indexOf(t)},Ir.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},Ir.isObject=function(e){return e===Object(e)&&!Ir.isArray(e)},Ir.isEmptyObject=function(e){if(Ir.isObject(e)){for(var t in e)if(lr.call(e,t))return!1;return!0}return!1},Ir.isUndefined=function(e){return void 0===e},Ir.isString=function(e){return"[object String]"==ur.call(e)},Ir.isDate=function(e){return"[object Date]"==ur.call(e)},Ir.isNumber=function(e){return"[object Number]"==ur.call(e)},Ir.isElement=function(e){return!(!e||1!==e.nodeType)},Ir.encodeDates=function(e){return Ir.each(e,(function(t,n){Ir.isDate(t)?e[n]=Ir.formatDate(t):Ir.isObject(t)&&(e[n]=Ir.encodeDates(t))})),e},Ir.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Ir.formatDate=function(e){function pad(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+pad(e.getUTCMonth()+1)+"-"+pad(e.getUTCDate())+"T"+pad(e.getUTCHours())+":"+pad(e.getUTCMinutes())+":"+pad(e.getUTCSeconds())},Ir.strip_empty_properties=function(e){var t={};return Ir.each(e,(function(e,n){Ir.isString(e)&&e.length>0&&(t[n]=e)})),t},Ir.truncate=function(e,t){var n;return"string"==typeof e?n=e.slice(0,t):Ir.isArray(e)?(n=[],Ir.each(e,(function(e){n.push(Ir.truncate(e,t))}))):Ir.isObject(e)?(n={},Ir.each(e,(function(e,i){n[i]=Ir.truncate(e,t)}))):n=e,n},Ir.JSONEncode=function(){return function(e){var quote=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,(function(e){var t=n[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'},str=function(e,t){var n="",i=0,s="",a="",c=0,d=n,u=[],l=t[e];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(e)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(n+=" ",u=[],"[object Array]"===ur.apply(l)){for(c=l.length,i=0;i<c;i+=1)u[i]=str(i,l)||"null";return a=0===u.length?"[]":n?"[\n"+n+u.join(",\n"+n)+"\n"+d+"]":"["+u.join(",")+"]",n=d,a}for(s in l)lr.call(l,s)&&(a=str(s,l))&&u.push(quote(s)+(n?": ":":")+a);return a=0===u.length?"{}":n?"{"+u.join(",")+d+"}":"{"+u.join(",")+"}",n=d,a}};return str("",{"":e})}}(),Ir.JSONDecode=(Xt={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},Qt=function(e){var t=new SyntaxError(e);throw t.at=Ht,t.text=Yt,t},er=function(e){return e&&e!==Gt&&Qt("Expected '"+e+"' instead of '"+Gt+"'"),Gt=Yt.charAt(Ht),Ht+=1,Gt},tr=function(){var e,t="";for("-"===Gt&&(t="-",er("-"));Gt>="0"&&Gt<="9";)t+=Gt,er();if("."===Gt)for(t+=".";er()&&Gt>="0"&&Gt<="9";)t+=Gt;if("e"===Gt||"E"===Gt)for(t+=Gt,er(),"-"!==Gt&&"+"!==Gt||(t+=Gt,er());Gt>="0"&&Gt<="9";)t+=Gt,er();if(e=+t,isFinite(e))return e;Qt("Bad number")},rr=function(){var e,t,n,i="";if('"'===Gt)for(;er();){if('"'===Gt)return er(),i;if("\\"===Gt)if(er(),"u"===Gt){for(n=0,t=0;t<4&&(e=parseInt(er(),16),isFinite(e));t+=1)n=16*n+e;i+=String.fromCharCode(n)}else{if("string"!=typeof Xt[Gt])break;i+=Xt[Gt]}else i+=Gt}Qt("Bad string")},nr=function(){for(;Gt&&Gt<=" ";)er()},Jt=function(){switch(nr(),Gt){case"{":return function(){var e,t={};if("{"===Gt){if(er("{"),nr(),"}"===Gt)return er("}"),t;for(;Gt;){if(e=rr(),nr(),er(":"),Object.hasOwnProperty.call(t,e)&&Qt('Duplicate key "'+e+'"'),t[e]=Jt(),nr(),"}"===Gt)return er("}"),t;er(","),nr()}}Qt("Bad object")}();case"[":return function(){var e=[];if("["===Gt){if(er("["),nr(),"]"===Gt)return er("]"),e;for(;Gt;){if(e.push(Jt()),nr(),"]"===Gt)return er("]"),e;er(","),nr()}}Qt("Bad array")}();case'"':return rr();case"-":return tr();default:return Gt>="0"&&Gt<="9"?tr():function(){switch(Gt){case"t":return er("t"),er("r"),er("u"),er("e"),!0;case"f":return er("f"),er("a"),er("l"),er("s"),er("e"),!1;case"n":return er("n"),er("u"),er("l"),er("l"),null}Qt('Unexpected "'+Gt+'"')}()}},function(e){var t;return Yt=e,Ht=0,Gt=" ",t=Jt(),nr(),Gt&&Qt("Syntax error"),t}),Ir.base64Encode=function(e){var t,n,i,s,a,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=0,u=0,l="",p=[];if(!e)return e;e=Ir.utf8Encode(e);do{t=(a=e.charCodeAt(d++)<<16|e.charCodeAt(d++)<<8|e.charCodeAt(d++))>>18&63,n=a>>12&63,i=a>>6&63,s=63&a,p[u++]=c.charAt(t)+c.charAt(n)+c.charAt(i)+c.charAt(s)}while(d<e.length);switch(l=p.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l},Ir.utf8Encode=function(e){var t,n,i,s,a="";for(t=n=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,s=0;s<i;s++){var c=e.charCodeAt(s),d=null;c<128?n++:d=c>127&&c<2048?String.fromCharCode(c>>6|192,63&c|128):String.fromCharCode(c>>12|224,c>>6&63|128,63&c|128),null!==d&&(n>t&&(a+=e.substring(t,n)),a+=d,t=n=s+1)}return n>t&&(a+=e.substring(t,e.length)),a},Ir.UUID=function(){var T2=function(){var e,t=1*new Date;if(Bt.performance&&Bt.performance.now)e=Bt.performance.now();else for(e=0;t==1*new Date;)e++;return t.toString(16)+Math.floor(e).toString(16)};return function(){var e=(gr.height*gr.width).toString(16);return T2()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=_r,i=[],s=0;function xor(e,t){var n,s=0;for(n=0;n<t.length;n++)s|=i[n]<<8*n;return e^s}for(e=0;e<n.length;e++)t=n.charCodeAt(e),i.unshift(255&t),i.length>=4&&(s=xor(s,i),i=[]);return i.length>0&&(s=xor(s,i)),s.toString(16)}()+"-"+e+"-"+T2()}}();var Er=["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"];Ir.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<Er.length;t++)if(-1!==e.indexOf(Er[t]))return!0;return!1},Ir.HTTPBuildQuery=function(e,t){var n,i,s=[];return Ir.isUndefined(t)&&(t="&"),Ir.each(e,(function(e,t){n=encodeURIComponent(e.toString()),i=encodeURIComponent(t),s[s.length]=i+"="+n})),s.join(t)},Ir.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var n=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);if(null===n||n&&"string"!=typeof n[1]&&n[1].length)return"";var i=n[1];try{i=decodeURIComponent(i)}catch(s){xr.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},Ir.cookie={get:function(e){for(var t=e+"=",n=fr.cookie.split(";"),i=0;i<n.length;i++){for(var s=n[i];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}return null},parse:function(e){var t;try{t=Ir.JSONDecode(Ir.cookie.get(e))||{}}catch(n){}return t},set_seconds:function(e,t,n,i,s,a,c){var d="",u="",l="";if(c)d="; domain="+c;else if(i){var p=extract_domain(fr.location.hostname);d=p?"; domain=."+p:""}if(n){var h=new Date;h.setTime(h.getTime()+1e3*n),u="; expires="+h.toGMTString()}a&&(s=!0,l="; SameSite=None"),s&&(l+="; secure"),fr.cookie=e+"="+encodeURIComponent(t)+u+"; path=/"+d+l},set:function(e,t,n,i,s,a,c){var d="",u="",l="";if(c)d="; domain="+c;else if(i){var p=extract_domain(fr.location.hostname);d=p?"; domain=."+p:""}if(n){var h=new Date;h.setTime(h.getTime()+24*n*60*60*1e3),u="; expires="+h.toGMTString()}a&&(s=!0,l="; SameSite=None"),s&&(l+="; secure");var f=e+"="+encodeURIComponent(t)+u+"; path=/"+d+l;return fr.cookie=f,f},remove:function(e,t,n){Ir.cookie.set(e,"",-1,t,!1,!1,n)}};var Cr=null,localStorageSupported=function(e,t){if(null!==Cr&&!t)return Cr;var n=!0;try{e=e||window.localStorage;var i="__mplss_"+cheap_guid(8);e.setItem(i,"xyz"),"xyz"!==e.getItem(i)&&(n=!1),e.removeItem(i)}catch(s){n=!1}return Cr=n,n};Ir.localStorage={is_supported:function(e){var t=localStorageSupported(null,e);return t||xr.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){xr.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){Ir.localStorage.error(t)}return null},parse:function(e){try{return Ir.JSONDecode(Ir.localStorage.get(e))||{}}catch(t){}return null},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(n){Ir.localStorage.error(n)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){Ir.localStorage.error(t)}}},Ir.register_event=function(){function fixEvent(e){return e&&(e.preventDefault=fixEvent.preventDefault,e.stopPropagation=fixEvent.stopPropagation),e}return fixEvent.preventDefault=function(){this.returnValue=!1},fixEvent.stopPropagation=function(){this.cancelBubble=!0},function(e,t,n,i,s){if(e)if(e.addEventListener&&!i)e.addEventListener(t,n,!!s);else{var a="on"+t,c=e[a];e[a]=function makeHandler(e,t,n){var handler=function(i){if(i=i||fixEvent(window.event)){var s,a,c=!0;return Ir.isFunction(n)&&(s=n(i)),a=t.call(e,i),!1!==s&&!1!==a||(c=!1),c}};return handler}(e,n,c)}else xr.error("No valid element provided to register_event")}}();var Or=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');Ir.dom_query=function(){function getAllChildren(e){return e.all?e.all:e.getElementsByTagName("*")}var e=/[\t\r\n]/g;function hasClass(t,n){var i=" "+n+" ";return(" "+t.className+" ").replace(e," ").indexOf(i)>=0}function getElementsBySelector(e){if(!fr.getElementsByTagName)return[];var t,n,i,s,a,c,d,u,l,p,h=e.split(" "),f=[fr];for(c=0;c<h.length;c++)if((t=h[c].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){i=(n=t.split("#"))[0];var m=n[1],g=fr.getElementById(m);if(!g||i&&g.nodeName.toLowerCase()!=i)return[];f=[g]}else if(t.indexOf(".")>-1){i=(n=t.split("."))[0];var _=n[1];for(i||(i="*"),s=[],a=0,d=0;d<f.length;d++)for(l="*"==i?getAllChildren(f[d]):f[d].getElementsByTagName(i),u=0;u<l.length;u++)s[a++]=l[u];for(f=[],p=0,d=0;d<s.length;d++)s[d].className&&Ir.isString(s[d].className)&&hasClass(s[d],_)&&(f[p++]=s[d])}else{var y=t.match(Or);if(y){i=y[1];var v,b=y[2],S=y[3],w=y[4];for(i||(i="*"),s=[],a=0,d=0;d<f.length;d++)for(l="*"==i?getAllChildren(f[d]):f[d].getElementsByTagName(i),u=0;u<l.length;u++)s[a++]=l[u];switch(f=[],p=0,S){case"=":v=function(e){return e.getAttribute(b)==w};break;case"~":v=function(e){return e.getAttribute(b).match(new RegExp("\\b"+w+"\\b"))};break;case"|":v=function(e){return e.getAttribute(b).match(new RegExp("^"+w+"-?"))};break;case"^":v=function(e){return 0===e.getAttribute(b).indexOf(w)};break;case"$":v=function(e){return e.getAttribute(b).lastIndexOf(w)==e.getAttribute(b).length-w.length};break;case"*":v=function(e){return e.getAttribute(b).indexOf(w)>-1};break;default:v=function(e){return e.getAttribute(b)}}for(f=[],p=0,d=0;d<s.length;d++)v(s[d])&&(f[p++]=s[d])}else{for(i=t,s=[],a=0,d=0;d<f.length;d++)for(l=f[d].getElementsByTagName(i),u=0;u<l.length;u++)s[a++]=l[u];f=s}}return f}return function(e){return Ir.isElement(e)?[e]:Ir.isObject(e)&&!Ir.isUndefined(e.length)?e:getElementsBySelector.call(this,e)}}();var Tr=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],Rr=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];Ir.info={campaignParams:function(e){var t="",n={};return Ir.each(Tr,(function(i){(t=Ir.getQueryParam(fr.URL,i)).length?n[i]=t:void 0!==e&&(n[i]=e)})),n},clickParams:function(){var e="",t={};return Ir.each(Rr,(function(n){(e=Ir.getQueryParam(fr.URL,n)).length&&(t[n]=e)})),t},marketingParams:function(){return Ir.extend(Ir.info.campaignParams(),Ir.info.clickParams())},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=Ir.info.searchEngine(e),n="yahoo"!=t?"q":"p",i={};if(null!==t){i.$search_engine=t;var s=Ir.getQueryParam(e,n);s.length&&(i.mp_keyword=s)}return i},browser:function(e,t,n){return t=t||"",n||Ir.includes(e," OPR/")?Ir.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":Ir.includes(e,"IEMobile")||Ir.includes(e,"WPDesktop")?"Internet Explorer Mobile":Ir.includes(e,"SamsungBrowser/")?"Samsung Internet":Ir.includes(e,"Edge")||Ir.includes(e,"Edg/")?"Microsoft Edge":Ir.includes(e,"FBIOS")?"Facebook Mobile":Ir.includes(e,"Chrome")?"Chrome":Ir.includes(e,"CriOS")?"Chrome iOS":Ir.includes(e,"UCWEB")||Ir.includes(e,"UCBrowser")?"UC Browser":Ir.includes(e,"FxiOS")?"Firefox iOS":Ir.includes(t,"Apple")?Ir.includes(e,"Mobile")?"Mobile Safari":"Safari":Ir.includes(e,"Android")?"Android Mobile":Ir.includes(e,"Konqueror")?"Konqueror":Ir.includes(e,"Firefox")?"Firefox":Ir.includes(e,"MSIE")||Ir.includes(e,"Trident/")?"Internet Explorer":Ir.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var 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+)?)/}[Ir.info.browser(e,t,n)];if(void 0===i)return null;var s=e.match(i);return s?parseFloat(s[s.length-2]):null},os:function(){var e=_r;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 Bt.location.href},properties:function(e){return"object"!=typeof e&&(e={}),Ir.extend(Ir.strip_empty_properties({$os:Ir.info.os(),$browser:Ir.info.browser(_r,hr.vendor,mr),$referrer:fr.referrer,$referring_domain:Ir.info.referringDomain(fr.referrer),$device:Ir.info.device(_r)}),{$current_url:Ir.info.currentUrl(),$browser_version:Ir.info.browserVersion(_r,hr.vendor,mr),$screen_height:gr.height,$screen_width:gr.width,mp_lib:"web",$lib_version:Vt.LIB_VERSION,$insert_id:cheap_guid(),time:Ir.timestamp()/1e3},Ir.strip_empty_properties(e))},people_properties:function(){return Ir.extend(Ir.strip_empty_properties({$os:Ir.info.os(),$browser:Ir.info.browser(_r,hr.vendor,mr)}),{$browser_version:Ir.info.browserVersion(_r,hr.vendor,mr)})},mpPageViewProperties:function(){return Ir.strip_empty_properties({current_page_title:fr.title,current_domain:Bt.location.hostname,current_url_path:Bt.location.pathname,current_url_protocol:Bt.location.protocol,current_url_search:Bt.location.search})}};var cheap_guid=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},Mr=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Nr=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,extract_domain=function(e){var t=Nr,n=e.split("."),i=n[n.length-1];(i.length>4||"com"===i||"org"===i)&&(t=Mr);var s=e.match(t);return s?s[0]:""},Dr=null,Zr=null;"undefined"!=typeof JSON&&(Dr=JSON.stringify,Zr=JSON.parse),Dr=Dr||Ir.JSONEncode,Zr=Zr||Ir.JSONDecode,Ir.toArray=Ir.toArray,Ir.isObject=Ir.isObject,Ir.JSONEncode=Ir.JSONEncode,Ir.JSONDecode=Ir.JSONDecode,Ir.isBlockedUA=Ir.isBlockedUA,Ir.isEmptyObject=Ir.isEmptyObject,Ir.info=Ir.info,Ir.info.device=Ir.info.device,Ir.info.browser=Ir.info.browser,Ir.info.browserVersion=Ir.info.browserVersion,Ir.info.properties=Ir.info.properties;var Pr="__mp_opt_in_out_";function optIn(e,t){_optInOut(!0,e,t)}function optOut(e,t){_optInOut(!1,e,t)}function hasOptedIn(e,t){return"1"===_getStorageValue(e,t)}function hasOptedOut(e,t){if(function _hasDoNotTrackFlagOn(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||Bt,n=t.navigator||{},i=!1;return Ir.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){Ir.includes([!0,1,"1","yes"],e)&&(i=!0)})),i}(t))return xr.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 n="0"===_getStorageValue(e,t);return n&&xr.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function addOptOutCheckMixpanelLib(e){return _addOptOutCheck(e,(function(e){return this.get_config(e)}))}function addOptOutCheckMixpanelPeople(e){return _addOptOutCheck(e,(function(e){return this._get_config(e)}))}function addOptOutCheckMixpanelGroup(e){return _addOptOutCheck(e,(function(e){return this._get_config(e)}))}function clearOptInOut(e,t){_getStorage(t=t||{}).remove(_getStorageKey(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function _getStorage(e){return"localStorage"===(e=e||{}).persistenceType?Ir.localStorage:Ir.cookie}function _getStorageKey(e,t){return((t=t||{}).persistencePrefix||Pr)+e}function _getStorageValue(e,t){return _getStorage(t).get(_getStorageKey(e,t))}function _optInOut(e,t,n){Ir.isString(t)&&t.length?(_getStorage(n=n||{}).set(_getStorageKey(t,n),e?1:0,Ir.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})):xr.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function _addOptOutCheck(e,t){return function(){var n=!1;try{var i=t.call(this,"token"),s=t.call(this,"ignore_dnt"),a=t.call(this,"opt_out_tracking_persistence_type"),c=t.call(this,"opt_out_tracking_cookie_prefix"),d=t.call(this,"window");i&&(n=hasOptedOut(i,{ignoreDnt:s,persistenceType:a,persistencePrefix:c,window:d}))}catch(l){xr.error("Unexpected error when checking tracking opt-out status: "+l)}if(!n)return e.apply(this,arguments);var u=arguments[arguments.length-1];"function"==typeof u&&u(0)}}var Ar=console_with_prefix("lock"),SharedLock=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};SharedLock.prototype.withLock=function(e,t,n){n||"function"==typeof t||(n=t,t=null);var i=n||(new Date).getTime()+"|"+Math.random(),s=(new Date).getTime(),a=this.storageKey,c=this.pollIntervalMS,d=this.timeoutMS,u=this.storage,l=a+":X",p=a+":Y",h=a+":Z",reportError=function(e){t&&t(e)},delay=function(e){if((new Date).getTime()-s>d)return Ar.error("Timeout waiting for mutex on "+a+"; clearing lock. ["+i+"]"),u.removeItem(h),u.removeItem(p),void loop();setTimeout((function(){try{e()}catch(t){reportError(t)}}),c*(Math.random()+.1))},waitFor=function(e,t){e()?t():delay((function(){waitFor(e,t)}))},getSetY=function(){var e=u.getItem(p);if(e&&e!==i)return!1;if(u.setItem(p,i),u.getItem(p)===i)return!0;if(!localStorageSupported(u,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},loop=function(){u.setItem(l,i),waitFor(getSetY,(function(){u.getItem(l)!==i?delay((function(){u.getItem(p)===i?waitFor((function(){return!u.getItem(h)}),criticalSection):loop()})):criticalSection()}))},criticalSection=function(){u.setItem(h,"1");try{e()}finally{u.removeItem(h),u.getItem(p)===i&&u.removeItem(p),u.getItem(l)===i&&u.removeItem(l)}};try{if(!localStorageSupported(u,!0))throw new Error("localStorage support check failed");loop()}catch(f){reportError(f)}};var Lr=console_with_prefix("batch"),RequestQueue=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||Ir.bind(Lr.error,Lr),this.lock=new SharedLock(e,{storage:this.storage}),this.usePersistence=t.usePersistence,this.pid=t.pid||null,this.memQueue=[]};RequestQueue.prototype.enqueue=function(e,t,n){var i={id:cheap_guid(),flushAfter:(new Date).getTime()+2*t,payload:e};this.usePersistence?this.lock.withLock(Ir.bind((function lockAcquired(){var t;try{var s=this.readFromStorage();s.push(i),(t=this.saveToStorage(s))&&this.memQueue.push(i)}catch(a){this.reportError("Error enqueueing item",e),t=!1}n&&n(t)}),this),Ir.bind((function lockFailure(e){this.reportError("Error acquiring storage lock",e),n&&n(!1)}),this),this.pid):(this.memQueue.push(i),n&&n(!0))},RequestQueue.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(this.usePersistence&&t.length<e){var n=this.readFromStorage();if(n.length){var i={};Ir.each(t,(function(e){i[e.id]=!0}));for(var s=0;s<n.length;s++){var a=n[s];if((new Date).getTime()>a.flushAfter&&!i[a.id]&&(a.orphaned=!0,t.push(a),t.length>=e))break}}}return t};var filterOutIDsAndInvalid=function(e,t){var n=[];return Ir.each(e,(function(e){e.id&&!t[e.id]&&n.push(e)})),n};RequestQueue.prototype.removeItemsByID=function(e,t){var n={};if(Ir.each(e,(function(e){n[e]=!0})),this.memQueue=filterOutIDsAndInvalid(this.memQueue,n),this.usePersistence){var i=Ir.bind((function(){var t;try{var i=this.readFromStorage();if(i=filterOutIDsAndInvalid(i,n),t=this.saveToStorage(i)){i=this.readFromStorage();for(var s=0;s<i.length;s++){var a=i[s];if(a.id&&n[a.id])return this.reportError("Item not removed from storage"),!1}}}catch(c){this.reportError("Error removing items",e),t=!1}return t}),this);this.lock.withLock((function lockAcquired(){var e=i();t&&t(e)}),Ir.bind((function lockFailure(e){var n=!1;if(this.reportError("Error acquiring storage lock",e),!localStorageSupported(this.storage,!0)&&!(n=i()))try{this.storage.removeItem(this.storageKey)}catch(s){this.reportError("Error clearing queue",s)}t&&t(n)}),this),this.pid)}else t&&t(!0)};var updatePayloads=function(e,t){var n=[];return Ir.each(e,(function(e){var i=e.id;if(i in t){var s=t[i];null!==s&&(e.payload=s,n.push(e))}else n.push(e)})),n};RequestQueue.prototype.updatePayloads=function(e,t){this.memQueue=updatePayloads(this.memQueue,e),this.usePersistence?this.lock.withLock(Ir.bind((function lockAcquired(){var n;try{var i=this.readFromStorage();i=updatePayloads(i,e),n=this.saveToStorage(i)}catch(s){this.reportError("Error updating items",e),n=!1}t&&t(n)}),this),Ir.bind((function lockFailure(e){this.reportError("Error acquiring storage lock",e),t&&t(!1)}),this),this.pid):t&&t(!0)},RequestQueue.prototype.readFromStorage=function(){var e;try{(e=this.storage.getItem(this.storageKey))&&(e=Zr(e),Ir.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null))}catch(t){this.reportError("Error retrieving queue",t),e=null}return e||[]},RequestQueue.prototype.saveToStorage=function(e){try{return this.storage.setItem(this.storageKey,Dr(e)),!0}catch(t){return this.reportError("Error saving queue",t),!1}},RequestQueue.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var jr=console_with_prefix("batch"),RequestBatcher=function(e,t){this.errorReporter=t.errorReporter,this.queue=new RequestQueue(e,{errorReporter:Ir.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};RequestBatcher.prototype.enqueue=function(e,t){this.queue.enqueue(e,this.flushInterval,t)},RequestBatcher.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},RequestBatcher.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},RequestBatcher.prototype.clear=function(){this.queue.clear()},RequestBatcher.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},RequestBatcher.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},RequestBatcher.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(Ir.bind((function(){this.stopped||this.flush()}),this),this.flushInterval))},RequestBatcher.prototype.flush=function(e){try{if(this.requestInProgress)return void jr.log("Flush: Request already in progress");e=e||{};var t=this.libConfig.batch_request_timeout_ms,n=(new Date).getTime(),i=this.batchSize,s=this.queue.fillBatch(i),a=s.length===i,c=[],d={};if(Ir.each(s,(function(e){var t=e.payload;if(this.beforeSendHook&&!e.orphaned&&(t=this.beforeSendHook(t)),t){t.event&&t.properties&&(t.properties=Ir.extend({},t.properties,{mp_sent_by_lib_version:Vt.LIB_VERSION}));var n=!0,i=e.id;i?(this.itemIdsSentSuccessfully[i]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:e,batchSize:s.length,timesSent:this.itemIdsSentSuccessfully[i]}),n=!1):this.reportError("[dupe] found item with no ID",{item:e}),n&&c.push(t)}d[e.id]=t}),this),c.length<1)return void this.resetFlush();this.requestInProgress=!0;var u=Ir.bind((function(c){this.requestInProgress=!1;try{var u=!1;if(e.unloading)this.queue.updatePayloads(d);else if(Ir.isObject(c)&&"timeout"===c.error&&(new Date).getTime()-n>=t)this.reportError("Network timeout; retrying"),this.flush();else if(Ir.isObject(c)&&(c.httpStatusCode>=500||429===c.httpStatusCode||c.httpStatusCode<=0&&(h=Bt.navigator.onLine,!Ir.isUndefined(h)&&!h)||"timeout"===c.error)){var l=2*this.flushInterval;c.retryAfter&&(l=1e3*parseInt(c.retryAfter,10)||l),l=Math.min(6e5,l),this.reportError("Error; retry in "+l+" ms"),this.scheduleFlush(l)}else if(Ir.isObject(c)&&413===c.httpStatusCode)if(s.length>1){var p=Math.max(1,Math.floor(i/2));this.batchSize=Math.min(this.batchSize,p,s.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",s),this.resetBatchSize(),u=!0;else u=!0;u&&(this.queue.removeItemsByID(Ir.map(s,(function(e){return e.id})),Ir.bind((function(e){e?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!a?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)),Ir.each(s,Ir.bind((function(e){var t=e.id;t?(this.itemIdsSentSuccessfully[t]=this.itemIdsSentSuccessfully[t]||0,this.itemIdsSentSuccessfully[t]++,this.itemIdsSentSuccessfully[t]>5&&this.reportError("[dupe] item ID sent too many times",{item:e,batchSize:s.length,timesSent:this.itemIdsSentSuccessfully[t]})):this.reportError("[dupe] found item with no ID while removing",{item:e})}),this)))}catch(f){this.reportError("Error handling API response",f),this.resetFlush()}var h}),this),l={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(l.transport="sendBeacon"),jr.log("MIXPANEL REQUEST:",c),this.sendRequest(c,l,u)}catch(p){this.reportError("Error flushing request queue",p),this.resetFlush()}},RequestBatcher.prototype.reportError=function(e,t){if(jr.error.apply(jr.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){jr.error(n)}};var Fr=console_with_prefix("recorder"),qr=Bt.CompressionStream,Ur={batch_size:1e3,batch_flush_interval_ms:1e4,batch_request_timeout_ms:9e4,batch_autostart:!0},$r=new Set([Wt.MouseMove,Wt.MouseInteraction,Wt.Scroll,Wt.ViewportResize,Wt.Input,Wt.TouchMove,Wt.MediaInteraction,Wt.Drag,Wt.Selection]);var MixpanelRecorder=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=ir,this.recordMinMs=0,this._initBatcher()};MixpanelRecorder.prototype._initBatcher=function(){this.batcher=new RequestBatcher("__mprec",{libConfig:Ur,sendRequestFunc:Ir.bind(this.flushEventsWithOptOut,this),errorReporter:Ir.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},MixpanelRecorder.prototype.get_config=function(e){return this._mixpanel.get_config(e)},MixpanelRecorder.prototype.startRecording=function(e){if(null===this._stopRecording){this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>ir&&(this.recordMaxMs=ir,Fr.critical("record_max_ms cannot be greater than "+ir+"ms. Capping value.")),this.recordMinMs=this.get_config("record_min_ms"),this.recordMinMs>or&&(this.recordMinMs=or,Fr.critical("record_min_ms cannot be greater than 8000ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=(new Date).getTime(),this.replayId=Ir.UUID(),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=Ir.bind((function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(Ir.bind((function(){Fr.log("Idle timeout reached, restarting recording."),this.resetRecording()}),this),this.get_config("record_idle_timeout_ms"))}),this),n=this.get_config("record_block_selector");""!==n&&null!==n||(n=void 0),this._stopRecording=record({emit:Ir.bind((function(e){this.batcher.enqueue(e),function isUserEvent(e){return e.type===zt.IncrementalSnapshot&&$r.has(e.data.source)}(e)&&(this.batcher.stopped&&(new Date).getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t())}),this),blockClass:this.get_config("record_block_class"),blockSelector:n,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(Ir.bind(this.resetRecording,this),this.recordMaxMs)}else Fr.log("Recording already in progress, skipping startRecording.")},MixpanelRecorder.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},MixpanelRecorder.prototype.stopRecording=function(){null!==this._stopRecording&&(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)},MixpanelRecorder.prototype.flushEventsWithOptOut=function(e,t,n){this._flushEvents(e,t,n,Ir.bind(this._onOptOut,this))},MixpanelRecorder.prototype._onOptOut=function(e){0===e&&(this.recEvents=[],this.stopRecording())},MixpanelRecorder.prototype._sendRequest=function(e,t,n,i){var s=Ir.bind((function(t,n){200===t.status&&this.replayId===e&&this.seqNo++,i({status:0,httpStatusCode:t.status,responseBody:n,retryAfter:t.headers.get("Retry-After")})}),this);Bt.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/octet-stream"},body:n}).then((function(e){e.json().then((function(t){s(e,t)})).catch((function(e){i({error:e})}))})).catch((function(e){i({error:e,httpStatusCode:0})}))},MixpanelRecorder.prototype._flushEvents=addOptOutCheckMixpanelLib((function(e,t,n){const i=e.length;if(i>0){var s=this.replayId,a=e[0].timestamp;0!==this.seqNo&&this.replayStartTime||(0!==this.seqNo&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=a);var c=e[i-1].timestamp-this.replayStartTime,d={distinct_id:String(this._mixpanel.get_distinct_id()),seq:this.seqNo,batch_start_time:a/1e3,replay_id:s,replay_length_ms:c,replay_start_time:this.replayStartTime/1e3},u=Ir.JSONEncode(e),l=this._mixpanel.get_property("$device_id");l&&(d.$device_id=l);var p=this._mixpanel.get_property("$user_id");if(p&&(d.$user_id=p),qr){var h=new Blob([u],{type:"application/json"}).stream().pipeThrough(new qr("gzip"));new Response(h).blob().then(Ir.bind((function(e){d.format="gzip",this._sendRequest(s,d,e,n)}),this))}else d.format="body",this._sendRequest(s,d,u,n)}})),MixpanelRecorder.prototype.reportError=function(e,t){Fr.error.apply(Fr.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){Fr.error(n)}},Bt.__mp_recorder=MixpanelRecorder;var DomTracker=function(){};DomTracker.prototype.create_properties=function(){},DomTracker.prototype.event_handler=function(){},DomTracker.prototype.after_track_handler=function(){},DomTracker.prototype.init=function(e){return this.mp=e,this},DomTracker.prototype.track=function(e,t,n,i){var s=this,a=Ir.dom_query(e);if(0!==a.length)return Ir.each(a,(function(e){Ir.register_event(e,this.override_event,(function(e){var a={},c=s.create_properties(n,this),d=s.mp.get_config("track_links_timeout");s.event_handler(e,this,a),window.setTimeout(s.track_callback(i,c,a,!0),d),s.mp.track(t,c,s.track_callback(i,c,a))}))}),this),!0;xr.error("The DOM query ("+e+") returned 0 elements")},DomTracker.prototype.track_callback=function(e,t,n,i){i=i||!1;var s=this;return function(){n.callback_fired||(n.callback_fired=!0,e&&!1===e(i,t)||s.after_track_handler(t,n,i))}},DomTracker.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):Ir.extend({},e)};var LinkTracker=function(){this.override_event="click"};Ir.inherit(LinkTracker,DomTracker),LinkTracker.prototype.create_properties=function(e,t){var n=LinkTracker.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},LinkTracker.prototype.event_handler=function(e,t,n){n.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,n.href=t.href,n.new_tab||e.preventDefault()},LinkTracker.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout((function(){window.location=t.href}),0)};var FormTracker=function(){this.override_event="submit"};Ir.inherit(FormTracker,DomTracker),FormTracker.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},FormTracker.prototype.after_track_handler=function(e,t){setTimeout((function(){t.element.submit()}),0)};var Br="$set",zr="$set_once",Wr="$unset",Vr="$add",Kr="$append",Hr="$union",Gr="$remove",Yr={set_action:function(e,t){var n={},i={};return Ir.isObject(e)?Ir.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[Br]=i,n},unset_action:function(e){var t={},n=[];return Ir.isArray(e)||(e=[e]),Ir.each(e,(function(e){this._is_reserved_property(e)||n.push(e)}),this),t[Wr]=n,t},set_once_action:function(e,t){var n={},i={};return Ir.isObject(e)?Ir.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[zr]=i,n},union_action:function(e,t){var n={},i={};return Ir.isObject(e)?Ir.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=Ir.isArray(e)?e:[e])}),this):i[e]=Ir.isArray(t)?t:[t],n[Hr]=i,n},append_action:function(e,t){var n={},i={};return Ir.isObject(e)?Ir.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[Kr]=i,n},remove_action:function(e,t){var n={},i={};return Ir.isObject(e)?Ir.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[Gr]=i,n},delete_action:function(){var e={$delete:""};return e}},MixpanelGroup=function(){};Ir.extend(MixpanelGroup.prototype,Yr),MixpanelGroup.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},MixpanelGroup.prototype.set=addOptOutCheckMixpanelGroup((function(e,t,n){var i=this.set_action(e,t);return Ir.isObject(e)&&(n=t),this._send_request(i,n)})),MixpanelGroup.prototype.set_once=addOptOutCheckMixpanelGroup((function(e,t,n){var i=this.set_once_action(e,t);return Ir.isObject(e)&&(n=t),this._send_request(i,n)})),MixpanelGroup.prototype.unset=addOptOutCheckMixpanelGroup((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),MixpanelGroup.prototype.union=addOptOutCheckMixpanelGroup((function(e,t,n){Ir.isObject(e)&&(n=t);var i=this.union_action(e,t);return this._send_request(i,n)})),MixpanelGroup.prototype.delete=addOptOutCheckMixpanelGroup((function(e){var t=this.delete_action();return this._send_request(t,e)})),MixpanelGroup.prototype.remove=addOptOutCheckMixpanelGroup((function(e,t,n){var i=this.remove_action(e,t);return this._send_request(i,n)})),MixpanelGroup.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=Ir.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)},MixpanelGroup.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},MixpanelGroup.prototype._get_config=function(e){return this._mixpanel.get_config(e)},MixpanelGroup.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},MixpanelGroup.prototype.remove=MixpanelGroup.prototype.remove,MixpanelGroup.prototype.set=MixpanelGroup.prototype.set,MixpanelGroup.prototype.set_once=MixpanelGroup.prototype.set_once,MixpanelGroup.prototype.union=MixpanelGroup.prototype.union,MixpanelGroup.prototype.unset=MixpanelGroup.prototype.unset,MixpanelGroup.prototype.toString=MixpanelGroup.prototype.toString;var MixpanelPeople=function(){};Ir.extend(MixpanelPeople.prototype,Yr),MixpanelPeople.prototype._init=function(e){this._mixpanel=e},MixpanelPeople.prototype.set=addOptOutCheckMixpanelPeople((function(e,t,n){var i=this.set_action(e,t);return Ir.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),i[Br]=Ir.extend({},Ir.info.people_properties(),i[Br]),this._send_request(i,n)})),MixpanelPeople.prototype.set_once=addOptOutCheckMixpanelPeople((function(e,t,n){var i=this.set_once_action(e,t);return Ir.isObject(e)&&(n=t),this._send_request(i,n)})),MixpanelPeople.prototype.unset=addOptOutCheckMixpanelPeople((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),MixpanelPeople.prototype.increment=addOptOutCheckMixpanelPeople((function(e,t,n){var i={},s={};return Ir.isObject(e)?(Ir.each(e,(function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void xr.error("Invalid increment value passed to mixpanel.people.increment - must be a number");s[t]=e}}),this),n=t):(Ir.isUndefined(t)&&(t=1),s[e]=t),i[Vr]=s,this._send_request(i,n)})),MixpanelPeople.prototype.append=addOptOutCheckMixpanelPeople((function(e,t,n){Ir.isObject(e)&&(n=t);var i=this.append_action(e,t);return this._send_request(i,n)})),MixpanelPeople.prototype.remove=addOptOutCheckMixpanelPeople((function(e,t,n){Ir.isObject(e)&&(n=t);var i=this.remove_action(e,t);return this._send_request(i,n)})),MixpanelPeople.prototype.union=addOptOutCheckMixpanelPeople((function(e,t,n){Ir.isObject(e)&&(n=t);var i=this.union_action(e,t);return this._send_request(i,n)})),MixpanelPeople.prototype.track_charge=addOptOutCheckMixpanelPeople((function(e,t,n){if(Ir.isNumber(e)||(e=parseFloat(e),!isNaN(e)))return this.append("$transactions",Ir.extend({$amount:e},t),n);xr.error("Invalid value passed to mixpanel.people.track_charge - must be a number")})),MixpanelPeople.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},MixpanelPeople.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}xr.error("mixpanel.people.delete_user() requires you to call identify() first")},MixpanelPeople.prototype.toString=function(){return this._mixpanel.toString()+".people"},MixpanelPeople.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),i=this._mixpanel.get_property("$user_id"),s=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),i&&(e.$user_id=i),s&&(e.$had_persisted_distinct_id=s);var a=Ir.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:a,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),Ir.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),Ir.truncate(a,255))},MixpanelPeople.prototype._get_config=function(e){return this._mixpanel.get_config(e)},MixpanelPeople.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},MixpanelPeople.prototype._enqueue=function(e){Br in e?this._mixpanel.persistence._add_to_people_queue(Br,e):zr in e?this._mixpanel.persistence._add_to_people_queue(zr,e):Wr in e?this._mixpanel.persistence._add_to_people_queue(Wr,e):Vr in e?this._mixpanel.persistence._add_to_people_queue(Vr,e):Kr in e?this._mixpanel.persistence._add_to_people_queue(Kr,e):Gr in e?this._mixpanel.persistence._add_to_people_queue(Gr,e):Hr in e?this._mixpanel.persistence._add_to_people_queue(Hr,e):xr.error("Invalid call to _enqueue():",e)},MixpanelPeople.prototype._flush_one_queue=function(e,t,n,i){var s=this,a=Ir.extend({},this._mixpanel.persistence.load_queue(e)),c=a;Ir.isUndefined(a)||!Ir.isObject(a)||Ir.isEmptyObject(a)||(s._mixpanel.persistence._pop_from_people_queue(e,a),s._mixpanel.persistence.save(),i&&(c=i(a)),t.call(s,c,(function(t,i){0===t&&s._mixpanel.persistence._add_to_people_queue(e,a),Ir.isUndefined(n)||n(t,i)})))},MixpanelPeople.prototype._flush=function(e,t,n,i,s,a,c){var d=this;this._flush_one_queue(Br,this.set,e),this._flush_one_queue(zr,this.set_once,i),this._flush_one_queue(Wr,this.unset,a,(function(e){return Ir.keys(e)})),this._flush_one_queue(Vr,this.increment,t),this._flush_one_queue(Hr,this.union,s);var u=this._mixpanel.persistence.load_queue(Kr);if(!Ir.isUndefined(u)&&Ir.isArray(u)&&u.length)for(var l,append_callback=function(e,t){0===e&&d._mixpanel.persistence._add_to_people_queue(Kr,l),Ir.isUndefined(n)||n(e,t)},p=u.length-1;p>=0;p--)u=this._mixpanel.persistence.load_queue(Kr),l=u.pop(),d._mixpanel.persistence.save(),Ir.isEmptyObject(l)||d.append(l,append_callback);var h=this._mixpanel.persistence.load_queue(Gr);if(!Ir.isUndefined(h)&&Ir.isArray(h)&&h.length)for(var f,remove_callback=function(e,t){0===e&&d._mixpanel.persistence._add_to_people_queue(Gr,f),Ir.isUndefined(c)||c(e,t)},m=h.length-1;m>=0;m--)h=this._mixpanel.persistence.load_queue(Gr),f=h.pop(),d._mixpanel.persistence.save(),Ir.isEmptyObject(f)||d.remove(f,remove_callback)},MixpanelPeople.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},MixpanelPeople.prototype.set=MixpanelPeople.prototype.set,MixpanelPeople.prototype.set_once=MixpanelPeople.prototype.set_once,MixpanelPeople.prototype.unset=MixpanelPeople.prototype.unset,MixpanelPeople.prototype.increment=MixpanelPeople.prototype.increment,MixpanelPeople.prototype.append=MixpanelPeople.prototype.append,MixpanelPeople.prototype.remove=MixpanelPeople.prototype.remove,MixpanelPeople.prototype.union=MixpanelPeople.prototype.union,MixpanelPeople.prototype.track_charge=MixpanelPeople.prototype.track_charge,MixpanelPeople.prototype.clear_charges=MixpanelPeople.prototype.clear_charges,MixpanelPeople.prototype.delete_user=MixpanelPeople.prototype.delete_user,MixpanelPeople.prototype.toString=MixpanelPeople.prototype.toString;var Jr,Xr="__mps",Qr="__mpso",en="__mpus",tn="__mpa",rn="__mpap",nn="__mpr",sn="__mpu",an="$people_distinct_id",cn="__alias",dn="__timers",un=[Xr,Qr,en,tn,rn,nn,sn,an,cn,dn],MixpanelPersistence=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;"cookie"!==t&&"localStorage"!==t&&(xr.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&Ir.localStorage.is_supported()?this.storage=Ir.localStorage:this.storage=Ir.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};MixpanelPersistence.prototype.properties=function(){var e={};return this.load(),Ir.each(this.props,(function(t,n){Ir.include(un,n)||(e[n]=t)})),e},MixpanelPersistence.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Ir.extend({},e))}},MixpanelPersistence.prototype.upgrade=function(){var e,t;this.storage===Ir.localStorage?(e=Ir.cookie.parse(this.name),Ir.cookie.remove(this.name),Ir.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===Ir.cookie&&(t=Ir.localStorage.parse(this.name),Ir.localStorage.remove(this.name),t&&this.register_once(t))},MixpanelPersistence.prototype.save=function(){this.disabled||this.storage.set(this.name,Ir.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},MixpanelPersistence.prototype.load_prop=function(e){return this.load(),this.props[e]},MixpanelPersistence.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},MixpanelPersistence.prototype.clear=function(){this.remove(),this.props={}},MixpanelPersistence.prototype.register_once=function(e,t,n){return!!Ir.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n,this.load(),Ir.each(e,(function(e,n){this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e)}),this),this.save(),!0)},MixpanelPersistence.prototype.register=function(e,t){return!!Ir.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,this.load(),Ir.extend(this.props,e),this.save(),!0)},MixpanelPersistence.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())},MixpanelPersistence.prototype.update_search_keyword=function(e){this.register(Ir.info.searchInfo(e))},MixpanelPersistence.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:Ir.info.referringDomain(e)||"$direct"},"")},MixpanelPersistence.prototype.get_referrer_info=function(){return Ir.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},MixpanelPersistence.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},MixpanelPersistence.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},MixpanelPersistence.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},MixpanelPersistence.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},MixpanelPersistence.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},MixpanelPersistence.prototype.get_cross_subdomain=function(){return this.cross_subdomain},MixpanelPersistence.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},MixpanelPersistence.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),i=t[e],s=this._get_or_create_queue(Br),a=this._get_or_create_queue(zr),c=this._get_or_create_queue(Wr),d=this._get_or_create_queue(Vr),u=this._get_or_create_queue(Hr),l=this._get_or_create_queue(Gr,[]),p=this._get_or_create_queue(Kr,[]);n===Xr?(Ir.extend(s,i),this._pop_from_people_queue(Vr,i),this._pop_from_people_queue(Hr,i),this._pop_from_people_queue(Wr,i)):n===Qr?(Ir.each(i,(function(e,t){t in a||(a[t]=e)})),this._pop_from_people_queue(Wr,i)):n===en?Ir.each(i,(function(e){Ir.each([s,a,d,u],(function(t){e in t&&delete t[e]})),Ir.each(p,(function(t){e in t&&delete t[e]})),c[e]=!0})):n===tn?(Ir.each(i,(function(e,t){t in s?s[t]+=e:(t in d||(d[t]=0),d[t]+=e)}),this),this._pop_from_people_queue(Wr,i)):n===sn?(Ir.each(i,(function(e,t){Ir.isArray(e)&&(t in u||(u[t]=[]),u[t]=u[t].concat(e))})),this._pop_from_people_queue(Wr,i)):n===nn?(l.push(i),this._pop_from_people_queue(Kr,i)):n===rn&&(p.push(i),this._pop_from_people_queue(Wr,i)),xr.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),xr.log(t),this.save()},MixpanelPersistence.prototype._pop_from_people_queue=function(e,t){var n=this.props[this._get_queue_key(e)];Ir.isUndefined(n)||Ir.each(t,(function(t,i){e===Kr||e===Gr?Ir.each(n,(function(e){e[i]===t&&delete e[i]})):delete n[i]}),this)},MixpanelPersistence.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))},MixpanelPersistence.prototype._get_queue_key=function(e){return e===Br?Xr:e===zr?Qr:e===Wr?en:e===Vr?tn:e===Kr?rn:e===Gr?nn:e===Hr?sn:void xr.error("Invalid queue:",e)},MixpanelPersistence.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=Ir.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},MixpanelPersistence.prototype.set_event_timer=function(e,t){var n=this.load_prop(dn)||{};n[e]=t,this.props[dn]=n,this.save()},MixpanelPersistence.prototype.remove_event_timer=function(e){var t=(this.load_prop(dn)||{})[e];return Ir.isUndefined(t)||(delete this.props[dn][e],this.save()),t};var ln,load_extra_bundle=function(e,t){throw new Error(e+" not available in this build.")},IDENTITY_FUNC=function(e){return e},NOOP_FUNC=function(){},pn="mixpanel",hn="base64",fn="$device:",mn=Bt.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,gn=!mn&&-1===_r.indexOf("MSIE")&&-1===_r.indexOf("Mozilla"),_n=null;hr.sendBeacon&&(_n=function(){return hr.sendBeacon.apply(hr,arguments)});var yn={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},vn={api_host:"https://api-js.mixpanel.com",api_routes:yn,api_method:"POST",api_transport:"XHR",api_payload_format:hn,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:NOOP_FUNC,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:NOOP_FUNC,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_collect_fonts:!1,record_idle_timeout_ms:18e5,record_inline_images:!1,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:ir,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},bn=!1,MixpanelLib=function(){},create_mplib=function(e,t,n){var i,s=n===pn?ln:ln[n];if(s&&0===Jr)i=s;else{if(s&&!Ir.isArray(s))return void xr.error("You have already initialized "+n);i=new MixpanelLib}if(i._cached_groups={},i._init(e,t,n),i.people=new MixpanelPeople,i.people._init(i),!i.get_config("skip_first_touch_marketing")){var a=Ir.info.campaignParams(null),c={},d=!1;Ir.each(a,(function(e,t){c["initial_"+t]=e,e&&(d=!0)})),d&&i.people.set_once(c)}return Vt.DEBUG=Vt.DEBUG||i.get_config("debug"),!Ir.isUndefined(s)&&Ir.isArray(s)&&(i._execute_array.call(i.people,s.people),i._execute_array(s)),i};MixpanelLib.prototype.init=function(e,t,n){if(Ir.isUndefined(n))this.report_error("You must name your new library: init(token, config, name)");else{if(n!==pn){var i=create_mplib(e,t,n);return ln[n]=i,i._loaded(),i}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},MixpanelLib.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var i={};"api_payload_format"in t||(t.api_host||vn.api_host).match(/\.mixpanel\.com/)&&(i.api_payload_format="json");if(this.set_config(Ir.extend({},vn,i,t,{name:n,token:e,callback_fn:(n===pn?n:pn+"."+n)+"._jsc"})),this._jsc=NOOP_FUNC,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests)if(Ir.localStorage.is_supported(!0)&&mn){if(this.init_batchers(),_n&&Bt.addEventListener){var s=Ir.bind((function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})}),this);Bt.addEventListener("pagehide",(function(e){e.persisted&&s()})),Bt.addEventListener("visibilitychange",(function(){"hidden"===fr.visibilityState&&s()}))}}else this._batch_requests=!1,xr.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),Ir.each(this.get_batcher_configs(),(function(e){xr.log("Clearing batch queue "+e.queue_key),Ir.localStorage.remove(e.queue_key)}));this.persistence=this.cookie=new MixpanelPersistence(this.config),this.unpersisted_superprops={},this._gdpr_init();var a=Ir.UUID();this.get_distinct_id()||this.register_once({distinct_id:fn+a,$device_id:a},"");var c=this.get_config("track_pageview");c&&this._init_url_change_tracking(c),this.get_config("record_sessions_percent")>0&&100*Math.random()<=this.get_config("record_sessions_percent")&&this.start_session_recording()},MixpanelLib.prototype.start_session_recording=addOptOutCheckMixpanelLib((function(){if(Bt.MutationObserver){var e=Ir.bind((function(){this._recorder=this._recorder||new Bt.__mp_recorder(this),this._recorder.startRecording()}),this);Ir.isUndefined(Bt.__mp_recorder)?load_extra_bundle(this.get_config("recorder_src"),e):e()}else xr.critical("Browser does not support MutationObserver; skipping session recording")})),MixpanelLib.prototype.stop_session_recording=function(){this._recorder?this._recorder.stopRecording():xr.critical("Session recorder module not loaded")},MixpanelLib.prototype.get_session_recording_properties=function(){var e={};if(this._recorder){var t=this._recorder.replayId;t&&(e.$mp_replay_id=t)}return e},MixpanelLib.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var e=Ir.info.campaignParams(null);Ir.each(e,function(e,t){this.unregister(t)}.bind(this))}},MixpanelLib.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(fr.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(Ir.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(fr.referrer)},MixpanelLib.prototype._dom_loaded=function(){Ir.each(this.__dom_loaded_queue,(function(e){this._track_dom.apply(this,e)}),this),this.has_opted_out_tracking()||Ir.each(this.__request_queue,(function(e){this._send_request.apply(this,e)}),this),delete this.__dom_loaded_queue,delete this.__request_queue},MixpanelLib.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!bn)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},MixpanelLib.prototype._init_url_change_tracking=function(e){var t="";if(this.track_pageview()&&(t=Ir.info.currentUrl()),Ir.include(["full-url","url-with-path-and-query-string","url-with-path"],e)){Bt.addEventListener("popstate",(function(){Bt.dispatchEvent(new Event("mp_locationchange"))})),Bt.addEventListener("hashchange",(function(){Bt.dispatchEvent(new Event("mp_locationchange"))}));var n=Bt.history.pushState;"function"==typeof n&&(Bt.history.pushState=function(e,t,i){n.call(Bt.history,e,t,i),Bt.dispatchEvent(new Event("mp_locationchange"))});var i=Bt.history.replaceState;"function"==typeof i&&(Bt.history.replaceState=function(e,t,n){i.call(Bt.history,e,t,n),Bt.dispatchEvent(new Event("mp_locationchange"))}),Bt.addEventListener("mp_locationchange",function(){var n=Ir.info.currentUrl(),i=!1;("full-url"===e?i=n!==t:"url-with-path-and-query-string"===e?i=n.split("#")[0]!==t.split("#")[0]:"url-with-path"===e&&(i=n.split("#")[0].split("?")[0]!==t.split("#")[0].split("?")[0]),i)&&(this.track_pageview()&&(t=n))}.bind(this))}},MixpanelLib.prototype._prepare_callback=function(e,t){if(Ir.isUndefined(e))return null;if(mn){return function(n){e(n,t)}}var n=this._jsc,i=""+Math.floor(1e8*Math.random()),s=this.get_config("callback_fn")+"["+i+"]";return n[i]=function(s){delete n[i],e(s,t)},s},MixpanelLib.prototype._send_request=function(e,t,n,i){var s=!0;if(gn)return this.__request_queue.push(arguments),s;var a={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},c=null;i||!Ir.isFunction(n)&&"string"!=typeof n||(i=n,n=null),n=Ir.extend(a,n||{}),mn||(n.method="GET");var d="POST"===n.method,u=_n&&d&&"sendbeacon"===n.transport.toLowerCase(),l=n.verbose;t.verbose&&(l=!0),this.get_config("test")&&(t.test=1),l&&(t.verbose=1),this.get_config("img")&&(t.img=1),mn||(i?t.callback=i:(l||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),d&&(c="data="+encodeURIComponent(t.data),delete t.data),e+="?"+Ir.HTTPBuildQuery(t);var p=this;if("img"in t){var h=fr.createElement("img");h.src=e,fr.body.appendChild(h)}else if(u){try{s=_n(e,c)}catch(v){p.report_error(v),s=!1}try{i&&i(s?1:0)}catch(v){p.report_error(v)}}else if(mn)try{var f=new XMLHttpRequest;f.open(n.method,e,!0);var m=this.get_config("xhr_headers");if(d&&(m["Content-Type"]="application/x-www-form-urlencoded"),Ir.each(m,(function(e,t){f.setRequestHeader(t,e)})),n.timeout_ms&&void 0!==f.timeout){f.timeout=n.timeout_ms;var g=(new Date).getTime()}f.withCredentials=!0,f.onreadystatechange=function(){var e;if(4===f.readyState)if(200===f.status){if(i)if(l){var t;try{t=Ir.JSONDecode(f.responseText)}catch(v){if(p.report_error(v),!n.ignore_json_errors)return;t=f.responseText}i(t)}else i(Number(f.responseText))}else if(e=f.timeout&&!f.status&&(new Date).getTime()-g>=f.timeout?"timeout":"Bad HTTP status: "+f.status+" "+f.statusText,p.report_error(e),i)if(l){var s=f.responseHeaders||{};i({status:0,httpStatusCode:f.status,error:e,retryAfter:s["Retry-After"]})}else i(0)},f.send(c)}catch(v){p.report_error(v),s=!1}else{var _=fr.createElement("script");_.type="text/javascript",_.async=!0,_.defer=!0,_.src=e;var y=fr.getElementsByTagName("script")[0];y.parentNode.insertBefore(_,y)}return s},MixpanelLib.prototype._execute_array=function(e){var t,n=[],i=[],s=[];Ir.each(e,(function(e){e&&(t=e[0],Ir.isArray(t)?s.push(e):"function"==typeof e?e.call(this):Ir.isArray(e)&&"alias"===t?n.push(e):Ir.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?s.push(e):i.push(e))}),this);var execute=function(e,t){Ir.each(e,(function(e){if(Ir.isArray(e[0])){var n=t;Ir.each(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};execute(n,this),execute(i,this),execute(s,this)},MixpanelLib.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},MixpanelLib.prototype.get_batcher_configs=function(){var e="__mpq_"+this.get_config("token"),t=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+t.track,queue_key:e+"_ev"},people:{type:"people",endpoint:"/"+t.engage,queue_key:e+"_pp"},groups:{type:"groups",endpoint:"/"+t.groups,queue_key:e+"_gr"}},this._batcher_configs},MixpanelLib.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=Ir.bind((function(e){return new RequestBatcher(e.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:Ir.bind((function(t,n,i){this._send_request(this.get_config("api_host")+e.endpoint,this._encode_data_for_request(t),n,this._prepare_callback(i,t))}),this),beforeSendHook:Ir.bind((function(t){return this._run_hook("before_send_"+e.type,t)}),this),stopAllBatchingFunc:Ir.bind(this.stop_batch_senders,this),usePersistence:!0})}),this),t=this.get_batcher_configs();this.request_batchers={events:e(t.events),people:e(t.people),groups:e(t.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},MixpanelLib.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,Ir.each(this.request_batchers,(function(e){e.start()})))},MixpanelLib.prototype.stop_batch_senders=function(){this._batch_requests=!1,Ir.each(this.request_batchers,(function(e){e.stop(),e.clear()}))},MixpanelLib.prototype.push=function(e){this._execute_array([e])},MixpanelLib.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},MixpanelLib.prototype._encode_data_for_request=function(e){var t=Ir.JSONEncode(e);return this.get_config("api_payload_format")===hn&&(t=Ir.base64Encode(t)),{data:t}},MixpanelLib.prototype._track_or_batch=function(e,t){var n=Ir.truncate(e.data,255),i=e.endpoint,s=e.batcher,a=e.should_send_immediately,c=e.send_request_options||{};t=t||NOOP_FUNC;var d=!0,u=Ir.bind((function(){return c.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(xr.log("MIXPANEL REQUEST:"),xr.log(n),this._send_request(i,this._encode_data_for_request(n),c,this._prepare_callback(t,n))):null}),this);return this._batch_requests&&!a?s.enqueue(n,(function(e){e?t(1,n):u()})):d=u(),d&&n},MixpanelLib.prototype.track=addOptOutCheckMixpanelLib((function(e,t,n,i){i||"function"!=typeof n||(i=n,n=null);var s=(n=n||{}).transport;s&&(n.transport=s);var a=n.send_immediately;if("function"!=typeof i&&(i=NOOP_FUNC),Ir.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=Ir.extend({},t)).token=this.get_config("token");var c=this.persistence.remove_event_timer(e);if(!Ir.isUndefined(c)){var d=(new Date).getTime()-c;t.$duration=parseFloat((d/1e3).toFixed(3))}this._set_default_superprops();var u=this.get_config("track_marketing")?Ir.info.marketingParams():{};t=Ir.extend({},Ir.info.properties({mp_loader:this.get_config("mp_loader")}),u,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var l=this.get_config("property_blacklist");Ir.isArray(l)?Ir.each(l,(function(e){delete t[e]})):this.report_error("Invalid value for property_blacklist config: "+l);var p={event:e,properties:t};return this._track_or_batch({type:"events",data:p,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:a,send_request_options:n},i)}i(0)}})),MixpanelLib.prototype.set_group=addOptOutCheckMixpanelLib((function(e,t,n){Ir.isArray(t)||(t=[t]);var i={};return i[e]=t,this.register(i),this.people.set(e,t,n)})),MixpanelLib.prototype.add_group=addOptOutCheckMixpanelLib((function(e,t,n){var i=this.get_property(e),s={};return void 0===i?(s[e]=[t],this.register(s)):-1===i.indexOf(t)&&(i.push(t),s[e]=i,this.register(s)),this.people.union(e,t,n)})),MixpanelLib.prototype.remove_group=addOptOutCheckMixpanelLib((function(e,t,n){var i=this.get_property(e);if(void 0!==i){var s=i.indexOf(t);s>-1&&(i.splice(s,1),this.register({group_key:i})),0===i.length&&this.unregister(e)}return this.people.remove(e,t,n)})),MixpanelLib.prototype.track_with_groups=addOptOutCheckMixpanelLib((function(e,t,n,i){var s=Ir.extend({},t||{});return Ir.each(n,(function(e,t){null!=e&&(s[t]=e)})),this.track(e,s,i)})),MixpanelLib.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},MixpanelLib.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},MixpanelLib.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),i=this._cached_groups[n];return void 0!==i&&i._group_key===e&&i._group_id===t||((i=new MixpanelGroup)._init(this,e,t),this._cached_groups[n]=i),i},MixpanelLib.prototype.track_pageview=addOptOutCheckMixpanelLib((function(e,t){"object"!=typeof e&&(e={});var n=(t=t||{}).event_name||"$mp_web_page_view",i=Ir.extend(Ir.info.mpPageViewProperties(),Ir.info.campaignParams(),Ir.info.clickParams()),s=Ir.extend({},i,e);return this.track(n,s)})),MixpanelLib.prototype.track_links=function(){return this._track_dom.call(this,LinkTracker,arguments)},MixpanelLib.prototype.track_forms=function(){return this._track_dom.call(this,FormTracker,arguments)},MixpanelLib.prototype.time_event=function(e){Ir.isUndefined(e)?this.report_error("No event name provided to mixpanel.time_event"):this._event_is_disabled(e)||this.persistence.set_event_timer(e,(new Date).getTime())};var Sn={persistent:!0},options_for_register=function(e){var t;return t=Ir.isObject(e)?e:Ir.isUndefined(e)?{}:{days:e},Ir.extend({},Sn,t)};MixpanelLib.prototype.register=function(e,t){var n=options_for_register(t);n.persistent?this.persistence.register(e,n.days):Ir.extend(this.unpersisted_superprops,e)},MixpanelLib.prototype.register_once=function(e,t,n){var i=options_for_register(n);i.persistent?this.persistence.register_once(e,t,i.days):(void 0===t&&(t="None"),Ir.each(e,(function(e,n){this.unpersisted_superprops.hasOwnProperty(n)&&this.unpersisted_superprops[n]!==t||(this.unpersisted_superprops[n]=e)}),this))},MixpanelLib.prototype.unregister=function(e,t){(t=options_for_register(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},MixpanelLib.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},MixpanelLib.prototype.identify=function(e,t,n,i,s,a,c,d){var u=this.get_distinct_id();if(e&&u!==e){if("string"==typeof e&&0===e.indexOf(fn))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var l=u;this.register_once({$had_persisted_distinct_id:!0,$device_id:l},"")}e!==u&&e!==this.get_property(cn)&&(this.unregister(cn),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,i,s,a,c,d),e!==u&&this.track("$identify",{distinct_id:e,$anon_distinct_id:u},{skip_hooks:!0})},MixpanelLib.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=Ir.UUID();this.register_once({distinct_id:fn+e,$device_id:e},"")},MixpanelLib.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},MixpanelLib.prototype.alias=function(e,t){if(e===this.get_property(an))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return Ir.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(cn,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},(function(){n.identify(e)}))):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},MixpanelLib.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},MixpanelLib.prototype.set_config=function(e){Ir.isObject(e)&&(Ir.extend(this.config,e),e.batch_size&&Ir.each(this.request_batchers,(function(e){e.resetBatchSize()})),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Vt.DEBUG=Vt.DEBUG||this.get_config("debug"))},MixpanelLib.prototype.get_config=function(e){return this.config[e]},MixpanelLib.prototype._run_hook=function(e){var t=(this.config.hooks[e]||IDENTITY_FUNC).apply(this,dr.call(arguments,1));return void 0===t&&(this.report_error(e+" hook did not return a value"),t=null),t},MixpanelLib.prototype.get_property=function(e){return this.persistence.load_prop([e])},MixpanelLib.prototype.toString=function(){var e=this.get_config("name");return e!==pn&&(e=pn+"."+e),e},MixpanelLib.prototype._event_is_disabled=function(e){return Ir.isBlockedUA(_r)||this._flags.disable_all_events||Ir.include(this.__disabled_events,e)},MixpanelLib.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&Ir.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_tracking()||!this.get_config("opt_out_tracking_by_default")&&!Ir.cookie.get("mp_optout")||(Ir.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},MixpanelLib.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t),t?this.stop_batch_senders():this._batchers_were_started&&this.start_batch_senders()},MixpanelLib.prototype._gdpr_call_func=function(e,t){return t=Ir.extend({track:Ir.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),Ir.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},MixpanelLib.prototype.opt_in_tracking=function(e){e=Ir.extend({enable_persistence:!0},e),this._gdpr_call_func(optIn,e),this._gdpr_update_persistence(e)},MixpanelLib.prototype.opt_out_tracking=function(e){(e=Ir.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(optOut,e),this._gdpr_update_persistence(e)},MixpanelLib.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(hasOptedIn,e)},MixpanelLib.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(hasOptedOut,e)},MixpanelLib.prototype.clear_opt_in_out_tracking=function(e){e=Ir.extend({enable_persistence:!0},e),this._gdpr_call_func(clearOptInOut,e),this._gdpr_update_persistence(e)},MixpanelLib.prototype.report_error=function(e,t){xr.error.apply(xr.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){xr.error(n)}},MixpanelLib.prototype.init=MixpanelLib.prototype.init,MixpanelLib.prototype.reset=MixpanelLib.prototype.reset,MixpanelLib.prototype.disable=MixpanelLib.prototype.disable,MixpanelLib.prototype.time_event=MixpanelLib.prototype.time_event,MixpanelLib.prototype.track=MixpanelLib.prototype.track,MixpanelLib.prototype.track_links=MixpanelLib.prototype.track_links,MixpanelLib.prototype.track_forms=MixpanelLib.prototype.track_forms,MixpanelLib.prototype.track_pageview=MixpanelLib.prototype.track_pageview,MixpanelLib.prototype.register=MixpanelLib.prototype.register,MixpanelLib.prototype.register_once=MixpanelLib.prototype.register_once,MixpanelLib.prototype.unregister=MixpanelLib.prototype.unregister,MixpanelLib.prototype.identify=MixpanelLib.prototype.identify,MixpanelLib.prototype.alias=MixpanelLib.prototype.alias,MixpanelLib.prototype.name_tag=MixpanelLib.prototype.name_tag,MixpanelLib.prototype.set_config=MixpanelLib.prototype.set_config,MixpanelLib.prototype.get_config=MixpanelLib.prototype.get_config,MixpanelLib.prototype.get_property=MixpanelLib.prototype.get_property,MixpanelLib.prototype.get_distinct_id=MixpanelLib.prototype.get_distinct_id,MixpanelLib.prototype.toString=MixpanelLib.prototype.toString,MixpanelLib.prototype.opt_out_tracking=MixpanelLib.prototype.opt_out_tracking,MixpanelLib.prototype.opt_in_tracking=MixpanelLib.prototype.opt_in_tracking,MixpanelLib.prototype.has_opted_out_tracking=MixpanelLib.prototype.has_opted_out_tracking,MixpanelLib.prototype.has_opted_in_tracking=MixpanelLib.prototype.has_opted_in_tracking,MixpanelLib.prototype.clear_opt_in_out_tracking=MixpanelLib.prototype.clear_opt_in_out_tracking,MixpanelLib.prototype.get_group=MixpanelLib.prototype.get_group,MixpanelLib.prototype.set_group=MixpanelLib.prototype.set_group,MixpanelLib.prototype.add_group=MixpanelLib.prototype.add_group,MixpanelLib.prototype.remove_group=MixpanelLib.prototype.remove_group,MixpanelLib.prototype.track_with_groups=MixpanelLib.prototype.track_with_groups,MixpanelLib.prototype.start_batch_senders=MixpanelLib.prototype.start_batch_senders,MixpanelLib.prototype.stop_batch_senders=MixpanelLib.prototype.stop_batch_senders,MixpanelLib.prototype.start_session_recording=MixpanelLib.prototype.start_session_recording,MixpanelLib.prototype.stop_session_recording=MixpanelLib.prototype.stop_session_recording,MixpanelLib.prototype.get_session_recording_properties=MixpanelLib.prototype.get_session_recording_properties,MixpanelLib.prototype.DEFAULT_API_ROUTES=yn,MixpanelPersistence.prototype.properties=MixpanelPersistence.prototype.properties,MixpanelPersistence.prototype.update_search_keyword=MixpanelPersistence.prototype.update_search_keyword,MixpanelPersistence.prototype.update_referrer_info=MixpanelPersistence.prototype.update_referrer_info,MixpanelPersistence.prototype.get_cross_subdomain=MixpanelPersistence.prototype.get_cross_subdomain,MixpanelPersistence.prototype.clear=MixpanelPersistence.prototype.clear;var kn={},override_mp_init_func=function(){ln.init=function(e,t,n){if(n)return ln[n]||(ln[n]=kn[n]=create_mplib(e,t,n),ln[n]._loaded()),ln[n];var i=ln;kn[pn]?i=kn[pn]:e&&((i=create_mplib(e,t,pn))._loaded(),kn[pn]=i),ln=i,1===Jr&&(Bt[pn]=ln),Ir.each(kn,(function(e,t){t!==pn&&(ln[t]=e)})),ln._=Ir}};var wn=function init_as_module(e){return load_extra_bundle=e,Jr=0,ln=new MixpanelLib,override_mp_init_func(),ln.init(),function(){function dom_loaded_handler(){dom_loaded_handler.done||(dom_loaded_handler.done=!0,bn=!0,gn=!1,Ir.each(kn,(function(e){e._dom_loaded()})))}if(fr.addEventListener)"complete"===fr.readyState?dom_loaded_handler():fr.addEventListener("DOMContentLoaded",dom_loaded_handler,!1);else if(fr.attachEvent){fr.attachEvent("onreadystatechange",dom_loaded_handler);var e=!1;try{e=null===Bt.frameElement}catch(t){}fr.documentElement.doScroll&&e&&function do_scroll_check(){try{fr.documentElement.doScroll("left")}catch(t){return void setTimeout(do_scroll_check,1)}dom_loaded_handler()}()}Ir.register_event(Bt,"load",dom_loaded_handler,!0)}(),ln}((function loadNoop(e,t){t()}));function isReady(){return void 0!==window.mixpanel}const In={init:function init$1(e,t=!1){return new Promise((n=>{wn.init(e,{debug:t,loaded:()=>{window.mixpanel=wn,n()}})}))},isReady:isReady,track:function track(e,t){isReady()&&wn.track(e,t)},identify:function identify$1(e,t){isReady()&&(wn.identify(e),wn.people.set(t))},attachProperty:function attachProperty(e,t){isReady()&&wn.people.union(e,[t])}},xn=["Search","View Results"];async function trackEvent(e,t){if(!In.isReady())throw new Error("Mixpanel is not initialized.");try{Ln.parseEventProps(e,t);const n=!xn.includes(e),i=await st.getFingerprint(n),s={...{"User Fingerprint":i},...t};In.track(e,s)}catch(Qt){console.error(`Error tracking event '${e}':`,Qt)}}const En=_e.object({product:be});const dateValidation=e=>!(!/^\d{4}-\d{2}-\d{2}$/.test(e)&&!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(e))||!(!/^\d{4}-\d{2}-\d{2}/.test(e)||isNaN(Date.parse(e))),Cn=_e.object({"Departure Arrival":_e.string().refine(dateValidation,{message:"Invalid departure arrival datetime format. Must include at least YYYY-MM-DD"}),"Departure Destination":_e.string().min(1,"Departure Destination is required"),"Departure Destination Terminal":_e.string().min(1,"Departure Destination Terminal is required"),"Departure Line":_e.string().min(1,"Departure Line is required"),"Departure Origin":_e.string().min(1,"Departure Origin is required"),"Departure Origin Terminal":_e.string().min(1,"Departure Origin Terminal is required"),"Departure Price":_e.number().positive("Departure Price must be a positive number"),"Departure Route":_e.string().min(1,"Departure Route is required"),"Departure Stops":_e.number().int("Departure Stops must be an integer").nonnegative().optional(),"Departure Time":_e.string().refine(dateValidation,{message:"Invalid departure time datetime format. Must include at least YYYY-MM-DD"}),"Departure Transporter":_e.string().min(1,"Departure Transporter is required"),"Passenger Count":_e.number().int("Passenger Count must be an integer").positive(),"Recommended Trip":_e.boolean(),"Recommended Trip Type":_e.string().optional(),Routes:_e.number().int("Routes must be an integer").positive(),Total:_e.number().positive("Total must be a positive number"),"Trip Length":_e.number().int("Trip Length must be an integer").nonnegative().optional(),product:be}),On=_e.object({"Departure Arrival":_e.string().refine(dateValidation,{message:"Invalid departure arrival datetime format. Must include at least YYYY-MM-DD"}),"Departure Destination":_e.string().min(1,"Departure Destination is required"),"Departure Destination Terminal":_e.string().min(1,"Departure Destination Terminal is required"),"Departure Line":_e.string().min(1,"Departure Line is required"),"Departure Origin":_e.string().min(1,"Departure Origin is required"),"Departure Origin Terminal":_e.string().min(1,"Departure Origin Terminal is required"),"Departure Price":_e.number().positive("Departure Price must be a positive number"),"Departure Route":_e.string().min(1,"Departure Route is required"),"Departure Stop Cities":_e.string().optional(),"Departure Stops":_e.number().int("Departure Stops must be an integer").nonnegative().optional(),"Departure Time":_e.string().refine(dateValidation,{message:"Invalid departure time datetime format. Must include at least YYYY-MM-DD"}),"Departure Transporter":_e.string().min(1,"Departure Transporter is required"),"Passenger Count":_e.number().int("Passenger Count must be an integer").positive(),"Payment Type":_e.string().min(1,"Payment Type is required"),"Recommended Trip":_e.boolean(),"Recommended Trip Type":_e.string().optional(),Routes:_e.number().int("Routes must be an integer").positive(),Total:_e.number().positive("Total must be a positive number"),product:be}),Tn=_e.object({Arrival:_e.string().refine(dateValidation,{message:"Invalid arrival datetime format"}),Departure:_e.string().refine(dateValidation,{message:"Invalid departure datetime format"}),Destination:_e.string().min(1,"Destination is required"),"Destination Terminal":_e.string().min(1,"Destination terminal is required"),Line:_e.string().min(1,"Line is required").optional(),Origin:_e.string().min(1,"Origin is required"),"Origin Terminal":_e.string().min(1,"Origin terminal is required"),Price:_e.number().positive("Price must be a positive number"),"Result Position":_e.number().int("Result Position must be an integer"),Route:_e.string().min(1,"Route is required"),Stops:_e.number().int("Stops must be an integer").nonnegative("Stops must be non-negative"),"Transport Type":_e.string().min(1,"Transport Type is required"),Transporter:_e.string().min(1,"Transporter is required"),product:be,"Recommended Trip":_e.boolean(),"Recommended Trip Type":_e.string().optional()});const Rn=_e.object({"Departure Arrival":_e.string().refine(dateValidation,{message:"Invalid departure arrival datetime format"}),"Departure Destination":_e.string().refine((e=>e),{message:"Departure Destination must be a string"}),"Departure Destination Terminal":_e.string().refine((e=>e),{message:"Departure Destination Terminal must be a string"}),"Departure Line":_e.string().refine((e=>e),{message:"Departure Line must be a string"}),"Departure Origin":_e.string().refine((e=>e),{message:"Departure Origin must be a string"}),"Departure Origin Terminal":_e.string().refine((e=>e),{message:"Departure Origin Terminal must be a string"}),"Departure Price":_e.number().refine((e=>e),{message:"Departure Price must be a number"}),"Departure Route":_e.string().refine((e=>e),{message:"Departure Route must be a string"}),"Departure Stops":_e.number().int().refine((e=>e),{message:"Departure Stops must be an integer"}),"Departure Time":_e.string().refine(dateValidation,{message:"Invalid departure time datetime format"}),"Departure Transport Type":_e.string().refine((e=>e),{message:"Departure Transport Type must be a string"}),"Departure Transporter":_e.string().refine((e=>e),{message:"Departure Transporter must be a string"}),"Passenger Count":_e.number().int().refine((e=>e),{message:"Passenger Count must be an integer"}),"Recommended Trip":_e.boolean(),"Recommended Trip Type":_e.string().optional(),Routes:_e.number().int().refine((e=>e),{message:"Routes must be an integer"}),Total:_e.number().refine((e=>e),{message:"Total must be a number"}),product:be,"Trip Length":_e.number().int().optional()}).strict();const Mn=_e.object({Departure:_e.string().refine(dateValidation,{message:"Invalid departure date or datetime format. Must include at least YYYY-MM-DD"}),"Departure Delta":_e.number().int("Departure Delta must be an integer"),Destination:_e.string().min(1,"Destination is required"),"Destination Terminal":_e.string().min(1,"Destination terminal is required"),Origin:_e.string().min(1,"Origin is required"),"Origin Terminal":_e.string().min(1,"Origin terminal is required"),Passengers:_e.number().int("Passenger count must be an integer"),Return:_e.string().refine(dateValidation,{message:"Invalid Return date or datetime format. Must include at least YYYY-MM-DD"}).optional(),Route:_e.string().min(1,"Route is required"),"Trip Length":_e.number().positive().optional(),product:be});const Nn=_e.object({Arrival:_e.string().refine(dateValidation,{message:"Invalid arrival date or datetime format. Must include at least YYYY-MM-DD"}),Departure:_e.string().refine(dateValidation,{message:"Invalid departure date or datetime format. Must include at least YYYY-MM-DD"}),Destination:_e.string().min(1,"Destination is required"),"Destination Terminal":_e.string().min(1,"Destination Terminal is required"),Line:_e.string().min(1,"Line is required").optional(),Origin:_e.string().min(1,"Origin is required"),"Origin Terminal":_e.string().min(1,"Origin Terminal is required"),Price:_e.number().positive("Price must be a positive number"),Route:_e.string().min(1,"Route is required"),Stops:_e.number().int("Stops must be an integer").nonnegative().optional(),Tickets:_e.number().int("Tickets must be an integer").positive(),Transporter:_e.string().min(1,"Transporter is required"),Way:_e.enum(["Departure","Return"],{description:"Way must be either 'Departure' or 'Return'"}),product:be});const Dn=_e.object({"Bus count":_e.number().int("Bus count must be an integer"),Departure:_e.string().refine(dateValidation,{message:"Invalid departure datetime format"}),"Departure Delta":_e.number().int("Departure Delta must be an integer").optional(),Destination:_e.string().min(1,"Destination is required").optional(),"Destination Terminal":_e.string().min(1,"Destination terminal is required").optional(),"Has Frequent Buses":_e.boolean().default(!1).optional(),Origin:_e.string().min(1,"Origin is required"),"Origin Terminal":_e.string().min(1,"Origin terminal is required"),Route:_e.string().min(1,"Route is required"),product:be}),Zn=_e.object({}),Pn=_e.object({mixpanelToken:_e.string().min(1,"Mixpanel token is required"),debug:_e.boolean().optional(),identificationKey:_e.string().min(1,"Identification key is required")}),SchemaErrorFormatter=e=>e.issues.map((e=>{let t="INVALID_FIELD",n="",i="",s="";return"invalid_type"===e.code?(t="TYPE_MISMATCH",n=e.expected,i=e.received,s=`Expected ${n} but received ${i}. Please provide a value of type ${n}.`):"too_small"===e.code?(t="VALUE_TOO_SMALL",s=`Increase the value to at least ${e.minimum}.`):"too_big"===e.code?(t="VALUE_TOO_BIG",s=`Reduce the value to no more than ${e.maximum}.`):(t="INVALID_FIELD",s="Ensure the field matches the expected format and value type."),{field:e.path.join("."),error_type:t,expected:n,received:i,message:e.message,suggestion:s}})),An={"Track Test":Zn,Search:Mn,"Seat Change":Nn,"Interest In Home":Se,"Passengers Created":Cn,"Payment Attempt":On,"Interest In Search":En,"View Results":Dn,"Purchase Attempt":Rn,"Picked Departure":Tn};function validateProps(e,t){try{t.parse(e)}catch(Qt){if(Qt instanceof ZodError){throw{message:"Schema validation failed",errors:SchemaErrorFormatter(Qt)}}throw{message:"Unknown validation error"}}}const Ln={parseEventProps:function parseEventProps(e,t){const n=An[e];if(!n)throw{message:`Event ${e} not found`};try{n.parse(t)}catch(Qt){if(Qt instanceof ZodError){throw{message:"Schema validation failed",errors:SchemaErrorFormatter(Qt)}}throw{message:"Unknown validation error"}}},parseInitProps:function parseInitProps(e){validateProps(e,Pn)},parseIdentifyProps:function parseIdentifyProps(e){validateProps(e,ye)}},jn=["firstName","lastName","email","phone"];const Fn={init:async function init(e){Ln.parseInitProps(e);const{mixpanelToken:t,debug:n=!1,identificationKey:i}=e;await In.init(t,n);try{await st.initFingerprint(i)}catch(Qt){console.error("Error initializing identification service:",Qt)}!function onLoaded(){window.dispatchEvent(new CustomEvent("Tracker Ready"))}()},identify:async function identify(e,t={}){if(In.isReady())try{if(Ln.parseIdentifyProps(t),!e)return void console.error("User ID is required for identification.");const n=function mapProperties(e){return{$first_name:null==e?void 0:e.firstName,$last_name:null==e?void 0:e.lastName,$email:null==e?void 0:e.email,$phone:null==e?void 0:e.phone,...Object.keys(e).reduce(((t,n)=>(jn.includes(n)||(t[n]=e[n]),t)),{})}}(t);In.identify(e,n);const i=await st.getFingerprint();i&&In.attachProperty("Known Fingerprints",i)}catch(Qt){console.error("Error identifying user",Qt)}else console.error("Mixpanel is not initialized.")},track:{test:function trackTest(){trackEvent("Track Test",{})},search:function trackSearch(e){trackEvent("Search",e)},seatChange:async e=>{trackEvent("Seat Change",e)},interestInHome:function trackInterestInHome(e){trackEvent("Interest In Home",e)},interestInSearch:function trackInterestInSearch(e){trackEvent("Interest In Search",e)},viewResults:function trackViewResults(e){trackEvent("View Results",e)},passengersCreated:async e=>{trackEvent("Passengers Created",e)},paymentAttempt:async e=>{trackEvent("Payment Attempt",e)},purchaseAttempt:function trackSearch$1(e){trackEvent("Purchase Attempt",e)},pickedDeparture:function trackSearch$2(e){trackEvent("Picked Departure",e)}}};module.exports=Fn;
30
+ function __awaiter2(e,t,n,i){return new(n||(n=Promise))((function(t,s){function fulfilled(e){try{step(i.next(e))}catch(t){s(t)}}function rejected(e){try{step(i.throw(e))}catch(t){s(t)}}function step(e){e.done?t(e.value):function adopt(e){return e instanceof n?e:new n((function(t){t(e)}))}(e.value).then(fulfilled,rejected)}step((i=i.apply(e,[])).next())}))}for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),n=0;n<64;n++)t[e.charCodeAt(n)]=n;var encode2=function(t){var n,i=new Uint8Array(t),s=i.length,a="";for(n=0;n<s;n+=3)a+=e[i[n]>>2],a+=e[(3&i[n])<<4|i[n+1]>>4],a+=e[(15&i[n+1])<<2|i[n+2]>>6],a+=e[63&i[n+2]];return s%3==2?a=a.substring(0,a.length-1)+"=":s%3==1&&(a=a.substring(0,a.length-2)+"=="),a};const i=new Map,s=new Map;const a=self;a.onmessage=function(e){return __awaiter2(this,0,void 0,(function*(){if(!("OffscreenCanvas"in globalThis))return a.postMessage({id:e.data.id});{const{id:t,bitmap:n,width:c,height:d,dataURLOptions:u}=e.data,l=function getTransparentBlobFor(e,t,n){return __awaiter2(this,0,void 0,(function*(){const i=`${e}-${t}`;if("OffscreenCanvas"in globalThis){if(s.has(i))return s.get(i);const a=new OffscreenCanvas(e,t);a.getContext("2d");const c=yield a.convertToBlob(n),d=yield c.arrayBuffer(),u=encode2(d);return s.set(i,u),u}return""}))}(c,d,u),p=new OffscreenCanvas(c,d);p.getContext("2d").drawImage(n,0,0),n.close();const h=yield p.convertToBlob(u),f=h.type,m=yield h.arrayBuffer(),g=encode2(m);if(!i.has(t)&&(yield l)===g)return i.set(t,g),a.postMessage({id:t});if(i.get(t)===g)return a.postMessage({id:t});a.postMessage({id:t,type:f,base64:g,width:c,height:d}),i.set(t,g)}}))}}()}));class CanvasManager{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(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:i,blockSelector:s,recordCanvas:a,dataURLOptions:c}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,a&&"all"===t&&this.initCanvasMutationObserver(n,i,s),a&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,i,s,{dataURLOptions:c})}initCanvasFPSObserver(e,t,n,i,s){const a=initCanvasContextObserver(t,n,i,!0),c=new Map,d=new Lt;d.onmessage=e=>{const{id:t}=e.data;if(c.set(t,!1),!("base64"in e.data))return;const{base64:n,type:i,width:s,height:a}=e.data;this.mutationCb({id:t,type:Ot["2D"],commands:[{property:"clearRect",args:[0,0,s,a]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:i}]},0,0]}]})};const u=1e3/e;let l,p=0;const takeCanvasSnapshots=e=>{p&&e-p<u||(p=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach((t=>{isBlocked(t,n,i,!0)||e.push(t)})),e})().forEach((e=>__awaiter(this,0,void 0,(function*(){var t;const n=this.mirror.getId(e);if(c.get(n))return;if(0===e.width||0===e.height)return;if(c.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const i=yield createImageBitmap(e);d.postMessage({id:n,bitmap:i,width:e.width,height:e.height,dataURLOptions:s.dataURLOptions},[i])}))))),l=requestAnimationFrame(takeCanvasSnapshots)};l=requestAnimationFrame(takeCanvasSnapshots),this.resetObservers=()=>{a(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=initCanvasContextObserver(e,t,n,!1),s=function initCanvas2DMutationObserver(e,t,n,i){const s=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const d of a)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[d])continue;const a=patch(t.CanvasRenderingContext2D.prototype,d,(function(s){return function(...a){return isBlocked(this.canvas,n,i,!0)||setTimeout((()=>{const n=serializeArgs(a,t,this);e(this.canvas,{type:Ot["2D"],property:d,args:n})}),0),s.apply(this,a)}}));s.push(a)}catch(c){const n=hookSetter(t.CanvasRenderingContext2D.prototype,d,{set(t){e(this.canvas,{type:Ot["2D"],property:d,args:[t],setter:!0})}});s.push(n)}return()=>{s.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n),a=function initCanvasWebGLMutationObserver(e,t,n,i,s){const a=[];return a.push(...patchGLPrototype(t.WebGLRenderingContext.prototype,Ot.WebGL,e,n,i,0,t)),void 0!==t.WebGL2RenderingContext&&a.push(...patchGLPrototype(t.WebGL2RenderingContext.prototype,Ot.WebGL2,e,n,i,0,t)),()=>{a.forEach((e=>e()))}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{i(),s(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const setLatestRAFTimestamp=e=>{this.rafStamps.latestId=e,requestAnimationFrame(setLatestRAFTimestamp)};requestAnimationFrame(setLatestRAFTimestamp)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const i=n.map((e=>{const t=function __rest(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(n[i[s]]=e[i[s]])}return n}(e,["type"]);return t})),{type:s}=n[0];this.mutationCb({id:t,type:s,commands:i}),this.pendingCanvasMutations.delete(e)}}class StylesheetManager{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new StyleSheetMirror,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},i=[];for(const s of e){let e;this.styleMirror.has(s)?e=this.styleMirror.getId(s):(e=this.styleMirror.add(s),i.push({styleId:e,rules:Array.from(s.rules||CSSRule,((e,t)=>({rule:stringifyRule(e),index:t})))})),n.styleIds.push(e)}i.length>0&&(n.styles=i),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class ProcessedNodeManager{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some((e=>e!==t))}add(e,t){this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function wrapEvent(e){return Object.assign(Object.assign({},e),{timestamp:wt()})}let jt,Ft,qt,Ut=!1;const $t=function createMirror(){return new Mirror}();function record(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:i,blockClass:s="rr-block",blockSelector:a=null,ignoreClass:c="rr-ignore",ignoreSelector:d=null,maskTextClass:u="rr-mask",maskTextSelector:l=null,inlineStylesheet:p=!0,maskAllInputs:h,maskInputOptions:f,slimDOMOptions:m,maskInputFn:g,maskTextFn:_,hooks:y,packFn:v,sampling:b={},dataURLOptions:S={},mousemoveWait:w,recordDOM:I=!0,recordCanvas:x=!1,recordCrossOriginIframes:C=!1,recordAfter:O=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:T=!1,collectFonts:R=!1,inlineImages:N=!1,plugins:D,keepIframeSrcFn:Z=()=>!1,ignoreCSSAttributes:P=new Set([]),errorHandler:A}=e;!function registerErrorHandler(e){Tt=e}(A);const L=!C||window.parent===window;let j=!1;if(!L)try{window.parent.document&&(j=!1)}catch(G){j=!0}if(L&&!t)throw new Error("emit function is required");void 0!==w&&void 0===b.mousemove&&(b.mousemove=w),$t.reset();const q=!0===h?{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}:void 0!==f?f:{password:!0},U=!0===m||"all"===m?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===m,headMetaDescKeywords:"all"===m}:m||{};let $;!function polyfill(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let B=0;const eventProcessor=e=>{for(const t of D||[])t.eventProcessor&&(e=t.eventProcessor(e));return v&&!j&&(e=v(e)),e};jt=(e,s)=>{var a;if(!(null===(a=Rt[0])||void 0===a?void 0:a.isFrozen())||e.type===It.FullSnapshot||e.type===It.IncrementalSnapshot&&e.data.source===xt.Mutation||Rt.forEach((e=>e.unfreeze())),L)null==t||t(eventProcessor(e),s);else if(j){const t={type:"rrweb",event:eventProcessor(e),origin:window.location.origin,isCheckout:s};window.parent.postMessage(t,"*")}if(e.type===It.FullSnapshot)$=e,B=0;else if(e.type===It.IncrementalSnapshot){if(e.data.source===xt.Mutation&&e.data.isAttachIframe)return;B++;const t=i&&B>=i,s=n&&e.timestamp-$.timestamp>n;(t||s)&&Ft(!0)}};const wrappedMutationEmit=e=>{jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.Mutation},e)}))},wrappedScrollEmit=e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.Scroll},e)})),wrappedCanvasMutationEmit=e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.CanvasMutation},e)})),z=new StylesheetManager({mutationCb:wrappedMutationEmit,adoptedStyleSheetCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.AdoptedStyleSheet},e)}))}),W=new IframeManager({mirror:$t,mutationCb:wrappedMutationEmit,stylesheetManager:z,recordCrossOriginIframes:C,wrappedEmit:jt});for(const Y of D||[])Y.getMirror&&Y.getMirror({nodeMirror:$t,crossOriginIframeMirror:W.crossOriginIframeMirror,crossOriginIframeStyleMirror:W.crossOriginIframeStyleMirror});const K=new ProcessedNodeManager;qt=new CanvasManager({recordCanvas:x,mutationCb:wrappedCanvasMutationEmit,win:window,blockClass:s,blockSelector:a,mirror:$t,sampling:b.canvas,dataURLOptions:S});const H=new ShadowDomManager({mutationCb:wrappedMutationEmit,scrollCb:wrappedScrollEmit,bypassOptions:{blockClass:s,blockSelector:a,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskInputOptions:q,dataURLOptions:S,maskTextFn:_,maskInputFn:g,recordCanvas:x,inlineImages:N,sampling:b,slimDOMOptions:U,iframeManager:W,stylesheetManager:z,canvasManager:qt,keepIframeSrcFn:Z,processedNodeManager:K},mirror:$t});Ft=(e=!1)=>{if(!I)return;jt(wrapEvent({type:It.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),e),z.reset(),H.init(),Rt.forEach((e=>e.lock()));const t=function snapshot(e,t){const{mirror:n=new Mirror,blockClass:i="rr-block",blockSelector:s=null,maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,inlineImages:u=!1,recordCanvas:l=!1,maskAllInputs:p=!1,maskTextFn:h,maskInputFn:f,slimDOM:m=!1,dataURLOptions:g,preserveWhiteSpace:_,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:w,keepIframeSrcFn:I=()=>!1}=t||{};return serializeNodeWithId(e,{doc:e,mirror:n,blockClass:i,blockSelector:s,maskTextClass:a,maskTextSelector:c,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===p?{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}:!1===p?{password:!0}:p,maskTextFn:h,maskInputFn:f,slimDOMOptions:!0===m||"all"===m?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===m,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===m?{}:m,dataURLOptions:g,inlineImages:u,recordCanvas:l,preserveWhiteSpace:_,onSerialize:y,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:S,stylesheetLoadTimeout:w,keepIframeSrcFn:I,newlyAddedElement:!1})}(document,{mirror:$t,blockClass:s,blockSelector:a,maskTextClass:u,maskTextSelector:l,inlineStylesheet:p,maskAllInputs:q,maskTextFn:_,slimDOM:U,dataURLOptions:S,recordCanvas:x,inlineImages:N,onSerialize:e=>{isSerializedIframe(e,$t)&&W.addIframe(e),isSerializedStylesheet(e,$t)&&z.trackLinkElement(e),hasShadowRoot(e)&&H.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{W.attachIframe(e,t),H.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{z.attachLinkElement(e,t)},keepIframeSrcFn:Z});if(!t)return console.warn("Failed to snapshot the document");jt(wrapEvent({type:It.FullSnapshot,data:{node:t,initialOffset:getWindowScroll(window)}}),e),Rt.forEach((e=>e.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&z.adoptStyleSheets(document.adoptedStyleSheets,$t.getId(document))};try{const e=[],observe=e=>{var t;return callbackWrapper(initObservers)({mutationCb:wrappedMutationEmit,mousemoveCb:(e,t)=>jt(wrapEvent({type:It.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.MouseInteraction},e)})),scrollCb:wrappedScrollEmit,viewportResizeCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.ViewportResize},e)})),inputCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.Input},e)})),mediaInteractionCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.MediaInteraction},e)})),styleSheetRuleCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.StyleSheetRule},e)})),styleDeclarationCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.StyleDeclaration},e)})),canvasMutationCb:wrappedCanvasMutationEmit,fontCb:e=>jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.Font},e)})),selectionCb:e=>{jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.Selection},e)}))},customElementCb:e=>{jt(wrapEvent({type:It.IncrementalSnapshot,data:Object.assign({source:xt.CustomElement},e)}))},blockClass:s,ignoreClass:c,ignoreSelector:d,maskTextClass:u,maskTextSelector:l,maskInputOptions:q,inlineStylesheet:p,sampling:b,recordDOM:I,recordCanvas:x,inlineImages:N,userTriggeredOnInput:T,collectFonts:R,doc:e,maskInputFn:g,maskTextFn:_,keepIframeSrcFn:Z,blockSelector:a,slimDOMOptions:U,dataURLOptions:S,mirror:$t,iframeManager:W,stylesheetManager:z,shadowDomManager:H,processedNodeManager:K,canvasManager:qt,ignoreCSSAttributes:P,plugins:(null===(t=null==D?void 0:D.filter((e=>e.observer)))||void 0===t?void 0:t.map((e=>({observer:e.observer,options:e.options,callback:t=>jt(wrapEvent({type:It.Plugin,data:{plugin:e.name,payload:t}}))}))))||[]},y)};W.addLoadListener((t=>{try{e.push(observe(t.contentDocument))}catch(Qt){console.warn(Qt)}}));const init2=()=>{Ft(),e.push(observe(document)),Ut=!0};return"interactive"===document.readyState||"complete"===document.readyState?init2():(e.push(on("DOMContentLoaded",(()=>{jt(wrapEvent({type:It.DomContentLoaded,data:{}})),"DOMContentLoaded"===O&&init2()}))),e.push(on("load",(()=>{jt(wrapEvent({type:It.Load,data:{}})),"load"===O&&init2()}),window))),()=>{e.forEach((e=>e())),K.destroy(),Ut=!1,function unregisterErrorHandler(){Tt=void 0}()}}catch(Qt){console.warn(Qt)}}record.addCustomEvent=(e,t)=>{if(!Ut)throw new Error("please add custom event after start recording");jt(wrapEvent({type:It.Custom,data:{tag:e,payload:t}}))},record.freezePage=()=>{Rt.forEach((e=>e.freeze()))},record.takeFullSnapshot=e=>{if(!Ut)throw new Error("please take full snapshot after start recording");Ft(e)},record.mirror=$t;var Bt,zt=(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))(zt||{}),Wt=(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))(Wt||{}),Vt={DEBUG:!1,LIB_VERSION:"2.55.1"};if("undefined"==typeof window){var Kt={hostname:""};Bt={navigator:{userAgent:"",onLine:!0},document:{location:Kt,referrer:""},screen:{width:0,height:0},location:Kt}}else Bt=window;var Ht,Gt,Yt,Jt,Xt,Qt,er,tr,rr,nr,ir=864e5,or=8e3,sr=Array.prototype,ar=Function.prototype,cr=Object.prototype,dr=sr.slice,ur=cr.toString,lr=cr.hasOwnProperty,pr=Bt.console,hr=Bt.navigator,fr=Bt.document,mr=Bt.opera,gr=Bt.screen,_r=hr.userAgent,yr=ar.bind,vr=sr.forEach,br=sr.indexOf,Sr=sr.map,kr=Array.isArray,wr={},Ir={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},xr={log:function(){if(Vt.DEBUG&&!Ir.isUndefined(pr)&&pr)try{pr.log.apply(pr,arguments)}catch(e){Ir.each(arguments,(function(e){pr.log(e)}))}},warn:function(){if(Vt.DEBUG&&!Ir.isUndefined(pr)&&pr){var e=["Mixpanel warning:"].concat(Ir.toArray(arguments));try{pr.warn.apply(pr,e)}catch(t){Ir.each(e,(function(e){pr.warn(e)}))}}},error:function(){if(Vt.DEBUG&&!Ir.isUndefined(pr)&&pr){var e=["Mixpanel error:"].concat(Ir.toArray(arguments));try{pr.error.apply(pr,e)}catch(t){Ir.each(e,(function(e){pr.error(e)}))}}},critical:function(){if(!Ir.isUndefined(pr)&&pr){var e=["Mixpanel error:"].concat(Ir.toArray(arguments));try{pr.error.apply(pr,e)}catch(t){Ir.each(e,(function(e){pr.error(e)}))}}}},log_func_with_prefix=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(xr,arguments)}},console_with_prefix=function(e){return{log:log_func_with_prefix(xr.log,e),error:log_func_with_prefix(xr.error,e),critical:log_func_with_prefix(xr.critical,e)}};Ir.bind=function(e,t){var n,i;if(yr&&e.bind===yr)return yr.apply(e,dr.call(arguments,1));if(!Ir.isFunction(e))throw new TypeError;return n=dr.call(arguments,2),i=function(){if(!(this instanceof i))return e.apply(t,n.concat(dr.call(arguments)));var s={};s.prototype=e.prototype;var a=new s;s.prototype=null;var c=e.apply(a,n.concat(dr.call(arguments)));return Object(c)===c?c:a},i},Ir.each=function(e,t,n){if(null!=e)if(vr&&e.forEach===vr)e.forEach(t,n);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(i in e&&t.call(n,e[i],i,e)===wr)return}else for(var a in e)if(lr.call(e,a)&&t.call(n,e[a],a,e)===wr)return},Ir.extend=function(e){return Ir.each(dr.call(arguments,1),(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},Ir.isArray=kr||function(e){return"[object Array]"===ur.call(e)},Ir.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch(t){return!1}},Ir.isArguments=function(e){return!(!e||!lr.call(e,"callee"))},Ir.toArray=function(e){return e?e.toArray?e.toArray():Ir.isArray(e)||Ir.isArguments(e)?dr.call(e):Ir.values(e):[]},Ir.map=function(e,t,n){if(Sr&&e.map===Sr)return e.map(t,n);var i=[];return Ir.each(e,(function(e){i.push(t.call(n,e))})),i},Ir.keys=function(e){var t=[];return null===e||Ir.each(e,(function(e,n){t[t.length]=n})),t},Ir.values=function(e){var t=[];return null===e||Ir.each(e,(function(e){t[t.length]=e})),t},Ir.include=function(e,t){var n=!1;return null===e?n:br&&e.indexOf===br?-1!=e.indexOf(t):(Ir.each(e,(function(e){if(n||(n=e===t))return wr})),n)},Ir.includes=function(e,t){return-1!==e.indexOf(t)},Ir.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},Ir.isObject=function(e){return e===Object(e)&&!Ir.isArray(e)},Ir.isEmptyObject=function(e){if(Ir.isObject(e)){for(var t in e)if(lr.call(e,t))return!1;return!0}return!1},Ir.isUndefined=function(e){return void 0===e},Ir.isString=function(e){return"[object String]"==ur.call(e)},Ir.isDate=function(e){return"[object Date]"==ur.call(e)},Ir.isNumber=function(e){return"[object Number]"==ur.call(e)},Ir.isElement=function(e){return!(!e||1!==e.nodeType)},Ir.encodeDates=function(e){return Ir.each(e,(function(t,n){Ir.isDate(t)?e[n]=Ir.formatDate(t):Ir.isObject(t)&&(e[n]=Ir.encodeDates(t))})),e},Ir.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},Ir.formatDate=function(e){function pad(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+pad(e.getUTCMonth()+1)+"-"+pad(e.getUTCDate())+"T"+pad(e.getUTCHours())+":"+pad(e.getUTCMinutes())+":"+pad(e.getUTCSeconds())},Ir.strip_empty_properties=function(e){var t={};return Ir.each(e,(function(e,n){Ir.isString(e)&&e.length>0&&(t[n]=e)})),t},Ir.truncate=function(e,t){var n;return"string"==typeof e?n=e.slice(0,t):Ir.isArray(e)?(n=[],Ir.each(e,(function(e){n.push(Ir.truncate(e,t))}))):Ir.isObject(e)?(n={},Ir.each(e,(function(e,i){n[i]=Ir.truncate(e,t)}))):n=e,n},Ir.JSONEncode=function(){return function(e){var quote=function(e){var t=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,n={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return t.lastIndex=0,t.test(e)?'"'+e.replace(t,(function(e){var t=n[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'},str=function(e,t){var n="",i=0,s="",a="",c=0,d=n,u=[],l=t[e];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(e)),typeof l){case"string":return quote(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(n+=" ",u=[],"[object Array]"===ur.apply(l)){for(c=l.length,i=0;i<c;i+=1)u[i]=str(i,l)||"null";return a=0===u.length?"[]":n?"[\n"+n+u.join(",\n"+n)+"\n"+d+"]":"["+u.join(",")+"]",n=d,a}for(s in l)lr.call(l,s)&&(a=str(s,l))&&u.push(quote(s)+(n?": ":":")+a);return a=0===u.length?"{}":n?"{"+u.join(",")+d+"}":"{"+u.join(",")+"}",n=d,a}};return str("",{"":e})}}(),Ir.JSONDecode=(Xt={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},Qt=function(e){var t=new SyntaxError(e);throw t.at=Ht,t.text=Yt,t},er=function(e){return e&&e!==Gt&&Qt("Expected '"+e+"' instead of '"+Gt+"'"),Gt=Yt.charAt(Ht),Ht+=1,Gt},tr=function(){var e,t="";for("-"===Gt&&(t="-",er("-"));Gt>="0"&&Gt<="9";)t+=Gt,er();if("."===Gt)for(t+=".";er()&&Gt>="0"&&Gt<="9";)t+=Gt;if("e"===Gt||"E"===Gt)for(t+=Gt,er(),"-"!==Gt&&"+"!==Gt||(t+=Gt,er());Gt>="0"&&Gt<="9";)t+=Gt,er();if(e=+t,isFinite(e))return e;Qt("Bad number")},rr=function(){var e,t,n,i="";if('"'===Gt)for(;er();){if('"'===Gt)return er(),i;if("\\"===Gt)if(er(),"u"===Gt){for(n=0,t=0;t<4&&(e=parseInt(er(),16),isFinite(e));t+=1)n=16*n+e;i+=String.fromCharCode(n)}else{if("string"!=typeof Xt[Gt])break;i+=Xt[Gt]}else i+=Gt}Qt("Bad string")},nr=function(){for(;Gt&&Gt<=" ";)er()},Jt=function(){switch(nr(),Gt){case"{":return function(){var e,t={};if("{"===Gt){if(er("{"),nr(),"}"===Gt)return er("}"),t;for(;Gt;){if(e=rr(),nr(),er(":"),Object.hasOwnProperty.call(t,e)&&Qt('Duplicate key "'+e+'"'),t[e]=Jt(),nr(),"}"===Gt)return er("}"),t;er(","),nr()}}Qt("Bad object")}();case"[":return function(){var e=[];if("["===Gt){if(er("["),nr(),"]"===Gt)return er("]"),e;for(;Gt;){if(e.push(Jt()),nr(),"]"===Gt)return er("]"),e;er(","),nr()}}Qt("Bad array")}();case'"':return rr();case"-":return tr();default:return Gt>="0"&&Gt<="9"?tr():function(){switch(Gt){case"t":return er("t"),er("r"),er("u"),er("e"),!0;case"f":return er("f"),er("a"),er("l"),er("s"),er("e"),!1;case"n":return er("n"),er("u"),er("l"),er("l"),null}Qt('Unexpected "'+Gt+'"')}()}},function(e){var t;return Yt=e,Ht=0,Gt=" ",t=Jt(),nr(),Gt&&Qt("Syntax error"),t}),Ir.base64Encode=function(e){var t,n,i,s,a,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=0,u=0,l="",p=[];if(!e)return e;e=Ir.utf8Encode(e);do{t=(a=e.charCodeAt(d++)<<16|e.charCodeAt(d++)<<8|e.charCodeAt(d++))>>18&63,n=a>>12&63,i=a>>6&63,s=63&a,p[u++]=c.charAt(t)+c.charAt(n)+c.charAt(i)+c.charAt(s)}while(d<e.length);switch(l=p.join(""),e.length%3){case 1:l=l.slice(0,-2)+"==";break;case 2:l=l.slice(0,-1)+"="}return l},Ir.utf8Encode=function(e){var t,n,i,s,a="";for(t=n=0,i=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,s=0;s<i;s++){var c=e.charCodeAt(s),d=null;c<128?n++:d=c>127&&c<2048?String.fromCharCode(c>>6|192,63&c|128):String.fromCharCode(c>>12|224,c>>6&63|128,63&c|128),null!==d&&(n>t&&(a+=e.substring(t,n)),a+=d,t=n=s+1)}return n>t&&(a+=e.substring(t,e.length)),a},Ir.UUID=function(){var T2=function(){var e,t=1*new Date;if(Bt.performance&&Bt.performance.now)e=Bt.performance.now();else for(e=0;t==1*new Date;)e++;return t.toString(16)+Math.floor(e).toString(16)};return function(){var e=(gr.height*gr.width).toString(16);return T2()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var e,t,n=_r,i=[],s=0;function xor(e,t){var n,s=0;for(n=0;n<t.length;n++)s|=i[n]<<8*n;return e^s}for(e=0;e<n.length;e++)t=n.charCodeAt(e),i.unshift(255&t),i.length>=4&&(s=xor(s,i),i=[]);return i.length>0&&(s=xor(s,i)),s.toString(16)}()+"-"+e+"-"+T2()}}();var Er=["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"];Ir.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<Er.length;t++)if(-1!==e.indexOf(Er[t]))return!0;return!1},Ir.HTTPBuildQuery=function(e,t){var n,i,s=[];return Ir.isUndefined(t)&&(t="&"),Ir.each(e,(function(e,t){n=encodeURIComponent(e.toString()),i=encodeURIComponent(t),s[s.length]=i+"="+n})),s.join(t)},Ir.getQueryParam=function(e,t){t=t.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var n=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);if(null===n||n&&"string"!=typeof n[1]&&n[1].length)return"";var i=n[1];try{i=decodeURIComponent(i)}catch(s){xr.error("Skipping decoding for malformed query param: "+i)}return i.replace(/\+/g," ")},Ir.cookie={get:function(e){for(var t=e+"=",n=fr.cookie.split(";"),i=0;i<n.length;i++){for(var s=n[i];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}return null},parse:function(e){var t;try{t=Ir.JSONDecode(Ir.cookie.get(e))||{}}catch(n){}return t},set_seconds:function(e,t,n,i,s,a,c){var d="",u="",l="";if(c)d="; domain="+c;else if(i){var p=extract_domain(fr.location.hostname);d=p?"; domain=."+p:""}if(n){var h=new Date;h.setTime(h.getTime()+1e3*n),u="; expires="+h.toGMTString()}a&&(s=!0,l="; SameSite=None"),s&&(l+="; secure"),fr.cookie=e+"="+encodeURIComponent(t)+u+"; path=/"+d+l},set:function(e,t,n,i,s,a,c){var d="",u="",l="";if(c)d="; domain="+c;else if(i){var p=extract_domain(fr.location.hostname);d=p?"; domain=."+p:""}if(n){var h=new Date;h.setTime(h.getTime()+24*n*60*60*1e3),u="; expires="+h.toGMTString()}a&&(s=!0,l="; SameSite=None"),s&&(l+="; secure");var f=e+"="+encodeURIComponent(t)+u+"; path=/"+d+l;return fr.cookie=f,f},remove:function(e,t,n){Ir.cookie.set(e,"",-1,t,!1,!1,n)}};var Cr=null,localStorageSupported=function(e,t){if(null!==Cr&&!t)return Cr;var n=!0;try{e=e||window.localStorage;var i="__mplss_"+cheap_guid(8);e.setItem(i,"xyz"),"xyz"!==e.getItem(i)&&(n=!1),e.removeItem(i)}catch(s){n=!1}return Cr=n,n};Ir.localStorage={is_supported:function(e){var t=localStorageSupported(null,e);return t||xr.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){xr.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){Ir.localStorage.error(t)}return null},parse:function(e){try{return Ir.JSONDecode(Ir.localStorage.get(e))||{}}catch(t){}return null},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(n){Ir.localStorage.error(n)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){Ir.localStorage.error(t)}}},Ir.register_event=function(){function fixEvent(e){return e&&(e.preventDefault=fixEvent.preventDefault,e.stopPropagation=fixEvent.stopPropagation),e}return fixEvent.preventDefault=function(){this.returnValue=!1},fixEvent.stopPropagation=function(){this.cancelBubble=!0},function(e,t,n,i,s){if(e)if(e.addEventListener&&!i)e.addEventListener(t,n,!!s);else{var a="on"+t,c=e[a];e[a]=function makeHandler(e,t,n){var handler=function(i){if(i=i||fixEvent(window.event)){var s,a,c=!0;return Ir.isFunction(n)&&(s=n(i)),a=t.call(e,i),!1!==s&&!1!==a||(c=!1),c}};return handler}(e,n,c)}else xr.error("No valid element provided to register_event")}}();var Or=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');Ir.dom_query=function(){function getAllChildren(e){return e.all?e.all:e.getElementsByTagName("*")}var e=/[\t\r\n]/g;function hasClass(t,n){var i=" "+n+" ";return(" "+t.className+" ").replace(e," ").indexOf(i)>=0}function getElementsBySelector(e){if(!fr.getElementsByTagName)return[];var t,n,i,s,a,c,d,u,l,p,h=e.split(" "),f=[fr];for(c=0;c<h.length;c++)if((t=h[c].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){i=(n=t.split("#"))[0];var m=n[1],g=fr.getElementById(m);if(!g||i&&g.nodeName.toLowerCase()!=i)return[];f=[g]}else if(t.indexOf(".")>-1){i=(n=t.split("."))[0];var _=n[1];for(i||(i="*"),s=[],a=0,d=0;d<f.length;d++)for(l="*"==i?getAllChildren(f[d]):f[d].getElementsByTagName(i),u=0;u<l.length;u++)s[a++]=l[u];for(f=[],p=0,d=0;d<s.length;d++)s[d].className&&Ir.isString(s[d].className)&&hasClass(s[d],_)&&(f[p++]=s[d])}else{var y=t.match(Or);if(y){i=y[1];var v,b=y[2],S=y[3],w=y[4];for(i||(i="*"),s=[],a=0,d=0;d<f.length;d++)for(l="*"==i?getAllChildren(f[d]):f[d].getElementsByTagName(i),u=0;u<l.length;u++)s[a++]=l[u];switch(f=[],p=0,S){case"=":v=function(e){return e.getAttribute(b)==w};break;case"~":v=function(e){return e.getAttribute(b).match(new RegExp("\\b"+w+"\\b"))};break;case"|":v=function(e){return e.getAttribute(b).match(new RegExp("^"+w+"-?"))};break;case"^":v=function(e){return 0===e.getAttribute(b).indexOf(w)};break;case"$":v=function(e){return e.getAttribute(b).lastIndexOf(w)==e.getAttribute(b).length-w.length};break;case"*":v=function(e){return e.getAttribute(b).indexOf(w)>-1};break;default:v=function(e){return e.getAttribute(b)}}for(f=[],p=0,d=0;d<s.length;d++)v(s[d])&&(f[p++]=s[d])}else{for(i=t,s=[],a=0,d=0;d<f.length;d++)for(l=f[d].getElementsByTagName(i),u=0;u<l.length;u++)s[a++]=l[u];f=s}}return f}return function(e){return Ir.isElement(e)?[e]:Ir.isObject(e)&&!Ir.isUndefined(e.length)?e:getElementsBySelector.call(this,e)}}();var Tr=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],Rr=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];Ir.info={campaignParams:function(e){var t="",n={};return Ir.each(Tr,(function(i){(t=Ir.getQueryParam(fr.URL,i)).length?n[i]=t:void 0!==e&&(n[i]=e)})),n},clickParams:function(){var e="",t={};return Ir.each(Rr,(function(n){(e=Ir.getQueryParam(fr.URL,n)).length&&(t[n]=e)})),t},marketingParams:function(){return Ir.extend(Ir.info.campaignParams(),Ir.info.clickParams())},searchEngine:function(e){return 0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(e){var t=Ir.info.searchEngine(e),n="yahoo"!=t?"q":"p",i={};if(null!==t){i.$search_engine=t;var s=Ir.getQueryParam(e,n);s.length&&(i.mp_keyword=s)}return i},browser:function(e,t,n){return t=t||"",n||Ir.includes(e," OPR/")?Ir.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":Ir.includes(e,"IEMobile")||Ir.includes(e,"WPDesktop")?"Internet Explorer Mobile":Ir.includes(e,"SamsungBrowser/")?"Samsung Internet":Ir.includes(e,"Edge")||Ir.includes(e,"Edg/")?"Microsoft Edge":Ir.includes(e,"FBIOS")?"Facebook Mobile":Ir.includes(e,"Chrome")?"Chrome":Ir.includes(e,"CriOS")?"Chrome iOS":Ir.includes(e,"UCWEB")||Ir.includes(e,"UCBrowser")?"UC Browser":Ir.includes(e,"FxiOS")?"Firefox iOS":Ir.includes(t,"Apple")?Ir.includes(e,"Mobile")?"Mobile Safari":"Safari":Ir.includes(e,"Android")?"Android Mobile":Ir.includes(e,"Konqueror")?"Konqueror":Ir.includes(e,"Firefox")?"Firefox":Ir.includes(e,"MSIE")||Ir.includes(e,"Trident/")?"Internet Explorer":Ir.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,n){var 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+)?)/}[Ir.info.browser(e,t,n)];if(void 0===i)return null;var s=e.match(i);return s?parseFloat(s[s.length-2]):null},os:function(){var e=_r;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 Bt.location.href},properties:function(e){return"object"!=typeof e&&(e={}),Ir.extend(Ir.strip_empty_properties({$os:Ir.info.os(),$browser:Ir.info.browser(_r,hr.vendor,mr),$referrer:fr.referrer,$referring_domain:Ir.info.referringDomain(fr.referrer),$device:Ir.info.device(_r)}),{$current_url:Ir.info.currentUrl(),$browser_version:Ir.info.browserVersion(_r,hr.vendor,mr),$screen_height:gr.height,$screen_width:gr.width,mp_lib:"web",$lib_version:Vt.LIB_VERSION,$insert_id:cheap_guid(),time:Ir.timestamp()/1e3},Ir.strip_empty_properties(e))},people_properties:function(){return Ir.extend(Ir.strip_empty_properties({$os:Ir.info.os(),$browser:Ir.info.browser(_r,hr.vendor,mr)}),{$browser_version:Ir.info.browserVersion(_r,hr.vendor,mr)})},mpPageViewProperties:function(){return Ir.strip_empty_properties({current_page_title:fr.title,current_domain:Bt.location.hostname,current_url_path:Bt.location.pathname,current_url_protocol:Bt.location.protocol,current_url_search:Bt.location.search})}};var cheap_guid=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},Mr=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Nr=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,extract_domain=function(e){var t=Nr,n=e.split("."),i=n[n.length-1];(i.length>4||"com"===i||"org"===i)&&(t=Mr);var s=e.match(t);return s?s[0]:""},Dr=null,Zr=null;"undefined"!=typeof JSON&&(Dr=JSON.stringify,Zr=JSON.parse),Dr=Dr||Ir.JSONEncode,Zr=Zr||Ir.JSONDecode,Ir.toArray=Ir.toArray,Ir.isObject=Ir.isObject,Ir.JSONEncode=Ir.JSONEncode,Ir.JSONDecode=Ir.JSONDecode,Ir.isBlockedUA=Ir.isBlockedUA,Ir.isEmptyObject=Ir.isEmptyObject,Ir.info=Ir.info,Ir.info.device=Ir.info.device,Ir.info.browser=Ir.info.browser,Ir.info.browserVersion=Ir.info.browserVersion,Ir.info.properties=Ir.info.properties;var Pr="__mp_opt_in_out_";function optIn(e,t){_optInOut(!0,e,t)}function optOut(e,t){_optInOut(!1,e,t)}function hasOptedIn(e,t){return"1"===_getStorageValue(e,t)}function hasOptedOut(e,t){if(function _hasDoNotTrackFlagOn(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||Bt,n=t.navigator||{},i=!1;return Ir.each([n.doNotTrack,n.msDoNotTrack,t.doNotTrack],(function(e){Ir.includes([!0,1,"1","yes"],e)&&(i=!0)})),i}(t))return xr.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 n="0"===_getStorageValue(e,t);return n&&xr.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),n}function addOptOutCheckMixpanelLib(e){return _addOptOutCheck(e,(function(e){return this.get_config(e)}))}function addOptOutCheckMixpanelPeople(e){return _addOptOutCheck(e,(function(e){return this._get_config(e)}))}function addOptOutCheckMixpanelGroup(e){return _addOptOutCheck(e,(function(e){return this._get_config(e)}))}function clearOptInOut(e,t){_getStorage(t=t||{}).remove(_getStorageKey(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function _getStorage(e){return"localStorage"===(e=e||{}).persistenceType?Ir.localStorage:Ir.cookie}function _getStorageKey(e,t){return((t=t||{}).persistencePrefix||Pr)+e}function _getStorageValue(e,t){return _getStorage(t).get(_getStorageKey(e,t))}function _optInOut(e,t,n){Ir.isString(t)&&t.length?(_getStorage(n=n||{}).set(_getStorageKey(t,n),e?1:0,Ir.isNumber(n.cookieExpiration)?n.cookieExpiration:null,!!n.crossSubdomainCookie,!!n.secureCookie,!!n.crossSiteCookie,n.cookieDomain),n.track&&e&&n.track(n.trackEventName||"$opt_in",n.trackProperties,{send_immediately:!0})):xr.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token")}function _addOptOutCheck(e,t){return function(){var n=!1;try{var i=t.call(this,"token"),s=t.call(this,"ignore_dnt"),a=t.call(this,"opt_out_tracking_persistence_type"),c=t.call(this,"opt_out_tracking_cookie_prefix"),d=t.call(this,"window");i&&(n=hasOptedOut(i,{ignoreDnt:s,persistenceType:a,persistencePrefix:c,window:d}))}catch(l){xr.error("Unexpected error when checking tracking opt-out status: "+l)}if(!n)return e.apply(this,arguments);var u=arguments[arguments.length-1];"function"==typeof u&&u(0)}}var Ar=console_with_prefix("lock"),SharedLock=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};SharedLock.prototype.withLock=function(e,t,n){n||"function"==typeof t||(n=t,t=null);var i=n||(new Date).getTime()+"|"+Math.random(),s=(new Date).getTime(),a=this.storageKey,c=this.pollIntervalMS,d=this.timeoutMS,u=this.storage,l=a+":X",p=a+":Y",h=a+":Z",reportError=function(e){t&&t(e)},delay=function(e){if((new Date).getTime()-s>d)return Ar.error("Timeout waiting for mutex on "+a+"; clearing lock. ["+i+"]"),u.removeItem(h),u.removeItem(p),void loop();setTimeout((function(){try{e()}catch(t){reportError(t)}}),c*(Math.random()+.1))},waitFor=function(e,t){e()?t():delay((function(){waitFor(e,t)}))},getSetY=function(){var e=u.getItem(p);if(e&&e!==i)return!1;if(u.setItem(p,i),u.getItem(p)===i)return!0;if(!localStorageSupported(u,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},loop=function(){u.setItem(l,i),waitFor(getSetY,(function(){u.getItem(l)!==i?delay((function(){u.getItem(p)===i?waitFor((function(){return!u.getItem(h)}),criticalSection):loop()})):criticalSection()}))},criticalSection=function(){u.setItem(h,"1");try{e()}finally{u.removeItem(h),u.getItem(p)===i&&u.removeItem(p),u.getItem(l)===i&&u.removeItem(l)}};try{if(!localStorageSupported(u,!0))throw new Error("localStorage support check failed");loop()}catch(f){reportError(f)}};var Lr=console_with_prefix("batch"),RequestQueue=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||Ir.bind(Lr.error,Lr),this.lock=new SharedLock(e,{storage:this.storage}),this.usePersistence=t.usePersistence,this.pid=t.pid||null,this.memQueue=[]};RequestQueue.prototype.enqueue=function(e,t,n){var i={id:cheap_guid(),flushAfter:(new Date).getTime()+2*t,payload:e};this.usePersistence?this.lock.withLock(Ir.bind((function lockAcquired(){var t;try{var s=this.readFromStorage();s.push(i),(t=this.saveToStorage(s))&&this.memQueue.push(i)}catch(a){this.reportError("Error enqueueing item",e),t=!1}n&&n(t)}),this),Ir.bind((function lockFailure(e){this.reportError("Error acquiring storage lock",e),n&&n(!1)}),this),this.pid):(this.memQueue.push(i),n&&n(!0))},RequestQueue.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(this.usePersistence&&t.length<e){var n=this.readFromStorage();if(n.length){var i={};Ir.each(t,(function(e){i[e.id]=!0}));for(var s=0;s<n.length;s++){var a=n[s];if((new Date).getTime()>a.flushAfter&&!i[a.id]&&(a.orphaned=!0,t.push(a),t.length>=e))break}}}return t};var filterOutIDsAndInvalid=function(e,t){var n=[];return Ir.each(e,(function(e){e.id&&!t[e.id]&&n.push(e)})),n};RequestQueue.prototype.removeItemsByID=function(e,t){var n={};if(Ir.each(e,(function(e){n[e]=!0})),this.memQueue=filterOutIDsAndInvalid(this.memQueue,n),this.usePersistence){var i=Ir.bind((function(){var t;try{var i=this.readFromStorage();if(i=filterOutIDsAndInvalid(i,n),t=this.saveToStorage(i)){i=this.readFromStorage();for(var s=0;s<i.length;s++){var a=i[s];if(a.id&&n[a.id])return this.reportError("Item not removed from storage"),!1}}}catch(c){this.reportError("Error removing items",e),t=!1}return t}),this);this.lock.withLock((function lockAcquired(){var e=i();t&&t(e)}),Ir.bind((function lockFailure(e){var n=!1;if(this.reportError("Error acquiring storage lock",e),!localStorageSupported(this.storage,!0)&&!(n=i()))try{this.storage.removeItem(this.storageKey)}catch(s){this.reportError("Error clearing queue",s)}t&&t(n)}),this),this.pid)}else t&&t(!0)};var updatePayloads=function(e,t){var n=[];return Ir.each(e,(function(e){var i=e.id;if(i in t){var s=t[i];null!==s&&(e.payload=s,n.push(e))}else n.push(e)})),n};RequestQueue.prototype.updatePayloads=function(e,t){this.memQueue=updatePayloads(this.memQueue,e),this.usePersistence?this.lock.withLock(Ir.bind((function lockAcquired(){var n;try{var i=this.readFromStorage();i=updatePayloads(i,e),n=this.saveToStorage(i)}catch(s){this.reportError("Error updating items",e),n=!1}t&&t(n)}),this),Ir.bind((function lockFailure(e){this.reportError("Error acquiring storage lock",e),t&&t(!1)}),this),this.pid):t&&t(!0)},RequestQueue.prototype.readFromStorage=function(){var e;try{(e=this.storage.getItem(this.storageKey))&&(e=Zr(e),Ir.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null))}catch(t){this.reportError("Error retrieving queue",t),e=null}return e||[]},RequestQueue.prototype.saveToStorage=function(e){try{return this.storage.setItem(this.storageKey,Dr(e)),!0}catch(t){return this.reportError("Error saving queue",t),!1}},RequestQueue.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var jr=console_with_prefix("batch"),RequestBatcher=function(e,t){this.errorReporter=t.errorReporter,this.queue=new RequestQueue(e,{errorReporter:Ir.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};RequestBatcher.prototype.enqueue=function(e,t){this.queue.enqueue(e,this.flushInterval,t)},RequestBatcher.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},RequestBatcher.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},RequestBatcher.prototype.clear=function(){this.queue.clear()},RequestBatcher.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},RequestBatcher.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},RequestBatcher.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(Ir.bind((function(){this.stopped||this.flush()}),this),this.flushInterval))},RequestBatcher.prototype.flush=function(e){try{if(this.requestInProgress)return void jr.log("Flush: Request already in progress");e=e||{};var t=this.libConfig.batch_request_timeout_ms,n=(new Date).getTime(),i=this.batchSize,s=this.queue.fillBatch(i),a=s.length===i,c=[],d={};if(Ir.each(s,(function(e){var t=e.payload;if(this.beforeSendHook&&!e.orphaned&&(t=this.beforeSendHook(t)),t){t.event&&t.properties&&(t.properties=Ir.extend({},t.properties,{mp_sent_by_lib_version:Vt.LIB_VERSION}));var n=!0,i=e.id;i?(this.itemIdsSentSuccessfully[i]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:e,batchSize:s.length,timesSent:this.itemIdsSentSuccessfully[i]}),n=!1):this.reportError("[dupe] found item with no ID",{item:e}),n&&c.push(t)}d[e.id]=t}),this),c.length<1)return void this.resetFlush();this.requestInProgress=!0;var u=Ir.bind((function(c){this.requestInProgress=!1;try{var u=!1;if(e.unloading)this.queue.updatePayloads(d);else if(Ir.isObject(c)&&"timeout"===c.error&&(new Date).getTime()-n>=t)this.reportError("Network timeout; retrying"),this.flush();else if(Ir.isObject(c)&&(c.httpStatusCode>=500||429===c.httpStatusCode||c.httpStatusCode<=0&&(h=Bt.navigator.onLine,!Ir.isUndefined(h)&&!h)||"timeout"===c.error)){var l=2*this.flushInterval;c.retryAfter&&(l=1e3*parseInt(c.retryAfter,10)||l),l=Math.min(6e5,l),this.reportError("Error; retry in "+l+" ms"),this.scheduleFlush(l)}else if(Ir.isObject(c)&&413===c.httpStatusCode)if(s.length>1){var p=Math.max(1,Math.floor(i/2));this.batchSize=Math.min(this.batchSize,p,s.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",s),this.resetBatchSize(),u=!0;else u=!0;u&&(this.queue.removeItemsByID(Ir.map(s,(function(e){return e.id})),Ir.bind((function(e){e?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!a?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)),Ir.each(s,Ir.bind((function(e){var t=e.id;t?(this.itemIdsSentSuccessfully[t]=this.itemIdsSentSuccessfully[t]||0,this.itemIdsSentSuccessfully[t]++,this.itemIdsSentSuccessfully[t]>5&&this.reportError("[dupe] item ID sent too many times",{item:e,batchSize:s.length,timesSent:this.itemIdsSentSuccessfully[t]})):this.reportError("[dupe] found item with no ID while removing",{item:e})}),this)))}catch(f){this.reportError("Error handling API response",f),this.resetFlush()}var h}),this),l={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(l.transport="sendBeacon"),jr.log("MIXPANEL REQUEST:",c),this.sendRequest(c,l,u)}catch(p){this.reportError("Error flushing request queue",p),this.resetFlush()}},RequestBatcher.prototype.reportError=function(e,t){if(jr.error.apply(jr.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(n){jr.error(n)}};var Fr=console_with_prefix("recorder"),qr=Bt.CompressionStream,Ur={batch_size:1e3,batch_flush_interval_ms:1e4,batch_request_timeout_ms:9e4,batch_autostart:!0},$r=new Set([Wt.MouseMove,Wt.MouseInteraction,Wt.Scroll,Wt.ViewportResize,Wt.Input,Wt.TouchMove,Wt.MediaInteraction,Wt.Drag,Wt.Selection]);var MixpanelRecorder=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=ir,this.recordMinMs=0,this._initBatcher()};MixpanelRecorder.prototype._initBatcher=function(){this.batcher=new RequestBatcher("__mprec",{libConfig:Ur,sendRequestFunc:Ir.bind(this.flushEventsWithOptOut,this),errorReporter:Ir.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},MixpanelRecorder.prototype.get_config=function(e){return this._mixpanel.get_config(e)},MixpanelRecorder.prototype.startRecording=function(e){if(null===this._stopRecording){this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>ir&&(this.recordMaxMs=ir,Fr.critical("record_max_ms cannot be greater than "+ir+"ms. Capping value.")),this.recordMinMs=this.get_config("record_min_ms"),this.recordMinMs>or&&(this.recordMinMs=or,Fr.critical("record_min_ms cannot be greater than 8000ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=(new Date).getTime(),this.replayId=Ir.UUID(),e||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var t=Ir.bind((function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(Ir.bind((function(){Fr.log("Idle timeout reached, restarting recording."),this.resetRecording()}),this),this.get_config("record_idle_timeout_ms"))}),this),n=this.get_config("record_block_selector");""!==n&&null!==n||(n=void 0),this._stopRecording=record({emit:Ir.bind((function(e){this.batcher.enqueue(e),function isUserEvent(e){return e.type===zt.IncrementalSnapshot&&$r.has(e.data.source)}(e)&&(this.batcher.stopped&&(new Date).getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),t())}),this),blockClass:this.get_config("record_block_class"),blockSelector:n,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(Ir.bind(this.resetRecording,this),this.recordMaxMs)}else Fr.log("Recording already in progress, skipping startRecording.")},MixpanelRecorder.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},MixpanelRecorder.prototype.stopRecording=function(){null!==this._stopRecording&&(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)},MixpanelRecorder.prototype.flushEventsWithOptOut=function(e,t,n){this._flushEvents(e,t,n,Ir.bind(this._onOptOut,this))},MixpanelRecorder.prototype._onOptOut=function(e){0===e&&(this.recEvents=[],this.stopRecording())},MixpanelRecorder.prototype._sendRequest=function(e,t,n,i){var s=Ir.bind((function(t,n){200===t.status&&this.replayId===e&&this.seqNo++,i({status:0,httpStatusCode:t.status,responseBody:n,retryAfter:t.headers.get("Retry-After")})}),this);Bt.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record+"?"+new URLSearchParams(t),{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/octet-stream"},body:n}).then((function(e){e.json().then((function(t){s(e,t)})).catch((function(e){i({error:e})}))})).catch((function(e){i({error:e,httpStatusCode:0})}))},MixpanelRecorder.prototype._flushEvents=addOptOutCheckMixpanelLib((function(e,t,n){const i=e.length;if(i>0){var s=this.replayId,a=e[0].timestamp;0!==this.seqNo&&this.replayStartTime||(0!==this.seqNo&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=a);var c=e[i-1].timestamp-this.replayStartTime,d={distinct_id:String(this._mixpanel.get_distinct_id()),seq:this.seqNo,batch_start_time:a/1e3,replay_id:s,replay_length_ms:c,replay_start_time:this.replayStartTime/1e3},u=Ir.JSONEncode(e),l=this._mixpanel.get_property("$device_id");l&&(d.$device_id=l);var p=this._mixpanel.get_property("$user_id");if(p&&(d.$user_id=p),qr){var h=new Blob([u],{type:"application/json"}).stream().pipeThrough(new qr("gzip"));new Response(h).blob().then(Ir.bind((function(e){d.format="gzip",this._sendRequest(s,d,e,n)}),this))}else d.format="body",this._sendRequest(s,d,u,n)}})),MixpanelRecorder.prototype.reportError=function(e,t){Fr.error.apply(Fr.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){Fr.error(n)}},Bt.__mp_recorder=MixpanelRecorder;var DomTracker=function(){};DomTracker.prototype.create_properties=function(){},DomTracker.prototype.event_handler=function(){},DomTracker.prototype.after_track_handler=function(){},DomTracker.prototype.init=function(e){return this.mp=e,this},DomTracker.prototype.track=function(e,t,n,i){var s=this,a=Ir.dom_query(e);if(0!==a.length)return Ir.each(a,(function(e){Ir.register_event(e,this.override_event,(function(e){var a={},c=s.create_properties(n,this),d=s.mp.get_config("track_links_timeout");s.event_handler(e,this,a),window.setTimeout(s.track_callback(i,c,a,!0),d),s.mp.track(t,c,s.track_callback(i,c,a))}))}),this),!0;xr.error("The DOM query ("+e+") returned 0 elements")},DomTracker.prototype.track_callback=function(e,t,n,i){i=i||!1;var s=this;return function(){n.callback_fired||(n.callback_fired=!0,e&&!1===e(i,t)||s.after_track_handler(t,n,i))}},DomTracker.prototype.create_properties=function(e,t){return"function"==typeof e?e(t):Ir.extend({},e)};var LinkTracker=function(){this.override_event="click"};Ir.inherit(LinkTracker,DomTracker),LinkTracker.prototype.create_properties=function(e,t){var n=LinkTracker.superclass.create_properties.apply(this,arguments);return t.href&&(n.url=t.href),n},LinkTracker.prototype.event_handler=function(e,t,n){n.new_tab=2===e.which||e.metaKey||e.ctrlKey||"_blank"===t.target,n.href=t.href,n.new_tab||e.preventDefault()},LinkTracker.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout((function(){window.location=t.href}),0)};var FormTracker=function(){this.override_event="submit"};Ir.inherit(FormTracker,DomTracker),FormTracker.prototype.event_handler=function(e,t,n){n.element=t,e.preventDefault()},FormTracker.prototype.after_track_handler=function(e,t){setTimeout((function(){t.element.submit()}),0)};var Br="$set",zr="$set_once",Wr="$unset",Vr="$add",Kr="$append",Hr="$union",Gr="$remove",Yr={set_action:function(e,t){var n={},i={};return Ir.isObject(e)?Ir.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[Br]=i,n},unset_action:function(e){var t={},n=[];return Ir.isArray(e)||(e=[e]),Ir.each(e,(function(e){this._is_reserved_property(e)||n.push(e)}),this),t[Wr]=n,t},set_once_action:function(e,t){var n={},i={};return Ir.isObject(e)?Ir.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[zr]=i,n},union_action:function(e,t){var n={},i={};return Ir.isObject(e)?Ir.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=Ir.isArray(e)?e:[e])}),this):i[e]=Ir.isArray(t)?t:[t],n[Hr]=i,n},append_action:function(e,t){var n={},i={};return Ir.isObject(e)?Ir.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[Kr]=i,n},remove_action:function(e,t){var n={},i={};return Ir.isObject(e)?Ir.each(e,(function(e,t){this._is_reserved_property(t)||(i[t]=e)}),this):i[e]=t,n[Gr]=i,n},delete_action:function(){var e={$delete:""};return e}},MixpanelGroup=function(){};Ir.extend(MixpanelGroup.prototype,Yr),MixpanelGroup.prototype._init=function(e,t,n){this._mixpanel=e,this._group_key=t,this._group_id=n},MixpanelGroup.prototype.set=addOptOutCheckMixpanelGroup((function(e,t,n){var i=this.set_action(e,t);return Ir.isObject(e)&&(n=t),this._send_request(i,n)})),MixpanelGroup.prototype.set_once=addOptOutCheckMixpanelGroup((function(e,t,n){var i=this.set_once_action(e,t);return Ir.isObject(e)&&(n=t),this._send_request(i,n)})),MixpanelGroup.prototype.unset=addOptOutCheckMixpanelGroup((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),MixpanelGroup.prototype.union=addOptOutCheckMixpanelGroup((function(e,t,n){Ir.isObject(e)&&(n=t);var i=this.union_action(e,t);return this._send_request(i,n)})),MixpanelGroup.prototype.delete=addOptOutCheckMixpanelGroup((function(e){var t=this.delete_action();return this._send_request(t,e)})),MixpanelGroup.prototype.remove=addOptOutCheckMixpanelGroup((function(e,t,n){var i=this.remove_action(e,t);return this._send_request(i,n)})),MixpanelGroup.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var n=Ir.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:n,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)},MixpanelGroup.prototype._is_reserved_property=function(e){return"$group_key"===e||"$group_id"===e},MixpanelGroup.prototype._get_config=function(e){return this._mixpanel.get_config(e)},MixpanelGroup.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},MixpanelGroup.prototype.remove=MixpanelGroup.prototype.remove,MixpanelGroup.prototype.set=MixpanelGroup.prototype.set,MixpanelGroup.prototype.set_once=MixpanelGroup.prototype.set_once,MixpanelGroup.prototype.union=MixpanelGroup.prototype.union,MixpanelGroup.prototype.unset=MixpanelGroup.prototype.unset,MixpanelGroup.prototype.toString=MixpanelGroup.prototype.toString;var MixpanelPeople=function(){};Ir.extend(MixpanelPeople.prototype,Yr),MixpanelPeople.prototype._init=function(e){this._mixpanel=e},MixpanelPeople.prototype.set=addOptOutCheckMixpanelPeople((function(e,t,n){var i=this.set_action(e,t);return Ir.isObject(e)&&(n=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),i[Br]=Ir.extend({},Ir.info.people_properties(),i[Br]),this._send_request(i,n)})),MixpanelPeople.prototype.set_once=addOptOutCheckMixpanelPeople((function(e,t,n){var i=this.set_once_action(e,t);return Ir.isObject(e)&&(n=t),this._send_request(i,n)})),MixpanelPeople.prototype.unset=addOptOutCheckMixpanelPeople((function(e,t){var n=this.unset_action(e);return this._send_request(n,t)})),MixpanelPeople.prototype.increment=addOptOutCheckMixpanelPeople((function(e,t,n){var i={},s={};return Ir.isObject(e)?(Ir.each(e,(function(e,t){if(!this._is_reserved_property(t)){if(isNaN(parseFloat(e)))return void xr.error("Invalid increment value passed to mixpanel.people.increment - must be a number");s[t]=e}}),this),n=t):(Ir.isUndefined(t)&&(t=1),s[e]=t),i[Vr]=s,this._send_request(i,n)})),MixpanelPeople.prototype.append=addOptOutCheckMixpanelPeople((function(e,t,n){Ir.isObject(e)&&(n=t);var i=this.append_action(e,t);return this._send_request(i,n)})),MixpanelPeople.prototype.remove=addOptOutCheckMixpanelPeople((function(e,t,n){Ir.isObject(e)&&(n=t);var i=this.remove_action(e,t);return this._send_request(i,n)})),MixpanelPeople.prototype.union=addOptOutCheckMixpanelPeople((function(e,t,n){Ir.isObject(e)&&(n=t);var i=this.union_action(e,t);return this._send_request(i,n)})),MixpanelPeople.prototype.track_charge=addOptOutCheckMixpanelPeople((function(e,t,n){if(Ir.isNumber(e)||(e=parseFloat(e),!isNaN(e)))return this.append("$transactions",Ir.extend({$amount:e},t),n);xr.error("Invalid value passed to mixpanel.people.track_charge - must be a number")})),MixpanelPeople.prototype.clear_charges=function(e){return this.set("$transactions",[],e)},MixpanelPeople.prototype.delete_user=function(){if(this._identify_called()){var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)}xr.error("mixpanel.people.delete_user() requires you to call identify() first")},MixpanelPeople.prototype.toString=function(){return this._mixpanel.toString()+".people"},MixpanelPeople.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var n=this._mixpanel.get_property("$device_id"),i=this._mixpanel.get_property("$user_id"),s=this._mixpanel.get_property("$had_persisted_distinct_id");n&&(e.$device_id=n),i&&(e.$user_id=i),s&&(e.$had_persisted_distinct_id=s);var a=Ir.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:a,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),Ir.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),Ir.truncate(a,255))},MixpanelPeople.prototype._get_config=function(e){return this._mixpanel.get_config(e)},MixpanelPeople.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},MixpanelPeople.prototype._enqueue=function(e){Br in e?this._mixpanel.persistence._add_to_people_queue(Br,e):zr in e?this._mixpanel.persistence._add_to_people_queue(zr,e):Wr in e?this._mixpanel.persistence._add_to_people_queue(Wr,e):Vr in e?this._mixpanel.persistence._add_to_people_queue(Vr,e):Kr in e?this._mixpanel.persistence._add_to_people_queue(Kr,e):Gr in e?this._mixpanel.persistence._add_to_people_queue(Gr,e):Hr in e?this._mixpanel.persistence._add_to_people_queue(Hr,e):xr.error("Invalid call to _enqueue():",e)},MixpanelPeople.prototype._flush_one_queue=function(e,t,n,i){var s=this,a=Ir.extend({},this._mixpanel.persistence.load_queue(e)),c=a;Ir.isUndefined(a)||!Ir.isObject(a)||Ir.isEmptyObject(a)||(s._mixpanel.persistence._pop_from_people_queue(e,a),s._mixpanel.persistence.save(),i&&(c=i(a)),t.call(s,c,(function(t,i){0===t&&s._mixpanel.persistence._add_to_people_queue(e,a),Ir.isUndefined(n)||n(t,i)})))},MixpanelPeople.prototype._flush=function(e,t,n,i,s,a,c){var d=this;this._flush_one_queue(Br,this.set,e),this._flush_one_queue(zr,this.set_once,i),this._flush_one_queue(Wr,this.unset,a,(function(e){return Ir.keys(e)})),this._flush_one_queue(Vr,this.increment,t),this._flush_one_queue(Hr,this.union,s);var u=this._mixpanel.persistence.load_queue(Kr);if(!Ir.isUndefined(u)&&Ir.isArray(u)&&u.length)for(var l,append_callback=function(e,t){0===e&&d._mixpanel.persistence._add_to_people_queue(Kr,l),Ir.isUndefined(n)||n(e,t)},p=u.length-1;p>=0;p--)u=this._mixpanel.persistence.load_queue(Kr),l=u.pop(),d._mixpanel.persistence.save(),Ir.isEmptyObject(l)||d.append(l,append_callback);var h=this._mixpanel.persistence.load_queue(Gr);if(!Ir.isUndefined(h)&&Ir.isArray(h)&&h.length)for(var f,remove_callback=function(e,t){0===e&&d._mixpanel.persistence._add_to_people_queue(Gr,f),Ir.isUndefined(c)||c(e,t)},m=h.length-1;m>=0;m--)h=this._mixpanel.persistence.load_queue(Gr),f=h.pop(),d._mixpanel.persistence.save(),Ir.isEmptyObject(f)||d.remove(f,remove_callback)},MixpanelPeople.prototype._is_reserved_property=function(e){return"$distinct_id"===e||"$token"===e||"$device_id"===e||"$user_id"===e||"$had_persisted_distinct_id"===e},MixpanelPeople.prototype.set=MixpanelPeople.prototype.set,MixpanelPeople.prototype.set_once=MixpanelPeople.prototype.set_once,MixpanelPeople.prototype.unset=MixpanelPeople.prototype.unset,MixpanelPeople.prototype.increment=MixpanelPeople.prototype.increment,MixpanelPeople.prototype.append=MixpanelPeople.prototype.append,MixpanelPeople.prototype.remove=MixpanelPeople.prototype.remove,MixpanelPeople.prototype.union=MixpanelPeople.prototype.union,MixpanelPeople.prototype.track_charge=MixpanelPeople.prototype.track_charge,MixpanelPeople.prototype.clear_charges=MixpanelPeople.prototype.clear_charges,MixpanelPeople.prototype.delete_user=MixpanelPeople.prototype.delete_user,MixpanelPeople.prototype.toString=MixpanelPeople.prototype.toString;var Jr,Xr="__mps",Qr="__mpso",en="__mpus",tn="__mpa",rn="__mpap",nn="__mpr",sn="__mpu",an="$people_distinct_id",cn="__alias",dn="__timers",un=[Xr,Qr,en,tn,rn,nn,sn,an,cn,dn],MixpanelPersistence=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;"cookie"!==t&&"localStorage"!==t&&(xr.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),"localStorage"===t&&Ir.localStorage.is_supported()?this.storage=Ir.localStorage:this.storage=Ir.cookie,this.load(),this.update_config(e),this.upgrade(),this.save()};MixpanelPersistence.prototype.properties=function(){var e={};return this.load(),Ir.each(this.props,(function(t,n){Ir.include(un,n)||(e[n]=t)})),e},MixpanelPersistence.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=Ir.extend({},e))}},MixpanelPersistence.prototype.upgrade=function(){var e,t;this.storage===Ir.localStorage?(e=Ir.cookie.parse(this.name),Ir.cookie.remove(this.name),Ir.cookie.remove(this.name,!0),e&&this.register_once(e)):this.storage===Ir.cookie&&(t=Ir.localStorage.parse(this.name),Ir.localStorage.remove(this.name),t&&this.register_once(t))},MixpanelPersistence.prototype.save=function(){this.disabled||this.storage.set(this.name,Ir.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},MixpanelPersistence.prototype.load_prop=function(e){return this.load(),this.props[e]},MixpanelPersistence.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},MixpanelPersistence.prototype.clear=function(){this.remove(),this.props={}},MixpanelPersistence.prototype.register_once=function(e,t,n){return!!Ir.isObject(e)&&(void 0===t&&(t="None"),this.expire_days=void 0===n?this.default_expiry:n,this.load(),Ir.each(e,(function(e,n){this.props.hasOwnProperty(n)&&this.props[n]!==t||(this.props[n]=e)}),this),this.save(),!0)},MixpanelPersistence.prototype.register=function(e,t){return!!Ir.isObject(e)&&(this.expire_days=void 0===t?this.default_expiry:t,this.load(),Ir.extend(this.props,e),this.save(),!0)},MixpanelPersistence.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())},MixpanelPersistence.prototype.update_search_keyword=function(e){this.register(Ir.info.searchInfo(e))},MixpanelPersistence.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:Ir.info.referringDomain(e)||"$direct"},"")},MixpanelPersistence.prototype.get_referrer_info=function(){return Ir.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},MixpanelPersistence.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)},MixpanelPersistence.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()},MixpanelPersistence.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())},MixpanelPersistence.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())},MixpanelPersistence.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())},MixpanelPersistence.prototype.get_cross_subdomain=function(){return this.cross_subdomain},MixpanelPersistence.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())},MixpanelPersistence.prototype._add_to_people_queue=function(e,t){var n=this._get_queue_key(e),i=t[e],s=this._get_or_create_queue(Br),a=this._get_or_create_queue(zr),c=this._get_or_create_queue(Wr),d=this._get_or_create_queue(Vr),u=this._get_or_create_queue(Hr),l=this._get_or_create_queue(Gr,[]),p=this._get_or_create_queue(Kr,[]);n===Xr?(Ir.extend(s,i),this._pop_from_people_queue(Vr,i),this._pop_from_people_queue(Hr,i),this._pop_from_people_queue(Wr,i)):n===Qr?(Ir.each(i,(function(e,t){t in a||(a[t]=e)})),this._pop_from_people_queue(Wr,i)):n===en?Ir.each(i,(function(e){Ir.each([s,a,d,u],(function(t){e in t&&delete t[e]})),Ir.each(p,(function(t){e in t&&delete t[e]})),c[e]=!0})):n===tn?(Ir.each(i,(function(e,t){t in s?s[t]+=e:(t in d||(d[t]=0),d[t]+=e)}),this),this._pop_from_people_queue(Wr,i)):n===sn?(Ir.each(i,(function(e,t){Ir.isArray(e)&&(t in u||(u[t]=[]),u[t]=u[t].concat(e))})),this._pop_from_people_queue(Wr,i)):n===nn?(l.push(i),this._pop_from_people_queue(Kr,i)):n===rn&&(p.push(i),this._pop_from_people_queue(Wr,i)),xr.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),xr.log(t),this.save()},MixpanelPersistence.prototype._pop_from_people_queue=function(e,t){var n=this.props[this._get_queue_key(e)];Ir.isUndefined(n)||Ir.each(t,(function(t,i){e===Kr||e===Gr?Ir.each(n,(function(e){e[i]===t&&delete e[i]})):delete n[i]}),this)},MixpanelPersistence.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))},MixpanelPersistence.prototype._get_queue_key=function(e){return e===Br?Xr:e===zr?Qr:e===Wr?en:e===Vr?tn:e===Kr?rn:e===Gr?nn:e===Hr?sn:void xr.error("Invalid queue:",e)},MixpanelPersistence.prototype._get_or_create_queue=function(e,t){var n=this._get_queue_key(e);return t=Ir.isUndefined(t)?{}:t,this.props[n]||(this.props[n]=t)},MixpanelPersistence.prototype.set_event_timer=function(e,t){var n=this.load_prop(dn)||{};n[e]=t,this.props[dn]=n,this.save()},MixpanelPersistence.prototype.remove_event_timer=function(e){var t=(this.load_prop(dn)||{})[e];return Ir.isUndefined(t)||(delete this.props[dn][e],this.save()),t};var ln,load_extra_bundle=function(e,t){throw new Error(e+" not available in this build.")},IDENTITY_FUNC=function(e){return e},NOOP_FUNC=function(){},pn="mixpanel",hn="base64",fn="$device:",mn=Bt.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,gn=!mn&&-1===_r.indexOf("MSIE")&&-1===_r.indexOf("Mozilla"),_n=null;hr.sendBeacon&&(_n=function(){return hr.sendBeacon.apply(hr,arguments)});var yn={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},vn={api_host:"https://api-js.mixpanel.com",api_routes:yn,api_method:"POST",api_transport:"XHR",api_payload_format:hn,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:NOOP_FUNC,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:NOOP_FUNC,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_collect_fonts:!1,record_idle_timeout_ms:18e5,record_inline_images:!1,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:ir,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},bn=!1,MixpanelLib=function(){},create_mplib=function(e,t,n){var i,s=n===pn?ln:ln[n];if(s&&0===Jr)i=s;else{if(s&&!Ir.isArray(s))return void xr.error("You have already initialized "+n);i=new MixpanelLib}if(i._cached_groups={},i._init(e,t,n),i.people=new MixpanelPeople,i.people._init(i),!i.get_config("skip_first_touch_marketing")){var a=Ir.info.campaignParams(null),c={},d=!1;Ir.each(a,(function(e,t){c["initial_"+t]=e,e&&(d=!0)})),d&&i.people.set_once(c)}return Vt.DEBUG=Vt.DEBUG||i.get_config("debug"),!Ir.isUndefined(s)&&Ir.isArray(s)&&(i._execute_array.call(i.people,s.people),i._execute_array(s)),i};MixpanelLib.prototype.init=function(e,t,n){if(Ir.isUndefined(n))this.report_error("You must name your new library: init(token, config, name)");else{if(n!==pn){var i=create_mplib(e,t,n);return ln[n]=i,i._loaded(),i}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},MixpanelLib.prototype._init=function(e,t,n){t=t||{},this.__loaded=!0,this.config={};var i={};"api_payload_format"in t||(t.api_host||vn.api_host).match(/\.mixpanel\.com/)&&(i.api_payload_format="json");if(this.set_config(Ir.extend({},vn,i,t,{name:n,token:e,callback_fn:(n===pn?n:pn+"."+n)+"._jsc"})),this._jsc=NOOP_FUNC,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests)if(Ir.localStorage.is_supported(!0)&&mn){if(this.init_batchers(),_n&&Bt.addEventListener){var s=Ir.bind((function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})}),this);Bt.addEventListener("pagehide",(function(e){e.persisted&&s()})),Bt.addEventListener("visibilitychange",(function(){"hidden"===fr.visibilityState&&s()}))}}else this._batch_requests=!1,xr.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),Ir.each(this.get_batcher_configs(),(function(e){xr.log("Clearing batch queue "+e.queue_key),Ir.localStorage.remove(e.queue_key)}));this.persistence=this.cookie=new MixpanelPersistence(this.config),this.unpersisted_superprops={},this._gdpr_init();var a=Ir.UUID();this.get_distinct_id()||this.register_once({distinct_id:fn+a,$device_id:a},"");var c=this.get_config("track_pageview");c&&this._init_url_change_tracking(c),this.get_config("record_sessions_percent")>0&&100*Math.random()<=this.get_config("record_sessions_percent")&&this.start_session_recording()},MixpanelLib.prototype.start_session_recording=addOptOutCheckMixpanelLib((function(){if(Bt.MutationObserver){var e=Ir.bind((function(){this._recorder=this._recorder||new Bt.__mp_recorder(this),this._recorder.startRecording()}),this);Ir.isUndefined(Bt.__mp_recorder)?load_extra_bundle(this.get_config("recorder_src"),e):e()}else xr.critical("Browser does not support MutationObserver; skipping session recording")})),MixpanelLib.prototype.stop_session_recording=function(){this._recorder?this._recorder.stopRecording():xr.critical("Session recorder module not loaded")},MixpanelLib.prototype.get_session_recording_properties=function(){var e={};if(this._recorder){var t=this._recorder.replayId;t&&(e.$mp_replay_id=t)}return e},MixpanelLib.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var e=Ir.info.campaignParams(null);Ir.each(e,function(e,t){this.unregister(t)}.bind(this))}},MixpanelLib.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(fr.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(Ir.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(fr.referrer)},MixpanelLib.prototype._dom_loaded=function(){Ir.each(this.__dom_loaded_queue,(function(e){this._track_dom.apply(this,e)}),this),this.has_opted_out_tracking()||Ir.each(this.__request_queue,(function(e){this._send_request.apply(this,e)}),this),delete this.__dom_loaded_queue,delete this.__request_queue},MixpanelLib.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!bn)return this.__dom_loaded_queue.push([e,t]),!1;var n=(new e).init(this);return n.track.apply(n,t)},MixpanelLib.prototype._init_url_change_tracking=function(e){var t="";if(this.track_pageview()&&(t=Ir.info.currentUrl()),Ir.include(["full-url","url-with-path-and-query-string","url-with-path"],e)){Bt.addEventListener("popstate",(function(){Bt.dispatchEvent(new Event("mp_locationchange"))})),Bt.addEventListener("hashchange",(function(){Bt.dispatchEvent(new Event("mp_locationchange"))}));var n=Bt.history.pushState;"function"==typeof n&&(Bt.history.pushState=function(e,t,i){n.call(Bt.history,e,t,i),Bt.dispatchEvent(new Event("mp_locationchange"))});var i=Bt.history.replaceState;"function"==typeof i&&(Bt.history.replaceState=function(e,t,n){i.call(Bt.history,e,t,n),Bt.dispatchEvent(new Event("mp_locationchange"))}),Bt.addEventListener("mp_locationchange",function(){var n=Ir.info.currentUrl(),i=!1;("full-url"===e?i=n!==t:"url-with-path-and-query-string"===e?i=n.split("#")[0]!==t.split("#")[0]:"url-with-path"===e&&(i=n.split("#")[0].split("?")[0]!==t.split("#")[0].split("?")[0]),i)&&(this.track_pageview()&&(t=n))}.bind(this))}},MixpanelLib.prototype._prepare_callback=function(e,t){if(Ir.isUndefined(e))return null;if(mn){return function(n){e(n,t)}}var n=this._jsc,i=""+Math.floor(1e8*Math.random()),s=this.get_config("callback_fn")+"["+i+"]";return n[i]=function(s){delete n[i],e(s,t)},s},MixpanelLib.prototype._send_request=function(e,t,n,i){var s=!0;if(gn)return this.__request_queue.push(arguments),s;var a={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},c=null;i||!Ir.isFunction(n)&&"string"!=typeof n||(i=n,n=null),n=Ir.extend(a,n||{}),mn||(n.method="GET");var d="POST"===n.method,u=_n&&d&&"sendbeacon"===n.transport.toLowerCase(),l=n.verbose;t.verbose&&(l=!0),this.get_config("test")&&(t.test=1),l&&(t.verbose=1),this.get_config("img")&&(t.img=1),mn||(i?t.callback=i:(l||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=(new Date).getTime().toString(),d&&(c="data="+encodeURIComponent(t.data),delete t.data),e+="?"+Ir.HTTPBuildQuery(t);var p=this;if("img"in t){var h=fr.createElement("img");h.src=e,fr.body.appendChild(h)}else if(u){try{s=_n(e,c)}catch(v){p.report_error(v),s=!1}try{i&&i(s?1:0)}catch(v){p.report_error(v)}}else if(mn)try{var f=new XMLHttpRequest;f.open(n.method,e,!0);var m=this.get_config("xhr_headers");if(d&&(m["Content-Type"]="application/x-www-form-urlencoded"),Ir.each(m,(function(e,t){f.setRequestHeader(t,e)})),n.timeout_ms&&void 0!==f.timeout){f.timeout=n.timeout_ms;var g=(new Date).getTime()}f.withCredentials=!0,f.onreadystatechange=function(){var e;if(4===f.readyState)if(200===f.status){if(i)if(l){var t;try{t=Ir.JSONDecode(f.responseText)}catch(v){if(p.report_error(v),!n.ignore_json_errors)return;t=f.responseText}i(t)}else i(Number(f.responseText))}else if(e=f.timeout&&!f.status&&(new Date).getTime()-g>=f.timeout?"timeout":"Bad HTTP status: "+f.status+" "+f.statusText,p.report_error(e),i)if(l){var s=f.responseHeaders||{};i({status:0,httpStatusCode:f.status,error:e,retryAfter:s["Retry-After"]})}else i(0)},f.send(c)}catch(v){p.report_error(v),s=!1}else{var _=fr.createElement("script");_.type="text/javascript",_.async=!0,_.defer=!0,_.src=e;var y=fr.getElementsByTagName("script")[0];y.parentNode.insertBefore(_,y)}return s},MixpanelLib.prototype._execute_array=function(e){var t,n=[],i=[],s=[];Ir.each(e,(function(e){e&&(t=e[0],Ir.isArray(t)?s.push(e):"function"==typeof e?e.call(this):Ir.isArray(e)&&"alias"===t?n.push(e):Ir.isArray(e)&&-1!==t.indexOf("track")&&"function"==typeof this[t]?s.push(e):i.push(e))}),this);var execute=function(e,t){Ir.each(e,(function(e){if(Ir.isArray(e[0])){var n=t;Ir.each(e,(function(e){n=n[e[0]].apply(n,e.slice(1))}))}else this[e[0]].apply(this,e.slice(1))}),t)};execute(n,this),execute(i,this),execute(s,this)},MixpanelLib.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},MixpanelLib.prototype.get_batcher_configs=function(){var e="__mpq_"+this.get_config("token"),t=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+t.track,queue_key:e+"_ev"},people:{type:"people",endpoint:"/"+t.engage,queue_key:e+"_pp"},groups:{type:"groups",endpoint:"/"+t.groups,queue_key:e+"_gr"}},this._batcher_configs},MixpanelLib.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=Ir.bind((function(e){return new RequestBatcher(e.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:Ir.bind((function(t,n,i){this._send_request(this.get_config("api_host")+e.endpoint,this._encode_data_for_request(t),n,this._prepare_callback(i,t))}),this),beforeSendHook:Ir.bind((function(t){return this._run_hook("before_send_"+e.type,t)}),this),stopAllBatchingFunc:Ir.bind(this.stop_batch_senders,this),usePersistence:!0})}),this),t=this.get_batcher_configs();this.request_batchers={events:e(t.events),people:e(t.people),groups:e(t.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},MixpanelLib.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,Ir.each(this.request_batchers,(function(e){e.start()})))},MixpanelLib.prototype.stop_batch_senders=function(){this._batch_requests=!1,Ir.each(this.request_batchers,(function(e){e.stop(),e.clear()}))},MixpanelLib.prototype.push=function(e){this._execute_array([e])},MixpanelLib.prototype.disable=function(e){void 0===e?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)},MixpanelLib.prototype._encode_data_for_request=function(e){var t=Ir.JSONEncode(e);return this.get_config("api_payload_format")===hn&&(t=Ir.base64Encode(t)),{data:t}},MixpanelLib.prototype._track_or_batch=function(e,t){var n=Ir.truncate(e.data,255),i=e.endpoint,s=e.batcher,a=e.should_send_immediately,c=e.send_request_options||{};t=t||NOOP_FUNC;var d=!0,u=Ir.bind((function(){return c.skip_hooks||(n=this._run_hook("before_send_"+e.type,n)),n?(xr.log("MIXPANEL REQUEST:"),xr.log(n),this._send_request(i,this._encode_data_for_request(n),c,this._prepare_callback(t,n))):null}),this);return this._batch_requests&&!a?s.enqueue(n,(function(e){e?t(1,n):u()})):d=u(),d&&n},MixpanelLib.prototype.track=addOptOutCheckMixpanelLib((function(e,t,n,i){i||"function"!=typeof n||(i=n,n=null);var s=(n=n||{}).transport;s&&(n.transport=s);var a=n.send_immediately;if("function"!=typeof i&&(i=NOOP_FUNC),Ir.isUndefined(e))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(e)){(t=Ir.extend({},t)).token=this.get_config("token");var c=this.persistence.remove_event_timer(e);if(!Ir.isUndefined(c)){var d=(new Date).getTime()-c;t.$duration=parseFloat((d/1e3).toFixed(3))}this._set_default_superprops();var u=this.get_config("track_marketing")?Ir.info.marketingParams():{};t=Ir.extend({},Ir.info.properties({mp_loader:this.get_config("mp_loader")}),u,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),t);var l=this.get_config("property_blacklist");Ir.isArray(l)?Ir.each(l,(function(e){delete t[e]})):this.report_error("Invalid value for property_blacklist config: "+l);var p={event:e,properties:t};return this._track_or_batch({type:"events",data:p,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:a,send_request_options:n},i)}i(0)}})),MixpanelLib.prototype.set_group=addOptOutCheckMixpanelLib((function(e,t,n){Ir.isArray(t)||(t=[t]);var i={};return i[e]=t,this.register(i),this.people.set(e,t,n)})),MixpanelLib.prototype.add_group=addOptOutCheckMixpanelLib((function(e,t,n){var i=this.get_property(e),s={};return void 0===i?(s[e]=[t],this.register(s)):-1===i.indexOf(t)&&(i.push(t),s[e]=i,this.register(s)),this.people.union(e,t,n)})),MixpanelLib.prototype.remove_group=addOptOutCheckMixpanelLib((function(e,t,n){var i=this.get_property(e);if(void 0!==i){var s=i.indexOf(t);s>-1&&(i.splice(s,1),this.register({group_key:i})),0===i.length&&this.unregister(e)}return this.people.remove(e,t,n)})),MixpanelLib.prototype.track_with_groups=addOptOutCheckMixpanelLib((function(e,t,n,i){var s=Ir.extend({},t||{});return Ir.each(n,(function(e,t){null!=e&&(s[t]=e)})),this.track(e,s,i)})),MixpanelLib.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)},MixpanelLib.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]},MixpanelLib.prototype.get_group=function(e,t){var n=this._create_map_key(e,t),i=this._cached_groups[n];return void 0!==i&&i._group_key===e&&i._group_id===t||((i=new MixpanelGroup)._init(this,e,t),this._cached_groups[n]=i),i},MixpanelLib.prototype.track_pageview=addOptOutCheckMixpanelLib((function(e,t){"object"!=typeof e&&(e={});var n=(t=t||{}).event_name||"$mp_web_page_view",i=Ir.extend(Ir.info.mpPageViewProperties(),Ir.info.campaignParams(),Ir.info.clickParams()),s=Ir.extend({},i,e);return this.track(n,s)})),MixpanelLib.prototype.track_links=function(){return this._track_dom.call(this,LinkTracker,arguments)},MixpanelLib.prototype.track_forms=function(){return this._track_dom.call(this,FormTracker,arguments)},MixpanelLib.prototype.time_event=function(e){Ir.isUndefined(e)?this.report_error("No event name provided to mixpanel.time_event"):this._event_is_disabled(e)||this.persistence.set_event_timer(e,(new Date).getTime())};var Sn={persistent:!0},options_for_register=function(e){var t;return t=Ir.isObject(e)?e:Ir.isUndefined(e)?{}:{days:e},Ir.extend({},Sn,t)};MixpanelLib.prototype.register=function(e,t){var n=options_for_register(t);n.persistent?this.persistence.register(e,n.days):Ir.extend(this.unpersisted_superprops,e)},MixpanelLib.prototype.register_once=function(e,t,n){var i=options_for_register(n);i.persistent?this.persistence.register_once(e,t,i.days):(void 0===t&&(t="None"),Ir.each(e,(function(e,n){this.unpersisted_superprops.hasOwnProperty(n)&&this.unpersisted_superprops[n]!==t||(this.unpersisted_superprops[n]=e)}),this))},MixpanelLib.prototype.unregister=function(e,t){(t=options_for_register(t)).persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]},MixpanelLib.prototype._register_single=function(e,t){var n={};n[e]=t,this.register(n)},MixpanelLib.prototype.identify=function(e,t,n,i,s,a,c,d){var u=this.get_distinct_id();if(e&&u!==e){if("string"==typeof e&&0===e.indexOf(fn))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var l=u;this.register_once({$had_persisted_distinct_id:!0,$device_id:l},"")}e!==u&&e!==this.get_property(cn)&&(this.unregister(cn),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,n,i,s,a,c,d),e!==u&&this.track("$identify",{distinct_id:e,$anon_distinct_id:u},{skip_hooks:!0})},MixpanelLib.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=Ir.UUID();this.register_once({distinct_id:fn+e,$device_id:e},"")},MixpanelLib.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},MixpanelLib.prototype.alias=function(e,t){if(e===this.get_property(an))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var n=this;return Ir.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(cn,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},(function(){n.identify(e)}))):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)},MixpanelLib.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)},MixpanelLib.prototype.set_config=function(e){Ir.isObject(e)&&(Ir.extend(this.config,e),e.batch_size&&Ir.each(this.request_batchers,(function(e){e.resetBatchSize()})),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Vt.DEBUG=Vt.DEBUG||this.get_config("debug"))},MixpanelLib.prototype.get_config=function(e){return this.config[e]},MixpanelLib.prototype._run_hook=function(e){var t=(this.config.hooks[e]||IDENTITY_FUNC).apply(this,dr.call(arguments,1));return void 0===t&&(this.report_error(e+" hook did not return a value"),t=null),t},MixpanelLib.prototype.get_property=function(e){return this.persistence.load_prop([e])},MixpanelLib.prototype.toString=function(){var e=this.get_config("name");return e!==pn&&(e=pn+"."+e),e},MixpanelLib.prototype._event_is_disabled=function(e){return Ir.isBlockedUA(_r)||this._flags.disable_all_events||Ir.include(this.__disabled_events,e)},MixpanelLib.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&Ir.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_tracking()||!this.get_config("opt_out_tracking_by_default")&&!Ir.cookie.get("mp_optout")||(Ir.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},MixpanelLib.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else{if(!e||!e.enable_persistence)return;t=!1}this.get_config("disable_persistence")||this.persistence.disabled===t||this.persistence.set_disabled(t),t?this.stop_batch_senders():this._batchers_were_started&&this.start_batch_senders()},MixpanelLib.prototype._gdpr_call_func=function(e,t){return t=Ir.extend({track:Ir.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),Ir.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})},MixpanelLib.prototype.opt_in_tracking=function(e){e=Ir.extend({enable_persistence:!0},e),this._gdpr_call_func(optIn,e),this._gdpr_update_persistence(e)},MixpanelLib.prototype.opt_out_tracking=function(e){(e=Ir.extend({clear_persistence:!0,delete_user:!0},e)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(optOut,e),this._gdpr_update_persistence(e)},MixpanelLib.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(hasOptedIn,e)},MixpanelLib.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(hasOptedOut,e)},MixpanelLib.prototype.clear_opt_in_out_tracking=function(e){e=Ir.extend({enable_persistence:!0},e),this._gdpr_call_func(clearOptInOut,e),this._gdpr_update_persistence(e)},MixpanelLib.prototype.report_error=function(e,t){xr.error.apply(xr.error,arguments);try{t||e instanceof Error||(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(n){xr.error(n)}},MixpanelLib.prototype.init=MixpanelLib.prototype.init,MixpanelLib.prototype.reset=MixpanelLib.prototype.reset,MixpanelLib.prototype.disable=MixpanelLib.prototype.disable,MixpanelLib.prototype.time_event=MixpanelLib.prototype.time_event,MixpanelLib.prototype.track=MixpanelLib.prototype.track,MixpanelLib.prototype.track_links=MixpanelLib.prototype.track_links,MixpanelLib.prototype.track_forms=MixpanelLib.prototype.track_forms,MixpanelLib.prototype.track_pageview=MixpanelLib.prototype.track_pageview,MixpanelLib.prototype.register=MixpanelLib.prototype.register,MixpanelLib.prototype.register_once=MixpanelLib.prototype.register_once,MixpanelLib.prototype.unregister=MixpanelLib.prototype.unregister,MixpanelLib.prototype.identify=MixpanelLib.prototype.identify,MixpanelLib.prototype.alias=MixpanelLib.prototype.alias,MixpanelLib.prototype.name_tag=MixpanelLib.prototype.name_tag,MixpanelLib.prototype.set_config=MixpanelLib.prototype.set_config,MixpanelLib.prototype.get_config=MixpanelLib.prototype.get_config,MixpanelLib.prototype.get_property=MixpanelLib.prototype.get_property,MixpanelLib.prototype.get_distinct_id=MixpanelLib.prototype.get_distinct_id,MixpanelLib.prototype.toString=MixpanelLib.prototype.toString,MixpanelLib.prototype.opt_out_tracking=MixpanelLib.prototype.opt_out_tracking,MixpanelLib.prototype.opt_in_tracking=MixpanelLib.prototype.opt_in_tracking,MixpanelLib.prototype.has_opted_out_tracking=MixpanelLib.prototype.has_opted_out_tracking,MixpanelLib.prototype.has_opted_in_tracking=MixpanelLib.prototype.has_opted_in_tracking,MixpanelLib.prototype.clear_opt_in_out_tracking=MixpanelLib.prototype.clear_opt_in_out_tracking,MixpanelLib.prototype.get_group=MixpanelLib.prototype.get_group,MixpanelLib.prototype.set_group=MixpanelLib.prototype.set_group,MixpanelLib.prototype.add_group=MixpanelLib.prototype.add_group,MixpanelLib.prototype.remove_group=MixpanelLib.prototype.remove_group,MixpanelLib.prototype.track_with_groups=MixpanelLib.prototype.track_with_groups,MixpanelLib.prototype.start_batch_senders=MixpanelLib.prototype.start_batch_senders,MixpanelLib.prototype.stop_batch_senders=MixpanelLib.prototype.stop_batch_senders,MixpanelLib.prototype.start_session_recording=MixpanelLib.prototype.start_session_recording,MixpanelLib.prototype.stop_session_recording=MixpanelLib.prototype.stop_session_recording,MixpanelLib.prototype.get_session_recording_properties=MixpanelLib.prototype.get_session_recording_properties,MixpanelLib.prototype.DEFAULT_API_ROUTES=yn,MixpanelPersistence.prototype.properties=MixpanelPersistence.prototype.properties,MixpanelPersistence.prototype.update_search_keyword=MixpanelPersistence.prototype.update_search_keyword,MixpanelPersistence.prototype.update_referrer_info=MixpanelPersistence.prototype.update_referrer_info,MixpanelPersistence.prototype.get_cross_subdomain=MixpanelPersistence.prototype.get_cross_subdomain,MixpanelPersistence.prototype.clear=MixpanelPersistence.prototype.clear;var kn={},override_mp_init_func=function(){ln.init=function(e,t,n){if(n)return ln[n]||(ln[n]=kn[n]=create_mplib(e,t,n),ln[n]._loaded()),ln[n];var i=ln;kn[pn]?i=kn[pn]:e&&((i=create_mplib(e,t,pn))._loaded(),kn[pn]=i),ln=i,1===Jr&&(Bt[pn]=ln),Ir.each(kn,(function(e,t){t!==pn&&(ln[t]=e)})),ln._=Ir}};var wn=function init_as_module(e){return load_extra_bundle=e,Jr=0,ln=new MixpanelLib,override_mp_init_func(),ln.init(),function(){function dom_loaded_handler(){dom_loaded_handler.done||(dom_loaded_handler.done=!0,bn=!0,gn=!1,Ir.each(kn,(function(e){e._dom_loaded()})))}if(fr.addEventListener)"complete"===fr.readyState?dom_loaded_handler():fr.addEventListener("DOMContentLoaded",dom_loaded_handler,!1);else if(fr.attachEvent){fr.attachEvent("onreadystatechange",dom_loaded_handler);var e=!1;try{e=null===Bt.frameElement}catch(t){}fr.documentElement.doScroll&&e&&function do_scroll_check(){try{fr.documentElement.doScroll("left")}catch(t){return void setTimeout(do_scroll_check,1)}dom_loaded_handler()}()}Ir.register_event(Bt,"load",dom_loaded_handler,!0)}(),ln}((function loadNoop(e,t){t()}));function isReady(){return void 0!==window.mixpanel}const In={init:function init$1(e,t=!1){return new Promise((n=>{wn.init(e,{debug:t,loaded:()=>{window.mixpanel=wn,n()}})}))},isReady:isReady,track:function track(e,t){isReady()&&wn.track(e,t)},identify:function identify$1(e,t){isReady()&&(wn.identify(e),wn.people.set(t))},attachProperty:function attachProperty(e,t){isReady()&&wn.people.union(e,[t])}},xn=["Search","View Results"];async function trackEvent(e,t,n={}){if(!In.isReady())throw new Error("Mixpanel is not initialized.");try{Ln.parseEventProps(e,t);const i=!xn.includes(e),s=await st.getFingerprint(i),a={...{"User Fingerprint":s},...t,...n};In.track(e,a)}catch(Qt){console.error(`Error tracking event '${e}':`,Qt)}}const En=_e.object({product:be});const dateValidation=e=>!(!/^\d{4}-\d{2}-\d{2}$/.test(e)&&!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(e))||!(!/^\d{4}-\d{2}-\d{2}/.test(e)||isNaN(Date.parse(e))),Cn=_e.object({"Departure Arrival":_e.string().refine(dateValidation,{message:"Invalid departure arrival datetime format. Must include at least YYYY-MM-DD"}),"Departure Destination":_e.string().min(1,"Departure Destination is required"),"Departure Destination Terminal":_e.string().min(1,"Departure Destination Terminal is required"),"Departure Line":_e.string().min(1,"Departure Line is required"),"Departure Origin":_e.string().min(1,"Departure Origin is required"),"Departure Origin Terminal":_e.string().min(1,"Departure Origin Terminal is required"),"Departure Price":_e.number().positive("Departure Price must be a positive number"),"Departure Route":_e.string().min(1,"Departure Route is required"),"Departure Stops":_e.number().int("Departure Stops must be an integer").nonnegative().optional(),"Departure Time":_e.string().refine(dateValidation,{message:"Invalid departure time datetime format. Must include at least YYYY-MM-DD"}),"Departure Transporter":_e.string().min(1,"Departure Transporter is required"),"Passenger Count":_e.number().int("Passenger Count must be an integer").positive(),"Recommended Trip":_e.boolean(),"Recommended Trip Type":_e.string().optional(),Routes:_e.number().int("Routes must be an integer").positive(),Total:_e.number().positive("Total must be a positive number"),"Trip Length":_e.number().int("Trip Length must be an integer").nonnegative().optional(),product:be});const On=_e.object({"Departure Arrival":_e.string().refine(dateValidation,{message:"Invalid departure arrival datetime format. Must include at least YYYY-MM-DD"}),"Departure Destination":_e.string().min(1,"Departure Destination is required"),"Departure Destination Terminal":_e.string().min(1,"Departure Destination Terminal is required"),"Departure Line":_e.string().min(1,"Departure Line is required"),"Departure Origin":_e.string().min(1,"Departure Origin is required"),"Departure Origin Terminal":_e.string().min(1,"Departure Origin Terminal is required"),"Departure Price":_e.number().positive("Departure Price must be a positive number"),"Departure Route":_e.string().min(1,"Departure Route is required"),"Departure Stop Cities":_e.string().optional(),"Departure Stops":_e.number().int("Departure Stops must be an integer").nonnegative().optional(),"Departure Time":_e.string().refine(dateValidation,{message:"Invalid departure time datetime format. Must include at least YYYY-MM-DD"}),"Departure Transporter":_e.string().min(1,"Departure Transporter is required"),"Passenger Count":_e.number().int("Passenger Count must be an integer").positive(),"Payment Type":_e.string().min(1,"Payment Type is required"),"Recommended Trip":_e.boolean(),"Recommended Trip Type":_e.string().optional(),Routes:_e.number().int("Routes must be an integer").positive(),Total:_e.number().positive("Total must be a positive number"),product:be}),Tn=_e.object({Arrival:_e.string().refine(dateValidation,{message:"Invalid arrival datetime format"}),Departure:_e.string().refine(dateValidation,{message:"Invalid departure datetime format"}),Destination:_e.string().min(1,"Destination is required"),"Destination Terminal":_e.string().min(1,"Destination terminal is required"),Line:_e.string().min(1,"Line is required").optional(),Origin:_e.string().min(1,"Origin is required"),"Origin Terminal":_e.string().min(1,"Origin terminal is required"),Price:_e.number().positive("Price must be a positive number"),"Result Position":_e.number().int("Result Position must be an integer"),Route:_e.string().min(1,"Route is required"),Stops:_e.number().int("Stops must be an integer").nonnegative("Stops must be non-negative"),"Transport Type":_e.string().min(1,"Transport Type is required"),Transporter:_e.string().min(1,"Transporter is required"),product:be,"Recommended Trip":_e.boolean(),"Recommended Trip Type":_e.string().optional()});const Rn=_e.object({"Departure Arrival":_e.string().refine(dateValidation,{message:"Invalid departure arrival datetime format"}),"Departure Destination":_e.string().refine((e=>e),{message:"Departure Destination must be a string"}),"Departure Destination Terminal":_e.string().refine((e=>e),{message:"Departure Destination Terminal must be a string"}),"Departure Line":_e.string().refine((e=>e),{message:"Departure Line must be a string"}),"Departure Origin":_e.string().refine((e=>e),{message:"Departure Origin must be a string"}),"Departure Origin Terminal":_e.string().refine((e=>e),{message:"Departure Origin Terminal must be a string"}),"Departure Price":_e.number().refine((e=>e),{message:"Departure Price must be a number"}),"Departure Route":_e.string().refine((e=>e),{message:"Departure Route must be a string"}),"Departure Stops":_e.number().int().refine((e=>e),{message:"Departure Stops must be an integer"}),"Departure Time":_e.string().refine(dateValidation,{message:"Invalid departure time datetime format"}),"Departure Transport Type":_e.string().refine((e=>e),{message:"Departure Transport Type must be a string"}),"Departure Transporter":_e.string().refine((e=>e),{message:"Departure Transporter must be a string"}),"Passenger Count":_e.number().int().refine((e=>e),{message:"Passenger Count must be an integer"}),"Recommended Trip":_e.boolean(),"Recommended Trip Type":_e.string().optional(),Routes:_e.number().int().refine((e=>e),{message:"Routes must be an integer"}),Total:_e.number().refine((e=>e),{message:"Total must be a number"}),product:be,"Trip Length":_e.number().int().optional()}).strict();const Mn=_e.object({Departure:_e.string().refine(dateValidation,{message:"Invalid departure date or datetime format. Must include at least YYYY-MM-DD"}),"Departure Delta":_e.number().int("Departure Delta must be an integer"),Destination:_e.string().min(1,"Destination is required"),"Destination Terminal":_e.string().min(1,"Destination terminal is required"),Origin:_e.string().min(1,"Origin is required"),"Origin Terminal":_e.string().min(1,"Origin terminal is required"),Passengers:_e.number().int("Passenger count must be an integer"),Return:_e.string().refine(dateValidation,{message:"Invalid Return date or datetime format. Must include at least YYYY-MM-DD"}).optional(),Route:_e.string().min(1,"Route is required"),"Trip Length":_e.number().positive().optional(),product:be});const Nn=_e.object({Arrival:_e.string().refine(dateValidation,{message:"Invalid arrival date or datetime format. Must include at least YYYY-MM-DD"}),Departure:_e.string().refine(dateValidation,{message:"Invalid departure date or datetime format. Must include at least YYYY-MM-DD"}),Destination:_e.string().min(1,"Destination is required"),"Destination Terminal":_e.string().min(1,"Destination Terminal is required"),Line:_e.string().min(1,"Line is required").optional(),Origin:_e.string().min(1,"Origin is required"),"Origin Terminal":_e.string().min(1,"Origin Terminal is required"),Price:_e.number().positive("Price must be a positive number"),Route:_e.string().min(1,"Route is required"),Stops:_e.number().int("Stops must be an integer").nonnegative().optional(),Tickets:_e.number().int("Tickets must be an integer").positive(),Transporter:_e.string().min(1,"Transporter is required"),Way:_e.enum(["Departure","Return"],{description:"Way must be either 'Departure' or 'Return'"}),product:be});const Dn=_e.object({"Bus count":_e.number().int("Bus count must be an integer"),Departure:_e.string().refine(dateValidation,{message:"Invalid departure datetime format"}),"Departure Delta":_e.number().int("Departure Delta must be an integer").optional(),Destination:_e.string().min(1,"Destination is required").optional(),"Destination Terminal":_e.string().min(1,"Destination terminal is required").optional(),"Has Frequent Buses":_e.boolean().default(!1).optional(),Origin:_e.string().min(1,"Origin is required"),"Origin Terminal":_e.string().min(1,"Origin terminal is required"),Route:_e.string().min(1,"Route is required"),product:be}),Zn=_e.object({}),Pn=_e.object({mixpanelToken:_e.string().min(1,"Mixpanel token is required"),debug:_e.boolean().optional(),identificationKey:_e.string().min(1,"Identification key is required")}),SchemaErrorFormatter=e=>e.issues.map((e=>{let t="INVALID_FIELD",n="",i="",s="";return"invalid_type"===e.code?(t="TYPE_MISMATCH",n=e.expected,i=e.received,s=`Expected ${n} but received ${i}. Please provide a value of type ${n}.`):"too_small"===e.code?(t="VALUE_TOO_SMALL",s=`Increase the value to at least ${e.minimum}.`):"too_big"===e.code?(t="VALUE_TOO_BIG",s=`Reduce the value to no more than ${e.maximum}.`):(t="INVALID_FIELD",s="Ensure the field matches the expected format and value type."),{field:e.path.join("."),error_type:t,expected:n,received:i,message:e.message,suggestion:s}})),An={"Track Test":Zn,Search:Mn,"Seat Change":Nn,"Interest In Home":Se,"Passengers Created":Cn,"Payment Attempt":On,"Interest In Search":En,"View Results":Dn,"Purchase Attempt":Rn,"Picked Departure":Tn};function validateProps(e,t){try{t.parse(e)}catch(Qt){if(Qt instanceof ZodError){throw{message:"Schema validation failed",errors:SchemaErrorFormatter(Qt)}}throw{message:"Unknown validation error"}}}const Ln={parseEventProps:function parseEventProps(e,t){const n=An[e];if(!n)throw{message:`Event ${e} not found`};try{n.parse(t)}catch(Qt){if(Qt instanceof ZodError){throw{message:"Schema validation failed",errors:SchemaErrorFormatter(Qt)}}throw{message:"Unknown validation error"}}},parseInitProps:function parseInitProps(e){validateProps(e,Pn)},parseIdentifyProps:function parseIdentifyProps(e){validateProps(e,ye)}},jn=["firstName","lastName","email","phone"];const Fn={init:async function init(e){Ln.parseInitProps(e);const{mixpanelToken:t,debug:n=!1,identificationKey:i}=e;await In.init(t,n);try{await st.initFingerprint(i)}catch(Qt){console.error("Error initializing identification service:",Qt)}!function onLoaded(){window.dispatchEvent(new CustomEvent("Tracker Ready"))}()},identify:async function identify(e,t={}){if(In.isReady())try{if(Ln.parseIdentifyProps(t),!e)return void console.error("User ID is required for identification.");const n=function mapProperties(e){return{$first_name:null==e?void 0:e.firstName,$last_name:null==e?void 0:e.lastName,$email:null==e?void 0:e.email,$phone:null==e?void 0:e.phone,...Object.keys(e).reduce(((t,n)=>(jn.includes(n)||(t[n]=e[n]),t)),{})}}(t);In.identify(e,n);const i=await st.getFingerprint();i&&In.attachProperty("Known Fingerprints",i)}catch(Qt){console.error("Error identifying user",Qt)}else console.error("Mixpanel is not initialized.")},track:{test:function trackTest(){trackEvent("Track Test",{})},search:function trackSearch(e,t={}){trackEvent("Search",e,t)},seatChange:function trackSeatChange(e,t={}){trackEvent("Seat Change",e,t)},interestInHome:function trackInterestInHome(e,t={}){trackEvent("Interest In Home",e,t)},interestInSearch:function trackInterestInSearch(e,t={}){trackEvent("Interest In Search",e,t)},viewResults:function trackViewResults(e,t={}){trackEvent("View Results",e,t)},passengersCreated:function trackPassengersCreated(e,t={}){trackEvent("Passengers Created",e,t)},paymentAttempt:async e=>{trackEvent("Payment Attempt",e)},purchaseAttempt:function trackPurchaseAttempt(e,t={}){trackEvent("Purchase Attempt",e,t)},pickedDeparture:function trackSearch$1(e,t={}){trackEvent("Picked Departure",e,t)}}};module.exports=Fn;