@launchdarkly/o11y 1.1.26 → 1.2.0

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.
package/dist/index.js CHANGED
@@ -40,11 +40,11 @@ var _ = (i, e, t) => new Promise((s, n) => {
40
40
  }, l = (d) => d.done ? s(d.value) : Promise.resolve(d.value).then(o, r);
41
41
  l((t = t.apply(i, e)).next());
42
42
  });
43
- import { W as Je, M as L, r as j, I as ve, a as ke, S as Qe, C as Ye, F as Xe, b as Ze, P as et, c as _e, g as tt, p as st, d as it, e as nt, f as rt, s as ot, h as at } from "./record-B0JnsHlu.js";
44
- import { R as os } from "./record-B0JnsHlu.js";
45
- import { s as x, G as O, g as M, S as E, r as Re, a as J, b as ct, c as lt, d as Q, e as Y, f as U, F as De, V as dt, P as ht, h as gt, H as X, M as ut, i as ft, L as Ue, j as We, p as mt, k as Ie, l as Ce, m as pt, n as wt, o as St, q as yt, t as bt, u as vt, v as kt, w as _t, x as Rt } from "./common-DTkqplI4.js";
46
- import { X as Dt, F as It, A as Ct, C as Lt, E as Et, s as ze, D as Nt, a as Ot, m as Le, d as Be, b as Ee, c as Ne, r as Me, e as Tt, p as Pt, f as Ht, g as Ut, M as D, h as N, W as Wt, N as zt, P as Bt, J as Mt, i as V, j as A, k as Ft, l as $t, n as Vt, o as Oe } from "./observe-BLBJc_WZ.js";
47
- import { O as cs } from "./observe-BLBJc_WZ.js";
43
+ import { W as Je, M as L, r as j, I as ve, a as ke, S as Qe, C as Ye, F as Xe, b as Ze, P as et, c as _e, g as tt, p as st, d as it, e as nt, f as rt, s as ot, h as at } from "./record-C_yieA7u.js";
44
+ import { R as os } from "./record-C_yieA7u.js";
45
+ import { s as x, G as O, g as M, S as E, r as Re, a as J, b as ct, c as lt, d as Q, e as Y, f as U, F as De, V as dt, P as ht, h as gt, H as X, M as ut, i as ft, L as Ue, j as We, p as mt, k as Ie, l as Ce, m as pt, n as wt, o as St, q as yt, t as bt, u as vt, v as kt, w as _t, x as Rt } from "./common-DQ61tUu9.js";
46
+ import { X as Dt, F as It, A as Ct, C as Lt, E as Et, s as ze, D as Nt, a as Ot, m as Le, d as Be, b as Ee, c as Ne, r as Me, e as Tt, p as Pt, f as Ht, g as Ut, M as D, h as N, W as Wt, N as zt, P as Bt, J as Mt, i as V, j as A, k as Ft, l as $t, n as Vt, o as Oe } from "./observe-CFB6c1lu.js";
47
+ import { O as cs } from "./observe-CFB6c1lu.js";
48
48
  import { L as At } from "./buffer-DIFxvF2Q.js";
49
49
  import { g as Te } from "./LDObserve-CHIjcqIn.js";
50
50
  import { L as ds } from "./LDObserve-CHIjcqIn.js";
