PageSourceSearch

https://www.swiss-arc.ch/user/edit/assets/index.5dc63891.js

js swiss-arc.ch collected 2026-10-09 22:42:17 UTC 8,908 bytes, 1 lines download raw bytes

1var N=Object.defineProperty;var w=(p,e,t)=>e in p?N(p,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[e]=t;var E=(p,e,t)=>(w(p,typeof e!="symbol"?e+"":e,t),t);import{z as T,M as i,j as n,F as a,U as h,bO as R,ce as u,bP as C,bS as b,S as M,b as I,T as U,_ as F,bW as A,l as v,bV as _,n as L,cf as P,w as z,bX as k}from"./index.3ec72d2e.js";import{H as B}from"./harvest-scheduler.67ce376d.js";import{A as D,o as H,c as W}from"./aggregate-base.0695104a.js";import{s as K}from"./stylesheet-evaluator.5aa20270.js";import{M as V}from"./agent-constants.7157acc7.js";import"./shared-context.ae8b129f.js";import"./page-visibility.2f62fa7f.js";import"./info.d5329f52.js";import"./configure.2bbcfbcf.js";let O;const Y=new Promise(p=>{O=p}),G=Object.freeze({onReplayReady:O,sessionReplayInitialized:Y});class j extends D{mode=i.OFF;constructor(e,t){super(e,T),this.harvestTimeSeconds=e.init.session_replay.harvestTimeSeconds||60,this.initialized=!1,this.blocked=!1,this.gzipper=void 0,this.u8=void 0,this.entitled=!1,this.timeKeeper=void 0,this.recorder=t?.recorder,this.errorNoticed=t?.errorNoticed||!1,n(h,["Config/SessionReplay/Enabled"],void 0,a.metrics,this.ee),this.ee.on("cfc.".concat(a.jserrors),c=>{c.hasReplay=!!(this.scheduler?.started&&this.recorder&&this.mode===i.FULL&&!this.blocked&&this.entitled)}),this.ee.on(R.RESET,()=>{this.abort(u.RESET)}),this.ee.on(R.PAUSE,()=>{this.recorder?.stopRecording()}),this.ee.on(R.RESUME,()=>{!this.recorder||(this.mode=e.runtime.session.state.sessionReplayMode,!(!this.initialized||this.mode===i.OFF)&&this.recorder?.startRecording())}),this.ee.on(R.UPDATE,(c,m)=>{!this.recorder||!this.initialized||this.blocked||c!==C.CROSS_TAB||(this.mode!==i.OFF&&m.sessionReplayMode===i.OFF&&this.abort(u.CROSS_TAB),this.mode=m.sessionReplay)}),this.scheduler=new B("browser/blobs",{onFinished:this.onHarvestFinished.bind(this),retryDelay:this.harvestTimeSeconds,getPayload:this.prepareHarvest.bind(this),raw:!0},this),b(M.PAUSE,()=>{this.forceStop(this.mode!==i.ERROR)},this.featureName,this.ee),b(M.ERROR_DURING_REPLAY,c=>{this.handleError(c)},this.featureName,this.ee);const{error_sampling_rate:s,sampling_rate:d,autoStart:l,block_selector:r,mask_text_selector:o,mask_all_inputs:g,inline_images:y,collect_fonts:f}=e.init.session_replay;this.waitForFlags(["srs","sr"]).then(([c,m])=>{if(this.entitled=!!m,!this.entitled){this.deregisterDrain(),this.recorder?.recording&&(this.abort(u.ENTITLEMENTS),n(h,["SessionReplay/EnabledNotEntitled/Detected"],void 0,a.metrics,this.ee));return}this.drain(),this.initializeRecording(c)}).then(()=>{if(this.mode===i.OFF)for(this.recorder?.stopRecording();this.recorder?.getEvents().events.length;)this.recorder?.clearBuffer?.();G.onReplayReady(this.mode)}),l||n(h,["Config/SessionReplay/AutoStart/Modified"],void 0,a.metrics,this.ee),f===!0&&n(h,["Config/SessionReplay/CollectFonts/Modified"],void 0,a.metrics,this.ee),y===!0&&n(h,["Config/SessionReplay/InlineImages/Modifed"],void 0,a.metrics,this.ee),g!==!0&&n(h,["Config/SessionReplay/MaskAllInputs/Modified"],void 0,a.metrics,this.ee),r!=="[data-nr-block]"&&n(h,["Config/SessionReplay/BlockSelector/Modified"],void 0,a.metrics,this.ee),o!=="*"&&n(h,["Config/SessionReplay/MaskTextSelector/Modified"],void 0,a.metrics,this.ee),n(h,["Config/SessionReplay/SamplingRate/Value",d],void 0,a.metrics,this.ee),n(h,["Config/SessionReplay/ErrorSamplingRate/Value",s],void 0,a.metrics,this.ee)}handleError(e){this.recorder&&(this.recorder.currentBufferTarget.hasError=!0),this.mode===i.ERROR&&I?.document.visibilityState==="visible"&&this.switchToFull()}switchToFull(){!this.entitled||this.blocked||(this.mode=i.FULL,this.recorder&&this.initialized?(this.recorder.recording||this.recorder.startRecording(),this.scheduler.startTimer(this.harvestTimeSeconds),this.syncWithSessionManager({sessionReplayMode:this.mode})):this.initializeRecording(!1,!0,!0))}async initializeRecording(e,t){if(this.initialized=!0,!this.entitled)return;const{session:s,timeKeeper:d}=this.agentRef.runtime;if(this.timeKeeper=d,this.recorder?.parent.trigger===U.API&&this.recorder?.recording?this.mode=i.FULL:!s.isNew&&!t?this.mode=s.state.sessionReplayMode:this.mode=e,this.mode!==i.OFF){if(this.recorder)this.recorder.parent=this;else try{const{Recorder:l}=await F(()=>import("./recorder.881762cf.js"),["assets/recorder.881762cf.js","assets/index.3ec72d2e.js","assets/index.0b64da20.css","assets/event-buffer.9a33d263.js","assets/agent-constants.7157acc7.js","assets/stylesheet-evaluator.5aa20270.js"]);this.recorder=new l(this),this.recorder.currentBufferTarget.hasError=this.errorNoticed}catch{return this.abort(u.IMPORT)}this.mode===i.ERROR&&this.errorNoticed&&(this.mode=i.FULL),this.mode===i.FULL&&(this.recorder?.getEvents().type==="preloaded"&&this.prepUtils().then(()=>{this.scheduler.runHarvest()}),this.scheduler.started||this.scheduler.startTimer(this.harvestTimeSeconds)),await this.prepUtils(),this.recorder.recording||this.recorder.startRecording(),this.syncWithSessionManager({sessionReplayMode:this.mode})}}async prepUtils(){try{const{gzipSync:e,strToU8:t}=await F(()=>import("./browser.a1df0985.js"),[]);this.gzipper=e,this.u8=t}catch{}}prepareHarvest({opts:e}={}){if(!this.recorder||!this.timeKeeper?.ready||!this.recorder.hasSeenSnapshot)return;const t=this.recorder.getEvents();if(!t.events.length||this.mode!==i.FULL||this.blocked)return;const s=this.getHarvestContents(t);if(!s.body.length){this.recorder.clearBuffer();return}n(h,["SessionReplay/Harvest/Attempts"],void 0,a.metrics,this.ee);let d=0;if(!!this.gzipper&&!!this.u8?(s.body=this.gzipper(this.u8("[".concat(s.body.map(({__serialized:l,...r})=>
1{if(r.__newrelic&&l)return l;const o={...r};return o.__newrelic||(o.__newrelic=A(r.timestamp,this.timeKeeper),o.timestamp=this.timeKeeper.correctAbsoluteTimestamp(r.timestamp)),v(o)}).join(","),"]"))),d=s.body.length,this.scheduler.opts.gzip=!0):(s.body=s.body.map(({__serialized:l,...r})=>{if(r.__newrelic)return r;const o={...r};return o.__newrelic=A(r.timestamp,this.timeKeeper),o.timestamp=this.timeKeeper.correctAbsoluteTimestamp(r.timestamp),o}),d=v(s.body).length,this.scheduler.opts.gzip=!1),d>V){this.abort(u.TOO_BIG,d);return}return this.agentRef.runtime.session.state.sessionReplaySentFirstChunk||this.syncWithSessionManager({sessionReplaySentFirstChunk:!0}),this.recorder.clearBuffer(),t.type==="preloaded"&&this.scheduler.runHarvest(e),[s]}getCorrectedTimestamp(e){if(!!e?.timestamp)return e.__newrelic?e.timestamp:this.timeKeeper.correctAbsoluteTimestamp(e.timestamp)}getHarvestContents(e){e??=this.recorder.getEvents();let t=e.events;const s=this.agentRef.runtime,d=this.agentRef.info.jsAttributes?.["enduser.id"];t?.[0]?.type===_.FullSnapshot&&!!this.recorder.lastMeta&&(e.hasMeta=!0,t.unshift(this.recorder.lastMeta),this.recorder.lastMeta=void 0),t[t.length-1]?.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 o=L(),g=this.getCorrectedTimestamp(t[0]),y=this.getCorrectedTimestamp(t[t.length-1]),f=g||Math.floor(this.timeKeeper.correctAbsoluteTimestamp(e.cycleTimestamp)),c=y||Math.floor(this.timeKeeper.correctRelativeTimestamp(o)),m=s.appMetadata?.agents?.[0]||{};return{qs:{browser_monitoring_key:this.agentRef.info.licenseKey,type:"SessionReplay",app_id:this.agentRef.info.applicationID,protocol_version:"0",timestamp:f,attributes:H({...!!this.gzipper&&!!this.u8&&{content_encoding:"gzip"},...m.entityGuid&&{entityGuid:m.entityGuid},harvestId:[s.session?.state.value,s.ptid,s.harvestCount].filter(S=>S).join("_"),"replay.firstTimestamp":f,"replay.lastTimestamp":c,"replay.nodes":t.length,"session.durationMs":s.session.getDuration(),agentVersion:s.version,session:s.session.state.value,rst:o,hasMeta:e.hasMeta||!1,hasSnapshot:e.hasSnapshot||!1,hasError:e.hasError||!1,isFirstChunk:s.session.state.sessionReplaySentFirstChunk===!1,decompressedBytes:e.payloadBytesEstimation,invalidStylesheetsDetected:K.invalidStylesheetsDetected,inlinedAllStylesheets:e.inlinedAllStylesheets,"rrweb.version":P,"payload.type":e.type,...d&&{"enduser.id":this.obfuscator.obfuscateString(d)},currentUrl:this.obfuscator.obfuscateString(W(""+location))},k).substring(1)},body:t}}onHarvestFinished(e){e.status===429&&this.abort(u.TOO_MANY),this.blocked&&this.scheduler.stopTimer(!0)}forceStop(e){e&&this.scheduler.runHarvest(),this.mode=i.OFF,this.recorder?.stopRecording?.(),this.syncWithSessionManager({sessionReplayMode:this.mode})}abort(e={},t){for(z(33,e.message),n(h,["SessionReplay/Abort/".concat(e.sm),t],void 0,a.metrics,this.ee),this.blocked=!0,this.mode=i.OFF,this.recorder?.stopRecording?.(),this.syncWithSessionManager({sessionReplayMode:this.mode}),this.recorder?.clearTimestamps?.(),this.ee.emit("REPLAY_ABORTED");this.recorder?.getEvents().events.length;)this.recorder?.clearBuffer?.()}syncWithSessionManager(e={}){this.agentRef.runtime.session.write(e)}}E(j,"featureName",T);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.