1import {a8 as s,z as ze,X as Xe,j as o,F,x,T as Te,w,v as v$1,a9 as R,aa as T,ab as f,n as S}from'./main-GIRCTQC7.js';import {a}from'./chunk-BtVpm8fA.js';import {t}from'./chunk-DL4kne7o.js';import {b as bt,d as dt}from'./chunk-CNi7LXg9.js';import'./chunk-BzaEwoyK.js';var h=class{constructor(e,t,r,s,i){this.n=e,this.s=t,this.e=r,this.o=s,this.t=i;}};function L(u){switch(u){case "keydown":case "keyup":case "keypress":return "typing";case "mousemove":case "mouseenter":case "mouseleave":case "mouseover":case "mouseout":return "mousing";case "touchstart":case "touchmove":case "touchend":case "touchcancel":case "touchenter":case "touchleave":return "touching";case "scroll":case "scrollend":return "scrolling";default:return u}}var N={global:{mouseup:true,mousedown:true},window:{load:true,pagehide:true},xhrOriginMissing:{ignoreAll:true}},c={typing:"typing",scrolling:"scrolling",mousing:"mousing",touching:"touching"},U={[c.typing]:1e3,[c.scrolling]:100,[c.mousing]:1e3,[c.touching]:1e3},B={[c.typing]:2e3,[c.scrolling]:1e3,[c.mousing]:2e3,[c.touching]:2e3},v=class{prevStoredEvents=new Set;constructor(e){this.parent=e;}#i(e){return e.n in c}#r(e){let t=s=>!(s.o!==e.o||s.n!==e.n||e.s-s.s<B[e.o]||s.e>e.s-U[e.o]),r={e:e.e};return this.parent.events.merge(t,r)}#s(e){if(e.n in N.global)return true;let t=e.o;return N[t]?.ignoreAll||N[t]?.[e.n]?true:t==="xhrOriginMissing"&&e.n==="Ajax"}#t(){if(this.parent.blocked)return false;if(this.parent.events.length>=R){if(this.parent.mode!==Xe.ERROR)return false;this.trimSTNsByTime(),this.parent.events.length>=R&&this.trimSTNsByIndex(1);}return true}#e(e){return this.#s(e)||!this.#t()?false:((!this.#i(e)||!this.#r(e))&&this.parent.events.add(e),true)}storeNode(e){return this.#e(e)}processPVT(e,t,r){return this.storeTiming({[e]:t})}storeTiming(e,t=false){if(!e)return false;let r=true;for(let s in e){let i=e[s],o=s.toLowerCase();o.indexOf("size")>=0||o.indexOf("status")>=0||typeof i=="number"&&i>=0&&(i=Math.round(i),t&&this.parent.timeKeeper?.ready&&(i=this.parent.timeKeeper.convertAbsoluteTimestamp(Math.floor(this.parent.timeKeeper.correctAbsoluteTimestamp(i)))),this.#e(new h(s,i,i,"document","timing"))||(r=false));}return r}storeEvent(e,t,r,s){if(this.prevStoredEvents.has(e)||!this.#t())return false;this.prevStoredEvents.add(e);let i=new h(L(e.type),r,s,void 0,"event");try{i.o=a(e.target,t,this.parent.ee);}catch(o){i.o=a(null,t,this.parent.ee);}return this.#e(i)}storeHist(e,t,r){return this.#e(new h("history.pushState",r,r,e,t))}storeResources(e){if(!e||e.length===0)return false;let t=true;for(let r=0;r<e.length;r++){let s=e[r];if(!this.#t())break;let{initiatorType:i,fetchStart:o,responseEnd:g,entryType:R}=s,{protocol:m,hostname:l,port:H,pathname:I}=T(s.name),_=new h(i,o|0,g|0,"".concat(m,"://").concat(l,":").concat(H).concat(I),R);this.#e(_)||(t=false);}return t}storeErrorAgg(e,t,r,s){return e!=="err"?false:this.#e(new h("error",s.time,s.time,r.message,r.stackHash))}storeXhrAgg(e,t,r,s){return e!=="xhr"?false:this.#e(new h("Ajax",s.time,s.time+s.duration,"".concat(r.status," ").concat(r.method,": ").concat(r.host).concat(r.pathname),"ajax"))}trimSTNsByTime(e=f){this.parent.events.clear({clearBeforeTime:Math.max(S-e,0),timestampKey:"e"});}trimSTNsByIndex(e=0){this.parent.events.clear({clearBeforeIndex:e});}clear(){this.prevStoredEvents.clear();}};var D=5e3,ne=(()=>{class u extends bt{static featureName=s;constructor(t){super(t,s),this.harvestOpts.raw=true,this.entitled=void 0,this.everHarvested=false,this.harvesting=false,this.traceStorage=new v(this),this.waitForFlags(["sts","st"]).then(([r,s])=>
1this.initialize(r,s));}initialize(t,r,s){if(this.entitled??=r,this.entitled||(this.blocked=true),this.blocked)return this.deregisterDrain();if(this.timeKeeper??=this.agentRef.runtime.timeKeeper,this.initialized||(this.initialized=true,this.ptid=this.agentRef.runtime.ptid,this.sessionId=this.agentRef.runtime.session?.state.value,this.ee.on(ze.RESET,()=>{this.blocked||this.abort(1);}),this.ee.on(ze.UPDATE,(i,o)=>{this.blocked||(this.mode!==Xe.FULL&&(o.sessionReplayMode===Xe.FULL||o.sessionTraceMode===Xe.FULL)&&this.switchToFull(),(this.sessionId!==o.value||i==="cross-tab"&&o.sessionTraceMode===Xe.OFF)&&this.abort(2));}),typeof PerformanceNavigationTiming<"u"&&o.performance?.getEntriesByType("navigation")?.length>0?this.traceStorage.storeTiming(o.performance.getEntriesByType("navigation")[0]):this.traceStorage.storeTiming(o.performance?.timing,true)),!this.agentRef.runtime.session.isNew&&!s?this.mode=this.agentRef.runtime.session.state.sessionTraceMode:this.mode=t,this.mode===Xe.OFF)return this.deregisterDrain();F("bst",(...i)=>this.traceStorage.storeEvent(...i),this.featureName,this.ee),F("bstResource",(...i)=>this.traceStorage.storeResources(...i),this.featureName,this.ee),F("bstHist",(...i)=>this.traceStorage.storeHist(...i),this.featureName,this.ee),F("bstXhrAgg",(...i)=>this.traceStorage.storeXhrAgg(...i),this.featureName,this.ee),F("bstApi",(...i)=>this.traceStorage.storeNode(...i),this.featureName,this.ee),F("trace-jserror",(...i)=>this.traceStorage.storeErrorAgg(...i),this.featureName,this.ee),F("pvtAdded",(...i)=>this.traceStorage.processPVT(...i),this.featureName,this.ee),this.mode!==Xe.FULL&&F("trace-jserror",()=>{this.mode===Xe.ERROR&&this.switchToFull();},this.featureName,this.ee),this.agentRef.runtime.session.write({sessionTraceMode:this.mode}),this.drain();}preHarvestChecks(){if(!(this.blocked||this.mode!==Xe.FULL)&&this.timeKeeper?.ready&&this.agentRef.runtime.session){if(this.sessionId!==this.agentRef.runtime.session.state.value||this.ptid!==this.agentRef.runtime.ptid){this.abort(3);return}return true}}serializer(t$1){if(t$1.length)return this.everHarvested=true,t(t$1,this.obfuscator.obfuscateString.bind(this.obfuscator),"string")}queryStringsBuilder(t){let r=!this.agentRef.runtime.session.state.traceHarvestStarted;r&&this.agentRef.runtime.session.write({traceHarvestStarted:true});let s=this.agentRef.runtime.session.state.sessionReplayMode===1,i=this.agentRef.info.jsAttributes["enduser.id"],o=this.agentRef.runtime.appMetadata.agents?.[0]?.entityGuid,g=t.reduce((m,l)=>Math.min(m,l.s),1/0),R=t.reduce((m,l)=>Math.max(m,l.s),-1/0);return {browser_monitoring_key:this.agentRef.info.licenseKey,type:"BrowserSessionChunk",app_id:this.agentRef.info.applicationID,protocol_version:"0",timestamp:Math.floor(this.timeKeeper.correctRelativeTimestamp(g)),attributes:dt(x(w(x(w(w(x(w({},o&&{entityGuid:o}),{harvestId:"".concat(this.agentRef.runtime.session.state.value,"_").concat(this.agentRef.runtime.ptid,"_").concat(this.agentRef.runtime.harvestCount),"trace.firstTimestamp":Math.floor(this.timeKeeper.correctRelativeTimestamp(g)),"trace.lastTimestamp":Math.floor(this.timeKeeper.correctRelativeTimestamp(R)),"trace.nodes":t.length,"trace.originTimestamp":this.timeKeeper.correctedOriginTime,agentVersion:this.agentRef.runtime.version}),r&&{firstSessionHarvest:r}),s&&{hasReplay:s}),{ptid:"".concat(this.ptid),session:"".concat(this.sessionId)}),i&&{"enduser.id":this.obfuscator.obfuscateString(i)}),{currentUrl:this.obfuscator.obfuscateString(Te(""+location))}),D).substring(1)}}switchToFull(){if(this.mode===Xe.FULL||!this.entitled||this.blocked)return;let t=this.mode;if(this.mode=Xe.FULL,this.agentRef.runtime.session.write({sessionTraceMode:this.mode}),t===Xe.OFF||!this.initialized)return this.initialize(this.mode,this.entitled);this.initialized&&(this.traceStorage.trimSTNsByTime(),this.agentRef.runtime.harvester.triggerHarvestFor(this));}abort(t){v$1(60,t),this.blocked=true,this.mode=Xe.OFF,this.agentRef.runtime.session.write({sessionTraceMode:this.mode}),this.events.clear();}postHarvestCleanup(t){this.traceStorage.clear(),super.postHarvestCleanup(t);}}return u})(); 2export{ne as Aggregate};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.