1var e={log:`log`,debug:`debug`,info:`info`,warn:`warn`,error:`error`},t=console,n={};Object.keys(e).forEach(e=>{n[e]=t[e]});var r=`Datadog Browser SDK:`,i={debug:n.debug.bind(t,r),log:n.log.bind(t,r),info:n.info.bind(t,r),warn:n.warn.bind(t,r),error:n.error.bind(t,r)},a=`https://docs.datadoghq.com`,o=`${a}/real_user_monitoring/browser/troubleshooting`,s=`More details:`;function c(e,t){return(...n)=>{try{return e(...n)}catch(e){i.error(t,e)}}}function l(e){return e!==0&&Math.random()*100<=e}function u(e){return d(e)&&e>=0&&e<=100}function d(e){return typeof e==`number`}function f(e){try{return JSON.parse(e)}catch{}}function p(e){return{...e}}function m(e,t){return Object.keys(e).some(n=>e[n]===t)}function h(e){return Object.keys(e).length===0}function g(){if(typeof globalThis==`object`)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let e=_dd_temp_;return delete Object.prototype._dd_temp_,typeof e!=`object`&&(e=typeof self==`object`?self:typeof window==`object`?window:{}),e}var _=g(),v=`WorkerGlobalScope`in _;function y(e,t){let n=g(),r;return n.Zone&&typeof n.Zone.__symbol__==`function`&&(r=e[n.Zone.__symbol__(t)]),r||=e[t],r}var ee,te=!1;function ne(e){ee=e}function re(e){te=e}function ie(e,t,n){let r=n.value;n.value=function(...e){return(ee?b(r):r).apply(this,e)}}function b(e){return function(...t){return ae(e,this,t)}}function ae(e,t,n){try{return e.apply(t,n)}catch(e){oe(e)}}function oe(e){if(se(e),ee)try{ee(e)}catch(e){se(e)}}function se(...e){te&&i.error(`[MONITOR]`,...e)}function ce(e,t){return y(g(),`setTimeout`)(b(e),t)}function le(e){y(g(),`clearTimeout`)(e)}function ue(e,t){return y(g(),`setInterval`)(b(e),t)}function de(e){y(g(),`clearInterval`)(e)}function fe(e){let t=_.queueMicrotask;typeof t==`function`?t(b(e)):Promise.resolve().then(b(e))}var x=class{constructor(e){this.onFirstSubscribe=e,this.observers=[]}subscribe(e){return this.addObserver(e),{unsubscribe:()=>this.removeObserver(e)}}notify(e){this.observers.forEach(t=>t(e))}addObserver(e){this.observers.push(e),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0)}removeObserver(e){this.observers=this.observers.filter(t=>e!==t),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}};function pe(...e){return new x(t=>{let n=e.map(e=>e.subscribe(e=>t.notify(e)));return()=>n.forEach(e=>e.unsubscribe())})}var me=class extends x{constructor(e){super(),this.maxBufferSize=e,this.buffer=[]}notify(e){this.buffer.push(e),this.buffer.length>this.maxBufferSize&&this.buffer.shift(),super.notify(e)}subscribe(e){let t=!1;return fe(()=>{for(let n of this.buffer){if(t)return;e(n)}t||this.addObserver(e)}),{unsubscribe:()=>{t=!0,this.removeObserver(e)}}}unbuffer(){fe(()=>{this.maxBufferSize=this.buffer.length=0})}},S=1e3,C=60*S,he=60*C,ge=24*he*365;function w(){return new Date().getTime()}function T(){return w()}function _e(){return performance.now()}function E(){return{relative:_e(),timeStamp:T()}}function ve(){return{relative:0,timeStamp:Ce()}}function ye(e,t){return t-e}function be(e,t){return e+t}function xe(e){return e-Ce()}var Se;function Ce(){return Se===void 0&&(Se=performance.timing?.navigationStart??performance.timeOrigin),Se}function we(e,t,n){let r=n&&n.leading!==void 0?n.leading:!0,i=n&&n.trailing!==void 0?n.trailing:!0,a=!1,o,s;return{throttled:(...n)=>{if(a){o=n;return}r?e(...n):o=n,a=!0,s=ce(()=>{i&&o&&e(...o),a=!1,o=void 0},t)},cancel:()=>{le(s),a=!1,o=void 0}}}function D(){}function O(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,O)}var Te=/(\S+?)\s*=\s*(.+?)(?:;|$)/g;function Ee(e,t){for(Te.lastIndex=0;;){let n=Te.exec(e);if(n){if(n[1]===t)return n[2]}else break}}function De(e){let t=new Map;for(Te.lastIndex=0;;){let n=Te.exec(e);if(n){let e=n[1],r=n[2];t.has(e)?t.get(e).push(r):t.set(e,[r])}else break}return t}function Oe(e){let t=new Map;for(Te.lastIndex=0;;){let n=Te.exec(e);if(n)t.set(n[1],n[2]);else break}return t}function ke(e,t,n=``){let r=e.charCodeAt(t-1),i=r>=55296&&r<=56319?t+1:t;return e.length<=i?e:`${e.slice(0,i)}${n}`}function Ae(){return Me()===0}var je;function Me(){return je??=Ne()}function Ne(e=window){let t=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(t)?0:e.navigator.vendor?.indexOf(`Apple`)===0||/safari/i.test(t)&&!/chrome|android/i.test(t)?1:2}function Pe(e){return Fe(e,location.href).href}function Fe(e,t){let{URL:n}=Le();try{return t===void 0?new n(e):new n(e,t)}catch(e){throw Error(`Failed to construct URL: ${String(e)}`)}}var Ie;function Le(){if(!Ie){let e,t;try{e=document.createElement(`iframe`),e.style.display=`none`,document.body.appendChild(e),t=e.contentWindow??_}catch{t=_}Ie={URL:t.URL},e?.remove()}return Ie}function Re(e,t,n=0,r){let i=new Date;i.setTime(i.getTime()+n);let a=`expires=${i.toUTCString()}`,o=r&&r.crossSite?`none`:`strict`,s=r&&r.domain?`;domain=${r.domain}`:``,c=r&&r.secure?`;secure`:``,l=r&&r.partitioned?`;partitioned`:``;document.cookie=`${e}=${t};${a};path=/;samesite=${o}${s}${c}${l}`}function ze(e){return Ee(document.cookie,e)}function Be(e){return De(document.cookie).get(e)||[]}var Ve;function k(e){return Ve||=Oe(document.cookie),Ve.get(e)}function He(e,t){Re(e,``,0,t)}function Ue(e){if(document.cookie===void 0||document.cookie===null)return!1;try{let t=`dd_cookie_test_${O()}`,n=`test`;Re(t,n,C,e);let r=ze(t)===n;return He(t,e),r}catch(e){return i.error(e),!1}}var We;function Ge(e=location.hostname,t=document.referrer){if(We===void 0){let n=Ke(e,t);if(n){let e=`dd_site_test_${O()}`,t=n.split(`.`),r=t.pop();for(;t.length&&!ze(e);)r=`${t.pop()}.${r}`,Re(e,`test`,S,{domain:r});He(e,{domain:r}),We=r}}return We}function Ke(e,t){try{return e||Fe(t).hostname}catch{}}var A=`_dd_s`;function qe(e,t){for(let n=e.length-1;n>=0;--n){let r=e[n];if(t(r,n,e))return r}}function Je(e){return Object.values(e)}function Ye(e){return Object.entries(e)}var Xe=4*he,Ze=15*C,Qe=ge,j={COOKIE:`cookie`,MEMORY:`memory`,LOCAL_STORAGE:`local-storage`},$e=/^([a-zA-Z]+)=([a-z0-9-]+)$/;function et(e){return!!e&&(e.indexOf(`&`)!==-1||$e.test(e))}function M(e,t){let n={isExpired:`1`};
1return t.trackAnonymousUser&&e?.anonymousId&&(n.anonymousId=e?.anonymousId),n}function tt(e){return h(e)}function nt(e){return!tt(e)}function rt(e){return e.isExpired!==void 0||!it(e)}function it(e){return(e.created===void 0||w()-Number(e.created)<Xe)&&(e.expire===void 0||w()<Number(e.expire))}function at(e){e.expire=String(w()+Ze)}function ot(e){return Ye(e).map(([e,t])=>e===`anonymousId`?`aid=${t}`:`${e}=${t}`).join(`&`)}function st(e){let t={};return et(e)&&e.split(`&`).forEach(e=>{let n=$e.exec(e);if(n!==null){let[,e,r]=n;e===`aid`?t.anonymousId=r:t[e]=r}}),t}var ct=`_dd_r`,lt=`_dd_l`,ut=`logs`;function dt(e){if(!k(`_dd_s`)){let t=k(`_dd`),n=k(ct),r=k(lt),i={};t&&(i.id=t),r&&/^[01]$/.test(r)&&(i[ut]=r),n&&/^[012]$/.test(n)&&(i.rum=n),nt(i)&&(at(i),e.persistSession(i))}}function ft(e){let t=gt(e);return t&&Ue(t)?{type:j.COOKIE,cookieOptions:t}:void 0}function pt(e,t){let n={isLockEnabled:Ae(),persistSession:n=>mt(t,e,n,Ze),retrieveSession:()=>ht(t,e),expireSession:n=>mt(t,e,M(n,e),Xe)};return dt(n),n}function mt(e,t,n,r){let i=ot(n);t.betaEncodeCookieOptions&&(i=ot({...n,...h(n)?{}:{c:_t(e)}})),Re(A,i,t.trackAnonymousUser?Qe:r,e)}function ht(e,t){return t.betaEncodeCookieOptions?vt(e):st(ze(A))}function gt(e){let t={};if(t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains){let e=Ge();if(!e)return;t.domain=e}return t}function _t(e){let t=e.domain?e.domain.split(`.`).length-1:0,n=0;return n|=0,n|=t<<1,n|=+!!e.crossSite,n.toString(16)}function vt(e){let t=Be(A),n=_t(e),r;for(let e of t.reverse())if(r=st(e),r.c===n)break;return r==null||delete r.c,r??{}}var yt=`_dd_test_`;function bt(){try{let e=O(),t=`${yt}${e}`;localStorage.setItem(t,e);let n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:j.LOCAL_STORAGE}:void 0}catch{return}}function xt(e){return{isLockEnabled:!1,persistSession:St,retrieveSession:Ct,expireSession:t=>wt(t,e)}}function St(e){localStorage.setItem(A,ot(e))}function Ct(){return st(localStorage.getItem(A))}function wt(e,t){St(M(e,t))}var Tt=S,Et=`--`,Dt=[],Ot;function N(e,t,n=0){var r;let{isLockEnabled:i,persistSession:a,expireSession:o}=t,s=e=>a({...e,lock:l}),c=()=>{let{lock:e,...n}=t.retrieveSession();return{session:n,lock:e&&!Mt(e)?e:void 0}};if(Ot||=e,e!==Ot){Dt.push(e);return}if(i&&n>=100){At(t);return}let l,u=c();if(i){if(u.lock){kt(e,t,n);return}if(l=jt(),s(u.session),u=c(),u.lock!==l){kt(e,t,n);return}}let d=e.process(u.session);if(i&&(u=c(),u.lock!==l)){kt(e,t,n);return}if(d&&(rt(d)?o(d):(at(d),i?s(d):a(d))),i&&!(d&&rt(d))){if(u=c(),u.lock!==l){kt(e,t,n);return}a(u.session),d=u.session}(r=e.after)==null||r.call(e,d||u.session),At(t)}function kt(e,t,n){ce(()=>{N(e,t,n+1)},10)}function At(e){Ot=void 0;let t=Dt.shift();t&&N(t,e)}function jt(){return O()+Et+T()}function Mt(e){let[,t]=e.split(Et);return!t||ye(Number(t),T())>Tt}var Nt=`_DD_SESSION`;function Pt(){return{type:j.MEMORY}}function Ft(e){return{expireSession:t=>Rt(t,e),isLockEnabled:!1,persistSession:Lt,retrieveSession:It}}function It(){let e=g();return e._DD_SESSION||(e[Nt]={}),p(e[Nt])}function Lt(e){let t=g();t[Nt]=p(e)}function Rt(e,t){Lt(M(e,t))}var zt=S;function Bt(e){let{sessionPersistence:t}=e,n=Vt(t,e);for(let t of n){let n=Ht(t,e);if(n!==void 0)return n}}function Vt(e,t){return Array.isArray(e)?e:e===void 0?t.allowFallbackToLocalStorage?[j.COOKIE,j.LOCAL_STORAGE]:[j.COOKIE]:[e]}function Ht(e,t){switch(e){case j.COOKIE:return ft(t);case j.LOCAL_STORAGE:return bt();case j.MEMORY:return Pt();default:i.error(`Invalid session persistence '${String(e)}'`);return}}function Ut(e,t){return e.type===j.COOKIE?pt(t,e.cookieOptions):e.type===j.LOCAL_STORAGE?xt(t):Ft(t)}function Wt(e,t,n,r,i=Ut(e,t)){let a=new x,o=new x,s=new x,c=ue(p,zt),l;h();let{throttled:u,cancel:d}=we(()=>{N({process:e=>{if(tt(e))return;let t=m(e);return g(t),t},after:e=>{nt(e)&&!_()&&ee(e),l=e}},i)},zt);function f(){N({process:e=>_()?m(e):void 0},i)}function p(){let e=i.retrieveSession();rt(e)?N({process:e=>rt(e)?M(e,t):void 0,after:m},i):m(e)}function m(e){return rt(e)&&(e=M(e,t)),_()&&(v(e)?y():(s.notify({previousState:l,newState:e}),l=e)),e}function h(){N({process:e=>{if(tt(e))return e.anonymousId=O(),M(e,t)},after:e=>{l=e}},i)}function g(e){if(tt(e))return!1;let i=r(e[n]);e[n]=i,delete e.isExpired,i!==`0`&&!e.id&&(e.id=O(),e.created=String(w())),t.trackA
1nonymousUser&&!e.anonymousId&&(e.anonymousId=O())}function _(){return l?.[n]!==void 0}function v(e){return l.id!==e.id||l[n]!==e[n]}function y(){l=M(l,t),o.notify()}function ee(e){l=e,a.notify()}function te(e){N({process:t=>({...t,...e}),after:m},i)}return{expandOrRenewSession:u,expandSession:f,getSession:()=>l,renewObservable:a,expireObservable:o,sessionStateUpdateObservable:s,restartSession:h,expire:e=>{d(),e===!1&&l&&delete l.anonymousId,i.expireSession(l),m(M(l,t))},stop:()=>{de(c)},updateSessionState:te}}var Gt={GRANTED:`granted`,NOT_GRANTED:`not-granted`};function Kt(e){let t=new x;return{tryToInit(t){e||=t},update(n){e=n,t.notify()},isGranted(){return e===Gt.GRANTED},observable:t}}function qt(e){return e===null?`null`:Array.isArray(e)?`array`:typeof e}function Jt(e){return qt(e)===`object`}function Yt(e,t,n=!1){return e.some(e=>{try{if(typeof e==`function`)return e(t);if(e instanceof RegExp)return e.test(t);if(typeof e==`string`)return n?t.startsWith(e):e===t}catch(e){i.error(e)}return!1})}function Xt(e){return e}var Zt=[`chrome-extension://`,`moz-extension://`];function Qt(e){return Zt.some(t=>e.includes(t))}function $t(e,t=``){return!Qt(e)&&Qt(t.split(` 2`).filter(e=>{let t=e.trim();return t.length&&/^at\s+|@/.test(t)})[1]||``)}var en="Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided.",tn=`SDK initialized on a non-allowed domain.`;function nn(e,t){let n=Xt(g().location),r=n?n.origin:``,a=e.allowedTrackingOrigins;if(!a)return!$t(r,t)||(i.error(en),!1);let o=Yt(a,r);return o||i.error(tn),o}var rn=`datad0g.com`,an=`datadoghq.com`,on=`ddog-gov.com`,sn=`pci.browser-intake-datadoghq.com`,cn=[`ddsource`,`dd-api-key`,`dd-request-id`];function P(e,t,n){let r=ln(e,t);return{build(i,a){let o=dn(e,t,i,a,n);return r(o)},trackType:t}}function ln(e,t){let n=`/api/v2/${t}`,r=e.proxy;if(typeof r==`string`){let e=Pe(r);return t=>`${e}?ddforward=${encodeURIComponent(`${n}?${t}`)}`}if(typeof r==`function`)return e=>r({path:n,parameters:e});let i=un(t,e);return e=>`https://${i}${n}?${e}`}function un(e,t){let{site:n=an,internalAnalyticsSubdomain:r}=t;if(e===`logs`&&t.usePciIntake&&n===`datadoghq.com`)return sn;if(r&&n===`datadoghq.com`)return`${r}.${an}`;if(n===`dd0g-gov.com`)return`http-intake.logs.${n}`;let i=n.split(`.`),a=i.pop();return`browser-intake-${i.join(`-`)}.${a}`}function dn({clientToken:e,internalAnalyticsSubdomain:t,source:n=`browser`},r,i,{retry:a,encoding:o},s=[]){let c=[`ddsource=${n}`,`dd-api-key=${e}`,`dd-evp-origin-version=6.32.0`,`dd-evp-origin=browser`,`dd-request-id=${O()}`].concat(s);return o&&c.push(`dd-evp-encoding=${o}`),r===`rum`&&(c.push(`batch_time=${T()}`,`_dd.api=${i}`),a&&c.push(`_dd.retry_count=${a.count}`,`_dd.retry_after=${a.lastFailureStatus}`)),t&&c.reverse(),c.join(`&`)}function fn(e){let t=e.site||`datadoghq.com`,n=pn(e.source),r=mn({...e,site:t,source:n});return{replica:hn({...e,site:t,source:n}),site:t,source:n,...r}}function pn(e){return e===`flutter`||e===`unity`?e:`browser`}function mn(e){return{logsEndpointBuilder:P(e,`logs`),rumEndpointBuilder:P(e,`rum`),profilingEndpointBuilder:P(e,`profile`),sessionReplayEndpointBuilder:P(e,`replay`),exposuresEndpointBuilder:P(e,`exposures`),flagEvaluationEndpointBuilder:P(e,`flagevaluation`)}}function hn(e){if(!e.replica)return;let t={...e,site:an,clientToken:e.replica.clientToken};return{logsEndpointBuilder:P(t,`logs`),rumEndpointBuilder:P(t,`rum`,[`application.id=${e.replica.applicationId}`])}}function gn(e){return cn.every(t=>e.includes(t))}function _n(e,t){return e!=null&&typeof e!=`string`?(i.error(`${t} must be defined as a string`),!1):!0}function vn(e){return e&&typeof e==`string`&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(i.error(`Site should be a valid Datadog site. ${s} ${a}/getting_started/site/.`),!1):!0}function yn(e,t){return e!==void 0&&!u(e)?(i.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function bn(e,t){if(!e||!e.clientToken){i.error(`Client Token is not configured, we will not send any data.`);return}if(e.allowedTrackingOrigins!==void 0&&!Array.isArray(e.allowedTrackingOrigins)){i.error(`Allowed Tracking Origins must be an array`);return}if(!(!vn(e.site)||!yn(e.sessionSampleRate,`Session`)||!yn(e.telemetrySampleRate,`Telemetry`)||!yn(e.telemetryConfigurationSampleRate,`Telemetry Configuration`)||!yn(e.telemetryUsageSampleRate,`Telemetry Usage`)||!_n(e.version,`Version`)||!_n(e.env,`Env`)||!_n(e.service,`Service`)||!nn(e,t??``))){if(e.trackingConsent!==void 0&&!m(Gt,e.trackingConsent)){i.error(`Tracking Consent should be either "granted" or "not-granted"`);return}return{beforeSend:e.beforeSend&&c(e.beforeSend,`beforeSend threw an error:`),sessionStoreStrategyType:v?void 0:Bt(e),sessionSampleRate:e.sessionSampleRate??100,telemetrySampleRate:e.telemetrySampleRate??20,telemetryConfigurationSampleRate:e.telemetryConfigurationSampleRate??5,telemetryUsageSampleRate:e.telemetryUsageSampleRate??5,service:e.service??void 0,env:e.env??void 0,version:e.version??void 0,datacenter:e.datacenter??void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:e.trackingConsent??Gt.GRANTED,trackAnonymousUser:e.trackA
2nonymousUser??!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,betaEncodeCookieOptions:!!e.betaEncodeCookieOptions,variant:e.variant,sdkVersion:e.sdkVersion,...fn(e)}}}function xn(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:Array.isArray(e.sessionPersistence)?e.sessionPersistence[0]:e.sessionPersistence,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent,use_allowed_tracking_origins:Array.isArray(e.allowedTrackingOrigins),beta_encode_cookie_options:e.betaEncodeCookieOptions,source:e.source,sdk_version:e.sdkVersion,variant:e.variant}}var Sn;(function(e){e.TRACK_INTAKE_REQUESTS=`track_intake_requests`,e.USE_TREE_WALKER_FOR_ACTION_NAME=`use_tree_walker_for_action_name`,e.FEATURE_OPERATION_VITAL=`feature_operation_vital`,e.SHORT_SESSION_INVESTIGATION=`short_session_investigation`,e.START_STOP_ACTION=`start_stop_action`,e.START_STOP_RESOURCE=`start_stop_resource`,e.USE_CHANGE_RECORDS=`use_change_records`,e.USE_INCREMENTAL_CHANGE_RECORDS=`use_incremental_change_records`,e.INP_SUBPARTS=`inp_subparts`,e.TOO_MANY_REQUESTS_INVESTIGATION=`too_many_requests_investigation`,e.COMPOSED_PATH_SELECTOR=`composed_path_selector`})(Sn||={});var Cn=new Set;function wn(e){Array.isArray(e)&&Tn(e.filter(e=>m(Sn,e)))}function Tn(e){e.forEach(e=>{Cn.add(e)})}function En(e){return Cn.has(e)}function Dn(){return Cn}var On=`?`;function kn(e){let t=[],n=Hn(e,`stack`),r=String(e);if(n&&n.startsWith(r)&&(n=n.slice(r.length)),n&&n.split(` 3`).forEach(e=>{let n=Pn(e)||In(e)||Rn(e)||Vn(e);n&&(!n.func&&n.line&&(n.func=On),t.push(n))}),t.length>0&&Jn()&&e instanceof Error){let n=[],r=e;for(;(r=Object.getPrototypeOf(r))&&Kn(r);){let e=r.constructor?.name||On;n.push(e)}for(let e=n.length-1;e>=0&&t[0]?.func===n[e];e--)t.shift()}return{message:Hn(e,`message`),name:Hn(e,`name`),stack:t}}var An=`((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)`,jn=`(?::(\\d+))`,Mn=RegExp(`^\\s*at (.*?) ?\\(${An}${jn}?${jn}?\\)?\\s*$`,`i`),Nn=RegExp(`\\((\\S*)${jn}${jn}\\)`);function Pn(e){let t=Mn.exec(e);if(!t)return;let n=t[2]&&t[2].indexOf(`native`)===0,r=t[2]&&t[2].indexOf(`eval`)===0,i=Nn.exec(t[2]);return r&&i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||On,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}var Fn=RegExp(`^\\s*at\\s*(?:(.*)?(?: @))?\\s*${An}${jn}?${jn}??\\s*$`,`i`);function In(e){let t=Fn.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||On,line:t[3]?+t[3]:void 0,url:t[2]}}var Ln=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Rn(e){let t=Ln.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||On,line:+t[3],url:t[2]}}var zn=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,Bn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Vn(e){let t=zn.exec(e);if(!t)return;let n=t[3]&&t[3].indexOf(` > eval`)>-1,r=Bn.exec(t[3]);return n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0),{args:t[2]?t[2].split(`,`):[],column:t[5]?+t[5]:void 0,func:t[1]||On,line:t[4]?+t[4]:void 0,url:t[3]}}function Hn(e,t){return Jt(e)&&typeof e[t]==`string`?e[t]:void 0}function Un(e,t,n,r){if(t===void 0)return;let{name:i,message:a}=Gn(e);return{name:i,message:a,stack:[{url:t,column:r,line:n}]}}var Wn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Gn(e){let t,n;return{}.toString.call(e)===`[object String]`&&([,t,n]=Wn.exec(e)),{name:t,message:n}}function Kn(e){return String(e.constructor).startsWith(`class `)}var qn;function Jn(){if(qn!==void 0)return qn;
3class e extends Error{constructor(){super(),this.name=`Error`}}let[t,n]=[e,Error].map(e=>new e);return qn=Kn(Object.getPrototypeOf(t))&&n.stack!==t.stack,qn}function Yn(e){let t=Error(e);t.name=`HandlingStack`;let n;return ae(()=>{let e=kn(t);e.stack=e.stack.slice(2),n=Xn(e)}),n}function Xn(e){let t=Zn(e);return e.stack.forEach(e=>{let n=e.func===`?`?`<anonymous>`:e.func,r=e.args&&e.args.length>0?`(${e.args.join(`, `)})`:``,i=e.line?`:${e.line}`:``,a=e.line&&e.column?`:${e.column}`:``;t+=`\n at ${n}${r} @ ${e.url}${i}${a}`}),t}function Zn(e){return`${e.name||`Error`}: ${e.message}`}function F(e,t,n,{computeHandlingStack:r}={}){let i=e[t];if(typeof i!=`function`){if(t in e&&typeof t==`string`&&t.startsWith(`on`))i=D;else return{stop:D}}let a=!1,o=function(){if(a)return i.apply(this,arguments);let e=Array.from(arguments),t;ae(n,null,[{target:this,parameters:e,onPostCall:e=>{t=e},handlingStack:r?Yn(`instrumented method`):void 0}]);let o=i.apply(this,e);return t&&ae(t,null,[o]),o};return e[t]=o,{stop:()=>{a=!0,e[t]===o&&(e[t]=i)}}}var I=1024,Qn=1024*I,$n=/[^\u0000-\u007F]/;function er(e){return $n.test(e)?window.TextEncoder===void 0?new Blob([e]).size:new TextEncoder().encode(e).length:e.length}function tr(e){if(e.length===1)return e[0];let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function L(e,t,n){if(typeof e!=`object`||!e)return JSON.stringify(e);let r=R(Object.prototype),i=R(Array.prototype),a=R(Object.getPrototypeOf(e)),o=R(e);try{return JSON.stringify(e,t,n)}catch{return`<error: unable to serialize object>`}finally{r(),i(),a(),o()}}function R(e){let t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):D}var nr=220*I,rr=`$`,ir=3;function z(e,t=nr){let n=R(Object.prototype),r=R(Array.prototype),i=[],a=new WeakMap,o=ar(e,rr,void 0,i,a),s=JSON.stringify(o),c=s?s.length:0;if(c>t){ur(t,`discarded`,e);return}for(;i.length>0&&c<t;){let n=i.shift(),r=0;if(Array.isArray(n.source))for(let o=0;o<n.source.length;o++){let s=ar(n.source[o],n.path,o,i,a);if(c+=s===void 0?4:JSON.stringify(s).length,c+=r,r=1,c>t){ur(t,`truncated`,e);break}n.target[o]=s}else for(let o in n.source)if(Object.prototype.hasOwnProperty.call(n.source,o)){let s=ar(n.source[o],n.path,o,i,a);if(s!==void 0&&(c+=JSON.stringify(s).length+r+o.length+ir,r=1),c>t){ur(t,`truncated`,e);break}n.target[o]=s}}return n(),r(),o}function ar(e,t,n,r,i){let a=lr(e);if(!a||typeof a!=`object`)return or(a);let o=sr(a);if(o!==`[Object]`&&o!==`[Array]`&&o!==`[Error]`)return o;let s=e;if(i.has(s))return`[Reference seen at ${i.get(s)}]`;let c=n===void 0?t:`${t}.${n}`,l=Array.isArray(a)?[]:{};return i.set(s,c),r.push({source:a,target:l,path:c}),l}function or(e){return typeof e==`bigint`?`[BigInt] ${e.toString()}`:typeof e==`function`?`[Function] ${e.name||`unknown`}`:typeof e==`symbol`?`[Symbol] ${e.description||e.toString()}`:e}function sr(e){try{if(e instanceof Event)return cr(e);if(e instanceof RegExp)return`[RegExp] ${e.toString()}`;let t=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(t&&t[1])return`[${t[1]}]`}catch{}return`[Unserializable]`}function cr(e){return{type:e.type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?sr(e.currentTarget):null,target:e.target?sr(e.target):null}}function lr(e){let t=e;if(t&&typeof t.toJSON==`function`)try{return t.toJSON()}catch{}return e}function ur(e,t,n){i.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,n)}var dr=`No stack, consider using an instance of Error`;function fr({originalError:e,stackTrace:t,source:n,useFallbackStack:r=!0,nonErrorPrefix:i}){let a=B(e);return!t&&a&&(t=kn(e)),{source:n,type:t?t.name:void 0,message:mr(t,a,i,e),stack:t?Xn(t):r?dr:void 0}}function pr({stackTrace:e,originalError:t,handlingStack:n,componentStack:r,startClocks:i,nonErrorPrefix:a,useFallbackStack:o=!0,source:s,handling:c}){return{startClocks:i,handling:c,handlingStack:n,componentStack:r,originalError:t,...fr({originalError:t,stackTrace:e,source:s,useFallbackStack:o,nonErrorPrefix:a}),causes:B(t)?vr(t,s):void 0,fingerprint:hr(t),context:gr(t)}}function mr(e,t,n,r){return e?.message&&e?.name?e.message:t?`Empty message`:n?`${n} ${L(z(r))}`:L(z(r))}function hr(e){return B(e)&&`dd_fingerprint`in e?String(e.dd_fingerprint):void 0}function gr(e){if(Jt(e))return e.dd_context}function _r(e){return/@ (.+)/.exec(e)?.[1]}function B(e){return e instanceof Error||Object.prototype.toString.call(e)===`[object Error]`}function vr(e,t){let n=[],r=e.cause;for(;r!=null&&n.length<10;){let e=fr({originalError:r,source:t,useFallbackStack:!1});n.push(e),r=B(r)?r.cause:void 0}return n.length?n:void 0}var V={AGENT:`agent`,CONSOLE:`console`,CUSTOM:`custom`,LOGGER:`logger`,NETWORK:`network`,SOURCE:`source`,REPORT:`report`};function yr(){return new x(e=>{let t=(t,n)=>{let r=pr({stackTrace:n,originalError:t,startClocks:E(),nonErrorPrefix:`Uncaught`,source:V.SOURCE,handling:`unhandled`});e.notify(r)},{stop:n}=br(t),{stop:r}=xr(t);return()=>{n(),r()}})}function br(e){return F(g(),`onerror`,({parameters:[t,n,r,i,a]})=>{let o;B(a)||(o=Un(t,n,r,i)),e(a??t,o)})}function xr(e){return F(g(),`onunhandledrejection`,({parameters:[t]})=>{e(t.reason||`Empty reason`)})}function Sr(e){let t={version:`6.32.0`,onReady(e){e()},...e};return Object.defineProperty(t,"_setDebug",{get(){return re},enumerable:!1}),t}function Cr(e,t,n){let r=e[t];r&&!r.q&&r.version&&i.warn(`SDK is loaded more than once. This is unsupported and might have unex
3pected behavior.`),e[t]=n,r&&r.q&&r.q.forEach(e=>c(e,`onReady callback threw an error:`)())}function wr(e,t){t.silentMultipleInit||i.error(`${e} is already initialized.`)}function H(e,t,n,r,i){return Tr(e,t,[n],r,i)}function Tr(e,t,n,r,{once:i,capture:a,passive:o}={}){let s=b(t=>{!t.isTrusted&&!t.__ddIsTrusted&&!e.allowUntrustedEvents||(i&&d(),r(t))}),c=o?{capture:a,passive:o}:a,l=window.EventTarget&&t instanceof EventTarget?window.EventTarget.prototype:t,u=y(l,`addEventListener`);n.forEach(e=>u.call(t,e,s,c));function d(){let e=y(l,`removeEventListener`);n.forEach(n=>e.call(t,n,s,c))}return{stop:d}}var Er={intervention:`intervention`,deprecation:`deprecation`,cspViolation:`csp_violation`};function Dr(e,t){let n=[];t.includes(Er.cspViolation)&&n.push(kr(e));let r=t.filter(e=>e!==Er.cspViolation);return r.length&&n.push(Or(r)),pe(...n)}function Or(e){return new x(t=>{if(!window.ReportingObserver)return;let n=b((e,n)=>e.forEach(e=>t.notify(Ar(e)))),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),()=>{r.disconnect()}})}function kr(e){return new x(t=>{let{stop:n}=H(e,document,`securitypolicyviolation`,e=>{t.notify(jr(e))});return n})}function Ar(e){let{type:t,body:n}=e;return Mr({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:Nr(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function jr(e){let t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return Mr({type:e.effectiveDirective,message:`${Er.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:Nr(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${ke(e.originalPolicy,100,`...`)}"`:`no policy`,e.sourceFile,e.lineNumber,e.columnNumber)})}function Mr(e){return{startClocks:E(),source:V.REPORT,handling:`unhandled`,...e}}function Nr(e,t,n,r,i){return n?Xn({name:e,message:t,stack:[{func:`?`,url:n,line:r??void 0,column:i??void 0}]}):void 0}function Pr(e){let{env:t,service:n,version:r,datacenter:i,sdkVersion:a,variant:o}=e,s=[U(`sdk_version`,a??`6.32.0`)];return t&&s.push(U(`env`,t)),n&&s.push(U(`service`,n)),r&&s.push(U(`version`,r)),i&&s.push(U(`datacenter`,i)),o&&s.push(U(`variant`,o)),s}function U(e,t){let n=t?`${e}:${t}`:e;return(n.length>200||Ir(n))&&i.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${s} ${a}/getting_started/tagging/#defining-tags`),Fr(n)}function Fr(e){return e.replace(/,/g,`_`)}function Ir(e){return Lr()?RegExp(`[^\\p{Ll}\\p{Lo}0-9_:./-]`,`u`).test(e):!1}function Lr(){try{return!0}catch{return!1}}function Rr(e,t){let n=_.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function zr(e,t,n=Vr()){if(t===void 0)return e;if(typeof t!=`object`||!t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){let e=t.flags||[t.global?`g`:``,t.ignoreCase?`i`:``,t.multiline?`m`:``,t.sticky?`y`:``,t.unicode?`u`:``].join(``);return new RegExp(t.source,e)}if(n.hasAlreadyBeenSeen(t))return;if(Array.isArray(t)){let r=Array.isArray(e)?e:[];for(let e=0;e<t.length;++e)r[e]=zr(r[e],t[e],n);return r}let r=qt(e)===`object`?e:{};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=zr(r[e],t[e],n));return r}function Br(e){return zr(void 0,e)}function W(...e){let t;for(let n of e)n!=null&&(t=zr(t,n));return t}function Vr(){if(typeof WeakSet<`u`){let e=new WeakSet;return{hasAlreadyBeenSeen(t){let n=e.has(t);return n||e.add(t),n}}}let e=[];return{hasAlreadyBeenSeen(t){let n=e.indexOf(t)>=0;return n||e.push(t),n}}}function Hr(){let e=_.navigator;return{status:e.onLine?`connected`:`not_connected`,interfaces:e.connection&&e.connection.type?[e.connection.type]:void 0,effective_type:e.connection?.effectiveType}}function Ur(e,t){return y(g(),`fetch`)(e,t)}function Wr(e){return e>=500}function Gr(e){try{return e.clone()}catch{return}}var Kr=80*I,qr=20*Qn,Jr=C,Yr=S;function Xr(e,t,n,r,i,a){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?Qr(e,t,n,a,{onSuccess:()=>$r(0,t,n,r,i,a),onFailure:()=>{t.queuedPayloads.enqueue(e)||a.notify({type:`queue-full`,bandwidth:t.bandwidthMonitor.stats(),payload:e}),Zr(t,n,r,i,a)}}):t.queuedPayloads.enqueue(e)||a.notify({type:`queue-full`,bandwidth:t.bandwidthMonitor.stats(),payload:e})}function Zr(e,t,n,r,i){e.transportStatus===2&&ce(()=>{Qr(e.queuedPayloads.first(),e,t,i,{onSuccess:()=>{e.queuedPayloads.dequeue(),e.currentBackoffTime=Yr,$r(1,e,t,n,r,i)},onFailure:()=>{e.currentBackoffTime=Math.min(Jr,e.currentBackoffTime*2),Zr(e,t,n,r,i)}})},e.currentBackoffTime)}function Qr(e,t,n,r,{onSuccess:i,onFailure:a}){t.bandwidthMonitor.add(e),n(e,n=>{t.bandwidthMonitor.remove(e),ei(n)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:n.status}
3,r.notify({type:`failure`,bandwidth:t.bandwidthMonitor.stats(),payload:e}),a()):(t.transportStatus=0,r.notify({type:`success`,bandwidth:t.bandwidthMonitor.stats(),payload:e}),i())})}function $r(e,t,n,r,i,a){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(i({message:`Reached max ${r} events size queued for upload: ${qr/Qn}MiB`,source:V.AGENT,startClocks:E()}),t.queueFullReported=!0);let o=t.queuedPayloads;for(t.queuedPayloads=ni();o.size()>0;)Xr(o.dequeue(),t,n,r,i,a)}function ei(e){return e.type!==`opaque`&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||Wr(e.status))}function ti(){return{transportStatus:0,currentBackoffTime:Yr,bandwidthMonitor:ri(),queuedPayloads:ni(),queueFullReported:!1}}function ni(){let e=[];return{bytesCount:0,enqueue(t){return!this.isFull()&&(e.push(t),this.bytesCount+=t.bytesCount,!0)},first(){return e[0]},dequeue(){let t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size(){return e.length},isFull(){return this.bytesCount>=qr}}}function ri(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=Kr&&this.ongoingRequestCount<32},add(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove(e){--this.ongoingRequestCount,this.ongoingByteCount-=e.bytesCount},stats(){return{ongoingByteCount:this.ongoingByteCount,ongoingRequestCount:this.ongoingRequestCount}}}}var ii=16*I;function ai(e,t,n=ii){let r=new x,i=ti();return{observable:r,send:n=>{for(let a of e)Xr(n,i,(e,t)=>{li(a,e,t)},a.trackType,t,r)},sendOnExit:t=>{for(let r of e)oi(r,n,t)}}}function oi(e,t,n){if(navigator.sendBeacon&&n.bytesCount<t)try{let t=e.build(`beacon`,n);if(navigator.sendBeacon(t,n.data))return}catch(e){ci(e)}li(e,n)}var si=!1;function ci(e){si||(si=!0,oe(e))}function li(e,t,n){Ur(e.build(`fetch`,t),{method:`POST`,body:t.data,mode:`cors`}).then(b(e=>n?.({status:e.status,type:e.type}))).catch(b(()=>n?.({status:0})))}function ui(){let e=fi();if(e)return{getCapabilities(){return JSON.parse(e.getCapabilities?.call(e)||`[]`)},getPrivacyLevel(){return e.getPrivacyLevel?.call(e)},getAllowedWebViewHosts(){return JSON.parse(e.getAllowedWebViewHosts())},send(t,n,r){let i=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:i}))}}}function di(e){e===void 0&&(e=g().location?.hostname);let t=ui();return!!t&&t.getAllowedWebViewHosts().some(t=>e===t||e.endsWith(`.${t}`))}function fi(){return g().DatadogEventBridge}var pi={HIDDEN:`visibility_hidden`,UNLOADING:`before_unload`,PAGEHIDE:`page_hide`,FROZEN:`page_frozen`};function mi(e){return new x(t=>{if(v)return;let{stop:n}=Tr(e,window,[`visibilitychange`,`freeze`],e=>{e.type===`visibilitychange`&&document.visibilityState===`hidden`?t.notify({reason:pi.HIDDEN}):e.type===`freeze`&&t.notify({reason:pi.FROZEN})},{capture:!0}),r=H(e,window,`beforeunload`,()=>{t.notify({reason:pi.UNLOADING})}).stop;return()=>{n(),r()}})}function hi(e){return Je(pi).includes(e)}
3var gi=256*I;function _i({encoder:e,request:t,flushController:n}){let r={},a=n.flushObservable.subscribe(e=>f(e));function c(t,i,a){n.notifyBeforeAddMessage(i),a===void 0?e.write(e.isEmpty?t:`\n${t}`,e=>{n.notifyAfterAddMessage(e-i)}):(r[a]=t,n.notifyAfterAddMessage())}function l(e){return e!==void 0&&r[e]!==void 0}function u(t){let i=r[t];delete r[t];let a=e.estimateEncodedBytesCount(i);n.notifyAfterRemoveMessage(a)}function d(t,n){let r=L(t),a=e.estimateEncodedBytesCount(r);if(a>=gi){i.warn(`Discarded a message whose size was bigger than the maximum allowed size ${gi/I}KiB. ${s} ${o}/#technical-limitations`);return}l(n)&&u(n),c(r,a,n)}function f(n){let i=Je(r).join(` 4`);r={};let a=hi(n.reason),o=a?t.sendOnExit:t.send;if(a&&e.isAsync){let t=e.finishSync();t.outputBytesCount&&o(vi(t));let n=[t.pendingData,i].filter(Boolean).join(` 5`);n&&o({data:n,bytesCount:er(n)})}else i&&e.write(e.isEmpty?i:`\n${i}`),e.finish(e=>{o(vi(e))})}return{flushController:n,add:d,upsert:d,stop:a.unsubscribe}}function vi(e){let t;return t=typeof e.output==`string`?e.output:new Blob([e.output],{type:`text/plain`}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}var yi=30*S,bi=v?1:50;function xi({pageMayExitObservable:e,sessionExpireObservable:t}){let n=e.subscribe(e=>s(e.reason)),r=t.subscribe(()=>s(`session_expire`)),i=new x(()=>()=>{n.unsubscribe(),r.unsubscribe()}),a=0,o=0;function s(e){if(o===0)return;let t=o,n=a;o=0,a=0,u(),i.notify({reason:e,messagesCount:t,bytesCount:n})}let c;function l(){c===void 0&&(c=ce(()=>{s(`duration_limit`)},yi))}function u(){le(c),c=void 0}return{flushObservable:i,get messagesCount(){return o},notifyBeforeAddMessage(e){a+e>=ii&&s(`bytes_limit`),o+=1,a+=e,l()},notifyAfterAddMessage(e=0){a+=e,o>=bi?s(`messages_limit`):a>=ii&&s(`bytes_limit`)},notifyAfterRemoveMessage(e){a-=e,--o,o===0&&u()}}}function Si(){let e=``,t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,r){let i=er(n);t+=i,e+=n,r&&r(i)},finish(e){e(this.finishSync())},finishSync(){let n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:``};return e=``,t=0,n},estimateEncodedBytesCount(e){return e.length}}}var Ci=`DISCARDED`,G=`SKIPPED`;function wi(){let e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(e=>e!==n)}}},triggerHook(t,n){let r=e[t]||[],i=[];for(let e of r){let t=e(n);if(t===`DISCARDED`)return Ci;t!==`SKIPPED`&&i.push(t)}return W(...i)}}}var K={LOG:`log`,CONFIGURATION:`configuration`,USAGE:`usage`},Ti=[`https://www.datadoghq-browser-agent.com`,`https://www.datad0g-browser-agent.com`,`https://d3uc069fcn7uxw.cloudfront.net`,`https://d20xtzwzcl0ceb.cloudfront.net`,`http://localhost`,`<anonymous>`],Ei=1,Di=[on],Oi=15,ki;function Ai(){return ki||=new me(100),ki}function ji(e,t,n){let r=new x,{enabled:i,metricsEnabled:a}=Mi(e,t,n,r),{stop:o}=Ni(t,r);return{stop:o,enabled:i,metricsEnabled:a}}function Mi(e,t,n,r,i=Ei,a=Oi){let o={},s=!Di.includes(t.site)&&l(t.telemetrySampleRate),c={[K.LOG]:s,[K.CONFIGURATION]:s&&l(t.telemetryConfigurationSampleRate),[K.USAGE]:s&&l(t.telemetryUsageSampleRate),metric:s&&l(i)},u=Pi(),d=Ai();return d.subscribe(({rawEvent:t,metricName:i})=>{if(i&&!c.metric||!c[t.type])return;let s=i||t.status||t.type,l=o[s];if(l||=o[s]=new Set,l.size>=a)return;let d=L(t);if(l.has(d))return;let p=n.triggerHook(1,{startTime:E().relative});if(p===`DISCARDED`)return;let m=f(p,e,t,u);r.notify(m),Rr(`telemetry`,m),l.add(d)}),d.unbuffer(),ne(Li),{enabled:s,metricsEnabled:c.metric};function f(e,n,r,i){return W({type:`telemetry`,date:E().timeStamp,service:n,version:`6.32.0`,source:`browser`,_dd:{format_version:2},telemetry:W(r,{runtime_env:i,connectivity:Hr(),sdk_setup:`npm`}),ddtags:Pr(t).join(`,`),experimental_features:Array.from(Dn())},e)}}function Ni(e,t){let n=[];if(di()){let e=ui(),r=t.subscribe(t=>e.send(`internal_telemetry`,t));n.push(r.unsubscribe)}else{let r=[e.rumEndpointBuilder];e.replica&&Fi(e)&&r.push(e.replica.rumEndpointBuilder);let i=_i({encoder:Si(),request:ai(r,D),flushController:xi({pageMayExitObservable:mi(e),sessionExpireObservable:new x})});n.push(i.stop);let a=t.subscribe(i.add);n.push(a.unsubscribe)}return{stop:()=>
5n.forEach(e=>e())}}function Pi(){return{is_local_file:_.location?.protocol===`file:`,is_worker:v}}function Fi(e){return e.site===rn}function Ii(t,n){se(e.debug,t,n),Ai().notify({rawEvent:{type:K.LOG,message:t,status:`debug`,...n}})}function Li(e,t){Ai().notify({rawEvent:{type:K.LOG,status:`error`,...Bi(e),...t}})}function Ri(e){Ai().notify({rawEvent:{type:K.CONFIGURATION,configuration:e}})}function zi(e){Ai().notify({rawEvent:{type:K.USAGE,usage:e}})}function Bi(e){if(B(e)){let t=kn(e);return{error:{kind:t.name,stack:Xn(Vi(t))},message:t.message}}return{error:{stack:dr},message:`Uncaught ${L(e)}`}}function Vi(e){return e.stack=e.stack.filter(e=>!e.url||Ti.some(t=>e.url.startsWith(t))),e}function Hi(e){let t=new Set;return e.forEach(e=>t.add(e)),Array.from(t)}function Ui(e,t){let n=e.indexOf(t);n>=0&&e.splice(n,1)}var Wi=1/0,Gi=C,Ki,qi=new Set;function Ji(){qi.forEach(e=>e())}function Yi({expireDelay:e,maxEntries:t}){let n=[];Ki||=ue(()=>Ji(),Gi);let r=()=>{let t=_e()-e;for(;n.length>0&&n[n.length-1].endTime<t;)n.pop()};qi.add(r);function i(e,r){let i={value:e,startTime:r,endTime:Wi,remove:()=>{Ui(n,i)},close:e=>{i.endTime=e}};return t&&n.length>=t&&n.pop(),n.unshift(i),i}function a(e=Wi,t={returnInactive:!1}){for(let r of n)if(r.startTime<=e){if(t.returnInactive||e<=r.endTime)return r.value;break}}function o(e){let t=n[0];t&&t.endTime===Wi&&t.close(e)}function s(e=Wi,t=0){let r=be(e,t);return n.filter(t=>t.startTime<=r&&e<=t.endTime).map(e=>e.value)}function c(e){return n.filter(t=>t.startTime===e)}function l(){n=[]}function u(){qi.delete(r),qi.size===0&&Ki&&(de(Ki),Ki=void 0)}return{add:i,find:a,closeActive:o,findAll:s,getEntries:c,reset:l,stop:u}}var Xi=`datadog-synthetics-`,Zi=`${Xi}public-id`,Qi=`${Xi}result-id`,$i=`${Xi}injects-rum`,ea=`${Xi}rum-context`;function ta(){return!v&&!!(_._DATADOG_SYNTHETICS_INJECTS_RUM||k($i))}function na(){let e=ia();return aa(e)?e:void 0}function ra(){return!!na()}function ia(){let e=_._DATADOG_SYNTHETICS_RUM_CONTEXT;if(e)return e;let t=k(ea);return t?f(decodeURIComponent(t)):{test_id:window._DATADOG_SYNTHETICS_PUBLIC_ID||k(Zi),result_id:window._DATADOG_SYNTHETICS_RESULT_ID||k(Qi)}}function aa(e){return typeof e==`object`&&!!e&&typeof e.test_id==`string`&&typeof e.result_id==`string`}var oa=C,sa=Xe,q=[];function ca(e,t,n,r){let i=new x,a=new x,o=Wt(e.sessionStoreStrategyType,e,t,n);q.push(()=>o.stop());let s=Yi({expireDelay:sa});if(q.push(()=>s.stop()),o.renewObservable.subscribe(()=>{s.add(c(),_e()),i.notify()}),o.expireObservable.subscribe(()=>{a.notify(),s.closeActive(_e())}),o.expandOrRenewSession(),s.add(c(),ve().relative),En(Sn.SHORT_SESSION_INVESTIGATION)){let t=o.getSession();t&&pa(e,t)}r.observable.subscribe(()=>{r.isGranted()?o.expandOrRenewSession():o.expire(!1)}),la(e,()=>{r.isGranted()&&o.expandOrRenewSession()}),ua(e,()=>o.expandSession()),da(e,()=>o.restartSession());function c(){let n=o.getSession();return n?{id:n.id,trackingType:n[t],isReplayForced:!!n.forcedReplay,anonymousId:n.anonymousId}:(fa(e).catch(()=>void 0),{id:`invalid`,trackingType:`0`,isReplayForced:!1,anonymousId:void 0})}return{findSession:(e,t)=>s.find(e,t),renewObservable:i,expireObservable:a,sessionStateUpdateObservable:o.sessionStateUpdateObservable,expire:o.expire,updateSessionState:o.updateSessionState}}function la(e,t){let{stop:n}=Tr(e,window,[`click`,`touchstart`,`keydown`,`scroll`],t,{capture:!0,passive:!0});q.push(n)}function ua(e,t){let n=()=>{document.visibilityState===`visible`&&t()},{stop:r}=H(e,document,`visibilitychange`,n);q.push(r);let i=ue(n,oa);q.push(()=>{de(i)})}function da(e,t){let{stop:n}=H(e,window,`resume`,t,{capture:!0});q.push(n)}async function fa(e){let t=e.sessionStoreStrategyType;if(!t)return;let n,r;t.type===j.COOKIE?(n=ht(t.cookieOptions,e),r={cookie:await ma(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):n=Ct(),Ii(`Unexpected session state`,{sessionStoreStrategyType:t.type,session:n,isSyntheticsTest:ra(),createdTimestamp:n?.created,expireTimestamp:n?.expire,...r})}function pa(e,t){if(!window.cookieStore||!t.created)return;let n=Number(t.created),r=w(),{stop:i}=H(e,cookieStore,`change`,a);q.push(i);function a(e){let a=qe(e.changed,e=>e.name===A);if(!a)return;let o=w()-n;if(o>84e4)i();else{let e=st(a.value);if(e.id&&e.id!==t.id){i();let n=w()-r;ma().then(r=>{Ii(`Session cookie changed`,{time:n,session_age:o,old:t,new:e,cookie:r})}).catch(oe)}}}}async function ma(){let e;return e=`cookieStore`in window?await window.cookieStore.getAll(A):document.cookie.split(/\s*;\s*/).filter(e=>e.startsWith(A)),{count:e.length,domain:Ge()||`undefined`,...e}}var ha=class{constructor(){this.callbacks={}}notify(e,t){let n=this.callbacks[e];
5n&&n.forEach(e=>e(t))}subscribe(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:()=>{this.callbacks[e]=this.callbacks[e].filter(e=>t!==e)}}}},ga=3e3;function _a(e,t,n=ga){let r=0,i=!1;return{isLimitReached(){if(r===0&&ce(()=>{r=0},C),r+=1,r<=n||i)return i=!1,!1;if(r===n+1){i=!0;try{t({message:`Reached max number of ${e}s by minute: ${n}`,source:V.AGENT,startClocks:E()})}finally{i=!1}}return!0}}}var va,ya=new WeakMap;function ba(e){return va||=xa(e),va}function xa(e){return new x(t=>{let{stop:n}=F(XMLHttpRequest.prototype,`open`,Sa),{stop:r}=F(XMLHttpRequest.prototype,`send`,n=>{Ca(n,e,t)},{computeHandlingStack:!0}),{stop:i}=F(XMLHttpRequest.prototype,`abort`,wa);return()=>{n(),r(),i()}})}function Sa({target:e,parameters:[t,n]}){ya.set(e,{state:`open`,method:String(t).toUpperCase(),url:Pe(String(n))})}function Ca({target:e,parameters:[t],handlingStack:n},r,i){let a=ya.get(e);if(!a)return;let o=a;o.state=`start`,o.startClocks=E(),o.isAborted=!1,o.xhr=e,o.handlingStack=n,o.requestBody=t;let s=!1,{stop:c}=F(e,`onreadystatechange`,()=>{e.readyState===XMLHttpRequest.DONE&&l()}),l=()=>{if(u(),c(),s)return;s=!0;let t=a;t.state=`complete`,t.duration=ye(o.startClocks.timeStamp,T()),t.status=e.status,typeof e.response==`string`&&(t.responseBody=e.response),i.notify(p(t))},{stop:u}=H(r,e,`loadend`,l);i.notify(o)}function wa({target:e}){let t=ya.get(e);t&&(t.isAborted=!0)}async function Ta(e,t){let n=e.getReader(),r=[];for(;;){let e=await n.read();if(e.done)break;t.collectStreamBody&&r.push(e.value)}return n.cancel().catch(D),t.collectStreamBody?tr(r):void 0}var Ea,Da=[];function Oa({responseBodyAction:e}={}){return e&&Da.push(e),Ea||=ka(),Ea}function ka(){return new x(e=>{if(!_.fetch)return;let{stop:t}=F(_,`fetch`,t=>Aa(t,e),{computeHandlingStack:!0});return t})}function Aa({parameters:e,onPostCall:t,handlingStack:n},r){let[i,a]=e,o=a&&a.method;o===void 0&&i instanceof Request&&(o=i.method);let s=o===void 0?`GET`:String(o).toUpperCase(),c=i instanceof Request?i.url:Pe(String(i)),l={state:`start`,init:a,input:i,method:s,startClocks:E(),url:c,handlingStack:n,isAbortedOnStart:i instanceof Request&&i.signal?.aborted||a?.signal?.aborted||!1};r.notify(l),e[0]=l.input,e[1]=l.init,t(e=>{ja(r,e,l).catch(oe)})}async function ja(e,t,n){let r=n;r.state=`resolve`;let i;try{i=await t}catch(t){r.status=0,r.isAborted=r.init?.signal?.aborted||t instanceof DOMException&&t.code===DOMException.ABORT_ERR,r.error=t,e.notify(r);return}r.response=i,r.status=i.status,r.responseType=i.type,r.isAborted=!1;let a=Da.reduce((e,t)=>Math.max(e,t(r)),0);if(a!==0){let e=Gr(i);if(e&&e.body)try{let t=await Ta(e.body,{collectStreamBody:a===2});r.responseBody=t&&new TextDecoder().decode(t)}catch{}}e.notify(r)}var Ma={};function Na(e){return pe(...e.map(e=>(Ma[e]||(Ma[e]=Pa(e)),Ma[e])))}function Pa(e){return new x(n=>{let r=t[e];return t[e]=(...t)=>{r.apply(console,t);let i=Yn(`console error`);ae(()=>{n.notify(Fa(t,e,i))})},()=>{t[e]=r}})}function Fa(t,n,r){let i=t.map(e=>Ia(e)).join(` `);if(n===e.error){let e=pr({originalError:t.find(B),handlingStack:r,startClocks:E(),source:V.CONSOLE,handling:`handled`,nonErrorPrefix:`Provided`,useFallbackStack:!1});return e.message=i,{api:n,message:i,handlingStack:r,error:e}}return{api:n,message:i,error:void 0,handlingStack:r}}function Ia(e){return typeof e==`string`?z(e):B(e)?Zn(kn(e)):L(z(e),void 0,2)}var La=500;function Ra(){let e=[];return{add:t=>{e.push(t)>La&&e.splice(0,1)},remove:t=>{Ui(e,t)},drain:t=>{e.forEach(e=>e(t)),e.length=0}}}function za(e){let t=qt(e)===`object`;return t||i.error(`Unsupported context:`,e),t}function Ba(e,t,n){let r={...e};for(let[e,{required:a,type:o}]of Object.entries(t))o===`string`&&!Va(r[e])&&(r[e]=String(r[e])),a&&Va(r[e])&&i.warn(`The property ${e} of ${n} is required; context will not be sent to the intake.`);return r}function Va(e){return e==null||e===``}function Ha(e=``,{propertiesConfig:t={}}={}){let n={},r=new x,i={getContext:()=>Br(n),setContext:a=>{za(a)?n=z(Ba(a,t,e)):i.clearContext(),r.notify()},setContextProperty:(i,a)=>{n=z(Ba({...n,[i]:a}
5,t,e)),r.notify()},removeContextProperty:i=>{delete n[i],Ba(n,t,e),r.notify()},clearContext:()=>{n={},r.notify()},changeObservable:r};return i}function J(e,t,n,r){return b((...i)=>(r&&zi({feature:r}),e()[t][n](...i)))}function Ua(e,t,n){e.changeObservable.subscribe(()=>{let r=e.getContext();n.add(e=>e[t].setContext(r))})}var Wa=`_dd_c`,Ga=[];function Ka(e,t,n,r){let i=qa(n,r);Ga.push(H(e,window,`storage`,({key:e})=>{i===e&&o()})),t.changeObservable.subscribe(s);let a=W(c(),t.getContext());h(a)||t.setContext(a);function o(){t.setContext(c())}function s(){localStorage.setItem(i,JSON.stringify(t.getContext()))}function c(){let e=localStorage.getItem(i);return e?JSON.parse(e):{}}}function qa(e,t){return`${Wa}_${e}_${t}`}function Ja(e,t,n){let r=Ya();return t.storeContextsAcrossPages&&Ka(t,r,n,4),e.register(0,()=>{let e=r.getContext();return h(e)||!e.id?G:{account:e}}),r}function Ya(){return Ha(`account`,{propertiesConfig:{id:{type:`string`,required:!0},name:{type:`string`}}})}function Xa(e,t,n,r){let i=Za();return t.storeContextsAcrossPages&&Ka(t,i,n,2),e.register(0,()=>{let e=i.getContext();return r?{context:e}:e}),i}function Za(){return Ha(`global context`)}function Qa(e,t,n,r){let i=$a();return t.storeContextsAcrossPages&&Ka(t,i,r,1),e.register(0,({eventType:e,startTime:r})=>{let a=i.getContext(),o=n.findTrackedSession(r);return o&&o.anonymousId&&!a.anonymous_id&&t.trackAnonymousUser&&(a.anonymous_id=o.anonymousId),h(a)?G:{type:e,usr:a}}),e.register(1,({startTime:e})=>({anonymous_id:n.findTrackedSession(e)?.anonymousId})),i}function $a(){return Ha(`user`,{propertiesConfig:{id:{type:`string`},name:{type:`string`},email:{type:`string`}}})}var Y={userContext:`userContext`,globalContext:`globalContext`,accountContext:`accountContext`},X={getContext:`getContext`,setContext:`setContext`,setContextProperty:`setContextProperty`,removeContextProperty:`removeContextProperty`,clearContext:`clearContext`},eo={DOCUMENT:`document`,XHR:`xhr`,BEACON:`beacon`,FETCH:`fetch`,CSS:`css`,JS:`js`,IMAGE:`image`,FONT:`font`,MEDIA:`media`,OTHER:`other`},to={FETCH:eo.FETCH,XHR:eo.XHR},no=500;function ro(){let e=new me(no),t=Xt(yr)().subscribe(t=>{e.notify({type:0,error:t})});return{observable:e,stop:()=>{t.unsubscribe()}}}function io(e,t,n){let r=n.getHandler(),i=Array.isArray(r)?r:[r];return ao[e]>=ao[n.getLevel()]&&i.includes(t)}var Z={ok:`ok`,debug:`debug`,info:`info`,notice:`notice`,warn:`warn`,error:`error`,critical:`critical`,alert:`alert`,emerg:`emerg`},ao={[Z.ok]:0,[Z.debug]:1,[Z.info]:2,[Z.notice]:4,[Z.warn]:5,[Z.error]:6,[Z.critical]:7,[Z.alert]:8,[Z.emerg]:9};function oo(e,{includeMessage:t=!1}={}){return{stack:e.stack,kind:e.type,message:t?e.message:void 0,causes:e.causes,fingerprint:e.fingerprint,handling:e.handling}}var so=function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},co={console:`console`,http:`http`,silent:`silent`},lo=Object.keys(Z),Q=class{constructor(e,t,n=co.http,r=Z.debug,i={}){this.handleLogStrategy=e,this.handlerType=n,this.level=r,this.contextManager=Ha(`logger`),this.tags=[],this.contextManager.setContext(i),t&&this.contextManager.setContextProperty(`logger`,{name:t})}logImplementation(e,t,n=Z.info,r,i){let a=z(t),o;if(r!=null){let e=pr({originalError:r,nonErrorPrefix:`Provided`,source:V.LOGGER,handling:`handled`,startClocks:E()});o=W({error:oo(e,{includeMessage:!0})},e.context,a)}else o=a;this.handleLogStrategy({message:z(e),context:o,status:n},this,i)}log(e,t,n=Z.info,r){let i;io(n,co.http,this)&&(i=Yn(`log`)),this.logImplementation(e,t,n,r,i)}setContext(e){this.contextManager.setContext(e)}getContext(){return this.contextManager.getContext()}setContextProperty(e,t){this.contextManager.setContextProperty(e,t)}removeContextProperty(e){this.contextManager.removeContextProperty(e)}clearContext(){this.contextManager.clearContext()}addTag(e,t){this.tags.push(U(e,t))}removeTagsWithKey(e){let t=Fr(e);this.tags=this.tags.filter(e=>e!==t&&!e.startsWith(`${t}:`))}getTags(){return this.tags.slice()}setHandler(e){this.handlerType=e}getHandler(){return this.handlerType}setLevel(e){this.level=e}getLevel(){return this.level}};so([ie],Q.prototype,`logImplementation`,null),Q.prototype.ok=$(Z.ok),Q.prototype.debug=$(Z.debug),Q.prototype.info=$(Z.info),Q.prototype.notice=$(Z.notice),Q.prototype.warn=$(Z.warn),Q.prototype.error=$(Z.error),Q.prototype.critical=$(Z.critical),Q.prototype.alert=$(Z.alert),Q.prototype.emerg=$(Z.emerg);function $(e){return function(t,n,r){let i;io(e,co.http,this)&&(i=Yn(`log`)),this.logImplementation(t,n,e,r,i)}}function uo(){return v?{}:{view:{referrer:document.referrer,url:window.location.href}}}var fo=`logs`;function po(e,t){let n=ca(e,fo,t=>ho(e,t),t);return{findTrackedSession:(e,t={returnInactive:!1})=>{let r=n.findSession(e,t);return r&&r.trackingType===`1`?{id:r.id,anonymousId:r.anonymousId}:void 0},expireObservable:n.expireObservable}}function mo(e){let t=ho(e)===`1`?{}:void 0;return{findTrackedSession:()=>t,expireObservable:new x}}function ho(e,t){return go(t)?t:l(e.sessionSampleRate)?`1`:`0`}function go(e){return e===`0`||e===`1`}function _o(e,t,n,r,i,a){let o=lo.concat([`custom`]),s={};
5o.forEach(e=>{s[e]=_a(e,i,a)}),t.subscribe(0,({rawLogsEvent:i,messageContext:a=void 0,savedCommonContext:o=void 0,domainContext:c,ddtags:l=[]})=>{let u=xe(i.date),d=o||r(),f=n.triggerHook(0,{startTime:u});if(f===`DISCARDED`)return;let p=Pr(e),m=W({view:d.view},f,i,a,{ddtags:p.concat(l).join(`,`)});e.beforeSend?.call(e,m,c)===!1||m.origin!==V.AGENT&&(s[m.status]??s.custom).isLimitReached()||t.notify(1,m)})}var vo={[e.log]:Z.info,[e.debug]:Z.debug,[e.info]:Z.info,[e.warn]:Z.warn,[e.error]:Z.error};function yo(e,t){let n=Na(e.forwardConsoleLogs).subscribe(e=>{let n={rawLogsEvent:{date:T(),message:e.message,origin:V.CONSOLE,error:e.error&&oo(e.error),status:vo[e.api]},messageContext:e.error?.context,domainContext:{handlingStack:e.handlingStack}};t.notify(0,n)});return{stop:()=>{n.unsubscribe()}}}function bo(e,t){let n=Dr(e,e.forwardReports).subscribe(e=>{let n=e.message,r,i=e.originalError.type===`deprecation`?Z.warn:Z.error;i===Z.error?r=oo(e):e.stack&&(n+=` Found in ${_r(e.stack)}`),t.notify(0,{rawLogsEvent:{date:T(),message:n,origin:V.REPORT,error:r,status:i}})});return{stop:()=>{n.unsubscribe()}}}function xo(e,t){if(!e.forwardErrorsToLogs)return{stop:D};let n=(v?new x:ba(e)).subscribe(e=>{e.state===`complete`&&a(to.XHR,e)}),r=Oa({responseBodyAction:e=>i(e)?2:0}).subscribe(e=>{e.state===`resolve`&&a(to.FETCH,e)});function i(e){return!gn(e.url)&&(So(e)||Wr(e.status))}function a(n,r){if(!i(r))return;let a=`error`in r&&r.error?Xn(kn(r.error)):r.responseBody||`Failed to load`,o={isAborted:r.isAborted,handlingStack:r.handlingStack};t.notify(0,{rawLogsEvent:{message:`${Co(n)} error ${r.method} ${r.url}`,date:r.startClocks.timeStamp,error:{stack:ke(a,e.requestErrorResponseLengthLimit,`...`),handling:void 0},http:{method:r.method,status_code:r.status,url:r.url},status:Z.error,origin:V.NETWORK},domainContext:o})}return{stop:()=>{n.unsubscribe(),r.unsubscribe()}}}function So(e){return e.status===0&&e.responseType!==`opaque`}function Co(e){return to.XHR===e?`XHR`:`Fetch`}function wo(e,t,n){if(!e.forwardErrorsToLogs)return{stop:D};let r=n.subscribe(e=>{if(e.type===0){let n=e.error;t.notify(0,{rawLogsEvent:{message:n.message,date:n.startClocks.timeStamp,error:oo(n),origin:V.SOURCE,status:Z.error},messageContext:n.context})}});return{stop:()=>{r.unsubscribe()}}}var To=ha;function Eo(e){function t(t,n,r,i,a){let o=W(n.getContext(),t.context);if(io(t.status,co.console,n)&&Oo(t,o),io(t.status,co.http,n)){let s={rawLogsEvent:{date:a||T(),message:t.message,status:t.status,origin:V.LOGGER},messageContext:o,savedCommonContext:i,ddtags:n.getTags()};r&&(s.domainContext={handlingStack:r}),e.notify(0,s)}}return{handleLog:t}}var Do={[Z.ok]:e.debug,[Z.debug]:e.debug,[Z.info]:e.info,[Z.notice]:e.info,[Z.warn]:e.warn,[Z.error]:e.error,[Z.critical]:e.error,[Z.alert]:e.error,[Z.emerg]:e.error};function Oo({status:e,message:r},i){n[Do[e]].call(t,r,i)}function ko(e,t,n,r,i){let a=[e.logsEndpointBuilder];e.replica&&a.push(e.replica.logsEndpointBuilder);let o=_i({encoder:Si(),request:ai(a,n),flushController:xi({pageMayExitObservable:r,sessionExpireObservable:i.expireObservable})});return t.subscribe(1,e=>{o.add(e)}),o}function Ao(e){let t=ui();e.subscribe(1,e=>{t.send(`log`,e)})}function jo(e){return{get:t=>{let n=e.findTrackedSession(t);if(n)return{session_id:n.id}}}}function Mo(e){return t=>{e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,origin:V.AGENT,status:Z.error}}),Ii(`Error reported to customer`,{"error.message":t.message})}}function No(e){let t=_;e.register(0,({startTime:e})=>n(e)||G),e.register(1,({startTime:e})=>{let t=n(e);return t?{application:{id:t.application_id},view:{id:t.view?.id},action:{id:t.user_action?.id}}:G});function n(e){let n=r(e,ta()?t.DD_RUM_SYNTHETICS:t.DD_RUM);if(n)return n}function r(e,t){if(t&&t.getInternalContext)return t.getInternalContext(e)}}function Po(e,t,n){e.register(0,({startTime:e})=>{let r=n.findTrackedSession(e);return n.findTrackedSession(e,{returnInactive:!0})?{service:t.service,session_id:r?r.id:void 0,session:r?{id:r.id}:void 0}:Ci}),e.register(1,({startTime:e})=>{let t=n.findTrackedSession(e);return!t||!t.id?G:{session:{id:t.id}}})}function Fo(e,t){function n(){return t.isGranted()?G:Ci}e.register(0,n),e.register(1,n)}var Io=`logs`;function Lo(e,t,n,r,i){let a=new To,o=[];a.subscribe(1,e=>Rr(`logs`,e));
5let s=Mo(a),c=mi(e),l=e.sessionStoreStrategyType&&!di()&&!ta()?po(e,n):mo(e);Fo(i,n),Po(i,e,l);let u=Ja(i,e,Io),d=Qa(i,e,l,Io),f=Xa(i,e,Io,!1);No(i),xo(e,a),wo(e,a,r),r.unbuffer(),yo(e,a),bo(e,a);let{handleLog:p}=Eo(a);if(_o(e,a,i,t,s),di())Ao(a);else{let{stop:t}=ko(e,a,s,c,l);o.push(()=>t())}return{handleLog:p,getInternalContext:jo(l).get,accountContext:u,globalContext:f,userContext:d,stop:()=>{o.forEach(e=>e())}}}var Ro=wi,zo=32*I;function Bo(t,n){t.usePciIntake===!0&&t.site&&t.site!==`datadoghq.com`&&i.warn(`PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.`);let r=bn(t,n),a=Vo(t.forwardConsoleLogs,Je(e),`Forward Console Logs`),o=Vo(t.forwardReports,Je(Er),`Forward Reports`);if(!(!r||!a||!o))return t.forwardErrorsToLogs&&!a.includes(e.error)&&a.push(e.error),{forwardErrorsToLogs:t.forwardErrorsToLogs!==!1,forwardConsoleLogs:a,forwardReports:o,requestErrorResponseLengthLimit:zo,...r}}function Vo(e,t,n){if(e===void 0)return[];if(!(e===`all`||Array.isArray(e)&&e.every(e=>t.includes(e)))){i.error(`${n} should be "all" or an array with allowed values "${t.join(`", "`)}"`);return}return e===`all`?t:Hi(e)}function Ho(e){let t=xn(e);return{forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports,use_pci_intake:e.usePciIntake,...t}}function Uo(e,t,n){let r=Ra(),a=Za();Ua(a,Y.globalContext,r);let o=Ya();Ua(o,Y.accountContext,r);let s=$a();Ua(s,Y.userContext,r);let c,l,u=Ro(),d=t.observable.subscribe(f);function f(){if(!l||!c||!t.isGranted())return;Xt(ji)(`browser-logs-sdk`,l,u),d.unsubscribe();let e=n(c,l,u);r.drain(e)}return{init(e,n){if(!e){i.error(`Missing configuration`);return}if(wn(e.enableExperimentalFeatures),di()&&(e=Wo(e)),c=e,Ri(Ho(e)),l){wr(`DD_LOGS`,e);return}let r=Bo(e,n);r&&(l=r,Oa().subscribe(D),t.tryToInit(r.trackingConsent),f())},get initConfiguration(){return c},globalContext:a,accountContext:o,userContext:s,getInternalContext:D,handleLog(t,n,i,a=e(),o=T()){r.add(e=>e.handleLog(t,n,i,a,o))}}}function Wo(e){return{...e,clientToken:`empty`}}function Go(){let e=Kt(),t=ro().observable,n=Uo(uo,e,(r,i,a)=>{let o=Xt(Lo)(i,uo,e,t,a);return n=Ko(r,o),o}),r=()=>n,i={};return Sr({logger:new Q((...e)=>n.handleLog(...e)),init:e=>{let t=Error().stack;ae(()=>n.init(e,t))},setTrackingConsent:b(t=>{e.update(t),zi({feature:`set-tracking-consent`,tracking_consent:t})}),getGlobalContext:J(r,Y.globalContext,X.getContext),setGlobalContext:J(r,Y.globalContext,X.setContext),setGlobalContextProperty:J(r,Y.globalContext,X.setContextProperty),removeGlobalContextProperty:J(r,Y.globalContext,X.removeContextProperty),clearGlobalContext:J(r,Y.globalContext,X.clearContext),createLogger:b((e,t={})=>(i[e]=new Q((...e)=>n.handleLog(...e),z(e),t.handler,t.level,z(t.context)),i[e])),getLogger:b(e=>i[e]),getInitConfiguration:b(()=>Br(n.initConfiguration)),getInternalContext:b(e=>n.getInternalContext(e)),setUser:J(r,Y.userContext,X.setContext),getUser:J(r,Y.userContext,X.getContext),setUserProperty:J(r,Y.userContext,X.setContextProperty),removeUserProperty:J(r,Y.userContext,X.removeContextProperty),clearUser:J(r,Y.userContext,X.clearContext),setAccount:J(r,Y.accountContext,X.setContext),getAccount:J(r,Y.accountContext,X.getContext),setAccountProperty:J(r,Y.accountContext,X.setContextProperty),removeAccountProperty:J(r,Y.accountContext,X.removeContextProperty),clearAccount:J(r,Y.accountContext,X.clearContext)})}function Ko(e,t){return{init:e=>{wr(`DD_LOGS`,e)},initConfiguration:e,...t}}var qo=Go();Cr(g(),`DD_LOGS`,qo);export{qo as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.