1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/recorder-Bb3myeBK.js","assets/stringify-Ld9O3j-q.js","assets/instrument-base-DXJzuvQL.js","assets/vendor-i18n-B6HYivoC.js","assets/vendor-framework-CobW1Mgl.js","assets/browser-agent-0xeT1dBs.js","assets/configure-CX0xSG8t.js","assets/constants-DRmf5Urr.js","assets/index-Br73PI4v.js","assets/constants-CzW6GYBR.js","assets/index-CQR1pb2S.js","assets/wrap-events-CtM99SMr.js","assets/deny-list-CI4EWlrg.js","assets/aggregate-base-BFvJAToj.js","assets/stylesheet-evaluator-YOcrZZLe.js"])))=>i.map(i=>d[i]); 2var I=Object.defineProperty;var L=(c,m,e)=>m in c?I(c,m,{enumerable:!0,configurable:!0,writable:!0,value:e}):c[m]=e;var M=(c,m,e)=>L(c,typeof m!="symbol"?m+"":m,e);import{_ as A}from"./vendor-i18n-B6HYivoC.js";import{K as z,a4 as v,j as B,au as O,w,n as P}from"./instrument-base-DXJzuvQL.js";import{e as N,A as f,S as C,T as D,R as _,Q as K}from"./browser-agent-0xeT1dBs.js";import{A as W,M as V,o as H,c as G}from"./aggregate-base-BFvJAToj.js";import{R as Y}from"./configure-CX0xSG8t.js";import{M as o,S as R,b as j,a as U}from"./stringify-Ld9O3j-q.js";import{s as x}from"./stylesheet-evaluator-YOcrZZLe.js";import"./vendor-framework-CobW1Mgl.js";import"./index-Br73PI4v.js";import"./constants-DRmf5Urr.js";import"./constants-CzW6GYBR.js";import"./index-CQR1pb2S.js";import"./wrap-events-CtM99SMr.js";import"./deny-list-CI4EWlrg.js";let k;const Q=new Promise(c=>{k=c}),q=Object.freeze({onReplayReady:k,sessionReplayInitialized:Q});class J extends W{constructor(e,t){super(e,N);M(this,"mode",o.OFF);this.initialized=!1,this.blocked=!1,this.gzipper=void 0,this.u8=void 0,this.entitled=!1,this.timeKeeper=void 0,this.recorder=t==null?void 0:t.recorder,this.errorNoticed=(t==null?void 0:t.errorNoticed)||!1,this.harvestOpts.raw=!0,this.isSessionTrackingEnabled=z(e.init)&&!!e.runtime.session,this.reportSupportabilityMetric("Config/SessionReplay/Enabled"),this.ee.on(R.RESET,()=>{this.abort(f.RESET)}),this.ee.on(R.PAUSE,()=>{var a;(a=this.recorder)==null||a.stopRecording()}),this.ee.on(R.RESUME,()=>{var a;this.recorder&&(this.mode=e.runtime.session.state.sessionReplayMode,!(!this.initialized||this.mode===o.OFF)&&((a=this.recorder)==null||a.startRecording()))}),this.ee.on(R.UPDATE,(a,d)=>{!this.recorder||!this.initialized||this.blocked||a!==j.CROSS_TAB||(this.mode!==o.OFF&&d.sessionReplayMode===o.OFF&&this.abort(f.CROSS_TAB),this.mode=d.sessionReplayMode)}),v(C.PAUSE,()=>{this.forceStop(this.mode===o.FULL)},this.featureName,this.ee),v(C.ERROR_DURING_REPLAY,a=>{this.handleError(a)},this.featureName,this.ee);const{error_sampling_rate:i,sampling_rate:r,autoStart:n,block_selector:p,mask_text_selector:l,mask_all_inputs:s,inline_images:h,collect_fonts:g}=e.init.session_replay;this.waitForFlags(["srs","sr"]).then(([a,d])=>{if(this.entitled=!!d,!this.entitled){this.deregisterDrain(),this.agentRef.runtime.isRecording&&(this.abort(f.ENTITLEMENTS),this.reportSupportabilityMetric("SessionReplay/EnabledNotEntitled/Detected"));return}this.drain(),this.initializeRecording(a)}).then(()=>{var a,d,u,y;if(this.mode===o.OFF)for((a=this.recorder)==null||a.stopRecording();(d=this.recorder)!=null&&d.getEvents().events.length;)(y=(u=this.recorder)==null?void 0:u.clearBuffer)==null||y.call(u);q.onReplayReady(this.mode)}),n||this.reportSupportabilityMetric("Config/SessionReplay/AutoStart/Modified"),g===!0&&this.reportSupportabilityMetric("Config/SessionReplay/CollectFonts/Modified"),h===!0&&this.reportSupportabilityMetric("Config/SessionReplay/InlineImages/Modifed"),s!==!0&&this.reportSupportabilityMetric("Config/SessionReplay/MaskAllInputs/Modified"),p!=="[data-nr-block]"&&this.reportSupportabilityMetric("Config/SessionReplay/BlockSelector/Modified"),l!=="*"&&this.reportSupportabilityMetric("Config/SessionReplay/MaskTextSelector/Modified"),this.reportSupportabilityMetric("Config/SessionReplay/SamplingRate/Value",r),this.reportSupportabilityMetric("Config/SessionReplay/ErrorSamplingRate/Value",i)}replayIsActive(){return!!(this.recorder&&this.mode===o.FULL&&!this.blocked&&this.entitled)}handleError(e){var t;this.recorder&&(this.recorder.currentBufferTarget.hasError=!0),this.mode===o.ERROR&&((t=B)==null?void 0:t.document.visibilityState)==="visible"&&this.switchToFull()}switchToFull(){!this.entitled||this.blocked||(this.mode=o.FULL,this.recorder&&this.initialized?(this.agentRef.runtime.isRecording||this.recorder.startRecording(),this.syncWithSessionManager({sessionReplayMode:this.mode}
2)):this.initializeRecording(o.FULL,!0))}async initializeRecording(e,t){var n,p;if(this.initialized=!0,!this.entitled)return;const{session:i,timeKeeper:r}=this.agentRef.runtime;if(this.timeKeeper=r,((n=this.recorder)==null?void 0:n.parent.trigger)===D.API&&this.agentRef.runtime.isRecording?this.mode=o.FULL:!i.isNew&&!t?this.mode=i.state.sessionReplayMode:this.mode=e,this.mode!==o.OFF){if(this.recorder)this.recorder.parent=this;else try{const{Recorder:l}=await A(async()=>{const{Recorder:s}=await import("./recorder-Bb3myeBK.js");return{Recorder:s}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]));this.recorder=new l(this),this.recorder.currentBufferTarget.hasError=this.errorNoticed}catch{return this.abort(f.IMPORT)}this.mode===o.ERROR&&this.errorNoticed&&(this.mode=o.FULL),this.mode===o.FULL&&((p=this.recorder)==null?void 0:p.getEvents().type)==="preloaded"&&this.prepUtils().then(()=>this.agentRef.runtime.harvester.triggerHarvestFor(this)),await this.prepUtils(),this.agentRef.runtime.isRecording||this.recorder.startRecording(),this.syncWithSessionManager({sessionReplayMode:this.mode})}}async prepUtils(){try{const{gzipSync:e,strToU8:t}=await A(async()=>{const{gzipSync:i,strToU8:r}=await import("./browser-B3O2tql6.js");return{gzipSync:i,strToU8:r}},[]);this.gzipper=e,this.u8=t}catch{}}makeHarvestPayload(e){var p;const t={targetApp:void 0,payload:void 0};if(this.mode!==o.FULL||this.blocked||!this.recorder||!((p=this.timeKeeper)!=null&&p.ready)||!this.recorder.hasSeenSnapshot)return;const i=this.recorder.getEvents();if(!i.events.length)return;const r=this.getHarvestContents(i);if(!r.body.length)return this.recorder.clearBuffer(),[t];this.reportSupportabilityMetric("SessionReplay/Harvest/Attempts");let n=0;return this.gzipper&&this.u8?(r.body=this.gzipper(this.u8("[".concat(r.body.map(({__serialized:l,...s})=>{if(s.__newrelic&&l)return l;const h={...s};return h.__newrelic||(h.__newrelic=O(s.timestamp,this.timeKeeper),h.timestamp=this.timeKeeper.correctAbsoluteTimestamp(s.timestamp)),U(h)}).join(","),"]"))),n=r.body.length):(r.body=r.body.map(({__serialized:l,...s})=>{if(s.__newrelic)return s;const h={...s};return h.__newrelic=O(s.timestamp,this.timeKeeper),h.timestamp=this.timeKeeper.correctAbsoluteTimestamp(s.timestamp),h}),n=U(r.body).length),n>V?(this.abort(f.TOO_BIG,n),[t]):(this.agentRef.runtime.session.state.sessionReplaySentFirstChunk||this.syncWithSessionManager({sessionReplaySentFirstChunk:!0}),this.recorder.clearBuffer(),i.type==="preloaded"&&this.agentRef.runtime.harvester.triggerHarvestFor(this),t.payload=r,this.agentRef.runtime.session.state.traceHarvestStarted||w(59,JSON.stringify(this.agentRef.runtime.session.state)),[t])}getCorrectedTimestamp(e){if(e!=null&&e.timestamp)return e.__newrelic?e.timestamp:this.timeKeeper.correctAbsoluteTimestamp(e.timestamp)}getHarvestContents(e){var u,y,b,E,T,F;e??(e=this.recorder.getEvents());let t=e.events;const i=this.agentRef.runtime,r=(u=this.agentRef.info.jsAttributes)==null?void 0:u["enduser.id"];((y=t==null?void 0:t[0])==null?void 0:y.type)===_.FullSnapshot&&this.recorder.lastMeta&&(e.hasMeta=!0,t.unshift(this.recorder.lastMeta),this.recorder.lastMeta=void 0),((b=t[t.length-1])==null?void 0:b.type)===_.Meta&&(this.recorder.lastMeta=t[t.length-1],t=t.slice(0,t.length-1),e.hasMeta=!!t.find(S=>S.type===_.Meta));const l=P(),s=this.getCorrectedTimestamp(t[0]),h=this.getCorrectedTimestamp(t[t.length-1]),g=s||Math.floor(this.timeKeeper.correctAbsoluteTimestamp(e.cycleTimestamp)),a=h||Math.floor(this.timeKeeper.correctRelativeTimestamp(l)),d=((T=(E=i.appMetadata)==null?void 0:E.agents)==null?void 0:T[0])||{};return{qs:{browser_monitoring_key:this.agentRef.info.licenseKey,type:"SessionReplay",app_id:this.agentRef.info.applicationID,protocol_version:"0",timestamp:g,attributes:H({...!!this.gzipper&&!!this.u8&&{content_encoding:"gzip"},...d.entityGuid&&{entityGuid:d.entityGuid},harvestId:[(F=i.session)==null?void 0:F.state.value,i.ptid,i.harvestCount].filter(S=>S).join("_"),"replay.firstTimestamp":g,"replay.lastTimestamp":a,"replay.nodes":t.length,"session.durationMs":i.session.getDuration(),agentVersion:i.version,session:i.session.state.value,rst:l,hasMeta:e.hasMeta||!1,hasSnapshot:e.hasSnapshot||!1,hasError:e.hasError||!1,isFirstChunk:i.session.state.sessionReplaySentFirstChunk===!1,decompressedBytes:e.payloadBytesEstimation,invalidStylesheetsDetected:x.invalidStylesheetsDetected,inlinedAllStylesheets:e.inlinedAllStylesheets,"rrweb.version":Y,"payload.type":e.type,...r&&{"enduser.id":this.obfuscator.obfuscateString(r)},currentUrl:this.obfuscator.obfuscateString(G(""+location))},K).substring(1)},body:t}}postHarvestCleanup(e){e.status===429&&this.abort(f.TOO_MANY)}forceStop(e){var t,i;e&&this.agentRef.runtime.harvester.triggerHarvestFor(this),this.mode=o.OFF,(i=(t=this.recorder)==null?void 0:t.stopRecording)==null||i.call(t),this.syncWithSessionManager({sessionReplayMode:this.mode})}abort(e={}
vendor: 607 bytes, line 2
2,t){var i,r,n,p,l,s,h;for(w(33,e.message),this.reportSupportabilityMetric("SessionReplay/Abort/".concat(e.sm),t),this.blocked=!0,this.mode=o.OFF,(r=(i=this.recorder)==null?void 0:i.stopRecording)==null||r.call(i),this.syncWithSessionManager({sessionReplayMode:this.mode}),(p=(n=this.recorder)==null?void 0:n.clearTimestamps)==null||p.call(n);(l=this.recorder)!=null&&l.getEvents().events.length;)(h=(s=this.recorder)==null?void 0:s.clearBuffer)==null||h.call(s)}syncWithSessionManager(e={}){this.isSessionTrackingEnabled&&this.agentRef.runtime.session.write(e)}}M(J,"featureName",N);export{J 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.