@datadog/webpack-plugin 2.6.4 → 2.6.5-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.
@@ -1 +1 @@
1
- "use strict";const t={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},e=console,n={};Object.keys(t).forEach((t=>{n[t]=e[t]}));const r="Datadog Browser SDK:",o={debug:n.debug.bind(e,r),log:n.log.bind(e,r),info:n.info.bind(e,r),warn:n.warn.bind(e,r),error:n.error.bind(e,r)},i="https://docs.datadoghq.com",s=`${i}/real_user_monitoring/browser/troubleshooting`,a="More details:";function c(t,e){return(...n)=>{try{return t(...n)}catch(t){o.error(e,t)}}}function u(t){return 0!==t&&100*Math.random()<=t}function l(t,e){return+t.toFixed(e)}function d(t){return"number"==typeof t}const f=1e3,p=6e4,h=31536e6;function m(t){return{relative:t,timeStamp:g(t)}}function g(t){const e=y()-performance.now();return e>E()?Math.round(C(e,t)):function(t){return Math.round(C(E(),t))}(t)}function v(t){return d(t)?l(1e6*t,0):t}function y(){return(new Date).getTime()}function _(){return y()}function b(){return performance.now()}function w(){return{relative:b(),timeStamp:_()}}function S(){return{relative:0,timeStamp:E()}}function k(t,e){return e-t}function C(t,e){return t+e}function x(t){return t-E()}let T;function E(){return void 0===T&&(T=performance.timing.navigationStart),T}const A=1024,R=/[^\u0000-\u007F]/;function I(t){return R.test(t)?void 0!==window.TextEncoder?(new TextEncoder).encode(t).length:new Blob([t]).size:t.length}function N(t){return{...t}}function O(t,e){return Object.keys(t).some((n=>t[n]===e))}function L(t){return 0===Object.keys(t).length}function M(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let t=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof t&&(t="object"==typeof self?self:"object"==typeof window?window:{}),t}function D(t,e){const n=M();let r;return n.Zone&&"function"==typeof n.Zone.__symbol__&&(r=t[n.Zone.__symbol__(e)]),r||(r=t[e]),r}let P,U=!1;function $(t){U=t}function z(t){return function(){return B(t,this,arguments)}}function B(t,e,n){try{return t.apply(e,n)}catch(t){V(t)}}function V(t){if(F(t),P)try{P(t)}catch(t){F(t)}}function F(...t){U&&o.error("[MONITOR]",...t)}function j(t,e){return D(M(),"setTimeout")(z(t),e)}function q(t){D(M(),"clearTimeout")(t)}function H(t,e){return D(M(),"setInterval")(z(t),e)}function G(t){D(M(),"clearInterval")(t)}class W{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.observers.push(t),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter((e=>t!==e)),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(t){this.observers.forEach((e=>e(t)))}}function K(...t){return new W((e=>{const n=t.map((t=>t.subscribe((t=>e.notify(t)))));return()=>n.forEach((t=>t.unsubscribe()))}))}function J(t,e,n){const r=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing;let i,s,a=!1;return{throttled:(...n)=>{a?i=n:(r?t(...n):i=n,a=!0,s=j((()=>{o&&i&&t(...i),a=!1,i=void 0}),e))},cancel:()=>{q(s),a=!1,i=void 0}}}function X(){}function Y(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,Y)}const Z=/([\w-]+)\s*=\s*([^;]+)/g;function Q(t,e){for(Z.lastIndex=0;;){const n=Z.exec(t);if(!n)break;if(n[1]===e)return n[2]}}function tt(t,e,n=""){const r=t.charCodeAt(e-1),o=r>=55296&&r<=56319?e+1:e;return t.length<=o?t:`${t.slice(0,o)}${n}`}let et,nt,rt;function ot(){return null!=et?et:et=function(t=window){var e;const n=t.navigator.userAgent;if(t.chrome||/HeadlessChrome/.test(n))return 0;if(0===(null===(e=t.navigator.vendor)||void 0===e?void 0:e.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n))return 1;return 2}()}function it(t,e,n=0,r){const o=new Date;o.setTime(o.getTime()+n);const i=`expires=${o.toUTCString()}`,s=r&&r.crossSite?"none":"strict",a=r&&r.domain?`;domain=${r.domain}`:"",c=r&&r.secure?";secure":"",u=r&&r.partitioned?";partitioned":"";document.cookie=`${t}=${e};${i};path=/;samesite=${s}${a}${c}${u}`}function st(t){return Q(document.cookie,t)}function at(t){return nt||(nt=function(t){const e=new Map;for(Z.lastIndex=0;;){const n=Z.exec(t);if(!n)break;e.set(n[1],n[2])}return e}(document.cookie)),nt.get(t)}function ct(t,e){it(t,"",0,e)}const ut="_dd_s";function lt(t){return Object.values(t)}function dt(t){return Object.entries(t)}function ft(t){return null===t?"null":Array.isArray(t)?"array":typeof t}function pt(t){const e={...t};return["id","name","email"].forEach((t=>{t in e&&(e[t]=String(e[t]))})),e}const ht=144e5,mt=9e5,gt=h,vt="cookie",yt="local-storage",_t=/^([a-zA-Z]+)=([a-z0-9-]+)$/;function bt(t,e){const n={isExpired:"1"};return e.trackAnonymousUser&&((null==t?void 0:t.anonymousId)?n.anonymousId=null==t?void 0:t.anonymousId:n.anonymousId=Math.floor(Math.random()*Math.pow(36,10)).toString(36).padStart(10,"0")),n}function wt(t){return L(t)}function St(t){return!wt(t)}function kt(t){return void 0!==t.isExpired||!((void 0===(e=t).created||y()-Number(e.created)<ht)&&(void 0===e.expire||y()<Number(e.expire)));var e}function Ct(t){t.expire=String(y()+mt)}function xt(t){return dt(t).map((([t,e])=>"anonymousId"===t?`aid=${e}`:`${t}=${e}`)).join("&")}function Tt(t){const e={};return function(t){return!!t&&(-1!==t.indexOf("&")||_t.test(t))}(t)&&t.split("&").forEach((t=>{const n=_t.exec(t);if(null!==n){const[,t,r]=n;"aid"===t?e.anonymousId=r:e[t]=r}})),e}function Et(t){const e=function(t){const e={};e.secure=!!t.useSecureSessionCookie||!!t.usePartitionedCrossSiteSessionCookie,e.crossSite=!!t.usePartitionedCrossSiteSessionCookie,e.partitioned=!!t.usePartitionedCrossSiteSessionCookie,t.trackSessionAcrossSubdomains&&(e.domain=function(){if(void 0===rt){const t=`dd_site_test_${Y()}`,e="test",n=window.location.hostname.split(".");let r=n.pop();for(;n.length&&!st(t);)r=`${n.pop()}.${r}`,it(t,e,f,{domain:r});ct(t,{domain:r}),rt=r}return rt}());return e}(t);return function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{const e=`dd_cookie_test_${Y()}`,n="test";it(e,n,p,t);const r=st(e)===n;return ct(e,t),r}catch(t){return o.error(t),!1}}(e)?{type:vt,cookieOptions:e}:void 0}function At(t,e){const n={isLockEnabled:0===ot(),persistSession:(r=e,t=>{it(ut,xt(t),mt,r)}),retrieveSession:Rt,expireSession:n=>function(t,e,n){const r=bt(e,n);it(ut,xt(r),n.trackAnonymousUser?gt:ht,t)}(e,n,t)};var r;return function(t){if(!at(ut)){const e=at("_dd"),n=at("_dd_r"),r=at("_dd_l"),o={};e&&(o.id=e),r&&/^[01]$/.test(r)&&(o.logs=r),n&&/^[012]$/.test(n)&&(o.rum=n),St(o)&&(Ct(o),t.persistSession(o))}}(n),n}function Rt(){return Tt(st(ut))}function It(){try{const t=Y(),e=`_dd_test_${t}`;localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),t===n?{type:yt}:void 0}catch(t){return}}function Nt(t){return{isLockEnabled:!1,persistSession:Ot,retrieveSession:Lt,expireSession:e=>function(t,e){Ot(bt(t,e))}(e,t)}}function Ot(t){localStorage.setItem(ut,xt(t))}function Lt(){return Tt(localStorage.getItem(ut))}const Mt=[];let Dt;function Pt(t,e,n=0){var r;const{isLockEnabled:o,persistSession:i,expireSession:s}=e,a=t=>i({...t,lock:u}),c=()=>{const t=e.retrieveSession(),n=t.lock;return t.lock&&delete t.lock,{session:t,lock:n}};if(Dt||(Dt=t),t!==Dt)return void Mt.push(t);if(o&&n>=100)return void $t(e);let u,l=c();if(o){if(l.lock)return void Ut(t,e,n);if(u=Y(),a(l.session),l=c(),l.lock!==u)return void Ut(t,e,n)}let d=t.process(l.session);if(o&&(l=c(),l.lock!==u))Ut(t,e,n);else{if(d&&(kt(d)?s(d):(Ct(d),o?a(d):i(d))),o&&(!d||!kt(d))){if(l=c(),l.lock!==u)return void Ut(t,e,n);i(l.session),d=l.session}null===(r=t.after)||void 0===r||r.call(t,d||l.session),$t(e)}}function Ut(t,e,n){j((()=>{Pt(t,e,n+1)}),10)}function $t(t){Dt=void 0;const e=Mt.shift();e&&Pt(e,t)}const zt=f;function Bt(t){switch(t.sessionPersistence){case vt:return Et(t);case yt:return It();case void 0:{let e=Et(t);return!e&&t.allowFallbackToLocalStorage&&(e=It()),e}default:o.error(`Invalid session persistence '${String(t.sessionPersistence)}'`)}}function Vt(t,e,n,r){const o=new W,i=new W,s=new W,a=t.type===vt?At(e,t.cookieOptions):Nt(e),{expireSession:c}=a,u=H((function(){Pt({process:t=>kt(t)?bt(t,e):void 0,after:p},a)}),zt);let l;h();const{throttled:d,cancel:f}=J((()=>{Pt({process:t=>{if(wt(t))return;const e=p(t);return function(t){if(wt(t))return!1;const{trackingType:e,isTracked:o}=r(t[n]);t[n]=e,delete t.isExpired,o&&!t.id&&(t.id=Y(),t.created=String(y()))}(e),e},after:t=>{St(t)&&!m()&&function(t){l=t,o.notify()}(t),l=t}},a)}),zt);function p(t){return kt(t)&&(t=bt(t,e)),m()&&(!function(t){return l.id!==t.id||l[n]!==t[n]}(t)?(s.notify({previousState:l,newState:t}),l=t):(l=bt(l,e),i.notify())),t}function h(){Pt({process:t=>{if(wt(t))return bt(t,e)},after:t=>{l=t}},a)}function m(){return void 0!==l[n]}return{expandOrRenewSession:d,expandSession:function(){Pt({process:t=>m()?p(t):void 0},a)},getSession:()=>l,renewObservable:o,expireObservable:i,sessionStateUpdateObservable:s,restartSession:h,expire:()=>{f(),c(l),p(bt(l,e))},stop:()=>{G(u)},updateSessionState:function(t){Pt({process:e=>({...e,...t}),after:p},a)}}}const Ft={GRANTED:"granted",NOT_GRANTED:"not-granted"};function jt(t,e,n){if("object"!=typeof t||null===t)return JSON.stringify(t);const r=qt(Object.prototype),o=qt(Array.prototype),i=qt(Object.getPrototypeOf(t)),s=qt(t);try{return JSON.stringify(t,e,n)}catch(t){return"<error: unable to serialize object>"}finally{r(),o(),i(),s()}}function qt(t){const e=t,n=e.toJSON;return n?(delete e.toJSON,()=>{e.toJSON=n}):X}function Ht(t){return Gt(t,location.href).href}function Gt(t,e){const n=function(){if(void 0===Kt)try{const t=new Wt("http://test/path");Kt="http://test/path"===t.href}catch(t){Kt=!1}return Kt?Wt:void 0}();if(n)try{return void 0!==e?new n(t,e):new n(t)}catch(n){throw new Error(`Failed to construct URL: ${String(n)} ${jt({url:t,base:e})}`)}if(void 0===e&&!/:/.test(t))throw new Error(`Invalid URL: '${t}'`);let r=document;const o=r.createElement("a");if(void 0!==e){r=document.implementation.createHTMLDocument("");const t=r.createElement("base");t.href=e,r.head.appendChild(t),r.body.appendChild(o)}return o.href=t,o}const Wt=URL;let Kt;const Jt="datad0g.com",Xt="dd0g-gov.com",Yt="datadoghq.com",Zt="datadoghq.eu",Qt="pci.browser-intake-datadoghq.com",te=["ddsource","ddtags"];function ee(t,e,n){const r=function(t,e){const n=`/api/v2/${e}`,r=t.proxy;if("string"==typeof r){const t=Ht(r);return e=>`${t}?ddforward=${encodeURIComponent(`${n}?${e}`)}`}if("function"==typeof r)return t=>r({path:n,parameters:t});const o=function(t,e){const{site:n=Yt,internalAnalyticsSubdomain:r}=e;if("logs"===t&&e.usePciIntake&&n===Yt)return Qt;if(r&&n===Yt)return`${r}.${Yt}`;if(n===Xt)return`http-intake.logs.${n}`;const o=n.split("."),i=o.pop();return`browser-intake-${o.join("-")}.${i}`}(e,t);return t=>`https://${o}${n}?${t}`}(t,e);return{build(o,i){const s=function({clientToken:t,internalAnalyticsSubdomain:e},n,r,o,{retry:i,encoding:s}){const a=["sdk_version:6.0.0",`api:${o}`].concat(r);i&&a.push(`retry_count:${i.count}`,`retry_after:${i.lastFailureStatus}`);const c=["ddsource=browser",`ddtags=${encodeURIComponent(a.join(","))}`,`dd-api-key=${t}`,`dd-evp-origin-version=${encodeURIComponent("6.0.0")}`,"dd-evp-origin=browser",`dd-request-id=${Y()}`];s&&c.push(`dd-evp-encoding=${s}`);"rum"===n&&c.push(`batch_time=${_()}`);e&&c.reverse();return c.join("&")}(t,e,n,o,i);return r(s)},urlPrefix:r(""),trackType:e}}function ne(t,e){const n=200-t.length-1;(e.length>n||function(t){if(!function(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch(t){return!1}}())return!1;return new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(t)}(e))&&o.warn(`${t} value doesn't meet tag requirements and will be sanitized. ${a} ${i}/getting_started/tagging/#defining-tags`);return`${t}:${e.replace(/,/g,"_")}`}function re(t){const e=t.site||Yt,n=function(t){const{env:e,service:n,version:r,datacenter:o}=t,i=[];return e&&i.push(ne("env",e)),n&&i.push(ne("service",n)),r&&i.push(ne("version",r)),o&&i.push(ne("datacenter",o)),i}(t),r=function(t,e){return{logsEndpointBuilder:ee(t,"logs",e),rumEndpointBuilder:ee(t,"rum",e),sessionReplayEndpointBuilder:ee(t,"replay",e)}}(t,n),o=function(t,e){if(!t.replica)return;const n={...t,site:Yt,clientToken:t.replica.clientToken},r={logsEndpointBuilder:ee(n,"logs",e),rumEndpointBuilder:ee(n,"rum",e)};return{applicationId:t.replica.applicationId,...r}}(t,n);return{replica:o,site:e,...r}}const oe={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},ie={ALL:"all",SAMPLED:"sampled"};function se(t,e){return null==t||"string"==typeof t||(o.error(`${e} must be defined as a string`),!1)}function ae(t,e){return!!(void 0===t||(n=t,d(n)&&n>=0&&n<=100))||(o.error(`${e} Sample Rate should be a number between 0 and 100`),!1);var n}function ce(t){var e,n,r,s,u,l;if(t&&t.clientToken){if((!(d=t.site)||"string"!=typeof d||/(datadog|ddog|datad0g|dd0g)/.test(d)||(o.error(`Site should be a valid Datadog site. ${a} ${i}/getting_started/site/.`),0))&&ae(t.sessionSampleRate,"Session")&&ae(t.telemetrySampleRate,"Telemetry")&&ae(t.telemetryConfigurationSampleRate,"Telemetry Configuration")&&ae(t.telemetryUsageSampleRate,"Telemetry Usage")&&se(t.version,"Version")&&se(t.env,"Env")&&se(t.service,"Service")){var d;if(void 0===t.trackingConsent||O(Ft,t.trackingConsent))return{beforeSend:t.beforeSend&&c(t.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Bt(t),sessionSampleRate:null!==(e=t.sessionSampleRate)&&void 0!==e?e:100,telemetrySampleRate:null!==(n=t.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=t.telemetryConfigurationSampleRate)&&void 0!==r?r:5,telemetryUsageSampleRate:null!==(s=t.telemetryUsageSampleRate)&&void 0!==s?s:5,service:t.service||void 0,silentMultipleInit:!!t.silentMultipleInit,allowUntrustedEvents:!!t.allowUntrustedEvents,trackingConsent:null!==(u=t.trackingConsent)&&void 0!==u?u:Ft.GRANTED,trackAnonymousUser:null===(l=t.trackAnonymousUser)||void 0===l||l,storeContextsAcrossPages:!!t.storeContextsAcrossPages,batchBytesLimit:16384,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:3e4,batchMessagesLimit:50,messageBytesLimit:262144,...re(t)};o.error('Tracking Consent should be either "granted" or "not-granted"')}}else o.error("Client Token is not configured, we will not send any data.")}var ue;!function(t){t.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",t.REMOTE_CONFIGURATION="remote_configuration",t.ACTION_NAME_MASKING="action_name_masking",t.CONSISTENT_TRACE_SAMPLING="consistent_trace_sampling",t.DELAY_VIEWPORT_COLLECTION="delay_viewport_collection"}(ue||(ue={}));const le=new Set;function de(t){Array.isArray(t)&&t.filter((t=>O(ue,t))).forEach((t=>{le.add(t)}))}function fe(t){return le.has(t)}function pe(){return le}const he="?";function me(t){const e=[];let n=Ce(t,"stack");const r=String(t);return n&&n.startsWith(r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((t=>{const n=function(t){const e=ye.exec(t);if(!e)return;const n=e[2]&&0===e[2].indexOf("native"),r=e[2]&&0===e[2].indexOf("eval"),o=_e.exec(e[2]);r&&o&&(e[2]=o[1],e[3]=o[2],e[4]=o[3]);return{args:n?[e[2]]:[],column:e[4]?+e[4]:void 0,func:e[1]||he,line:e[3]?+e[3]:void 0,url:n?void 0:e[2]}}(t)||function(t){const e=be.exec(t);if(!e)return;return{args:[],column:e[3]?+e[3]:void 0,func:he,line:e[2]?+e[2]:void 0,url:e[1]}}(t)||function(t){const e=we.exec(t);if(!e)return;return{args:[],column:e[4]?+e[4]:void 0,func:e[1]||he,line:+e[3],url:e[2]}}(t)||function(t){const e=Se.exec(t);if(!e)return;const n=e[3]&&e[3].indexOf(" > eval")>-1,r=ke.exec(e[3]);n&&r&&(e[3]=r[1],e[4]=r[2],e[5]=void 0);return{args:e[2]?e[2].split(","):[],column:e[5]?+e[5]:void 0,func:e[1]||he,line:e[4]?+e[4]:void 0,url:e[3]}}(t);n&&(!n.func&&n.line&&(n.func=he),e.push(n))})),{message:Ce(t,"message"),name:Ce(t,"name"),stack:e}}const ge="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",ve="(?::(\\d+))",ye=new RegExp(`^\\s*at (.*?) ?\\(${ge}${ve}?${ve}?\\)?\\s*$`,"i"),_e=new RegExp(`\\((\\S*)${ve}${ve}\\)`);const be=new RegExp(`^\\s*at ?${ge}${ve}?${ve}??\\s*$`,"i");const we=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;const Se=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,ke=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Ce(t,e){if("object"!=typeof t||!t||!(e in t))return;const n=t[e];return"string"==typeof n?n:void 0}function xe(t,e,n,r){const o=[{url:e,column:r,line:n}],{name:i,message:s}=function(t){let e,n;"[object String]"==={}.toString.call(t)&&([,e,n]=Te.exec(t));return{name:e,message:n}}(t);return{name:i,message:s,stack:o}}const Te=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Ee(){const t=new Error;let e;return B((()=>{const n=me(t);n.stack=n.stack.slice(2),e=Ae(n)})),e}function Ae(t){let e=Re(t);return t.stack.forEach((t=>{const n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?`(${t.args.join(", ")})`:"",o=t.line?`:${t.line}`:"",i=t.line&&t.column?`:${t.column}`:"";e+=`\n at ${n}${r} @ ${t.url}${o}${i}`})),e}function Re(t){return`${t.name||"Error"}: ${t.message}`}function Ie(t,e,n,{computeHandlingStack:r}={}){let o=t[e];if("function"!=typeof o){if(!(e in t)||!e.startsWith("on"))return{stop:X};o=X}let i=!1;const s=function(){if(i)return o.apply(this,arguments);const t=Array.from(arguments);let e;B(n,null,[{target:this,parameters:t,onPostCall:t=>{e=t},handlingStack:r?Ee():void 0}]);const s=o.apply(this,t);return e&&B(e,null,[s]),s};return t[e]=s,{stop:()=>{i=!0,t[e]===s&&(t[e]=o)}}}function Ne(t,e,n){const r=Object.getOwnPropertyDescriptor(t,e);if(!r||!r.set||!r.configurable)return{stop:X};const o=X;let i=(t,e)=>{j((()=>{i!==o&&n(t,e)}),0)};const s=function(t){r.set.call(this,t),i(this,t)};return Object.defineProperty(t,e,{set:s}),{stop:()=>{var n;(null===(n=Object.getOwnPropertyDescriptor(t,e))||void 0===n?void 0:n.set)===s&&Object.defineProperty(t,e,r),i=o}}}function Oe(t,e=225280){const n=qt(Object.prototype),r=qt(Array.prototype),o=[],i=new WeakMap,s=Le(t,"$",void 0,o,i),a=JSON.stringify(s);let c=a?a.length:0;if(!(c>e)){for(;o.length>0&&c<e;){const n=o.shift();let r=0;if(Array.isArray(n.source))for(let s=0;s<n.source.length;s++){const a=Le(n.source[s],n.path,s,o,i);if(c+=void 0!==a?JSON.stringify(a).length:4,c+=r,r=1,c>e){De(e,"truncated",t);break}n.target[s]=a}else for(const s in n.source)if(Object.prototype.hasOwnProperty.call(n.source,s)){const a=Le(n.source[s],n.path,s,o,i);if(void 0!==a&&(c+=JSON.stringify(a).length+r+s.length+3,r=1),c>e){De(e,"truncated",t);break}n.target[s]=a}}return n(),r(),s}De(e,"discarded",t)}function Le(t,e,n,r,o){const i=function(t){const e=t;if(e&&"function"==typeof e.toJSON)try{return e.toJSON()}catch(t){}return t}(t);if(!i||"object"!=typeof i)return function(t){if("bigint"==typeof t)return`[BigInt] ${t.toString()}`;if("function"==typeof t)return`[Function] ${t.name||"unknown"}`;if("symbol"==typeof t)return`[Symbol] ${t.description||t.toString()}`;return t}(i);const s=Me(i);if("[Object]"!==s&&"[Array]"!==s&&"[Error]"!==s)return s;const a=t;if(o.has(a))return`[Reference seen at ${o.get(a)}]`;const c=void 0!==n?`${e}.${n}`:e,u=Array.isArray(i)?[]:{};return o.set(a,c),r.push({source:i,target:u,path:c}),u}function Me(t){try{if(t instanceof Event)return{type:(e=t).type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?Me(e.currentTarget):null,target:e.target?Me(e.target):null};if(t instanceof RegExp)return`[RegExp] ${t.toString()}`;const n=Object.prototype.toString.call(t).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch(t){}var e;return"[Unserializable]"}function De(t,e,n){o.warn(`The data provided has been ${e} as it is over the limit of ${t} characters:`,n)}const Pe="No stack, consider using an instance of Error";function Ue({stackTrace:t,originalError:e,handlingStack:n,startClocks:r,nonErrorPrefix:o,source:i,handling:s}){const a=ze(e),c=function(t,e,n,r){return(null==t?void 0:t.message)&&(null==t?void 0:t.name)?t.message:e?"Empty message":`${n} ${jt(Oe(r))}`}(t,a,o,e),u=function(t,e){if(void 0===e)return!1;if(t)return!0;return e.stack.length>0&&(e.stack.length>1||void 0!==e.stack[0].url)}(a,t)?Ae(t):Pe,l=a?Be(e,i):void 0;return{startClocks:r,source:i,handling:s,handlingStack:n,originalError:e,type:t?t.name:void 0,message:c,stack:u,causes:l,fingerprint:$e(e)}}function $e(t){return ze(t)&&"dd_fingerprint"in t?String(t.dd_fingerprint):void 0}function ze(t){return t instanceof Error||"[object Error]"===Object.prototype.toString.call(t)}function Be(t,e){let n=t;const r=[];for(;ze(null==n?void 0:n.cause)&&r.length<10;){const t=me(n.cause);r.push({message:n.cause.message,source:e,type:null==t?void 0:t.name,stack:t&&Ae(t)}),n=n.cause}return r.length?r:void 0}const Ve="agent",Fe="console",je="custom",qe="source",He="report";function Ge(t){const e=(e,n)=>{const r=Ue({stackTrace:e,originalError:n,startClocks:w(),nonErrorPrefix:"Uncaught",source:qe,handling:"unhandled"});t.notify(r)},{stop:n}=(r=e,Ie(window,"onerror",(({parameters:[t,e,n,o,i]})=>{let s;s=ze(i)?me(i):xe(t,e,n,o),r(s,null!=i?i:t)})));var r;const{stop:o}=function(t){return Ie(window,"onunhandledrejection",(({parameters:[e]})=>{const n=e.reason||"Empty reason",r=me(n);t(r,n)}))}(e);return{stop:()=>{n(),o()}}}function We(t,e){e.silentMultipleInit||o.error(`${t} is already initialized.`)}function Ke(t,e,n,r,o){return Je(t,e,[n],r,o)}function Je(t,e,n,r,{once:o,capture:i,passive:s}={}){const a=z((e=>{(e.isTrusted||e.__ddIsTrusted||t.allowUntrustedEvents)&&(o&&d(),r(e))})),c=s?{capture:i,passive:s}:i,u=window.EventTarget&&e instanceof EventTarget?window.EventTarget.prototype:e,l=D(u,"addEventListener");function d(){const t=D(u,"removeEventListener");n.forEach((n=>t.call(e,n,a,c)))}return n.forEach((t=>l.call(e,t,a,c))),{stop:d}}const Xe="intervention",Ye="csp_violation";function Ze(t,e){const n=[];e.includes(Ye)&&n.push(function(t){return new W((e=>{const{stop:n}=Ke(t,document,"securitypolicyviolation",(t=>{e.notify(function(t){const e=`'${t.blockedURI}' blocked by '${t.effectiveDirective}' directive`;return Qe({type:t.effectiveDirective,message:`${Ye}: ${e}`,originalError:t,csp:{disposition:t.disposition},stack:tn(t.effectiveDirective,t.originalPolicy?`${e} of the policy "${tt(t.originalPolicy,100,"...")}"`:"no policy",t.sourceFile,t.lineNumber,t.columnNumber)})}(t))}));return n}))}(t));const r=e.filter((t=>t!==Ye));return r.length&&n.push(function(t){return new W((e=>{if(!window.ReportingObserver)return;const n=z(((t,n)=>t.forEach((t=>e.notify(function(t){const{type:e,body:n}=t;return Qe({type:n.id,message:`${e}: ${n.message}`,originalError:t,stack:tn(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}(t)))))),r=new window.ReportingObserver(n,{types:t,buffered:!0});return r.observe(),()=>{r.disconnect()}}))}(r)),K(...n)}function Qe(t){return{startClocks:w(),source:He,handling:"unhandled",...t}}function tn(t,e,n,r,o){return n?Ae({name:t,message:e,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=o?o:void 0}]}):void 0}function en(t,e){const n=window.__ddBrowserSdkExtensionCallback;n&&n({type:t,payload:e})}function nn(t,e,n=function(){if("undefined"!=typeof WeakSet){const t=new WeakSet;return{hasAlreadyBeenSeen(e){const n=t.has(e);return n||t.add(e),n}}}const t=[];return{hasAlreadyBeenSeen(e){const n=t.indexOf(e)>=0;return n||t.push(e),n}}}()){if(void 0===e)return t;if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=e.flags||[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.sticky?"y":"",e.unicode?"u":""].join("");return new RegExp(e.source,t)}if(n.hasAlreadyBeenSeen(e))return;if(Array.isArray(e)){const r=Array.isArray(t)?t:[];for(let t=0;t<e.length;++t)r[t]=nn(r[t],e[t],n);return r}const r="object"===ft(t)?t:{};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=nn(r[t],e[t],n));return r}function rn(t){return nn(void 0,t)}function on(...t){let e;for(const n of t)null!=n&&(e=nn(e,n));return e}function sn(){var t;const e=window.navigator;return{status:e.onLine?"connected":"not_connected",interfaces:e.connection&&e.connection.type?[e.connection.type]:void 0,effective_type:null===(t=e.connection)||void 0===t?void 0:t.effectiveType}}function an(t,e){const n=t.indexOf(e);n>=0&&t.splice(n,1)}function cn(){const t=[];return{add:e=>{t.push(e)>500&&t.splice(0,1)},remove:e=>{an(t,e)},drain:e=>{t.forEach((t=>t(e))),t.length=0}}}const un="log",ln="configuration",dn="usage",fn=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],pn=["ddog-gov.com"];let hn=cn(),mn=t=>{hn.add((()=>mn(t)))};function gn(t,e){let n;const r=new W,o=new Set,i=!pn.includes(e.site)&&u(e.telemetrySampleRate),s={[un]:i,[ln]:i&&u(e.telemetryConfigurationSampleRate),[dn]:i&&u(e.telemetryUsageSampleRate)},a={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return mn=i=>{const c=jt(i);if(s[i.type]&&o.size<e.maxTelemetryEventsPerPage&&!o.has(c)){const e=function(t,e,r){return on({type:"telemetry",date:_(),service:t,version:"6.0.0",source:"browser",_dd:{format_version:2},telemetry:on(e,{runtime_env:r,connectivity:sn(),sdk_setup:"npm"}),experimental_features:Array.from(pe())},void 0!==n?n():{})}(t,i,a);r.notify(e),en("telemetry",e),o.add(c)}},P=yn,{setContextProvider:t=>{n=t},observable:r,enabled:i}}function vn(e,n){F(t.debug,e,n),mn({type:un,message:e,status:"debug",...n})}function yn(t,e){mn({type:un,status:"error",...bn(t),...e})}function _n(t){mn({type:dn,usage:t})}function bn(t){if(ze(t)){const e=me(t);return{error:{kind:e.name,stack:Ae(wn(e))},message:e.message}}return{error:{stack:Pe},message:`Uncaught ${jt(t)}`}}function wn(t){return t.stack=t.stack.filter((t=>!t.url||fn.some((e=>t.url.startsWith(e))))),t}const Sn=1/0;function kn({expireDelay:t,maxEntries:e}){let n=[];const r=H((()=>function(){const e=b()-t;for(;n.length>0&&n[n.length-1].endTime<e;)n.pop()}()),6e4);return{add:function(t,r){const o={value:t,startTime:r,endTime:Sn,remove:()=>{an(n,o)},close:t=>{o.endTime=t}};return e&&n.length>=e&&n.pop(),n.unshift(o),o},find:function(t=Infinity,e={returnInactive:!1}){for(const r of n)if(r.startTime<=t){if(e.returnInactive||t<=r.endTime)return r.value;break}},closeActive:function(t){const e=n[0];e&&e.endTime===Sn&&e.close(t)},findAll:function(t=Infinity,e=0){const r=C(t,e);return n.filter((e=>e.startTime<=r&&t<=e.endTime)).map((t=>t.value))},reset:function(){n=[]},stop:function(){G(r)}}}const Cn=p,xn=ht;function Tn(t,e,n,r){const o=new W,i=new W,s=Vt(t.sessionStoreStrategyType,t,e,n),a=kn({expireDelay:xn});function c(){return{id:s.getSession().id,trackingType:s.getSession()[e],isReplayForced:!!s.getSession().forcedReplay,anonymousId:s.getSession().anonymousId}}return s.renewObservable.subscribe((()=>{a.add(c(),b()),o.notify()})),s.expireObservable.subscribe((()=>{i.notify(),a.closeActive(b())})),s.expandOrRenewSession(),a.add(c(),S().relative),r.observable.subscribe((()=>{r.isGranted()?s.expandOrRenewSession():s.expire()})),function(t,e){Je(t,window,["click","touchstart","keydown","scroll"],e,{capture:!0,passive:!0})}(t,(()=>{r.isGranted()&&s.expandOrRenewSession()})),function(t,e){const n=()=>{"visible"===document.visibilityState&&e()};Ke(t,document,"visibilitychange",n),H(n,Cn)}(t,(()=>s.expandSession())),function(t,e){Ke(t,window,"resume",e,{capture:!0})}(t,(()=>s.restartSession())),{findSession:(t,e)=>a.find(t,e),renewObservable:o,expireObservable:i,sessionStateUpdateObservable:s.sessionStateUpdateObservable,expire:s.expire,updateSessionState:s.updateSessionState}}const En=3145728,An=f;function Rn(t,e,n,r,o){0===e.transportStatus&&0===e.queuedPayloads.size()&&e.bandwidthMonitor.canHandle(t)?Nn(t,e,n,{onSuccess:()=>On(0,e,n,r,o),onFailure:()=>{e.queuedPayloads.enqueue(t),In(e,n,r,o)}}):e.queuedPayloads.enqueue(t)}function In(t,e,n,r){2===t.transportStatus&&j((()=>{Nn(t.queuedPayloads.first(),t,e,{onSuccess:()=>{t.queuedPayloads.dequeue(),t.currentBackoffTime=An,On(1,t,e,n,r)},onFailure:()=>{t.currentBackoffTime=Math.min(6e4,2*t.currentBackoffTime),In(t,e,n,r)}})}),t.currentBackoffTime)}function Nn(t,e,n,{onSuccess:r,onFailure:o}){e.bandwidthMonitor.add(t),n(t,(n=>{e.bandwidthMonitor.remove(t),!function(t){return"opaque"!==t.type&&(0===t.status&&!navigator.onLine||408===t.status||429===t.status||(e=t.status,e>=500));var e}(n)?(e.transportStatus=0,r()):(e.transportStatus=e.bandwidthMonitor.ongoingRequestCount>0?1:2,t.retry={count:t.retry?t.retry.count+1:1,lastFailureStatus:n.status},o())}))}function On(t,e,n,r,o){0===t&&e.queuedPayloads.isFull()&&!e.queueFullReported&&(o({message:`Reached max ${r} events size queued for upload: 3MiB`,source:Ve,startClocks:w()}),e.queueFullReported=!0);const i=e.queuedPayloads;for(e.queuedPayloads=Ln();i.size()>0;)Rn(i.dequeue(),e,n,r,o)}function Ln(){const t=[];return{bytesCount:0,enqueue(e){this.isFull()||(t.push(e),this.bytesCount+=e.bytesCount)},first:()=>t[0],dequeue(){const e=t.shift();return e&&(this.bytesCount-=e.bytesCount),e},size:()=>t.length,isFull(){return this.bytesCount>=En}}}function Mn(t,e,n){const r={transportStatus:0,currentBackoffTime:An,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle(t){return 0===this.ongoingRequestCount||this.ongoingByteCount+t.bytesCount<=81920&&this.ongoingRequestCount<32},add(t){this.ongoingRequestCount+=1,this.ongoingByteCount+=t.bytesCount},remove(t){this.ongoingRequestCount-=1,this.ongoingByteCount-=t.bytesCount}},queuedPayloads:Ln(),queueFullReported:!1},o=(n,r)=>function(t,e,n,r){const o=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(t){return!1}}()&&n.bytesCount<e;if(o){const e=t.build("fetch",n);fetch(e,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(z((t=>null==r?void 0:r({status:t.status,type:t.type}))),z((()=>{Pn(t.build("xhr",n),n.data,r)})))}else{Pn(t.build("xhr",n),n.data,r)}}(t,e,n,r);return{send:e=>{Rn(e,r,o,t.trackType,n)},sendOnExit:n=>{!function(t,e,n){const r=!!navigator.sendBeacon&&n.bytesCount<e;if(r)try{const e=t.build("beacon",n);if(navigator.sendBeacon(e,n.data))return}catch(t){!function(t){Dn||(Dn=!0,yn(t))}(t)}const o=t.build("xhr",n);Pn(o,n.data)}(t,e,n)}}}let Dn=!1;function Pn(t,e,n){const r=new XMLHttpRequest;r.open("POST",t,!0),e instanceof Blob&&r.setRequestHeader("Content-Type",e.type),Ke({allowUntrustedEvents:!0},r,"loadend",(()=>{null==n||n({status:r.status})}),{once:!0}),r.send(e)}function Un(){const t=M().DatadogEventBridge;if(t)return{getCapabilities(){var e;return JSON.parse((null===(e=t.getCapabilities)||void 0===e?void 0:e.call(t))||"[]")},getPrivacyLevel(){var e;return null===(e=t.getPrivacyLevel)||void 0===e?void 0:e.call(t)},getAllowedWebViewHosts:()=>JSON.parse(t.getAllowedWebViewHosts()),send(e,n,r){const o=r?{id:r}:void 0;t.send(JSON.stringify({eventType:e,event:n,view:o}))}}}function $n(t){const e=Un();return!!e&&e.getCapabilities().includes(t)}function zn(t){var e;void 0===t&&(t=null===(e=M().location)||void 0===e?void 0:e.hostname);const n=Un();return!!n&&n.getAllowedWebViewHosts().some((e=>t===e||t.endsWith(`.${e}`)))}const Bn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Vn(t){return lt(Bn).includes(t)}function Fn({encoder:t,request:e,flushController:n,messageBytesLimit:r}){let i={};const c=n.flushObservable.subscribe((n=>function(n){const r=lt(i).join("\n");i={};const o=Vn(n.reason),s=o?e.sendOnExit:e.send;if(o&&t.isAsync){const e=t.finishSync();e.outputBytesCount&&s(jn(e));const n=[e.pendingData,r].filter(Boolean).join("\n");n&&s({data:n,bytesCount:I(n)})}else r&&t.write(t.isEmpty?r:`\n${r}`),t.finish((t=>{s(jn(t))}))}(n)));function u(e,c){const u=jt(e),l=t.estimateEncodedBytesCount(u);l>=r?o.warn(`Discarded a message whose size was bigger than the maximum allowed size ${r}KB. ${a} ${s}/#technical-limitations`):(function(t){return void 0!==t&&void 0!==i[t]}(c)&&function(e){const r=i[e];delete i[e];const o=t.estimateEncodedBytesCount(r);n.notifyAfterRemoveMessage(o)}(c),function(e,r,o){n.notifyBeforeAddMessage(r),void 0!==o?(i[o]=e,n.notifyAfterAddMessage()):t.write(t.isEmpty?e:`\n${e}`,(t=>{n.notifyAfterAddMessage(t-r)}))}(u,l,c))}return{flushController:n,add:u,upsert:u,stop:c.unsubscribe}}function jn(t){let e;return e="string"==typeof t.output?t.output:new Blob([t.output],{type:"text/plain"}),{data:e,bytesCount:t.outputBytesCount,encoding:t.encoding}}function qn({messagesLimit:t,bytesLimit:e,durationLimit:n,pageExitObservable:r,sessionExpireObservable:o}){const i=r.subscribe((t=>d(t.reason))),s=o.subscribe((()=>d("session_expire"))),a=new W((()=>()=>{i.unsubscribe(),s.unsubscribe()}));let c,u=0,l=0;function d(t){if(0===l)return;const e=l,n=u;l=0,u=0,f(),a.notify({reason:t,messagesCount:e,bytesCount:n})}function f(){q(c),c=void 0}return{flushObservable:a,get messagesCount(){return l},notifyBeforeAddMessage(t){u+t>=e&&d("bytes_limit"),l+=1,u+=t,void 0===c&&(c=j((()=>{d("duration_limit")}),n))},notifyAfterAddMessage(n=0){u+=n,l>=t?d("messages_limit"):u>=e&&d("bytes_limit")},notifyAfterRemoveMessage(t){u-=t,l-=1,0===l&&f()}}}function Hn(){let t="",e=0;return{isAsync:!1,get isEmpty(){return!t},write(n,r){const o=I(n);e+=o,t+=n,r&&r(o)},finish(t){t(this.finishSync())},finishSync(){const n={output:t,outputBytesCount:e,rawBytesCount:e,pendingData:""};return t="",e=0,n},estimateEncodedBytesCount:t=>t.length}}function Gn(t,e,n){let r=0,o=!1;return{isLimitReached(){if(0===r&&j((()=>{r=0}),p),r+=1,r<=e||o)return o=!1,!1;if(r===e+1){o=!0;try{n({message:`Reached max number of ${t}s by minute: ${e}`,source:Ve,startClocks:w()})}finally{o=!1}}return!0}}}function Wn(t,e,n){if(document.readyState===e||"complete"===document.readyState)return n(),{stop:X};return Ke(t,window,"complete"===e?"load":"DOMContentLoaded",n,{once:!0})}function Kn(t,e){return new Promise((n=>{Wn(t,e,n)}))}let Jn;const Xn=new WeakMap;function Yn(t){return Jn||(Jn=function(t){return new W((e=>{const{stop:n}=Ie(XMLHttpRequest.prototype,"open",Zn),{stop:r}=Ie(XMLHttpRequest.prototype,"send",(n=>{!function({target:t,handlingStack:e},n,r){const o=Xn.get(t);if(!o)return;const i=o;i.state="start",i.startClocks=w(),i.isAborted=!1,i.xhr=t,i.handlingStack=e;let s=!1;const{stop:a}=Ie(t,"onreadystatechange",(()=>{t.readyState===XMLHttpRequest.DONE&&c()})),c=()=>{if(u(),a(),s)return;s=!0;const e=o;e.state="complete",e.duration=k(i.startClocks.timeStamp,_()),e.status=t.status,r.notify(N(e))},{stop:u}=Ke(n,t,"loadend",c);r.notify(i)}(n,t,e)}),{computeHandlingStack:!0}),{stop:o}=Ie(XMLHttpRequest.prototype,"abort",Qn);return()=>{n(),r(),o()}}))}(t)),Jn}function Zn({target:t,parameters:[e,n]}){Xn.set(t,{state:"open",method:String(e).toUpperCase(),url:Ht(String(n))})}function Qn({target:t}){const e=Xn.get(t);e&&(e.isAborted=!0)}let tr;function er(){return tr||(tr=new W((t=>{if(!window.fetch)return;const{stop:e}=Ie(window,"fetch",(e=>function({parameters:t,onPostCall:e,handlingStack:n},r){const[o,i]=t;let s=i&&i.method;void 0===s&&o instanceof Request&&(s=o.method);const a=void 0!==s?String(s).toUpperCase():"GET",c=o instanceof Request?o.url:Ht(String(o)),u=w(),l={state:"start",init:i,input:o,method:a,startClocks:u,url:c,handlingStack:n};r.notify(l),t[0]=l.input,t[1]=l.init,e((t=>function(t,e,n){const r=n;function o(e){r.state="resolve",Object.assign(r,e),t.notify(r)}e.then(z((t=>{o({response:t,responseType:t.type,status:t.status,isAborted:!1})})),z((t=>{var e,n;o({status:0,isAborted:(null===(n=null===(e=r.init)||void 0===e?void 0:e.signal)||void 0===n?void 0:n.aborted)||t instanceof DOMException&&t.code===DOMException.ABORT_ERR,error:t})})))}(r,t,l)))}(e,t)),{computeHandlingStack:!0});return e}))),tr}function nr(t,e){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(z(t),e);return()=>window.cancelIdleCallback(n)}return function(t){const e=y(),n=j((()=>{t({didTimeout:!1,timeRemaining:()=>Math.max(0,rr-(y()-e))})}),0);return()=>q(n)}(t)}const rr=50;let or={};function ir(n){return K(...n.map((n=>(or[n]||(or[n]=function(n){return new W((r=>{const o=e[n];return e[n]=(...e)=>{o.apply(console,e);const i=Ee();B((()=>{r.notify(function(e,n,r){const o=e.map((t=>function(t){if("string"==typeof t)return Oe(t);if(ze(t))return Re(me(t));return jt(Oe(t),void 0,2)}(t))).join(" ");let i;if(n===t.error){const t=e.find(ze);i={stack:t?Ae(me(t)):void 0,fingerprint:$e(t),causes:t?Be(t,"console"):void 0,startClocks:w(),message:o,source:Fe,handling:"handled",handlingStack:r}}return{api:n,message:o,error:i,handlingStack:r}}(e,n,i))}))},()=>{e[n]=o}}))}(n)),or[n]))))}function sr(t){let e={};const n=new W,r={getContext:()=>rn(e),setContext:o=>{"object"===ft(o)?(e=Oe(o),null==t||t.updateCustomerData(e)):r.clearContext(),n.notify()},setContextProperty:(r,o)=>{e[r]=Oe(o),null==t||t.updateCustomerData(e),n.notify()},removeContextProperty:r=>{delete e[r],null==t||t.updateCustomerData(e),n.notify()},clearContext:()=>{e={},null==t||t.resetCustomerData(),n.notify()},changeObservable:n};return r}const ar="_dd_c",cr=[];function ur(t,e,n,r){const o=function(t,e){return`${ar}_${t}_${e}`}(n,r);function i(){const t=localStorage.getItem(o);return null!==t?JSON.parse(t):{}}cr.push(Ke(t,window,"storage",(({key:t})=>{o===t&&e.setContext(i())}))),e.changeObservable.subscribe((function(){localStorage.setItem(o,JSON.stringify(e.getContext()))})),e.setContext(on(i(),e.getContext()))}function lr(t=2){const e=new Map;let n=!1;function r(r=0){if(n||0===t)return;const i=2===t?3072:16384;let c=r;e.forEach((t=>{c+=t.getBytesCount()})),c>i&&(!function(t){o.warn(`Customer data exceeds the recommended ${t/A}KiB threshold. ${a} ${s}/#customer-data-exceeds-the-recommended-threshold-warning`)}(i),n=!0)}return{createDetachedTracker:()=>{const t=dr((()=>r(t.getBytesCount())));return t},getOrCreateTracker:t=>(e.has(t)||e.set(t,dr(r)),e.get(t)),setCompressionStatus:e=>{0===t&&(t=e,r())},getCompressionStatus:()=>t,stop:()=>{e.forEach((t=>t.stop())),e.clear()}}}function dr(t){let e=0;const{throttled:n,cancel:r}=J((n=>{e=I(jt(n)),t()}),200),o=()=>{r(),e=0};return{updateCustomerData:t=>{L(t)?o():n(t)},resetCustomerData:o,getBytesCount:()=>e,stop:()=>{r()}}}function fr(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||at("datadog-synthetics-injects-rum"))}function pr(t){const e=ft(t);return"string"===e||"function"===e||t instanceof RegExp}function hr(t,e,n=!1){return t.some((t=>{try{if("function"==typeof t)return t(e);if(t instanceof RegExp)return t.test(e);if("string"==typeof t)return n?e.startsWith(t):t===e}catch(t){o.error(t)}return!1}))}function mr(t,e,n){function r(n){(function(t){return!e.wasInPageStateDuringPeriod("frozen",t.startClocks.relative,t.duration)})(n)&&t.notify(11,function(t){const e={date:t.startClocks.timeStamp,vital:{id:Y(),type:t.type,name:t.name,duration:v(t.duration),description:t.description},type:"vital",_dd:{vital:{computed_value:!0}}};return{rawRumEvent:e,startTime:t.startClocks.relative,customerContext:t.context,domainContext:{}}}(n))}return{addDurationVital:r,startDurationVital:(t,e={})=>gr(n,t,e),stopDurationVital:(t,e={})=>{vr(r,n,t,e)}}}function gr({vitalsByName:t,vitalsByReference:e},n,r={}){const o={name:n,startClocks:w(),context:r.context,description:r.description},i={__dd_vital_reference:!0};return t.set(n,o),e.set(i,o),i}function vr(t,{vitalsByName:e,vitalsByReference:n},r,o={}){const i="string"==typeof r?e.get(r):n.get(r);i&&(t(function(t,e,n,r){var o;return{name:t.name,type:"duration",startClocks:e,duration:k(e.timeStamp,r.timeStamp),context:on(t.context,n.context),description:null!==(o=n.description)&&void 0!==o?o:t.description}}(i,i.startClocks,o,w())),"string"==typeof r?e.delete(r):n.delete(r))}function yr(){return window.crypto||window.msCrypto}function _r(){return wr(63)}let br;function wr(t){return br||(br=fe(ue.CONSISTENT_TRACE_SAMPLING)&&function(){try{return crypto.getRandomValues(new BigUint64Array(1)),!0}catch(t){return!1}}()?Sr:kr),br(t)}function Sr(t){let e=crypto.getRandomValues(new BigUint64Array(1))[0];return 63===t&&(e>>=BigInt("1")),e}function kr(t){const e=yr().getRandomValues(new Uint32Array(2));return 63===t&&(e[e.length-1]>>>=1),{toString(t=10){let n=e[1],r=e[0],o="";do{const e=n%t*4294967296+r;n=Math.floor(n/t),r=Math.floor(e/t),o=(e%t).toString(t)+o}while(n||r);return o}}}function Cr(t){const e=t.toString(16);return Array(17-e.length).join("0")+e}function xr(t){0!==t.status||t.isAborted||(t.traceId=void 0,t.spanId=void 0,t.traceSampled=void 0)}function Tr(t,e,n,r){if(void 0===yr()||!n.findTrackedSession())return;const o=t.allowedTracingUrls.find((t=>hr([t.match],e.url,!0)));if(!o)return;const i=wr(64);e.traceSampled=function(t,e){if(100===e)return!0;if(0===e)return!1;if("bigint"!=typeof t)return u(e);const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000");return Number(t*n%r)<=e/100*Number(r)}(i,t.traceSampleRate);(e.traceSampled||t.traceContextInjection===ie.ALL)&&(e.traceId=i,e.spanId=_r(),r(function(t,e,n,r){const o={};return r.forEach((r=>{switch(r){case"datadog":Object.assign(o,{"x-datadog-origin":"rum","x-datadog-parent-id":e.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":t.toString()});break;case"tracecontext":Object.assign(o,{traceparent:`00-0000000000000000${Cr(t)}-${Cr(e)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break;case"b3":Object.assign(o,{b3:`${Cr(t)}-${Cr(e)}-${n?"1":"0"}`});break;case"b3multi":Object.assign(o,{"X-B3-TraceId":Cr(t),"X-B3-SpanId":Cr(e),"X-B3-Sampled":n?"1":"0"})}})),o}(e.traceId,e.spanId,e.traceSampled,o.propagatorTypes)))}const Er=["tracecontext","datadog"];function Ar(t){var e,n,r,i,s,a;if(!t.applicationId)return void o.error("Application ID is not configured, no RUM data will be collected.");if(!ae(t.sessionReplaySampleRate,"Session Replay")||!ae(t.traceSampleRate,"Trace"))return;if(void 0!==t.excludedActivityUrls&&!Array.isArray(t.excludedActivityUrls))return void o.error("Excluded Activity Urls should be an array");const c=function(t){if(void 0===t.allowedTracingUrls)return[];if(!Array.isArray(t.allowedTracingUrls))return void o.error("Allowed Tracing URLs should be an array");if(0!==t.allowedTracingUrls.length&&void 0===t.service)return void o.error("Service needs to be configured when tracing is enabled");const e=[];return t.allowedTracingUrls.forEach((t=>{pr(t)?e.push({match:t,propagatorTypes:Er}):!function(t){const e=t;return"object"===ft(e)&&pr(e.match)&&Array.isArray(e.propagatorTypes)}(t)?o.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",t):e.push(t)})),e}(t);if(!c)return;const u=ce(t);if(!u)return;const l=null!==(e=t.sessionReplaySampleRate)&&void 0!==e?e:0;return{applicationId:t.applicationId,version:t.version||void 0,actionNameAttribute:t.actionNameAttribute,sessionReplaySampleRate:l,startSessionReplayRecordingManually:void 0!==t.startSessionReplayRecordingManually?!!t.startSessionReplayRecordingManually:0===l,traceSampleRate:null!==(n=t.traceSampleRate)&&void 0!==n?n:100,rulePsr:d(t.traceSampleRate)?t.traceSampleRate/100:void 0,allowedTracingUrls:c,excludedActivityUrls:null!==(r=t.excludedActivityUrls)&&void 0!==r?r:[],workerUrl:t.workerUrl,compressIntakeRequests:!!t.compressIntakeRequests,trackUserInteractions:!(null!==(i=t.trackUserInteractions)&&void 0!==i&&!i),trackViewsManually:!!t.trackViewsManually,trackResources:!(null!==(s=t.trackResources)&&void 0!==s&&!s),trackLongTasks:!(null!==(a=t.trackLongTasks)&&void 0!==a&&!a),subdomain:t.subdomain,defaultPrivacyLevel:O(oe,t.defaultPrivacyLevel)?t.defaultPrivacyLevel:oe.MASK,enablePrivacyForActionName:!!t.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,traceContextInjection:O(ie,t.traceContextInjection)?t.traceContextInjection:ie.SAMPLED,plugins:t.plugins||[],...u}}function Rr(t){const e=new Set;return Array.isArray(t.allowedTracingUrls)&&t.allowedTracingUrls.length>0&&t.allowedTracingUrls.forEach((t=>{pr(t)?Er.forEach((t=>e.add(t))):"object"===ft(t)&&Array.isArray(t.propagatorTypes)&&t.propagatorTypes.forEach((t=>e.add(t)))})),Array.from(e)}const Ir="https://d3uc069fcn7uxw.cloudfront.net/configuration";function Nr(t,e){!function(t,e){const n=new XMLHttpRequest;Ke(t,n,"load",(function(){200===n.status?e(JSON.parse(n.responseText)):Or()})),Ke(t,n,"error",(function(){Or()})),n.open("GET",`${Ir}/${encodeURIComponent(t.remoteConfigurationId)}.json`),n.send()}(t,(n=>{e(function(t,e){return{...t,...e}}(t,n))}))}function Or(){o.error("Error fetching the remote configuration.")}function Lr({ignoreInitIfSyntheticsWillInjectRum:t,startDeflateWorker:e},n,r,i,s){const a=cn();let c,u,l,d;const f=r.observable.subscribe(p);function p(){if(!l||!d||!r.isGranted())return;let t;if(f.unsubscribe(),d.trackViewsManually){if(!c)return;a.remove(c.callback),t=c.options}const e=s(d,u,t);a.drain(e)}function h(t){const n=zn();if(n&&(t=function(t){var e,n;return{...t,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:null!==(e=t.defaultPrivacyLevel)&&void 0!==e?e:null===(n=Un())||void 0===n?void 0:n.getPrivacyLevel()}}(t)),l=t,function(t){mn({type:ln,configuration:t})}(function(t){var e;const n={session_sample_rate:(r=t).sessionSampleRate,telemetry_sample_rate:r.telemetrySampleRate,telemetry_configuration_sample_rate:r.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:r.telemetryUsageSampleRate,use_before_send:!!r.beforeSend,use_partitioned_cross_site_session_cookie:r.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:r.useSecureSessionCookie,use_proxy:!!r.proxy,silent_multiple_init:r.silentMultipleInit,track_session_across_subdomains:r.trackSessionAcrossSubdomains,track_anonymous_user:r.trackAnonymousUser,session_persistence:r.sessionPersistence,allow_fallback_to_local_storage:!!r.allowFallbackToLocalStorage,store_contexts_across_pages:!!r.storeContextsAcrossPages,allow_untrusted_events:!!r.allowUntrustedEvents,tracking_consent:r.trackingConsent};var r;return{session_replay_sample_rate:t.sessionReplaySampleRate,start_session_replay_recording_manually:t.startSessionReplayRecordingManually,trace_sample_rate:t.traceSampleRate,trace_context_injection:t.traceContextInjection,action_name_attribute:t.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(t.allowedTracingUrls)&&t.allowedTracingUrls.length>0,selected_tracing_propagators:Rr(t),default_privacy_level:t.defaultPrivacyLevel,enable_privacy_for_action_name:t.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(t.excludedActivityUrls)&&t.excludedActivityUrls.length>0,use_worker_url:!!t.workerUrl,compress_intake_requests:t.compressIntakeRequests,track_views_manually:t.trackViewsManually,track_user_interactions:t.trackUserInteractions,track_resources:t.trackResources,track_long_task:t.trackLongTasks,plugins:null===(e=t.plugins)||void 0===e?void 0:e.map((t=>{var e;return{name:t.name,...null===(e=t.getConfigurationTelemetry)||void 0===e?void 0:e.call(t)}})),...n}}(t)),d)return void We("DD_RUM",t);const i=Ar(t);i&&(n||i.sessionStoreStrategyType?i.compressIntakeRequests&&!n&&e&&(u=e(i,"Datadog RUM",X),!u)||(d=i,er().subscribe(X),r.tryToInit(i.trackingConsent),p()):o.warn("No storage available for session. We will not send any data."))}const m=t=>{a.add((e=>e.addDurationVital(t)))};return{init(e,n){e?(de(e.enableExperimentalFeatures),l=e,t&&fr()||(!function(t,e,n){if(t)for(const r of t){const t=r[e];t&&t(n)}}(e.plugins,"onInit",{initConfiguration:e,publicApi:n}),e.remoteConfigurationId&&fe(ue.REMOTE_CONFIGURATION)?Nr(e,h):h(e))):o.error("Missing configuration")},get initConfiguration(){return l},getInternalContext:X,stopSession:X,addTiming(t,e=_()){a.add((n=>n.addTiming(t,e)))},startView(t,e=w()){const n=n=>{n.startView(t,e)};a.add(n),c||(c={options:t,callback:n},p())},setViewName(t){a.add((e=>e.setViewName(t)))},setViewContext(t){a.add((e=>e.setViewContext(t)))},setViewContextProperty(t,e){a.add((n=>n.setViewContextProperty(t,e)))},addAction(t,e=n()){a.add((n=>n.addAction(t,e)))},addError(t,e=n()){a.add((n=>n.addError(t,e)))},addFeatureFlagEvaluation(t,e){a.add((n=>n.addFeatureFlagEvaluation(t,e)))},startDurationVital:(t,e)=>gr(i,t,e),stopDurationVital(t,e){vr(m,i,t,e)},addDurationVital:m}}function Mr(){let t;const e=window;if(e.Zone&&(t=D(e,"MutationObserver"),e.MutationObserver&&t===e.MutationObserver)){const n=D(new e.MutationObserver(X),"originalInstance");t=n&&n.constructor}return t||(t=e.MutationObserver),t}function Dr(){const t=function(){const t=window._DATADOG_SYNTHETICS_PUBLIC_ID||at("datadog-synthetics-public-id");return"string"==typeof t?t:void 0}(),e=function(){const t=window._DATADOG_SYNTHETICS_RESULT_ID||at("datadog-synthetics-result-id");return"string"==typeof t?t:void 0}();if(t&&e)return{test_id:t,result_id:e,injected:fr()}}function Pr(t,e,n){const r=rn(t),o=n(r);return dt(e).forEach((([e,n])=>{const o=function(t,e){let n=t;for(const t of e.split(".")){if(!zr(n,t))return;n=n[t]}return n}(r,e),i=ft(o);i===n?Ur(t,e,Oe(o)):"object"!==n||"undefined"!==i&&"null"!==i||Ur(t,e,{})})),o}function Ur(t,e,n){let r=t;const o=e.split(".");for(let t=0;t<o.length;t+=1){const e=o[t];if(!$r(r))return;t!==o.length-1?r=r[e]:r[e]=n}}function $r(t){return"object"===ft(t)}function zr(t,e){return $r(t)&&Object.prototype.hasOwnProperty.call(t,e)}const Br={"view.name":"string","view.url":"string","view.referrer":"string"},Vr={context:"object"},Fr={service:"string",version:"string"};let jr;function qr(t,e,n,r,i,s,a,c,u,d){jr={view:{...Vr,...Br},error:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...Vr,...Br,...Fr},resource:{"resource.url":"string",...fe(ue.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...Vr,...Br,...Fr},action:{"action.target.name":"string",...Vr,...Br,...Fr},long_task:{...Vr,...Br},vital:{...Vr,...Br}};const f={error:Gn("error",t.eventRateLimiterThreshold,d),action:Gn("action",t.eventRateLimiterThreshold,d),vital:Gn("vital",t.eventRateLimiterThreshold,d)},p=Dr();e.subscribe(11,(({startTime:d,rawRumEvent:h,domainContext:m,savedCommonContext:g,customerContext:v})=>{const b=r.findView(d),w=i.findUrl(d),S=n.findTrackedSession(d);if(S&&b&&w){const n=g||u(),r=s.findActionId(d),i=on({_dd:{format_version:2,drift:Math.round(y()-C(E(),performance.now())),configuration:{session_sample_rate:l(t.sessionSampleRate,3),session_replay_sample_rate:l(t.sessionReplaySampleRate,3)},browser_sdk_version:zn()?"6.0.0":void 0},application:{id:t.applicationId},date:_(),service:b.service||t.service,version:b.version||t.version,source:"browser",session:{id:S.id,type:p?"synthetics":c.get()?"ci_test":"user"},view:{id:b.id,name:b.name,url:w.url,referrer:w.referrer},action:(k=h,-1!==["error","resource","long_task"].indexOf(k.type)&&r?{id:r}:void 0),synthetics:p,ci_test:c.get(),display:a.get(),connectivity:sn()},h);i.context=on(n.context,b.context,v),"has_replay"in i.session||(i.session.has_replay=n.hasReplay),"view"===i.type&&(i.session.sampled_for_replay=1===S.sessionReplay),S.anonymousId&&!n.user.anonymous_id&&t.trackAnonymousUser&&(n.user.anonymous_id=S.anonymousId),L(n.user)||(i.usr=n.user),function(t,e,n,r){var i;if(e){const r=Pr(t,jr[t.type],(t=>e(t,n)));if(!1===r&&"view"!==t.type)return!1;!1===r&&o.warn("Can't dismiss view events using beforeSend!")}const s=null===(i=r[t.type])||void 0===i?void 0:i.isLimitReached();return!s}(i,t.beforeSend,m,f)&&(L(i.context)&&delete i.context,e.notify(12,i))}var k}))}const Hr=class{constructor(){this.callbacks={}}notify(t,e){const n=this.callbacks[t];n&&n.forEach((t=>t(e)))}subscribe(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter((t=>e!==t))}}}},Gr=ht;const Wr="initial_document",Kr=[["document",t=>Wr===t],["xhr",t=>"xmlhttprequest"===t],["fetch",t=>"fetch"===t],["beacon",t=>"beacon"===t],["css",(t,e)=>/\.css$/i.test(e)],["js",(t,e)=>/\.js$/i.test(e)],["image",(t,e)=>["image","img","icon"].includes(t)||null!==/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(e)],["font",(t,e)=>null!==/\.(woff|eot|woff2|ttf)$/i.exec(e)],["media",(t,e)=>["audio","video"].includes(t)||null!==/\.(mp3|mp4)$/i.exec(e)]];function Jr(t){const e=t.name;if(!function(t){try{return!!Gt(t)}catch(t){return!1}}(e))return vn(`Failed to construct URL for "${t.name}"`),"other";const n=function(t){const e=Gt(t).pathname;return"/"===e[0]?e:`/${e}`}(e);for(const[e,r]of Kr)if(r(t.initiatorType,n))return e;return"other"}function Xr(...t){for(let e=1;e<t.length;e+=1)if(t[e-1]>t[e])return!1;return!0}function Yr(t){return"xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType}function Zr(t){const{duration:e,startTime:n,responseEnd:r}=t;return v(0===e&&n<r?k(n,r):e)}function Qr(t){if(!eo(t))return;const{startTime:e,fetchStart:n,workerStart:r,redirectStart:o,redirectEnd:i,domainLookupStart:s,domainLookupEnd:a,connectStart:c,secureConnectionStart:u,connectEnd:l,requestStart:d,responseStart:f,responseEnd:p}=t,h={download:no(e,f,p),first_byte:no(e,d,f)};return 0<r&&r<n&&(h.worker=no(e,r,n)),n<l&&(h.connect=no(e,c,l),c<=u&&u<=l&&(h.ssl=no(e,u,l))),n<a&&(h.dns=no(e,s,a)),e<i&&(h.redirect=no(e,o,i)),h}function to(t){return t.duration>=0}function eo(t){const e=Xr(t.startTime,t.fetchStart,t.domainLookupStart,t.domainLookupEnd,t.connectStart,t.connectEnd,t.requestStart,t.responseStart,t.responseEnd),n=!function(t){return t.redirectEnd>t.startTime}(t)||Xr(t.startTime,t.redirectStart,t.redirectEnd,t.fetchStart);return e&&n}function no(t,e,n){if(t<=e&&e<=n)return{duration:v(k(e,n)),start:v(k(t,e))}}function ro(t){return""===t.nextHopProtocol?void 0:t.nextHopProtocol}function oo(t){return""===t.deliveryType?"other":t.deliveryType}function io(t){if(t.startTime<t.responseStart){const{encodedBodySize:e,decodedBodySize:n,transferSize:r}=t;return{size:n,encoded_body_size:e,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function so(t){return t&&!function(t){return te.every((e=>t.includes(e)))}(t)}const ao=/data:(.+)?(;base64)?,/g;function co(t){return!(t.length<=24e3)&&("data:"===t.substring(0,5)&&(t=t.substring(0,24e3),!0))}function uo(t){return`${t.match(ao)[0]}[...]`}let lo=1;function fo(t,e,n){const r=function(t,e){return{clearTracingIfNeeded:xr,traceFetch:n=>Tr(t,n,e,(t=>{var e;if(n.input instanceof Request&&!(null===(e=n.init)||void 0===e?void 0:e.headers))n.input=new Request(n.input),Object.keys(t).forEach((e=>{n.input.headers.append(e,t[e])}));else{n.init=N(n.init);const e=[];n.init.headers instanceof Headers?n.init.headers.forEach(((t,n)=>{e.push([n,t])})):Array.isArray(n.init.headers)?n.init.headers.forEach((t=>{e.push(t)})):n.init.headers&&Object.keys(n.init.headers).forEach((t=>{e.push([t,n.init.headers[t]])})),n.init.headers=e.concat(dt(t))}})),traceXhr:(n,r)=>Tr(t,n,e,(t=>{Object.keys(t).forEach((e=>{r.setRequestHeader(e,t[e])}))}))}}(e,n);!function(t,e,n){const r=Yn(e).subscribe((e=>{const r=e;if(so(r.url))switch(r.state){case"start":n.traceXhr(r,r.xhr),r.requestIndex=po(),t.notify(6,{requestIndex:r.requestIndex,url:r.url});break;case"complete":n.clearTracingIfNeeded(r),t.notify(7,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,traceSampled:r.traceSampled,type:"xhr",url:r.url,xhr:r.xhr,isAborted:r.isAborted,handlingStack:r.handlingStack})}}))}(t,e,r),function(t,e){const n=er().subscribe((n=>{const r=n;if(so(r.url))switch(r.state){case"start":e.traceFetch(r),r.requestIndex=po(),t.notify(6,{requestIndex:r.requestIndex,url:r.url});break;case"resolve":!function(t,e){const n=t.response&&function(t){try{return t.clone()}catch(t){return}}(t.response);n&&n.body?function(t,e,n){const r=t.getReader();let o=0;function i(){r.cancel().catch(X),e(void 0,void 0,void 0)}!function t(){r.read().then(z((e=>{e.done?i():(o+=e.value.length,o>n.bytesLimit?i():t())})),z((t=>e(t))))}()}(n.body,(()=>{e(k(t.startClocks.timeStamp,_()))}),{bytesLimit:Number.POSITIVE_INFINITY,collectStreamBody:!1}):e(k(t.startClocks.timeStamp,_()))}(r,(n=>{e.clearTracingIfNeeded(r),t.notify(7,{duration:n,method:r.method,requestIndex:r.requestIndex,responseType:r.responseType,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,traceSampled:r.traceSampled,type:"fetch",url:r.url,response:r.response,init:r.init,input:r.input,isAborted:r.isAborted,handlingStack:r.handlingStack})}))}}))}(t,r)}function po(){const t=lo;return lo+=1,t}function ho(t){return d(t)&&t<0?void 0:t}function mo({lifeCycle:t,isChildEvent:e,onChange:n=X}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},o=t.subscribe(12,(t=>{var o;if("view"!==t.type&&"vital"!==t.type&&e(t))switch(t.type){case"error":r.errorCount+=1,n();break;case"action":r.actionCount+=1,t.action.frustration&&(r.frustrationCount+=t.action.frustration.type.length),n();break;case"long_task":r.longTaskCount+=1,n();break;case"resource":(null===(o=t._dd)||void 0===o?void 0:o.discarded)||(r.resourceCount+=1,n())}}));return{stop:()=>{o.unsubscribe()},eventCounts:r}}function go(t,e){const n=y();let r=!1;const{stop:o}=Je(t,window,["click","mousedown","keydown","touchstart","pointerdown"],(e=>{if(!e.cancelable)return;const n={entryType:"first-input",processingStart:b(),processingEnd:b(),startTime:e.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};"pointerdown"===e.type?function(t,e){Je(t,window,["pointerup","pointercancel"],(t=>{"pointerup"===t.type&&i(e)}),{once:!0})}(t,n):i(n)}),{passive:!0,capture:!0});return{stop:o};function i(t){if(!r){r=!0,o();const i=t.processingStart-t.startTime;i>=0&&i<y()-n&&e(t)}}}var vo;function yo(t,e){return new W((n=>{if(!window.PerformanceObserver)return;const r=t=>{const e=function(t){return t.filter((t=>!function(t){return!(t.entryType!==vo.RESOURCE||so(t.name)&&to(t))}(t)))}(t);e.length>0&&n.notify(e)};let o,i=!0;const s=new PerformanceObserver(z((t=>{i?o=j((()=>r(t.getEntries()))):r(t.getEntries())})));try{s.observe(e)}catch(t){if([vo.RESOURCE,vo.NAVIGATION,vo.LONG_TASK,vo.PAINT].includes(e.type)){e.buffered&&(o=j((()=>r(performance.getEntriesByType(e.type)))));try{s.observe({entryTypes:[e.type]})}catch(t){return}}}let a;return i=!1,function(t){!_o&&void 0!==window.performance&&"getEntries"in performance&&"addEventListener"in performance&&(_o=Ke(t,performance,"resourcetimingbufferfull",(()=>{performance.clearResourceTimings()})))}(t),bo(vo.FIRST_INPUT)||e.type!==vo.FIRST_INPUT||({stop:a}=go(t,(t=>{r([t])}))),()=>{s.disconnect(),a&&a(),q(o)}}))}let _o;function bo(t){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes(t)}!function(t){t.EVENT="event",t.FIRST_INPUT="first-input",t.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",t.LAYOUT_SHIFT="layout-shift",t.LONG_TASK="longtask",t.LONG_ANIMATION_FRAME="long-animation-frame",t.NAVIGATION="navigation",t.PAINT="paint",t.RESOURCE="resource"}(vo||(vo={}));const wo=100;function So(t,e,n,r,o,i){const s=function(t,e,n,r){return new W((o=>{const i=[];let s,a=0;return i.push(e.subscribe(c),n.subscribe(c),yo(r,{type:vo.RESOURCE}).subscribe((t=>{t.some((t=>!ko(r,t.name)))&&c()})),t.subscribe(6,(t=>{ko(r,t.url)||(void 0===s&&(s=t.requestIndex),a+=1,c())})),t.subscribe(7,(t=>{ko(r,t.url)||void 0===s||t.requestIndex<s||(a-=1,c())}))),()=>{i.forEach((t=>t.unsubscribe()))};function c(){o.notify({isBusy:a>0})}}))}(t,e,n,r);return function(t,e,n){let r,o=!1;const i=j(z((()=>u({hadActivity:!1}))),100),s=void 0!==n?j(z((()=>u({hadActivity:!0,end:_()}))),n):void 0,a=t.subscribe((({isBusy:t})=>{q(i),q(r);const e=_();t||(r=j(z((()=>u({hadActivity:!0,end:e}))),100))})),c=()=>{o=!0,q(i),q(r),q(s),a.unsubscribe()};function u(t){o||(c(),e(t))}return{stop:c}}(s,o,i)}function ko(t,e){return hr(t.excludedActivityUrls,e)}function Co(t){return t.nodeType===Node.TEXT_NODE}function xo(t){return t.nodeType===Node.ELEMENT_NODE}function To(t){return xo(t)&&Boolean(t.shadowRoot)}function Eo(t){const e=t;return!!e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&xo(e.host)}function Ao(t,e){let n=t.firstChild;for(;n;)e(n),n=n.nextSibling;To(t)&&e(t.shadowRoot)}function Ro(t){return Eo(t)?t.host:t.parentNode}const Io={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:oe.ALLOW,MASK:oe.MASK,MASK_USER_INPUT:oe.MASK_USER_INPUT},No="data-dd-privacy",Oo="hidden",Lo="***",Mo="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",Do={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0};function Po(t,e,n){if(n&&n.has(t))return n.get(t);const r=Ro(t),o=r?Po(r,e,n):e,i=Uo($o(t),o);return n&&n.set(t,i),i}function Uo(t,e){switch(e){case Io.HIDDEN:case Io.IGNORE:return e}switch(t){case Io.ALLOW:case Io.MASK:case Io.MASK_USER_INPUT:case Io.HIDDEN:case Io.IGNORE:return t;default:return e}}function $o(t){if(xo(t)){if("BASE"===t.tagName)return Io.ALLOW;if("INPUT"===t.tagName){const e=t;if("password"===e.type||"email"===e.type||"tel"===e.type)return Io.MASK;if("hidden"===e.type)return Io.MASK;const n=e.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return Io.MASK}return t.matches(Fo(Io.HIDDEN))?Io.HIDDEN:t.matches(Fo(Io.MASK))?Io.MASK:t.matches(Fo(Io.MASK_USER_INPUT))?Io.MASK_USER_INPUT:t.matches(Fo(Io.ALLOW))?Io.ALLOW:function(t){if("SCRIPT"===t.nodeName)return!0;if("LINK"===t.nodeName){const t=e("rel");return/preload|prefetch/i.test(t)&&"script"===e("as")||"shortcut icon"===t||"icon"===t}if("META"===t.nodeName){const n=e("name"),r=e("rel"),o=e("property");return/^msapplication-tile(image|color)$/.test(n)||"application-name"===n||"icon"===r||"apple-touch-icon"===r||"shortcut icon"===r||"keywords"===n||"description"===n||/^(og|twitter|fb):/.test(o)||/^(og|twitter):/.test(n)||"pinterest"===n||"robots"===n||"googlebot"===n||"bingbot"===n||t.hasAttribute("http-equiv")||"author"===n||"generator"===n||"framework"===n||"publisher"===n||"progid"===n||/^article:/.test(o)||/^product:/.test(o)||"google-site-verification"===n||"yandex-verification"===n||"csrf-token"===n||"p:domain_verify"===n||"verify-v1"===n||"verification"===n||"shopify-checkout-api-token"===n}function e(e){return(t.getAttribute(e)||"").toLowerCase()}return!1}(t)?Io.IGNORE:void 0}}function zo(t,e){switch(e){case Io.MASK:case Io.HIDDEN:case Io.IGNORE:return!0;case Io.MASK_USER_INPUT:return Co(t)?Bo(t.parentNode):Bo(t);default:return!1}}function Bo(t){if(!t||t.nodeType!==t.ELEMENT_NODE)return!1;const e=t;if("INPUT"===e.tagName)switch(e.type){case"button":case"color":case"reset":case"submit":return!1}return!!Do[e.tagName]}function Vo(t,e,n){var r;const o=null===(r=t.parentElement)||void 0===r?void 0:r.tagName;let i=t.textContent||"";if(e&&!i.trim())return;if("SCRIPT"===o)i=Lo;else if(n===Io.HIDDEN)i=Lo;else if(zo(t,n))if("DATALIST"===o||"SELECT"===o||"OPTGROUP"===o){if(!i.trim())return}else i="OPTION"===o?Lo:i.replace(/\S/g,"x");return i}function Fo(t){return`[${No}="${t}"], .dd-privacy-${t}`}const jo="data-dd-action-name";function qo(t,e){const n=t.closest(`[${e}]`);if(!n)return;return Xo(Jo(n.getAttribute(e).trim()))}const Ho=[(t,e)=>{if("labels"in t&&t.labels&&t.labels.length>0)return Zo(t.labels[0],e)},t=>{if("INPUT"===t.nodeName){const e=t,n=e.getAttribute("type");if("button"===n||"submit"===n||"reset"===n)return{name:e.value,nameSource:"text_content"}}},(t,e,n)=>{if("BUTTON"===t.nodeName||"LABEL"===t.nodeName||"button"===t.getAttribute("role"))return Zo(t,e,n)},t=>Yo(t,"aria-label"),(t,e,n)=>{const r=t.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map((e=>function(t,e){return t.ownerDocument?t.ownerDocument.getElementById(e):null}(t,e))).filter((t=>Boolean(t))).map((t=>Qo(t,e,n))).join(" "),nameSource:"text_content"}},t=>Yo(t,"alt"),t=>Yo(t,"name"),t=>Yo(t,"title"),t=>Yo(t,"placeholder"),(t,e)=>{if("options"in t&&t.options.length>0)return Zo(t.options[0],e)}],Go=[(t,e,n)=>Zo(t,e,n)],Wo=10;function Ko(t,e,n,r){let o=t,i=0;for(;i<=Wo&&o&&"BODY"!==o.nodeName&&"HTML"!==o.nodeName&&"HEAD"!==o.nodeName;){for(const t of n){const n=t(o,e,r);if(n){const{name:t,nameSource:e}=n,r=t&&t.trim();if(r)return{name:Xo(Jo(r)),nameSource:e}}}if("FORM"===o.nodeName)break;o=o.parentElement,i+=1}}function Jo(t){return t.replace(/\s+/g," ")}function Xo(t){return t.length>100?`${tt(t,100)} [...]`:t}function Yo(t,e){return{name:t.getAttribute(e)||"",nameSource:"standard_attribute"}}function Zo(t,e,n){return{name:Qo(t,e,n)||"",nameSource:"text_content"}}function Qo(t,e,n){if(!t.isContentEditable){if("innerText"in t){let r=t.innerText;const o=e=>{const n=t.querySelectorAll(e);for(let t=0;t<n.length;t+=1){const e=n[t];if("innerText"in e){const t=e.innerText;t&&t.trim().length>0&&(r=r.replace(t,""))}}};return o(`[${jo}]`),e&&o(`[${e}]`),n&&o(`${Fo(Io.HIDDEN)}, ${Fo(Io.MASK)}`),r}return t.textContent}}const ti=[jo,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],ei=[ii,function(t){if(t.id&&!oi(t.id))return`#${CSS.escape(t.id)}`}],ni=[ii,function(t){if("BODY"===t.tagName)return;const e=t.classList;for(let n=0;n<e.length;n+=1){const r=e[n];if(!oi(r))return`${CSS.escape(t.tagName)}.${CSS.escape(r)}`}},function(t){return CSS.escape(t.tagName)}];function ri(t,e){if(!function(t){if("isConnected"in t)return t.isConnected;return t.ownerDocument.documentElement.contains(t)}(t))return;let n,r=t;for(;r&&"HTML"!==r.nodeName;){const t=ai(r,ei,ci,e,n);if(t)return t;n=ai(r,ni,ui,e,n)||li(si(r),n),r=r.parentElement}return n}function oi(t){return/[0-9]/.test(t)}function ii(t,e){if(e){const t=n(e);if(t)return t}for(const t of ti){const e=n(t);if(e)return e}function n(e){if(t.hasAttribute(e))return`${CSS.escape(t.tagName)}[${e}="${CSS.escape(t.getAttribute(e))}"]`}}function si(t){let e=t.parentElement.firstElementChild,n=1;for(;e&&e!==t;)e.tagName===t.tagName&&(n+=1),e=e.nextElementSibling;return`${CSS.escape(t.tagName)}:nth-of-type(${n})`}function ai(t,e,n,r,o){for(const i of e){const e=i(t,r);if(e&&n(t,e,o))return li(e,o)}}function ci(t,e,n){return 1===t.ownerDocument.querySelectorAll(li(e,n)).length}function ui(t,e,n){let r;if(void 0===n)r=t=>t.matches(e);else{const t=function(){if(void 0===di)try{document.querySelector(":scope"),di=!0}catch(t){di=!1}return di}()?li(`${e}:scope`,n):li(e,n);r=e=>null!==e.querySelector(t)}let o=t.parentElement.firstElementChild;for(;o;){if(o!==t&&r(o))return!1;o=o.nextElementSibling}return!0}function li(t,e){return e?`${t}>${e}`:t}let di;const fi=f;function pi(t,e){const n=[];let r,o=0;function i(t){t.stopObservable.subscribe(s),n.push(t),q(r),r=j(a,fi)}function s(){1===o&&n.every((t=>t.isStopped()))&&(o=2,e(n))}function a(){q(r),0===o&&(o=1,s())}return i(t),{tryAppend:t=>{return 0===o&&(n.length>0&&(e=n[n.length-1].event,r=t.event,!(e.target===r.target&&(s=e,c=r,Math.sqrt(Math.pow(s.clientX-c.clientX,2)+Math.pow(s.clientY-c.clientY,2))<=100)&&e.timeStamp-r.timeStamp<=fi))?(a(),!1):(i(t),!0));var e,r,s,c},stop:()=>{a()}}}function hi(){const t=window.getSelection();return!t||t.isCollapsed}function mi(t){return t.target instanceof Element&&!1!==t.isPrimary}function gi(t,e){if(function(t){if(t.some((t=>t.getUserActivity().selection||t.getUserActivity().scroll)))return!1;for(let e=0;e<t.length-2;e+=1)if(t[e+3-1].event.timeStamp-t[e].event.timeStamp<=f)return!0;return!1}(t))return e.addFrustration("rage_click"),t.some(yi)&&e.addFrustration("dead_click"),e.hasError&&e.addFrustration("error_click"),{isRage:!0};const n=t.some((t=>t.getUserActivity().selection));return t.forEach((t=>{t.hasError&&t.addFrustration("error_click"),yi(t)&&!n&&t.addFrustration("dead_click")})),{isRage:!1}}const vi='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function yi(t){return!(t.hasPageActivity||t.getUserActivity().input||t.getUserActivity().scroll)&&!t.event.target.matches(vi)}const _i=1e4,bi=new Map;function wi(t,e){bi.set(t,e),bi.forEach(((t,e)=>{k(e,b())>1e4&&bi.delete(e)}))}function Si(t,e,n,r){const o=kn({expireDelay:3e5}),i=new W;let s;t.subscribe(9,(()=>{o.reset()})),t.subscribe(4,u);const{stop:a}=function(t,{onPointerDown:e,onPointerUp:n}){let r,o,i={selection:!1,input:!1,scroll:!1};const s=[Ke(t,window,"pointerdown",(t=>{mi(t)&&(r=hi(),i={selection:!1,input:!1,scroll:!1},o=e(t))}),{capture:!0}),Ke(t,window,"selectionchange",(()=>{r&&hi()||(i.selection=!0)}),{capture:!0}),Ke(t,window,"scroll",(()=>{i.scroll=!0}),{capture:!0,passive:!0}),Ke(t,window,"pointerup",(t=>{if(mi(t)&&o){const e=i;n(o,t,(()=>e)),o=void 0}}),{capture:!0}),Ke(t,window,"input",(()=>{i.input=!0}),{capture:!0})];return{stop:()=>{s.forEach((t=>t.stop()))}}}(r,{onPointerDown:o=>function(t,e,n,r,o){const i=t.enablePrivacyForActionName?Po(r.target,t.defaultPrivacyLevel):Io.ALLOW;if(i===Io.HIDDEN)return;const s=function(t,e,n){const r=t.target.getBoundingClientRect(),o=ri(t.target,n.actionNameAttribute);o&&wi(t.timeStamp,o);const i=function(t,{enablePrivacyForActionName:e,actionNameAttribute:n},r){const o=qo(t,jo)||n&&qo(t,n);return o?{name:o,nameSource:"custom_attribute"}:r===Io.MASK?{name:"Masked Element",nameSource:"mask_placeholder"}:Ko(t,n,Ho,e)||Ko(t,n,Go,e)||{name:"",nameSource:"blank"}}(t.target,n,e);return{type:"click",target:{width:Math.round(r.width),height:Math.round(r.height),selector:o},position:{x:Math.round(t.clientX-r.left),y:Math.round(t.clientY-r.top)},name:i.name,nameSource:i.nameSource}}(r,i,t);let a=!1;return So(e,n,o,t,(t=>{a=t.hadActivity}),wo),{clickActionBase:s,hadActivityOnPointerDown:()=>a}}(r,t,e,o,n),onPointerUp:({clickActionBase:s,hadActivityOnPointerDown:a},u,l)=>{!function(t,e,n,r,o,i,s,a,c,u,l){var d;const f=ki(e,o,u,a,c);s(f);const p=null===(d=null==a?void 0:a.target)||void 0===d?void 0:d.selector;p&&wi(c.timeStamp,p);const{stop:h}=So(e,n,r,t,(t=>{t.hadActivity&&t.end<f.startClocks.timeStamp?f.discard():t.hadActivity?f.stop(t.end):l()?f.stop(f.startClocks.timeStamp):f.stop()}),_i),m=e.subscribe(4,(({endClocks:t})=>{f.stop(t.timeStamp)})),g=i.subscribe((()=>{f.stop()}));f.stopObservable.subscribe((()=>{m.unsubscribe(),h(),g.unsubscribe()}))}(r,t,e,n,o,i,c,s,u,l,a)}});return{stop:()=>{u(),i.notify(),a()},actionContexts:{findActionId:t=>o.findAll(t)}};function c(t){if(!s||!s.tryAppend(t)){const e=t.clone();s=pi(t,(t=>{!function(t,e){const{isRage:n}=gi(t,e);n?(t.forEach((t=>t.discard())),e.stop(_()),e.validate(t.map((t=>t.event)))):(e.discard(),t.forEach((t=>t.validate())))}(t,e)}))}}function u(){s&&s.stop()}}function ki(t,e,n,r,o){const i=Y(),s=w(),a=e.add(i,s.relative),c=mo({lifeCycle:t,isChildEvent:t=>void 0!==t.action&&(Array.isArray(t.action.id)?t.action.id.includes(i):t.action.id===i)});let u,l=0;const d=[],f=new W;function p(t){0===l&&(u=t,l=1,u?a.close(x(u)):a.remove(),c.stop(),f.notify())}return{event:o,stop:p,stopObservable:f,get hasError(){return c.eventCounts.errorCount>0},get hasPageActivity(){return void 0!==u},getUserActivity:n,addFrustration:t=>{d.push(t)},startClocks:s,isStopped:()=>1===l||2===l,clone:()=>ki(t,e,n,r,o),validate:e=>{if(p(),1!==l)return;const{resourceCount:n,errorCount:a,longTaskCount:f}=c.eventCounts,h={duration:u&&k(s.timeStamp,u),startClocks:s,id:i,frustrationTypes:d,counts:{resourceCount:n,errorCount:a,longTaskCount:f},events:null!=e?e:[o],event:o,...r};t.notify(0,h),l=2},discard:()=>{p(),l=2}}}function Ci(t,e){const n=xi(t)?{action:{id:t.id,loading_time:ho(v(t.duration)),frustration:{type:t.frustrationTypes},error:{count:t.counts.errorCount},long_task:{count:t.counts.longTaskCount},resource:{count:t.counts.resourceCount}},_dd:{action:{target:t.target,position:t.position,name_source:fe(ue.ACTION_NAME_MASKING)?t.nameSource:void 0}}}:void 0,r=xi(t)?void 0:t.context,o=on({action:{id:Y(),target:{name:t.name},type:t.type},date:t.startClocks.timeStamp,type:"action",view:{in_foreground:e.wasInPageStateAt("active",t.startClocks.relative)}},n),i=xi(t)?{events:t.events}:{};return!xi(t)&&t.handlingStack&&(i.handlingStack=t.handlingStack),{customerContext:r,rawRumEvent:o,startTime:t.startClocks.relative,domainContext:i}}function xi(t){return"custom"!==t.type}function Ti(e,n,r,o){const i=new W;return function(e){const n=ir([t.error]).subscribe((t=>e.notify(t.error)))}(i),Ge(i),function(t,e){const n=Ze(t,[Ye,Xe]).subscribe((t=>e.notify(t)))}(n,i),i.subscribe((t=>e.notify(13,{error:t}))),function(t,e,n){return t.subscribe(13,(({error:r,customerContext:o,savedCommonContext:i})=>{t.notify(11,{customerContext:o,savedCommonContext:i,...Ei(r,e,n)})})),{addError:({error:e,handlingStack:n,startClocks:r,context:o},i)=>{const s=Ue({stackTrace:ze(e)?me(e):void 0,originalError:e,handlingStack:n,startClocks:r,nonErrorPrefix:"Provided",source:je,handling:"handled"});t.notify(13,{customerContext:o,savedCommonContext:i,error:s})}}}(e,r,o)}function Ei(t,e,n){const r={date:t.startClocks.timeStamp,error:{id:Y(),message:t.message,source:t.source,stack:t.stack,handling_stack:t.handlingStack,type:t.type,handling:t.handling,causes:t.causes,source_type:"browser",fingerprint:t.fingerprint,csp:t.csp},type:"error",view:{in_foreground:e.wasInPageStateAt("active",t.startClocks.relative)}},o=n.findFeatureFlagEvaluations(t.startClocks.relative);o&&!L(o)&&(r.feature_flags=o);const i={error:t.originalError,handlingStack:t.handlingStack};return{rawRumEvent:r,startTime:t.startClocks.relative,domainContext:i}}const Ai=new WeakSet;function Ri(t){if(!performance||!("getEntriesByName"in performance))return;const e=performance.getEntriesByName(t.url,"resource");if(!e.length||!("toJSON"in e[0]))return;const n=e.filter((t=>!Ai.has(t))).filter((t=>to(t)&&eo(t))).filter((e=>function(t,e,n){const r=1;return t.startTime>=e-r&&Ii(t)<=C(n,r)}(e,t.startClocks.relative,Ii({startTime:t.startClocks.relative,duration:t.duration}))));return 1===n.length?(Ai.add(n[0]),n[0].toJSON()):void 0}function Ii(t){return C(t.startTime,t.duration)}function Ni(t){const e=function(t){const e=t.querySelector("meta[name=dd-trace-id]"),n=t.querySelector("meta[name=dd-trace-time]");return Oi(e&&e.content,n&&n.content)}(t)||function(t){const e=function(t){for(let e=0;e<t.childNodes.length;e+=1){const n=Li(t.childNodes[e]);if(n)return n}if(t.body)for(let e=t.body.childNodes.length-1;e>=0;e-=1){const n=t.body.childNodes[e],r=Li(n);if(r)return r;if(!Co(n))break}}(t);if(!e)return;return Oi(Q(e,"trace-id"),Q(e,"trace-time"))}(t);if(e&&!(e.traceTime<=y()-12e4))return e.traceId}function Oi(t,e){const n=e&&Number(e);if(t&&n)return{traceId:t,traceTime:n}}function Li(t){if(t&&function(t){return t.nodeType===Node.COMMENT_NODE}(t)){const e=/^\s*DATADOG;(.*?)\s*$/.exec(t.data);if(e)return e[1]}}function Mi(){if(bo(vo.NAVIGATION)){const t=performance.getEntriesByType(vo.NAVIGATION)[0];if(t)return t}const t=function(){const t={},e=performance.timing;for(const n in e)if(d(e[n])){const r=n,o=e[r];t[r]=0===o?0:x(o)}return t}(),e={entryType:vo.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:t.responseEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...e,toJSON:void 0}),...t};return e}function Di(t,e){Wn(t,"interactive",(()=>{const t=Object.assign(Mi().toJSON(),{entryType:vo.RESOURCE,initiatorType:Wr,traceId:Ni(document),toJSON:()=>({...t,toJSON:void 0})});e(t)}))}function Pi(t,e,n,r=function(){const t=[];function e(e){let r;if(e.didTimeout){const t=performance.now();r=()=>30-(performance.now()-t)}else r=e.timeRemaining.bind(e);for(;r()>0&&t.length;)t.shift()();t.length&&n()}function n(){nr(e,{timeout:1e3})}return{push(e){1===t.push(e)&&n()}}}(),o=Di){t.subscribe(7,(t=>{s((()=>function(t,e,n){const r=Ri(t),o=r?m(r.startTime):t.startClocks,i=function(t,e){const n=t.traceSampled&&t.traceId&&t.spanId;if(!n)return;return{_dd:{span_id:t.spanId.toString(),trace_id:t.traceId.toString(),rule_psr:e.rulePsr}}}(t,e);if(!e.trackResources&&!i)return;const s="xhr"===t.type?"xhr":"fetch",a=r?$i(r):void 0,c=function(t,e,n){return t.wasInPageStateDuringPeriod("frozen",e.relative,n)?void 0:v(n)}(n,o,t.duration),u=on({date:o.timeStamp,resource:{id:Y(),type:s,duration:c,method:t.method,status_code:t.status,protocol:r&&ro(r),url:co(t.url)?uo(t.url):t.url,delivery_type:r&&oo(r)},type:"resource",_dd:{discarded:!e.trackResources}},i,a);return{startTime:o.relative,rawRumEvent:u,domainContext:{performanceEntry:r,xhr:t.xhr,response:t.response,requestInput:t.input,requestInit:t.init,error:t.error,isAborted:t.isAborted,handlingStack:t.handlingStack}}}(t,e,n)))}));const i=yo(e,{type:vo.RESOURCE,buffered:!0}).subscribe((t=>{for(const n of t)Yr(n)||s((()=>Ui(n,e)))}));function s(e){r.push((()=>{const n=e();n&&t.notify(11,n)}))}return o(e,(t=>{s((()=>Ui(t,e)))})),{stop:()=>{i.unsubscribe()}}}function Ui(t,e){const n=m(t.startTime),r=function(t,e){const n=t.traceId;if(!n)return;return{_dd:{trace_id:t.traceId,span_id:_r().toString(),rule_psr:e.rulePsr}}}(t,e);if(!e.trackResources&&!r)return;const o=Jr(t),i=$i(t),s=on({date:n.timeStamp,resource:{id:Y(),type:o,url:t.name,status_code:(a=t.responseStatus,0===a?void 0:a),protocol:ro(t),delivery_type:oo(t)},type:"resource",_dd:{discarded:!e.trackResources}},r,i);var a;return{startTime:n.relative,rawRumEvent:s,domainContext:{performanceEntry:t}}}function $i(t){const{renderBlockingStatus:e}=t;return{resource:{duration:Zr(t),render_blocking_status:e,...io(t),...Qr(t)}}}function zi(t,e,n=Mi){return function(t,e){let n;const{stop:r}=Wn(t,"complete",(()=>{n=j((()=>e()))}));return{stop:()=>{r(),q(n)}}}(t,(()=>{const t=n();(function(t){return t.loadEventEnd<=0})(t)||e(function(t){return{domComplete:t.domComplete,domContentLoaded:t.domContentLoadedEventEnd,domInteractive:t.domInteractive,loadEvent:t.loadEventEnd,firstByte:t.responseStart>=0&&t.responseStart<=b()?t.responseStart:void 0}}(t))}))}function Bi(t,e=window){let n,r;return"hidden"===document.visibilityState?n=0:(n=1/0,({stop:r}=Je(t,e,["pagehide","visibilitychange"],(t=>{"pagehide"!==t.type&&"hidden"!==document.visibilityState||(n=t.timeStamp,r())}),{capture:!0}))),{get timeStamp(){return n},stop(){null==r||r()}}}function Vi(t,e,n){const r={},{stop:o}=zi(t,(t=>{e(t.loadEvent),r.navigationTimings=t,n()})),i=Bi(t),{stop:s}=function(t,e,n){return{stop:yo(t,{type:vo.PAINT,buffered:!0}).subscribe((t=>{const r=t.find((t=>"first-contentful-paint"===t.name&&t.startTime<e.timeStamp&&t.startTime<6e5));r&&n(r.startTime)})).unsubscribe}}(t,i,(t=>{r.firstContentfulPaint=t,n()})),{stop:a}=function(t,e,n,r){let o=1/0;const{stop:i}=Je(t,n,["pointerdown","keydown"],(t=>{o=t.timeStamp}),{capture:!0,once:!0});let s=0;const a=yo(t,{type:vo.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe((n=>{const i=function(t,e){for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(e(r,n,t))return r}}(n,(t=>t.entryType===vo.LARGEST_CONTENTFUL_PAINT&&t.startTime<o&&t.startTime<e.timeStamp&&t.startTime<6e5&&t.size>s));if(i){let e;i.element&&(e=ri(i.element,t.actionNameAttribute)),r({value:i.startTime,targetSelector:e}),s=i.size}}));return{stop:()=>{i(),a.unsubscribe()}}}(t,i,window,(t=>{r.largestContentfulPaint=t,n()})),{stop:c}=function(t,e,n){const r=yo(t,{type:vo.FIRST_INPUT,buffered:!0}).subscribe((r=>{const o=r.find((t=>t.startTime<e.timeStamp));if(o){const e=k(o.startTime,o.processingStart);let r;o.target&&xo(o.target)&&(r=ri(o.target,t.actionNameAttribute)),n({delay:e>=0?e:0,time:o.startTime,targetSelector:r})}}));return{stop:()=>{r.unsubscribe()}}}(t,i,(t=>{r.firstInput=t,n()}));return{stop:function(){o(),s(),a(),c(),i.stop()},initialViewMetrics:r}}function Fi(t,e,n){if(!Gi())return{stop:X};let r,o,i=0;n({value:0});const s=function(){let t,e,n=0,r=0;return{update:o=>{let i;return void 0===t||o.startTime-e>=Hi||o.startTime-t>=qi?(t=e=o.startTime,r=n=o.value,i=!0):(n+=o.value,e=o.startTime,i=o.value>r,i&&(r=o.value)),{cumulatedValue:n,isMaxValue:i}}}}(),a=yo(t,{type:vo.LAYOUT_SHIFT,buffered:!0}).subscribe((a=>{for(const c of a){if(c.hadRecentInput||c.startTime<e)continue;const{cumulatedValue:a,isMaxValue:u}=s.update(c);if(u){const t=ji(c.sources);r=t?new WeakRef(t):void 0,o=k(e,c.startTime)}if(a>i){i=a;const e=null==r?void 0:r.deref();n({value:l(i,4),targetSelector:e&&ri(e,t.actionNameAttribute),time:o})}}}));return{stop:()=>{a.unsubscribe()}}}function ji(t){var e;if(t)return null===(e=t.find((t=>!!t.node&&xo(t.node))))||void 0===e?void 0:e.node}const qi=5e3,Hi=f;function Gi(){return bo(vo.LAYOUT_SHIFT)&&"WeakRef"in window}let Wi,Ki=0,Ji=1/0,Xi=0;const Yi=()=>Wi?Ki:window.performance.interactionCount||0;function Zi(t,e,n){if(!(bo(vo.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return{getInteractionToNextPaint:()=>{},setViewEnd:X,stop:X};const{getViewInteractionCount:r,stopViewInteractionCount:o}=function(t){"interactionCount"in performance||Wi||(Wi=new window.PerformanceObserver(z((t=>{t.getEntries().forEach((t=>{const e=t;e.interactionId&&(Ji=Math.min(Ji,e.interactionId),Xi=Math.max(Xi,e.interactionId),Ki=(Xi-Ji)/7+1)}))}))),Wi.observe({type:"event",buffered:!0,durationThreshold:0}));const e="initial_load"===t?0:Yi();let n={stopped:!1};function r(){return Yi()-e}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}(n);let i=1/0;const s=function(t){const e=[];function n(){e.sort(((t,e)=>e.duration-t.duration)).splice(10)}return{process(t){const r=e.findIndex((e=>t.interactionId===e.interactionId)),o=e[e.length-1];-1!==r?t.duration>e[r].duration&&(e[r]=t,n()):(e.length<10||t.duration>o.duration)&&(e.push(t),n())},estimateP98Interaction(){const n=Math.min(e.length-1,Math.floor(t()/50));return e[n]}}}(r);let a,c,u=-1;function l(n){for(const t of n)t.interactionId&&t.startTime>=e&&t.startTime<=i&&s.process(t);const r=s.estimateP98Interaction();r&&r.duration!==u&&(u=r.duration,c=k(e,r.startTime),a=function(t){const e=bi.get(t);return bi.delete(t),e}(r.startTime),!a&&r.target&&xo(r.target)&&(a=ri(r.target,t.actionNameAttribute)))}const d=yo(t,{type:vo.FIRST_INPUT,buffered:!0}).subscribe(l),f=yo(t,{type:vo.EVENT,durationThreshold:40,buffered:!0}).subscribe(l);return{getInteractionToNextPaint:()=>u>=0?{value:Math.min(u,6e4),targetSelector:a,time:c}:r()?{value:0}:void 0,setViewEnd:t=>{i=t,o()},stop:()=>{f.unsubscribe(),d.unsubscribe()}}}function Qi(){let t;const e=window.visualViewport;return t=e?e.pageLeft-e.offsetLeft:void 0!==window.scrollX?window.scrollX:window.pageXOffset||0,Math.round(t)}function ts(){let t;const e=window.visualViewport;return t=e?e.pageTop-e.offsetTop:void 0!==window.scrollY?window.scrollY:window.pageYOffset||0,Math.round(t)}let es;function ns(t){return es||(es=function(t){return new W((e=>{const{throttled:n}=J((()=>{e.notify(rs())}),200);return Ke(t,window,"resize",n,{capture:!0,passive:!0}).stop}))}(t)),es}function rs(){const t=window.visualViewport;return t?{width:Number(t.width*t.scale),height:Number(t.height*t.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}function os(t,e,n,r=function(t,e=1e3){return new W((n=>{function r(){n.notify(function(){const t=ts(),{height:e}=rs(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(e+t);return{scrollHeight:n,scrollDepth:r,scrollTop:t}}())}if(window.ResizeObserver){const n=J(r,e,{leading:!1,trailing:!0}),o=document.scrollingElement||document.documentElement,i=new ResizeObserver(z(n.throttled));o&&i.observe(o);const s=Ke(t,window,"scroll",n.throttled,{passive:!0});return()=>{n.cancel(),i.disconnect(),s.stop()}}}))}(t)){let o=0,i=0,s=0;const a=r.subscribe((({scrollDepth:t,scrollTop:r,scrollHeight:a})=>{let c=!1;if(t>o&&(o=t,c=!0),a>i){i=a;const t=b();s=k(e.relative,t),c=!0}c&&n({maxDepth:Math.min(o,i),maxDepthScrollTop:r,maxScrollHeight:i,maxScrollHeightTime:s})}));return{stop:()=>a.unsubscribe()}}function is(t,e,n,r,o,i,s){const a={},{stop:c,setLoadEvent:u}=function(t,e,n,r,o,i,s){let a="initial_load"===o,c=!0;const u=[],l=Bi(r);function d(){if(!c&&!a&&u.length>0){const t=Math.max(...u);t<l.timeStamp&&s(t)}}const{stop:f}=So(t,e,n,r,(t=>{c&&(c=!1,t.hadActivity&&u.push(k(i.timeStamp,t.end)),d())}));return{stop:()=>{f(),l.stop()},setLoadEvent:t=>{a&&(a=!1,u.push(t),d())}}}(t,e,n,r,i,s,(t=>{a.loadingTime=t,o()})),{stop:l}=os(r,s,(t=>{a.scroll=t})),{stop:d}=Fi(r,s.relative,(t=>{a.cumulativeLayoutShift=t,o()})),{stop:f,getInteractionToNextPaint:p,setViewEnd:h}=Zi(r,s.relative,i);return{stop:()=>{c(),d(),l()},stopINPTracking:f,setLoadEvent:u,setViewEnd:h,getCommonViewMetrics:()=>(a.interactionToNextPaint=p(),a)}}const ss=3e5,as=3e5;function cs(t,e,n,r,i,s,a,c){const u=new Set;let l,d=f("initial_load",S(),c);function f(s,a,c){const l=function(t,e,n,r,i,s,a=w(),c){const u=Y(),l=new W,d={};let f,p=0;const m=N(i),g=sr();let v,y,b,S,C=!0;c&&(v=c.name,y=c.service||void 0,b=c.version||void 0,c.context&&(S=c.context,g.setContext(S)));const x={id:u,name:v,startClocks:a,service:y,version:b,context:S};t.notify(1,x),t.notify(2,x);const{throttled:T,cancel:E}=J(z,3e3,{leading:!1}),{setLoadEvent:A,setViewEnd:R,stop:I,stopINPTracking:O,getCommonViewMetrics:L}=is(t,e,n,r,T,s,a),{stop:M,initialViewMetrics:D}="initial_load"===s?Vi(r,A,T):{stop:X,initialViewMetrics:{}},{stop:P,eventCounts:U}=function(t,e,n){const{stop:r,eventCounts:o}=mo({lifeCycle:t,isChildEvent:t=>t.view.id===e,onChange:n});return{stop:r,eventCounts:o}}(t,u,T),$=H(z,ss);function z(){E(),p+=1;const e=void 0===f?_():f.timeStamp;t.notify(3,{customTimings:d,documentVersion:p,id:u,name:v,service:y,version:b,context:g.getContext(),loadingType:s,location:m,startClocks:a,commonViewMetrics:L(),initialViewMetrics:D,duration:k(a.timeStamp,e),isActive:void 0===f,sessionIsActive:C,eventCounts:U})}return z(),g.changeObservable.subscribe(z),{get name(){return v},service:y,version:b,contextManager:g,stopObservable:l,end(e={}){var n,r;f||(f=null!==(n=e.endClocks)&&void 0!==n?n:w(),C=null===(r=e.sessionIsActive)||void 0===r||r,t.notify(4,{endClocks:f}),t.notify(5,{endClocks:f}),G($),R(f.relative),I(),z(),j((()=>{this.stop()}),as))},stop(){M(),P(),O(),l.notify()},addTiming(t,e){if(f)return;const n=function(t){return t<h}(e)?e:k(a.timeStamp,e);d[function(t){const e=t.replace(/[^a-zA-Z0-9-_.@$]/g,"_");e!==t&&o.warn(`Invalid timing name: ${t}, sanitized to: ${e}`);return e}(t)]=n,T()},setViewName(t){v=t,z()}}}(e,n,r,i,t,s,a,c);return u.add(l),l.stopObservable.subscribe((()=>{u.delete(l)})),l}return e.subscribe(9,(()=>{d=f("route_change",void 0,{name:d.name,service:d.service,version:d.version,context:d.contextManager.getContext()})})),e.subscribe(8,(()=>{d.end({sessionIsActive:!1})})),e.subscribe(10,(t=>{t.reason===Bn.UNLOADING&&d.end()})),a&&(l=function(t){return t.subscribe((({oldLocation:t,newLocation:e})=>{var n,r;r=e,((n=t).pathname!==r.pathname||!function(t){const e=t.substring(1);return""!==e&&!!document.getElementById(e)}(r.hash)&&us(r.hash)!==us(n.hash))&&(d.end(),d=f("route_change"))}))}(s)),{addTiming:(t,e=_())=>{d.addTiming(t,e)},startView:(t,e)=>{d.end({endClocks:e}),d=f("route_change",e,t)},setViewContext:t=>{d.contextManager.setContext(t)},setViewContextProperty:(t,e)=>{d.contextManager.setContextProperty(t,e)},setViewName:t=>{d.setViewName(t)},stop:()=>{l&&l.unsubscribe(),d.end(),u.forEach((t=>t.stop()))}}}function us(t){const e=t.indexOf("?");return e<0?t:t.slice(0,e)}function ls(t,e,n,r,o,i,s,a,c,u){return t.subscribe(3,(n=>t.notify(11,function(t,e,n,r,o){var i,s,a,c,u,l,d,f,p,h,m,g,y,_,b,w;const S=r.getReplayStats(t.id),k=n.findFeatureFlagEvaluations(t.startClocks.relative),C=o.findAll(t.startClocks.relative,t.duration),x={_dd:{document_version:t.documentVersion,replay_stats:S,page_states:C,configuration:{start_session_replay_recording_manually:e.startSessionReplayRecordingManually}},date:t.startClocks.timeStamp,type:"view",view:{action:{count:t.eventCounts.actionCount},frustration:{count:t.eventCounts.frustrationCount},cumulative_layout_shift:null===(i=t.commonViewMetrics.cumulativeLayoutShift)||void 0===i?void 0:i.value,cumulative_layout_shift_time:v(null===(s=t.commonViewMetrics.cumulativeLayoutShift)||void 0===s?void 0:s.time),cumulative_layout_shift_target_selector:null===(a=t.commonViewMetrics.cumulativeLayoutShift)||void 0===a?void 0:a.targetSelector,first_byte:v(null===(c=t.initialViewMetrics.navigationTimings)||void 0===c?void 0:c.firstByte),dom_complete:v(null===(u=t.initialViewMetrics.navigationTimings)||void 0===u?void 0:u.domComplete),dom_content_loaded:v(null===(l=t.initialViewMetrics.navigationTimings)||void 0===l?void 0:l.domContentLoaded),dom_interactive:v(null===(d=t.initialViewMetrics.navigationTimings)||void 0===d?void 0:d.domInteractive),error:{count:t.eventCounts.errorCount},first_contentful_paint:v(t.initialViewMetrics.firstContentfulPaint),first_input_delay:v(null===(f=t.initialViewMetrics.firstInput)||void 0===f?void 0:f.delay),first_input_time:v(null===(p=t.initialViewMetrics.firstInput)||void 0===p?void 0:p.time),first_input_target_selector:null===(h=t.initialViewMetrics.firstInput)||void 0===h?void 0:h.targetSelector,interaction_to_next_paint:v(null===(m=t.commonViewMetrics.interactionToNextPaint)||void 0===m?void 0:m.value),interaction_to_next_paint_time:v(null===(g=t.commonViewMetrics.interactionToNextPaint)||void 0===g?void 0:g.time),interaction_to_next_paint_target_selector:null===(y=t.commonViewMetrics.interactionToNextPaint)||void 0===y?void 0:y.targetSelector,is_active:t.isActive,name:t.name,largest_contentful_paint:v(null===(_=t.initialViewMetrics.largestContentfulPaint)||void 0===_?void 0:_.value),largest_contentful_paint_target_selector:null===(b=t.initialViewMetrics.largestContentfulPaint)||void 0===b?void 0:b.targetSelector,load_event:v(null===(w=t.initialViewMetrics.navigationTimings)||void 0===w?void 0:w.loadEvent),loading_time:ho(v(t.commonViewMetrics.loadingTime)),loading_type:t.loadingType,long_task:{count:t.eventCounts.longTaskCount},resource:{count:t.eventCounts.resourceCount},time_spent:v(t.duration)},feature_flags:k&&!L(k)?k:void 0,display:t.commonViewMetrics.scroll?{scroll:{max_depth:t.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:t.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:t.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:v(t.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,session:{has_replay:!!S||void 0,is_active:!!t.sessionIsActive&&void 0},privacy:{replay_level:e.defaultPrivacyLevel}};L(t.customTimings)||(x.view.custom_timings=function(t,e){const n={};for(const r of Object.keys(t))n[r]=e(t[r]);return n}(t.customTimings,v));return{rawRumEvent:x,startTime:t.startClocks.relative,domainContext:{location:t.location}}}(n,e,s,c,a)))),cs(n,t,r,o,e,i,!e.trackViewsManually,u)}function ds(t,e,n){const r=Tn(t,"rum",(e=>function(t,e){let n;n=function(t){return"0"===t||"1"===t||"2"===t}(e)?e:u(t.sessionSampleRate)?u(t.sessionReplaySampleRate)?"1":"2":"0";return{trackingType:n,isTracked:fs(n)}}(t,e)),n);return r.expireObservable.subscribe((()=>{e.notify(8)})),r.renewObservable.subscribe((()=>{e.notify(9)})),r.sessionStateUpdateObservable.subscribe((({previousState:t,newState:e})=>{if(!t.forcedReplay&&e.forcedReplay){const t=r.findSession();t&&(t.isReplayForced=!0)}})),{findTrackedSession:t=>{const e=r.findSession(t);if(e&&fs(e.trackingType))return{id:e.id,sessionReplay:"1"===e.trackingType?1:e.isReplayForced?2:0,anonymousId:e.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}function fs(t){return"2"===t||"1"===t}function ps(t,e,n,r,o,i,s){const a=t.replica,c=function(t,e,n,r,o,i,s=Fn){const a=u(t,e),c=n&&u(t,n);function u(t,{endpoint:e,encoder:n}){return s({encoder:n,request:Mn(e,t.batchBytesLimit,r),flushController:qn({messagesLimit:t.batchMessagesLimit,bytesLimit:t.batchBytesLimit,durationLimit:t.flushTimeout,pageExitObservable:o,sessionExpireObservable:i}),messageBytesLimit:t.messageBytesLimit})}return{flushObservable:a.flushController.flushObservable,add(t,e=!0){a.add(t),c&&e&&c.add(n.transformMessage?n.transformMessage(t):t)},upsert:(t,e)=>{a.upsert(t,e),c&&c.upsert(n.transformMessage?n.transformMessage(t):t,e)},stop:()=>{a.stop(),c&&c.stop()}}}(t,{endpoint:t.rumEndpointBuilder,encoder:s(2)},a&&{endpoint:a.rumEndpointBuilder,transformMessage:t=>on(t,{application:{id:a.applicationId}}),encoder:s(3)},r,o,i);return e.subscribe(12,(t=>{"view"===t.type?c.upsert(t,t.view.id):c.add(t)})),n.subscribe((e=>c.add(e,function(t){return t.site===Jt}(t)))),c}const hs=ht;function ms(t,e){let n=N(e);return new W((r=>{const{stop:o}=function(t,e){const{stop:n}=Ie(gs("pushState"),"pushState",(({onPostCall:t})=>{t(e)})),{stop:r}=Ie(gs("replaceState"),"replaceState",(({onPostCall:t})=>{t(e)})),{stop:o}=Ke(t,window,"popstate",e);return{stop:()=>{n(),r(),o()}}}(t,s),{stop:i}=function(t,e){return Ke(t,window,"hashchange",e)}(t,s);function s(){if(n.href===e.href)return;const t=N(e);r.notify({newLocation:t,oldLocation:n}),n=t}return()=>{o(),i()}}))}function gs(t){return Object.prototype.hasOwnProperty.call(history,t)?history:History.prototype}const vs=ht;let ys,_s,bs;function ws(){0!==ys.batchCount&&(vn("Customer data measures",ys),Cs())}function Ss(t,e){t.sum+=e,t.min=Math.min(t.min,e),t.max=Math.max(t.max,e)}function ks(t,e){t.sum+=e.sum,t.min=Math.min(t.min,e.min),t.max=Math.max(t.max,e.max)}function Cs(){ys={batchCount:0,batchBytesCount:{min:1/0,max:0,sum:0},batchMessagesCount:{min:1/0,max:0,sum:0},globalContextBytes:{min:1/0,max:0,sum:0},userContextBytes:{min:1/0,max:0,sum:0},featureFlagBytes:{min:1/0,max:0,sum:0}}}function xs(){bs=!1,_s={globalContextBytes:{min:1/0,max:0,sum:0},userContextBytes:{min:1/0,max:0,sum:0},featureFlagBytes:{min:1/0,max:0,sum:0}}}const Ts=ht;function Es(t,e=500){const n=kn({expireDelay:Ts,maxEntries:4e3});let r;i(As(),b());const{stop:o}=Je(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],(t=>{i(function(t){if("freeze"===t.type)return"frozen";if("pagehide"===t.type)return t.persisted?"frozen":"terminated";return As()}(t),t.timeStamp)}),{capture:!0});function i(t,e=b()){t!==r&&(r=t,n.closeActive(e),n.add({state:r,startTime:e},e))}const s={findAll:(t,r)=>{const o=n.findAll(t,r);if(0===o.length)return;const i=[],s=Math.max(0,o.length-e);for(let e=o.length-1;e>=s;e--){const n=o[e],r=k(t,n.startTime);i.push({state:n.state,start:v(r)})}return i},wasInPageStateAt:(t,e)=>s.wasInPageStateDuringPeriod(t,e,0),wasInPageStateDuringPeriod:(t,e,r)=>n.findAll(e,r).some((e=>e.state===t)),addPageState:i,stop:()=>{o(),n.stop()}};return s}function As(){return"hidden"===document.visibilityState?"hidden":document.hasFocus()?"active":"passive"}function Rs(t,e){const n=window.cookieStore?function(t){return(e,n)=>Ke(t,window.cookieStore,"change",(t=>{const r=t.changed.find((t=>t.name===e))||t.deleted.find((t=>t.name===e));r&&n(r.value)})).stop}(t):Ns;return new W((t=>n(e,(e=>t.notify(e)))))}const Is=f;function Ns(t,e){const n=Q(document.cookie,t),r=H((()=>{const r=Q(document.cookie,t);r!==n&&e(r)}),Is);return()=>{G(r)}}const Os="datadog-ci-visibility-test-execution-id";function Ls(t,{session:e,viewContext:n,errorType:r}){const o=e?e.id:"no-session-id",i=[];void 0!==r&&i.push(`error-type=${r}`),n&&(i.push(`seed=${n.id}`),i.push(`from=${n.startClocks.timeStamp}`));const s=function(t){const e=t.site,n=t.subdomain||function(t){switch(t.site){case Yt:case Zt:return"app";case Jt:return"dd";default:return}}(t);return`https://${n?`${n}.`:""}${e}`}(t);return`${s}${`/rum/replay/sessions/${o}`}?${i.join("&")}`}let Ms;function Ds(t){return Ps(t).segments_count}function Ps(t){let e;return Ms||(Ms=new Map),Ms.has(t)?e=Ms.get(t):(e={records_count:0,segments_count:0,segments_total_raw_size:0},Ms.set(t,e),Ms.size>10&&function(){if(!Ms)return;const t=Ms.keys().next().value;t&&Ms.delete(t)}()),e}function Us(t,e,n){let r,o=0,i=[],s=0;const a=[],{stop:c}=Ke(t,e,"message",(({data:t})=>{if("wrote"!==t.type||t.streamId!==n)return;o+=t.additionalBytesCount,i.push(t.result),r=t.trailer;const e=a.shift();e&&e.id===t.id?e.writeCallback?e.writeCallback(t.result.byteLength):e.finishCallback&&e.finishCallback():(c(),vn("Worker responses received out of order."))}));function u(){const t=0===i.length?new Uint8Array(0):function(t){const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(i.concat(r)),e={rawBytesCount:o,output:t,outputBytesCount:t.byteLength,encoding:"deflate"};return o=0,i=[],e}function l(){s>0&&(e.postMessage({action:"reset",streamId:n}),s=0)}return{isAsync:!0,get isEmpty(){return 0===s},write(t,r){e.postMessage({action:"write",id:s,data:t,streamId:n}),a.push({id:s,writeCallback:r,data:t}),s+=1},finish(t){l(),a.length?(a.forEach((t=>{delete t.writeCallback})),a[a.length-1].finishCallback=()=>t(u())):t(u())},finishSync(){l();const t=a.map((t=>(delete t.writeCallback,delete t.finishCallback,t.data))).join("");return{...u(),pendingData:t}},estimateEncodedBytesCount:t=>t.length/8,stop(){c()}}}function $s(t){return new Worker(t.workerUrl||URL.createObjectURL(new Blob(['(()=>{"use strict";function t(t){const e=t.reduce(((t,e)=>t+e.length),0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,r=30,i=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),h=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);var d=new Array(60);e(d);var u=new Array(512);e(u);var f=new Array(256);e(f);var c=new Array(29);e(c);var p,g,w,v=new Array(r);function b(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function m(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(v);var y=function(t){return t<256?u[t]:u[256+(t>>>7)]},k=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},z=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,k(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},x=function(t,e,a){z(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},U=function(t,e,a){var n,r,s=new Array(16),h=0;for(n=1;n<=i;n++)s[n]=h=h+a[n-1]<<1;for(r=0;r<=e;r++){var l=t[2*r+1];0!==l&&(t[2*r]=A(s[l]++,l))}},I=function(t){var e;for(e=0;e<n;e++)t.dyn_ltree[2*e]=0;for(e=0;e<r;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},B=function(t){t.bi_valid>8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},E=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},S=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&E(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!E(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},C=function(t,e,n){var r,i,l,_,o=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===r?x(t,i,e):(l=f[i],x(t,l+a+1,e),0!==(_=s[l])&&(i-=c[l],z(t,i,_)),r--,l=y(r),x(t,l,n),0!==(_=h[l])&&(r-=v[l],z(t,r,_)))}while(o<t.last_lit);x(t,256,e)},D=function(t,e){var a,n,r,s=e.dyn_tree,h=e.stat_desc.static_tree,l=e.stat_desc.has_stree,_=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<_;a++)0!==s[2*a]?(t.heap[++t.heap_len]=o=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(r=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[r]=0,t.opt_len--,l&&(t.static_len-=h[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;a>=1;a--)S(t,s,a);r=_;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*r]=s[2*a]+s[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=r,t.heap[1]=r++,S(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,s,h,l,_=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(s=0;s<=i;s++)t.bl_count[s]=0;for(_[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=_[2*_[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),_[2*n+1]=s,n>o||(t.bl_count[s]++,h=0,n>=c&&(h=f[n-c]),l=_[2*n],t.opt_len+=l*(s+h),u&&(t.static_len+=l*(d[2*n+1]+h)));if(0!==g){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=t.bl_count[s];0!==n;)(r=t.heap[--a])>o||(_[2*r+1]!==s&&(t.opt_len+=(s-_[2*r+1])*_[2*r],_[2*r+1]=s),n--)}}(t,e),U(s,o,t.bl_count)},j=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},M=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{x(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(x(t,r,t.bl_tree),h--),x(t,16,t.bl_tree),z(t,h-3,2)):h<=10?(x(t,17,t.bl_tree),z(t,h-3,3)):(x(t,18,t.bl_tree),z(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},L=!1,T=function(t,e,a,n){z(t,0+(n?1:0),3),function(t,e,a,n){B(t),n&&(k(t,a),k(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a,!0)},H=function(t,e,n,r){var i,s,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),D(t,t.l_desc),D(t,t.d_desc),h=function(t){var e;for(j(t,t.dyn_ltree,t.l_desc.max_code),j(t,t.dyn_dtree,t.d_desc.max_code),D(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*_[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?T(t,e,n,r):4===t.strategy||s===i?(z(t,2+(r?1:0),3),C(t,o,d)):(z(t,4+(r?1:0),3),function(t,e,a,n){var r;for(z(t,e-257,5),z(t,a-1,5),z(t,n-4,4),r=0;r<n;r++)z(t,t.bl_tree[2*_[r]+1],3);M(t,t.dyn_ltree,e-1),M(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),C(t,t.dyn_ltree,t.dyn_dtree)),I(t),r&&B(t)},R={_tr_init:function(t){L||(!function(){var t,e,a,_,m,y=new Array(16);for(a=0,_=0;_<28;_++)for(c[_]=a,t=0;t<1<<s[_];t++)f[a++]=_;for(f[a-1]=_,m=0,_=0;_<16;_++)for(v[_]=m,t=0;t<1<<h[_];t++)u[m++]=_;for(m>>=7;_<r;_++)for(v[_]=m<<7,t=0;t<1<<h[_]-7;t++)u[256+m++]=_;for(e=0;e<=i;e++)y[e]=0;for(t=0;t<=143;)o[2*t+1]=8,t++,y[8]++;for(;t<=255;)o[2*t+1]=9,t++,y[9]++;for(;t<=279;)o[2*t+1]=7,t++,y[7]++;for(;t<=287;)o[2*t+1]=8,t++,y[8]++;for(U(o,287,y),t=0;t<r;t++)d[2*t+1]=5,d[2*t]=A(t,5);p=new b(o,s,257,n,i),g=new b(d,h,0,r,i),w=new b(new Array(0),l,0,19,7)}(),L=!0),t.l_desc=new m(t.dyn_ltree,p),t.d_desc=new m(t.dyn_dtree,g),t.bl_desc=new m(t.bl_tree,w),t.bi_buf=0,t.bi_valid=0,I(t)},_tr_stored_block:T,_tr_flush_block:H,_tr_tally:function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){z(t,2,3),x(t,256,o),function(t){16===t.bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},K=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},N=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),O=function(t,e,a,n){var r=N,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},q={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},F=0,G=2,J=3,P=4,Q=0,V=1,W=-1,X=0,Y=8,Z=R._tr_init,$=R._tr_stored_block,tt=R._tr_flush_block,et=R._tr_tally,at=R._tr_align,nt=F,rt=1,it=J,st=P,ht=5,lt=Q,_t=V,ot=-2,dt=-3,ut=-5,ft=W,ct=1,pt=2,gt=3,wt=4,vt=X,bt=2,mt=Y,yt=258,kt=262,zt=103,xt=113,At=666,Ut=function(t,e){return t.msg=q[e],e},It=function(t){return(t<<1)-(t>4?9:0)},Bt=function(t){for(var e=t.length;--e>=0;)t[e]=0},Et=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},St=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Ct=function(t,e){tt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,St(t.strm)},Dt=function(t,e){t.pending_buf[t.pending++]=e},jt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Mt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-kt?t.strstart-(t.w_size-kt):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+yt,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=yt-(u-i),i=u-yt,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},Lt=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-kt)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=K(s.adler,h,o,l):2===s.state.wrap&&(s.adler=O(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Et(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Et(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<kt&&0!==t.strm.avail_in)},Tt=function(t,e){for(var a,n;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a)),t.match_length>=3)if(n=et(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Et(t,t.ins_h,t.window[t.strstart+1]);else n=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2},Ht=function(t,e){for(var a,n,r;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a),t.match_length<=5&&(t.strategy===ct||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=et(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Ct(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=et(t,0,t.window[t.strstart-1]))&&Ct(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=et(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2};function Rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Kt=[new Rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Lt(t),0===t.lookahead&&e===nt)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Ct(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-kt&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Ct(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Tt),new Rt(4,5,16,8,Tt),new Rt(4,6,32,32,Tt),new Rt(4,4,16,16,Ht),new Rt(8,16,32,32,Ht),new Rt(8,16,128,128,Ht),new Rt(8,32,128,256,Ht),new Rt(32,128,258,1024,Ht),new Rt(32,258,258,4096,Ht)];function Nt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=mt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Bt(this.dyn_ltree),Bt(this.dyn_dtree),Bt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Bt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Bt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ot=function(t){if(!t||!t.state)return Ut(t,ot);t.total_in=t.total_out=0,t.data_type=bt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:xt,t.adler=2===e.wrap?0:1,e.last_flush=nt,Z(e),lt},qt=function(t){var e,a=Ot(t);return a===lt&&((e=t.state).window_size=2*e.w_size,Bt(e.head),e.max_lazy_match=Kt[e.level].max_lazy,e.good_match=Kt[e.level].good_length,e.nice_match=Kt[e.level].nice_length,e.max_chain_length=Kt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ft=function(t,e,a,n,r,i){if(!t)return ot;var s=1;if(e===ft&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==mt||n<8||n>15||e<0||e>9||i<0||i>wt)return Ut(t,ot);8===n&&(n=9);var h=new Nt;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,qt(t)},Gt={deflateInit:function(t,e){return Ft(t,e,mt,15,8,vt)},deflateInit2:Ft,deflateReset:qt,deflateResetKeep:Ot,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?ot:(t.state.gzhead=e,lt):ot},deflate:function(t,e){var a,n;if(!t||!t.state||e>ht||e<0)return t?Ut(t,ot):ot;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===At&&e!==st)return Ut(t,0===t.avail_out?ut:ot);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Dt(r,31),Dt(r,139),Dt(r,8),r.gzhead?(Dt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Dt(r,255&r.gzhead.time),Dt(r,r.gzhead.time>>8&255),Dt(r,r.gzhead.time>>16&255),Dt(r,r.gzhead.time>>24&255),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Dt(r,255&r.gzhead.extra.length),Dt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=O(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,3),r.status=xt);else{var s=mt+(r.w_bits-8<<4)<<8;s|=(r.strategy>=pt||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=xt,jt(r,s),0!==r.strstart&&(jt(r,t.adler>>>16),jt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending!==r.pending_buf_size));)Dt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=zt)}else r.status=zt;if(r.status===zt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&St(t),r.pending+2<=r.pending_buf_size&&(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),t.adler=0,r.status=xt)):r.status=xt),0!==r.pending){if(St(t),0===t.avail_out)return r.last_flush=-1,lt}else if(0===t.avail_in&&It(e)<=It(i)&&e!==st)return Ut(t,ut);if(r.status===At&&0!==t.avail_in)return Ut(t,ut);if(0!==t.avail_in||0!==r.lookahead||e!==nt&&r.status!==At){var h=r.strategy===pt?function(t,e){for(var a;;){if(0===t.lookahead&&(Lt(t),0===t.lookahead)){if(e===nt)return 1;break}if(t.match_length=0,a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===gt?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=yt){if(Lt(t),t.lookahead<=yt&&e===nt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+yt;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=yt-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=et(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):Kt[r.level].func(r,e);if(3!==h&&4!==h||(r.status=At),1===h||3===h)return 0===t.avail_out&&(r.last_flush=-1),lt;if(2===h&&(e===rt?at(r):e!==ht&&($(r,0,0,!1),e===it&&(Bt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),St(t),0===t.avail_out))return r.last_flush=-1,lt}return e!==st?lt:r.wrap<=0?_t:(2===r.wrap?(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),Dt(r,t.adler>>16&255),Dt(r,t.adler>>24&255),Dt(r,255&t.total_in),Dt(r,t.total_in>>8&255),Dt(r,t.total_in>>16&255),Dt(r,t.total_in>>24&255)):(jt(r,t.adler>>>16),jt(r,65535&t.adler)),St(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?lt:_t)},deflateEnd:function(t){if(!t||!t.state)return ot;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==zt&&e!==xt&&e!==At?Ut(t,ot):(t.state=null,e===xt?Ut(t,dt):lt)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return ot;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return ot;if(1===r&&(t.adler=K(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(Bt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Lt(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=Et(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,Lt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,lt},deflateInfo:"pako deflate (from Nodeca project)"};for(var Jt=new Uint8Array(256),Pt=0;Pt<256;Pt++)Jt[Pt]=Pt>=252?6:Pt>=248?5:Pt>=240?4:Pt>=224?3:Pt>=192?2:1;Jt[254]=Jt[254]=1;var Qt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Vt=Object.prototype.toString,Wt=F,Xt=G,Yt=J,Zt=P,$t=Q,te=V,ee=W,ae=X,ne=Y;function re(){this.options={level:ee,method:ne,chunkSize:16384,windowBits:15,memLevel:8,strategy:ae};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var e=Gt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==$t)throw new Error(q[e]);if(t.header&&Gt.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a="[object ArrayBuffer]"===Vt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Gt.deflateSetDictionary(this.strm,a))!==$t)throw new Error(q[e]);this._dict_set=!0}}function ie(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:String(e),streamId:a})}}function se(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}re.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Zt:Wt,"[object ArrayBuffer]"===Vt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Xt||n===Yt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Gt.deflate(r,n))===te)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Gt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===$t;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},re.prototype.onData=function(t){this.chunks.push(t)},re.prototype.onEnd=function(t){t===$t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",(n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.0.0"};case"write":{let n=e.get(a.streamId);n||(n=new re,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,G),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:se(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){ie(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}}))}catch(t){ie(e,t)}}()})();'])))}let zs={status:0};function Bs(t,e,n,r=$s){switch(0===zs.status&&function(t,e,n=$s){try{const r=n(t),{stop:i}=Ke(t,r,"error",(n=>{Fs(t,e,n)})),{stop:s}=Ke(t,r,"message",(({data:n})=>{var r;"errored"===n.type?Fs(t,e,n.error,n.streamId):"initialized"===n.type&&(r=n.version,1===zs.status&&(zs={status:3,worker:zs.worker,stop:zs.stop,version:r}))}));r.postMessage({action:"init"}),j((()=>function(t){1===zs.status&&(o.error(`${t} failed to start: a timeout occurred while initializing the Worker`),zs.initializationFailureCallbacks.forEach((t=>t())),zs={status:2})}(e)),3e4);zs={status:1,worker:r,stop:()=>{i(),s()},initializationFailureCallbacks:[]}}catch(n){Fs(t,e,n)}}(t,e,r),zs.status){case 1:return zs.initializationFailureCallbacks.push(n),zs.worker;case 3:return zs.worker}}function Vs(){return zs.status}function Fs(t,e,n,r){if(1===zs.status||0===zs.status){if(o.error(`${e} failed to start: an error occurred while creating the Worker:`,n),n instanceof Event||n instanceof Error&&((s=n.message).includes("Content Security Policy")||s.includes("requires 'TrustedScriptURL'"))){let e;e=t.workerUrl?`Please make sure the Worker URL ${t.workerUrl} is correct and CSP is correctly configured.`:"Please make sure CSP is correctly configured.",o.error(`${e} See documentation at ${i}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else yn(n);1===zs.status&&zs.initializationFailureCallbacks.forEach((t=>t())),zs={status:2}}else yn(n,{worker_version:3===zs.status&&zs.version,stream_id:r});var s}function js(){return"function"==typeof Array.from&&"function"==typeof CSSSupportsRule&&"function"==typeof URL.createObjectURL&&"forEach"in NodeList.prototype}function qs(t,e,n,r){const o=e.findTrackedSession(),i=function(t,e){if(!js())return"browser-not-supported";if(!t)return"rum-not-tracked";if(0===t.sessionReplay)return"incorrect-session-plan";if(!e)return"replay-not-started"}(o,r);return Ls(t,{viewContext:n.findView(),errorType:i,session:o})}function Hs(t,e,n,r,o,i){let s,a=0;e.subscribe(8,(()=>{2!==a&&3!==a||(l(),a=1)})),e.subscribe(10,(t=>{t.reason===Bn.UNLOADING&&l()})),e.subscribe(9,(()=>{1===a&&u()}));const c=async()=>{const[c]=await Promise.all([o(),Kn(t,"interactive")]);if(2!==a)return;const u=i();u&&c?(({stop:s}=c(e,t,n,r,u)),a=3):a=0};function u(t){const e=n.findTrackedSession();!function(t,e){return!t||0===t.sessionReplay&&(!e||!e.force)}(e,t)?function(t){return 2===t||3===t}(a)||(a=2,c().catch(V),function(t,e){return e&&e.force&&0===t.sessionReplay}(e,t)&&n.setForcedReplay()):a=1}function l(){3===a&&(null==s||s()),a=0}return{start:u,stop:l,getSessionReplayLink:()=>qs(t,n,r,0!==a),isRecording:()=>3===a}}const Gs=function(t,e,n={}){const r=lr(0),i=sr(r.getOrCreateTracker(2)),s=sr(r.getOrCreateTracker(1)),a=function(t){const e=new W;return{tryToInit(e){t||(t=e)},update(n){t=n,e.notify()},isGranted:()=>t===Ft.GRANTED,observable:e}}(),c={vitalsByName:new Map,vitalsByReference:new WeakMap};function u(){return function(t,e,n){return{context:t.getContext(),user:e.getContext(),hasReplay:!!n.isRecording()||void 0}}(i,s,e)}let l=Lr(n,u,a,c,((o,d,f)=>{o.storeContextsAcrossPages&&(ur(o,i,"rum",2),ur(o,s,"rum",1)),r.setCompressionStatus(d?1:2);const p=t(o,e,r,u,f,d&&n.createDeflateEncoder?t=>n.createDeflateEncoder(o,d,t):Hn,a,c);return e.onRumStart(p.lifeCycle,o,p.session,p.viewHistory,d),l=function(t,e){return{init:t=>{We("DD_RUM",t)},initConfiguration:t.initConfiguration,...e}}(l,p),p}));const d=z((t=>{const e="object"==typeof t?t:{name:t};e.context&&r.getOrCreateTracker(3).updateCustomerData(e.context),l.startView(e),_n({feature:"start-view"})})),f=function(t){const e={version:"6.0.0",onReady(t){t()},...t};return Object.defineProperty(e,"_setDebug",{get:()=>$,enumerable:!1}),e}({init:z((t=>{l.init(t,f)})),setTrackingConsent:z((t=>{a.update(t),_n({feature:"set-tracking-consent",tracking_consent:t})})),setViewName:z((t=>{l.setViewName(t)})),setViewContext:z((t=>{l.setViewContext(t)})),setViewContextProperty:z(((t,e)=>{l.setViewContextProperty(t,e)})),setGlobalContext:z((t=>{i.setContext(t),_n({feature:"set-global-context"})})),getGlobalContext:z((()=>i.getContext())),setGlobalContextProperty:z(((t,e)=>{i.setContextProperty(t,e),_n({feature:"set-global-context"})})),removeGlobalContextProperty:z((t=>i.removeContextProperty(t))),clearGlobalContext:z((()=>i.clearContext())),getInternalContext:z((t=>l.getInternalContext(t))),getInitConfiguration:z((()=>rn(l.initConfiguration))),addAction:(t,e)=>{const n=Ee();B((()=>{l.addAction({name:Oe(t),context:Oe(e),startClocks:w(),type:"custom",handlingStack:n}),_n({feature:"add-action"})}))},addError:(t,e)=>{const n=Ee();B((()=>{l.addError({error:t,handlingStack:n,context:Oe(e),startClocks:w()}),_n({feature:"add-error"})}))},addTiming:z(((t,e)=>{l.addTiming(Oe(t),e)})),setUser:z((t=>{(function(t){const e="object"===ft(t);return e||o.error("Unsupported user:",t),e})(t)&&s.setContext(pt(t)),_n({feature:"set-user"})})),getUser:z((()=>s.getContext())),setUserProperty:z(((t,e)=>{const n=pt({[t]:e})[t];s.setContextProperty(t,n),_n({feature:"set-user"})})),removeUserProperty:z((t=>s.removeContextProperty(t))),clearUser:z((()=>s.clearContext())),startView:d,stopSession:z((()=>{l.stopSession(),_n({feature:"stop-session"})})),addFeatureFlagEvaluation:z(((t,e)=>{l.addFeatureFlagEvaluation(Oe(t),Oe(e)),_n({feature:"add-feature-flag-evaluation"})})),getSessionReplayLink:z((()=>e.getSessionReplayLink())),startSessionReplayRecording:z((t=>{e.start(t),_n({feature:"start-session-replay-recording",force:t&&t.force})})),stopSessionReplayRecording:z((()=>e.stop())),addDurationVital:z(((t,e)=>{var n;_n({feature:"add-duration-vital"}),l.addDurationVital({name:Oe(t),type:"duration",startClocks:(n=e.startTime,{relative:x(n),timeStamp:n}),duration:e.duration,context:Oe(e&&e.context),description:Oe(e&&e.description)})})),startDurationVital:z(((t,e)=>(_n({feature:"start-duration-vital"}),l.startDurationVital(Oe(t),{context:Oe(e&&e.context),description:Oe(e&&e.description)})))),stopDurationVital:z(((t,e)=>{_n({feature:"stop-duration-vital"}),l.stopDurationVital("string"==typeof t?Oe(t):t,{context:Oe(e&&e.context),description:Oe(e&&e.description)})}))});return f}((function(t,e,n,r,o,i,s,a){var c;const l=[],d=new Hr;d.subscribe(12,(t=>en("rum",t)));const f=function(t){const e=gn("browser-rum-sdk",t);if(zn()){const t=Un();e.observable.subscribe((e=>t.send("internal_telemetry",e)))}return e}(t);f.setContextProvider((()=>{var e,n;return{application:{id:t.applicationId},session:{id:null===(e=_.findTrackedSession())||void 0===e?void 0:e.id},view:{id:null===(n=T.findView())||void 0===n?void 0:n.id},action:{id:A.findActionId()}}}));const p=t=>{d.notify(13,{error:t}),vn("Error reported to customer",{"error.message":t.message})},h=function(t,e){const n=kn({expireDelay:vs});return t.subscribe(1,(({startClocks:t})=>{n.add({},t.relative),e.resetCustomerData()})),t.subscribe(5,(({endClocks:t})=>{n.closeActive(t.relative)})),{findFeatureFlagEvaluations:t=>n.find(t),addFeatureFlagEvaluation:(t,r)=>{const o=n.find();o&&(o[t]=r,e.updateCustomerData(o))},stop:()=>e.stop()}}(d,n.getOrCreateTracker(0)),g=function(t){return new W((e=>{const{stop:n}=Je(t,window,["visibilitychange","freeze"],(t=>{"visibilitychange"===t.type&&"hidden"===document.visibilityState?e.notify({reason:Bn.HIDDEN}):"freeze"===t.type&&e.notify({reason:Bn.FROZEN})}),{capture:!0}),r=Ke(t,window,"beforeunload",(()=>{e.notify({reason:Bn.UNLOADING})})).stop;return()=>{n(),r()}}))}(t),y=g.subscribe((t=>{d.notify(10,t)}));l.push((()=>y.unsubscribe()));const _=zn()?function(){const t={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:$n("records")?1:0};return{findTrackedSession:()=>t,expire:X,expireObservable:new W,setForcedReplay:X}}():ds(t,d,s);if(zn())!function(t){const e=Un();t.subscribe(12,(t=>{e.send("rum",t)}))}(d);else{const e=ps(t,d,f.observable,p,g,_.expireObservable,i);l.push((()=>e.stop())),function(t,e,n,r,o){e.enabled&&u(t.customerDataTelemetrySampleRate)&&(Cs(),xs(),n.subscribe(12,(t=>{bs=!0,Ss(_s.globalContextBytes,r.getOrCreateTracker(2).getBytesCount()),Ss(_s.userContextBytes,r.getOrCreateTracker(1).getBytesCount()),Ss(_s.featureFlagBytes,["view","error"].includes(t.type)?r.getOrCreateTracker(0).getBytesCount():0)})),o.subscribe((({bytesCount:t,messagesCount:e})=>{bs&&(ys.batchCount+=1,Ss(ys.batchBytesCount,t),Ss(ys.batchMessagesCount,e),ks(ys.globalContextBytes,_s.globalContextBytes),ks(ys.userContextBytes,_s.userContextBytes),ks(ys.featureFlagBytes,_s.featureFlagBytes),xs())})),H(ws,1e4))}(t,f,d,n,e.flushObservable)}const w=function(){const t=Mr();return new W((e=>{if(!t)return;const n=new t(z((()=>e.notify())));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()}))}(),S=ms(t,location),k=Es(t),{observable:C,stop:x}=function(){const t=new W,{stop:e}=Ie(window,"open",(()=>t.notify()));return{observable:t,stop:e}}();l.push(x);const{viewHistory:T,urlContexts:E,actionContexts:A,addAction:R,stop:I}=function(t,e,n,r,o,i,s,a,c,u){const l=function(t){const e=kn({expireDelay:Gr});return t.subscribe(1,(t=>{e.add(function(t){return{service:t.service,version:t.version,context:t.context,id:t.id,name:t.name,startClocks:t.startClocks}}(t),t.startClocks.relative)})),t.subscribe(5,(({endClocks:t})=>{e.closeActive(t.relative)})),t.subscribe(3,(t=>{const n=e.find(t.startClocks.relative);n&&t.name&&(n.name=t.name),n&&t.context&&(n.context=t.context)})),t.subscribe(9,(()=>{e.reset()})),{findView:t=>e.find(t),stop:()=>{e.stop()}}}(t),d=function(t,e,n){const r=kn({expireDelay:hs});let o;t.subscribe(1,(({startClocks:t})=>{const e=n.href;r.add(s({url:e,referrer:o||document.referrer}),t.relative),o=e})),t.subscribe(5,(({endClocks:t})=>{r.closeActive(t.relative)}));const i=e.subscribe((({newLocation:t})=>{const e=r.find();if(e){const n=b();r.closeActive(n),r.add(s({url:t.href,referrer:e.referrer}),n)}}));function s({url:t,referrer:e}){return{url:t,referrer:e}}return{findUrl:t=>r.find(t),stop:()=>{i.unsubscribe(),r.stop()}}}(t,i,n),f=function(t,e,n,r,o){t.subscribe(0,(e=>t.notify(11,Ci(e,o))));let i={findActionId:X},s=X;return r.trackUserInteractions&&({actionContexts:i,stop:s}=Si(t,e,n,r)),{addAction:(e,n)=>{t.notify(11,{savedCommonContext:n,...Ci(e,o)})},actionContexts:i,stop:s}}(t,s,a,e,o),p=function(t){let e,n;fe(ue.DELAY_VIEWPORT_COLLECTION)?n=requestAnimationFrame((()=>{e=rs()})):e=rs();const r=ns(t).subscribe((t=>{e=t})).unsubscribe;return{get:()=>e?{viewport:e}:void 0,stop:()=>{r(),n&&cancelAnimationFrame(n)}}}(e),h=function(t,e=Rs(t,Os)){var n;let r=at(Os)||(null===(n=window.Cypress)||void 0===n?void 0:n.env("traceId"));const o=e.subscribe((t=>{r=t}));return{get:()=>{if("string"==typeof r)return{test_execution_id:r}},stop:()=>o.unsubscribe()}}(e);return qr(e,t,r,l,d,f.actionContexts,p,h,c,u),{viewHistory:l,pageStateHistory:o,urlContexts:d,addAction:f.addAction,actionContexts:f.actionContexts,stop:()=>{f.stop(),h.stop(),p.stop(),d.stop(),l.stop(),o.stop()}}}(d,t,location,_,k,S,w,C,r,p);l.push(I),hn.drain();const{addTiming:N,startView:O,setViewName:L,setViewContext:M,setViewContextProperty:D,stop:P}=ls(d,t,location,w,C,S,h,k,e,o);l.push(P);const{stop:U}=Pi(d,t,k);if(l.push(U),t.trackLongTasks)if(null===(c=PerformanceObserver.supportedEntryTypes)||void 0===c?void 0:c.includes(vo.LONG_ANIMATION_FRAME)){const{stop:e}=function(t,e){const n=yo(e,{type:vo.LONG_ANIMATION_FRAME,buffered:!0}).subscribe((e=>{for(const n of e){const e=m(n.startTime),r={date:e.timeStamp,long_task:{id:Y(),entry_type:"long-animation-frame",duration:v(n.duration),blocking_duration:v(n.blockingDuration),first_ui_event_timestamp:v(n.firstUIEventTimestamp),render_start:v(n.renderStart),style_and_layout_start:v(n.styleAndLayoutStart),start_time:v(n.startTime),scripts:n.scripts.map((t=>({duration:v(t.duration),pause_duration:v(t.pauseDuration),forced_style_and_layout_duration:v(t.forcedStyleAndLayoutDuration),start_time:v(t.startTime),execution_start:v(t.executionStart),source_url:t.sourceURL,source_function_name:t.sourceFunctionName,source_char_position:t.sourceCharPosition,invoker:t.invoker,invoker_type:t.invokerType,window_attribution:t.windowAttribution})))},type:"long_task",_dd:{discarded:!1}};t.notify(11,{rawRumEvent:r,startTime:e.relative,domainContext:{performanceEntry:n}})}}));return{stop:()=>n.unsubscribe()}}(d,t);l.push(e)}else!function(t,e){const n=yo(e,{type:vo.LONG_TASK,buffered:!0}).subscribe((n=>{for(const r of n){if(r.entryType!==vo.LONG_TASK)break;if(!e.trackLongTasks)break;const n=m(r.startTime),o={date:n.timeStamp,long_task:{id:Y(),entry_type:"long-task",duration:v(r.duration)},type:"long_task",_dd:{discarded:!1}};t.notify(11,{rawRumEvent:o,startTime:n.relative,domainContext:{performanceEntry:r}})}}))}(d,t);const{addError:$}=Ti(d,t,k,h);fo(d,t,_);const B=mr(d,k,a),V=function(t,e,n,r,o){return{get:i=>{const s=n.findView(i),a=o.findUrl(i),c=e.findTrackedSession(i);if(c&&s&&a){const e=r.findActionId(i);return{application_id:t,session_id:c.id,user_action:e?{id:e}:void 0,view:{id:s.id,name:s.name,referrer:a.referrer,url:a.url}}}}}}(t.applicationId,_,T,A,E);return{addAction:R,addError:$,addTiming:N,addFeatureFlagEvaluation:h.addFeatureFlagEvaluation,startView:O,setViewContext:M,setViewContextProperty:D,setViewName:L,lifeCycle:d,viewHistory:T,session:_,stopSession:()=>_.expire(),getInternalContext:V.get,startDurationVital:B.startDurationVital,stopDurationVital:B.stopDurationVital,addDurationVital:B.addDurationVital,stop:()=>{l.forEach((t=>t()))}}}),function(t,e){if(zn()&&!$n("records")||!js())return{start:X,stop:X,getReplayStats:()=>{},onRumStart:X,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=function(){let t=0;return{strategy:{start(){t=1},stop(){t=2},isRecording:()=>!1,getSessionReplayLink:X},shouldStartImmediately:e=>1===t||0===t&&!e.startSessionReplayRecordingManually}}();return{start:t=>n.start(t),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:function(o,i,s,a,c){let u;n=Hs(i,o,s,a,t,(function(){u||(null!=c||(c=Bs(i,"Datadog Session Replay",(()=>{n.stop()}),e)),c&&(u=Us(i,c,1)));return u})),r(i)&&n.start()},isRecording:()=>3===Vs()&&n.isRecording(),getReplayStats:t=>3===Vs()?function(t){return null==Ms?void 0:Ms.get(t)}(t):void 0}}((async function(){try{return(await Promise.resolve().then((function(){return lc}))).startRecording}catch(t){}})),{startDeflateWorker:Bs,createDeflateEncoder:Us});!function(t,e,n){const r=t[e];r&&!r.q&&r.version&&o.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),t[e]=n,r&&r.q&&r.q.forEach((t=>c(t,"onReady callback threw an error:")()))}(M(),"DD_RUM",Gs);globalThis.DD_RUM=Gs;const Ws=new WeakMap;function Ks(t){return Ws.has(t)}function Js(t){return Ws.get(t)}function Xs(t,e){const n=t.tagName,r=t.value;if(zo(t,e)){const e=t.type;if("INPUT"===n&&("button"===e||"submit"===e||"reset"===e))return r;if(!r||"OPTION"===n)return;return Lo}return"OPTION"===n||"SELECT"===n?t.value:"INPUT"===n||"TEXTAREA"===n?r:void 0}const Ys=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,Zs=/^[A-Za-z]+:|^\/\//,Qs=/^data:.*,/i;function ta(t,e){return t.replace(Ys,((t,n,r,o,i,s)=>{const a=r||i||s;if(!e||!a||Zs.test(a)||Qs.test(a))return t;const c=n||o||"";return`url(${c}${function(t,e){try{return Gt(t,e).href}catch(e){return t}}(a,e)}${c})`}))}const ea=/[^a-z1-6-_]/;function na(t){const e=t.toLowerCase().trim();return ea.test(e)?"div":e}function ra(t,e){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${e}' style='background-color:silver'%3E%3C/svg%3E`}const oa=2,ia=3,sa=4,aa=6,ca=7,ua=8,la=9,da=0,fa=1,pa=2,ha=3,ma=4,ga=11,va=0,ya=1,_a=2,ba=3,wa=4,Sa=5,ka=6,Ca=7,xa=8,Ta=5,Ea=6,Aa=0,Ra=1;function Ia(t){if(void 0!==t&&0!==t.length)return t.map((t=>{const e=t.cssRules||t.rules;return{cssRules:Array.from(e,(t=>t.cssText)),disabled:t.disabled||void 0,media:t.media.length>0?Array.from(t.media):void 0}}))}function Na(t,e,n,r){if(e===Io.HIDDEN)return null;const o=t.getAttribute(n);if(e===Io.MASK&&n!==No&&!ti.includes(n)&&n!==r.actionNameAttribute){const e=t.tagName;switch(n){case"title":case"alt":case"placeholder":return Lo}if("IMG"===e&&("src"===n||"srcset"===n)){const e=t;if(e.naturalWidth>0)return ra(e.naturalWidth,e.naturalHeight);const{width:n,height:r}=t.getBoundingClientRect();return n>0||r>0?ra(n,r):Mo}if("SOURCE"===e&&("src"===n||"srcset"===n))return Mo;if("A"===e&&"href"===n)return Lo;if(o&&n.startsWith("data-"))return Lo;if("IFRAME"===e&&"srcdoc"===n)return Lo}return o&&"string"==typeof o&&co(o)?uo(o):o}function Oa(t){if(!t)return null;let e;try{e=t.rules||t.cssRules}catch(t){}if(!e)return null;return ta(Array.from(e,1===ot()?La:Ma).join(""),t.href)}function La(t){if(function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")){const e=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return t.cssText.replace(e,"$1\\$2")}return Ma(t)}function Ma(t){return function(t){return"styleSheet"in t}(t)&&Oa(t.styleSheet)||t.cssText}function Da(t,e){const n=function(t,e){switch(t.nodeType){case t.DOCUMENT_NODE:return function(t,e){return{type:da,childNodes:Ua(t,e),adoptedStyleSheets:Ia(t.adoptedStyleSheets)}}(t,e);case t.DOCUMENT_FRAGMENT_NODE:return function(t,e){const n=Eo(t);n&&e.serializationContext.shadowRootsController.addShadowRoot(t);return{type:ga,childNodes:Ua(t,e),isShadowRoot:n,adoptedStyleSheets:n?Ia(t.adoptedStyleSheets):void 0}}(t,e);case t.DOCUMENT_TYPE_NODE:return{type:fa,name:(n=t).name,publicId:n.publicId,systemId:n.systemId};case t.ELEMENT_NODE:return function(t,e){const n=na(t.tagName),r=(i=t,"svg"===i.tagName||i instanceof SVGElement||void 0),o=Uo($o(t),e.parentNodePrivacyLevel);var i;if(o===Io.HIDDEN){const{width:e,height:o}=t.getBoundingClientRect();return{type:pa,tagName:n,attributes:{rr_width:`${e}px`,rr_height:`${o}px`,[No]:Oo},childNodes:[],isSVG:r}}if(o===Io.IGNORE)return;const s=function(t,e,n){if(e===Io.HIDDEN)return{};const r={},o=na(t.tagName),i=t.ownerDocument;for(let o=0;o<t.attributes.length;o+=1){const i=t.attributes.item(o).name,s=Na(t,e,i,n.configuration);null!==s&&(r[i]=s)}if(t.value&&("textarea"===o||"select"===o||"option"===o||"input"===o)){const n=Xs(t,e);void 0!==n&&(r.value=n)}if("option"===o&&e===Io.ALLOW){const e=t;e.selected&&(r.selected=e.selected)}if("link"===o){const e=Array.from(i.styleSheets).find((e=>e.href===t.href)),n=Oa(e);n&&e&&(r._cssText=n)}if("style"===o&&t.sheet){const e=Oa(t.sheet);e&&(r._cssText=e)}const s=t;if("input"!==o||"radio"!==s.type&&"checkbox"!==s.type||(e===Io.ALLOW?r.checked=!!s.checked:zo(s,e)&&delete r.checked),"audio"===o||"video"===o){const e=t;r.rr_mediaState=e.paused?"paused":"played"}let a,c;const u=n.serializationContext;switch(u.status){case 0:a=Math.round(t.scrollTop),c=Math.round(t.scrollLeft),(a||c)&&u.elementsScrollPositions.set(t,{scrollTop:a,scrollLeft:c});break;case 1:u.elementsScrollPositions.has(t)&&({scrollTop:a,scrollLeft:c}=u.elementsScrollPositions.get(t))}return c&&(r.rr_scrollLeft=c),a&&(r.rr_scrollTop=a),r}(t,o,e);let a=[];if(function(t){return t.childNodes.length>0||To(t)}(t)&&"style"!==n){let r;r=e.parentNodePrivacyLevel===o&&e.ignoreWhiteSpace===("head"===n)?e:{...e,parentNodePrivacyLevel:o,ignoreWhiteSpace:"head"===n},a=Ua(t,r)}return{type:pa,tagName:n,attributes:s,childNodes:a,isSVG:r}}(t,e);case t.TEXT_NODE:return function(t,e){const n=Vo(t,e.ignoreWhiteSpace||!1,e.parentNodePrivacyLevel);if(void 0===n)return;return{type:ha,textContent:n}}(t,e);case t.CDATA_SECTION_NODE:return{type:ma,textContent:""}}var n}(t,e);if(!n)return null;const r=Js(t)||Pa++,o=n;return o.id=r,function(t,e){Ws.set(t,e)}(t,r),e.serializedNodeIds&&e.serializedNodeIds.add(r),o}let Pa=1;function Ua(t,e){const n=[];return Ao(t,(t=>{const r=Da(t,e);r&&n.push(r)})),n}function $a(t,e,n){return Da(t,{serializationContext:n,parentNodePrivacyLevel:e.defaultPrivacyLevel,configuration:e})}function za(t){return Boolean(t.changedTouches)}function Ba(t){return!0===t.composed&&To(t.target)?t.composedPath()[0]:t.target}const Va=(t,e)=>{const n=window.visualViewport,r={layoutViewportX:t,layoutViewportY:e,visualViewportX:t,visualViewportY:e};return n?(!function(t){return Math.abs(t.pageTop-t.offsetTop-window.scrollY)>25||Math.abs(t.pageLeft-t.offsetLeft-window.scrollX)>25}(n)?(r.visualViewportX=Math.round(t-n.offsetLeft),r.visualViewportY=Math.round(e-n.offsetTop)):(r.layoutViewportX=Math.round(t+n.offsetLeft),r.layoutViewportY=Math.round(e+n.offsetTop)),r):r},Fa=t=>({scale:t.scale,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,pageLeft:t.pageLeft,pageTop:t.pageTop,height:t.height,width:t.width});function ja(t,e){return{data:{source:t,...e},type:ia,timestamp:_()}}function qa(t,e){const{throttled:n,cancel:r}=J((t=>{const n=Ba(t);if(Ks(n)){const r=Ha(t);if(!r)return;const o={id:Js(n),timeOffset:0,x:r.x,y:r.y};e(ja(za(t)?ka:ya,{positions:[o]}))}}),50,{trailing:!1}),{stop:o}=Je(t,document,["mousemove","touchmove"],n,{capture:!0,passive:!0});return{stop:()=>{o(),r()}}}function Ha(t){let{clientX:e,clientY:n}=za(t)?t.changedTouches[0]:t;if(window.visualViewport){const{visualViewportX:t,visualViewportY:r}=Va(e,n);e=t,n=r}if(Number.isFinite(e)&&Number.isFinite(n))return{x:e,y:n};t.isTrusted&&vn("mouse/touch event without x/y")}const Ga={pointerup:0,mousedown:1,click:2,contextmenu:3,dblclick:4,focus:Ta,blur:Ea,touchstart:7,touchend:9};function Wa(t,e,n){return Je(t,document,Object.keys(Ga),(r=>{const o=Ba(r);if(Po(o,t.defaultPrivacyLevel)===Io.HIDDEN||!Ks(o))return;const i=Js(o),s=Ga[r.type];let a;if(s!==Ea&&s!==Ta){const t=Ha(r);if(!t)return;a={id:i,type:s,x:t.x,y:t.y}}else a={id:i,type:s};const c={id:n.getIdForEvent(r),...ja(_a,a)};e(c)}),{capture:!0,passive:!0})}function Ka(t,e,n,r=document){const{throttled:o,cancel:i}=J((r=>{const o=Ba(r);if(!o||Po(o,t.defaultPrivacyLevel)===Io.HIDDEN||!Ks(o))return;const i=Js(o),s=o===document?{scrollTop:ts(),scrollLeft:Qi()}:{scrollTop:Math.round(o.scrollTop),scrollLeft:Math.round(o.scrollLeft)};n.set(o,s),e(ja(ba,{id:i,x:s.scrollLeft,y:s.scrollTop}))}),100),{stop:s}=Ke(t,r,"scroll",o,{capture:!0,passive:!0});return{stop:()=>{s(),i()}}}function Ja(t,e){const n=ns(t).subscribe((t=>{e(ja(wa,t))}));return{stop:()=>{n.unsubscribe()}}}function Xa(t,e){const n=window.visualViewport;if(!n)return{stop:X};const{throttled:r,cancel:o}=J((()=>{e({data:Fa(n),type:ua,timestamp:_()})}),200,{trailing:!1}),{stop:i}=Je(t,n,["resize","scroll"],r,{capture:!0,passive:!0});return{stop:()=>{i(),o()}}}function Ya(t,e){return Je(t,document,["play","pause"],(n=>{const r=Ba(n);r&&Po(r,t.defaultPrivacyLevel)!==Io.HIDDEN&&Ks(r)&&e(ja(Ca,{id:Js(r),type:"play"===n.type?Aa:Ra}))}),{capture:!0,passive:!0})}function Za(t){function e(t,e){t&&Ks(t.ownerNode)&&e(Js(t.ownerNode))}const n=[Ie(CSSStyleSheet.prototype,"insertRule",(({target:n,parameters:[r,o]})=>{e(n,(e=>t(ja(xa,{id:e,adds:[{rule:r,index:o}]}))))})),Ie(CSSStyleSheet.prototype,"deleteRule",(({target:n,parameters:[r]})=>{e(n,(e=>t(ja(xa,{id:e,removes:[{index:r}]}))))}))];function r(r){n.push(Ie(r.prototype,"insertRule",(({target:n,parameters:[r,o]})=>{e(n.parentStyleSheet,(e=>{const i=Qa(n);i&&(i.push(o||0),t(ja(xa,{id:e,adds:[{rule:r,index:i}]})))}))})),Ie(r.prototype,"deleteRule",(({target:n,parameters:[r]})=>{e(n.parentStyleSheet,(e=>{const o=Qa(n);o&&(o.push(r),t(ja(xa,{id:e,removes:[{index:o}]})))}))})))}return"undefined"!=typeof CSSGroupingRule?r(CSSGroupingRule):(r(CSSMediaRule),r(CSSSupportsRule)),{stop:()=>{n.forEach((t=>t.stop()))}}}function Qa(t){const e=[];let n=t;for(;n.parentRule;){const t=Array.from(n.parentRule.cssRules).indexOf(n);e.unshift(t),n=n.parentRule}if(!n.parentStyleSheet)return;const r=Array.from(n.parentStyleSheet.cssRules).indexOf(n);return e.unshift(r),e}function tc(t,e){return Je(t,window,["focus","blur"],(()=>{e({data:{has_focus:document.hasFocus()},type:aa,timestamp:_()})}))}function ec(t,e,n){const r=t.subscribe(11,(t=>{var r,o;"action"===t.rawRumEvent.type&&"click"===t.rawRumEvent.action.type&&(null===(o=null===(r=t.rawRumEvent.action.frustration)||void 0===r?void 0:r.type)||void 0===o?void 0:o.length)&&"events"in t.domainContext&&t.domainContext.events&&t.domainContext.events.length&&e({timestamp:t.rawRumEvent.date,type:la,data:{frustrationTypes:t.rawRumEvent.action.frustration.type,recordIds:t.domainContext.events.map((t=>n.getIdForEvent(t)))}})}));return{stop:()=>{r.unsubscribe()}}}function nc(t,e){const n=t.subscribe(4,(()=>{e({timestamp:_(),type:ca})}));return{stop:()=>{n.unsubscribe()}}}function rc(t,e,n=document){const r=t.defaultPrivacyLevel,o=new WeakMap,i=n!==document,{stop:s}=Je(t,n,i?["change"]:["input","change"],(t=>{const e=Ba(t);(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)&&c(e)}),{capture:!0,passive:!0});let a;if(i)a=X;else{const t=[Ne(HTMLInputElement.prototype,"value",c),Ne(HTMLInputElement.prototype,"checked",c),Ne(HTMLSelectElement.prototype,"value",c),Ne(HTMLTextAreaElement.prototype,"value",c),Ne(HTMLSelectElement.prototype,"selectedIndex",c)];a=()=>{t.forEach((t=>t.stop()))}}return{stop:()=>{a(),s()}};function c(t){const e=Po(t,r);if(e===Io.HIDDEN)return;const n=t.type;let o;if("radio"===n||"checkbox"===n){if(zo(t,e))return;o={isChecked:t.checked}}else{const n=Xs(t,e);if(void 0===n)return;o={text:n}}u(t,o);const i=t.name;"radio"===n&&i&&t.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(i)}"]`).forEach((e=>{e!==t&&u(e,{isChecked:!1})}))}function u(t,n){if(!Ks(t))return;const r=o.get(t);r&&r.text===n.text&&r.isChecked===n.isChecked||(o.set(t,n),e(ja(Sa,{id:Js(t),...n})))}}function oc(t,e,n,r){const o=Mr();if(!o)return{stop:X,flush:X};const i=function(t){let e=X,n=[];function r(){e(),t(n),n=[]}const{throttled:o,cancel:i}=J(r,16,{leading:!1});return{addMutations:t=>{0===n.length&&(e=nr(o,{timeout:100})),n.push(...t)},flush:r,stop:()=>{e(),i()}}}((r=>{!function(t,e,n,r){const o=new Map;t.filter((t=>"childList"===t.type)).forEach((t=>{t.removedNodes.forEach((t=>{ic(t,r.removeShadowRoot)}))}));const i=t.filter((t=>t.target.isConnected&&function(t){let e=t;for(;e;){if(!Ks(e)&&!Eo(e))return!1;e=Ro(e)}return!0}(t.target)&&Po(t.target,n.defaultPrivacyLevel,o)!==Io.HIDDEN)),{adds:s,removes:a,hasBeenSerialized:c}=function(t,e,n,r){const o=new Set,i=new Map;for(const e of t)e.addedNodes.forEach((t=>{o.add(t)})),e.removedNodes.forEach((t=>{o.has(t)||i.set(t,e.target),o.delete(t)}));const s=Array.from(o);a=s,a.sort(((t,e)=>{const n=t.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_CONTAINS||n&Node.DOCUMENT_POSITION_FOLLOWING?1:n&Node.DOCUMENT_POSITION_PRECEDING?-1:0}));var a;const c=new Set,u=[];for(const t of s){if(d(t))continue;const o=Po(t.parentNode,e.defaultPrivacyLevel,r);if(o===Io.HIDDEN||o===Io.IGNORE)continue;const i=Da(t,{serializedNodeIds:c,parentNodePrivacyLevel:o,serializationContext:{status:2,shadowRootsController:n},configuration:e});if(!i)continue;const s=Ro(t);u.push({nextId:f(t),parentId:Js(s),node:i})}const l=[];return i.forEach(((t,e)=>{Ks(e)&&l.push({parentId:Js(t),id:Js(e)})})),{adds:u,removes:l,hasBeenSerialized:d};function d(t){return Ks(t)&&c.has(Js(t))}function f(t){let e=t.nextSibling;for(;e;){if(Ks(e))return Js(e);e=e.nextSibling}return null}}(i.filter((t=>"childList"===t.type)),n,r,o),u=function(t,e,n){var r;const o=[],i=new Set,s=t.filter((t=>!i.has(t.target)&&(i.add(t.target),!0)));for(const t of s){if(t.target.textContent===t.oldValue)continue;const i=Po(Ro(t.target),e.defaultPrivacyLevel,n);i!==Io.HIDDEN&&i!==Io.IGNORE&&o.push({id:Js(t.target),value:null!==(r=Vo(t.target,!1,i))&&void 0!==r?r:null})}return o}(i.filter((t=>"characterData"===t.type&&!c(t.target))),n,o),l=function(t,e,n){const r=[],o=new Map,i=t.filter((t=>{const e=o.get(t.target);return(!e||!e.has(t.attributeName))&&(e?e.add(t.attributeName):o.set(t.target,new Set([t.attributeName])),!0)})),s=new Map;for(const t of i){if(t.target.getAttribute(t.attributeName)===t.oldValue)continue;const o=Po(t.target,e.defaultPrivacyLevel,n),i=Na(t.target,o,t.attributeName,e);let a;if("value"===t.attributeName){const e=Xs(t.target,o);if(void 0===e)continue;a=e}else a="string"==typeof i?i:null;let c=s.get(t.target);c||(c={id:Js(t.target),attributes:{}},r.push(c),s.set(t.target,c)),c.attributes[t.attributeName]=a}return r}(i.filter((t=>"attributes"===t.type&&!c(t.target))),n,o);if(!(u.length||l.length||a.length||s.length))return;e(ja(va,{adds:s,removes:a,texts:u,attributes:l}))}(r.concat(s.takeRecords()),t,e,n)})),s=new o(z(i.addMutations));return s.observe(r,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{s.disconnect(),i.stop()},flush:()=>{i.flush()}}}function ic(t,e){To(t)&&e(t.shadowRoot),Ao(t,(t=>ic(t,e)))}function sc(t){const{emit:e,configuration:n,lifeCycle:r}=t;if(!e)throw new Error("emit function is required");const o=n=>{e(n),en("record",{record:n});const r=t.viewHistory.findView();Ps(r.id).records_count+=1},i=function(){const t=new WeakMap;return{set(e,n){(e!==document||document.scrollingElement)&&t.set(e===document?document.scrollingElement:e,n)},get:e=>t.get(e),has:e=>t.has(e)}}(),s=((t,e,n)=>{const r=new Map,o={addShadowRoot:i=>{if(r.has(i))return;const s=oc(e,t,o,i),a=rc(t,e,i),c=Ka(t,e,n,i);r.set(i,{flush:()=>s.flush(),stop:()=>{s.stop(),a.stop(),c.stop()}})},removeShadowRoot:t=>{const e=r.get(t);e&&(e.stop(),r.delete(t))},stop:()=>{r.forEach((({stop:t})=>t()))},flush:()=>{r.forEach((({flush:t})=>t()))}};return o})(n,o,i),{stop:a}=function(t,e,n,r,o,i){const s=(n=_(),o={status:0,elementsScrollPositions:t,shadowRootsController:e})=>{const{width:i,height:s}=rs(),a=[{data:{height:s,href:window.location.href,width:i},type:sa,timestamp:n},{data:{has_focus:document.hasFocus()},type:aa,timestamp:n},{data:{node:$a(document,r,o),initialOffset:{left:Qi(),top:ts()}},type:oa,timestamp:n}];return window.visualViewport&&a.push({data:Fa(window.visualViewport),type:ua,timestamp:n}),a};i(s());const{unsubscribe:a}=n.subscribe(2,(n=>{o(),i(s(n.startClocks.timeStamp,{shadowRootsController:e,status:1,elementsScrollPositions:t}))}));return{stop:a}}(i,s,r,n,c,(t=>t.forEach((t=>o(t)))));function c(){s.flush(),l.flush()}const u=function(){const t=new WeakMap;let e=1;return{getIdForEvent:n=>(t.has(n)||t.set(n,e++),t.get(n))}}(),l=oc(o,n,s,document),d=[l,qa(n,o),Wa(n,o,u),Ka(n,o,i,document),Ja(n,o),rc(n,o),Ya(n,o),Za(o),tc(n,o),Xa(n,o),ec(r,o,u),nc(r,(t=>{c(),o(t)}))];return{stop:()=>{s.stop(),d.forEach((t=>t.stop())),a()},flushMutations:c,shadowRootsController:s}}function ac({context:t,creationReason:e,encoder:n}){let r=0;const o=t.view.id,i={start:1/0,end:-1/0,creation_reason:e,records_count:0,has_full_snapshot:!1,index_in_view:Ds(o),source:"browser",...t};return function(t){Ps(t).segments_count+=1}(o),{addRecord:function(t,e){i.start=Math.min(i.start,t.timestamp),i.end=Math.max(i.end,t.timestamp),i.records_count+=1,i.has_full_snapshot||(i.has_full_snapshot=t.type===oa);const o=n.isEmpty?'{"records":[':",";n.write(o+JSON.stringify(t),(t=>{r+=t,e(r)}))},flush:function(t){if(n.isEmpty)throw new Error("Empty segment flushed");n.write(`],${JSON.stringify(i).slice(1)}\n`),n.finish((e=>{!function(t,e){Ps(t).segments_total_raw_size+=e}(i.view.id,e.rawBytesCount),t(i,e)}))}}}let cc=6e4;function uc(t,e,n,r,o,i){return function(t,e,n,r){let o={status:0,nextSegmentCreationReason:"init"};const{unsubscribe:i}=t.subscribe(2,(()=>{a("view_change")})),{unsubscribe:s}=t.subscribe(10,(t=>{a(t.reason)}));function a(t){1===o.status&&(o.segment.flush(((e,r)=>{const o=function(t,e,n){const r=new FormData;r.append("segment",new Blob([t],{type:"application/octet-stream"}),`${e.session.id}-${e.start}`);const o={raw_segment_size:n,compressed_segment_size:t.byteLength,...e},i=JSON.stringify(o);return r.append("event",new Blob([i],{type:"application/json"})),{data:r,bytesCount:t.byteLength}}(r.output,e,r.rawBytesCount);Vn(t)?n.sendOnExit(o):n.send(o)})),q(o.expirationTimeoutId)),o="stop"!==t?{status:0,nextSegmentCreationReason:t}:{status:2}}return{addRecord:t=>{if(2!==o.status){if(0===o.status){const t=e();if(!t)return;o={status:1,segment:ac({encoder:r,context:t,creationReason:o.nextSegmentCreationReason}),expirationTimeoutId:j((()=>{a("segment_duration_limit")}),5e3)}}o.segment.addRecord(t,(t=>{t>cc&&a("segment_bytes_limit")}))}},stop:()=>{a("stop"),i(),s()}}}(t,(()=>function(t,e,n){const r=e.findTrackedSession(),o=n.findView();if(!r||!o)return;return{application:{id:t},session:{id:r.id},view:{id:o.id}}}(e.applicationId,n,r)),o,i)}var lc=Object.freeze({__proto__:null,startRecording:function(t,e,n,r,o,i){const s=[],a=i||Mn(e.sessionReplayEndpointBuilder,cc,(e=>{t.notify(13,{error:e}),vn("Error reported to customer",{"error.message":e.message})}));let c;if(zn())({addRecord:c}=function(t){const e=Un();return{addRecord:n=>{const r=t.findView();e.send("record",n,r.id)}}}(r));else{const i=uc(t,e,n,r,a,o);c=i.addRecord,s.push(i.stop)}const{stop:u}=sc({emit:c,configuration:e,lifeCycle:t,viewHistory:r});return s.push(u),{stop:()=>{s.forEach((t=>t()))}}}});
1
+ "use strict";const t={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},e=console,n={};Object.keys(t).forEach((t=>{n[t]=e[t]}));const r="Datadog Browser SDK:",o={debug:n.debug.bind(e,r),log:n.log.bind(e,r),info:n.info.bind(e,r),warn:n.warn.bind(e,r),error:n.error.bind(e,r)},i="https://docs.datadoghq.com",s=`${i}/real_user_monitoring/browser/troubleshooting`,a="More details:";function c(t,e){return(...n)=>{try{return t(...n)}catch(t){o.error(e,t)}}}function u(t){return 0!==t&&100*Math.random()<=t}function l(t,e){return+t.toFixed(e)}function d(t){return"number"==typeof t}const f=1e3,p=6e4,h=31536e6;function m(t){return{relative:t,timeStamp:g(t)}}function g(t){const e=y()-performance.now();return e>E()?Math.round(C(e,t)):function(t){return Math.round(C(E(),t))}(t)}function v(t){return d(t)?l(1e6*t,0):t}function y(){return(new Date).getTime()}function _(){return y()}function b(){return performance.now()}function w(){return{relative:b(),timeStamp:_()}}function S(){return{relative:0,timeStamp:E()}}function k(t,e){return e-t}function C(t,e){return t+e}function x(t){return t-E()}let T;function E(){return void 0===T&&(T=performance.timing.navigationStart),T}const A=1024,R=/[^\u0000-\u007F]/;function I(t){return R.test(t)?void 0!==window.TextEncoder?(new TextEncoder).encode(t).length:new Blob([t]).size:t.length}function N(t){return{...t}}function O(t,e){return Object.keys(t).some((n=>t[n]===e))}function L(t){return 0===Object.keys(t).length}function M(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let t=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof t&&(t="object"==typeof self?self:"object"==typeof window?window:{}),t}function D(t,e){const n=M();let r;return n.Zone&&"function"==typeof n.Zone.__symbol__&&(r=t[n.Zone.__symbol__(e)]),r||(r=t[e]),r}let P,U=!1;function $(t){U=t}function z(t){return function(){return B(t,this,arguments)}}function B(t,e,n){try{return t.apply(e,n)}catch(t){V(t)}}function V(t){if(F(t),P)try{P(t)}catch(t){F(t)}}function F(...t){U&&o.error("[MONITOR]",...t)}function j(t,e){return D(M(),"setTimeout")(z(t),e)}function q(t){D(M(),"clearTimeout")(t)}function H(t,e){return D(M(),"setInterval")(z(t),e)}function G(t){D(M(),"clearInterval")(t)}class W{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.observers.push(t),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter((e=>t!==e)),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(t){this.observers.forEach((e=>e(t)))}}function K(...t){return new W((e=>{const n=t.map((t=>t.subscribe((t=>e.notify(t)))));return()=>n.forEach((t=>t.unsubscribe()))}))}function J(t,e,n){const r=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing;let i,s,a=!1;return{throttled:(...n)=>{a?i=n:(r?t(...n):i=n,a=!0,s=j((()=>{o&&i&&t(...i),a=!1,i=void 0}),e))},cancel:()=>{q(s),a=!1,i=void 0}}}function X(){}function Y(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,Y)}const Z=/([\w-]+)\s*=\s*([^;]+)/g;function Q(t,e){for(Z.lastIndex=0;;){const n=Z.exec(t);if(!n)break;if(n[1]===e)return n[2]}}function tt(t,e,n=""){const r=t.charCodeAt(e-1),o=r>=55296&&r<=56319?e+1:e;return t.length<=o?t:`${t.slice(0,o)}${n}`}let et,nt,rt;function ot(){return null!=et?et:et=function(t=window){var e;const n=t.navigator.userAgent;if(t.chrome||/HeadlessChrome/.test(n))return 0;if(0===(null===(e=t.navigator.vendor)||void 0===e?void 0:e.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n))return 1;return 2}()}function it(t,e,n=0,r){const o=new Date;o.setTime(o.getTime()+n);const i=`expires=${o.toUTCString()}`,s=r&&r.crossSite?"none":"strict",a=r&&r.domain?`;domain=${r.domain}`:"",c=r&&r.secure?";secure":"",u=r&&r.partitioned?";partitioned":"";document.cookie=`${t}=${e};${i};path=/;samesite=${s}${a}${c}${u}`}function st(t){return Q(document.cookie,t)}function at(t){return nt||(nt=function(t){const e=new Map;for(Z.lastIndex=0;;){const n=Z.exec(t);if(!n)break;e.set(n[1],n[2])}return e}(document.cookie)),nt.get(t)}function ct(t,e){it(t,"",0,e)}const ut="_dd_s";function lt(t){return Object.values(t)}function dt(t){return Object.entries(t)}function ft(t){return null===t?"null":Array.isArray(t)?"array":typeof t}function pt(t){const e={...t};return["id","name","email"].forEach((t=>{t in e&&(e[t]=String(e[t]))})),e}const ht=144e5,mt=9e5,gt=h,vt="cookie",yt="local-storage",_t=/^([a-zA-Z]+)=([a-z0-9-]+)$/;function bt(t,e){const n={isExpired:"1"};return e.trackAnonymousUser&&((null==t?void 0:t.anonymousId)?n.anonymousId=null==t?void 0:t.anonymousId:n.anonymousId=Math.floor(Math.random()*Math.pow(36,10)).toString(36).padStart(10,"0")),n}function wt(t){return L(t)}function St(t){return!wt(t)}function kt(t){return void 0!==t.isExpired||!((void 0===(e=t).created||y()-Number(e.created)<ht)&&(void 0===e.expire||y()<Number(e.expire)));var e}function Ct(t){t.expire=String(y()+mt)}function xt(t){return dt(t).map((([t,e])=>"anonymousId"===t?`aid=${e}`:`${t}=${e}`)).join("&")}function Tt(t){const e={};return function(t){return!!t&&(-1!==t.indexOf("&")||_t.test(t))}(t)&&t.split("&").forEach((t=>{const n=_t.exec(t);if(null!==n){const[,t,r]=n;"aid"===t?e.anonymousId=r:e[t]=r}})),e}function Et(t){const e=function(t){const e={};e.secure=!!t.useSecureSessionCookie||!!t.usePartitionedCrossSiteSessionCookie,e.crossSite=!!t.usePartitionedCrossSiteSessionCookie,e.partitioned=!!t.usePartitionedCrossSiteSessionCookie,t.trackSessionAcrossSubdomains&&(e.domain=function(){if(void 0===rt){const t=`dd_site_test_${Y()}`,e="test",n=window.location.hostname.split(".");let r=n.pop();for(;n.length&&!st(t);)r=`${n.pop()}.${r}`,it(t,e,f,{domain:r});ct(t,{domain:r}),rt=r}return rt}());return e}(t);return function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{const e=`dd_cookie_test_${Y()}`,n="test";it(e,n,p,t);const r=st(e)===n;return ct(e,t),r}catch(t){return o.error(t),!1}}(e)?{type:vt,cookieOptions:e}:void 0}function At(t,e){const n={isLockEnabled:0===ot(),persistSession:(r=e,t=>{it(ut,xt(t),mt,r)}),retrieveSession:Rt,expireSession:n=>function(t,e,n){const r=bt(e,n);it(ut,xt(r),n.trackAnonymousUser?gt:ht,t)}(e,n,t)};var r;return function(t){if(!at(ut)){const e=at("_dd"),n=at("_dd_r"),r=at("_dd_l"),o={};e&&(o.id=e),r&&/^[01]$/.test(r)&&(o.logs=r),n&&/^[012]$/.test(n)&&(o.rum=n),St(o)&&(Ct(o),t.persistSession(o))}}(n),n}function Rt(){return Tt(st(ut))}function It(){try{const t=Y(),e=`_dd_test_${t}`;localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),t===n?{type:yt}:void 0}catch(t){return}}function Nt(t){return{isLockEnabled:!1,persistSession:Ot,retrieveSession:Lt,expireSession:e=>function(t,e){Ot(bt(t,e))}(e,t)}}function Ot(t){localStorage.setItem(ut,xt(t))}function Lt(){return Tt(localStorage.getItem(ut))}const Mt=[];let Dt;function Pt(t,e,n=0){var r;const{isLockEnabled:o,persistSession:i,expireSession:s}=e,a=t=>i({...t,lock:u}),c=()=>{const t=e.retrieveSession(),n=t.lock;return t.lock&&delete t.lock,{session:t,lock:n}};if(Dt||(Dt=t),t!==Dt)return void Mt.push(t);if(o&&n>=100)return void $t(e);let u,l=c();if(o){if(l.lock)return void Ut(t,e,n);if(u=Y(),a(l.session),l=c(),l.lock!==u)return void Ut(t,e,n)}let d=t.process(l.session);if(o&&(l=c(),l.lock!==u))Ut(t,e,n);else{if(d&&(kt(d)?s(d):(Ct(d),o?a(d):i(d))),o&&(!d||!kt(d))){if(l=c(),l.lock!==u)return void Ut(t,e,n);i(l.session),d=l.session}null===(r=t.after)||void 0===r||r.call(t,d||l.session),$t(e)}}function Ut(t,e,n){j((()=>{Pt(t,e,n+1)}),10)}function $t(t){Dt=void 0;const e=Mt.shift();e&&Pt(e,t)}const zt=f;function Bt(t){switch(t.sessionPersistence){case vt:return Et(t);case yt:return It();case void 0:{let e=Et(t);return!e&&t.allowFallbackToLocalStorage&&(e=It()),e}default:o.error(`Invalid session persistence '${String(t.sessionPersistence)}'`)}}function Vt(t,e,n,r){const o=new W,i=new W,s=new W,a=t.type===vt?At(e,t.cookieOptions):Nt(e),{expireSession:c}=a,u=H((function(){Pt({process:t=>kt(t)?bt(t,e):void 0,after:p},a)}),zt);let l;h();const{throttled:d,cancel:f}=J((()=>{Pt({process:t=>{if(wt(t))return;const e=p(t);return function(t){if(wt(t))return!1;const{trackingType:e,isTracked:o}=r(t[n]);t[n]=e,delete t.isExpired,o&&!t.id&&(t.id=Y(),t.created=String(y()))}(e),e},after:t=>{St(t)&&!m()&&function(t){l=t,o.notify()}(t),l=t}},a)}),zt);function p(t){return kt(t)&&(t=bt(t,e)),m()&&(!function(t){return l.id!==t.id||l[n]!==t[n]}(t)?(s.notify({previousState:l,newState:t}),l=t):(l=bt(l,e),i.notify())),t}function h(){Pt({process:t=>{if(wt(t))return bt(t,e)},after:t=>{l=t}},a)}function m(){return void 0!==l[n]}return{expandOrRenewSession:d,expandSession:function(){Pt({process:t=>m()?p(t):void 0},a)},getSession:()=>l,renewObservable:o,expireObservable:i,sessionStateUpdateObservable:s,restartSession:h,expire:()=>{f(),c(l),p(bt(l,e))},stop:()=>{G(u)},updateSessionState:function(t){Pt({process:e=>({...e,...t}),after:p},a)}}}const Ft={GRANTED:"granted",NOT_GRANTED:"not-granted"};function jt(t,e,n){if("object"!=typeof t||null===t)return JSON.stringify(t);const r=qt(Object.prototype),o=qt(Array.prototype),i=qt(Object.getPrototypeOf(t)),s=qt(t);try{return JSON.stringify(t,e,n)}catch(t){return"<error: unable to serialize object>"}finally{r(),o(),i(),s()}}function qt(t){const e=t,n=e.toJSON;return n?(delete e.toJSON,()=>{e.toJSON=n}):X}function Ht(t){return Gt(t,location.href).href}function Gt(t,e){const n=function(){if(void 0===Kt)try{const t=new Wt("http://test/path");Kt="http://test/path"===t.href}catch(t){Kt=!1}return Kt?Wt:void 0}();if(n)try{return void 0!==e?new n(t,e):new n(t)}catch(n){throw new Error(`Failed to construct URL: ${String(n)} ${jt({url:t,base:e})}`)}if(void 0===e&&!/:/.test(t))throw new Error(`Invalid URL: '${t}'`);let r=document;const o=r.createElement("a");if(void 0!==e){r=document.implementation.createHTMLDocument("");const t=r.createElement("base");t.href=e,r.head.appendChild(t),r.body.appendChild(o)}return o.href=t,o}const Wt=URL;let Kt;const Jt="datad0g.com",Xt="dd0g-gov.com",Yt="datadoghq.com",Zt="datadoghq.eu",Qt="pci.browser-intake-datadoghq.com",te=["ddsource","ddtags"];function ee(t,e,n){const r=function(t,e){const n=`/api/v2/${e}`,r=t.proxy;if("string"==typeof r){const t=Ht(r);return e=>`${t}?ddforward=${encodeURIComponent(`${n}?${e}`)}`}if("function"==typeof r)return t=>r({path:n,parameters:t});const o=function(t,e){const{site:n=Yt,internalAnalyticsSubdomain:r}=e;if("logs"===t&&e.usePciIntake&&n===Yt)return Qt;if(r&&n===Yt)return`${r}.${Yt}`;if(n===Xt)return`http-intake.logs.${n}`;const o=n.split("."),i=o.pop();return`browser-intake-${o.join("-")}.${i}`}(e,t);return t=>`https://${o}${n}?${t}`}(t,e);return{build(o,i){const s=function({clientToken:t,internalAnalyticsSubdomain:e},n,r,o,{retry:i,encoding:s}){const a=["sdk_version:6.0.0",`api:${o}`].concat(r);i&&a.push(`retry_count:${i.count}`,`retry_after:${i.lastFailureStatus}`);const c=["ddsource=browser",`ddtags=${encodeURIComponent(a.join(","))}`,`dd-api-key=${t}`,`dd-evp-origin-version=${encodeURIComponent("6.0.0")}`,"dd-evp-origin=browser",`dd-request-id=${Y()}`];s&&c.push(`dd-evp-encoding=${s}`);"rum"===n&&c.push(`batch_time=${_()}`);e&&c.reverse();return c.join("&")}(t,e,n,o,i);return r(s)},urlPrefix:r(""),trackType:e}}function ne(t,e){const n=200-t.length-1;(e.length>n||function(t){if(!function(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch(t){return!1}}())return!1;return new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(t)}(e))&&o.warn(`${t} value doesn't meet tag requirements and will be sanitized. ${a} ${i}/getting_started/tagging/#defining-tags`);return`${t}:${e.replace(/,/g,"_")}`}function re(t){const e=t.site||Yt,n=function(t){const{env:e,service:n,version:r,datacenter:o}=t,i=[];return e&&i.push(ne("env",e)),n&&i.push(ne("service",n)),r&&i.push(ne("version",r)),o&&i.push(ne("datacenter",o)),i}(t),r=function(t,e){return{logsEndpointBuilder:ee(t,"logs",e),rumEndpointBuilder:ee(t,"rum",e),sessionReplayEndpointBuilder:ee(t,"replay",e)}}(t,n),o=function(t,e){if(!t.replica)return;const n={...t,site:Yt,clientToken:t.replica.clientToken},r={logsEndpointBuilder:ee(n,"logs",e),rumEndpointBuilder:ee(n,"rum",e)};return{applicationId:t.replica.applicationId,...r}}(t,n);return{replica:o,site:e,...r}}const oe={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},ie={ALL:"all",SAMPLED:"sampled"};function se(t,e){return null==t||"string"==typeof t||(o.error(`${e} must be defined as a string`),!1)}function ae(t,e){return!!(void 0===t||(n=t,d(n)&&n>=0&&n<=100))||(o.error(`${e} Sample Rate should be a number between 0 and 100`),!1);var n}function ce(t){var e,n,r,s,u,l;if(t&&t.clientToken){if((!(d=t.site)||"string"!=typeof d||/(datadog|ddog|datad0g|dd0g)/.test(d)||(o.error(`Site should be a valid Datadog site. ${a} ${i}/getting_started/site/.`),0))&&ae(t.sessionSampleRate,"Session")&&ae(t.telemetrySampleRate,"Telemetry")&&ae(t.telemetryConfigurationSampleRate,"Telemetry Configuration")&&ae(t.telemetryUsageSampleRate,"Telemetry Usage")&&se(t.version,"Version")&&se(t.env,"Env")&&se(t.service,"Service")){var d;if(void 0===t.trackingConsent||O(Ft,t.trackingConsent))return{beforeSend:t.beforeSend&&c(t.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Bt(t),sessionSampleRate:null!==(e=t.sessionSampleRate)&&void 0!==e?e:100,telemetrySampleRate:null!==(n=t.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=t.telemetryConfigurationSampleRate)&&void 0!==r?r:5,telemetryUsageSampleRate:null!==(s=t.telemetryUsageSampleRate)&&void 0!==s?s:5,service:t.service||void 0,silentMultipleInit:!!t.silentMultipleInit,allowUntrustedEvents:!!t.allowUntrustedEvents,trackingConsent:null!==(u=t.trackingConsent)&&void 0!==u?u:Ft.GRANTED,trackAnonymousUser:null===(l=t.trackAnonymousUser)||void 0===l||l,storeContextsAcrossPages:!!t.storeContextsAcrossPages,batchBytesLimit:16384,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:3e4,batchMessagesLimit:50,messageBytesLimit:262144,...re(t)};o.error('Tracking Consent should be either "granted" or "not-granted"')}}else o.error("Client Token is not configured, we will not send any data.")}var ue;!function(t){t.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",t.REMOTE_CONFIGURATION="remote_configuration",t.ACTION_NAME_MASKING="action_name_masking",t.CONSISTENT_TRACE_SAMPLING="consistent_trace_sampling",t.DELAY_VIEWPORT_COLLECTION="delay_viewport_collection"}(ue||(ue={}));const le=new Set;function de(t){Array.isArray(t)&&t.filter((t=>O(ue,t))).forEach((t=>{le.add(t)}))}function fe(t){return le.has(t)}function pe(){return le}const he="?";function me(t){const e=[];let n=Ce(t,"stack");const r=String(t);return n&&n.startsWith(r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((t=>{const n=function(t){const e=ye.exec(t);if(!e)return;const n=e[2]&&0===e[2].indexOf("native"),r=e[2]&&0===e[2].indexOf("eval"),o=_e.exec(e[2]);r&&o&&(e[2]=o[1],e[3]=o[2],e[4]=o[3]);return{args:n?[e[2]]:[],column:e[4]?+e[4]:void 0,func:e[1]||he,line:e[3]?+e[3]:void 0,url:n?void 0:e[2]}}(t)||function(t){const e=be.exec(t);if(!e)return;return{args:[],column:e[3]?+e[3]:void 0,func:he,line:e[2]?+e[2]:void 0,url:e[1]}}(t)||function(t){const e=we.exec(t);if(!e)return;return{args:[],column:e[4]?+e[4]:void 0,func:e[1]||he,line:+e[3],url:e[2]}}(t)||function(t){const e=Se.exec(t);if(!e)return;const n=e[3]&&e[3].indexOf(" > eval")>-1,r=ke.exec(e[3]);n&&r&&(e[3]=r[1],e[4]=r[2],e[5]=void 0);return{args:e[2]?e[2].split(","):[],column:e[5]?+e[5]:void 0,func:e[1]||he,line:e[4]?+e[4]:void 0,url:e[3]}}(t);n&&(!n.func&&n.line&&(n.func=he),e.push(n))})),{message:Ce(t,"message"),name:Ce(t,"name"),stack:e}}const ge="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",ve="(?::(\\d+))",ye=new RegExp(`^\\s*at (.*?) ?\\(${ge}${ve}?${ve}?\\)?\\s*$`,"i"),_e=new RegExp(`\\((\\S*)${ve}${ve}\\)`);const be=new RegExp(`^\\s*at ?${ge}${ve}?${ve}??\\s*$`,"i");const we=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;const Se=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,ke=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Ce(t,e){if("object"!=typeof t||!t||!(e in t))return;const n=t[e];return"string"==typeof n?n:void 0}function xe(t,e,n,r){const o=[{url:e,column:r,line:n}],{name:i,message:s}=function(t){let e,n;"[object String]"==={}.toString.call(t)&&([,e,n]=Te.exec(t));return{name:e,message:n}}(t);return{name:i,message:s,stack:o}}const Te=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Ee(){const t=new Error;let e;return B((()=>{const n=me(t);n.stack=n.stack.slice(2),e=Ae(n)})),e}function Ae(t){let e=Re(t);return t.stack.forEach((t=>{const n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?`(${t.args.join(", ")})`:"",o=t.line?`:${t.line}`:"",i=t.line&&t.column?`:${t.column}`:"";e+=`\n at ${n}${r} @ ${t.url}${o}${i}`})),e}function Re(t){return`${t.name||"Error"}: ${t.message}`}function Ie(t,e,n,{computeHandlingStack:r}={}){let o=t[e];if("function"!=typeof o){if(!(e in t)||!e.startsWith("on"))return{stop:X};o=X}let i=!1;const s=function(){if(i)return o.apply(this,arguments);const t=Array.from(arguments);let e;B(n,null,[{target:this,parameters:t,onPostCall:t=>{e=t},handlingStack:r?Ee():void 0}]);const s=o.apply(this,t);return e&&B(e,null,[s]),s};return t[e]=s,{stop:()=>{i=!0,t[e]===s&&(t[e]=o)}}}function Ne(t,e,n){const r=Object.getOwnPropertyDescriptor(t,e);if(!r||!r.set||!r.configurable)return{stop:X};const o=X;let i=(t,e)=>{j((()=>{i!==o&&n(t,e)}),0)};const s=function(t){r.set.call(this,t),i(this,t)};return Object.defineProperty(t,e,{set:s}),{stop:()=>{var n;(null===(n=Object.getOwnPropertyDescriptor(t,e))||void 0===n?void 0:n.set)===s&&Object.defineProperty(t,e,r),i=o}}}function Oe(t,e=225280){const n=qt(Object.prototype),r=qt(Array.prototype),o=[],i=new WeakMap,s=Le(t,"$",void 0,o,i),a=JSON.stringify(s);let c=a?a.length:0;if(!(c>e)){for(;o.length>0&&c<e;){const n=o.shift();let r=0;if(Array.isArray(n.source))for(let s=0;s<n.source.length;s++){const a=Le(n.source[s],n.path,s,o,i);if(c+=void 0!==a?JSON.stringify(a).length:4,c+=r,r=1,c>e){De(e,"truncated",t);break}n.target[s]=a}else for(const s in n.source)if(Object.prototype.hasOwnProperty.call(n.source,s)){const a=Le(n.source[s],n.path,s,o,i);if(void 0!==a&&(c+=JSON.stringify(a).length+r+s.length+3,r=1),c>e){De(e,"truncated",t);break}n.target[s]=a}}return n(),r(),s}De(e,"discarded",t)}function Le(t,e,n,r,o){const i=function(t){const e=t;if(e&&"function"==typeof e.toJSON)try{return e.toJSON()}catch(t){}return t}(t);if(!i||"object"!=typeof i)return function(t){if("bigint"==typeof t)return`[BigInt] ${t.toString()}`;if("function"==typeof t)return`[Function] ${t.name||"unknown"}`;if("symbol"==typeof t)return`[Symbol] ${t.description||t.toString()}`;return t}(i);const s=Me(i);if("[Object]"!==s&&"[Array]"!==s&&"[Error]"!==s)return s;const a=t;if(o.has(a))return`[Reference seen at ${o.get(a)}]`;const c=void 0!==n?`${e}.${n}`:e,u=Array.isArray(i)?[]:{};return o.set(a,c),r.push({source:i,target:u,path:c}),u}function Me(t){try{if(t instanceof Event)return{type:(e=t).type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?Me(e.currentTarget):null,target:e.target?Me(e.target):null};if(t instanceof RegExp)return`[RegExp] ${t.toString()}`;const n=Object.prototype.toString.call(t).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch(t){}var e;return"[Unserializable]"}function De(t,e,n){o.warn(`The data provided has been ${e} as it is over the limit of ${t} characters:`,n)}const Pe="No stack, consider using an instance of Error";function Ue({stackTrace:t,originalError:e,handlingStack:n,startClocks:r,nonErrorPrefix:o,source:i,handling:s}){const a=ze(e),c=function(t,e,n,r){return(null==t?void 0:t.message)&&(null==t?void 0:t.name)?t.message:e?"Empty message":`${n} ${jt(Oe(r))}`}(t,a,o,e),u=function(t,e){if(void 0===e)return!1;if(t)return!0;return e.stack.length>0&&(e.stack.length>1||void 0!==e.stack[0].url)}(a,t)?Ae(t):Pe,l=a?Be(e,i):void 0;return{startClocks:r,source:i,handling:s,handlingStack:n,originalError:e,type:t?t.name:void 0,message:c,stack:u,causes:l,fingerprint:$e(e)}}function $e(t){return ze(t)&&"dd_fingerprint"in t?String(t.dd_fingerprint):void 0}function ze(t){return t instanceof Error||"[object Error]"===Object.prototype.toString.call(t)}function Be(t,e){let n=t;const r=[];for(;ze(null==n?void 0:n.cause)&&r.length<10;){const t=me(n.cause);r.push({message:n.cause.message,source:e,type:null==t?void 0:t.name,stack:t&&Ae(t)}),n=n.cause}return r.length?r:void 0}const Ve="agent",Fe="console",je="custom",qe="source",He="report";function Ge(t){const e=(e,n)=>{const r=Ue({stackTrace:e,originalError:n,startClocks:w(),nonErrorPrefix:"Uncaught",source:qe,handling:"unhandled"});t.notify(r)},{stop:n}=(r=e,Ie(window,"onerror",(({parameters:[t,e,n,o,i]})=>{let s;s=ze(i)?me(i):xe(t,e,n,o),r(s,null!=i?i:t)})));var r;const{stop:o}=function(t){return Ie(window,"onunhandledrejection",(({parameters:[e]})=>{const n=e.reason||"Empty reason",r=me(n);t(r,n)}))}(e);return{stop:()=>{n(),o()}}}function We(t,e){e.silentMultipleInit||o.error(`${t} is already initialized.`)}function Ke(t,e,n,r,o){return Je(t,e,[n],r,o)}function Je(t,e,n,r,{once:o,capture:i,passive:s}={}){const a=z((e=>{(e.isTrusted||e.__ddIsTrusted||t.allowUntrustedEvents)&&(o&&d(),r(e))})),c=s?{capture:i,passive:s}:i,u=window.EventTarget&&e instanceof EventTarget?window.EventTarget.prototype:e,l=D(u,"addEventListener");function d(){const t=D(u,"removeEventListener");n.forEach((n=>t.call(e,n,a,c)))}return n.forEach((t=>l.call(e,t,a,c))),{stop:d}}const Xe="intervention",Ye="csp_violation";function Ze(t,e){const n=[];e.includes(Ye)&&n.push(function(t){return new W((e=>{const{stop:n}=Ke(t,document,"securitypolicyviolation",(t=>{e.notify(function(t){const e=`'${t.blockedURI}' blocked by '${t.effectiveDirective}' directive`;return Qe({type:t.effectiveDirective,message:`${Ye}: ${e}`,originalError:t,csp:{disposition:t.disposition},stack:tn(t.effectiveDirective,t.originalPolicy?`${e} of the policy "${tt(t.originalPolicy,100,"...")}"`:"no policy",t.sourceFile,t.lineNumber,t.columnNumber)})}(t))}));return n}))}(t));const r=e.filter((t=>t!==Ye));return r.length&&n.push(function(t){return new W((e=>{if(!window.ReportingObserver)return;const n=z(((t,n)=>t.forEach((t=>e.notify(function(t){const{type:e,body:n}=t;return Qe({type:n.id,message:`${e}: ${n.message}`,originalError:t,stack:tn(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}(t)))))),r=new window.ReportingObserver(n,{types:t,buffered:!0});return r.observe(),()=>{r.disconnect()}}))}(r)),K(...n)}function Qe(t){return{startClocks:w(),source:He,handling:"unhandled",...t}}function tn(t,e,n,r,o){return n?Ae({name:t,message:e,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=o?o:void 0}]}):void 0}function en(t,e){const n=window.__ddBrowserSdkExtensionCallback;n&&n({type:t,payload:e})}function nn(t,e,n=function(){if("undefined"!=typeof WeakSet){const t=new WeakSet;return{hasAlreadyBeenSeen(e){const n=t.has(e);return n||t.add(e),n}}}const t=[];return{hasAlreadyBeenSeen(e){const n=t.indexOf(e)>=0;return n||t.push(e),n}}}()){if(void 0===e)return t;if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){const t=e.flags||[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.sticky?"y":"",e.unicode?"u":""].join("");return new RegExp(e.source,t)}if(n.hasAlreadyBeenSeen(e))return;if(Array.isArray(e)){const r=Array.isArray(t)?t:[];for(let t=0;t<e.length;++t)r[t]=nn(r[t],e[t],n);return r}const r="object"===ft(t)?t:{};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=nn(r[t],e[t],n));return r}function rn(t){return nn(void 0,t)}function on(...t){let e;for(const n of t)null!=n&&(e=nn(e,n));return e}function sn(){var t;const e=window.navigator;return{status:e.onLine?"connected":"not_connected",interfaces:e.connection&&e.connection.type?[e.connection.type]:void 0,effective_type:null===(t=e.connection)||void 0===t?void 0:t.effectiveType}}function an(t,e){const n=t.indexOf(e);n>=0&&t.splice(n,1)}function cn(){const t=[];return{add:e=>{t.push(e)>500&&t.splice(0,1)},remove:e=>{an(t,e)},drain:e=>{t.forEach((t=>t(e))),t.length=0}}}const un="log",ln="configuration",dn="usage",fn=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],pn=["ddog-gov.com"];let hn=cn(),mn=t=>{hn.add((()=>mn(t)))};function gn(t,e){let n;const r=new W,o=new Set,i=!pn.includes(e.site)&&u(e.telemetrySampleRate),s={[un]:i,[ln]:i&&u(e.telemetryConfigurationSampleRate),[dn]:i&&u(e.telemetryUsageSampleRate)},a={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return mn=i=>{const c=jt(i);if(s[i.type]&&o.size<e.maxTelemetryEventsPerPage&&!o.has(c)){const e=function(t,e,r){return on({type:"telemetry",date:_(),service:t,version:"6.0.0",source:"browser",_dd:{format_version:2},telemetry:on(e,{runtime_env:r,connectivity:sn(),sdk_setup:"npm"}),experimental_features:Array.from(pe())},void 0!==n?n():{})}(t,i,a);r.notify(e),en("telemetry",e),o.add(c)}},P=yn,{setContextProvider:t=>{n=t},observable:r,enabled:i}}function vn(e,n){F(t.debug,e,n),mn({type:un,message:e,status:"debug",...n})}function yn(t,e){mn({type:un,status:"error",...bn(t),...e})}function _n(t){mn({type:dn,usage:t})}function bn(t){if(ze(t)){const e=me(t);return{error:{kind:e.name,stack:Ae(wn(e))},message:e.message}}return{error:{stack:Pe},message:`Uncaught ${jt(t)}`}}function wn(t){return t.stack=t.stack.filter((t=>!t.url||fn.some((e=>t.url.startsWith(e))))),t}const Sn=1/0;function kn({expireDelay:t,maxEntries:e}){let n=[];const r=H((()=>function(){const e=b()-t;for(;n.length>0&&n[n.length-1].endTime<e;)n.pop()}()),6e4);return{add:function(t,r){const o={value:t,startTime:r,endTime:Sn,remove:()=>{an(n,o)},close:t=>{o.endTime=t}};return e&&n.length>=e&&n.pop(),n.unshift(o),o},find:function(t=Infinity,e={returnInactive:!1}){for(const r of n)if(r.startTime<=t){if(e.returnInactive||t<=r.endTime)return r.value;break}},closeActive:function(t){const e=n[0];e&&e.endTime===Sn&&e.close(t)},findAll:function(t=Infinity,e=0){const r=C(t,e);return n.filter((e=>e.startTime<=r&&t<=e.endTime)).map((t=>t.value))},reset:function(){n=[]},stop:function(){G(r)}}}const Cn=p,xn=ht;function Tn(t,e,n,r){const o=new W,i=new W,s=Vt(t.sessionStoreStrategyType,t,e,n),a=kn({expireDelay:xn});function c(){return{id:s.getSession().id,trackingType:s.getSession()[e],isReplayForced:!!s.getSession().forcedReplay,anonymousId:s.getSession().anonymousId}}return s.renewObservable.subscribe((()=>{a.add(c(),b()),o.notify()})),s.expireObservable.subscribe((()=>{i.notify(),a.closeActive(b())})),s.expandOrRenewSession(),a.add(c(),S().relative),r.observable.subscribe((()=>{r.isGranted()?s.expandOrRenewSession():s.expire()})),function(t,e){const{stop:n}=Je(t,window,["click","touchstart","keydown","scroll"],e,{capture:!0,passive:!0})}(t,(()=>{r.isGranted()&&s.expandOrRenewSession()})),function(t,e){const n=()=>{"visible"===document.visibilityState&&e()},{stop:r}=Ke(t,document,"visibilitychange",n);H(n,Cn)}(t,(()=>s.expandSession())),function(t,e){const{stop:n}=Ke(t,window,"resume",e,{capture:!0})}(t,(()=>s.restartSession())),{findSession:(t,e)=>a.find(t,e),renewObservable:o,expireObservable:i,sessionStateUpdateObservable:s.sessionStateUpdateObservable,expire:s.expire,updateSessionState:s.updateSessionState}}const En=3145728,An=f;function Rn(t,e,n,r,o){0===e.transportStatus&&0===e.queuedPayloads.size()&&e.bandwidthMonitor.canHandle(t)?Nn(t,e,n,{onSuccess:()=>On(0,e,n,r,o),onFailure:()=>{e.queuedPayloads.enqueue(t),In(e,n,r,o)}}):e.queuedPayloads.enqueue(t)}function In(t,e,n,r){2===t.transportStatus&&j((()=>{Nn(t.queuedPayloads.first(),t,e,{onSuccess:()=>{t.queuedPayloads.dequeue(),t.currentBackoffTime=An,On(1,t,e,n,r)},onFailure:()=>{t.currentBackoffTime=Math.min(6e4,2*t.currentBackoffTime),In(t,e,n,r)}})}),t.currentBackoffTime)}function Nn(t,e,n,{onSuccess:r,onFailure:o}){e.bandwidthMonitor.add(t),n(t,(n=>{e.bandwidthMonitor.remove(t),!function(t){return"opaque"!==t.type&&(0===t.status&&!navigator.onLine||408===t.status||429===t.status||(e=t.status,e>=500));var e}(n)?(e.transportStatus=0,r()):(e.transportStatus=e.bandwidthMonitor.ongoingRequestCount>0?1:2,t.retry={count:t.retry?t.retry.count+1:1,lastFailureStatus:n.status},o())}))}function On(t,e,n,r,o){0===t&&e.queuedPayloads.isFull()&&!e.queueFullReported&&(o({message:`Reached max ${r} events size queued for upload: 3MiB`,source:Ve,startClocks:w()}),e.queueFullReported=!0);const i=e.queuedPayloads;for(e.queuedPayloads=Ln();i.size()>0;)Rn(i.dequeue(),e,n,r,o)}function Ln(){const t=[];return{bytesCount:0,enqueue(e){this.isFull()||(t.push(e),this.bytesCount+=e.bytesCount)},first:()=>t[0],dequeue(){const e=t.shift();return e&&(this.bytesCount-=e.bytesCount),e},size:()=>t.length,isFull(){return this.bytesCount>=En}}}function Mn(t,e,n){const r={transportStatus:0,currentBackoffTime:An,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle(t){return 0===this.ongoingRequestCount||this.ongoingByteCount+t.bytesCount<=81920&&this.ongoingRequestCount<32},add(t){this.ongoingRequestCount+=1,this.ongoingByteCount+=t.bytesCount},remove(t){this.ongoingRequestCount-=1,this.ongoingByteCount-=t.bytesCount}},queuedPayloads:Ln(),queueFullReported:!1},o=(n,r)=>function(t,e,n,r){const o=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(t){return!1}}()&&n.bytesCount<e;if(o){const e=t.build("fetch",n);fetch(e,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(z((t=>null==r?void 0:r({status:t.status,type:t.type}))),z((()=>{Pn(t.build("xhr",n),n.data,r)})))}else{Pn(t.build("xhr",n),n.data,r)}}(t,e,n,r);return{send:e=>{Rn(e,r,o,t.trackType,n)},sendOnExit:n=>{!function(t,e,n){const r=!!navigator.sendBeacon&&n.bytesCount<e;if(r)try{const e=t.build("beacon",n);if(navigator.sendBeacon(e,n.data))return}catch(t){!function(t){Dn||(Dn=!0,yn(t))}(t)}const o=t.build("xhr",n);Pn(o,n.data)}(t,e,n)}}}let Dn=!1;function Pn(t,e,n){const r=new XMLHttpRequest;r.open("POST",t,!0),e instanceof Blob&&r.setRequestHeader("Content-Type",e.type),Ke({allowUntrustedEvents:!0},r,"loadend",(()=>{null==n||n({status:r.status})}),{once:!0}),r.send(e)}function Un(){const t=M().DatadogEventBridge;if(t)return{getCapabilities(){var e;return JSON.parse((null===(e=t.getCapabilities)||void 0===e?void 0:e.call(t))||"[]")},getPrivacyLevel(){var e;return null===(e=t.getPrivacyLevel)||void 0===e?void 0:e.call(t)},getAllowedWebViewHosts:()=>JSON.parse(t.getAllowedWebViewHosts()),send(e,n,r){const o=r?{id:r}:void 0;t.send(JSON.stringify({eventType:e,event:n,view:o}))}}}function $n(t){const e=Un();return!!e&&e.getCapabilities().includes(t)}function zn(t){var e;void 0===t&&(t=null===(e=M().location)||void 0===e?void 0:e.hostname);const n=Un();return!!n&&n.getAllowedWebViewHosts().some((e=>t===e||t.endsWith(`.${e}`)))}const Bn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Vn(t){return lt(Bn).includes(t)}function Fn({encoder:t,request:e,flushController:n,messageBytesLimit:r}){let i={};const c=n.flushObservable.subscribe((n=>function(n){const r=lt(i).join("\n");i={};const o=Vn(n.reason),s=o?e.sendOnExit:e.send;if(o&&t.isAsync){const e=t.finishSync();e.outputBytesCount&&s(jn(e));const n=[e.pendingData,r].filter(Boolean).join("\n");n&&s({data:n,bytesCount:I(n)})}else r&&t.write(t.isEmpty?r:`\n${r}`),t.finish((t=>{s(jn(t))}))}(n)));function u(e,c){const u=jt(e),l=t.estimateEncodedBytesCount(u);l>=r?o.warn(`Discarded a message whose size was bigger than the maximum allowed size ${r}KB. ${a} ${s}/#technical-limitations`):(function(t){return void 0!==t&&void 0!==i[t]}(c)&&function(e){const r=i[e];delete i[e];const o=t.estimateEncodedBytesCount(r);n.notifyAfterRemoveMessage(o)}(c),function(e,r,o){n.notifyBeforeAddMessage(r),void 0!==o?(i[o]=e,n.notifyAfterAddMessage()):t.write(t.isEmpty?e:`\n${e}`,(t=>{n.notifyAfterAddMessage(t-r)}))}(u,l,c))}return{flushController:n,add:u,upsert:u,stop:c.unsubscribe}}function jn(t){let e;return e="string"==typeof t.output?t.output:new Blob([t.output],{type:"text/plain"}),{data:e,bytesCount:t.outputBytesCount,encoding:t.encoding}}function qn({messagesLimit:t,bytesLimit:e,durationLimit:n,pageExitObservable:r,sessionExpireObservable:o}){const i=r.subscribe((t=>d(t.reason))),s=o.subscribe((()=>d("session_expire"))),a=new W((()=>()=>{i.unsubscribe(),s.unsubscribe()}));let c,u=0,l=0;function d(t){if(0===l)return;const e=l,n=u;l=0,u=0,f(),a.notify({reason:t,messagesCount:e,bytesCount:n})}function f(){q(c),c=void 0}return{flushObservable:a,get messagesCount(){return l},notifyBeforeAddMessage(t){u+t>=e&&d("bytes_limit"),l+=1,u+=t,void 0===c&&(c=j((()=>{d("duration_limit")}),n))},notifyAfterAddMessage(n=0){u+=n,l>=t?d("messages_limit"):u>=e&&d("bytes_limit")},notifyAfterRemoveMessage(t){u-=t,l-=1,0===l&&f()}}}function Hn(){let t="",e=0;return{isAsync:!1,get isEmpty(){return!t},write(n,r){const o=I(n);e+=o,t+=n,r&&r(o)},finish(t){t(this.finishSync())},finishSync(){const n={output:t,outputBytesCount:e,rawBytesCount:e,pendingData:""};return t="",e=0,n},estimateEncodedBytesCount:t=>t.length}}function Gn(t,e,n){let r=0,o=!1;return{isLimitReached(){if(0===r&&j((()=>{r=0}),p),r+=1,r<=e||o)return o=!1,!1;if(r===e+1){o=!0;try{n({message:`Reached max number of ${t}s by minute: ${e}`,source:Ve,startClocks:w()})}finally{o=!1}}return!0}}}function Wn(t,e,n){if(document.readyState===e||"complete"===document.readyState)return n(),{stop:X};return Ke(t,window,"complete"===e?"load":"DOMContentLoaded",n,{once:!0})}function Kn(t,e){return new Promise((n=>{Wn(t,e,n)}))}let Jn;const Xn=new WeakMap;function Yn(t){return Jn||(Jn=function(t){return new W((e=>{const{stop:n}=Ie(XMLHttpRequest.prototype,"open",Zn),{stop:r}=Ie(XMLHttpRequest.prototype,"send",(n=>{!function({target:t,handlingStack:e},n,r){const o=Xn.get(t);if(!o)return;const i=o;i.state="start",i.startClocks=w(),i.isAborted=!1,i.xhr=t,i.handlingStack=e;let s=!1;const{stop:a}=Ie(t,"onreadystatechange",(()=>{t.readyState===XMLHttpRequest.DONE&&c()})),c=()=>{if(u(),a(),s)return;s=!0;const e=o;e.state="complete",e.duration=k(i.startClocks.timeStamp,_()),e.status=t.status,r.notify(N(e))},{stop:u}=Ke(n,t,"loadend",c);r.notify(i)}(n,t,e)}),{computeHandlingStack:!0}),{stop:o}=Ie(XMLHttpRequest.prototype,"abort",Qn);return()=>{n(),r(),o()}}))}(t)),Jn}function Zn({target:t,parameters:[e,n]}){Xn.set(t,{state:"open",method:String(e).toUpperCase(),url:Ht(String(n))})}function Qn({target:t}){const e=Xn.get(t);e&&(e.isAborted=!0)}let tr;function er(){return tr||(tr=new W((t=>{if(!window.fetch)return;const{stop:e}=Ie(window,"fetch",(e=>function({parameters:t,onPostCall:e,handlingStack:n},r){const[o,i]=t;let s=i&&i.method;void 0===s&&o instanceof Request&&(s=o.method);const a=void 0!==s?String(s).toUpperCase():"GET",c=o instanceof Request?o.url:Ht(String(o)),u=w(),l={state:"start",init:i,input:o,method:a,startClocks:u,url:c,handlingStack:n};r.notify(l),t[0]=l.input,t[1]=l.init,e((t=>function(t,e,n){const r=n;function o(e){r.state="resolve",Object.assign(r,e),t.notify(r)}e.then(z((t=>{o({response:t,responseType:t.type,status:t.status,isAborted:!1})})),z((t=>{var e,n;o({status:0,isAborted:(null===(n=null===(e=r.init)||void 0===e?void 0:e.signal)||void 0===n?void 0:n.aborted)||t instanceof DOMException&&t.code===DOMException.ABORT_ERR,error:t})})))}(r,t,l)))}(e,t)),{computeHandlingStack:!0});return e}))),tr}function nr(t,e){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(z(t),e);return()=>window.cancelIdleCallback(n)}return function(t){const e=y(),n=j((()=>{t({didTimeout:!1,timeRemaining:()=>Math.max(0,rr-(y()-e))})}),0);return()=>q(n)}(t)}const rr=50;let or={};function ir(n){return K(...n.map((n=>(or[n]||(or[n]=function(n){return new W((r=>{const o=e[n];return e[n]=(...e)=>{o.apply(console,e);const i=Ee();B((()=>{r.notify(function(e,n,r){const o=e.map((t=>function(t){if("string"==typeof t)return Oe(t);if(ze(t))return Re(me(t));return jt(Oe(t),void 0,2)}(t))).join(" ");let i;if(n===t.error){const t=e.find(ze);i={stack:t?Ae(me(t)):void 0,fingerprint:$e(t),causes:t?Be(t,"console"):void 0,startClocks:w(),message:o,source:Fe,handling:"handled",handlingStack:r}}return{api:n,message:o,error:i,handlingStack:r}}(e,n,i))}))},()=>{e[n]=o}}))}(n)),or[n]))))}function sr(t){let e={};const n=new W,r={getContext:()=>rn(e),setContext:o=>{"object"===ft(o)?(e=Oe(o),null==t||t.updateCustomerData(e)):r.clearContext(),n.notify()},setContextProperty:(r,o)=>{e[r]=Oe(o),null==t||t.updateCustomerData(e),n.notify()},removeContextProperty:r=>{delete e[r],null==t||t.updateCustomerData(e),n.notify()},clearContext:()=>{e={},null==t||t.resetCustomerData(),n.notify()},changeObservable:n};return r}const ar="_dd_c",cr=[];function ur(t,e,n,r){const o=function(t,e){return`${ar}_${t}_${e}`}(n,r);function i(){const t=localStorage.getItem(o);return null!==t?JSON.parse(t):{}}cr.push(Ke(t,window,"storage",(({key:t})=>{o===t&&e.setContext(i())}))),e.changeObservable.subscribe((function(){localStorage.setItem(o,JSON.stringify(e.getContext()))})),e.setContext(on(i(),e.getContext()))}function lr(t=2){const e=new Map;let n=!1;function r(r=0){if(n||0===t)return;const i=2===t?3072:16384;let c=r;e.forEach((t=>{c+=t.getBytesCount()})),c>i&&(!function(t){o.warn(`Customer data exceeds the recommended ${t/A}KiB threshold. ${a} ${s}/#customer-data-exceeds-the-recommended-threshold-warning`)}(i),n=!0)}return{createDetachedTracker:()=>{const t=dr((()=>r(t.getBytesCount())));return t},getOrCreateTracker:t=>(e.has(t)||e.set(t,dr(r)),e.get(t)),setCompressionStatus:e=>{0===t&&(t=e,r())},getCompressionStatus:()=>t,stop:()=>{e.forEach((t=>t.stop())),e.clear()}}}function dr(t){let e=0;const{throttled:n,cancel:r}=J((n=>{e=I(jt(n)),t()}),200),o=()=>{r(),e=0};return{updateCustomerData:t=>{L(t)?o():n(t)},resetCustomerData:o,getBytesCount:()=>e,stop:()=>{r()}}}function fr(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||at("datadog-synthetics-injects-rum"))}function pr(t){const e=ft(t);return"string"===e||"function"===e||t instanceof RegExp}function hr(t,e,n=!1){return t.some((t=>{try{if("function"==typeof t)return t(e);if(t instanceof RegExp)return t.test(e);if("string"==typeof t)return n?e.startsWith(t):t===e}catch(t){o.error(t)}return!1}))}function mr(t,e,n){function r(n){(function(t){return!e.wasInPageStateDuringPeriod("frozen",t.startClocks.relative,t.duration)})(n)&&t.notify(11,function(t){const e={date:t.startClocks.timeStamp,vital:{id:Y(),type:t.type,name:t.name,duration:v(t.duration),description:t.description},type:"vital",_dd:{vital:{computed_value:!0}}};return{rawRumEvent:e,startTime:t.startClocks.relative,customerContext:t.context,domainContext:{}}}(n))}return{addDurationVital:r,startDurationVital:(t,e={})=>gr(n,t,e),stopDurationVital:(t,e={})=>{vr(r,n,t,e)}}}function gr({vitalsByName:t,vitalsByReference:e},n,r={}){const o={name:n,startClocks:w(),context:r.context,description:r.description},i={__dd_vital_reference:!0};return t.set(n,o),e.set(i,o),i}function vr(t,{vitalsByName:e,vitalsByReference:n},r,o={}){const i="string"==typeof r?e.get(r):n.get(r);i&&(t(function(t,e,n,r){var o;return{name:t.name,type:"duration",startClocks:e,duration:k(e.timeStamp,r.timeStamp),context:on(t.context,n.context),description:null!==(o=n.description)&&void 0!==o?o:t.description}}(i,i.startClocks,o,w())),"string"==typeof r?e.delete(r):n.delete(r))}function yr(){return window.crypto||window.msCrypto}function _r(){return wr(63)}let br;function wr(t){return br||(br=fe(ue.CONSISTENT_TRACE_SAMPLING)&&function(){try{return crypto.getRandomValues(new BigUint64Array(1)),!0}catch(t){return!1}}()?Sr:kr),br(t)}function Sr(t){let e=crypto.getRandomValues(new BigUint64Array(1))[0];return 63===t&&(e>>=BigInt("1")),e}function kr(t){const e=yr().getRandomValues(new Uint32Array(2));return 63===t&&(e[e.length-1]>>>=1),{toString(t=10){let n=e[1],r=e[0],o="";do{const e=n%t*4294967296+r;n=Math.floor(n/t),r=Math.floor(e/t),o=(e%t).toString(t)+o}while(n||r);return o}}}function Cr(t){const e=t.toString(16);return Array(17-e.length).join("0")+e}function xr(t){0!==t.status||t.isAborted||(t.traceId=void 0,t.spanId=void 0,t.traceSampled=void 0)}function Tr(t,e,n,r){if(void 0===yr()||!n.findTrackedSession())return;const o=t.allowedTracingUrls.find((t=>hr([t.match],e.url,!0)));if(!o)return;const i=wr(64);e.traceSampled=function(t,e){if(100===e)return!0;if(0===e)return!1;if("bigint"!=typeof t)return u(e);const n=BigInt("1111111111111111111"),r=BigInt("0x10000000000000000");return Number(t*n%r)<=e/100*Number(r)}(i,t.traceSampleRate);(e.traceSampled||t.traceContextInjection===ie.ALL)&&(e.traceId=i,e.spanId=_r(),r(function(t,e,n,r){const o={};return r.forEach((r=>{switch(r){case"datadog":Object.assign(o,{"x-datadog-origin":"rum","x-datadog-parent-id":e.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":t.toString()});break;case"tracecontext":Object.assign(o,{traceparent:`00-0000000000000000${Cr(t)}-${Cr(e)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break;case"b3":Object.assign(o,{b3:`${Cr(t)}-${Cr(e)}-${n?"1":"0"}`});break;case"b3multi":Object.assign(o,{"X-B3-TraceId":Cr(t),"X-B3-SpanId":Cr(e),"X-B3-Sampled":n?"1":"0"})}})),o}(e.traceId,e.spanId,e.traceSampled,o.propagatorTypes)))}const Er=["tracecontext","datadog"];function Ar(t){var e,n,r,i,s,a;if(!t.applicationId)return void o.error("Application ID is not configured, no RUM data will be collected.");if(!ae(t.sessionReplaySampleRate,"Session Replay")||!ae(t.traceSampleRate,"Trace"))return;if(void 0!==t.excludedActivityUrls&&!Array.isArray(t.excludedActivityUrls))return void o.error("Excluded Activity Urls should be an array");const c=function(t){if(void 0===t.allowedTracingUrls)return[];if(!Array.isArray(t.allowedTracingUrls))return void o.error("Allowed Tracing URLs should be an array");if(0!==t.allowedTracingUrls.length&&void 0===t.service)return void o.error("Service needs to be configured when tracing is enabled");const e=[];return t.allowedTracingUrls.forEach((t=>{pr(t)?e.push({match:t,propagatorTypes:Er}):!function(t){const e=t;return"object"===ft(e)&&pr(e.match)&&Array.isArray(e.propagatorTypes)}(t)?o.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",t):e.push(t)})),e}(t);if(!c)return;const u=ce(t);if(!u)return;const l=null!==(e=t.sessionReplaySampleRate)&&void 0!==e?e:0;return{applicationId:t.applicationId,version:t.version||void 0,actionNameAttribute:t.actionNameAttribute,sessionReplaySampleRate:l,startSessionReplayRecordingManually:void 0!==t.startSessionReplayRecordingManually?!!t.startSessionReplayRecordingManually:0===l,traceSampleRate:null!==(n=t.traceSampleRate)&&void 0!==n?n:100,rulePsr:d(t.traceSampleRate)?t.traceSampleRate/100:void 0,allowedTracingUrls:c,excludedActivityUrls:null!==(r=t.excludedActivityUrls)&&void 0!==r?r:[],workerUrl:t.workerUrl,compressIntakeRequests:!!t.compressIntakeRequests,trackUserInteractions:!(null!==(i=t.trackUserInteractions)&&void 0!==i&&!i),trackViewsManually:!!t.trackViewsManually,trackResources:!(null!==(s=t.trackResources)&&void 0!==s&&!s),trackLongTasks:!(null!==(a=t.trackLongTasks)&&void 0!==a&&!a),subdomain:t.subdomain,defaultPrivacyLevel:O(oe,t.defaultPrivacyLevel)?t.defaultPrivacyLevel:oe.MASK,enablePrivacyForActionName:!!t.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,traceContextInjection:O(ie,t.traceContextInjection)?t.traceContextInjection:ie.SAMPLED,plugins:t.plugins||[],...u}}function Rr(t){const e=new Set;return Array.isArray(t.allowedTracingUrls)&&t.allowedTracingUrls.length>0&&t.allowedTracingUrls.forEach((t=>{pr(t)?Er.forEach((t=>e.add(t))):"object"===ft(t)&&Array.isArray(t.propagatorTypes)&&t.propagatorTypes.forEach((t=>e.add(t)))})),Array.from(e)}const Ir="https://d3uc069fcn7uxw.cloudfront.net/configuration";function Nr(t,e){!function(t,e){const n=new XMLHttpRequest;Ke(t,n,"load",(function(){200===n.status?e(JSON.parse(n.responseText)):Or()})),Ke(t,n,"error",(function(){Or()})),n.open("GET",`${Ir}/${encodeURIComponent(t.remoteConfigurationId)}.json`),n.send()}(t,(n=>{e(function(t,e){return{...t,...e}}(t,n))}))}function Or(){o.error("Error fetching the remote configuration.")}function Lr({ignoreInitIfSyntheticsWillInjectRum:t,startDeflateWorker:e},n,r,i,s){const a=cn();let c,u,l,d;const f=r.observable.subscribe(p);function p(){if(!l||!d||!r.isGranted())return;let t;if(f.unsubscribe(),d.trackViewsManually){if(!c)return;a.remove(c.callback),t=c.options}const e=s(d,u,t);a.drain(e)}function h(t){const n=zn();if(n&&(t=function(t){var e,n;return{...t,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:null!==(e=t.defaultPrivacyLevel)&&void 0!==e?e:null===(n=Un())||void 0===n?void 0:n.getPrivacyLevel()}}(t)),l=t,function(t){mn({type:ln,configuration:t})}(function(t){var e;const n={session_sample_rate:(r=t).sessionSampleRate,telemetry_sample_rate:r.telemetrySampleRate,telemetry_configuration_sample_rate:r.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:r.telemetryUsageSampleRate,use_before_send:!!r.beforeSend,use_partitioned_cross_site_session_cookie:r.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:r.useSecureSessionCookie,use_proxy:!!r.proxy,silent_multiple_init:r.silentMultipleInit,track_session_across_subdomains:r.trackSessionAcrossSubdomains,track_anonymous_user:r.trackAnonymousUser,session_persistence:r.sessionPersistence,allow_fallback_to_local_storage:!!r.allowFallbackToLocalStorage,store_contexts_across_pages:!!r.storeContextsAcrossPages,allow_untrusted_events:!!r.allowUntrustedEvents,tracking_consent:r.trackingConsent};var r;return{session_replay_sample_rate:t.sessionReplaySampleRate,start_session_replay_recording_manually:t.startSessionReplayRecordingManually,trace_sample_rate:t.traceSampleRate,trace_context_injection:t.traceContextInjection,action_name_attribute:t.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(t.allowedTracingUrls)&&t.allowedTracingUrls.length>0,selected_tracing_propagators:Rr(t),default_privacy_level:t.defaultPrivacyLevel,enable_privacy_for_action_name:t.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(t.excludedActivityUrls)&&t.excludedActivityUrls.length>0,use_worker_url:!!t.workerUrl,compress_intake_requests:t.compressIntakeRequests,track_views_manually:t.trackViewsManually,track_user_interactions:t.trackUserInteractions,track_resources:t.trackResources,track_long_task:t.trackLongTasks,plugins:null===(e=t.plugins)||void 0===e?void 0:e.map((t=>{var e;return{name:t.name,...null===(e=t.getConfigurationTelemetry)||void 0===e?void 0:e.call(t)}})),...n}}(t)),d)return void We("DD_RUM",t);const i=Ar(t);i&&(n||i.sessionStoreStrategyType?i.compressIntakeRequests&&!n&&e&&(u=e(i,"Datadog RUM",X),!u)||(d=i,er().subscribe(X),r.tryToInit(i.trackingConsent),p()):o.warn("No storage available for session. We will not send any data."))}const m=t=>{a.add((e=>e.addDurationVital(t)))};return{init(e,n){e?(de(e.enableExperimentalFeatures),l=e,t&&fr()||(!function(t,e,n){if(t)for(const r of t){const t=r[e];t&&t(n)}}(e.plugins,"onInit",{initConfiguration:e,publicApi:n}),e.remoteConfigurationId&&fe(ue.REMOTE_CONFIGURATION)?Nr(e,h):h(e))):o.error("Missing configuration")},get initConfiguration(){return l},getInternalContext:X,stopSession:X,addTiming(t,e=_()){a.add((n=>n.addTiming(t,e)))},startView(t,e=w()){const n=n=>{n.startView(t,e)};a.add(n),c||(c={options:t,callback:n},p())},setViewName(t){a.add((e=>e.setViewName(t)))},setViewContext(t){a.add((e=>e.setViewContext(t)))},setViewContextProperty(t,e){a.add((n=>n.setViewContextProperty(t,e)))},addAction(t,e=n()){a.add((n=>n.addAction(t,e)))},addError(t,e=n()){a.add((n=>n.addError(t,e)))},addFeatureFlagEvaluation(t,e){a.add((n=>n.addFeatureFlagEvaluation(t,e)))},startDurationVital:(t,e)=>gr(i,t,e),stopDurationVital(t,e){vr(m,i,t,e)},addDurationVital:m}}function Mr(){let t;const e=window;if(e.Zone&&(t=D(e,"MutationObserver"),e.MutationObserver&&t===e.MutationObserver)){const n=D(new e.MutationObserver(X),"originalInstance");t=n&&n.constructor}return t||(t=e.MutationObserver),t}function Dr(){const t=function(){const t=window._DATADOG_SYNTHETICS_PUBLIC_ID||at("datadog-synthetics-public-id");return"string"==typeof t?t:void 0}(),e=function(){const t=window._DATADOG_SYNTHETICS_RESULT_ID||at("datadog-synthetics-result-id");return"string"==typeof t?t:void 0}();if(t&&e)return{test_id:t,result_id:e,injected:fr()}}function Pr(t,e,n){const r=rn(t),o=n(r);return dt(e).forEach((([e,n])=>{const o=function(t,e){let n=t;for(const t of e.split(".")){if(!zr(n,t))return;n=n[t]}return n}(r,e),i=ft(o);i===n?Ur(t,e,Oe(o)):"object"!==n||"undefined"!==i&&"null"!==i||Ur(t,e,{})})),o}function Ur(t,e,n){let r=t;const o=e.split(".");for(let t=0;t<o.length;t+=1){const e=o[t];if(!$r(r))return;t!==o.length-1?r=r[e]:r[e]=n}}function $r(t){return"object"===ft(t)}function zr(t,e){return $r(t)&&Object.prototype.hasOwnProperty.call(t,e)}const Br={"view.name":"string","view.url":"string","view.referrer":"string"},Vr={context:"object"},Fr={service:"string",version:"string"};let jr;function qr(t,e,n,r,i,s,a,c,u,d){jr={view:{...Vr,...Br},error:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...Vr,...Br,...Fr},resource:{"resource.url":"string",...fe(ue.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...Vr,...Br,...Fr},action:{"action.target.name":"string",...Vr,...Br,...Fr},long_task:{...Vr,...Br},vital:{...Vr,...Br}};const f={error:Gn("error",t.eventRateLimiterThreshold,d),action:Gn("action",t.eventRateLimiterThreshold,d),vital:Gn("vital",t.eventRateLimiterThreshold,d)},p=Dr();e.subscribe(11,(({startTime:d,rawRumEvent:h,domainContext:m,savedCommonContext:g,customerContext:v})=>{const b=r.findView(d),w=i.findUrl(d),S=n.findTrackedSession(d);if(S&&b&&w){const n=g||u(),r=s.findActionId(d),i=on({_dd:{format_version:2,drift:Math.round(y()-C(E(),performance.now())),configuration:{session_sample_rate:l(t.sessionSampleRate,3),session_replay_sample_rate:l(t.sessionReplaySampleRate,3)},browser_sdk_version:zn()?"6.0.0":void 0},application:{id:t.applicationId},date:_(),service:b.service||t.service,version:b.version||t.version,source:"browser",session:{id:S.id,type:p?"synthetics":c.get()?"ci_test":"user"},view:{id:b.id,name:b.name,url:w.url,referrer:w.referrer},action:(k=h,-1!==["error","resource","long_task"].indexOf(k.type)&&r?{id:r}:void 0),synthetics:p,ci_test:c.get(),display:a.get(),connectivity:sn()},h);i.context=on(n.context,b.context,v),"has_replay"in i.session||(i.session.has_replay=n.hasReplay),"view"===i.type&&(i.session.sampled_for_replay=1===S.sessionReplay),S.anonymousId&&!n.user.anonymous_id&&t.trackAnonymousUser&&(n.user.anonymous_id=S.anonymousId),L(n.user)||(i.usr=n.user),function(t,e,n,r){var i;if(e){const r=Pr(t,jr[t.type],(t=>e(t,n)));if(!1===r&&"view"!==t.type)return!1;!1===r&&o.warn("Can't dismiss view events using beforeSend!")}const s=null===(i=r[t.type])||void 0===i?void 0:i.isLimitReached();return!s}(i,t.beforeSend,m,f)&&(L(i.context)&&delete i.context,e.notify(12,i))}var k}))}const Hr=class{constructor(){this.callbacks={}}notify(t,e){const n=this.callbacks[t];n&&n.forEach((t=>t(e)))}subscribe(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter((t=>e!==t))}}}},Gr=ht;const Wr="initial_document",Kr=[["document",t=>Wr===t],["xhr",t=>"xmlhttprequest"===t],["fetch",t=>"fetch"===t],["beacon",t=>"beacon"===t],["css",(t,e)=>/\.css$/i.test(e)],["js",(t,e)=>/\.js$/i.test(e)],["image",(t,e)=>["image","img","icon"].includes(t)||null!==/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(e)],["font",(t,e)=>null!==/\.(woff|eot|woff2|ttf)$/i.exec(e)],["media",(t,e)=>["audio","video"].includes(t)||null!==/\.(mp3|mp4)$/i.exec(e)]];function Jr(t){const e=t.name;if(!function(t){try{return!!Gt(t)}catch(t){return!1}}(e))return vn(`Failed to construct URL for "${t.name}"`),"other";const n=function(t){const e=Gt(t).pathname;return"/"===e[0]?e:`/${e}`}(e);for(const[e,r]of Kr)if(r(t.initiatorType,n))return e;return"other"}function Xr(...t){for(let e=1;e<t.length;e+=1)if(t[e-1]>t[e])return!1;return!0}function Yr(t){return"xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType}function Zr(t){const{duration:e,startTime:n,responseEnd:r}=t;return v(0===e&&n<r?k(n,r):e)}function Qr(t){if(!eo(t))return;const{startTime:e,fetchStart:n,workerStart:r,redirectStart:o,redirectEnd:i,domainLookupStart:s,domainLookupEnd:a,connectStart:c,secureConnectionStart:u,connectEnd:l,requestStart:d,responseStart:f,responseEnd:p}=t,h={download:no(e,f,p),first_byte:no(e,d,f)};return 0<r&&r<n&&(h.worker=no(e,r,n)),n<l&&(h.connect=no(e,c,l),c<=u&&u<=l&&(h.ssl=no(e,u,l))),n<a&&(h.dns=no(e,s,a)),e<i&&(h.redirect=no(e,o,i)),h}function to(t){return t.duration>=0}function eo(t){const e=Xr(t.startTime,t.fetchStart,t.domainLookupStart,t.domainLookupEnd,t.connectStart,t.connectEnd,t.requestStart,t.responseStart,t.responseEnd),n=!function(t){return t.redirectEnd>t.startTime}(t)||Xr(t.startTime,t.redirectStart,t.redirectEnd,t.fetchStart);return e&&n}function no(t,e,n){if(t<=e&&e<=n)return{duration:v(k(e,n)),start:v(k(t,e))}}function ro(t){return""===t.nextHopProtocol?void 0:t.nextHopProtocol}function oo(t){return""===t.deliveryType?"other":t.deliveryType}function io(t){if(t.startTime<t.responseStart){const{encodedBodySize:e,decodedBodySize:n,transferSize:r}=t;return{size:n,encoded_body_size:e,decoded_body_size:n,transfer_size:r}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function so(t){return t&&!function(t){return te.every((e=>t.includes(e)))}(t)}const ao=/data:(.+)?(;base64)?,/g;function co(t){return!(t.length<=24e3)&&("data:"===t.substring(0,5)&&(t=t.substring(0,24e3),!0))}function uo(t){return`${t.match(ao)[0]}[...]`}let lo=1;function fo(t,e,n){const r=function(t,e){return{clearTracingIfNeeded:xr,traceFetch:n=>Tr(t,n,e,(t=>{var e;if(n.input instanceof Request&&!(null===(e=n.init)||void 0===e?void 0:e.headers))n.input=new Request(n.input),Object.keys(t).forEach((e=>{n.input.headers.append(e,t[e])}));else{n.init=N(n.init);const e=[];n.init.headers instanceof Headers?n.init.headers.forEach(((t,n)=>{e.push([n,t])})):Array.isArray(n.init.headers)?n.init.headers.forEach((t=>{e.push(t)})):n.init.headers&&Object.keys(n.init.headers).forEach((t=>{e.push([t,n.init.headers[t]])})),n.init.headers=e.concat(dt(t))}})),traceXhr:(n,r)=>Tr(t,n,e,(t=>{Object.keys(t).forEach((e=>{r.setRequestHeader(e,t[e])}))}))}}(e,n);!function(t,e,n){const r=Yn(e).subscribe((e=>{const r=e;if(so(r.url))switch(r.state){case"start":n.traceXhr(r,r.xhr),r.requestIndex=po(),t.notify(6,{requestIndex:r.requestIndex,url:r.url});break;case"complete":n.clearTracingIfNeeded(r),t.notify(7,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,traceSampled:r.traceSampled,type:"xhr",url:r.url,xhr:r.xhr,isAborted:r.isAborted,handlingStack:r.handlingStack})}}))}(t,e,r),function(t,e){const n=er().subscribe((n=>{const r=n;if(so(r.url))switch(r.state){case"start":e.traceFetch(r),r.requestIndex=po(),t.notify(6,{requestIndex:r.requestIndex,url:r.url});break;case"resolve":!function(t,e){const n=t.response&&function(t){try{return t.clone()}catch(t){return}}(t.response);n&&n.body?function(t,e,n){const r=t.getReader();let o=0;function i(){r.cancel().catch(X),e(void 0,void 0,void 0)}!function t(){r.read().then(z((e=>{e.done?i():(o+=e.value.length,o>n.bytesLimit?i():t())})),z((t=>e(t))))}()}(n.body,(()=>{e(k(t.startClocks.timeStamp,_()))}),{bytesLimit:Number.POSITIVE_INFINITY}):e(k(t.startClocks.timeStamp,_()))}(r,(n=>{e.clearTracingIfNeeded(r),t.notify(7,{duration:n,method:r.method,requestIndex:r.requestIndex,responseType:r.responseType,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,traceSampled:r.traceSampled,type:"fetch",url:r.url,response:r.response,init:r.init,input:r.input,isAborted:r.isAborted,handlingStack:r.handlingStack})}))}}))}(t,r)}function po(){const t=lo;return lo+=1,t}function ho(t){return d(t)&&t<0?void 0:t}function mo({lifeCycle:t,isChildEvent:e,onChange:n=X}){const r={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},o=t.subscribe(12,(t=>{var o;if("view"!==t.type&&"vital"!==t.type&&e(t))switch(t.type){case"error":r.errorCount+=1,n();break;case"action":r.actionCount+=1,t.action.frustration&&(r.frustrationCount+=t.action.frustration.type.length),n();break;case"long_task":r.longTaskCount+=1,n();break;case"resource":(null===(o=t._dd)||void 0===o?void 0:o.discarded)||(r.resourceCount+=1,n())}}));return{stop:()=>{o.unsubscribe()},eventCounts:r}}function go(t,e){const n=y();let r=!1;const{stop:o}=Je(t,window,["click","mousedown","keydown","touchstart","pointerdown"],(e=>{if(!e.cancelable)return;const n={entryType:"first-input",processingStart:b(),processingEnd:b(),startTime:e.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};"pointerdown"===e.type?function(t,e){Je(t,window,["pointerup","pointercancel"],(t=>{"pointerup"===t.type&&i(e)}),{once:!0})}(t,n):i(n)}),{passive:!0,capture:!0});return{stop:o};function i(t){if(!r){r=!0,o();const i=t.processingStart-t.startTime;i>=0&&i<y()-n&&e(t)}}}var vo;function yo(t,e){return new W((n=>{if(!window.PerformanceObserver)return;const r=t=>{const e=function(t){return t.filter((t=>!function(t){return!(t.entryType!==vo.RESOURCE||so(t.name)&&to(t))}(t)))}(t);e.length>0&&n.notify(e)};let o,i=!0;const s=new PerformanceObserver(z((t=>{i?o=j((()=>r(t.getEntries()))):r(t.getEntries())})));try{s.observe(e)}catch(t){if([vo.RESOURCE,vo.NAVIGATION,vo.LONG_TASK,vo.PAINT].includes(e.type)){e.buffered&&(o=j((()=>r(performance.getEntriesByType(e.type)))));try{s.observe({entryTypes:[e.type]})}catch(t){return}}}let a;return i=!1,function(t){!_o&&void 0!==window.performance&&"getEntries"in performance&&"addEventListener"in performance&&(_o=Ke(t,performance,"resourcetimingbufferfull",(()=>{performance.clearResourceTimings()})))}(t),bo(vo.FIRST_INPUT)||e.type!==vo.FIRST_INPUT||({stop:a}=go(t,(t=>{r([t])}))),()=>{s.disconnect(),a&&a(),q(o)}}))}let _o;function bo(t){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes(t)}!function(t){t.EVENT="event",t.FIRST_INPUT="first-input",t.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",t.LAYOUT_SHIFT="layout-shift",t.LONG_TASK="longtask",t.LONG_ANIMATION_FRAME="long-animation-frame",t.NAVIGATION="navigation",t.PAINT="paint",t.RESOURCE="resource"}(vo||(vo={}));const wo=100;function So(t,e,n,r,o,i){const s=function(t,e,n,r){return new W((o=>{const i=[];let s,a=0;return i.push(e.subscribe(c),n.subscribe(c),yo(r,{type:vo.RESOURCE}).subscribe((t=>{t.some((t=>!ko(r,t.name)))&&c()})),t.subscribe(6,(t=>{ko(r,t.url)||(void 0===s&&(s=t.requestIndex),a+=1,c())})),t.subscribe(7,(t=>{ko(r,t.url)||void 0===s||t.requestIndex<s||(a-=1,c())}))),()=>{i.forEach((t=>t.unsubscribe()))};function c(){o.notify({isBusy:a>0})}}))}(t,e,n,r);return function(t,e,n){let r,o=!1;const i=j(z((()=>u({hadActivity:!1}))),100),s=void 0!==n?j(z((()=>u({hadActivity:!0,end:_()}))),n):void 0,a=t.subscribe((({isBusy:t})=>{q(i),q(r);const e=_();t||(r=j(z((()=>u({hadActivity:!0,end:e}))),100))})),c=()=>{o=!0,q(i),q(r),q(s),a.unsubscribe()};function u(t){o||(c(),e(t))}return{stop:c}}(s,o,i)}function ko(t,e){return hr(t.excludedActivityUrls,e)}function Co(t){return t.nodeType===Node.TEXT_NODE}function xo(t){return t.nodeType===Node.ELEMENT_NODE}function To(t){return xo(t)&&Boolean(t.shadowRoot)}function Eo(t){const e=t;return!!e.host&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&xo(e.host)}function Ao(t,e){let n=t.firstChild;for(;n;)e(n),n=n.nextSibling;To(t)&&e(t.shadowRoot)}function Ro(t){return Eo(t)?t.host:t.parentNode}const Io={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:oe.ALLOW,MASK:oe.MASK,MASK_USER_INPUT:oe.MASK_USER_INPUT},No="data-dd-privacy",Oo="hidden",Lo="***",Mo="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",Do={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0};function Po(t,e,n){if(n&&n.has(t))return n.get(t);const r=Ro(t),o=r?Po(r,e,n):e,i=Uo($o(t),o);return n&&n.set(t,i),i}function Uo(t,e){switch(e){case Io.HIDDEN:case Io.IGNORE:return e}switch(t){case Io.ALLOW:case Io.MASK:case Io.MASK_USER_INPUT:case Io.HIDDEN:case Io.IGNORE:return t;default:return e}}function $o(t){if(xo(t)){if("BASE"===t.tagName)return Io.ALLOW;if("INPUT"===t.tagName){const e=t;if("password"===e.type||"email"===e.type||"tel"===e.type)return Io.MASK;if("hidden"===e.type)return Io.MASK;const n=e.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return Io.MASK}return t.matches(Fo(Io.HIDDEN))?Io.HIDDEN:t.matches(Fo(Io.MASK))?Io.MASK:t.matches(Fo(Io.MASK_USER_INPUT))?Io.MASK_USER_INPUT:t.matches(Fo(Io.ALLOW))?Io.ALLOW:function(t){if("SCRIPT"===t.nodeName)return!0;if("LINK"===t.nodeName){const t=e("rel");return/preload|prefetch/i.test(t)&&"script"===e("as")||"shortcut icon"===t||"icon"===t}if("META"===t.nodeName){const n=e("name"),r=e("rel"),o=e("property");return/^msapplication-tile(image|color)$/.test(n)||"application-name"===n||"icon"===r||"apple-touch-icon"===r||"shortcut icon"===r||"keywords"===n||"description"===n||/^(og|twitter|fb):/.test(o)||/^(og|twitter):/.test(n)||"pinterest"===n||"robots"===n||"googlebot"===n||"bingbot"===n||t.hasAttribute("http-equiv")||"author"===n||"generator"===n||"framework"===n||"publisher"===n||"progid"===n||/^article:/.test(o)||/^product:/.test(o)||"google-site-verification"===n||"yandex-verification"===n||"csrf-token"===n||"p:domain_verify"===n||"verify-v1"===n||"verification"===n||"shopify-checkout-api-token"===n}function e(e){return(t.getAttribute(e)||"").toLowerCase()}return!1}(t)?Io.IGNORE:void 0}}function zo(t,e){switch(e){case Io.MASK:case Io.HIDDEN:case Io.IGNORE:return!0;case Io.MASK_USER_INPUT:return Co(t)?Bo(t.parentNode):Bo(t);default:return!1}}function Bo(t){if(!t||t.nodeType!==t.ELEMENT_NODE)return!1;const e=t;if("INPUT"===e.tagName)switch(e.type){case"button":case"color":case"reset":case"submit":return!1}return!!Do[e.tagName]}function Vo(t,e,n){var r;const o=null===(r=t.parentElement)||void 0===r?void 0:r.tagName;let i=t.textContent||"";if(e&&!i.trim())return;if("SCRIPT"===o)i=Lo;else if(n===Io.HIDDEN)i=Lo;else if(zo(t,n))if("DATALIST"===o||"SELECT"===o||"OPTGROUP"===o){if(!i.trim())return}else i="OPTION"===o?Lo:i.replace(/\S/g,"x");return i}function Fo(t){return`[${No}="${t}"], .dd-privacy-${t}`}const jo="data-dd-action-name";function qo(t,e){const n=t.closest(`[${e}]`);if(!n)return;return Xo(Jo(n.getAttribute(e).trim()))}const Ho=[(t,e)=>{if("labels"in t&&t.labels&&t.labels.length>0)return Zo(t.labels[0],e)},t=>{if("INPUT"===t.nodeName){const e=t,n=e.getAttribute("type");if("button"===n||"submit"===n||"reset"===n)return{name:e.value,nameSource:"text_content"}}},(t,e,n)=>{if("BUTTON"===t.nodeName||"LABEL"===t.nodeName||"button"===t.getAttribute("role"))return Zo(t,e,n)},t=>Yo(t,"aria-label"),(t,e,n)=>{const r=t.getAttribute("aria-labelledby");if(r)return{name:r.split(/\s+/).map((e=>function(t,e){return t.ownerDocument?t.ownerDocument.getElementById(e):null}(t,e))).filter((t=>Boolean(t))).map((t=>Qo(t,e,n))).join(" "),nameSource:"text_content"}},t=>Yo(t,"alt"),t=>Yo(t,"name"),t=>Yo(t,"title"),t=>Yo(t,"placeholder"),(t,e)=>{if("options"in t&&t.options.length>0)return Zo(t.options[0],e)}],Go=[(t,e,n)=>Zo(t,e,n)],Wo=10;function Ko(t,e,n,r){let o=t,i=0;for(;i<=Wo&&o&&"BODY"!==o.nodeName&&"HTML"!==o.nodeName&&"HEAD"!==o.nodeName;){for(const t of n){const n=t(o,e,r);if(n){const{name:t,nameSource:e}=n,r=t&&t.trim();if(r)return{name:Xo(Jo(r)),nameSource:e}}}if("FORM"===o.nodeName)break;o=o.parentElement,i+=1}}function Jo(t){return t.replace(/\s+/g," ")}function Xo(t){return t.length>100?`${tt(t,100)} [...]`:t}function Yo(t,e){return{name:t.getAttribute(e)||"",nameSource:"standard_attribute"}}function Zo(t,e,n){return{name:Qo(t,e,n)||"",nameSource:"text_content"}}function Qo(t,e,n){if(!t.isContentEditable){if("innerText"in t){let r=t.innerText;const o=e=>{const n=t.querySelectorAll(e);for(let t=0;t<n.length;t+=1){const e=n[t];if("innerText"in e){const t=e.innerText;t&&t.trim().length>0&&(r=r.replace(t,""))}}};return o(`[${jo}]`),e&&o(`[${e}]`),n&&o(`${Fo(Io.HIDDEN)}, ${Fo(Io.MASK)}`),r}return t.textContent}}const ti=[jo,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],ei=[ii,function(t){if(t.id&&!oi(t.id))return`#${CSS.escape(t.id)}`}],ni=[ii,function(t){if("BODY"===t.tagName)return;const e=t.classList;for(let n=0;n<e.length;n+=1){const r=e[n];if(!oi(r))return`${CSS.escape(t.tagName)}.${CSS.escape(r)}`}},function(t){return CSS.escape(t.tagName)}];function ri(t,e){if(!function(t){if("isConnected"in t)return t.isConnected;return t.ownerDocument.documentElement.contains(t)}(t))return;let n,r=t;for(;r&&"HTML"!==r.nodeName;){const t=ai(r,ei,ci,e,n);if(t)return t;n=ai(r,ni,ui,e,n)||li(si(r),n),r=r.parentElement}return n}function oi(t){return/[0-9]/.test(t)}function ii(t,e){if(e){const t=n(e);if(t)return t}for(const t of ti){const e=n(t);if(e)return e}function n(e){if(t.hasAttribute(e))return`${CSS.escape(t.tagName)}[${e}="${CSS.escape(t.getAttribute(e))}"]`}}function si(t){let e=t.parentElement.firstElementChild,n=1;for(;e&&e!==t;)e.tagName===t.tagName&&(n+=1),e=e.nextElementSibling;return`${CSS.escape(t.tagName)}:nth-of-type(${n})`}function ai(t,e,n,r,o){for(const i of e){const e=i(t,r);if(e&&n(t,e,o))return li(e,o)}}function ci(t,e,n){return 1===t.ownerDocument.querySelectorAll(li(e,n)).length}function ui(t,e,n){let r;if(void 0===n)r=t=>t.matches(e);else{const t=function(){if(void 0===di)try{document.querySelector(":scope"),di=!0}catch(t){di=!1}return di}()?li(`${e}:scope`,n):li(e,n);r=e=>null!==e.querySelector(t)}let o=t.parentElement.firstElementChild;for(;o;){if(o!==t&&r(o))return!1;o=o.nextElementSibling}return!0}function li(t,e){return e?`${t}>${e}`:t}let di;const fi=f;function pi(t,e){const n=[];let r,o=0;function i(t){t.stopObservable.subscribe(s),n.push(t),q(r),r=j(a,fi)}function s(){1===o&&n.every((t=>t.isStopped()))&&(o=2,e(n))}function a(){q(r),0===o&&(o=1,s())}return i(t),{tryAppend:t=>{return 0===o&&(n.length>0&&(e=n[n.length-1].event,r=t.event,!(e.target===r.target&&(s=e,c=r,Math.sqrt(Math.pow(s.clientX-c.clientX,2)+Math.pow(s.clientY-c.clientY,2))<=100)&&e.timeStamp-r.timeStamp<=fi))?(a(),!1):(i(t),!0));var e,r,s,c},stop:()=>{a()}}}function hi(){const t=window.getSelection();return!t||t.isCollapsed}function mi(t){return t.target instanceof Element&&!1!==t.isPrimary}function gi(t,e){if(function(t){if(t.some((t=>t.getUserActivity().selection||t.getUserActivity().scroll)))return!1;for(let e=0;e<t.length-2;e+=1)if(t[e+3-1].event.timeStamp-t[e].event.timeStamp<=f)return!0;return!1}(t))return e.addFrustration("rage_click"),t.some(yi)&&e.addFrustration("dead_click"),e.hasError&&e.addFrustration("error_click"),{isRage:!0};const n=t.some((t=>t.getUserActivity().selection));return t.forEach((t=>{t.hasError&&t.addFrustration("error_click"),yi(t)&&!n&&t.addFrustration("dead_click")})),{isRage:!1}}const vi='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function yi(t){return!(t.hasPageActivity||t.getUserActivity().input||t.getUserActivity().scroll)&&!t.event.target.matches(vi)}const _i=1e4,bi=new Map;function wi(t,e){bi.set(t,e),bi.forEach(((t,e)=>{k(e,b())>1e4&&bi.delete(e)}))}function Si(t,e,n,r){const o=kn({expireDelay:3e5}),i=new W;let s;t.subscribe(9,(()=>{o.reset()})),t.subscribe(4,u);const{stop:a}=function(t,{onPointerDown:e,onPointerUp:n}){let r,o,i={selection:!1,input:!1,scroll:!1};const s=[Ke(t,window,"pointerdown",(t=>{mi(t)&&(r=hi(),i={selection:!1,input:!1,scroll:!1},o=e(t))}),{capture:!0}),Ke(t,window,"selectionchange",(()=>{r&&hi()||(i.selection=!0)}),{capture:!0}),Ke(t,window,"scroll",(()=>{i.scroll=!0}),{capture:!0,passive:!0}),Ke(t,window,"pointerup",(t=>{if(mi(t)&&o){const e=i;n(o,t,(()=>e)),o=void 0}}),{capture:!0}),Ke(t,window,"input",(()=>{i.input=!0}),{capture:!0})];return{stop:()=>{s.forEach((t=>t.stop()))}}}(r,{onPointerDown:o=>function(t,e,n,r,o){const i=t.enablePrivacyForActionName?Po(r.target,t.defaultPrivacyLevel):Io.ALLOW;if(i===Io.HIDDEN)return;const s=function(t,e,n){const r=t.target.getBoundingClientRect(),o=ri(t.target,n.actionNameAttribute);o&&wi(t.timeStamp,o);const i=function(t,{enablePrivacyForActionName:e,actionNameAttribute:n},r){const o=qo(t,jo)||n&&qo(t,n);return o?{name:o,nameSource:"custom_attribute"}:r===Io.MASK?{name:"Masked Element",nameSource:"mask_placeholder"}:Ko(t,n,Ho,e)||Ko(t,n,Go,e)||{name:"",nameSource:"blank"}}(t.target,n,e);return{type:"click",target:{width:Math.round(r.width),height:Math.round(r.height),selector:o},position:{x:Math.round(t.clientX-r.left),y:Math.round(t.clientY-r.top)},name:i.name,nameSource:i.nameSource}}(r,i,t);let a=!1;return So(e,n,o,t,(t=>{a=t.hadActivity}),wo),{clickActionBase:s,hadActivityOnPointerDown:()=>a}}(r,t,e,o,n),onPointerUp:({clickActionBase:s,hadActivityOnPointerDown:a},u,l)=>{!function(t,e,n,r,o,i,s,a,c,u,l){var d;const f=ki(e,o,u,a,c);s(f);const p=null===(d=null==a?void 0:a.target)||void 0===d?void 0:d.selector;p&&wi(c.timeStamp,p);const{stop:h}=So(e,n,r,t,(t=>{t.hadActivity&&t.end<f.startClocks.timeStamp?f.discard():t.hadActivity?f.stop(t.end):l()?f.stop(f.startClocks.timeStamp):f.stop()}),_i),m=e.subscribe(4,(({endClocks:t})=>{f.stop(t.timeStamp)})),g=i.subscribe((()=>{f.stop()}));f.stopObservable.subscribe((()=>{m.unsubscribe(),h(),g.unsubscribe()}))}(r,t,e,n,o,i,c,s,u,l,a)}});return{stop:()=>{u(),i.notify(),a()},actionContexts:{findActionId:t=>o.findAll(t)}};function c(t){if(!s||!s.tryAppend(t)){const e=t.clone();s=pi(t,(t=>{!function(t,e){const{isRage:n}=gi(t,e);n?(t.forEach((t=>t.discard())),e.stop(_()),e.validate(t.map((t=>t.event)))):(e.discard(),t.forEach((t=>t.validate())))}(t,e)}))}}function u(){s&&s.stop()}}function ki(t,e,n,r,o){const i=Y(),s=w(),a=e.add(i,s.relative),c=mo({lifeCycle:t,isChildEvent:t=>void 0!==t.action&&(Array.isArray(t.action.id)?t.action.id.includes(i):t.action.id===i)});let u,l=0;const d=[],f=new W;function p(t){0===l&&(u=t,l=1,u?a.close(x(u)):a.remove(),c.stop(),f.notify())}return{event:o,stop:p,stopObservable:f,get hasError(){return c.eventCounts.errorCount>0},get hasPageActivity(){return void 0!==u},getUserActivity:n,addFrustration:t=>{d.push(t)},startClocks:s,isStopped:()=>1===l||2===l,clone:()=>ki(t,e,n,r,o),validate:e=>{if(p(),1!==l)return;const{resourceCount:n,errorCount:a,longTaskCount:f}=c.eventCounts,h={duration:u&&k(s.timeStamp,u),startClocks:s,id:i,frustrationTypes:d,counts:{resourceCount:n,errorCount:a,longTaskCount:f},events:null!=e?e:[o],event:o,...r};t.notify(0,h),l=2},discard:()=>{p(),l=2}}}function Ci(t,e){const n=xi(t)?{action:{id:t.id,loading_time:ho(v(t.duration)),frustration:{type:t.frustrationTypes},error:{count:t.counts.errorCount},long_task:{count:t.counts.longTaskCount},resource:{count:t.counts.resourceCount}},_dd:{action:{target:t.target,position:t.position,name_source:fe(ue.ACTION_NAME_MASKING)?t.nameSource:void 0}}}:void 0,r=xi(t)?void 0:t.context,o=on({action:{id:Y(),target:{name:t.name},type:t.type},date:t.startClocks.timeStamp,type:"action",view:{in_foreground:e.wasInPageStateAt("active",t.startClocks.relative)}},n),i=xi(t)?{events:t.events}:{};return!xi(t)&&t.handlingStack&&(i.handlingStack=t.handlingStack),{customerContext:r,rawRumEvent:o,startTime:t.startClocks.relative,domainContext:i}}function xi(t){return"custom"!==t.type}function Ti(e,n,r,o){const i=new W;return function(e){const n=ir([t.error]).subscribe((t=>e.notify(t.error)))}(i),Ge(i),function(t,e){const n=Ze(t,[Ye,Xe]).subscribe((t=>e.notify(t)))}(n,i),i.subscribe((t=>e.notify(13,{error:t}))),function(t,e,n){return t.subscribe(13,(({error:r,customerContext:o,savedCommonContext:i})=>{t.notify(11,{customerContext:o,savedCommonContext:i,...Ei(r,e,n)})})),{addError:({error:e,handlingStack:n,startClocks:r,context:o},i)=>{const s=Ue({stackTrace:ze(e)?me(e):void 0,originalError:e,handlingStack:n,startClocks:r,nonErrorPrefix:"Provided",source:je,handling:"handled"});t.notify(13,{customerContext:o,savedCommonContext:i,error:s})}}}(e,r,o)}function Ei(t,e,n){const r={date:t.startClocks.timeStamp,error:{id:Y(),message:t.message,source:t.source,stack:t.stack,handling_stack:t.handlingStack,type:t.type,handling:t.handling,causes:t.causes,source_type:"browser",fingerprint:t.fingerprint,csp:t.csp},type:"error",view:{in_foreground:e.wasInPageStateAt("active",t.startClocks.relative)}},o=n.findFeatureFlagEvaluations(t.startClocks.relative);o&&!L(o)&&(r.feature_flags=o);const i={error:t.originalError,handlingStack:t.handlingStack};return{rawRumEvent:r,startTime:t.startClocks.relative,domainContext:i}}const Ai=new WeakSet;function Ri(t){if(!performance||!("getEntriesByName"in performance))return;const e=performance.getEntriesByName(t.url,"resource");if(!e.length||!("toJSON"in e[0]))return;const n=e.filter((t=>!Ai.has(t))).filter((t=>to(t)&&eo(t))).filter((e=>function(t,e,n){const r=1;return t.startTime>=e-r&&Ii(t)<=C(n,r)}(e,t.startClocks.relative,Ii({startTime:t.startClocks.relative,duration:t.duration}))));return 1===n.length?(Ai.add(n[0]),n[0].toJSON()):void 0}function Ii(t){return C(t.startTime,t.duration)}function Ni(t){const e=function(t){const e=t.querySelector("meta[name=dd-trace-id]"),n=t.querySelector("meta[name=dd-trace-time]");return Oi(e&&e.content,n&&n.content)}(t)||function(t){const e=function(t){for(let e=0;e<t.childNodes.length;e+=1){const n=Li(t.childNodes[e]);if(n)return n}if(t.body)for(let e=t.body.childNodes.length-1;e>=0;e-=1){const n=t.body.childNodes[e],r=Li(n);if(r)return r;if(!Co(n))break}}(t);if(!e)return;return Oi(Q(e,"trace-id"),Q(e,"trace-time"))}(t);if(e&&!(e.traceTime<=y()-12e4))return e.traceId}function Oi(t,e){const n=e&&Number(e);if(t&&n)return{traceId:t,traceTime:n}}function Li(t){if(t&&function(t){return t.nodeType===Node.COMMENT_NODE}(t)){const e=/^\s*DATADOG;(.*?)\s*$/.exec(t.data);if(e)return e[1]}}function Mi(){if(bo(vo.NAVIGATION)){const t=performance.getEntriesByType(vo.NAVIGATION)[0];if(t)return t}const t=function(){const t={},e=performance.timing;for(const n in e)if(d(e[n])){const r=n,o=e[r];t[r]=0===o?0:x(o)}return t}(),e={entryType:vo.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:t.responseEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...e,toJSON:void 0}),...t};return e}function Di(t,e){Wn(t,"interactive",(()=>{const t=Object.assign(Mi().toJSON(),{entryType:vo.RESOURCE,initiatorType:Wr,traceId:Ni(document),toJSON:()=>({...t,toJSON:void 0})});e(t)}))}function Pi(t,e,n,r=function(){const t=[];function e(e){let r;if(e.didTimeout){const t=performance.now();r=()=>30-(performance.now()-t)}else r=e.timeRemaining.bind(e);for(;r()>0&&t.length;)t.shift()();t.length&&n()}function n(){nr(e,{timeout:1e3})}return{push(e){1===t.push(e)&&n()}}}(),o=Di){t.subscribe(7,(t=>{s((()=>function(t,e,n){const r=Ri(t),o=r?m(r.startTime):t.startClocks,i=function(t,e){const n=t.traceSampled&&t.traceId&&t.spanId;if(!n)return;return{_dd:{span_id:t.spanId.toString(),trace_id:t.traceId.toString(),rule_psr:e.rulePsr}}}(t,e);if(!e.trackResources&&!i)return;const s="xhr"===t.type?"xhr":"fetch",a=r?$i(r):void 0,c=function(t,e,n){return t.wasInPageStateDuringPeriod("frozen",e.relative,n)?void 0:v(n)}(n,o,t.duration),u=on({date:o.timeStamp,resource:{id:Y(),type:s,duration:c,method:t.method,status_code:t.status,protocol:r&&ro(r),url:co(t.url)?uo(t.url):t.url,delivery_type:r&&oo(r)},type:"resource",_dd:{discarded:!e.trackResources}},i,a);return{startTime:o.relative,rawRumEvent:u,domainContext:{performanceEntry:r,xhr:t.xhr,response:t.response,requestInput:t.input,requestInit:t.init,error:t.error,isAborted:t.isAborted,handlingStack:t.handlingStack}}}(t,e,n)))}));const i=yo(e,{type:vo.RESOURCE,buffered:!0}).subscribe((t=>{for(const n of t)Yr(n)||s((()=>Ui(n,e)))}));function s(e){r.push((()=>{const n=e();n&&t.notify(11,n)}))}return o(e,(t=>{s((()=>Ui(t,e)))})),{stop:()=>{i.unsubscribe()}}}function Ui(t,e){const n=m(t.startTime),r=function(t,e){const n=t.traceId;if(!n)return;return{_dd:{trace_id:t.traceId,span_id:_r().toString(),rule_psr:e.rulePsr}}}(t,e);if(!e.trackResources&&!r)return;const o=Jr(t),i=$i(t),s=on({date:n.timeStamp,resource:{id:Y(),type:o,url:t.name,status_code:(a=t.responseStatus,0===a?void 0:a),protocol:ro(t),delivery_type:oo(t)},type:"resource",_dd:{discarded:!e.trackResources}},r,i);var a;return{startTime:n.relative,rawRumEvent:s,domainContext:{performanceEntry:t}}}function $i(t){const{renderBlockingStatus:e}=t;return{resource:{duration:Zr(t),render_blocking_status:e,...io(t),...Qr(t)}}}function zi(t,e,n=Mi){return function(t,e){let n;const{stop:r}=Wn(t,"complete",(()=>{n=j((()=>e()))}));return{stop:()=>{r(),q(n)}}}(t,(()=>{const t=n();(function(t){return t.loadEventEnd<=0})(t)||e(function(t){return{domComplete:t.domComplete,domContentLoaded:t.domContentLoadedEventEnd,domInteractive:t.domInteractive,loadEvent:t.loadEventEnd,firstByte:t.responseStart>=0&&t.responseStart<=b()?t.responseStart:void 0}}(t))}))}function Bi(t,e=window){let n,r;return"hidden"===document.visibilityState?n=0:(n=1/0,({stop:r}=Je(t,e,["pagehide","visibilitychange"],(t=>{"pagehide"!==t.type&&"hidden"!==document.visibilityState||(n=t.timeStamp,r())}),{capture:!0}))),{get timeStamp(){return n},stop(){null==r||r()}}}function Vi(t,e,n){const r={},{stop:o}=zi(t,(t=>{e(t.loadEvent),r.navigationTimings=t,n()})),i=Bi(t),{stop:s}=function(t,e,n){return{stop:yo(t,{type:vo.PAINT,buffered:!0}).subscribe((t=>{const r=t.find((t=>"first-contentful-paint"===t.name&&t.startTime<e.timeStamp&&t.startTime<6e5));r&&n(r.startTime)})).unsubscribe}}(t,i,(t=>{r.firstContentfulPaint=t,n()})),{stop:a}=function(t,e,n,r){let o=1/0;const{stop:i}=Je(t,n,["pointerdown","keydown"],(t=>{o=t.timeStamp}),{capture:!0,once:!0});let s=0;const a=yo(t,{type:vo.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe((n=>{const i=function(t,e){for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(e(r,n,t))return r}}(n,(t=>t.entryType===vo.LARGEST_CONTENTFUL_PAINT&&t.startTime<o&&t.startTime<e.timeStamp&&t.startTime<6e5&&t.size>s));if(i){let e;i.element&&(e=ri(i.element,t.actionNameAttribute)),r({value:i.startTime,targetSelector:e}),s=i.size}}));return{stop:()=>{i(),a.unsubscribe()}}}(t,i,window,(t=>{r.largestContentfulPaint=t,n()})),{stop:c}=function(t,e,n){const r=yo(t,{type:vo.FIRST_INPUT,buffered:!0}).subscribe((r=>{const o=r.find((t=>t.startTime<e.timeStamp));if(o){const e=k(o.startTime,o.processingStart);let r;o.target&&xo(o.target)&&(r=ri(o.target,t.actionNameAttribute)),n({delay:e>=0?e:0,time:o.startTime,targetSelector:r})}}));return{stop:()=>{r.unsubscribe()}}}(t,i,(t=>{r.firstInput=t,n()}));return{stop:function(){o(),s(),a(),c(),i.stop()},initialViewMetrics:r}}function Fi(t,e,n){if(!Gi())return{stop:X};let r,o,i=0;n({value:0});const s=function(){let t,e,n=0,r=0;return{update:o=>{let i;return void 0===t||o.startTime-e>=Hi||o.startTime-t>=qi?(t=e=o.startTime,r=n=o.value,i=!0):(n+=o.value,e=o.startTime,i=o.value>r,i&&(r=o.value)),{cumulatedValue:n,isMaxValue:i}}}}(),a=yo(t,{type:vo.LAYOUT_SHIFT,buffered:!0}).subscribe((a=>{for(const c of a){if(c.hadRecentInput||c.startTime<e)continue;const{cumulatedValue:a,isMaxValue:u}=s.update(c);if(u){const t=ji(c.sources);r=t?new WeakRef(t):void 0,o=k(e,c.startTime)}if(a>i){i=a;const e=null==r?void 0:r.deref();n({value:l(i,4),targetSelector:e&&ri(e,t.actionNameAttribute),time:o})}}}));return{stop:()=>{a.unsubscribe()}}}function ji(t){var e;if(t)return null===(e=t.find((t=>!!t.node&&xo(t.node))))||void 0===e?void 0:e.node}const qi=5e3,Hi=f;function Gi(){return bo(vo.LAYOUT_SHIFT)&&"WeakRef"in window}let Wi,Ki=0,Ji=1/0,Xi=0;const Yi=()=>Wi?Ki:window.performance.interactionCount||0;function Zi(t,e,n){if(!(bo(vo.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return{getInteractionToNextPaint:()=>{},setViewEnd:X,stop:X};const{getViewInteractionCount:r,stopViewInteractionCount:o}=function(t){"interactionCount"in performance||Wi||(Wi=new window.PerformanceObserver(z((t=>{t.getEntries().forEach((t=>{const e=t;e.interactionId&&(Ji=Math.min(Ji,e.interactionId),Xi=Math.max(Xi,e.interactionId),Ki=(Xi-Ji)/7+1)}))}))),Wi.observe({type:"event",buffered:!0,durationThreshold:0}));const e="initial_load"===t?0:Yi();let n={stopped:!1};function r(){return Yi()-e}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:r(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:r()}}}}(n);let i=1/0;const s=function(t){const e=[];function n(){e.sort(((t,e)=>e.duration-t.duration)).splice(10)}return{process(t){const r=e.findIndex((e=>t.interactionId===e.interactionId)),o=e[e.length-1];-1!==r?t.duration>e[r].duration&&(e[r]=t,n()):(e.length<10||t.duration>o.duration)&&(e.push(t),n())},estimateP98Interaction(){const n=Math.min(e.length-1,Math.floor(t()/50));return e[n]}}}(r);let a,c,u=-1;function l(n){for(const t of n)t.interactionId&&t.startTime>=e&&t.startTime<=i&&s.process(t);const r=s.estimateP98Interaction();r&&r.duration!==u&&(u=r.duration,c=k(e,r.startTime),a=function(t){const e=bi.get(t);return bi.delete(t),e}(r.startTime),!a&&r.target&&xo(r.target)&&(a=ri(r.target,t.actionNameAttribute)))}const d=yo(t,{type:vo.FIRST_INPUT,buffered:!0}).subscribe(l),f=yo(t,{type:vo.EVENT,durationThreshold:40,buffered:!0}).subscribe(l);return{getInteractionToNextPaint:()=>u>=0?{value:Math.min(u,6e4),targetSelector:a,time:c}:r()?{value:0}:void 0,setViewEnd:t=>{i=t,o()},stop:()=>{f.unsubscribe(),d.unsubscribe()}}}function Qi(){let t;const e=window.visualViewport;return t=e?e.pageLeft-e.offsetLeft:void 0!==window.scrollX?window.scrollX:window.pageXOffset||0,Math.round(t)}function ts(){let t;const e=window.visualViewport;return t=e?e.pageTop-e.offsetTop:void 0!==window.scrollY?window.scrollY:window.pageYOffset||0,Math.round(t)}let es;function ns(t){return es||(es=function(t){return new W((e=>{const{throttled:n}=J((()=>{e.notify(rs())}),200);return Ke(t,window,"resize",n,{capture:!0,passive:!0}).stop}))}(t)),es}function rs(){const t=window.visualViewport;return t?{width:Number(t.width*t.scale),height:Number(t.height*t.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}function os(t,e,n,r=function(t,e=1e3){return new W((n=>{function r(){n.notify(function(){const t=ts(),{height:e}=rs(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),r=Math.round(e+t);return{scrollHeight:n,scrollDepth:r,scrollTop:t}}())}if(window.ResizeObserver){const n=J(r,e,{leading:!1,trailing:!0}),o=document.scrollingElement||document.documentElement,i=new ResizeObserver(z(n.throttled));o&&i.observe(o);const s=Ke(t,window,"scroll",n.throttled,{passive:!0});return()=>{n.cancel(),i.disconnect(),s.stop()}}}))}(t)){let o=0,i=0,s=0;const a=r.subscribe((({scrollDepth:t,scrollTop:r,scrollHeight:a})=>{let c=!1;if(t>o&&(o=t,c=!0),a>i){i=a;const t=b();s=k(e.relative,t),c=!0}c&&n({maxDepth:Math.min(o,i),maxDepthScrollTop:r,maxScrollHeight:i,maxScrollHeightTime:s})}));return{stop:()=>a.unsubscribe()}}function is(t,e,n,r,o,i,s){const a={},{stop:c,setLoadEvent:u}=function(t,e,n,r,o,i,s){let a="initial_load"===o,c=!0;const u=[],l=Bi(r);function d(){if(!c&&!a&&u.length>0){const t=Math.max(...u);t<l.timeStamp&&s(t)}}const{stop:f}=So(t,e,n,r,(t=>{c&&(c=!1,t.hadActivity&&u.push(k(i.timeStamp,t.end)),d())}));return{stop:()=>{f(),l.stop()},setLoadEvent:t=>{a&&(a=!1,u.push(t),d())}}}(t,e,n,r,i,s,(t=>{a.loadingTime=t,o()})),{stop:l}=os(r,s,(t=>{a.scroll=t})),{stop:d}=Fi(r,s.relative,(t=>{a.cumulativeLayoutShift=t,o()})),{stop:f,getInteractionToNextPaint:p,setViewEnd:h}=Zi(r,s.relative,i);return{stop:()=>{c(),d(),l()},stopINPTracking:f,setLoadEvent:u,setViewEnd:h,getCommonViewMetrics:()=>(a.interactionToNextPaint=p(),a)}}const ss=3e5,as=3e5;function cs(t,e,n,r,i,s,a,c){const u=new Set;let l,d=f("initial_load",S(),c);function f(s,a,c){const l=function(t,e,n,r,i,s,a=w(),c){const u=Y(),l=new W,d={};let f,p=0;const m=N(i),g=sr();let v,y,b,S,C=!0;c&&(v=c.name,y=c.service||void 0,b=c.version||void 0,c.context&&(S=c.context,g.setContext(S)));const x={id:u,name:v,startClocks:a,service:y,version:b,context:S};t.notify(1,x),t.notify(2,x);const{throttled:T,cancel:E}=J(z,3e3,{leading:!1}),{setLoadEvent:A,setViewEnd:R,stop:I,stopINPTracking:O,getCommonViewMetrics:L}=is(t,e,n,r,T,s,a),{stop:M,initialViewMetrics:D}="initial_load"===s?Vi(r,A,T):{stop:X,initialViewMetrics:{}},{stop:P,eventCounts:U}=function(t,e,n){const{stop:r,eventCounts:o}=mo({lifeCycle:t,isChildEvent:t=>t.view.id===e,onChange:n});return{stop:r,eventCounts:o}}(t,u,T),$=H(z,ss);function z(){E(),p+=1;const e=void 0===f?_():f.timeStamp;t.notify(3,{customTimings:d,documentVersion:p,id:u,name:v,service:y,version:b,context:g.getContext(),loadingType:s,location:m,startClocks:a,commonViewMetrics:L(),initialViewMetrics:D,duration:k(a.timeStamp,e),isActive:void 0===f,sessionIsActive:C,eventCounts:U})}return z(),g.changeObservable.subscribe(z),{get name(){return v},service:y,version:b,contextManager:g,stopObservable:l,end(e={}){var n,r;f||(f=null!==(n=e.endClocks)&&void 0!==n?n:w(),C=null===(r=e.sessionIsActive)||void 0===r||r,t.notify(4,{endClocks:f}),t.notify(5,{endClocks:f}),G($),R(f.relative),I(),z(),j((()=>{this.stop()}),as))},stop(){M(),P(),O(),l.notify()},addTiming(t,e){if(f)return;const n=function(t){return t<h}(e)?e:k(a.timeStamp,e);d[function(t){const e=t.replace(/[^a-zA-Z0-9-_.@$]/g,"_");e!==t&&o.warn(`Invalid timing name: ${t}, sanitized to: ${e}`);return e}(t)]=n,T()},setViewName(t){v=t,z()}}}(e,n,r,i,t,s,a,c);return u.add(l),l.stopObservable.subscribe((()=>{u.delete(l)})),l}return e.subscribe(9,(()=>{d=f("route_change",void 0,{name:d.name,service:d.service,version:d.version,context:d.contextManager.getContext()})})),e.subscribe(8,(()=>{d.end({sessionIsActive:!1})})),e.subscribe(10,(t=>{t.reason===Bn.UNLOADING&&d.end()})),a&&(l=function(t){return t.subscribe((({oldLocation:t,newLocation:e})=>{var n,r;r=e,((n=t).pathname!==r.pathname||!function(t){const e=t.substring(1);return""!==e&&!!document.getElementById(e)}(r.hash)&&us(r.hash)!==us(n.hash))&&(d.end(),d=f("route_change"))}))}(s)),{addTiming:(t,e=_())=>{d.addTiming(t,e)},startView:(t,e)=>{d.end({endClocks:e}),d=f("route_change",e,t)},setViewContext:t=>{d.contextManager.setContext(t)},setViewContextProperty:(t,e)=>{d.contextManager.setContextProperty(t,e)},setViewName:t=>{d.setViewName(t)},stop:()=>{l&&l.unsubscribe(),d.end(),u.forEach((t=>t.stop()))}}}function us(t){const e=t.indexOf("?");return e<0?t:t.slice(0,e)}function ls(t,e,n,r,o,i,s,a,c,u){return t.subscribe(3,(n=>t.notify(11,function(t,e,n,r,o){var i,s,a,c,u,l,d,f,p,h,m,g,y,_,b,w;const S=r.getReplayStats(t.id),k=n.findFeatureFlagEvaluations(t.startClocks.relative),C=o.findAll(t.startClocks.relative,t.duration),x={_dd:{document_version:t.documentVersion,replay_stats:S,page_states:C,configuration:{start_session_replay_recording_manually:e.startSessionReplayRecordingManually}},date:t.startClocks.timeStamp,type:"view",view:{action:{count:t.eventCounts.actionCount},frustration:{count:t.eventCounts.frustrationCount},cumulative_layout_shift:null===(i=t.commonViewMetrics.cumulativeLayoutShift)||void 0===i?void 0:i.value,cumulative_layout_shift_time:v(null===(s=t.commonViewMetrics.cumulativeLayoutShift)||void 0===s?void 0:s.time),cumulative_layout_shift_target_selector:null===(a=t.commonViewMetrics.cumulativeLayoutShift)||void 0===a?void 0:a.targetSelector,first_byte:v(null===(c=t.initialViewMetrics.navigationTimings)||void 0===c?void 0:c.firstByte),dom_complete:v(null===(u=t.initialViewMetrics.navigationTimings)||void 0===u?void 0:u.domComplete),dom_content_loaded:v(null===(l=t.initialViewMetrics.navigationTimings)||void 0===l?void 0:l.domContentLoaded),dom_interactive:v(null===(d=t.initialViewMetrics.navigationTimings)||void 0===d?void 0:d.domInteractive),error:{count:t.eventCounts.errorCount},first_contentful_paint:v(t.initialViewMetrics.firstContentfulPaint),first_input_delay:v(null===(f=t.initialViewMetrics.firstInput)||void 0===f?void 0:f.delay),first_input_time:v(null===(p=t.initialViewMetrics.firstInput)||void 0===p?void 0:p.time),first_input_target_selector:null===(h=t.initialViewMetrics.firstInput)||void 0===h?void 0:h.targetSelector,interaction_to_next_paint:v(null===(m=t.commonViewMetrics.interactionToNextPaint)||void 0===m?void 0:m.value),interaction_to_next_paint_time:v(null===(g=t.commonViewMetrics.interactionToNextPaint)||void 0===g?void 0:g.time),interaction_to_next_paint_target_selector:null===(y=t.commonViewMetrics.interactionToNextPaint)||void 0===y?void 0:y.targetSelector,is_active:t.isActive,name:t.name,largest_contentful_paint:v(null===(_=t.initialViewMetrics.largestContentfulPaint)||void 0===_?void 0:_.value),largest_contentful_paint_target_selector:null===(b=t.initialViewMetrics.largestContentfulPaint)||void 0===b?void 0:b.targetSelector,load_event:v(null===(w=t.initialViewMetrics.navigationTimings)||void 0===w?void 0:w.loadEvent),loading_time:ho(v(t.commonViewMetrics.loadingTime)),loading_type:t.loadingType,long_task:{count:t.eventCounts.longTaskCount},resource:{count:t.eventCounts.resourceCount},time_spent:v(t.duration)},feature_flags:k&&!L(k)?k:void 0,display:t.commonViewMetrics.scroll?{scroll:{max_depth:t.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:t.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:t.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:v(t.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,session:{has_replay:!!S||void 0,is_active:!!t.sessionIsActive&&void 0},privacy:{replay_level:e.defaultPrivacyLevel}};L(t.customTimings)||(x.view.custom_timings=function(t,e){const n={};for(const r of Object.keys(t))n[r]=e(t[r]);return n}(t.customTimings,v));return{rawRumEvent:x,startTime:t.startClocks.relative,domainContext:{location:t.location}}}(n,e,s,c,a)))),cs(n,t,r,o,e,i,!e.trackViewsManually,u)}function ds(t,e,n){const r=Tn(t,"rum",(e=>function(t,e){let n;n=function(t){return"0"===t||"1"===t||"2"===t}(e)?e:u(t.sessionSampleRate)?u(t.sessionReplaySampleRate)?"1":"2":"0";return{trackingType:n,isTracked:fs(n)}}(t,e)),n);return r.expireObservable.subscribe((()=>{e.notify(8)})),r.renewObservable.subscribe((()=>{e.notify(9)})),r.sessionStateUpdateObservable.subscribe((({previousState:t,newState:e})=>{if(!t.forcedReplay&&e.forcedReplay){const t=r.findSession();t&&(t.isReplayForced=!0)}})),{findTrackedSession:t=>{const e=r.findSession(t);if(e&&fs(e.trackingType))return{id:e.id,sessionReplay:"1"===e.trackingType?1:e.isReplayForced?2:0,anonymousId:e.anonymousId}},expire:r.expire,expireObservable:r.expireObservable,setForcedReplay:()=>r.updateSessionState({forcedReplay:"1"})}}function fs(t){return"2"===t||"1"===t}function ps(t,e,n,r,o,i,s){const a=t.replica,c=function(t,e,n,r,o,i,s=Fn){const a=u(t,e),c=n&&u(t,n);function u(t,{endpoint:e,encoder:n}){return s({encoder:n,request:Mn(e,t.batchBytesLimit,r),flushController:qn({messagesLimit:t.batchMessagesLimit,bytesLimit:t.batchBytesLimit,durationLimit:t.flushTimeout,pageExitObservable:o,sessionExpireObservable:i}),messageBytesLimit:t.messageBytesLimit})}return{flushObservable:a.flushController.flushObservable,add(t,e=!0){a.add(t),c&&e&&c.add(n.transformMessage?n.transformMessage(t):t)},upsert:(t,e)=>{a.upsert(t,e),c&&c.upsert(n.transformMessage?n.transformMessage(t):t,e)},stop:()=>{a.stop(),c&&c.stop()}}}(t,{endpoint:t.rumEndpointBuilder,encoder:s(2)},a&&{endpoint:a.rumEndpointBuilder,transformMessage:t=>on(t,{application:{id:a.applicationId}}),encoder:s(3)},r,o,i);return e.subscribe(12,(t=>{"view"===t.type?c.upsert(t,t.view.id):c.add(t)})),n.subscribe((e=>c.add(e,function(t){return t.site===Jt}(t)))),c}const hs=ht;function ms(t,e){let n=N(e);return new W((r=>{const{stop:o}=function(t,e){const{stop:n}=Ie(gs("pushState"),"pushState",(({onPostCall:t})=>{t(e)})),{stop:r}=Ie(gs("replaceState"),"replaceState",(({onPostCall:t})=>{t(e)})),{stop:o}=Ke(t,window,"popstate",e);return{stop:()=>{n(),r(),o()}}}(t,s),{stop:i}=function(t,e){return Ke(t,window,"hashchange",e)}(t,s);function s(){if(n.href===e.href)return;const t=N(e);r.notify({newLocation:t,oldLocation:n}),n=t}return()=>{o(),i()}}))}function gs(t){return Object.prototype.hasOwnProperty.call(history,t)?history:History.prototype}const vs=ht;let ys,_s,bs;function ws(){0!==ys.batchCount&&(vn("Customer data measures",ys),Cs())}function Ss(t,e){t.sum+=e,t.min=Math.min(t.min,e),t.max=Math.max(t.max,e)}function ks(t,e){t.sum+=e.sum,t.min=Math.min(t.min,e.min),t.max=Math.max(t.max,e.max)}function Cs(){ys={batchCount:0,batchBytesCount:{min:1/0,max:0,sum:0},batchMessagesCount:{min:1/0,max:0,sum:0},globalContextBytes:{min:1/0,max:0,sum:0},userContextBytes:{min:1/0,max:0,sum:0},featureFlagBytes:{min:1/0,max:0,sum:0}}}function xs(){bs=!1,_s={globalContextBytes:{min:1/0,max:0,sum:0},userContextBytes:{min:1/0,max:0,sum:0},featureFlagBytes:{min:1/0,max:0,sum:0}}}const Ts=ht;function Es(t,e=500){const n=kn({expireDelay:Ts,maxEntries:4e3});let r;i(As(),b());const{stop:o}=Je(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],(t=>{i(function(t){if("freeze"===t.type)return"frozen";if("pagehide"===t.type)return t.persisted?"frozen":"terminated";return As()}(t),t.timeStamp)}),{capture:!0});function i(t,e=b()){t!==r&&(r=t,n.closeActive(e),n.add({state:r,startTime:e},e))}const s={findAll:(t,r)=>{const o=n.findAll(t,r);if(0===o.length)return;const i=[],s=Math.max(0,o.length-e);for(let e=o.length-1;e>=s;e--){const n=o[e],r=k(t,n.startTime);i.push({state:n.state,start:v(r)})}return i},wasInPageStateAt:(t,e)=>s.wasInPageStateDuringPeriod(t,e,0),wasInPageStateDuringPeriod:(t,e,r)=>n.findAll(e,r).some((e=>e.state===t)),addPageState:i,stop:()=>{o(),n.stop()}};return s}function As(){return"hidden"===document.visibilityState?"hidden":document.hasFocus()?"active":"passive"}function Rs(t,e){const n=window.cookieStore?function(t){return(e,n)=>Ke(t,window.cookieStore,"change",(t=>{const r=t.changed.find((t=>t.name===e))||t.deleted.find((t=>t.name===e));r&&n(r.value)})).stop}(t):Ns;return new W((t=>n(e,(e=>t.notify(e)))))}const Is=f;function Ns(t,e){const n=Q(document.cookie,t),r=H((()=>{const r=Q(document.cookie,t);r!==n&&e(r)}),Is);return()=>{G(r)}}const Os="datadog-ci-visibility-test-execution-id";function Ls(t,{session:e,viewContext:n,errorType:r}){const o=e?e.id:"no-session-id",i=[];void 0!==r&&i.push(`error-type=${r}`),n&&(i.push(`seed=${n.id}`),i.push(`from=${n.startClocks.timeStamp}`));const s=function(t){const e=t.site,n=t.subdomain||function(t){switch(t.site){case Yt:case Zt:return"app";case Jt:return"dd";default:return}}(t);return`https://${n?`${n}.`:""}${e}`}(t);return`${s}${`/rum/replay/sessions/${o}`}?${i.join("&")}`}let Ms;function Ds(t){return Ps(t).segments_count}function Ps(t){let e;return Ms||(Ms=new Map),Ms.has(t)?e=Ms.get(t):(e={records_count:0,segments_count:0,segments_total_raw_size:0},Ms.set(t,e),Ms.size>10&&function(){if(!Ms)return;const t=Ms.keys().next().value;t&&Ms.delete(t)}()),e}function Us(t,e,n){let r,o=0,i=[],s=0;const a=[],{stop:c}=Ke(t,e,"message",(({data:t})=>{if("wrote"!==t.type||t.streamId!==n)return;o+=t.additionalBytesCount,i.push(t.result),r=t.trailer;const e=a.shift();e&&e.id===t.id?e.writeCallback?e.writeCallback(t.result.byteLength):e.finishCallback&&e.finishCallback():(c(),vn("Worker responses received out of order."))}));function u(){const t=0===i.length?new Uint8Array(0):function(t){const e=t.reduce(((t,e)=>t+e.length),0),n=new Uint8Array(e);let r=0;for(const e of t)n.set(e,r),r+=e.length;return n}(i.concat(r)),e={rawBytesCount:o,output:t,outputBytesCount:t.byteLength,encoding:"deflate"};return o=0,i=[],e}function l(){s>0&&(e.postMessage({action:"reset",streamId:n}),s=0)}return{isAsync:!0,get isEmpty(){return 0===s},write(t,r){e.postMessage({action:"write",id:s,data:t,streamId:n}),a.push({id:s,writeCallback:r,data:t}),s+=1},finish(t){l(),a.length?(a.forEach((t=>{delete t.writeCallback})),a[a.length-1].finishCallback=()=>t(u())):t(u())},finishSync(){l();const t=a.map((t=>(delete t.writeCallback,delete t.finishCallback,t.data))).join("");return{...u(),pendingData:t}},estimateEncodedBytesCount:t=>t.length/8,stop(){c()}}}function $s(t){return new Worker(t.workerUrl||URL.createObjectURL(new Blob(['(()=>{"use strict";function t(t){const e=t.reduce(((t,e)=>t+e.length),0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=256,n=286,r=30,i=15,s=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),h=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),l=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),_=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),o=new Array(576);e(o);var d=new Array(60);e(d);var u=new Array(512);e(u);var f=new Array(256);e(f);var c=new Array(29);e(c);var p,g,w,v=new Array(r);function b(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function m(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(v);var y=function(t){return t<256?u[t]:u[256+(t>>>7)]},k=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},z=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,k(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},x=function(t,e,a){z(t,a[2*e],a[2*e+1])},A=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},U=function(t,e,a){var n,r,s=new Array(16),h=0;for(n=1;n<=i;n++)s[n]=h=h+a[n-1]<<1;for(r=0;r<=e;r++){var l=t[2*r+1];0!==l&&(t[2*r]=A(s[l]++,l))}},I=function(t){var e;for(e=0;e<n;e++)t.dyn_ltree[2*e]=0;for(e=0;e<r;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},B=function(t){t.bi_valid>8?k(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},E=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},S=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&E(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!E(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},C=function(t,e,n){var r,i,l,_,o=0;if(0!==t.last_lit)do{r=t.pending_buf[t.d_buf+2*o]<<8|t.pending_buf[t.d_buf+2*o+1],i=t.pending_buf[t.l_buf+o],o++,0===r?x(t,i,e):(l=f[i],x(t,l+a+1,e),0!==(_=s[l])&&(i-=c[l],z(t,i,_)),r--,l=y(r),x(t,l,n),0!==(_=h[l])&&(r-=v[l],z(t,r,_)))}while(o<t.last_lit);x(t,256,e)},D=function(t,e){var a,n,r,s=e.dyn_tree,h=e.stat_desc.static_tree,l=e.stat_desc.has_stree,_=e.stat_desc.elems,o=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<_;a++)0!==s[2*a]?(t.heap[++t.heap_len]=o=a,t.depth[a]=0):s[2*a+1]=0;for(;t.heap_len<2;)s[2*(r=t.heap[++t.heap_len]=o<2?++o:0)]=1,t.depth[r]=0,t.opt_len--,l&&(t.static_len-=h[2*r+1]);for(e.max_code=o,a=t.heap_len>>1;a>=1;a--)S(t,s,a);r=_;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,s,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,s[2*r]=s[2*a]+s[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,s[2*a+1]=s[2*n+1]=r,t.heap[1]=r++,S(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,s,h,l,_=e.dyn_tree,o=e.max_code,d=e.stat_desc.static_tree,u=e.stat_desc.has_stree,f=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,p=e.stat_desc.max_length,g=0;for(s=0;s<=i;s++)t.bl_count[s]=0;for(_[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(s=_[2*_[2*(n=t.heap[a])+1]+1]+1)>p&&(s=p,g++),_[2*n+1]=s,n>o||(t.bl_count[s]++,h=0,n>=c&&(h=f[n-c]),l=_[2*n],t.opt_len+=l*(s+h),u&&(t.static_len+=l*(d[2*n+1]+h)));if(0!==g){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,g-=2}while(g>0);for(s=p;0!==s;s--)for(n=t.bl_count[s];0!==n;)(r=t.heap[--a])>o||(_[2*r+1]!==s&&(t.opt_len+=(s-_[2*r+1])*_[2*r],_[2*r+1]=s),n--)}}(t,e),U(s,o,t.bl_count)},j=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},M=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{x(t,r,t.bl_tree)}while(0!=--h);else 0!==r?(r!==i&&(x(t,r,t.bl_tree),h--),x(t,16,t.bl_tree),z(t,h-3,2)):h<=10?(x(t,17,t.bl_tree),z(t,h-3,3)):(x(t,18,t.bl_tree),z(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},L=!1,T=function(t,e,a,n){z(t,0+(n?1:0),3),function(t,e,a,n){B(t),n&&(k(t,a),k(t,~a)),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a,!0)},H=function(t,e,n,r){var i,s,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<a;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),D(t,t.l_desc),D(t,t.d_desc),h=function(t){var e;for(j(t,t.dyn_ltree,t.l_desc.max_code),j(t,t.dyn_dtree,t.d_desc.max_code),D(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*_[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(s=t.static_len+3+7>>>3)<=i&&(i=s)):i=s=n+5,n+4<=i&&-1!==e?T(t,e,n,r):4===t.strategy||s===i?(z(t,2+(r?1:0),3),C(t,o,d)):(z(t,4+(r?1:0),3),function(t,e,a,n){var r;for(z(t,e-257,5),z(t,a-1,5),z(t,n-4,4),r=0;r<n;r++)z(t,t.bl_tree[2*_[r]+1],3);M(t,t.dyn_ltree,e-1),M(t,t.dyn_dtree,a-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),C(t,t.dyn_ltree,t.dyn_dtree)),I(t),r&&B(t)},R={_tr_init:function(t){L||(!function(){var t,e,a,_,m,y=new Array(16);for(a=0,_=0;_<28;_++)for(c[_]=a,t=0;t<1<<s[_];t++)f[a++]=_;for(f[a-1]=_,m=0,_=0;_<16;_++)for(v[_]=m,t=0;t<1<<h[_];t++)u[m++]=_;for(m>>=7;_<r;_++)for(v[_]=m<<7,t=0;t<1<<h[_]-7;t++)u[256+m++]=_;for(e=0;e<=i;e++)y[e]=0;for(t=0;t<=143;)o[2*t+1]=8,t++,y[8]++;for(;t<=255;)o[2*t+1]=9,t++,y[9]++;for(;t<=279;)o[2*t+1]=7,t++,y[7]++;for(;t<=287;)o[2*t+1]=8,t++,y[8]++;for(U(o,287,y),t=0;t<r;t++)d[2*t+1]=5,d[2*t]=A(t,5);p=new b(o,s,257,n,i),g=new b(d,h,0,r,i),w=new b(new Array(0),l,0,19,7)}(),L=!0),t.l_desc=new m(t.dyn_ltree,p),t.d_desc=new m(t.dyn_dtree,g),t.bl_desc=new m(t.bl_tree,w),t.bi_buf=0,t.bi_valid=0,I(t)},_tr_stored_block:T,_tr_flush_block:H,_tr_tally:function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(f[n]+a+1)]++,t.dyn_dtree[2*y(e)]++),t.last_lit===t.lit_bufsize-1},_tr_align:function(t){z(t,2,3),x(t,256,o),function(t){16===t.bi_valid?(k(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},K=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},N=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),O=function(t,e,a,n){var r=N,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return~t},q={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},F=0,G=2,J=3,P=4,Q=0,V=1,W=-1,X=0,Y=8,Z=R._tr_init,$=R._tr_stored_block,tt=R._tr_flush_block,et=R._tr_tally,at=R._tr_align,nt=F,rt=1,it=J,st=P,ht=5,lt=Q,_t=V,ot=-2,dt=-3,ut=-5,ft=W,ct=1,pt=2,gt=3,wt=4,vt=X,bt=2,mt=Y,yt=258,kt=262,zt=103,xt=113,At=666,Ut=function(t,e){return t.msg=q[e],e},It=function(t){return(t<<1)-(t>4?9:0)},Bt=function(t){for(var e=t.length;--e>=0;)t[e]=0},Et=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},St=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Ct=function(t,e){tt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,St(t.strm)},Dt=function(t,e){t.pending_buf[t.pending++]=e},jt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Mt=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-kt?t.strstart-(t.w_size-kt):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+yt,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=yt-(u-i),i=u-yt,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!=--r);return s<=t.lookahead?s:t.lookahead},Lt=function(t){var e,a,n,r,i,s,h,l,_,o,d=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-kt)){t.window.set(t.window.subarray(d,d+d),0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=d?n-d:0}while(--a);e=a=d;do{n=t.prev[--e],t.prev[e]=n>=d?n-d:0}while(--a);r+=d}if(0===t.strm.avail_in)break;if(s=t.strm,h=t.window,l=t.strstart+t.lookahead,_=r,o=void 0,(o=s.avail_in)>_&&(o=_),a=0===o?0:(s.avail_in-=o,h.set(s.input.subarray(s.next_in,s.next_in+o),l),1===s.state.wrap?s.adler=K(s.adler,h,o,l):2===s.state.wrap&&(s.adler=O(s.adler,h,o,l)),s.next_in+=o,s.total_in+=o,o),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Et(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Et(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<kt&&0!==t.strm.avail_in)},Tt=function(t,e){for(var a,n;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a)),t.match_length>=3)if(n=et(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Et(t,t.ins_h,t.window[t.strstart+1]);else n=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2},Ht=function(t,e){for(var a,n,r;;){if(t.lookahead<kt){if(Lt(t),t.lookahead<kt&&e===nt)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-kt&&(t.match_length=Mt(t,a),t.match_length<=5&&(t.strategy===ct||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=et(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=Et(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Ct(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=et(t,0,t.window[t.strstart-1]))&&Ct(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=et(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2};function Rt(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var Kt=[new Rt(0,0,0,0,(function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Lt(t),0===t.lookahead&&e===nt)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Ct(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-kt&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Ct(t,!1),t.strm.avail_out),1)})),new Rt(4,4,8,4,Tt),new Rt(4,5,16,8,Tt),new Rt(4,6,32,32,Tt),new Rt(4,4,16,16,Ht),new Rt(8,16,32,32,Ht),new Rt(8,16,128,128,Ht),new Rt(8,32,128,256,Ht),new Rt(32,128,258,1024,Ht),new Rt(32,258,258,4096,Ht)];function Nt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=mt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Bt(this.dyn_ltree),Bt(this.dyn_dtree),Bt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Bt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Bt(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ot=function(t){if(!t||!t.state)return Ut(t,ot);t.total_in=t.total_out=0,t.data_type=bt;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:xt,t.adler=2===e.wrap?0:1,e.last_flush=nt,Z(e),lt},qt=function(t){var e,a=Ot(t);return a===lt&&((e=t.state).window_size=2*e.w_size,Bt(e.head),e.max_lazy_match=Kt[e.level].max_lazy,e.good_match=Kt[e.level].good_length,e.nice_match=Kt[e.level].nice_length,e.max_chain_length=Kt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),a},Ft=function(t,e,a,n,r,i){if(!t)return ot;var s=1;if(e===ft&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||a!==mt||n<8||n>15||e<0||e>9||i<0||i>wt)return Ut(t,ot);8===n&&(n=9);var h=new Nt;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,qt(t)},Gt={deflateInit:function(t,e){return Ft(t,e,mt,15,8,vt)},deflateInit2:Ft,deflateReset:qt,deflateResetKeep:Ot,deflateSetHeader:function(t,e){return t&&t.state?2!==t.state.wrap?ot:(t.state.gzhead=e,lt):ot},deflate:function(t,e){var a,n;if(!t||!t.state||e>ht||e<0)return t?Ut(t,ot):ot;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===At&&e!==st)return Ut(t,0===t.avail_out?ut:ot);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Dt(r,31),Dt(r,139),Dt(r,8),r.gzhead?(Dt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Dt(r,255&r.gzhead.time),Dt(r,r.gzhead.time>>8&255),Dt(r,r.gzhead.time>>16&255),Dt(r,r.gzhead.time>>24&255),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Dt(r,255&r.gzhead.extra.length),Dt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=O(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,0),Dt(r,9===r.level?2:r.strategy>=pt||r.level<2?4:0),Dt(r,3),r.status=xt);else{var s=mt+(r.w_bits-8<<4)<<8;s|=(r.strategy>=pt||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=32),s+=31-s%31,r.status=xt,jt(r,s),0!==r.strstart&&(jt(r,t.adler>>>16),jt(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending!==r.pending_buf_size));)Dt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),St(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Dt(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=O(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=zt)}else r.status=zt;if(r.status===zt&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&St(t),r.pending+2<=r.pending_buf_size&&(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),t.adler=0,r.status=xt)):r.status=xt),0!==r.pending){if(St(t),0===t.avail_out)return r.last_flush=-1,lt}else if(0===t.avail_in&&It(e)<=It(i)&&e!==st)return Ut(t,ut);if(r.status===At&&0!==t.avail_in)return Ut(t,ut);if(0!==t.avail_in||0!==r.lookahead||e!==nt&&r.status!==At){var h=r.strategy===pt?function(t,e){for(var a;;){if(0===t.lookahead&&(Lt(t),0===t.lookahead)){if(e===nt)return 1;break}if(t.match_length=0,a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===gt?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=yt){if(Lt(t),t.lookahead<=yt&&e===nt)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+yt;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=yt-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=et(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=et(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Ct(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===st?(Ct(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Ct(t,!1),0===t.strm.avail_out)?1:2}(r,e):Kt[r.level].func(r,e);if(3!==h&&4!==h||(r.status=At),1===h||3===h)return 0===t.avail_out&&(r.last_flush=-1),lt;if(2===h&&(e===rt?at(r):e!==ht&&($(r,0,0,!1),e===it&&(Bt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),St(t),0===t.avail_out))return r.last_flush=-1,lt}return e!==st?lt:r.wrap<=0?_t:(2===r.wrap?(Dt(r,255&t.adler),Dt(r,t.adler>>8&255),Dt(r,t.adler>>16&255),Dt(r,t.adler>>24&255),Dt(r,255&t.total_in),Dt(r,t.total_in>>8&255),Dt(r,t.total_in>>16&255),Dt(r,t.total_in>>24&255)):(jt(r,t.adler>>>16),jt(r,65535&t.adler)),St(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?lt:_t)},deflateEnd:function(t){if(!t||!t.state)return ot;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==zt&&e!==xt&&e!==At?Ut(t,ot):(t.state=null,e===xt?Ut(t,dt):lt)},deflateSetDictionary:function(t,e){var a=e.length;if(!t||!t.state)return ot;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return ot;if(1===r&&(t.adler=K(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(Bt(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,Lt(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=Et(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,Lt(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,lt},deflateInfo:"pako deflate (from Nodeca project)"};for(var Jt=new Uint8Array(256),Pt=0;Pt<256;Pt++)Jt[Pt]=Pt>=252?6:Pt>=248?5:Pt>=240?4:Pt>=224?3:Pt>=192?2:1;Jt[254]=Jt[254]=1;var Qt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Vt=Object.prototype.toString,Wt=F,Xt=G,Yt=J,Zt=P,$t=Q,te=V,ee=W,ae=X,ne=Y;function re(){this.options={level:ee,method:ne,chunkSize:16384,windowBits:15,memLevel:8,strategy:ae};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Qt,this.strm.avail_out=0;var e=Gt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(e!==$t)throw new Error(q[e]);if(t.header&&Gt.deflateSetHeader(this.strm,t.header),t.dictionary){var a;if(a="[object ArrayBuffer]"===Vt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(e=Gt.deflateSetDictionary(this.strm,a))!==$t)throw new Error(q[e]);this._dict_set=!0}}function ie(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:String(e),streamId:a})}}function se(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}re.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?Zt:Wt,"[object ArrayBuffer]"===Vt.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(n===Xt||n===Yt)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if((a=Gt.deflate(r,n))===te)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=Gt.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===$t;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},re.prototype.onData=function(t){this.chunks.push(t)},re.prototype.onEnd=function(t){t===$t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",(n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.0.0"};case"write":{let n=e.get(a.streamId);n||(n=new re,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,G),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:se(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){ie(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}}))}catch(t){ie(e,t)}}()})();'])))}let zs={status:0};function Bs(t,e,n,r=$s){switch(0===zs.status&&function(t,e,n=$s){try{const r=n(t),{stop:i}=Ke(t,r,"error",(n=>{Fs(t,e,n)})),{stop:s}=Ke(t,r,"message",(({data:n})=>{var r;"errored"===n.type?Fs(t,e,n.error,n.streamId):"initialized"===n.type&&(r=n.version,1===zs.status&&(zs={status:3,worker:zs.worker,stop:zs.stop,version:r}))}));r.postMessage({action:"init"}),j((()=>function(t){1===zs.status&&(o.error(`${t} failed to start: a timeout occurred while initializing the Worker`),zs.initializationFailureCallbacks.forEach((t=>t())),zs={status:2})}(e)),3e4);zs={status:1,worker:r,stop:()=>{i(),s()},initializationFailureCallbacks:[]}}catch(n){Fs(t,e,n)}}(t,e,r),zs.status){case 1:return zs.initializationFailureCallbacks.push(n),zs.worker;case 3:return zs.worker}}function Vs(){return zs.status}function Fs(t,e,n,r){if(1===zs.status||0===zs.status){if(o.error(`${e} failed to start: an error occurred while creating the Worker:`,n),n instanceof Event||n instanceof Error&&((s=n.message).includes("Content Security Policy")||s.includes("requires 'TrustedScriptURL'"))){let e;e=t.workerUrl?`Please make sure the Worker URL ${t.workerUrl} is correct and CSP is correctly configured.`:"Please make sure CSP is correctly configured.",o.error(`${e} See documentation at ${i}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else yn(n);1===zs.status&&zs.initializationFailureCallbacks.forEach((t=>t())),zs={status:2}}else yn(n,{worker_version:3===zs.status&&zs.version,stream_id:r});var s}function js(){return"function"==typeof Array.from&&"function"==typeof CSSSupportsRule&&"function"==typeof URL.createObjectURL&&"forEach"in NodeList.prototype}function qs(t,e,n,r){const o=e.findTrackedSession(),i=function(t,e){if(!js())return"browser-not-supported";if(!t)return"rum-not-tracked";if(0===t.sessionReplay)return"incorrect-session-plan";if(!e)return"replay-not-started"}(o,r);return Ls(t,{viewContext:n.findView(),errorType:i,session:o})}function Hs(t,e,n,r,o,i){let s,a=0;e.subscribe(8,(()=>{2!==a&&3!==a||(l(),a=1)})),e.subscribe(10,(t=>{t.reason===Bn.UNLOADING&&l()})),e.subscribe(9,(()=>{1===a&&u()}));const c=async()=>{const[c]=await Promise.all([o(),Kn(t,"interactive")]);if(2!==a)return;const u=i();u&&c?(({stop:s}=c(e,t,n,r,u)),a=3):a=0};function u(t){const e=n.findTrackedSession();!function(t,e){return!t||0===t.sessionReplay&&(!e||!e.force)}(e,t)?function(t){return 2===t||3===t}(a)||(a=2,c().catch(V),function(t,e){return e&&e.force&&0===t.sessionReplay}(e,t)&&n.setForcedReplay()):a=1}function l(){3===a&&(null==s||s()),a=0}return{start:u,stop:l,getSessionReplayLink:()=>qs(t,n,r,0!==a),isRecording:()=>3===a}}const Gs=function(t,e,n={}){const r=lr(0),i=sr(r.getOrCreateTracker(2)),s=sr(r.getOrCreateTracker(1)),a=function(t){const e=new W;return{tryToInit(e){t||(t=e)},update(n){t=n,e.notify()},isGranted:()=>t===Ft.GRANTED,observable:e}}(),c={vitalsByName:new Map,vitalsByReference:new WeakMap};function u(){return function(t,e,n){return{context:t.getContext(),user:e.getContext(),hasReplay:!!n.isRecording()||void 0}}(i,s,e)}let l=Lr(n,u,a,c,((o,d,f)=>{o.storeContextsAcrossPages&&(ur(o,i,"rum",2),ur(o,s,"rum",1)),r.setCompressionStatus(d?1:2);const p=t(o,e,r,u,f,d&&n.createDeflateEncoder?t=>n.createDeflateEncoder(o,d,t):Hn,a,c);return e.onRumStart(p.lifeCycle,o,p.session,p.viewHistory,d),l=function(t,e){return{init:t=>{We("DD_RUM",t)},initConfiguration:t.initConfiguration,...e}}(l,p),p}));const d=z((t=>{const e="object"==typeof t?t:{name:t};e.context&&r.getOrCreateTracker(3).updateCustomerData(e.context),l.startView(e),_n({feature:"start-view"})})),f=function(t){const e={version:"6.0.0",onReady(t){t()},...t};return Object.defineProperty(e,"_setDebug",{get:()=>$,enumerable:!1}),e}({init:z((t=>{l.init(t,f)})),setTrackingConsent:z((t=>{a.update(t),_n({feature:"set-tracking-consent",tracking_consent:t})})),setViewName:z((t=>{l.setViewName(t)})),setViewContext:z((t=>{l.setViewContext(t)})),setViewContextProperty:z(((t,e)=>{l.setViewContextProperty(t,e)})),setGlobalContext:z((t=>{i.setContext(t),_n({feature:"set-global-context"})})),getGlobalContext:z((()=>i.getContext())),setGlobalContextProperty:z(((t,e)=>{i.setContextProperty(t,e),_n({feature:"set-global-context"})})),removeGlobalContextProperty:z((t=>i.removeContextProperty(t))),clearGlobalContext:z((()=>i.clearContext())),getInternalContext:z((t=>l.getInternalContext(t))),getInitConfiguration:z((()=>rn(l.initConfiguration))),addAction:(t,e)=>{const n=Ee();B((()=>{l.addAction({name:Oe(t),context:Oe(e),startClocks:w(),type:"custom",handlingStack:n}),_n({feature:"add-action"})}))},addError:(t,e)=>{const n=Ee();B((()=>{l.addError({error:t,handlingStack:n,context:Oe(e),startClocks:w()}),_n({feature:"add-error"})}))},addTiming:z(((t,e)=>{l.addTiming(Oe(t),e)})),setUser:z((t=>{(function(t){const e="object"===ft(t);return e||o.error("Unsupported user:",t),e})(t)&&s.setContext(pt(t)),_n({feature:"set-user"})})),getUser:z((()=>s.getContext())),setUserProperty:z(((t,e)=>{const n=pt({[t]:e})[t];s.setContextProperty(t,n),_n({feature:"set-user"})})),removeUserProperty:z((t=>s.removeContextProperty(t))),clearUser:z((()=>s.clearContext())),startView:d,stopSession:z((()=>{l.stopSession(),_n({feature:"stop-session"})})),addFeatureFlagEvaluation:z(((t,e)=>{l.addFeatureFlagEvaluation(Oe(t),Oe(e)),_n({feature:"add-feature-flag-evaluation"})})),getSessionReplayLink:z((()=>e.getSessionReplayLink())),startSessionReplayRecording:z((t=>{e.start(t),_n({feature:"start-session-replay-recording",force:t&&t.force})})),stopSessionReplayRecording:z((()=>e.stop())),addDurationVital:z(((t,e)=>{var n;_n({feature:"add-duration-vital"}),l.addDurationVital({name:Oe(t),type:"duration",startClocks:(n=e.startTime,{relative:x(n),timeStamp:n}),duration:e.duration,context:Oe(e&&e.context),description:Oe(e&&e.description)})})),startDurationVital:z(((t,e)=>(_n({feature:"start-duration-vital"}),l.startDurationVital(Oe(t),{context:Oe(e&&e.context),description:Oe(e&&e.description)})))),stopDurationVital:z(((t,e)=>{_n({feature:"stop-duration-vital"}),l.stopDurationVital("string"==typeof t?Oe(t):t,{context:Oe(e&&e.context),description:Oe(e&&e.description)})}))});return f}((function(t,e,n,r,o,i,s,a){var c;const l=[],d=new Hr;d.subscribe(12,(t=>en("rum",t)));const f=function(t){const e=gn("browser-rum-sdk",t);if(zn()){const t=Un();e.observable.subscribe((e=>t.send("internal_telemetry",e)))}return e}(t);f.setContextProvider((()=>{var e,n;return{application:{id:t.applicationId},session:{id:null===(e=_.findTrackedSession())||void 0===e?void 0:e.id},view:{id:null===(n=T.findView())||void 0===n?void 0:n.id},action:{id:A.findActionId()}}}));const p=t=>{d.notify(13,{error:t}),vn("Error reported to customer",{"error.message":t.message})},h=function(t,e){const n=kn({expireDelay:vs});return t.subscribe(1,(({startClocks:t})=>{n.add({},t.relative),e.resetCustomerData()})),t.subscribe(5,(({endClocks:t})=>{n.closeActive(t.relative)})),{findFeatureFlagEvaluations:t=>n.find(t),addFeatureFlagEvaluation:(t,r)=>{const o=n.find();o&&(o[t]=r,e.updateCustomerData(o))},stop:()=>e.stop()}}(d,n.getOrCreateTracker(0)),g=function(t){return new W((e=>{const{stop:n}=Je(t,window,["visibilitychange","freeze"],(t=>{"visibilitychange"===t.type&&"hidden"===document.visibilityState?e.notify({reason:Bn.HIDDEN}):"freeze"===t.type&&e.notify({reason:Bn.FROZEN})}),{capture:!0}),r=Ke(t,window,"beforeunload",(()=>{e.notify({reason:Bn.UNLOADING})})).stop;return()=>{n(),r()}}))}(t),y=g.subscribe((t=>{d.notify(10,t)}));l.push((()=>y.unsubscribe()));const _=zn()?function(){const t={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:$n("records")?1:0};return{findTrackedSession:()=>t,expire:X,expireObservable:new W,setForcedReplay:X}}():ds(t,d,s);if(zn())!function(t){const e=Un();t.subscribe(12,(t=>{e.send("rum",t)}))}(d);else{const e=ps(t,d,f.observable,p,g,_.expireObservable,i);l.push((()=>e.stop())),function(t,e,n,r,o){e.enabled&&u(t.customerDataTelemetrySampleRate)&&(Cs(),xs(),n.subscribe(12,(t=>{bs=!0,Ss(_s.globalContextBytes,r.getOrCreateTracker(2).getBytesCount()),Ss(_s.userContextBytes,r.getOrCreateTracker(1).getBytesCount()),Ss(_s.featureFlagBytes,["view","error"].includes(t.type)?r.getOrCreateTracker(0).getBytesCount():0)})),o.subscribe((({bytesCount:t,messagesCount:e})=>{bs&&(ys.batchCount+=1,Ss(ys.batchBytesCount,t),Ss(ys.batchMessagesCount,e),ks(ys.globalContextBytes,_s.globalContextBytes),ks(ys.userContextBytes,_s.userContextBytes),ks(ys.featureFlagBytes,_s.featureFlagBytes),xs())})),H(ws,1e4))}(t,f,d,n,e.flushObservable)}const w=function(){const t=Mr();return new W((e=>{if(!t)return;const n=new t(z((()=>e.notify())));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()}))}(),S=ms(t,location),k=Es(t),{observable:C,stop:x}=function(){const t=new W,{stop:e}=Ie(window,"open",(()=>t.notify()));return{observable:t,stop:e}}();l.push(x);const{viewHistory:T,urlContexts:E,actionContexts:A,addAction:R,stop:I}=function(t,e,n,r,o,i,s,a,c,u){const l=function(t){const e=kn({expireDelay:Gr});return t.subscribe(1,(t=>{e.add(function(t){return{service:t.service,version:t.version,context:t.context,id:t.id,name:t.name,startClocks:t.startClocks}}(t),t.startClocks.relative)})),t.subscribe(5,(({endClocks:t})=>{e.closeActive(t.relative)})),t.subscribe(3,(t=>{const n=e.find(t.startClocks.relative);n&&t.name&&(n.name=t.name),n&&t.context&&(n.context=t.context)})),t.subscribe(9,(()=>{e.reset()})),{findView:t=>e.find(t),stop:()=>{e.stop()}}}(t),d=function(t,e,n){const r=kn({expireDelay:hs});let o;t.subscribe(1,(({startClocks:t})=>{const e=n.href;r.add(s({url:e,referrer:o||document.referrer}),t.relative),o=e})),t.subscribe(5,(({endClocks:t})=>{r.closeActive(t.relative)}));const i=e.subscribe((({newLocation:t})=>{const e=r.find();if(e){const n=b();r.closeActive(n),r.add(s({url:t.href,referrer:e.referrer}),n)}}));function s({url:t,referrer:e}){return{url:t,referrer:e}}return{findUrl:t=>r.find(t),stop:()=>{i.unsubscribe(),r.stop()}}}(t,i,n),f=function(t,e,n,r,o){t.subscribe(0,(e=>t.notify(11,Ci(e,o))));let i={findActionId:X},s=X;return r.trackUserInteractions&&({actionContexts:i,stop:s}=Si(t,e,n,r)),{addAction:(e,n)=>{t.notify(11,{savedCommonContext:n,...Ci(e,o)})},actionContexts:i,stop:s}}(t,s,a,e,o),p=function(t){let e,n;fe(ue.DELAY_VIEWPORT_COLLECTION)?n=requestAnimationFrame((()=>{e=rs()})):e=rs();const r=ns(t).subscribe((t=>{e=t})).unsubscribe;return{get:()=>e?{viewport:e}:void 0,stop:()=>{r(),n&&cancelAnimationFrame(n)}}}(e),h=function(t,e=Rs(t,Os)){var n;let r=at(Os)||(null===(n=window.Cypress)||void 0===n?void 0:n.env("traceId"));const o=e.subscribe((t=>{r=t}));return{get:()=>{if("string"==typeof r)return{test_execution_id:r}},stop:()=>o.unsubscribe()}}(e);return qr(e,t,r,l,d,f.actionContexts,p,h,c,u),{viewHistory:l,pageStateHistory:o,urlContexts:d,addAction:f.addAction,actionContexts:f.actionContexts,stop:()=>{f.stop(),h.stop(),p.stop(),d.stop(),l.stop(),o.stop()}}}(d,t,location,_,k,S,w,C,r,p);l.push(I),hn.drain();const{addTiming:N,startView:O,setViewName:L,setViewContext:M,setViewContextProperty:D,stop:P}=ls(d,t,location,w,C,S,h,k,e,o);l.push(P);const{stop:U}=Pi(d,t,k);if(l.push(U),t.trackLongTasks)if(null===(c=PerformanceObserver.supportedEntryTypes)||void 0===c?void 0:c.includes(vo.LONG_ANIMATION_FRAME)){const{stop:e}=function(t,e){const n=yo(e,{type:vo.LONG_ANIMATION_FRAME,buffered:!0}).subscribe((e=>{for(const n of e){const e=m(n.startTime),r={date:e.timeStamp,long_task:{id:Y(),entry_type:"long-animation-frame",duration:v(n.duration),blocking_duration:v(n.blockingDuration),first_ui_event_timestamp:v(n.firstUIEventTimestamp),render_start:v(n.renderStart),style_and_layout_start:v(n.styleAndLayoutStart),start_time:v(n.startTime),scripts:n.scripts.map((t=>({duration:v(t.duration),pause_duration:v(t.pauseDuration),forced_style_and_layout_duration:v(t.forcedStyleAndLayoutDuration),start_time:v(t.startTime),execution_start:v(t.executionStart),source_url:t.sourceURL,source_function_name:t.sourceFunctionName,source_char_position:t.sourceCharPosition,invoker:t.invoker,invoker_type:t.invokerType,window_attribution:t.windowAttribution})))},type:"long_task",_dd:{discarded:!1}};t.notify(11,{rawRumEvent:r,startTime:e.relative,domainContext:{performanceEntry:n}})}}));return{stop:()=>n.unsubscribe()}}(d,t);l.push(e)}else!function(t,e){const n=yo(e,{type:vo.LONG_TASK,buffered:!0}).subscribe((n=>{for(const r of n){if(r.entryType!==vo.LONG_TASK)break;if(!e.trackLongTasks)break;const n=m(r.startTime),o={date:n.timeStamp,long_task:{id:Y(),entry_type:"long-task",duration:v(r.duration)},type:"long_task",_dd:{discarded:!1}};t.notify(11,{rawRumEvent:o,startTime:n.relative,domainContext:{performanceEntry:r}})}}))}(d,t);const{addError:$}=Ti(d,t,k,h);fo(d,t,_);const B=mr(d,k,a),V=function(t,e,n,r,o){return{get:i=>{const s=n.findView(i),a=o.findUrl(i),c=e.findTrackedSession(i);if(c&&s&&a){const e=r.findActionId(i);return{application_id:t,session_id:c.id,user_action:e?{id:e}:void 0,view:{id:s.id,name:s.name,referrer:a.referrer,url:a.url}}}}}}(t.applicationId,_,T,A,E);return{addAction:R,addError:$,addTiming:N,addFeatureFlagEvaluation:h.addFeatureFlagEvaluation,startView:O,setViewContext:M,setViewContextProperty:D,setViewName:L,lifeCycle:d,viewHistory:T,session:_,stopSession:()=>_.expire(),getInternalContext:V.get,startDurationVital:B.startDurationVital,stopDurationVital:B.stopDurationVital,addDurationVital:B.addDurationVital,stop:()=>{l.forEach((t=>t()))}}}),function(t,e){if(zn()&&!$n("records")||!js())return{start:X,stop:X,getReplayStats:()=>{},onRumStart:X,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:r}=function(){let t=0;return{strategy:{start(){t=1},stop(){t=2},isRecording:()=>!1,getSessionReplayLink:X},shouldStartImmediately:e=>1===t||0===t&&!e.startSessionReplayRecordingManually}}();return{start:t=>n.start(t),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:function(o,i,s,a,c){let u;n=Hs(i,o,s,a,t,(function(){u||(null!=c||(c=Bs(i,"Datadog Session Replay",(()=>{n.stop()}),e)),c&&(u=Us(i,c,1)));return u})),r(i)&&n.start()},isRecording:()=>3===Vs()&&n.isRecording(),getReplayStats:t=>3===Vs()?function(t){return null==Ms?void 0:Ms.get(t)}(t):void 0}}((async function(){try{return(await Promise.resolve().then((function(){return lc}))).startRecording}catch(t){}})),{startDeflateWorker:Bs,createDeflateEncoder:Us});!function(t,e,n){const r=t[e];r&&!r.q&&r.version&&o.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),t[e]=n,r&&r.q&&r.q.forEach((t=>c(t,"onReady callback threw an error:")()))}(M(),"DD_RUM",Gs);globalThis.DD_RUM=Gs;const Ws=new WeakMap;function Ks(t){return Ws.has(t)}function Js(t){return Ws.get(t)}function Xs(t,e){const n=t.tagName,r=t.value;if(zo(t,e)){const e=t.type;if("INPUT"===n&&("button"===e||"submit"===e||"reset"===e))return r;if(!r||"OPTION"===n)return;return Lo}return"OPTION"===n||"SELECT"===n?t.value:"INPUT"===n||"TEXTAREA"===n?r:void 0}const Ys=/url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm,Zs=/^[A-Za-z]+:|^\/\//,Qs=/^data:.*,/i;function ta(t,e){return t.replace(Ys,((t,n,r,o,i,s)=>{const a=r||i||s;if(!e||!a||Zs.test(a)||Qs.test(a))return t;const c=n||o||"";return`url(${c}${function(t,e){try{return Gt(t,e).href}catch(e){return t}}(a,e)}${c})`}))}const ea=/[^a-z1-6-_]/;function na(t){const e=t.toLowerCase().trim();return ea.test(e)?"div":e}function ra(t,e){return`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${e}' style='background-color:silver'%3E%3C/svg%3E`}const oa=2,ia=3,sa=4,aa=6,ca=7,ua=8,la=9,da=0,fa=1,pa=2,ha=3,ma=4,ga=11,va=0,ya=1,_a=2,ba=3,wa=4,Sa=5,ka=6,Ca=7,xa=8,Ta=5,Ea=6,Aa=0,Ra=1;function Ia(t){if(void 0!==t&&0!==t.length)return t.map((t=>{const e=t.cssRules||t.rules;return{cssRules:Array.from(e,(t=>t.cssText)),disabled:t.disabled||void 0,media:t.media.length>0?Array.from(t.media):void 0}}))}function Na(t,e,n,r){if(e===Io.HIDDEN)return null;const o=t.getAttribute(n);if(e===Io.MASK&&n!==No&&!ti.includes(n)&&n!==r.actionNameAttribute){const e=t.tagName;switch(n){case"title":case"alt":case"placeholder":return Lo}if("IMG"===e&&("src"===n||"srcset"===n)){const e=t;if(e.naturalWidth>0)return ra(e.naturalWidth,e.naturalHeight);const{width:n,height:r}=t.getBoundingClientRect();return n>0||r>0?ra(n,r):Mo}if("SOURCE"===e&&("src"===n||"srcset"===n))return Mo;if("A"===e&&"href"===n)return Lo;if(o&&n.startsWith("data-"))return Lo;if("IFRAME"===e&&"srcdoc"===n)return Lo}return o&&"string"==typeof o&&co(o)?uo(o):o}function Oa(t){if(!t)return null;let e;try{e=t.rules||t.cssRules}catch(t){}if(!e)return null;return ta(Array.from(e,1===ot()?La:Ma).join(""),t.href)}function La(t){if(function(t){return"selectorText"in t}(t)&&t.selectorText.includes(":")){const e=/(\[[\w-]+[^\\])(:[^\]]+\])/g;return t.cssText.replace(e,"$1\\$2")}return Ma(t)}function Ma(t){return function(t){return"styleSheet"in t}(t)&&Oa(t.styleSheet)||t.cssText}function Da(t,e){const n=function(t,e){switch(t.nodeType){case t.DOCUMENT_NODE:return function(t,e){return{type:da,childNodes:Ua(t,e),adoptedStyleSheets:Ia(t.adoptedStyleSheets)}}(t,e);case t.DOCUMENT_FRAGMENT_NODE:return function(t,e){const n=Eo(t);n&&e.serializationContext.shadowRootsController.addShadowRoot(t);return{type:ga,childNodes:Ua(t,e),isShadowRoot:n,adoptedStyleSheets:n?Ia(t.adoptedStyleSheets):void 0}}(t,e);case t.DOCUMENT_TYPE_NODE:return{type:fa,name:(n=t).name,publicId:n.publicId,systemId:n.systemId};case t.ELEMENT_NODE:return function(t,e){const n=na(t.tagName),r=(i=t,"svg"===i.tagName||i instanceof SVGElement||void 0),o=Uo($o(t),e.parentNodePrivacyLevel);var i;if(o===Io.HIDDEN){const{width:e,height:o}=t.getBoundingClientRect();return{type:pa,tagName:n,attributes:{rr_width:`${e}px`,rr_height:`${o}px`,[No]:Oo},childNodes:[],isSVG:r}}if(o===Io.IGNORE)return;const s=function(t,e,n){if(e===Io.HIDDEN)return{};const r={},o=na(t.tagName),i=t.ownerDocument;for(let o=0;o<t.attributes.length;o+=1){const i=t.attributes.item(o).name,s=Na(t,e,i,n.configuration);null!==s&&(r[i]=s)}if(t.value&&("textarea"===o||"select"===o||"option"===o||"input"===o)){const n=Xs(t,e);void 0!==n&&(r.value=n)}if("option"===o&&e===Io.ALLOW){const e=t;e.selected&&(r.selected=e.selected)}if("link"===o){const e=Array.from(i.styleSheets).find((e=>e.href===t.href)),n=Oa(e);n&&e&&(r._cssText=n)}if("style"===o&&t.sheet){const e=Oa(t.sheet);e&&(r._cssText=e)}const s=t;if("input"!==o||"radio"!==s.type&&"checkbox"!==s.type||(e===Io.ALLOW?r.checked=!!s.checked:zo(s,e)&&delete r.checked),"audio"===o||"video"===o){const e=t;r.rr_mediaState=e.paused?"paused":"played"}let a,c;const u=n.serializationContext;switch(u.status){case 0:a=Math.round(t.scrollTop),c=Math.round(t.scrollLeft),(a||c)&&u.elementsScrollPositions.set(t,{scrollTop:a,scrollLeft:c});break;case 1:u.elementsScrollPositions.has(t)&&({scrollTop:a,scrollLeft:c}=u.elementsScrollPositions.get(t))}return c&&(r.rr_scrollLeft=c),a&&(r.rr_scrollTop=a),r}(t,o,e);let a=[];if(function(t){return t.childNodes.length>0||To(t)}(t)&&"style"!==n){let r;r=e.parentNodePrivacyLevel===o&&e.ignoreWhiteSpace===("head"===n)?e:{...e,parentNodePrivacyLevel:o,ignoreWhiteSpace:"head"===n},a=Ua(t,r)}return{type:pa,tagName:n,attributes:s,childNodes:a,isSVG:r}}(t,e);case t.TEXT_NODE:return function(t,e){const n=Vo(t,e.ignoreWhiteSpace||!1,e.parentNodePrivacyLevel);if(void 0===n)return;return{type:ha,textContent:n}}(t,e);case t.CDATA_SECTION_NODE:return{type:ma,textContent:""}}var n}(t,e);if(!n)return null;const r=Js(t)||Pa++,o=n;return o.id=r,function(t,e){Ws.set(t,e)}(t,r),e.serializedNodeIds&&e.serializedNodeIds.add(r),o}let Pa=1;function Ua(t,e){const n=[];return Ao(t,(t=>{const r=Da(t,e);r&&n.push(r)})),n}function $a(t,e,n){return Da(t,{serializationContext:n,parentNodePrivacyLevel:e.defaultPrivacyLevel,configuration:e})}function za(t){return Boolean(t.changedTouches)}function Ba(t){return!0===t.composed&&To(t.target)?t.composedPath()[0]:t.target}const Va=(t,e)=>{const n=window.visualViewport,r={layoutViewportX:t,layoutViewportY:e,visualViewportX:t,visualViewportY:e};return n?(!function(t){return Math.abs(t.pageTop-t.offsetTop-window.scrollY)>25||Math.abs(t.pageLeft-t.offsetLeft-window.scrollX)>25}(n)?(r.visualViewportX=Math.round(t-n.offsetLeft),r.visualViewportY=Math.round(e-n.offsetTop)):(r.layoutViewportX=Math.round(t+n.offsetLeft),r.layoutViewportY=Math.round(e+n.offsetTop)),r):r},Fa=t=>({scale:t.scale,offsetLeft:t.offsetLeft,offsetTop:t.offsetTop,pageLeft:t.pageLeft,pageTop:t.pageTop,height:t.height,width:t.width});function ja(t,e){return{data:{source:t,...e},type:ia,timestamp:_()}}function qa(t,e){const{throttled:n,cancel:r}=J((t=>{const n=Ba(t);if(Ks(n)){const r=Ha(t);if(!r)return;const o={id:Js(n),timeOffset:0,x:r.x,y:r.y};e(ja(za(t)?ka:ya,{positions:[o]}))}}),50,{trailing:!1}),{stop:o}=Je(t,document,["mousemove","touchmove"],n,{capture:!0,passive:!0});return{stop:()=>{o(),r()}}}function Ha(t){let{clientX:e,clientY:n}=za(t)?t.changedTouches[0]:t;if(window.visualViewport){const{visualViewportX:t,visualViewportY:r}=Va(e,n);e=t,n=r}if(Number.isFinite(e)&&Number.isFinite(n))return{x:e,y:n};t.isTrusted&&vn("mouse/touch event without x/y")}const Ga={pointerup:0,mousedown:1,click:2,contextmenu:3,dblclick:4,focus:Ta,blur:Ea,touchstart:7,touchend:9};function Wa(t,e,n){return Je(t,document,Object.keys(Ga),(r=>{const o=Ba(r);if(Po(o,t.defaultPrivacyLevel)===Io.HIDDEN||!Ks(o))return;const i=Js(o),s=Ga[r.type];let a;if(s!==Ea&&s!==Ta){const t=Ha(r);if(!t)return;a={id:i,type:s,x:t.x,y:t.y}}else a={id:i,type:s};const c={id:n.getIdForEvent(r),...ja(_a,a)};e(c)}),{capture:!0,passive:!0})}function Ka(t,e,n,r=document){const{throttled:o,cancel:i}=J((r=>{const o=Ba(r);if(!o||Po(o,t.defaultPrivacyLevel)===Io.HIDDEN||!Ks(o))return;const i=Js(o),s=o===document?{scrollTop:ts(),scrollLeft:Qi()}:{scrollTop:Math.round(o.scrollTop),scrollLeft:Math.round(o.scrollLeft)};n.set(o,s),e(ja(ba,{id:i,x:s.scrollLeft,y:s.scrollTop}))}),100),{stop:s}=Ke(t,r,"scroll",o,{capture:!0,passive:!0});return{stop:()=>{s(),i()}}}function Ja(t,e){const n=ns(t).subscribe((t=>{e(ja(wa,t))}));return{stop:()=>{n.unsubscribe()}}}function Xa(t,e){const n=window.visualViewport;if(!n)return{stop:X};const{throttled:r,cancel:o}=J((()=>{e({data:Fa(n),type:ua,timestamp:_()})}),200,{trailing:!1}),{stop:i}=Je(t,n,["resize","scroll"],r,{capture:!0,passive:!0});return{stop:()=>{i(),o()}}}function Ya(t,e){return Je(t,document,["play","pause"],(n=>{const r=Ba(n);r&&Po(r,t.defaultPrivacyLevel)!==Io.HIDDEN&&Ks(r)&&e(ja(Ca,{id:Js(r),type:"play"===n.type?Aa:Ra}))}),{capture:!0,passive:!0})}function Za(t){function e(t,e){t&&Ks(t.ownerNode)&&e(Js(t.ownerNode))}const n=[Ie(CSSStyleSheet.prototype,"insertRule",(({target:n,parameters:[r,o]})=>{e(n,(e=>t(ja(xa,{id:e,adds:[{rule:r,index:o}]}))))})),Ie(CSSStyleSheet.prototype,"deleteRule",(({target:n,parameters:[r]})=>{e(n,(e=>t(ja(xa,{id:e,removes:[{index:r}]}))))}))];function r(r){n.push(Ie(r.prototype,"insertRule",(({target:n,parameters:[r,o]})=>{e(n.parentStyleSheet,(e=>{const i=Qa(n);i&&(i.push(o||0),t(ja(xa,{id:e,adds:[{rule:r,index:i}]})))}))})),Ie(r.prototype,"deleteRule",(({target:n,parameters:[r]})=>{e(n.parentStyleSheet,(e=>{const o=Qa(n);o&&(o.push(r),t(ja(xa,{id:e,removes:[{index:o}]})))}))})))}return"undefined"!=typeof CSSGroupingRule?r(CSSGroupingRule):(r(CSSMediaRule),r(CSSSupportsRule)),{stop:()=>{n.forEach((t=>t.stop()))}}}function Qa(t){const e=[];let n=t;for(;n.parentRule;){const t=Array.from(n.parentRule.cssRules).indexOf(n);e.unshift(t),n=n.parentRule}if(!n.parentStyleSheet)return;const r=Array.from(n.parentStyleSheet.cssRules).indexOf(n);return e.unshift(r),e}function tc(t,e){return Je(t,window,["focus","blur"],(()=>{e({data:{has_focus:document.hasFocus()},type:aa,timestamp:_()})}))}function ec(t,e,n){const r=t.subscribe(11,(t=>{var r,o;"action"===t.rawRumEvent.type&&"click"===t.rawRumEvent.action.type&&(null===(o=null===(r=t.rawRumEvent.action.frustration)||void 0===r?void 0:r.type)||void 0===o?void 0:o.length)&&"events"in t.domainContext&&t.domainContext.events&&t.domainContext.events.length&&e({timestamp:t.rawRumEvent.date,type:la,data:{frustrationTypes:t.rawRumEvent.action.frustration.type,recordIds:t.domainContext.events.map((t=>n.getIdForEvent(t)))}})}));return{stop:()=>{r.unsubscribe()}}}function nc(t,e){const n=t.subscribe(4,(()=>{e({timestamp:_(),type:ca})}));return{stop:()=>{n.unsubscribe()}}}function rc(t,e,n=document){const r=t.defaultPrivacyLevel,o=new WeakMap,i=n!==document,{stop:s}=Je(t,n,i?["change"]:["input","change"],(t=>{const e=Ba(t);(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)&&c(e)}),{capture:!0,passive:!0});let a;if(i)a=X;else{const t=[Ne(HTMLInputElement.prototype,"value",c),Ne(HTMLInputElement.prototype,"checked",c),Ne(HTMLSelectElement.prototype,"value",c),Ne(HTMLTextAreaElement.prototype,"value",c),Ne(HTMLSelectElement.prototype,"selectedIndex",c)];a=()=>{t.forEach((t=>t.stop()))}}return{stop:()=>{a(),s()}};function c(t){const e=Po(t,r);if(e===Io.HIDDEN)return;const n=t.type;let o;if("radio"===n||"checkbox"===n){if(zo(t,e))return;o={isChecked:t.checked}}else{const n=Xs(t,e);if(void 0===n)return;o={text:n}}u(t,o);const i=t.name;"radio"===n&&i&&t.checked&&document.querySelectorAll(`input[type="radio"][name="${CSS.escape(i)}"]`).forEach((e=>{e!==t&&u(e,{isChecked:!1})}))}function u(t,n){if(!Ks(t))return;const r=o.get(t);r&&r.text===n.text&&r.isChecked===n.isChecked||(o.set(t,n),e(ja(Sa,{id:Js(t),...n})))}}function oc(t,e,n,r){const o=Mr();if(!o)return{stop:X,flush:X};const i=function(t){let e=X,n=[];function r(){e(),t(n),n=[]}const{throttled:o,cancel:i}=J(r,16,{leading:!1});return{addMutations:t=>{0===n.length&&(e=nr(o,{timeout:100})),n.push(...t)},flush:r,stop:()=>{e(),i()}}}((r=>{!function(t,e,n,r){const o=new Map;t.filter((t=>"childList"===t.type)).forEach((t=>{t.removedNodes.forEach((t=>{ic(t,r.removeShadowRoot)}))}));const i=t.filter((t=>t.target.isConnected&&function(t){let e=t;for(;e;){if(!Ks(e)&&!Eo(e))return!1;e=Ro(e)}return!0}(t.target)&&Po(t.target,n.defaultPrivacyLevel,o)!==Io.HIDDEN)),{adds:s,removes:a,hasBeenSerialized:c}=function(t,e,n,r){const o=new Set,i=new Map;for(const e of t)e.addedNodes.forEach((t=>{o.add(t)})),e.removedNodes.forEach((t=>{o.has(t)||i.set(t,e.target),o.delete(t)}));const s=Array.from(o);a=s,a.sort(((t,e)=>{const n=t.compareDocumentPosition(e);return n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_CONTAINS||n&Node.DOCUMENT_POSITION_FOLLOWING?1:n&Node.DOCUMENT_POSITION_PRECEDING?-1:0}));var a;const c=new Set,u=[];for(const t of s){if(d(t))continue;const o=Po(t.parentNode,e.defaultPrivacyLevel,r);if(o===Io.HIDDEN||o===Io.IGNORE)continue;const i=Da(t,{serializedNodeIds:c,parentNodePrivacyLevel:o,serializationContext:{status:2,shadowRootsController:n},configuration:e});if(!i)continue;const s=Ro(t);u.push({nextId:f(t),parentId:Js(s),node:i})}const l=[];return i.forEach(((t,e)=>{Ks(e)&&l.push({parentId:Js(t),id:Js(e)})})),{adds:u,removes:l,hasBeenSerialized:d};function d(t){return Ks(t)&&c.has(Js(t))}function f(t){let e=t.nextSibling;for(;e;){if(Ks(e))return Js(e);e=e.nextSibling}return null}}(i.filter((t=>"childList"===t.type)),n,r,o),u=function(t,e,n){var r;const o=[],i=new Set,s=t.filter((t=>!i.has(t.target)&&(i.add(t.target),!0)));for(const t of s){if(t.target.textContent===t.oldValue)continue;const i=Po(Ro(t.target),e.defaultPrivacyLevel,n);i!==Io.HIDDEN&&i!==Io.IGNORE&&o.push({id:Js(t.target),value:null!==(r=Vo(t.target,!1,i))&&void 0!==r?r:null})}return o}(i.filter((t=>"characterData"===t.type&&!c(t.target))),n,o),l=function(t,e,n){const r=[],o=new Map,i=t.filter((t=>{const e=o.get(t.target);return(!e||!e.has(t.attributeName))&&(e?e.add(t.attributeName):o.set(t.target,new Set([t.attributeName])),!0)})),s=new Map;for(const t of i){if(t.target.getAttribute(t.attributeName)===t.oldValue)continue;const o=Po(t.target,e.defaultPrivacyLevel,n),i=Na(t.target,o,t.attributeName,e);let a;if("value"===t.attributeName){const e=Xs(t.target,o);if(void 0===e)continue;a=e}else a="string"==typeof i?i:null;let c=s.get(t.target);c||(c={id:Js(t.target),attributes:{}},r.push(c),s.set(t.target,c)),c.attributes[t.attributeName]=a}return r}(i.filter((t=>"attributes"===t.type&&!c(t.target))),n,o);if(!(u.length||l.length||a.length||s.length))return;e(ja(va,{adds:s,removes:a,texts:u,attributes:l}))}(r.concat(s.takeRecords()),t,e,n)})),s=new o(z(i.addMutations));return s.observe(r,{attributeOldValue:!0,attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),{stop:()=>{s.disconnect(),i.stop()},flush:()=>{i.flush()}}}function ic(t,e){To(t)&&e(t.shadowRoot),Ao(t,(t=>ic(t,e)))}function sc(t){const{emit:e,configuration:n,lifeCycle:r}=t;if(!e)throw new Error("emit function is required");const o=n=>{e(n),en("record",{record:n});const r=t.viewHistory.findView();Ps(r.id).records_count+=1},i=function(){const t=new WeakMap;return{set(e,n){(e!==document||document.scrollingElement)&&t.set(e===document?document.scrollingElement:e,n)},get:e=>t.get(e),has:e=>t.has(e)}}(),s=((t,e,n)=>{const r=new Map,o={addShadowRoot:i=>{if(r.has(i))return;const s=oc(e,t,o,i),a=rc(t,e,i),c=Ka(t,e,n,i);r.set(i,{flush:()=>s.flush(),stop:()=>{s.stop(),a.stop(),c.stop()}})},removeShadowRoot:t=>{const e=r.get(t);e&&(e.stop(),r.delete(t))},stop:()=>{r.forEach((({stop:t})=>t()))},flush:()=>{r.forEach((({flush:t})=>t()))}};return o})(n,o,i),{stop:a}=function(t,e,n,r,o,i){const s=(n=_(),o={status:0,elementsScrollPositions:t,shadowRootsController:e})=>{const{width:i,height:s}=rs(),a=[{data:{height:s,href:window.location.href,width:i},type:sa,timestamp:n},{data:{has_focus:document.hasFocus()},type:aa,timestamp:n},{data:{node:$a(document,r,o),initialOffset:{left:Qi(),top:ts()}},type:oa,timestamp:n}];return window.visualViewport&&a.push({data:Fa(window.visualViewport),type:ua,timestamp:n}),a};i(s());const{unsubscribe:a}=n.subscribe(2,(n=>{o(),i(s(n.startClocks.timeStamp,{shadowRootsController:e,status:1,elementsScrollPositions:t}))}));return{stop:a}}(i,s,r,n,c,(t=>t.forEach((t=>o(t)))));function c(){s.flush(),l.flush()}const u=function(){const t=new WeakMap;let e=1;return{getIdForEvent:n=>(t.has(n)||t.set(n,e++),t.get(n))}}(),l=oc(o,n,s,document),d=[l,qa(n,o),Wa(n,o,u),Ka(n,o,i,document),Ja(n,o),rc(n,o),Ya(n,o),Za(o),tc(n,o),Xa(n,o),ec(r,o,u),nc(r,(t=>{c(),o(t)}))];return{stop:()=>{s.stop(),d.forEach((t=>t.stop())),a()},flushMutations:c,shadowRootsController:s}}function ac({context:t,creationReason:e,encoder:n}){let r=0;const o=t.view.id,i={start:1/0,end:-1/0,creation_reason:e,records_count:0,has_full_snapshot:!1,index_in_view:Ds(o),source:"browser",...t};return function(t){Ps(t).segments_count+=1}(o),{addRecord:function(t,e){i.start=Math.min(i.start,t.timestamp),i.end=Math.max(i.end,t.timestamp),i.records_count+=1,i.has_full_snapshot||(i.has_full_snapshot=t.type===oa);const o=n.isEmpty?'{"records":[':",";n.write(o+JSON.stringify(t),(t=>{r+=t,e(r)}))},flush:function(t){if(n.isEmpty)throw new Error("Empty segment flushed");n.write(`],${JSON.stringify(i).slice(1)}\n`),n.finish((e=>{!function(t,e){Ps(t).segments_total_raw_size+=e}(i.view.id,e.rawBytesCount),t(i,e)}))}}}let cc=6e4;function uc(t,e,n,r,o,i){return function(t,e,n,r){let o={status:0,nextSegmentCreationReason:"init"};const{unsubscribe:i}=t.subscribe(2,(()=>{a("view_change")})),{unsubscribe:s}=t.subscribe(10,(t=>{a(t.reason)}));function a(t){1===o.status&&(o.segment.flush(((e,r)=>{const o=function(t,e,n){const r=new FormData;r.append("segment",new Blob([t],{type:"application/octet-stream"}),`${e.session.id}-${e.start}`);const o={raw_segment_size:n,compressed_segment_size:t.byteLength,...e},i=JSON.stringify(o);return r.append("event",new Blob([i],{type:"application/json"})),{data:r,bytesCount:t.byteLength}}(r.output,e,r.rawBytesCount);Vn(t)?n.sendOnExit(o):n.send(o)})),q(o.expirationTimeoutId)),o="stop"!==t?{status:0,nextSegmentCreationReason:t}:{status:2}}return{addRecord:t=>{if(2!==o.status){if(0===o.status){const t=e();if(!t)return;o={status:1,segment:ac({encoder:r,context:t,creationReason:o.nextSegmentCreationReason}),expirationTimeoutId:j((()=>{a("segment_duration_limit")}),5e3)}}o.segment.addRecord(t,(t=>{t>cc&&a("segment_bytes_limit")}))}},stop:()=>{a("stop"),i(),s()}}}(t,(()=>function(t,e,n){const r=e.findTrackedSession(),o=n.findView();if(!r||!o)return;return{application:{id:t},session:{id:r.id},view:{id:o.id}}}(e.applicationId,n,r)),o,i)}var lc=Object.freeze({__proto__:null,startRecording:function(t,e,n,r,o,i){const s=[],a=i||Mn(e.sessionReplayEndpointBuilder,cc,(e=>{t.notify(13,{error:e}),vn("Error reported to customer",{"error.message":e.message})}));let c;if(zn())({addRecord:c}=function(t){const e=Un();return{addRecord:n=>{const r=t.findView();e.send("record",n,r.id)}}}(r));else{const i=uc(t,e,n,r,a,o);c=i.addRecord,s.push(i.stop)}const{stop:u}=sc({emit:c,configuration:e,lifeCycle:t,viewHistory:r});return s.push(u),{stop:()=>{s.forEach((t=>t()))}}}});