package/dist/index.umd.js CHANGED
@@ -463,7 +463,7 @@ To resolve the conflict:`,Wm(a,t))),s=u):H.warn("A view or instrument with the n
463
463
  `,m),v=g===-1?-1:f.indexOf(`\r
464
464
  \r
465
465
  `,g);if(v===-1)break;const y=new TextDecoder().decode(c.subarray(g+2,v)),S=v+4,_=f.indexOf(`\r
466
- ${d}`,S),w=_===-1,b=w?f.length:_,R=(o=/\bname="([^"]*)"/i.exec(y))==null?void 0:o[1];if(R!==void 0){const E=(l=/\bfilename="([^"]*)"/i.exec(y))==null?void 0:l[1];if(E!==void 0){const I=(h=(a=(u=/^content-type:[ \t]*(.*)$/im.exec(y))==null?void 0:u[1])==null?void 0:a.trim())!=null?h:"",C=b-S;wu(p,R,`[File name="${E}" type="${I}" size${w?">=":"="}${C}]`)}else wu(p,R,new TextDecoder().decode(c.subarray(S,b)))}m=w?-1:_+2}return e.truncated&&Object.keys(p).length===0?Ws(e):JSON.stringify(p)}catch(c){return Ws(e)}},zL=(e,t)=>{try{if(t&&t.body!==void 0&&t.body!==null)return Promise.resolve(rg(t.body));if(!e.body||e.bodyUsed)return Promise.resolve(void 0);const r=e.clone();if(!r.body)return Promise.resolve(void 0);const n=e.headers.get("content-type");return JL(r.body,$l(e.headers)).then(i=>ML(n)?BL(i,n):YL(i)).catch(()=>{})}catch(r){return Promise.resolve(void 0)}},KL=(e=[])=>{if(typeof window=="undefined"||typeof window.fetch!="function"||typeof Request=="undefined")return()=>{};const t=i=>e.some(s=>i.toLowerCase().includes(s)),r=window.fetch,n=function(i,s){return i instanceof Request&&!Ru.has(i)&&!t(i.url)&&Ru.set(i,zL(i,s)),r.call(this!=null?this:window,i,s)};return window.fetch=n,()=>{window.fetch===n&&(window.fetch=r)}};class _u{constructor(t,r){L(this,"debug");L(this,"name");this.debug=t,this.name=r}log(...t){if(this.debug){let r=`[${Date.now()}]`;this.name&&(r+=` - ${this.name}`),console.log.apply(console,[r,...t])}}warn(...t){let r=`[${Date.now()}]`;this.name&&(r+=` - ${this.name}`),console.warn.apply(console,[r,...t])}}class Tu{constructor(){L(this,"_sdk");L(this,"_isLoaded",!1);L(this,"_callBuffer",[]);L(this,"_capacity",1e5);L(this,"_droppedEvents",0);L(this,"_exceededCapacity",!1);L(this,"_logger",new _u)}_bufferCall(t,r){if(this._isLoaded)try{return this._sdk[t](...r)}catch(n){De(`Error executing buffered call to ${t}:`,"error",n)}else{this._enqueue({method:t,args:r});return}}_enqueue(t){this._callBuffer.length<this._capacity?(this._callBuffer.push(t),this._exceededCapacity=!1):(this._exceededCapacity||(this._exceededCapacity=!0,De("Exceeded event queue capacity. Increase capacity to avoid dropping events.","warn")),this._droppedEvents+=1)}load(t){this._sdk=t,this._isLoaded=!0;for(const{method:r,args:n}of this._callBuffer)try{this._sdk[r](...n)}catch(i){De(`Error executing buffered call to ${r}:`,"error",i)}this._callBuffer=[]}}const Je="feature_flag",ng="launchdarkly",Eu="evaluation",jL=`${Je}.${Eu}`,ig=`${Je}.set.id`,sg=`${Je}.key`,og=`${Je}.contextKeys`,ag=`${Je}.context.id`,lg=`${Je}.result.value`,Iu=`${Je}.provider.name`,Ps={kind:`${Je}.result.reason.kind`,errorKind:`${Je}.result.reason.errorKind`,ruleIndex:`${Je}.result.reason.ruleIndex`,ruleId:`${Je}.result.reason.ruleId`,prerequisiteKey:`${Je}.result.reason.prerequisiteKey`,inExperiment:`${Je}.result.reason.inExperiment`,bigSegmentsStatus:`${Je}.result.reason.bigSegmentsStatus`},ug=`${Je}.result.variationIndex`,cg=`${ng}.application.id`,dg=`${ng}.application.version`,QL="context.contextKeys",$L="$ld:telemetry:session:init",hg="$ld:telemetry:track",qL="launchdarkly.track",ex="page_view",tx="document_load",rx="result.status";function fg(e){return e.includes("%")||e.includes(":")?e.replace(/%/g,"%25").replace(/:/g,"%3A"):e}function pg(e){return e.kind==="multi"}function Ir(e){return pg(e)?Object.keys(e).sort().filter(t=>t!=="kind").map(t=>`${t}:${fg(e[t].key)}`).join(":"):"kind"in e&&e.kind==="user"?e.key:"kind"in e?`${e.kind}:${fg(e.key)}`:e.key}function Hn(e){return pg(e)?Object.keys(e).sort().filter(t=>t!=="kind").map(t=>({[t]:e[t].key})).reduce((t,r)=>x(x({},t),r),{}):"kind"in e?{[e.kind]:e.key}:{user:e.key}}function nx(e,t,r){t.addHook({getMetadata:()=>({name:"highlight.run"}),afterIdentify:(n,i,s)=>{var l,u;const o=B(x({},Hn(n.context)),{key:(u=(l=r==null?void 0:r.contextFriendlyName)==null?void 0:l.call(r,n.context))!=null?u:Ir(n.context)});return e.log("LD.identify","INFO",o),s.status==="completed"&&e.identify(o.key,o,"LaunchDarkly"),i},afterEvaluation:(n,i,s)=>{const o=x({[Iu]:"LaunchDarkly",[sg]:n.flagKey,[lg]:JSON.stringify(s.value)},s.variationIndex!==void 0&&s.variationIndex!==null?{[ug]:s.variationIndex}:{});if(s.reason)for(const l in Ps){const u=l,a=s.reason[u];a!=null&&(o[Ps[u]]=a)}return n.context&&(o[og]=JSON.stringify(Hn(n.context)),o[ag]=Ir(n.context)),e.startSpan(Eu,l=>{l&&l.addEvent(jL,o)}),i}})}class ix{constructor(t,r){L(this,"client");L(this,"metadata");this.client=t,this.metadata=r}getHooks(t){return[]}init(t){this.client.track($L,{sessionID:t})}recordGauge(t,r){}identify(t,r,n={},i){}error(t,r){}track(t,r){const n=r.event;this.client.track(n?`${hg}:${n}`:hg,B(x({},r),{sessionID:t}))}}class Ms extends Tu{constructor(r,n){super();L(this,"client");this.client=new ix(r,n)}getHooks(r){return[{getMetadata:()=>({name:"highlight.run/ld"}),afterIdentify:(n,i,s)=>(this.load(this.client),i)}]}init(r){return this._bufferCall("init",[r])}recordGauge(r,n){return this._bufferCall("recordGauge",[r,n])}identify(r,n,i={},s){return this._bufferCall("identify",[r,n,i,s])}error(r,n){return this._bufferCall("error",[r,n])}track(r,n){return this._bufferCall("track",[r,n])}}const Cu=e=>{e(window.location.href);const t=history.pushState;history.pushState=(s=>function(){var l=s.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),l})(history.pushState);const r=history.replaceState;history.replaceState=(s=>function(){var l=s.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),l})(history.replaceState);const n=()=>{window.dispatchEvent(new Event("locationchange"))};window.addEventListener("popstate",n);const i=function(){e(window.location.href)};return window.addEventListener("locationchange",i),()=>{window.removeEventListener("popstate",n),window.removeEventListener("locationchange",i),history.pushState=t,history.replaceState=r}},an=class an extends Wn{constructor(r={}){super(an.moduleName,an.version,r);L(this,"_getLDContextKeyAttributes");L(this,"_unlisten");L(this,"_lastUrl","");this._getLDContextKeyAttributes=r.getLDContextKeyAttributes}init(){}enable(){this._lastUrl=window.location.href,this._unlisten=Cu(r=>{var i;const n=this._lastUrl;if(this._lastUrl=r,n!==r)try{const s=this.tracer.startSpan(ex,{attributes:{[er]:r,"page_view.previous_url":n,"page_view.url":r}}),o=(i=this._getLDContextKeyAttributes)==null?void 0:i.call(this);o&&s.setAttributes(o),s.end()}catch(s){this._diag.error("failed to create page view span",s)}})}disable(){var r;(r=this._unlisten)==null||r.call(this),this._unlisten=void 0}};L(an,"version","0.1.0"),L(an,"moduleName","location-change");let Zu=an;const Lu={version:"1.1.26"}.version;let Me={},Ut,As,Cr,Zr;const Lr="highlight.record",sx="highlight.session_id",Us=new Map,xu=e=>`${e.spanContext().traceId}:${e.spanContext().spanId}`,mg="launchdarkly.js.log",ox="launchdarkly.exception.id",gg="launchdarkly.sampling.ratio",yg="log.severity",bg="log.message",vg=(e,t)=>{var g,v,y,S,_,w,b,R,E,I,C,N,G,Q;if(Me.tracerProvider||Me.meterProvider){console.warn("OTEL already initialized. Skipping...");return}Ut=e;const r=e.backendUrl||void 0||"https://pub.highlight.io",n=[...(v=(g=e.networkRecordingOptions)==null?void 0:g.urlBlocklist)!=null?v:[],...Fp],i=[r,e.otlpEndpoint].filter(Z=>!!Z).map(Z=>Z.toLowerCase()),s=(y=e.environment)!=null?y:"production",o={url:e.otlpEndpoint+"/v1/traces",concurrencyLimit:10,timeoutMillis:3e4,compression:"gzip",keepAlive:!0,httpAgentOptions:{timeout:6e4,keepAlive:!0}},l=new OL(o,t),u=new Ds(l,{maxExportBatchSize:1024,maxQueueSize:2048,exportTimeoutMillis:o.timeoutMillis,scheduledDelayMillis:5e3}),a=new Pn({[PT]:(S=e.serviceName)!=null?S:"highlight-browser",[MT]:e.serviceVersion,"deployment.environment.name":s,"highlight.project_id":e.projectId,[UT]:navigator.userAgent,"browser.language":navigator.language,"telemetry.distro.name":"@highlight-run/observability","telemetry.distro.version":Lu});Me.tracerProvider=new gT({resource:a,mergeResourceWithDefaults:!0,spanProcessors:[u]}),Se.setGlobalTracerProvider(Me.tracerProvider);const h=new GL(B(x({},o),{url:e.otlpEndpoint+"/v1/metrics"})),c=new HC({exporter:h,exportIntervalMillis:o.timeoutMillis,exportTimeoutMillis:o.timeoutMillis});Me.meterProvider=new NZ({resource:a,readers:[c]}),yl.setGlobalMeterProvider(Me.meterProvider);let f=[];if(((_=e.instrumentations)==null?void 0:_["@opentelemetry/instrumentation-document-load"])!==!1&&f.push(new HT({applyCustomAttributesOnSpan:{documentLoad:Tg,documentFetch:Tg,resourceFetch:bx}})),((w=e.instrumentations)==null?void 0:w["@opentelemetry/instrumentation-user-interaction"])!==!1&&f.push(new Su({productAnalyticsEvents:e.productAnalyticsEvents,getLDContextKeyAttributes:e.getLDContextKeyAttributes})),((b=e.productAnalyticsEvents)==null?void 0:b.pageViews)!==!1&&f.push(new Zu({getLDContextKeyAttributes:e.getLDContextKeyAttributes})),(R=e.networkRecordingOptions)!=null&&R.enabled){if(((E=e.instrumentations)==null?void 0:E["@opentelemetry/instrumentation-fetch"])!==!1){const W=new vE({propagateTraceHeaderCorsUrls:Ig(e.tracingOrigins),applyCustomAttributesOnSpan:(k,M,D)=>{var P;if(!k.attributes)return;const U=k;if(U.attributes[Lr]===!1)return;const q=typeof Request!="undefined"&&M instanceof Request,fe=q?FL(M):void 0;Rg(k,q?void 0:M.body,M.headers,e.networkRecordingOptions);const O=()=>$(this,null,function*(){const F=yield fe;F!==void 0&&dx(k,F,M.headers,e.networkRecordingOptions)}),pe=()=>{var F;return(F=e.networkRecordingOptions)!=null&&F.requestResponseSanitizer&&_g(k,e.networkRecordingOptions.requestResponseSanitizer),U.attributes[Lr]!==!1};if(!(D instanceof Response)){if(k.setAttributes({"http.response.error":D.message,[Tp]:D.status}),!pe())return;fe&&Us.set(xu(k),O().then(()=>{pe()}));return}if(pe()&&(P=e.networkRecordingOptions)!=null&&P.recordHeadersAndBody){const F=$(this,null,function*(){var ge,K,le,Te,Jt;yield O();const Y=yield $p(D,(ge=e.networkRecordingOptions)==null?void 0:ge.bodyKeysToRecord,(K=e.networkRecordingOptions)==null?void 0:K.networkBodyKeysToRedact),j=Object.fromEntries(D.headers.entries()),ne=Es((Te=(le=e.networkRecordingOptions)==null?void 0:le.networkHeadersToRedact)!=null?Te:[],j,(Jt=e.networkRecordingOptions)==null?void 0:Jt.headerKeysToRecord),ae=Ou(ne,"http.response.header");Object.assign(k.attributes,x({"http.response.body":Y},ae)),pe()});Us.set(xu(k),F)}}});f.push(W)}((I=e.instrumentations)==null?void 0:I["@opentelemetry/instrumentation-xml-http-request"])!==!1&&f.push(new DE({propagateTraceHeaderCorsUrls:Ig(e.tracingOrigins),applyCustomAttributesOnSpan:(W,k)=>{var U,q,fe,O;const M=k;if(!(!W.attributes||W.attributes[Lr]===!1)){if(Rg(W,M._body,M._requestHeaders,e.networkRecordingOptions),(U=e.networkRecordingOptions)!=null&&U.recordHeadersAndBody){let pe="";(k.responseType===""||k.responseType==="text")&&(pe=Ct(k.responseText,(q=e.networkRecordingOptions)==null?void 0:q.networkBodyKeysToRedact,(fe=e.networkRecordingOptions)==null?void 0:fe.bodyKeysToRecord,void 0));const P=hx(k.getAllResponseHeaders());gx(W,P,pe,e.networkRecordingOptions)}(O=e.networkRecordingOptions)!=null&&O.requestResponseSanitizer&&_g(W,e.networkRecordingOptions.requestResponseSanitizer)}}}))}O_({instrumentations:f}),(C=e.networkRecordingOptions)!=null&&C.enabled&&e.networkRecordingOptions.recordHeadersAndBody&&((N=e.instrumentations)==null?void 0:N["@opentelemetry/instrumentation-xml-http-request"])!==!1&&(Cr==null||Cr(),Cr=WL([...n,...i])),(G=e.networkRecordingOptions)!=null&&G.enabled&&e.networkRecordingOptions.recordHeadersAndBody&&((Q=e.instrumentations)==null?void 0:Q["@opentelemetry/instrumentation-fetch"])!==!1&&(Zr==null||Zr(),Zr=KL([...n,...i]));const m=new vp;return m.enable(),Me.tracerProvider.register({contextManager:m,propagator:new Mf({propagators:[new xf,new lx({backendUrl:r,otlpEndpoint:e.otlpEndpoint,tracingOrigins:e.tracingOrigins,urlBlocklist:n})]})}),As=ax(l,h,u,()=>Me),Me},ax=(e,t,r,n)=>{if(typeof document=="undefined"||typeof window=="undefined")return()=>{};const i=()=>{var u,a;e.setUnloading(!0),t.setUnloading(!0),r.setSkipPendingOnFlush(!0);const l=n();(u=l.tracerProvider)==null||u.forceFlush().catch(()=>{}),(a=l.meterProvider)==null||a.forceFlush().catch(()=>{})},s=()=>{document.visibilityState==="hidden"?i():document.visibilityState==="visible"&&(e.setUnloading(!1),t.setUnloading(!1),r.setSkipPendingOnFlush(!1))},o=()=>i();return document.addEventListener("visibilitychange",s),window.addEventListener("pagehide",o),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("pagehide",o)}};class Ds extends fp{constructor(){super(...arguments);L(this,"_pendingSpans",new Set);L(this,"_skipPendingOnFlush",!1)}setSkipPendingOnFlush(r){this._skipPendingOnFlush=r}onStart(r,n){r.setAttribute(sx,Pt()),super.onStart(r,n)}onEnd(r){if(r.attributes[Lr]===!1)return;const n=xu(r),i=Us.get(n);if(i){const s=i.catch(o=>{console.warn("[CustomBatchSpanProcessor] Failed to capture response body attributes",o)}).finally(()=>{Us.delete(n),this._pendingSpans.delete(s),r.attributes[Lr]!==!1&&super.onEnd(r)});this._pendingSpans.add(s);return}super.onEnd(r)}shutdown(){return $(this,null,function*(){return this._skipPendingOnFlush||(yield Promise.allSettled(this._pendingSpans)),hc(Ds.prototype,this,"shutdown").call(this)})}forceFlush(){return $(this,null,function*(){return this._skipPendingOnFlush||(yield Promise.allSettled(this._pendingSpans)),hc(Ds.prototype,this,"forceFlush").call(this)})}}class lx extends Ff{constructor(r){super();L(this,"highlightEndpoints");L(this,"tracingOrigins");L(this,"urlBlocklist");this.highlightEndpoints=[r.backendUrl,`${r.otlpEndpoint}/v1/traces`,`${r.otlpEndpoint}/v1/logs`,`${r.otlpEndpoint}/v1/metrics`],this.tracingOrigins=r.tracingOrigins,this.urlBlocklist=r.urlBlocklist}inject(r,n,i){var l;const s=Se.getSpan(r);if(!s||!s.attributes)return;const o=Cg(s);typeof o=="string"&&(yx(o,this.highlightEndpoints,this.tracingOrigins,this.urlBlocklist)||s.setAttribute(Lr,!1),!zl(o,(l=this.tracingOrigins)!=null?l:[],this.urlBlocklist))||super.inject(r,n,i)}}const Sg="highlight-browser",ux=Sg,Fs=()=>{var e;return(e=Me.tracerProvider)==null?void 0:e.getTracer(Sg)},nr=()=>{var e;return(e=Me.meterProvider)==null?void 0:e.getMeter(ux)},cx=()=>Se.getActiveSpan(),Nu=()=>$(this,null,function*(){As&&(As(),As=void 0),Cr&&(Cr(),Cr=void 0),Zr&&(Zr(),Zr=void 0),yield Promise.allSettled([$(this,null,function*(){Me.tracerProvider?(yield Me.tracerProvider.shutdown(),Me.tracerProvider=void 0):console.warn("OTEL shutdown called without initialized tracerProvider.")}),$(this,null,function*(){Me.meterProvider?(yield Me.meterProvider.shutdown(),Me.meterProvider=void 0):console.warn("OTEL shutdown called without initialized meterProvider.")})])}),wg=e=>{const t=FE(e),r={};return t!=null&&t.name&&(r["graphql.operation.name"]=t.name),t!=null&&t.type&&(r["graphql.operation.type"]=t.type),r},dx=(e,t,r,n)=>{if(!e.attributes)return;const i=e.attributes;Object.assign(i,wg(t)),n!=null&&n.recordHeadersAndBody&&Object.assign(i,{"http.request.body":Ct(t,n.networkBodyKeysToRedact,n.bodyKeysToRecord,eg(r))})},Rg=(e,t,r,n)=>{var h;if(!e.attributes)return;const s=Cg(e),o=Is(s),l=Jp(o),u=rg(t),a=eg(r);if(e.setAttributes(wg(u!=null?u:t)),e.setAttributes({"highlight.type":"http.request",[jr]:o,[er]:o,[ps]:l.pathname,[AT]:l.search}),e.setAttributes(fx(l.searchParams,"url.query_params")),n!=null&&n.recordHeadersAndBody){u!==void 0&&e.setAttribute("http.request.body",Ct(u,n.networkBodyKeysToRedact,n.bodyKeysToRecord,a));const c=Es((h=n.networkHeadersToRedact)!=null?h:[],a,n.headerKeysToRecord),f=Ou(c,"http.request.header");e.setAttributes(f)}},hx=e=>{const t={};return e&&e.trim().split(/[\r\n]+/).forEach(r=>{const n=r.split(": "),i=n.shift();i&&(t[i]=n.join(": "))}),t},Ou=(e,t)=>{const r={};return Object.entries(e).forEach(([n,i])=>{const s=n.toLowerCase().replace(/_/g,"-"),o=`${t}.${s}`,l=mx(s,i);if(r[o]){const u=r[o];Array.isArray(u)?r[o]=[...u,...l]:r[o]=[u,...l]}else r[o]=l.length===1?l[0]:l}),r},fx=(e,t)=>{const r={};for(const[n,i]of e.entries()){const s=`${t}.${n}`,o=r[s];o===void 0?r[s]=i:Array.isArray(o)?o.push(i):r[s]=[o,i]}return r},px=new Set(["accept","accept-charset","accept-encoding","accept-language","accept-ranges","allow","cache-control","connection","content-encoding","content-language","expect","if-match","if-none-match","pragma","proxy-authenticate","te","trailer","transfer-encoding","upgrade","vary","via","warning","www-authenticate","access-control-allow-headers","access-control-allow-methods","access-control-expose-headers","access-control-request-headers"]),mx=(e,t)=>px.has(e)?t.split(",").map(r=>r.trim()).filter(r=>r.length>0):[t],gx=(e,t,r,n)=>{var o;e.setAttribute("http.response.body",r);const i=Es((o=n.networkHeadersToRedact)!=null?o:[],t,n.headerKeysToRecord),s=Ou(i,"http.response.header");e.setAttributes(s)},_g=(e,t)=>{var c,f,d,p,m,g,v,y,S,_,w,b;const n=e.attributes,i={},s={};for(const[R,E]of Object.entries(n))R.startsWith("http.request.header.")&&(i[R.slice(20)]=String(E)),R.startsWith("http.response.header.")&&(s[R.slice(21)]=String(E));let l={request:{sessionSecureID:"",id:"",url:(f=(c=n[er])!=null?c:n[jr])!=null?f:"",verb:(p=(d=n["http.request.method"])!=null?d:n[GT])!=null?p:"GET",headers:i,body:(m=n["http.request.body"])!=null?m:""},response:{status:Number((v=(g=n[Tp])!=null?g:n[VT])!=null?v:0),headers:s,body:(y=n["http.response.body"])!=null?y:""},urlBlocked:!1},u=!0;try{l.request.body=JSON.parse(l.request.body)}catch(R){u=!1}let a=!0;try{l.response.body=JSON.parse(l.response.body)}catch(R){a=!1}let h;try{h=t(l)}catch(R){return}if(!h){Object.assign(e.attributes,{[Lr]:!1});return}u&&((S=h.request)!=null&&S.body)&&(h.request.body=JSON.stringify(h.request.body)),a&&((_=h.response)!=null&&_.body)&&(h.response.body=JSON.stringify(h.response.body)),Object.assign(e.attributes,{"http.request.body":(w=h.request.body)!=null?w:"","http.response.body":(b=h.response.body)!=null?b:""})},yx=(e,t,r,n)=>n!=null&&n.some(s=>e.toLowerCase().includes(s))?!1:Cs(e,t),Tg=e=>{var s,o,l;if(!e.events)return;const r=e.events,n={unload:ht("unloadEventStart","unloadEventEnd",r),dom_interactive:ht("fetchStart","domInteractive",r),dom_content_loaded:ht("domContentLoadedEventStart","domContentLoadedEventEnd",r),dom_complete:ht("fetchStart","domComplete",r),load_event:ht("loadEventStart","loadEventEnd",r),document_load:ht("fetchStart","loadEventEnd",r),first_paint:ht("fetchStart","firstPaint",r),first_contentful_paint:ht("fetchStart","firstContentfulPaint",r),domain_lookup:ht("domainLookupStart","domainLookupEnd",r),connect:ht("connectStart","connectEnd",r),request:ht("requestStart","requestEnd",r),response:ht("responseStart","responseEnd",r)},i=(o=(s=Ut==null?void 0:Ut.getIntegrations)==null?void 0:s.call(Ut))!=null?o:[];if(n.document_load!==void 0)for(const u of i)u.recordGauge((l=Ut==null?void 0:Ut.sessionSecureId)!=null?l:"",{name:tx,value:n.document_load/1e6});Object.entries(n).forEach(([u,a])=>{a!==void 0&&(e.setAttribute(`timings.${u}.ns`,a),e.setAttribute(`timings.${u}.readable`,Eg(a)))})};function ht(e,t,r){const n=r.find(l=>l.name===e),i=r.find(l=>l.name===t);if(!n||!i)return;const s=n.time[0]*1e9+n.time[1];return i.time[0]*1e9+i.time[1]-s}const bx=(e,t)=>{const r={domain_lookup:(t.domainLookupEnd-t.domainLookupStart)*1e6,connect:(t.connectEnd-t.connectStart)*1e6,request:(t.responseEnd-t.requestStart)*1e6,response:(t.responseEnd-t.responseStart)*1e6};Object.entries(r).forEach(([n,i])=>{e.setAttribute(`timings.${n}.ns`,i),e.setAttribute(`timings.${n}.readable`,Eg(i))})},Eg=e=>{if(e>=36e11){const o=e/36e11;return`${Number(o.toFixed(1))}h`}else if(e>=6e10){const o=e/6e10;return`${Number(o.toFixed(1))}m`}else if(e>=1e9){const o=e/1e9;return`${Number(o.toFixed(1))}s`}else if(e>=1e6){const o=e/1e6;return`${Number(o.toFixed(1))}ms`}else if(e>=1e3){const o=e/1e3;return`${Number(o.toFixed(1))}µs`}else return`${Number(e.toFixed(1))}ns`},Ig=e=>e===!0?[/localhost/,/^\//,zp(window.location.host)]:Array.isArray(e)?e.map(t=>typeof t=="string"?new RegExp(t):t):/^$/,Cg=e=>e.attributes[er]?e.attributes[er]:e.attributes[jr],vx=(e,t,r)=>{const n=window._highlightWebSocketRequestCallback;window._highlightWebSocketRequestCallback=e;const i=window._highlightWebSocketEventCallback;return window._highlightWebSocketEventCallback=s=>{const c=s,{message:o,size:l}=c,u=et(c,["message","size"]),h=r.some(f=>s.name.toLowerCase().includes(f))?u:s;t(h)},()=>{window._highlightWebSocketRequestCallback=n,window._highlightWebSocketEventCallback=i}},Sx=({xhrCallback:e,fetchCallback:t,webSocketRequestCallback:r,webSocketEventCallback:n,disableWebSocketRecording:i,bodyKeysToRedact:s,highlightEndpoints:o,tracingOrigins:l,urlBlocklist:u,bodyKeysToRecord:a})=>{const h=SI(e,o,l,u,s,a),c=EI(t,o,l,u,s,a),f=i?()=>{}:vx(r,n,u);return()=>{h(),c(),f()}};class Dt{constructor(t){L(this,"disableConsoleRecording");L(this,"reportConsoleErrors");L(this,"enablePromisePatch");L(this,"consoleMethodsToRecord");L(this,"listeners");L(this,"errors");L(this,"messages");L(this,"options");L(this,"hasNetworkRecording",!0);L(this,"disableNetworkRecording");L(this,"enableRecordingNetworkContents");L(this,"xhrNetworkContents");L(this,"fetchNetworkContents");L(this,"disableRecordingWebSocketContents");L(this,"webSocketNetworkContents");L(this,"webSocketEventContents");L(this,"tracingOrigins");L(this,"networkHeadersToRedact");L(this,"networkBodyKeysToRedact");L(this,"networkBodyKeysToRecord");L(this,"networkHeaderKeysToRecord");L(this,"lastNetworkRequestTimestamp");L(this,"urlBlocklist");L(this,"highlightEndpoints");L(this,"requestResponseSanitizer");var r,n;this.options=t,this.disableConsoleRecording=!!t.disableConsoleRecording,this.reportConsoleErrors=(r=t.reportConsoleErrors)!=null?r:!1,this.enablePromisePatch=(n=t.enablePromisePatch)!=null?n:!1,this.consoleMethodsToRecord=t.consoleMethodsToRecord||[...el],this.listeners=[],this.errors=[],this.messages=[],this.lastNetworkRequestTimestamp=0}isListening(){return this.listeners.length>0}startListening(){if(this.isListening())return;const t=this;this.disableConsoleRecording||this.listeners.push(mf(r=>{var n,i,s;if(this.reportConsoleErrors&&(r.type==="Error"||r.type==="error")&&r.value&&r.trace){const o=bt(r.value);if(al.includes(o)||ll.some(l=>o.includes(l)))return;t.errors.push({event:o,type:"console.error",url:window.location.href,source:(n=r.trace[0])!=null&&n.fileName?r.trace[0].fileName:"",lineNumber:(i=r.trace[0])!=null&&i.lineNumber?r.trace[0].lineNumber:0,columnNumber:(s=r.trace[0])!=null&&s.columnNumber?r.trace[0].columnNumber:0,stackTrace:r.trace,timestamp:new Date().toISOString(),id:_n()})}t.messages.push(r)},B(x({},pf),{level:this.consoleMethodsToRecord}))),this.listeners.push(yf(r=>{al.includes(r.event)||ll.some(n=>r.event.includes(n))||t.errors.push(r)},{enablePromisePatch:this.enablePromisePatch})),this.listeners.push(Nu),Dt.setupNetworkListener(this,this.options)}stopListening(){this.listeners.forEach(t=>t()),this.listeners=[]}static setupNetworkListener(t,r){var s,o,l,u,a,h,c,f,d,p,m,g;const n=(r==null?void 0:r.backendUrl)||void 0||"https://pub.highlight.io",i=r.otlpEndpoint||"https://otel.highlight.io";t.highlightEndpoints=[n,`${i}/v1/traces`,`${i}/v1/logs`,`${i}/v1/metrics`],t.xhrNetworkContents=[],t.fetchNetworkContents=[],t.webSocketNetworkContents=[],t.webSocketEventContents=[],t.networkHeadersToRedact=[],t.urlBlocklist=[],t.tracingOrigins=r.tracingOrigins||[],(r==null?void 0:r.disableNetworkRecording)!==void 0?(t.disableNetworkRecording=r==null?void 0:r.disableNetworkRecording,t.enableRecordingNetworkContents=!1,t.disableRecordingWebSocketContents=!0,t.networkHeadersToRedact=[],t.networkBodyKeysToRedact=[],t.urlBlocklist=[],t.networkBodyKeysToRecord=[]):typeof(r==null?void 0:r.networkRecording)=="boolean"?(t.disableNetworkRecording=!r.networkRecording,t.enableRecordingNetworkContents=!1,t.disableRecordingWebSocketContents=!0,t.networkHeadersToRedact=[],t.networkBodyKeysToRedact=[],t.urlBlocklist=[]):(((s=r.networkRecording)==null?void 0:s.enabled)!==void 0?t.disableNetworkRecording=!r.networkRecording.enabled:t.disableNetworkRecording=!1,t.enableRecordingNetworkContents=((o=r.networkRecording)==null?void 0:o.recordHeadersAndBody)||!1,t.disableRecordingWebSocketContents=((l=r.networkRecording)==null?void 0:l.disableWebSocketEventRecordings)||!1,t.networkHeadersToRedact=((a=(u=r.networkRecording)==null?void 0:u.networkHeadersToRedact)==null?void 0:a.map(v=>v.toLowerCase()))||[],t.networkBodyKeysToRedact=((c=(h=r.networkRecording)==null?void 0:h.networkBodyKeysToRedact)==null?void 0:c.map(v=>v.toLowerCase()))||[],t.urlBlocklist=((d=(f=r.networkRecording)==null?void 0:f.urlBlocklist)==null?void 0:d.map(v=>v.toLowerCase()))||[],t.urlBlocklist=[...t.urlBlocklist,...Fp],t.requestResponseSanitizer=(p=r.networkRecording)==null?void 0:p.requestResponseSanitizer,t.networkHeaderKeysToRecord=(m=r.networkRecording)==null?void 0:m.headerKeysToRecord,t.networkHeaderKeysToRecord&&(t.networkHeadersToRedact=[],t.networkHeaderKeysToRecord=t.networkHeaderKeysToRecord.map(v=>v.toLocaleLowerCase())),t.networkBodyKeysToRecord=(g=r.networkRecording)==null?void 0:g.bodyKeysToRecord,t.networkBodyKeysToRecord&&(t.networkBodyKeysToRedact=[],t.networkBodyKeysToRecord=t.networkBodyKeysToRecord.map(v=>v.toLocaleLowerCase()))),!t.disableNetworkRecording&&t.enableRecordingNetworkContents&&(t.hasNetworkRecording=!0,t.listeners.push(Sx({xhrCallback:v=>{t.xhrNetworkContents.push(v)},fetchCallback:v=>{t.fetchNetworkContents.push(v)},webSocketRequestCallback:v=>{t.webSocketNetworkContents&&t.webSocketNetworkContents.push(v)},webSocketEventCallback:v=>{t.webSocketEventContents.push(v)},disableWebSocketRecording:t.disableRecordingWebSocketContents,bodyKeysToRedact:t.networkBodyKeysToRedact,highlightEndpoints:t.highlightEndpoints,tracingOrigins:t.tracingOrigins,urlBlocklist:t.urlBlocklist,bodyKeysToRecord:t.networkBodyKeysToRecord})))}static getRecordedNetworkResources(t,r){var s,o;let n=[],i=[];if(!t.disableNetworkRecording){const l=((s=window==null?void 0:window.performance)==null?void 0:s.timeOrigin)||0;n=performance.getEntriesByType("resource");const u=(r-l)*2;if(n=n.filter(a=>a.responseEnd<t.lastNetworkRequestTimestamp?!1:Cs(a.name,t.highlightEndpoints)).map(a=>B(x({},a.toJSON()),{offsetStartTime:a.startTime-u,offsetResponseEnd:a.responseEnd-u,offsetFetchStart:a.fetchStart-u})),t.lastNetworkRequestTimestamp=((o=n.at(-1))==null?void 0:o.responseEnd)||t.lastNetworkRequestTimestamp,t.enableRecordingNetworkContents){const a={headersToRedact:t.networkHeadersToRedact,headersToRecord:t.networkHeaderKeysToRecord,requestResponseSanitizer:t.requestResponseSanitizer};n=Bp(n,t.xhrNetworkContents,"xmlhttprequest",a),n=Bp(n,t.fetchNetworkContents,"fetch",a)}}return t.disableRecordingWebSocketContents||(i=t.webSocketNetworkContents||[]),[...n,...i]}static getRecordedWebSocketEvents(t){let r=[];return!t.disableNetworkRecording&&!t.disableRecordingWebSocketContents&&(r=t.webSocketEventContents),r}static clearRecordedNetworkResources(t){t.disableNetworkRecording||(t.xhrNetworkContents=[],t.fetchNetworkContents=[],t.webSocketNetworkContents=[],t.webSocketEventContents=[],performance.clearResourceTimings())}}const Zg=(e,t,r)=>{switch(e){case"strict":return[!0,void 0];case"default":return[!0,void 0];case"none":return[!!t,B(x({},r),{password:!0})]}};let ft,Gu;function Lg(e,t){return e.nodeType,Node.ELEMENT_NODE,Pu(e);return wx(e,t)}function Vu(e){if(e.id.length)return`#${e.id}`;if(e.classList.length){let t=[];for(const r of e.classList)t.push(`.${r}`);return`${e.nodeName.toLowerCase()}${t.join(",")}`}return e.nodeName.toLowerCase()}function wx(e,t){if(e.tagName.toLowerCase()==="html")return"html";try{const r={root:document.body,idName:i=>!0,className:i=>!0,tagName:i=>!0,attr:(i,s)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:50,maxNumberOfTries:1e3,optimized:!0};ft=x(x({},r),t),Gu=Rx(ft.root,r);let n=ku(e,0,()=>ku(e,1,()=>ku(e,2)));if(n){if(ft.optimized){const i=Vg(kg(n,e));i.length>0&&(n=i[0])}return Js(n)}else return Pu(e)}catch(r){return Pu(e)}}function Rx(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function ku(e,t,r){let n=null,i=[],s=e,o=0;for(;s&&s!==ft.root.parentElement;){let l=Hs(_x(s))||Hs(...Tx(s))||Hs(...Ex(s))||Hs(Ix(s))||[Cx()];const u=Zx(s);if(t===0)u&&(l=l.concat(l.filter(Wu).map(a=>Xu(a,u))));else if(t===1)l=l.slice(0,1),u&&(l=l.concat(l.filter(Wu).map(a=>Xu(a,u))));else if(t===2){const[a]=l=l.slice(0,1);u&&Wu(a)&&(l=[Xu(a,u)])}for(let a of l)a.level=o;if(i.push(l),i.length>=ft.seedMinLength&&(n=xg(i,r),n))break;s=s.parentElement,o++}return n||(n=xg(i,r)),n}function xg(e,t){const r=Vg(Gg(e));if(r.length>ft.threshold)return t?t():null;for(let n of r)if(Og(n))return n;return null}function Js(e){let t=e[0],r=t.name;for(let n=1;n<e.length;n++){const i=e[n].level||0;t.level===i-1?r=`${e[n].name} > ${r}`:r=`${e[n].name} ${r}`,t=e[n]}return r}function Ng(e){return e.map(t=>t.penalty).reduce((t,r)=>t+r,0)}function Og(e){switch(Gu.querySelectorAll(Js(e)).length){case 0:return!0;case 1:return!0;default:return!1}}function _x(e){const t=e.getAttribute("id");return t&&ft.idName(t)?{name:"#"+Ys(t,{isIdentifier:!0}),penalty:0}:null}function Tx(e){return Array.from(e.attributes).filter(r=>ft.attr(r.name,r.value)).map(r=>({name:"["+Ys(r.name,{isIdentifier:!0})+'="'+Ys(r.value)+'"]',penalty:.5}))}function Ex(e){return Array.from(e.classList).filter(ft.className).map(r=>({name:"."+Ys(r,{isIdentifier:!0}),penalty:1}))}function Ix(e){const t=e.tagName.toLowerCase();return ft.tagName(t)?{name:t,penalty:2}:null}function Cx(){return{name:"*",penalty:3}}function Zx(e){const t=e.parentNode;if(!t)return null;let r=t.firstChild;if(!r)return null;let n=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&n++,r!==e);)r=r.nextSibling;return n}function Xu(e,t){return{name:e.name+`:nth-child(${t})`,penalty:e.penalty+1}}function Wu(e){return e.name!=="html"&&!e.name.startsWith("#")}function Hs(...e){const t=e.filter(Lx);return t.length>0?t:null}function Lx(e){return e!=null}function*Gg(e,t=[]){if(e.length>0)for(let r of e[0])yield*fc(Gg(e.slice(1,e.length),t.concat(r)));else yield t}function Vg(e){return Array.from(e).sort((t,r)=>Ng(t)-Ng(r))}function*kg(e,t,r={counter:0,visited:new Map}){if(e.length>2&&e.length>ft.optimizedMinLength)for(let n=1;n<e.length-1;n++){if(r.counter>ft.maxNumberOfTries)return;r.counter+=1;const i=[...e];i.splice(n,1);const s=Js(i);if(r.visited.has(s))return;Og(i)&&xx(i,t)&&(yield i,r.visited.set(s,!0),yield*fc(kg(i,t,r)))}}function xx(e,t){return Gu.querySelector(Js(e))===t}const Nx=/[ -,\.\/:-@\[-\^`\{-~]/,Ox=/[ -,\.\/:-@\[\]\^`\{-~]/,Gx=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,Vx={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1};function Ys(e,t={}){const r=x(x({},Vx),t);r.quotes!="single"&&r.quotes!="double"&&(r.quotes="single");const n=r.quotes=="double"?'"':"'",i=r.isIdentifier,s=e.charAt(0);let o="",l=0;const u=e.length;for(;l<u;){const a=e.charAt(l++);let h=a.charCodeAt(0),c;if(h<32||h>126){if(h>=55296&&h<=56319&&l<u){const f=e.charCodeAt(l++);(f&64512)==56320?h=((h&1023)<<10)+(f&1023)+65536:l--}c="\\"+h.toString(16).toUpperCase()+" "}else r.escapeEverything?Nx.test(a)?c="\\"+a:c="\\"+h.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(a)?c="\\"+h.toString(16).toUpperCase()+" ":a=="\\"||!i&&(a=='"'&&n==a||a=="'"&&n==a)||i&&Ox.test(a)?c="\\"+a:c=a;o+=c}return i&&(/^-[-\d]/.test(o)?o="\\-"+o.slice(1):/\d/.test(s)&&(o="\\3"+s+" "+o.slice(1))),o=o.replace(Gx,function(a,h,c){return h&&h.length%2?a:(h||"")+c}),!i&&r.wrap?n+o+n:o}const Pu=e=>{let t="";const r=e.getAttribute("class"),n=e.getAttribute("id");return n&&(t=t.concat(Xg(n,"#"))),r&&(t=t.concat(Xg(r,"."))),t===""&&(t=t.concat(e.tagName.toLowerCase())),t},Xg=(e,t)=>`${t}${e.trim().split(" ").join(t)}`,Wg=e=>{const t=n=>{if(n.target){const i=n.target,s=Lg(i);e(s,n)}},r={capture:!0};return window.addEventListener("click",t,r),()=>window.removeEventListener("click",t,r)},Pg=e=>{const t=r=>{if(r.target){const n=Lg(r.target);e(n)}};return window.addEventListener("focusin",t),()=>window.removeEventListener("focusin",t)},kx=30,Xx=()=>new Promise(e=>requestAnimationFrame(t=>requestAnimationFrame(r=>e(r-t)))),Wx=()=>$(this,null,function*(){const e=[];for(let t=0;t<kx;t++)e.push(yield Xx());return e.reduce((t,r)=>t+r,0)/e.length}),Mg=(e,t)=>{let r={},n=16.666666666666668;Wx().then(u=>n=u);const i=u=>{var a;r!=null&&r.event||(r={event:u,location:window.location.href,timerStart:(a=window.performance)==null?void 0:a.now()},window.requestAnimationFrame(s))},s=()=>{if(!(r!=null&&r.timerStart))return;const u=window.performance.now()-r.timerStart-n;o(u),r={}},o=u=>{const a=(new Date().getTime()-t)/1e3;e({relativeTimestamp:a,jankAmount:u,querySelector:l(),newLocation:window.location.href!=r.location?window.location.href:void 0})},l=()=>{var u;return(u=r==null?void 0:r.event)!=null&&u.target?Vu(r.event.target):""};return window.addEventListener("click",i,!0),window.addEventListener("keydown",i,!0),()=>{window.removeEventListener("keydown",i,!0),window.removeEventListener("click",i,!0)}},Ag=e=>{let t,r;if(typeof document.hidden!="undefined"?(t="hidden",r="visibilitychange"):typeof document.msHidden!="undefined"?(t="msHidden",r="msvisibilitychange"):typeof document.webkitHidden!="undefined"&&(t="webkitHidden",r="webkitvisibilitychange"),r===void 0)return()=>{};if(t===void 0)return()=>{};const n=t,i=()=>{const o=document[n];e(!!o)};document.addEventListener(r,i);const s=r;return()=>document.removeEventListener(s,i)},Ug=typeof window!="undefined"&&"performance"in window&&"memory"in performance?performance:{memory:{}},Dg=(e,t)=>{let r=0,n=0;const i=()=>{const h=(new Date().getTime()-t)/1e3,c=Ug.memory.jsHeapSizeLimit||0,f=Ug.memory.usedJSHeapSize||0;e({jsHeapSizeLimit:c,usedJSHeapSize:f,relativeTimestamp:h,fps:r})};i();let s;s=setInterval(()=>{i()},1e3);let o=0,l=Date.now();const u=function(){var a=Date.now();o++,a>1e3+l&&(r=Math.round(o*1e3/(a-l)),o=0,l=a),n=requestAnimationFrame(u)};return u(),()=>{clearInterval(s),cancelAnimationFrame(n)}},Fg=e=>{e(window.location.href);var t=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(s){setTimeout(()=>{var l;var o;try{o=JSON.parse((l=s==null?void 0:s.toString())!=null?l:"")}catch(u){return}(o.type==="track"||o.type==="identify")&&Mu(o)&&e(o)},100),t.call(this,s)};const r=s=>{if(s.key==="ajs_user_id"||s.key==="ajs_anonymous_id"||s.key==="ajs_user_traits"){const{userId:o,userTraits:l}=Jg();if(o){let u={};l&&(u=JSON.parse(l));const a={type:"identify",userId:o.toString(),traits:u};Mu(a)&&e(a)}}},{userId:n,userTraits:i}=Jg();if(n){let s={};i&&(s=JSON.parse(i));const o={type:"identify",userId:n.toString(),traits:s};Mu(o)&&e(o)}return window.addEventListener("storage",r),rI(({keyName:s})=>{r({key:s})}),()=>{window.removeEventListener("storage",r),XMLHttpRequest.prototype.send=t}},Jg=()=>{const e=Fe("ajs_user_id"),t=Fe("ajs_user_traits"),r=Fe("ajs_anonymous_id");return{userId:e,userTraits:t,anonymousId:r}},Mu=e=>{if(!e)return!1;let t="";try{t=JSON.stringify(e)}catch(i){return!1}const r=Px(t),n=Fe(Ne.SEGMENT_LAST_SENT_HASH_KEY);return n===void 0||r!==n?(ct(Ne.SEGMENT_LAST_SENT_HASH_KEY,r),!0):!1},Px=e=>{var t=0,r=e.length,n=0;if(r>0)for(;n<r;)t=(t<<5)-t+e.charCodeAt(n++)|0;return t.toString()},Hg=(e,t)=>{const r=Mx(e);let n=[];const i=!1,s=!0,o=[];for(let u=0;u<r.length;u++){let a=r[u].split("+");n=[],a.length>1&&(n=Dx(Bg,a)),a=a[a.length-1],a=a==="*"?"*":Ux(a),a in _t||(_t[a]=[]);const h={mods:n,shortcut:r[u],key:r[u],method:t,keyup:i,keydown:s,scope:"all",splitKey:"+"};_t[a].push(h),o.push({key:a,handler:h})}const l=u=>Hx(u);return Fx(document,"keydown",l),()=>{document.removeEventListener("keydown",l);for(const{key:u,handler:a}of o){const h=_t[u],c=h?h.indexOf(a):-1;c>-1&&h.splice(c,1)}}};let ze=[];function Mx(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let r=t.lastIndexOf("");for(;r>=0;)t[r-1]+=",",t.splice(r,1),r=t.lastIndexOf("");return t}const _t={},Au=typeof navigator!="undefined"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1,Ax={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Au?173:189,"=":Au?61:187,";":Au?59:186,"'":222,"[":219,"]":221,"\\":220},Yg={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ke={16:!1,18:!1,17:!1,91:!1},Bg={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Ux=e=>Ax[e.toLowerCase()]||Bg[e.toLowerCase()]||e.toUpperCase().charCodeAt(0);function Dx(e,t){const r=t.slice(0,t.length-1);for(let n=0;n<r.length;n++)r[n]=e[r[n].toLowerCase()];return r}function Fx(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent&&e.attachEvent(`on${t}`,()=>{r(window.event)})}function Jx(e,t,r){let n;if(t.scope===r||t.scope==="all"){n=t.mods.length>0;for(const i in Ke)Object.prototype.hasOwnProperty.call(Ke,i)&&(!Ke[i]&&t.mods.indexOf(+i)>-1||Ke[i]&&t.mods.indexOf(+i)===-1)&&(n=!1);(t.mods.length===0&&!Ke[16]&&!Ke[18]&&!Ke[17]&&!Ke[91]||n||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function Hx(e){const t=_t["*"];let r=e.keyCode||e.which||e.charCode;if((r===93||r===224)&&(r=91),ze.indexOf(r)===-1&&r!==229&&ze.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(n=>{const i=Yg[n];e[n]&&ze.indexOf(i)===-1?ze.push(i):!e[n]&&ze.indexOf(i)>-1?ze.splice(ze.indexOf(i),1):n==="metaKey"&&e[n]&&ze.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(ze=ze.slice(ze.indexOf(i))))}),!(r in Ke&&(Ke[r]=!0,!t))){for(const n in Ke)Object.prototype.hasOwnProperty.call(Ke,n)&&(Ke[n]=e[Yg[n]]);if(e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(ze.indexOf(17)===-1&&ze.push(17),ze.indexOf(18)===-1&&ze.push(18),Ke[17]=!0,Ke[18]=!0),r in _t){for(let n=0;n<_t[r].length;n++)if((e.type==="keydown"&&_t[r][n].keydown||e.type==="keyup"&&_t[r][n].keyup)&&_t[r][n].key){const i=_t[r][n];Jx(e,i,"all")}}}}const Uu=e=>{let t;const n=()=>{clearTimeout(t),t=setTimeout(()=>{var i,s;e({height:window.innerHeight,width:window.innerWidth,availHeight:window.screen.availHeight,availWidth:window.screen.availWidth,colorDepth:window.screen.colorDepth,pixelDepth:window.screen.pixelDepth,orientation:(s=(i=window.screen.orientation)==null?void 0:i.angle)!=null?s:0})},500)};return window.addEventListener("resize",n),n(),()=>window.removeEventListener("resize",n)};var ir,Yn,zg,Bs,Du,en=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},Bn=function(e){if(document.readyState==="loading")return"loading";var t=en();if(t){if(e<t.domInteractive)return"loading";if(t.domContentLoadedEventStart===0||e<t.domContentLoadedEventStart)return"dom-interactive";if(t.domComplete===0||e<t.domComplete)return"dom-content-loaded"}return"complete"},Yx=function(e){var t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},zs=function(e,t){var r="";try{for(;e&&e.nodeType!==9;){var n=e,i=n.id?"#"+n.id:Yx(n)+(n.classList&&n.classList.value&&n.classList.value.trim()&&n.classList.value.trim().length?"."+n.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+i.length>99)return r||i;if(r=r?i+">"+r:i,n.id)break;e=n.parentNode}}catch(s){}return r},Kg=-1,jg=function(){return Kg},xr=function(e){addEventListener("pageshow",function(t){t.persisted&&(Kg=t.timeStamp,e(t))},!0)},Ks=function(){var e=en();return e&&e.activationStart||0},pt=function(e,t){var r=en(),n="navigate";return jg()>=0?n="back-forward-cache":r&&(document.prerendering||Ks()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},tn=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(i){Promise.resolve().then(function(){t(i.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(i){}},mt=function(e,t,r,n){var i,s;return function(o){t.value>=0&&(o||n)&&((s=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=s,t.rating=function(l,u){return l>u[1]?"poor":l>u[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Fu=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},js=function(e){var t=function(r){r.type!=="pagehide"&&document.visibilityState!=="hidden"||e(r)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},Ju=function(e){var t=!1;return function(r){t||(e(r),t=!0)}},rn=-1,Qg=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Qs=function(e){document.visibilityState==="hidden"&&rn>-1&&(rn=e.type==="visibilitychange"?e.timeStamp:0,Bx())},$g=function(){addEventListener("visibilitychange",Qs,!0),addEventListener("prerenderingchange",Qs,!0)},Bx=function(){removeEventListener("visibilitychange",Qs,!0),removeEventListener("prerenderingchange",Qs,!0)},Hu=function(){return rn<0&&(rn=Qg(),$g(),xr(function(){setTimeout(function(){rn=Qg(),$g()},0)})),{get firstHiddenTime(){return rn}}},zn=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},qg=[1800,3e3],ey=function(e,t){t=t||{},zn(function(){var r,n=Hu(),i=pt("FCP"),s=tn("paint",function(o){o.forEach(function(l){l.name==="first-contentful-paint"&&(s.disconnect(),l.startTime<n.firstHiddenTime&&(i.value=Math.max(l.startTime-Ks(),0),i.entries.push(l),r(!0)))})});s&&(r=mt(e,i,qg,t.reportAllChanges),xr(function(o){i=pt("FCP"),r=mt(e,i,qg,t.reportAllChanges),Fu(function(){i.value=performance.now()-o.timeStamp,r(!0)})}))})},ty=[.1,.25],zx=function(e,t){(function(r,n){n=n||{},ey(Ju(function(){var i,s=pt("CLS",0),o=0,l=[],u=function(h){h.forEach(function(c){if(!c.hadRecentInput){var f=l[0],d=l[l.length-1];o&&c.startTime-d.startTime<1e3&&c.startTime-f.startTime<5e3?(o+=c.value,l.push(c)):(o=c.value,l=[c])}}),o>s.value&&(s.value=o,s.entries=l,i())},a=tn("layout-shift",u);a&&(i=mt(r,s,ty,n.reportAllChanges),js(function(){u(a.takeRecords()),i(!0)}),xr(function(){o=0,s=pt("CLS",0),i=mt(r,s,ty,n.reportAllChanges),Fu(function(){return i()})}),setTimeout(i,0))}))})(function(r){(function(n){if(n.entries.length){var i=n.entries.reduce(function(l,u){return l&&l.value>u.value?l:u});if(i&&i.sources&&i.sources.length){var s=(o=i.sources).find(function(l){return l.node&&l.node.nodeType===1})||o[0];if(s)return void(n.attribution={largestShiftTarget:zs(s.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:s,largestShiftEntry:i,loadState:Bn(i.startTime)})}}var o;n.attribution={}})(r),e(r)},t)},Kx=function(e,t){ey(function(r){(function(n){if(n.entries.length){var i=en(),s=n.entries[n.entries.length-1];if(i){var o=i.activationStart||0,l=Math.max(0,i.responseStart-o);return void(n.attribution={timeToFirstByte:l,firstByteToFCP:n.value-l,loadState:Bn(n.entries[0].startTime),navigationEntry:i,fcpEntry:s})}}n.attribution={timeToFirstByte:0,firstByteToFCP:n.value,loadState:Bn(jg())}})(r),e(r)},t)},Kn={passive:!0,capture:!0},jx=new Date,ry=function(e,t){ir||(ir=t,Yn=e,zg=new Date,iy(removeEventListener),ny())},ny=function(){if(Yn>=0&&Yn<zg-jx){var e={entryType:"first-input",name:ir.type,target:ir.target,cancelable:ir.cancelable,startTime:ir.timeStamp,processingStart:ir.timeStamp+Yn};Bs.forEach(function(t){t(e)}),Bs=[]}},Qx=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;e.type=="pointerdown"?function(r,n){var i=function(){ry(r,n),o()},s=function(){o()},o=function(){removeEventListener("pointerup",i,Kn),removeEventListener("pointercancel",s,Kn)};addEventListener("pointerup",i,Kn),addEventListener("pointercancel",s,Kn)}(t,e):ry(t,e)}},iy=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,Qx,Kn)})},sy=[100,300],$x=function(e,t){t=t||{},zn(function(){var r,n=Hu(),i=pt("FID"),s=function(u){u.startTime<n.firstHiddenTime&&(i.value=u.processingStart-u.startTime,i.entries.push(u),r(!0))},o=function(u){u.forEach(s)},l=tn("first-input",o);r=mt(e,i,sy,t.reportAllChanges),l&&js(Ju(function(){o(l.takeRecords()),l.disconnect()})),l&&xr(function(){var u;i=pt("FID"),r=mt(e,i,sy,t.reportAllChanges),Bs=[],Yn=-1,ir=null,iy(addEventListener),u=s,Bs.push(u),ny()})})},qx=function(e,t){$x(function(r){(function(n){var i=n.entries[0];n.attribution={eventTarget:zs(i.target),eventType:i.name,eventTime:i.startTime,eventEntry:i,loadState:Bn(i.startTime)}})(r),e(r)},t)},oy=0,Yu=1/0,$s=0,eN=function(e){e.forEach(function(t){t.interactionId&&(Yu=Math.min(Yu,t.interactionId),$s=Math.max($s,t.interactionId),oy=$s?($s-Yu)/7+1:0)})},ay=function(){return Du?oy:performance.interactionCount||0},tN=function(){"interactionCount"in performance||Du||(Du=tn("event",eN,{type:"event",buffered:!0,durationThreshold:0}))},ly=[200,500],uy=0,cy=function(){return ay()-uy},Lt=[],Bu={},dy=function(e){var t=Lt[Lt.length-1],r=Bu[e.interactionId];if(r||Lt.length<10||e.duration>t.latency){if(r)r.entries.push(e),r.latency=Math.max(r.latency,e.duration);else{var n={id:e.interactionId,latency:e.duration,entries:[e]};Bu[n.id]=n,Lt.push(n)}Lt.sort(function(i,s){return s.latency-i.latency}),Lt.splice(10).forEach(function(i){delete Bu[i.id]})}},rN=function(e,t){t=t||{},zn(function(){var r;tN();var n,i=pt("INP"),s=function(l){l.forEach(function(h){h.interactionId&&dy(h),h.entryType==="first-input"&&!Lt.some(function(c){return c.entries.some(function(f){return h.duration===f.duration&&h.startTime===f.startTime})})&&dy(h)});var u,a=(u=Math.min(Lt.length-1,Math.floor(cy()/50)),Lt[u]);a&&a.latency!==i.value&&(i.value=a.latency,i.entries=a.entries,n())},o=tn("event",s,{durationThreshold:(r=t.durationThreshold)!==null&&r!==void 0?r:40});n=mt(e,i,ly,t.reportAllChanges),o&&("interactionId"in PerformanceEventTiming.prototype&&o.observe({type:"first-input",buffered:!0}),js(function(){s(o.takeRecords()),i.value<0&&cy()>0&&(i.value=0,i.entries=[]),n(!0)}),xr(function(){Lt=[],uy=ay(),i=pt("INP"),n=mt(e,i,ly,t.reportAllChanges)}))})},nN=function(e,t){rN(function(r){(function(n){if(n.entries.length){var i=n.entries.sort(function(s,o){return o.duration-s.duration||o.processingEnd-o.processingStart-(s.processingEnd-s.processingStart)})[0];n.attribution={eventTarget:zs(i.target),eventType:i.name,eventTime:i.startTime,eventEntry:i,loadState:Bn(i.startTime)}}else n.attribution={}})(r),e(r)},t)},hy=[2500,4e3],zu={},iN=function(e,t){(function(r,n){n=n||{},zn(function(){var i,s=Hu(),o=pt("LCP"),l=function(h){var c=h[h.length-1];c&&c.startTime<s.firstHiddenTime&&(o.value=Math.max(c.startTime-Ks(),0),o.entries=[c],i())},u=tn("largest-contentful-paint",l);if(u){i=mt(r,o,hy,n.reportAllChanges);var a=Ju(function(){zu[o.id]||(l(u.takeRecords()),u.disconnect(),zu[o.id]=!0,i(!0))});["keydown","click"].forEach(function(h){addEventListener(h,function(){return setTimeout(a,0)},!0)}),js(a),xr(function(h){o=pt("LCP"),i=mt(r,o,hy,n.reportAllChanges),Fu(function(){o.value=performance.now()-h.timeStamp,zu[o.id]=!0,i(!0)})})}})})(function(r){(function(n){if(n.entries.length){var i=en();if(i){var s=i.activationStart||0,o=n.entries[n.entries.length-1],l=o.url&&performance.getEntriesByType("resource").filter(function(d){return d.name===o.url})[0],u=Math.max(0,i.responseStart-s),a=Math.max(u,l?(l.requestStart||l.startTime)-s:0),h=Math.max(a,l?l.responseEnd-s:0),c=Math.max(h,o?o.startTime-s:0),f={element:zs(o.element),timeToFirstByte:u,resourceLoadDelay:a-u,resourceLoadTime:h-a,elementRenderDelay:c-h,navigationEntry:i,lcpEntry:o};return o.url&&(f.url=o.url),l&&(f.lcpResourceEntry=l),void(n.attribution=f)}}n.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadTime:0,elementRenderDelay:n.value}})(r),e(r)},t)},fy=[800,1800],sN=function e(t){document.prerendering?zn(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},oN=function(e,t){t=t||{};var r=pt("TTFB"),n=mt(e,r,fy,t.reportAllChanges);sN(function(){var i=en();if(i){var s=i.responseStart;if(s<=0||s>performance.now())return;r.value=Math.max(s-Ks(),0),r.entries=[i],n(!0),xr(function(){r=pt("TTFB",0),(n=mt(e,r,fy,t.reportAllChanges))(!0)})}})},aN=function(e,t){oN(function(r){(function(n){if(n.entries.length){var i=n.entries[0],s=i.activationStart||0,o=Math.max(i.domainLookupStart-s,0),l=Math.max(i.connectStart-s,0),u=Math.max(i.requestStart-s,0);n.attribution={waitingTime:o,dnsTime:l-o,connectionTime:u-l,requestTime:n.value-u,navigationEntry:i}}else n.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}})(r),e(r)},t)};const py=e=>(zx(e),Kx(e),qx(e),iN(e),aN(e),nN(e),()=>{}),nn=typeof navigator!="undefined"&&"connection"in navigator?navigator.connection:{},my=(e,t)=>{const r=()=>{const s=(new Date().getTime()-t)/1e3;e({relativeTimestamp:s,downlink:nn.downlink,downlinkMax:nn.downlinkMax,effectiveType:nn.effectiveType,rtt:nn.rtt,saveData:nn.saveData,type:nn.type})};r();let n;return n=setInterval(()=>{r()},1e3),()=>{clearInterval(n)}},qs="iframe parent ready",eo="iframe ok",jn="highlightLogs",lN=e=>{let t=Fe(jn)||"";t=t+"["+new Date().getTime()+"] "+e+`
466
+ ${d}`,S),w=_===-1,b=w?f.length:_,R=(o=/\bname="([^"]*)"/i.exec(y))==null?void 0:o[1];if(R!==void 0){const E=(l=/\bfilename="([^"]*)"/i.exec(y))==null?void 0:l[1];if(E!==void 0){const I=(h=(a=(u=/^content-type:[ \t]*(.*)$/im.exec(y))==null?void 0:u[1])==null?void 0:a.trim())!=null?h:"",C=b-S;wu(p,R,`[File name="${E}" type="${I}" size${w?">=":"="}${C}]`)}else wu(p,R,new TextDecoder().decode(c.subarray(S,b)))}m=w?-1:_+2}return e.truncated&&Object.keys(p).length===0?Ws(e):JSON.stringify(p)}catch(c){return Ws(e)}},zL=(e,t)=>{try{if(t&&t.body!==void 0&&t.body!==null)return Promise.resolve(rg(t.body));if(!e.body||e.bodyUsed)return Promise.resolve(void 0);const r=e.clone();if(!r.body)return Promise.resolve(void 0);const n=e.headers.get("content-type");return JL(r.body,$l(e.headers)).then(i=>ML(n)?BL(i,n):YL(i)).catch(()=>{})}catch(r){return Promise.resolve(void 0)}},KL=(e=[])=>{if(typeof window=="undefined"||typeof window.fetch!="function"||typeof Request=="undefined")return()=>{};const t=i=>e.some(s=>i.toLowerCase().includes(s)),r=window.fetch,n=function(i,s){return i instanceof Request&&!Ru.has(i)&&!t(i.url)&&Ru.set(i,zL(i,s)),r.call(this!=null?this:window,i,s)};return window.fetch=n,()=>{window.fetch===n&&(window.fetch=r)}};class _u{constructor(t,r){L(this,"debug");L(this,"name");this.debug=t,this.name=r}log(...t){if(this.debug){let r=`[${Date.now()}]`;this.name&&(r+=` - ${this.name}`),console.log.apply(console,[r,...t])}}warn(...t){let r=`[${Date.now()}]`;this.name&&(r+=` - ${this.name}`),console.warn.apply(console,[r,...t])}}class Tu{constructor(){L(this,"_sdk");L(this,"_isLoaded",!1);L(this,"_callBuffer",[]);L(this,"_capacity",1e5);L(this,"_droppedEvents",0);L(this,"_exceededCapacity",!1);L(this,"_logger",new _u)}_bufferCall(t,r){if(this._isLoaded)try{return this._sdk[t](...r)}catch(n){De(`Error executing buffered call to ${t}:`,"error",n)}else{this._enqueue({method:t,args:r});return}}_enqueue(t){this._callBuffer.length<this._capacity?(this._callBuffer.push(t),this._exceededCapacity=!1):(this._exceededCapacity||(this._exceededCapacity=!0,De("Exceeded event queue capacity. Increase capacity to avoid dropping events.","warn")),this._droppedEvents+=1)}load(t){this._sdk=t,this._isLoaded=!0;for(const{method:r,args:n}of this._callBuffer)try{this._sdk[r](...n)}catch(i){De(`Error executing buffered call to ${r}:`,"error",i)}this._callBuffer=[]}}const Je="feature_flag",ng="launchdarkly",Eu="evaluation",jL=`${Je}.${Eu}`,ig=`${Je}.set.id`,sg=`${Je}.key`,og=`${Je}.contextKeys`,ag=`${Je}.context.id`,lg=`${Je}.result.value`,Iu=`${Je}.provider.name`,Ps={kind:`${Je}.result.reason.kind`,errorKind:`${Je}.result.reason.errorKind`,ruleIndex:`${Je}.result.reason.ruleIndex`,ruleId:`${Je}.result.reason.ruleId`,prerequisiteKey:`${Je}.result.reason.prerequisiteKey`,inExperiment:`${Je}.result.reason.inExperiment`,bigSegmentsStatus:`${Je}.result.reason.bigSegmentsStatus`},ug=`${Je}.result.variationIndex`,cg=`${ng}.application.id`,dg=`${ng}.application.version`,QL="context.contextKeys",$L="$ld:telemetry:session:init",hg="$ld:telemetry:track",qL="launchdarkly.track",ex="page_view",tx="document_load",rx="result.status";function fg(e){return e.includes("%")||e.includes(":")?e.replace(/%/g,"%25").replace(/:/g,"%3A"):e}function pg(e){return e.kind==="multi"}function Ir(e){return pg(e)?Object.keys(e).sort().filter(t=>t!=="kind").map(t=>`${t}:${fg(e[t].key)}`).join(":"):"kind"in e&&e.kind==="user"?e.key:"kind"in e?`${e.kind}:${fg(e.key)}`:e.key}function Hn(e){return pg(e)?Object.keys(e).sort().filter(t=>t!=="kind").map(t=>({[t]:e[t].key})).reduce((t,r)=>x(x({},t),r),{}):"kind"in e?{[e.kind]:e.key}:{user:e.key}}function nx(e,t,r){t.addHook({getMetadata:()=>({name:"highlight.run"}),afterIdentify:(n,i,s)=>{var l,u;const o=B(x({},Hn(n.context)),{key:(u=(l=r==null?void 0:r.contextFriendlyName)==null?void 0:l.call(r,n.context))!=null?u:Ir(n.context)});return e.log("LD.identify","INFO",o),s.status==="completed"&&e.identify(o.key,o,"LaunchDarkly"),i},afterEvaluation:(n,i,s)=>{const o=x({[Iu]:"LaunchDarkly",[sg]:n.flagKey,[lg]:JSON.stringify(s.value)},s.variationIndex!==void 0&&s.variationIndex!==null?{[ug]:s.variationIndex}:{});if(s.reason)for(const l in Ps){const u=l,a=s.reason[u];a!=null&&(o[Ps[u]]=a)}return n.context&&(o[og]=JSON.stringify(Hn(n.context)),o[ag]=Ir(n.context)),e.startSpan(Eu,l=>{l&&l.addEvent(jL,o)}),i}})}class ix{constructor(t,r){L(this,"client");L(this,"metadata");this.client=t,this.metadata=r}getHooks(t){return[]}init(t){this.client.track($L,{sessionID:t})}recordGauge(t,r){}identify(t,r,n={},i){}error(t,r){}track(t,r){const n=r.event;this.client.track(n?`${hg}:${n}`:hg,B(x({},r),{sessionID:t}))}}class Ms extends Tu{constructor(r,n){super();L(this,"client");this.client=new ix(r,n)}getHooks(r){return[{getMetadata:()=>({name:"highlight.run/ld"}),afterIdentify:(n,i,s)=>(this.load(this.client),i)}]}init(r){return this._bufferCall("init",[r])}recordGauge(r,n){return this._bufferCall("recordGauge",[r,n])}identify(r,n,i={},s){return this._bufferCall("identify",[r,n,i,s])}error(r,n){return this._bufferCall("error",[r,n])}track(r,n){return this._bufferCall("track",[r,n])}}const Cu=e=>{e(window.location.href);const t=history.pushState;history.pushState=(s=>function(){var l=s.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),l})(history.pushState);const r=history.replaceState;history.replaceState=(s=>function(){var l=s.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),l})(history.replaceState);const n=()=>{window.dispatchEvent(new Event("locationchange"))};window.addEventListener("popstate",n);const i=function(){e(window.location.href)};return window.addEventListener("locationchange",i),()=>{window.removeEventListener("popstate",n),window.removeEventListener("locationchange",i),history.pushState=t,history.replaceState=r}},an=class an extends Wn{constructor(r={}){super(an.moduleName,an.version,r);L(this,"_getLDContextKeyAttributes");L(this,"_unlisten");L(this,"_lastUrl","");this._getLDContextKeyAttributes=r.getLDContextKeyAttributes}init(){}enable(){this._lastUrl=window.location.href,this._unlisten=Cu(r=>{var i;const n=this._lastUrl;if(this._lastUrl=r,n!==r)try{const s=this.tracer.startSpan(ex,{attributes:{[er]:r,"page_view.previous_url":n,"page_view.url":r}}),o=(i=this._getLDContextKeyAttributes)==null?void 0:i.call(this);o&&s.setAttributes(o),s.end()}catch(s){this._diag.error("failed to create page view span",s)}})}disable(){var r;(r=this._unlisten)==null||r.call(this),this._unlisten=void 0}};L(an,"version","0.1.0"),L(an,"moduleName","location-change");let Zu=an;const Lu={version:"1.2.0"}.version;let Me={},Ut,As,Cr,Zr;const Lr="highlight.record",sx="highlight.session_id",Us=new Map,xu=e=>`${e.spanContext().traceId}:${e.spanContext().spanId}`,mg="launchdarkly.js.log",ox="launchdarkly.exception.id",gg="launchdarkly.sampling.ratio",yg="log.severity",bg="log.message",vg=(e,t)=>{var g,v,y,S,_,w,b,R,E,I,C,N,G,Q;if(Me.tracerProvider||Me.meterProvider){console.warn("OTEL already initialized. Skipping...");return}Ut=e;const r=e.backendUrl||void 0||"https://pub.highlight.io",n=[...(v=(g=e.networkRecordingOptions)==null?void 0:g.urlBlocklist)!=null?v:[],...Fp],i=[r,e.otlpEndpoint].filter(Z=>!!Z).map(Z=>Z.toLowerCase()),s=(y=e.environment)!=null?y:"production",o={url:e.otlpEndpoint+"/v1/traces",concurrencyLimit:10,timeoutMillis:3e4,compression:"gzip",keepAlive:!0,httpAgentOptions:{timeout:6e4,keepAlive:!0}},l=new OL(o,t),u=new Ds(l,{maxExportBatchSize:1024,maxQueueSize:2048,exportTimeoutMillis:o.timeoutMillis,scheduledDelayMillis:5e3}),a=new Pn({[PT]:(S=e.serviceName)!=null?S:"highlight-browser",[MT]:e.serviceVersion,"deployment.environment.name":s,"highlight.project_id":e.projectId,[UT]:navigator.userAgent,"browser.language":navigator.language,"telemetry.distro.name":"@highlight-run/observability","telemetry.distro.version":Lu});Me.tracerProvider=new gT({resource:a,mergeResourceWithDefaults:!0,spanProcessors:[u]}),Se.setGlobalTracerProvider(Me.tracerProvider);const h=new GL(B(x({},o),{url:e.otlpEndpoint+"/v1/metrics"})),c=new HC({exporter:h,exportIntervalMillis:o.timeoutMillis,exportTimeoutMillis:o.timeoutMillis});Me.meterProvider=new NZ({resource:a,readers:[c]}),yl.setGlobalMeterProvider(Me.meterProvider);let f=[];if(((_=e.instrumentations)==null?void 0:_["@opentelemetry/instrumentation-document-load"])!==!1&&f.push(new HT({applyCustomAttributesOnSpan:{documentLoad:Tg,documentFetch:Tg,resourceFetch:bx}})),((w=e.instrumentations)==null?void 0:w["@opentelemetry/instrumentation-user-interaction"])!==!1&&f.push(new Su({productAnalyticsEvents:e.productAnalyticsEvents,getLDContextKeyAttributes:e.getLDContextKeyAttributes})),((b=e.productAnalyticsEvents)==null?void 0:b.pageViews)!==!1&&f.push(new Zu({getLDContextKeyAttributes:e.getLDContextKeyAttributes})),(R=e.networkRecordingOptions)!=null&&R.enabled){if(((E=e.instrumentations)==null?void 0:E["@opentelemetry/instrumentation-fetch"])!==!1){const W=new vE({propagateTraceHeaderCorsUrls:Ig(e.tracingOrigins),applyCustomAttributesOnSpan:(k,M,D)=>{var P;if(!k.attributes)return;const U=k;if(U.attributes[Lr]===!1)return;const q=typeof Request!="undefined"&&M instanceof Request,fe=q?FL(M):void 0;Rg(k,q?void 0:M.body,M.headers,e.networkRecordingOptions);const O=()=>$(this,null,function*(){const F=yield fe;F!==void 0&&dx(k,F,M.headers,e.networkRecordingOptions)}),pe=()=>{var F;return(F=e.networkRecordingOptions)!=null&&F.requestResponseSanitizer&&_g(k,e.networkRecordingOptions.requestResponseSanitizer),U.attributes[Lr]!==!1};if(!(D instanceof Response)){if(k.setAttributes({"http.response.error":D.message,[Tp]:D.status}),!pe())return;fe&&Us.set(xu(k),O().then(()=>{pe()}));return}if(pe()&&(P=e.networkRecordingOptions)!=null&&P.recordHeadersAndBody){const F=$(this,null,function*(){var ge,K,le,Te,Jt;yield O();const Y=yield $p(D,(ge=e.networkRecordingOptions)==null?void 0:ge.bodyKeysToRecord,(K=e.networkRecordingOptions)==null?void 0:K.networkBodyKeysToRedact),j=Object.fromEntries(D.headers.entries()),ne=Es((Te=(le=e.networkRecordingOptions)==null?void 0:le.networkHeadersToRedact)!=null?Te:[],j,(Jt=e.networkRecordingOptions)==null?void 0:Jt.headerKeysToRecord),ae=Ou(ne,"http.response.header");Object.assign(k.attributes,x({"http.response.body":Y},ae)),pe()});Us.set(xu(k),F)}}});f.push(W)}((I=e.instrumentations)==null?void 0:I["@opentelemetry/instrumentation-xml-http-request"])!==!1&&f.push(new DE({propagateTraceHeaderCorsUrls:Ig(e.tracingOrigins),applyCustomAttributesOnSpan:(W,k)=>{var U,q,fe,O;const M=k;if(!(!W.attributes||W.attributes[Lr]===!1)){if(Rg(W,M._body,M._requestHeaders,e.networkRecordingOptions),(U=e.networkRecordingOptions)!=null&&U.recordHeadersAndBody){let pe="";(k.responseType===""||k.responseType==="text")&&(pe=Ct(k.responseText,(q=e.networkRecordingOptions)==null?void 0:q.networkBodyKeysToRedact,(fe=e.networkRecordingOptions)==null?void 0:fe.bodyKeysToRecord,void 0));const P=hx(k.getAllResponseHeaders());gx(W,P,pe,e.networkRecordingOptions)}(O=e.networkRecordingOptions)!=null&&O.requestResponseSanitizer&&_g(W,e.networkRecordingOptions.requestResponseSanitizer)}}}))}O_({instrumentations:f}),(C=e.networkRecordingOptions)!=null&&C.enabled&&e.networkRecordingOptions.recordHeadersAndBody&&((N=e.instrumentations)==null?void 0:N["@opentelemetry/instrumentation-xml-http-request"])!==!1&&(Cr==null||Cr(),Cr=WL([...n,...i])),(G=e.networkRecordingOptions)!=null&&G.enabled&&e.networkRecordingOptions.recordHeadersAndBody&&((Q=e.instrumentations)==null?void 0:Q["@opentelemetry/instrumentation-fetch"])!==!1&&(Zr==null||Zr(),Zr=KL([...n,...i]));const m=new vp;return m.enable(),Me.tracerProvider.register({contextManager:m,propagator:new Mf({propagators:[new xf,new lx({backendUrl:r,otlpEndpoint:e.otlpEndpoint,tracingOrigins:e.tracingOrigins,urlBlocklist:n})]})}),As=ax(l,h,u,()=>Me),Me},ax=(e,t,r,n)=>{if(typeof document=="undefined"||typeof window=="undefined")return()=>{};const i=()=>{var u,a;e.setUnloading(!0),t.setUnloading(!0),r.setSkipPendingOnFlush(!0);const l=n();(u=l.tracerProvider)==null||u.forceFlush().catch(()=>{}),(a=l.meterProvider)==null||a.forceFlush().catch(()=>{})},s=()=>{document.visibilityState==="hidden"?i():document.visibilityState==="visible"&&(e.setUnloading(!1),t.setUnloading(!1),r.setSkipPendingOnFlush(!1))},o=()=>i();return document.addEventListener("visibilitychange",s),window.addEventListener("pagehide",o),()=>{document.removeEventListener("visibilitychange",s),window.removeEventListener("pagehide",o)}};class Ds extends fp{constructor(){super(...arguments);L(this,"_pendingSpans",new Set);L(this,"_skipPendingOnFlush",!1)}setSkipPendingOnFlush(r){this._skipPendingOnFlush=r}onStart(r,n){r.setAttribute(sx,Pt()),super.onStart(r,n)}onEnd(r){if(r.attributes[Lr]===!1)return;const n=xu(r),i=Us.get(n);if(i){const s=i.catch(o=>{console.warn("[CustomBatchSpanProcessor] Failed to capture response body attributes",o)}).finally(()=>{Us.delete(n),this._pendingSpans.delete(s),r.attributes[Lr]!==!1&&super.onEnd(r)});this._pendingSpans.add(s);return}super.onEnd(r)}shutdown(){return $(this,null,function*(){return this._skipPendingOnFlush||(yield Promise.allSettled(this._pendingSpans)),hc(Ds.prototype,this,"shutdown").call(this)})}forceFlush(){return $(this,null,function*(){return this._skipPendingOnFlush||(yield Promise.allSettled(this._pendingSpans)),hc(Ds.prototype,this,"forceFlush").call(this)})}}class lx extends Ff{constructor(r){super();L(this,"highlightEndpoints");L(this,"tracingOrigins");L(this,"urlBlocklist");this.highlightEndpoints=[r.backendUrl,`${r.otlpEndpoint}/v1/traces`,`${r.otlpEndpoint}/v1/logs`,`${r.otlpEndpoint}/v1/metrics`],this.tracingOrigins=r.tracingOrigins,this.urlBlocklist=r.urlBlocklist}inject(r,n,i){var l;const s=Se.getSpan(r);if(!s||!s.attributes)return;const o=Cg(s);typeof o=="string"&&(yx(o,this.highlightEndpoints,this.tracingOrigins,this.urlBlocklist)||s.setAttribute(Lr,!1),!zl(o,(l=this.tracingOrigins)!=null?l:[],this.urlBlocklist))||super.inject(r,n,i)}}const Sg="highlight-browser",ux=Sg,Fs=()=>{var e;return(e=Me.tracerProvider)==null?void 0:e.getTracer(Sg)},nr=()=>{var e;return(e=Me.meterProvider)==null?void 0:e.getMeter(ux)},cx=()=>Se.getActiveSpan(),Nu=()=>$(this,null,function*(){As&&(As(),As=void 0),Cr&&(Cr(),Cr=void 0),Zr&&(Zr(),Zr=void 0),yield Promise.allSettled([$(this,null,function*(){Me.tracerProvider?(yield Me.tracerProvider.shutdown(),Me.tracerProvider=void 0):console.warn("OTEL shutdown called without initialized tracerProvider.")}),$(this,null,function*(){Me.meterProvider?(yield Me.meterProvider.shutdown(),Me.meterProvider=void 0):console.warn("OTEL shutdown called without initialized meterProvider.")})])}),wg=e=>{const t=FE(e),r={};return t!=null&&t.name&&(r["graphql.operation.name"]=t.name),t!=null&&t.type&&(r["graphql.operation.type"]=t.type),r},dx=(e,t,r,n)=>{if(!e.attributes)return;const i=e.attributes;Object.assign(i,wg(t)),n!=null&&n.recordHeadersAndBody&&Object.assign(i,{"http.request.body":Ct(t,n.networkBodyKeysToRedact,n.bodyKeysToRecord,eg(r))})},Rg=(e,t,r,n)=>{var h;if(!e.attributes)return;const s=Cg(e),o=Is(s),l=Jp(o),u=rg(t),a=eg(r);if(e.setAttributes(wg(u!=null?u:t)),e.setAttributes({"highlight.type":"http.request",[jr]:o,[er]:o,[ps]:l.pathname,[AT]:l.search}),e.setAttributes(fx(l.searchParams,"url.query_params")),n!=null&&n.recordHeadersAndBody){u!==void 0&&e.setAttribute("http.request.body",Ct(u,n.networkBodyKeysToRedact,n.bodyKeysToRecord,a));const c=Es((h=n.networkHeadersToRedact)!=null?h:[],a,n.headerKeysToRecord),f=Ou(c,"http.request.header");e.setAttributes(f)}},hx=e=>{const t={};return e&&e.trim().split(/[\r\n]+/).forEach(r=>{const n=r.split(": "),i=n.shift();i&&(t[i]=n.join(": "))}),t},Ou=(e,t)=>{const r={};return Object.entries(e).forEach(([n,i])=>{const s=n.toLowerCase().replace(/_/g,"-"),o=`${t}.${s}`,l=mx(s,i);if(r[o]){const u=r[o];Array.isArray(u)?r[o]=[...u,...l]:r[o]=[u,...l]}else r[o]=l.length===1?l[0]:l}),r},fx=(e,t)=>{const r={};for(const[n,i]of e.entries()){const s=`${t}.${n}`,o=r[s];o===void 0?r[s]=i:Array.isArray(o)?o.push(i):r[s]=[o,i]}return r},px=new Set(["accept","accept-charset","accept-encoding","accept-language","accept-ranges","allow","cache-control","connection","content-encoding","content-language","expect","if-match","if-none-match","pragma","proxy-authenticate","te","trailer","transfer-encoding","upgrade","vary","via","warning","www-authenticate","access-control-allow-headers","access-control-allow-methods","access-control-expose-headers","access-control-request-headers"]),mx=(e,t)=>px.has(e)?t.split(",").map(r=>r.trim()).filter(r=>r.length>0):[t],gx=(e,t,r,n)=>{var o;e.setAttribute("http.response.body",r);const i=Es((o=n.networkHeadersToRedact)!=null?o:[],t,n.headerKeysToRecord),s=Ou(i,"http.response.header");e.setAttributes(s)},_g=(e,t)=>{var c,f,d,p,m,g,v,y,S,_,w,b;const n=e.attributes,i={},s={};for(const[R,E]of Object.entries(n))R.startsWith("http.request.header.")&&(i[R.slice(20)]=String(E)),R.startsWith("http.response.header.")&&(s[R.slice(21)]=String(E));let l={request:{sessionSecureID:"",id:"",url:(f=(c=n[er])!=null?c:n[jr])!=null?f:"",verb:(p=(d=n["http.request.method"])!=null?d:n[GT])!=null?p:"GET",headers:i,body:(m=n["http.request.body"])!=null?m:""},response:{status:Number((v=(g=n[Tp])!=null?g:n[VT])!=null?v:0),headers:s,body:(y=n["http.response.body"])!=null?y:""},urlBlocked:!1},u=!0;try{l.request.body=JSON.parse(l.request.body)}catch(R){u=!1}let a=!0;try{l.response.body=JSON.parse(l.response.body)}catch(R){a=!1}let h;try{h=t(l)}catch(R){return}if(!h){Object.assign(e.attributes,{[Lr]:!1});return}u&&((S=h.request)!=null&&S.body)&&(h.request.body=JSON.stringify(h.request.body)),a&&((_=h.response)!=null&&_.body)&&(h.response.body=JSON.stringify(h.response.body)),Object.assign(e.attributes,{"http.request.body":(w=h.request.body)!=null?w:"","http.response.body":(b=h.response.body)!=null?b:""})},yx=(e,t,r,n)=>n!=null&&n.some(s=>e.toLowerCase().includes(s))?!1:Cs(e,t),Tg=e=>{var s,o,l;if(!e.events)return;const r=e.events,n={unload:ht("unloadEventStart","unloadEventEnd",r),dom_interactive:ht("fetchStart","domInteractive",r),dom_content_loaded:ht("domContentLoadedEventStart","domContentLoadedEventEnd",r),dom_complete:ht("fetchStart","domComplete",r),load_event:ht("loadEventStart","loadEventEnd",r),document_load:ht("fetchStart","loadEventEnd",r),first_paint:ht("fetchStart","firstPaint",r),first_contentful_paint:ht("fetchStart","firstContentfulPaint",r),domain_lookup:ht("domainLookupStart","domainLookupEnd",r),connect:ht("connectStart","connectEnd",r),request:ht("requestStart","requestEnd",r),response:ht("responseStart","responseEnd",r)},i=(o=(s=Ut==null?void 0:Ut.getIntegrations)==null?void 0:s.call(Ut))!=null?o:[];if(n.document_load!==void 0)for(const u of i)u.recordGauge((l=Ut==null?void 0:Ut.sessionSecureId)!=null?l:"",{name:tx,value:n.document_load/1e6});Object.entries(n).forEach(([u,a])=>{a!==void 0&&(e.setAttribute(`timings.${u}.ns`,a),e.setAttribute(`timings.${u}.readable`,Eg(a)))})};function ht(e,t,r){const n=r.find(l=>l.name===e),i=r.find(l=>l.name===t);if(!n||!i)return;const s=n.time[0]*1e9+n.time[1];return i.time[0]*1e9+i.time[1]-s}const bx=(e,t)=>{const r={domain_lookup:(t.domainLookupEnd-t.domainLookupStart)*1e6,connect:(t.connectEnd-t.connectStart)*1e6,request:(t.responseEnd-t.requestStart)*1e6,response:(t.responseEnd-t.responseStart)*1e6};Object.entries(r).forEach(([n,i])=>{e.setAttribute(`timings.${n}.ns`,i),e.setAttribute(`timings.${n}.readable`,Eg(i))})},Eg=e=>{if(e>=36e11){const o=e/36e11;return`${Number(o.toFixed(1))}h`}else if(e>=6e10){const o=e/6e10;return`${Number(o.toFixed(1))}m`}else if(e>=1e9){const o=e/1e9;return`${Number(o.toFixed(1))}s`}else if(e>=1e6){const o=e/1e6;return`${Number(o.toFixed(1))}ms`}else if(e>=1e3){const o=e/1e3;return`${Number(o.toFixed(1))}µs`}else return`${Number(e.toFixed(1))}ns`},Ig=e=>e===!0?[/localhost/,/^\//,zp(window.location.host)]:Array.isArray(e)?e.map(t=>typeof t=="string"?new RegExp(t):t):/^$/,Cg=e=>e.attributes[er]?e.attributes[er]:e.attributes[jr],vx=(e,t,r)=>{const n=window._highlightWebSocketRequestCallback;window._highlightWebSocketRequestCallback=e;const i=window._highlightWebSocketEventCallback;return window._highlightWebSocketEventCallback=s=>{const c=s,{message:o,size:l}=c,u=et(c,["message","size"]),h=r.some(f=>s.name.toLowerCase().includes(f))?u:s;t(h)},()=>{window._highlightWebSocketRequestCallback=n,window._highlightWebSocketEventCallback=i}},Sx=({xhrCallback:e,fetchCallback:t,webSocketRequestCallback:r,webSocketEventCallback:n,disableWebSocketRecording:i,bodyKeysToRedact:s,highlightEndpoints:o,tracingOrigins:l,urlBlocklist:u,bodyKeysToRecord:a})=>{const h=SI(e,o,l,u,s,a),c=EI(t,o,l,u,s,a),f=i?()=>{}:vx(r,n,u);return()=>{h(),c(),f()}};class Dt{constructor(t){L(this,"disableConsoleRecording");L(this,"reportConsoleErrors");L(this,"enablePromisePatch");L(this,"consoleMethodsToRecord");L(this,"listeners");L(this,"errors");L(this,"messages");L(this,"options");L(this,"hasNetworkRecording",!0);L(this,"disableNetworkRecording");L(this,"enableRecordingNetworkContents");L(this,"xhrNetworkContents");L(this,"fetchNetworkContents");L(this,"disableRecordingWebSocketContents");L(this,"webSocketNetworkContents");L(this,"webSocketEventContents");L(this,"tracingOrigins");L(this,"networkHeadersToRedact");L(this,"networkBodyKeysToRedact");L(this,"networkBodyKeysToRecord");L(this,"networkHeaderKeysToRecord");L(this,"lastNetworkRequestTimestamp");L(this,"urlBlocklist");L(this,"highlightEndpoints");L(this,"requestResponseSanitizer");var r,n;this.options=t,this.disableConsoleRecording=!!t.disableConsoleRecording,this.reportConsoleErrors=(r=t.reportConsoleErrors)!=null?r:!1,this.enablePromisePatch=(n=t.enablePromisePatch)!=null?n:!1,this.consoleMethodsToRecord=t.consoleMethodsToRecord||[...el],this.listeners=[],this.errors=[],this.messages=[],this.lastNetworkRequestTimestamp=0}isListening(){return this.listeners.length>0}startListening(){if(this.isListening())return;const t=this;this.disableConsoleRecording||this.listeners.push(mf(r=>{var n,i,s;if(this.reportConsoleErrors&&(r.type==="Error"||r.type==="error")&&r.value&&r.trace){const o=bt(r.value);if(al.includes(o)||ll.some(l=>o.includes(l)))return;t.errors.push({event:o,type:"console.error",url:window.location.href,source:(n=r.trace[0])!=null&&n.fileName?r.trace[0].fileName:"",lineNumber:(i=r.trace[0])!=null&&i.lineNumber?r.trace[0].lineNumber:0,columnNumber:(s=r.trace[0])!=null&&s.columnNumber?r.trace[0].columnNumber:0,stackTrace:r.trace,timestamp:new Date().toISOString(),id:_n()})}t.messages.push(r)},B(x({},pf),{level:this.consoleMethodsToRecord}))),this.listeners.push(yf(r=>{al.includes(r.event)||ll.some(n=>r.event.includes(n))||t.errors.push(r)},{enablePromisePatch:this.enablePromisePatch})),this.listeners.push(Nu),Dt.setupNetworkListener(this,this.options)}stopListening(){this.listeners.forEach(t=>t()),this.listeners=[]}static setupNetworkListener(t,r){var s,o,l,u,a,h,c,f,d,p,m,g;const n=(r==null?void 0:r.backendUrl)||void 0||"https://pub.highlight.io",i=r.otlpEndpoint||"https://otel.highlight.io";t.highlightEndpoints=[n,`${i}/v1/traces`,`${i}/v1/logs`,`${i}/v1/metrics`],t.xhrNetworkContents=[],t.fetchNetworkContents=[],t.webSocketNetworkContents=[],t.webSocketEventContents=[],t.networkHeadersToRedact=[],t.urlBlocklist=[],t.tracingOrigins=r.tracingOrigins||[],(r==null?void 0:r.disableNetworkRecording)!==void 0?(t.disableNetworkRecording=r==null?void 0:r.disableNetworkRecording,t.enableRecordingNetworkContents=!1,t.disableRecordingWebSocketContents=!0,t.networkHeadersToRedact=[],t.networkBodyKeysToRedact=[],t.urlBlocklist=[],t.networkBodyKeysToRecord=[]):typeof(r==null?void 0:r.networkRecording)=="boolean"?(t.disableNetworkRecording=!r.networkRecording,t.enableRecordingNetworkContents=!1,t.disableRecordingWebSocketContents=!0,t.networkHeadersToRedact=[],t.networkBodyKeysToRedact=[],t.urlBlocklist=[]):(((s=r.networkRecording)==null?void 0:s.enabled)!==void 0?t.disableNetworkRecording=!r.networkRecording.enabled:t.disableNetworkRecording=!1,t.enableRecordingNetworkContents=((o=r.networkRecording)==null?void 0:o.recordHeadersAndBody)||!1,t.disableRecordingWebSocketContents=((l=r.networkRecording)==null?void 0:l.disableWebSocketEventRecordings)||!1,t.networkHeadersToRedact=((a=(u=r.networkRecording)==null?void 0:u.networkHeadersToRedact)==null?void 0:a.map(v=>v.toLowerCase()))||[],t.networkBodyKeysToRedact=((c=(h=r.networkRecording)==null?void 0:h.networkBodyKeysToRedact)==null?void 0:c.map(v=>v.toLowerCase()))||[],t.urlBlocklist=((d=(f=r.networkRecording)==null?void 0:f.urlBlocklist)==null?void 0:d.map(v=>v.toLowerCase()))||[],t.urlBlocklist=[...t.urlBlocklist,...Fp],t.requestResponseSanitizer=(p=r.networkRecording)==null?void 0:p.requestResponseSanitizer,t.networkHeaderKeysToRecord=(m=r.networkRecording)==null?void 0:m.headerKeysToRecord,t.networkHeaderKeysToRecord&&(t.networkHeadersToRedact=[],t.networkHeaderKeysToRecord=t.networkHeaderKeysToRecord.map(v=>v.toLocaleLowerCase())),t.networkBodyKeysToRecord=(g=r.networkRecording)==null?void 0:g.bodyKeysToRecord,t.networkBodyKeysToRecord&&(t.networkBodyKeysToRedact=[],t.networkBodyKeysToRecord=t.networkBodyKeysToRecord.map(v=>v.toLocaleLowerCase()))),!t.disableNetworkRecording&&t.enableRecordingNetworkContents&&(t.hasNetworkRecording=!0,t.listeners.push(Sx({xhrCallback:v=>{t.xhrNetworkContents.push(v)},fetchCallback:v=>{t.fetchNetworkContents.push(v)},webSocketRequestCallback:v=>{t.webSocketNetworkContents&&t.webSocketNetworkContents.push(v)},webSocketEventCallback:v=>{t.webSocketEventContents.push(v)},disableWebSocketRecording:t.disableRecordingWebSocketContents,bodyKeysToRedact:t.networkBodyKeysToRedact,highlightEndpoints:t.highlightEndpoints,tracingOrigins:t.tracingOrigins,urlBlocklist:t.urlBlocklist,bodyKeysToRecord:t.networkBodyKeysToRecord})))}static getRecordedNetworkResources(t,r){var s,o;let n=[],i=[];if(!t.disableNetworkRecording){const l=((s=window==null?void 0:window.performance)==null?void 0:s.timeOrigin)||0;n=performance.getEntriesByType("resource");const u=(r-l)*2;if(n=n.filter(a=>a.responseEnd<t.lastNetworkRequestTimestamp?!1:Cs(a.name,t.highlightEndpoints)).map(a=>B(x({},a.toJSON()),{offsetStartTime:a.startTime-u,offsetResponseEnd:a.responseEnd-u,offsetFetchStart:a.fetchStart-u})),t.lastNetworkRequestTimestamp=((o=n.at(-1))==null?void 0:o.responseEnd)||t.lastNetworkRequestTimestamp,t.enableRecordingNetworkContents){const a={headersToRedact:t.networkHeadersToRedact,headersToRecord:t.networkHeaderKeysToRecord,requestResponseSanitizer:t.requestResponseSanitizer};n=Bp(n,t.xhrNetworkContents,"xmlhttprequest",a),n=Bp(n,t.fetchNetworkContents,"fetch",a)}}return t.disableRecordingWebSocketContents||(i=t.webSocketNetworkContents||[]),[...n,...i]}static getRecordedWebSocketEvents(t){let r=[];return!t.disableNetworkRecording&&!t.disableRecordingWebSocketContents&&(r=t.webSocketEventContents),r}static clearRecordedNetworkResources(t){t.disableNetworkRecording||(t.xhrNetworkContents=[],t.fetchNetworkContents=[],t.webSocketNetworkContents=[],t.webSocketEventContents=[],performance.clearResourceTimings())}}const Zg=(e,t,r)=>{switch(e){case"strict":return[!0,void 0];case"default":return[!0,void 0];case"none":return[!!t,B(x({},r),{password:!0})]}};let ft,Gu;function Lg(e,t){return e.nodeType,Node.ELEMENT_NODE,Pu(e);return wx(e,t)}function Vu(e){if(e.id.length)return`#${e.id}`;if(e.classList.length){let t=[];for(const r of e.classList)t.push(`.${r}`);return`${e.nodeName.toLowerCase()}${t.join(",")}`}return e.nodeName.toLowerCase()}function wx(e,t){if(e.tagName.toLowerCase()==="html")return"html";try{const r={root:document.body,idName:i=>!0,className:i=>!0,tagName:i=>!0,attr:(i,s)=>!1,seedMinLength:1,optimizedMinLength:2,threshold:50,maxNumberOfTries:1e3,optimized:!0};ft=x(x({},r),t),Gu=Rx(ft.root,r);let n=ku(e,0,()=>ku(e,1,()=>ku(e,2)));if(n){if(ft.optimized){const i=Vg(kg(n,e));i.length>0&&(n=i[0])}return Js(n)}else return Pu(e)}catch(r){return Pu(e)}}function Rx(e,t){return e.nodeType===Node.DOCUMENT_NODE?e:e===t.root?e.ownerDocument:e}function ku(e,t,r){let n=null,i=[],s=e,o=0;for(;s&&s!==ft.root.parentElement;){let l=Hs(_x(s))||Hs(...Tx(s))||Hs(...Ex(s))||Hs(Ix(s))||[Cx()];const u=Zx(s);if(t===0)u&&(l=l.concat(l.filter(Wu).map(a=>Xu(a,u))));else if(t===1)l=l.slice(0,1),u&&(l=l.concat(l.filter(Wu).map(a=>Xu(a,u))));else if(t===2){const[a]=l=l.slice(0,1);u&&Wu(a)&&(l=[Xu(a,u)])}for(let a of l)a.level=o;if(i.push(l),i.length>=ft.seedMinLength&&(n=xg(i,r),n))break;s=s.parentElement,o++}return n||(n=xg(i,r)),n}function xg(e,t){const r=Vg(Gg(e));if(r.length>ft.threshold)return t?t():null;for(let n of r)if(Og(n))return n;return null}function Js(e){let t=e[0],r=t.name;for(let n=1;n<e.length;n++){const i=e[n].level||0;t.level===i-1?r=`${e[n].name} > ${r}`:r=`${e[n].name} ${r}`,t=e[n]}return r}function Ng(e){return e.map(t=>t.penalty).reduce((t,r)=>t+r,0)}function Og(e){switch(Gu.querySelectorAll(Js(e)).length){case 0:return!0;case 1:return!0;default:return!1}}function _x(e){const t=e.getAttribute("id");return t&&ft.idName(t)?{name:"#"+Ys(t,{isIdentifier:!0}),penalty:0}:null}function Tx(e){return Array.from(e.attributes).filter(r=>ft.attr(r.name,r.value)).map(r=>({name:"["+Ys(r.name,{isIdentifier:!0})+'="'+Ys(r.value)+'"]',penalty:.5}))}function Ex(e){return Array.from(e.classList).filter(ft.className).map(r=>({name:"."+Ys(r,{isIdentifier:!0}),penalty:1}))}function Ix(e){const t=e.tagName.toLowerCase();return ft.tagName(t)?{name:t,penalty:2}:null}function Cx(){return{name:"*",penalty:3}}function Zx(e){const t=e.parentNode;if(!t)return null;let r=t.firstChild;if(!r)return null;let n=0;for(;r&&(r.nodeType===Node.ELEMENT_NODE&&n++,r!==e);)r=r.nextSibling;return n}function Xu(e,t){return{name:e.name+`:nth-child(${t})`,penalty:e.penalty+1}}function Wu(e){return e.name!=="html"&&!e.name.startsWith("#")}function Hs(...e){const t=e.filter(Lx);return t.length>0?t:null}function Lx(e){return e!=null}function*Gg(e,t=[]){if(e.length>0)for(let r of e[0])yield*fc(Gg(e.slice(1,e.length),t.concat(r)));else yield t}function Vg(e){return Array.from(e).sort((t,r)=>Ng(t)-Ng(r))}function*kg(e,t,r={counter:0,visited:new Map}){if(e.length>2&&e.length>ft.optimizedMinLength)for(let n=1;n<e.length-1;n++){if(r.counter>ft.maxNumberOfTries)return;r.counter+=1;const i=[...e];i.splice(n,1);const s=Js(i);if(r.visited.has(s))return;Og(i)&&xx(i,t)&&(yield i,r.visited.set(s,!0),yield*fc(kg(i,t,r)))}}function xx(e,t){return Gu.querySelector(Js(e))===t}const Nx=/[ -,\.\/:-@\[-\^`\{-~]/,Ox=/[ -,\.\/:-@\[\]\^`\{-~]/,Gx=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,Vx={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1};function Ys(e,t={}){const r=x(x({},Vx),t);r.quotes!="single"&&r.quotes!="double"&&(r.quotes="single");const n=r.quotes=="double"?'"':"'",i=r.isIdentifier,s=e.charAt(0);let o="",l=0;const u=e.length;for(;l<u;){const a=e.charAt(l++);let h=a.charCodeAt(0),c;if(h<32||h>126){if(h>=55296&&h<=56319&&l<u){const f=e.charCodeAt(l++);(f&64512)==56320?h=((h&1023)<<10)+(f&1023)+65536:l--}c="\\"+h.toString(16).toUpperCase()+" "}else r.escapeEverything?Nx.test(a)?c="\\"+a:c="\\"+h.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(a)?c="\\"+h.toString(16).toUpperCase()+" ":a=="\\"||!i&&(a=='"'&&n==a||a=="'"&&n==a)||i&&Ox.test(a)?c="\\"+a:c=a;o+=c}return i&&(/^-[-\d]/.test(o)?o="\\-"+o.slice(1):/\d/.test(s)&&(o="\\3"+s+" "+o.slice(1))),o=o.replace(Gx,function(a,h,c){return h&&h.length%2?a:(h||"")+c}),!i&&r.wrap?n+o+n:o}const Pu=e=>{let t="";const r=e.getAttribute("class"),n=e.getAttribute("id");return n&&(t=t.concat(Xg(n,"#"))),r&&(t=t.concat(Xg(r,"."))),t===""&&(t=t.concat(e.tagName.toLowerCase())),t},Xg=(e,t)=>`${t}${e.trim().split(" ").join(t)}`,Wg=e=>{const t=n=>{if(n.target){const i=n.target,s=Lg(i);e(s,n)}},r={capture:!0};return window.addEventListener("click",t,r),()=>window.removeEventListener("click",t,r)},Pg=e=>{const t=r=>{if(r.target){const n=Lg(r.target);e(n)}};return window.addEventListener("focusin",t),()=>window.removeEventListener("focusin",t)},kx=30,Xx=()=>new Promise(e=>requestAnimationFrame(t=>requestAnimationFrame(r=>e(r-t)))),Wx=()=>$(this,null,function*(){const e=[];for(let t=0;t<kx;t++)e.push(yield Xx());return e.reduce((t,r)=>t+r,0)/e.length}),Mg=(e,t)=>{let r={},n=16.666666666666668;Wx().then(u=>n=u);const i=u=>{var a;r!=null&&r.event||(r={event:u,location:window.location.href,timerStart:(a=window.performance)==null?void 0:a.now()},window.requestAnimationFrame(s))},s=()=>{if(!(r!=null&&r.timerStart))return;const u=window.performance.now()-r.timerStart-n;o(u),r={}},o=u=>{const a=(new Date().getTime()-t)/1e3;e({relativeTimestamp:a,jankAmount:u,querySelector:l(),newLocation:window.location.href!=r.location?window.location.href:void 0})},l=()=>{var u;return(u=r==null?void 0:r.event)!=null&&u.target?Vu(r.event.target):""};return window.addEventListener("click",i,!0),window.addEventListener("keydown",i,!0),()=>{window.removeEventListener("keydown",i,!0),window.removeEventListener("click",i,!0)}},Ag=e=>{let t,r;if(typeof document.hidden!="undefined"?(t="hidden",r="visibilitychange"):typeof document.msHidden!="undefined"?(t="msHidden",r="msvisibilitychange"):typeof document.webkitHidden!="undefined"&&(t="webkitHidden",r="webkitvisibilitychange"),r===void 0)return()=>{};if(t===void 0)return()=>{};const n=t,i=()=>{const o=document[n];e(!!o)};document.addEventListener(r,i);const s=r;return()=>document.removeEventListener(s,i)},Ug=typeof window!="undefined"&&"performance"in window&&"memory"in performance?performance:{memory:{}},Dg=(e,t)=>{let r=0,n=0;const i=()=>{const h=(new Date().getTime()-t)/1e3,c=Ug.memory.jsHeapSizeLimit||0,f=Ug.memory.usedJSHeapSize||0;e({jsHeapSizeLimit:c,usedJSHeapSize:f,relativeTimestamp:h,fps:r})};i();let s;s=setInterval(()=>{i()},1e3);let o=0,l=Date.now();const u=function(){var a=Date.now();o++,a>1e3+l&&(r=Math.round(o*1e3/(a-l)),o=0,l=a),n=requestAnimationFrame(u)};return u(),()=>{clearInterval(s),cancelAnimationFrame(n)}},Fg=e=>{e(window.location.href);var t=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(s){setTimeout(()=>{var l;var o;try{o=JSON.parse((l=s==null?void 0:s.toString())!=null?l:"")}catch(u){return}(o.type==="track"||o.type==="identify")&&Mu(o)&&e(o)},100),t.call(this,s)};const r=s=>{if(s.key==="ajs_user_id"||s.key==="ajs_anonymous_id"||s.key==="ajs_user_traits"){const{userId:o,userTraits:l}=Jg();if(o){let u={};l&&(u=JSON.parse(l));const a={type:"identify",userId:o.toString(),traits:u};Mu(a)&&e(a)}}},{userId:n,userTraits:i}=Jg();if(n){let s={};i&&(s=JSON.parse(i));const o={type:"identify",userId:n.toString(),traits:s};Mu(o)&&e(o)}return window.addEventListener("storage",r),rI(({keyName:s})=>{r({key:s})}),()=>{window.removeEventListener("storage",r),XMLHttpRequest.prototype.send=t}},Jg=()=>{const e=Fe("ajs_user_id"),t=Fe("ajs_user_traits"),r=Fe("ajs_anonymous_id");return{userId:e,userTraits:t,anonymousId:r}},Mu=e=>{if(!e)return!1;let t="";try{t=JSON.stringify(e)}catch(i){return!1}const r=Px(t),n=Fe(Ne.SEGMENT_LAST_SENT_HASH_KEY);return n===void 0||r!==n?(ct(Ne.SEGMENT_LAST_SENT_HASH_KEY,r),!0):!1},Px=e=>{var t=0,r=e.length,n=0;if(r>0)for(;n<r;)t=(t<<5)-t+e.charCodeAt(n++)|0;return t.toString()},Hg=(e,t)=>{const r=Mx(e);let n=[];const i=!1,s=!0,o=[];for(let u=0;u<r.length;u++){let a=r[u].split("+");n=[],a.length>1&&(n=Dx(Bg,a)),a=a[a.length-1],a=a==="*"?"*":Ux(a),a in _t||(_t[a]=[]);const h={mods:n,shortcut:r[u],key:r[u],method:t,keyup:i,keydown:s,scope:"all",splitKey:"+"};_t[a].push(h),o.push({key:a,handler:h})}const l=u=>Hx(u);return Fx(document,"keydown",l),()=>{document.removeEventListener("keydown",l);for(const{key:u,handler:a}of o){const h=_t[u],c=h?h.indexOf(a):-1;c>-1&&h.splice(c,1)}}};let ze=[];function Mx(e){typeof e!="string"&&(e=""),e=e.replace(/\s/g,"");const t=e.split(",");let r=t.lastIndexOf("");for(;r>=0;)t[r-1]+=",",t.splice(r,1),r=t.lastIndexOf("");return t}const _t={},Au=typeof navigator!="undefined"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1,Ax={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":Au?173:189,"=":Au?61:187,";":Au?59:186,"'":222,"[":219,"]":221,"\\":220},Yg={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Ke={16:!1,18:!1,17:!1,91:!1},Bg={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},Ux=e=>Ax[e.toLowerCase()]||Bg[e.toLowerCase()]||e.toUpperCase().charCodeAt(0);function Dx(e,t){const r=t.slice(0,t.length-1);for(let n=0;n<r.length;n++)r[n]=e[r[n].toLowerCase()];return r}function Fx(e,t,r){e.addEventListener?e.addEventListener(t,r,!1):e.attachEvent&&e.attachEvent(`on${t}`,()=>{r(window.event)})}function Jx(e,t,r){let n;if(t.scope===r||t.scope==="all"){n=t.mods.length>0;for(const i in Ke)Object.prototype.hasOwnProperty.call(Ke,i)&&(!Ke[i]&&t.mods.indexOf(+i)>-1||Ke[i]&&t.mods.indexOf(+i)===-1)&&(n=!1);(t.mods.length===0&&!Ke[16]&&!Ke[18]&&!Ke[17]&&!Ke[91]||n||t.shortcut==="*")&&t.method(e,t)===!1&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function Hx(e){const t=_t["*"];let r=e.keyCode||e.which||e.charCode;if((r===93||r===224)&&(r=91),ze.indexOf(r)===-1&&r!==229&&ze.push(r),["ctrlKey","altKey","shiftKey","metaKey"].forEach(n=>{const i=Yg[n];e[n]&&ze.indexOf(i)===-1?ze.push(i):!e[n]&&ze.indexOf(i)>-1?ze.splice(ze.indexOf(i),1):n==="metaKey"&&e[n]&&ze.length===3&&(e.ctrlKey||e.shiftKey||e.altKey||(ze=ze.slice(ze.indexOf(i))))}),!(r in Ke&&(Ke[r]=!0,!t))){for(const n in Ke)Object.prototype.hasOwnProperty.call(Ke,n)&&(Ke[n]=e[Yg[n]]);if(e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(ze.indexOf(17)===-1&&ze.push(17),ze.indexOf(18)===-1&&ze.push(18),Ke[17]=!0,Ke[18]=!0),r in _t){for(let n=0;n<_t[r].length;n++)if((e.type==="keydown"&&_t[r][n].keydown||e.type==="keyup"&&_t[r][n].keyup)&&_t[r][n].key){const i=_t[r][n];Jx(e,i,"all")}}}}const Uu=e=>{let t;const n=()=>{clearTimeout(t),t=setTimeout(()=>{var i,s;e({height:window.innerHeight,width:window.innerWidth,availHeight:window.screen.availHeight,availWidth:window.screen.availWidth,colorDepth:window.screen.colorDepth,pixelDepth:window.screen.pixelDepth,orientation:(s=(i=window.screen.orientation)==null?void 0:i.angle)!=null?s:0})},500)};return window.addEventListener("resize",n),n(),()=>window.removeEventListener("resize",n)};var ir,Yn,zg,Bs,Du,en=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},Bn=function(e){if(document.readyState==="loading")return"loading";var t=en();if(t){if(e<t.domInteractive)return"loading";if(t.domContentLoadedEventStart===0||e<t.domContentLoadedEventStart)return"dom-interactive";if(t.domComplete===0||e<t.domComplete)return"dom-content-loaded"}return"complete"},Yx=function(e){var t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},zs=function(e,t){var r="";try{for(;e&&e.nodeType!==9;){var n=e,i=n.id?"#"+n.id:Yx(n)+(n.classList&&n.classList.value&&n.classList.value.trim()&&n.classList.value.trim().length?"."+n.classList.value.trim().replace(/\s+/g,"."):"");if(r.length+i.length>99)return r||i;if(r=r?i+">"+r:i,n.id)break;e=n.parentNode}}catch(s){}return r},Kg=-1,jg=function(){return Kg},xr=function(e){addEventListener("pageshow",function(t){t.persisted&&(Kg=t.timeStamp,e(t))},!0)},Ks=function(){var e=en();return e&&e.activationStart||0},pt=function(e,t){var r=en(),n="navigate";return jg()>=0?n="back-forward-cache":r&&(document.prerendering||Ks()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},tn=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(i){Promise.resolve().then(function(){t(i.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(i){}},mt=function(e,t,r,n){var i,s;return function(o){t.value>=0&&(o||n)&&((s=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=s,t.rating=function(l,u){return l>u[1]?"poor":l>u[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Fu=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},js=function(e){var t=function(r){r.type!=="pagehide"&&document.visibilityState!=="hidden"||e(r)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},Ju=function(e){var t=!1;return function(r){t||(e(r),t=!0)}},rn=-1,Qg=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Qs=function(e){document.visibilityState==="hidden"&&rn>-1&&(rn=e.type==="visibilitychange"?e.timeStamp:0,Bx())},$g=function(){addEventListener("visibilitychange",Qs,!0),addEventListener("prerenderingchange",Qs,!0)},Bx=function(){removeEventListener("visibilitychange",Qs,!0),removeEventListener("prerenderingchange",Qs,!0)},Hu=function(){return rn<0&&(rn=Qg(),$g(),xr(function(){setTimeout(function(){rn=Qg(),$g()},0)})),{get firstHiddenTime(){return rn}}},zn=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},qg=[1800,3e3],ey=function(e,t){t=t||{},zn(function(){var r,n=Hu(),i=pt("FCP"),s=tn("paint",function(o){o.forEach(function(l){l.name==="first-contentful-paint"&&(s.disconnect(),l.startTime<n.firstHiddenTime&&(i.value=Math.max(l.startTime-Ks(),0),i.entries.push(l),r(!0)))})});s&&(r=mt(e,i,qg,t.reportAllChanges),xr(function(o){i=pt("FCP"),r=mt(e,i,qg,t.reportAllChanges),Fu(function(){i.value=performance.now()-o.timeStamp,r(!0)})}))})},ty=[.1,.25],zx=function(e,t){(function(r,n){n=n||{},ey(Ju(function(){var i,s=pt("CLS",0),o=0,l=[],u=function(h){h.forEach(function(c){if(!c.hadRecentInput){var f=l[0],d=l[l.length-1];o&&c.startTime-d.startTime<1e3&&c.startTime-f.startTime<5e3?(o+=c.value,l.push(c)):(o=c.value,l=[c])}}),o>s.value&&(s.value=o,s.entries=l,i())},a=tn("layout-shift",u);a&&(i=mt(r,s,ty,n.reportAllChanges),js(function(){u(a.takeRecords()),i(!0)}),xr(function(){o=0,s=pt("CLS",0),i=mt(r,s,ty,n.reportAllChanges),Fu(function(){return i()})}),setTimeout(i,0))}))})(function(r){(function(n){if(n.entries.length){var i=n.entries.reduce(function(l,u){return l&&l.value>u.value?l:u});if(i&&i.sources&&i.sources.length){var s=(o=i.sources).find(function(l){return l.node&&l.node.nodeType===1})||o[0];if(s)return void(n.attribution={largestShiftTarget:zs(s.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:s,largestShiftEntry:i,loadState:Bn(i.startTime)})}}var o;n.attribution={}})(r),e(r)},t)},Kx=function(e,t){ey(function(r){(function(n){if(n.entries.length){var i=en(),s=n.entries[n.entries.length-1];if(i){var o=i.activationStart||0,l=Math.max(0,i.responseStart-o);return void(n.attribution={timeToFirstByte:l,firstByteToFCP:n.value-l,loadState:Bn(n.entries[0].startTime),navigationEntry:i,fcpEntry:s})}}n.attribution={timeToFirstByte:0,firstByteToFCP:n.value,loadState:Bn(jg())}})(r),e(r)},t)},Kn={passive:!0,capture:!0},jx=new Date,ry=function(e,t){ir||(ir=t,Yn=e,zg=new Date,iy(removeEventListener),ny())},ny=function(){if(Yn>=0&&Yn<zg-jx){var e={entryType:"first-input",name:ir.type,target:ir.target,cancelable:ir.cancelable,startTime:ir.timeStamp,processingStart:ir.timeStamp+Yn};Bs.forEach(function(t){t(e)}),Bs=[]}},Qx=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;e.type=="pointerdown"?function(r,n){var i=function(){ry(r,n),o()},s=function(){o()},o=function(){removeEventListener("pointerup",i,Kn),removeEventListener("pointercancel",s,Kn)};addEventListener("pointerup",i,Kn),addEventListener("pointercancel",s,Kn)}(t,e):ry(t,e)}},iy=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,Qx,Kn)})},sy=[100,300],$x=function(e,t){t=t||{},zn(function(){var r,n=Hu(),i=pt("FID"),s=function(u){u.startTime<n.firstHiddenTime&&(i.value=u.processingStart-u.startTime,i.entries.push(u),r(!0))},o=function(u){u.forEach(s)},l=tn("first-input",o);r=mt(e,i,sy,t.reportAllChanges),l&&js(Ju(function(){o(l.takeRecords()),l.disconnect()})),l&&xr(function(){var u;i=pt("FID"),r=mt(e,i,sy,t.reportAllChanges),Bs=[],Yn=-1,ir=null,iy(addEventListener),u=s,Bs.push(u),ny()})})},qx=function(e,t){$x(function(r){(function(n){var i=n.entries[0];n.attribution={eventTarget:zs(i.target),eventType:i.name,eventTime:i.startTime,eventEntry:i,loadState:Bn(i.startTime)}})(r),e(r)},t)},oy=0,Yu=1/0,$s=0,eN=function(e){e.forEach(function(t){t.interactionId&&(Yu=Math.min(Yu,t.interactionId),$s=Math.max($s,t.interactionId),oy=$s?($s-Yu)/7+1:0)})},ay=function(){return Du?oy:performance.interactionCount||0},tN=function(){"interactionCount"in performance||Du||(Du=tn("event",eN,{type:"event",buffered:!0,durationThreshold:0}))},ly=[200,500],uy=0,cy=function(){return ay()-uy},Lt=[],Bu={},dy=function(e){var t=Lt[Lt.length-1],r=Bu[e.interactionId];if(r||Lt.length<10||e.duration>t.latency){if(r)r.entries.push(e),r.latency=Math.max(r.latency,e.duration);else{var n={id:e.interactionId,latency:e.duration,entries:[e]};Bu[n.id]=n,Lt.push(n)}Lt.sort(function(i,s){return s.latency-i.latency}),Lt.splice(10).forEach(function(i){delete Bu[i.id]})}},rN=function(e,t){t=t||{},zn(function(){var r;tN();var n,i=pt("INP"),s=function(l){l.forEach(function(h){h.interactionId&&dy(h),h.entryType==="first-input"&&!Lt.some(function(c){return c.entries.some(function(f){return h.duration===f.duration&&h.startTime===f.startTime})})&&dy(h)});var u,a=(u=Math.min(Lt.length-1,Math.floor(cy()/50)),Lt[u]);a&&a.latency!==i.value&&(i.value=a.latency,i.entries=a.entries,n())},o=tn("event",s,{durationThreshold:(r=t.durationThreshold)!==null&&r!==void 0?r:40});n=mt(e,i,ly,t.reportAllChanges),o&&("interactionId"in PerformanceEventTiming.prototype&&o.observe({type:"first-input",buffered:!0}),js(function(){s(o.takeRecords()),i.value<0&&cy()>0&&(i.value=0,i.entries=[]),n(!0)}),xr(function(){Lt=[],uy=ay(),i=pt("INP"),n=mt(e,i,ly,t.reportAllChanges)}))})},nN=function(e,t){rN(function(r){(function(n){if(n.entries.length){var i=n.entries.sort(function(s,o){return o.duration-s.duration||o.processingEnd-o.processingStart-(s.processingEnd-s.processingStart)})[0];n.attribution={eventTarget:zs(i.target),eventType:i.name,eventTime:i.startTime,eventEntry:i,loadState:Bn(i.startTime)}}else n.attribution={}})(r),e(r)},t)},hy=[2500,4e3],zu={},iN=function(e,t){(function(r,n){n=n||{},zn(function(){var i,s=Hu(),o=pt("LCP"),l=function(h){var c=h[h.length-1];c&&c.startTime<s.firstHiddenTime&&(o.value=Math.max(c.startTime-Ks(),0),o.entries=[c],i())},u=tn("largest-contentful-paint",l);if(u){i=mt(r,o,hy,n.reportAllChanges);var a=Ju(function(){zu[o.id]||(l(u.takeRecords()),u.disconnect(),zu[o.id]=!0,i(!0))});["keydown","click"].forEach(function(h){addEventListener(h,function(){return setTimeout(a,0)},!0)}),js(a),xr(function(h){o=pt("LCP"),i=mt(r,o,hy,n.reportAllChanges),Fu(function(){o.value=performance.now()-h.timeStamp,zu[o.id]=!0,i(!0)})})}})})(function(r){(function(n){if(n.entries.length){var i=en();if(i){var s=i.activationStart||0,o=n.entries[n.entries.length-1],l=o.url&&performance.getEntriesByType("resource").filter(function(d){return d.name===o.url})[0],u=Math.max(0,i.responseStart-s),a=Math.max(u,l?(l.requestStart||l.startTime)-s:0),h=Math.max(a,l?l.responseEnd-s:0),c=Math.max(h,o?o.startTime-s:0),f={element:zs(o.element),timeToFirstByte:u,resourceLoadDelay:a-u,resourceLoadTime:h-a,elementRenderDelay:c-h,navigationEntry:i,lcpEntry:o};return o.url&&(f.url=o.url),l&&(f.lcpResourceEntry=l),void(n.attribution=f)}}n.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadTime:0,elementRenderDelay:n.value}})(r),e(r)},t)},fy=[800,1800],sN=function e(t){document.prerendering?zn(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},oN=function(e,t){t=t||{};var r=pt("TTFB"),n=mt(e,r,fy,t.reportAllChanges);sN(function(){var i=en();if(i){var s=i.responseStart;if(s<=0||s>performance.now())return;r.value=Math.max(s-Ks(),0),r.entries=[i],n(!0),xr(function(){r=pt("TTFB",0),(n=mt(e,r,fy,t.reportAllChanges))(!0)})}})},aN=function(e,t){oN(function(r){(function(n){if(n.entries.length){var i=n.entries[0],s=i.activationStart||0,o=Math.max(i.domainLookupStart-s,0),l=Math.max(i.connectStart-s,0),u=Math.max(i.requestStart-s,0);n.attribution={waitingTime:o,dnsTime:l-o,connectionTime:u-l,requestTime:n.value-u,navigationEntry:i}}else n.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}})(r),e(r)},t)};const py=e=>(zx(e),Kx(e),qx(e),iN(e),aN(e),nN(e),()=>{}),nn=typeof navigator!="undefined"&&"connection"in navigator?navigator.connection:{},my=(e,t)=>{const r=()=>{const s=(new Date().getTime()-t)/1e3;e({relativeTimestamp:s,downlink:nn.downlink,downlinkMax:nn.downlinkMax,effectiveType:nn.effectiveType,rtt:nn.rtt,saveData:nn.saveData,type:nn.type})};r();let n;return n=setInterval(()=>{r()},1e3),()=>{clearInterval(n)}},qs="iframe parent ready",eo="iframe ok",jn="highlightLogs",lN=e=>{let t=Fe(jn)||"";t=t+"["+new Date().getTime()+"] "+e+`
467
467
  `,ct(jn,t)},gy=()=>Fe(jn)||"",yy=e=>{if(!e)return;let t=Fe(jn)||"";t&&(t.startsWith(e)?(t=t.slice(e.length),ct(jn,t)):lN("Unable to clear logs "+e.replace(`
468
468
  `," ")+" from "+t.replace(`
469
469
  `," ")))},by=()=>{if(!("performance"in window&&"memory"in performance))return{getDeviceDetails:void 0,getCurrentDeviceDetails:void 0};const e=window.performance;return{getDeviceDetails:()=>({deviceMemory:uN(navigator.deviceMemory||0)}),getCurrentDeviceDetails:()=>{const n=Ku(e.memory.jsHeapSizeLimit),i=Ku(e.memory.totalJSHeapSize),s=Ku(e.memory.usedJSHeapSize);return{jsHeapSizeLimit:n,totalJSHeapSize:i,usedJSHeapSize:s}}}},Ku=e=>e/Math.pow(1e3,2),uN=e=>1024*e;var vy={exports:{}};/**