1var D=Object.defineProperty;var C=(i,e,t)=>e in i?D(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var T=(i,e,t)=>(C(i,typeof e!="symbol"?e+"":e,t),t),N=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var l=(i,e,t)=>(N(i,e,"read from private field"),t?t.call(i):e.get(i)),p=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)};import{g as L,a as _,b as F,n as y}from"./bel-serializer.402b0b7b.js";import{H as I}from"./harvest-scheduler.67ce376d.js";import{i as m,cc as A,e as v,bS as S,j as w,F as U}from"./index.3ec72d2e.js";import{c as R,A as H}from"./aggregate-base.0695104a.js";import{D as V,V as f,c,y as P,r as M,o as x,f as O,a as b}from"./first-paint.cfaa9ce2.js";import{t as B}from"./time-to-first-byte.65f4761c.js";import{s as k}from"./page-visibility.2f62fa7f.js";import{E as z}from"./event-buffer.9a33d263.js";import"./shared-context.ae8b129f.js";import"./info.d5329f52.js";import"./configure.2bbcfbcf.js";import"./agent-constants.7157acc7.js";const h=new f(c.CUMULATIVE_LAYOUT_SHIFT,i=>i);m&&V(({value:i,attribution:e,id:t})=>{const s={metricId:t,largestShiftTarget:e.largestShiftTarget,largestShiftTime:e.largestShiftTime,largestShiftValue:e.largestShiftValue,loadState:e.loadState};h.update({value:i,attrs:s})},{reportAllChanges:!0});const u=new f(c.FIRST_INPUT_DELAY);m&&P(({value:i,attribution:e})=>{if(A||u.isValid)return;const t={type:e.eventType,fid:Math.round(i),eventTarget:e.eventTarget,loadState:e.loadState};u.update({value:e.eventTime,attrs:t})});const E=new f(c.INTERACTION_TO_NEXT_PAINT);m&&M(({value:i,attribution:e,id:t})=>{const s={metricId:t,eventTarget:e.interactionTarget,eventTime:e.interactionTime,interactionTarget:e.interactionTarget,interactionTime:e.interactionTime,interactionType:e.interactionType,inputDelay:e.inputDelay,nextPaintTime:e.nextPaintTime,processingDuration:e.processingDuration,presentationDelay:e.presentationDelay,loadState:e.loadState};E.update({value:i,attrs:s})});const g=new f(c.LARGEST_CONTENTFUL_PAINT);m&&x(({value:i,attribution:e})=>{if(A||g.isValid)return;let t;const s=e.lcpEntry;s&&(t={size:s.size,eid:s.id,element:e.element,timeToFirstByte:e.timeToFirstByte,resourceLoadDelay:e.resourceLoadDelay,resourceLoadDuration:e.resourceLoadDuration,resourceLoadTime:e.resourceLoadDuration,elementRenderDelay:e.elementRenderDelay},e.url&&(t.elUrl=R(e.url)),s.element?.tagName&&(t.elTag=s.element.tagName)),g.update({value:i,attrs:t})});var o;class G extends H{constructor(t){super(t,v);p(this,o,({name:t,value:s,attrs:n})=>{this.addTiming(t,s,n)});this.timings=new z,this.curSessEndRecorded=!1,S("docHidden",n=>this.endCurrentSession(n),this.featureName,this.ee),S("winPagehide",n=>this.addTiming("unload",n,null),this.featureName,this.ee);const s=t.init.page_view_timing.harvestTimeSeconds||30;this.waitForFlags([]).then(()=>{O.subscribe(l(this,o)),b.subscribe(l(this,o)),u.subscribe(l(this,o)),g.subscribe(l(this,o)),E.subscribe(l(this,o)),B.subscribe(({attrs:a})=>{this.addTiming("load",Math.round(a.navigationEntry.loadEventEnd))}),k(()=>{const{name:a,value:r,attrs:d}=h.current;r!==void 0&&this.addTiming(a,r*1e3,d)},!0),new I("events",{onFinished:(...a)=>this.onHarvestFinished(...a),getPayload:(...a)=>this.prepareHarvest(...a)},this).startTimer(s),this.drain()})}endCurrentSession(t){this.curSessEndRecorded||(this.addTiming("pageHide",t,null),this.curSessEndRecorded=!0)}addTiming(t,s,n){n=n||{},Y(n),t!==c.CUMULATIVE_LAYOUT_SHIFT&&h.current.value>=0&&(n.cls=h.current.value),this.timings.add({name:t,value:s,attrs:n}),w("pvtAdded",[t,s,n],void 0,U.sessionTrace,this.ee)}onHarvestFinished(t){t.retry&&this.timings.held.hasData?this.timings.unhold():this.timings.held.clear()}appendGlobalCustomAttributes(t){var s=t.attrs||{},n=["size","eid","cls","type","fid","elTag","elUrl","net-type","net-etype","net-rtt","net-dlink"];Object.entries(this.agentRef.info.jsAttributes||{}).forEach(([a,r])=>{n.indexOf(a)<0&&(s[a]=r)})}prepareHarvest(t){if(!!this.timings.hasData){var s=this.getPayload(this.timings.buffer);return t.retry?this.timings.hold():this.timings.clear(),{body:{e:s}}}}getPayload(t){for(var s=L(this.agentIdentifier),n="bel.6;",a=0;a<t.length;a++){var r=t[a];n+="e,",n+=s(r.name)+",",n+=_(r.value,y,!1)+",",this.appendGlobalCustomAttributes(r);var d=F(r.attrs,s);d&&d.length>0&&(n+=y(d.length)+";"+d.join(";")),a+1<t.length&&(n+=";")}return n}}o=new WeakMap,T(G,"featureName",v);function Y(i){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;!e||(e.type&&(i["net-type"]=e.type),e.effectiveType&&(i["net-etype"]=e.effectiveType),e.rtt&&(i["net-rtt"]=e.rtt),e.downlink&&(i["net-dlink"]=e.downlink))}export{G 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.