1import{a as E,b as O,e as Dr,j}from"./chunk-BMIYOSOG.js";var ze={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},Ve=console,Lt={};Object.keys(ze).forEach(e=>{Lt[e]=Ve[e]});var ar="Datadog Browser SDK:",b={debug:Lt.debug.bind(Ve,ar),log:Lt.log.bind(Ve,ar),info:Lt.info.bind(Ve,ar),warn:Lt.warn.bind(Ve,ar),error:Lt.error.bind(Ve,ar)},cr="https://docs.datadoghq.com",mi=`${cr}/real_user_monitoring/browser/troubleshooting`,Mt="More details:";function W(){return globalThis}var X=W(),Ee="WorkerGlobalScope"in X;function ur(e){return e!==0&&Math.random()*100<=e}function We(e,t){return+e.toFixed(t)}function Ei(e){return Xe(e)&&e>=0&&e<=100}function Xe(e){return typeof e=="number"}var B=1e3,H=60*B,lr=60*H,Jc=24*lr,Kn=365*Jc;function Fe(e){return{relative:e,timeStamp:Qc(e)}}function Pr(e){return{relative:jn(e),timeStamp:e}}function Qc(e){let t=ue()-performance.now();return t>St()?Math.round(gt(t,e)):Zc(e)}function gi(){return Math.round(ue()-gt(St(),performance.now()))}function I(e){return Xe(e)?We(e*1e6,0):e}function ue(){return new Date().getTime()}function F(){return ue()}function Y(){return performance.now()}function w(){return{relative:Y(),timeStamp:F()}}function Ur(){return{relative:0,timeStamp:St()}}function D(e,t){return t-e}function gt(e,t){return e+t}function jn(e){return e-St()}function Zc(e){return Math.round(gt(St(),e))}function Si(e){return e<Kn}var $n;function St(){return $n===void 0&&($n=performance.timing?.navigationStart??performance.timeOrigin),$n}var qn,bi=!1;function yi(e){qn=e}function Yn(e){bi=e}function _(e){return function(...t){return ee(e,this,t)}}function ee(e,t,r){try{return e.apply(t,r)}catch(n){J(n)}}function J(e){if(Vr(e),qn)try{qn(e)}catch(t){Vr(t)}}function Vr(...e){bi&&b.error("[MONITOR]",...e)}function ge(e,t){let r=W(),n;return r.Zone&&typeof r.Zone.__symbol__=="function"&&(n=e[r.Zone.__symbol__(t)]),n||(n=e[t]),n}function G(e,t){return ge(W(),"setTimeout")(_(e),t)}function q(e){ge(W(),"clearTimeout")(e)}function Ae(e,t){return ge(W(),"setInterval")(_(e),t)}function Be(e){ge(W(),"clearInterval")(e)}function ut(e,t,r){let n=r&&r.leading!==void 0?r.leading:!0,o=r&&r.trailing!==void 0?r.trailing:!0,i=!1,s,a;return{throttled:(...u)=>{if(i){s=u;return}n?e(...u):s=u,i=!0,a=G(()=>{o&&s&&e(...s),i=!1,s=void 0},t)},cancel:()=>{q(a),i=!1,s=void 0}}}function M(){}function pr(e,t){return ge(W(),"fetch")(e,t)}function zn(e){let t=X.queueMicrotask;typeof t=="function"?t(_(e)):Promise.resolve().then(_(e))}var y=class{constructor(t){this.onFirstSubscribe=t,this.observers=[]}subscribe(t){return this.addObserver(t),{unsubscribe:()=>this.removeObserver(t)}}notify(t){this.observers.forEach(r=>r(t))}addObserver(t){this.observers.push(t),this.observers.length===1&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0)}removeObserver(t){this.observers=this.observers.filter(r=>t!==r),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}};function Fr(...e){return new y(t=>{let r=e.map(n=>n.subscribe(o=>t.notify(o)));return()=>r.forEach(n=>n.unsubscribe())})}var Je=class extends y{constructor(t,r){super(),this.maxBufferSize=t,this.onDrop=r,this.buffer=[],this.droppedCount=0}notify(t){this.buffer.push(t),this.buffer.length>this.maxBufferSize&&(this.buffer.shift(),this.droppedCount++),super.notify(t)}subscribe(t){let r=!1,n={unsubscribe:()=>{r=!0,this.removeObserver(t)}};return zn(()=>{for(let o of this.buffer){if(r)return;t(o)}r||this.addObserver(t)}),n}unbuffer(){zn(()=>{this.droppedCount>0&&this.onDrop&&this.onDrop(this.droppedCount),this.maxBufferSize=this.buffer.length=0})}};var eu=/[^\u0000-\u007F]/;function Br(e){return eu.test(e)?new TextEncoder().encode(e).length:e.length}function Ti(e){if(e.length===1)return e[0];let t=e.reduce((o,i)=>o+i.length,0),r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}function xi(e){return e>=500}function hi(e){try{return e.clone()}catch(t){return}}var ye={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};var ru=80*1024,nu=32,_i=20*1048576,ou=H,Ai=B;function Wn(e,t,r,n,o,i){t.transportStatus===0&&t.queuedPayloads.size()===0&&t.bandwidthMonitor.canHandle(e)?Ci(e,t,r,i,{onSuccess:()=>Ri(0,t,r,n,o,i),onFailure:()=>{t.queuedPayloads.enqueue(e)||i.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e}),Ii(t,r,n,o,i)}}):t.queuedPayloads.enqueue(e)||i.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e})}function Ii(e,t,r,n,o){e.transportStatus===2&&G(()=>{let i=e.queuedPayloads.first();Ci(i,e,t,o,{onSuccess:()=>{e.queuedPayloads.dequeue(),e.currentBackoffTime=Ai,Ri(1,e,t,r,n,o)},onFailure:()=>{e.currentBackoffTime=Math.min(ou,e.currentBackoffTime*2),Ii(e,t,r,n,o)}})},e.currentBackoffTime)}function Ci(e,t,r,n,{onSuccess:o,onFailure:i}){t.bandwidthMonitor.add(e),r(e,s=>{t.bandwidthMonitor.remove(e),iu(s)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:s.status},n.notify({type:"failure",bandwidth:t.bandwidthMonitor.stats(),payload:e}),i()):(t.transportStatus=0,n.notify({type:"success",bandwidth:t.bandwidthMonitor.stats(),payload:e}),o())})}function Ri(e,t,r,n,o,i){e===0&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:`Reached max ${n} events size queued for upload: ${_i/1048576}MiB`,source:ye.AGENT,startClocks:w()}),t.queueFullReported=!0);let s=t.queuedPayloads;for(t.queuedPayloads=vi();s.size()>0;)Wn(s.dequeue(),t,r,n,o,i)}function iu(e){return e.type!=="opaque"&&(e.status===0&&!navigator.onLine||e.status===408||e.status===429||xi(e.status))}function Oi(){return{transportStatus:0,currentBackoffTime:Ai,bandwidthMonitor:su(),queuedPayloads:vi(),queueFullReported:!1}}function vi(){let e=[];return{bytesCount:0,enqueue(t){return this.isFull()?!1:(e.push(t),this.bytesCount+=t.bytesCount,!0)},first(){return e[0]},dequeue(){let t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size(){return e.length},isFull(){return this.bytesCount>=_i}}}function su(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return this.ongoingRequestCount===0||this.ongoingByteCount+e.bytesCount<=ru&&this.ongoingRequestCount<nu},add(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount},stats(){return{ongoingByteCount:this.ongoingByteCount,ongoingRequestCount:this.ongoingRequestCount}}}}var Hr=16*1024;function lt(e,t,r=Hr){let n=new y,o=Oi();return{observable:n,send:i=>{for(let s of e)Wn(i,o,(a,u)=>{Ni(s,a,u)},s.trackType,t,n)},sendOnExit:i=>{for(let s of e)au(s,r,i)}}}function au(e,t,r){if(r.bytesCount<t)try{let o=e.build("beacon",r);if(navigator.sendBeacon(o,r.data))return}catch(o){cu(o)}Ni(e,r)}var wi=!1;function cu(e){wi||(wi=!0,J(e))}function Ni(e,t,r){let n=e.build("fetch",t);pr(n,{method:"POST",body:t.data,mode:"cors"}).then(_(o=>r?.({status:o.status,type:o.type}))).catch(_(()=>r?.({status:0})))}function Ie(){let e=uu();if(e)return{getCapabilities(){return JSON.parse(e.getCapabilities?.()||"[]")},getPrivacyLevel(){return e.getPrivacyLevel?.()},getIsTraceSampled(){return JSON.parse(e.getIsTraceSampled?.()||"null")},getAllowedWebViewHosts(){return JSON.parse(e.getAllowedWebViewHosts())},send(t,r,n){let o=n?{id:n}:void 0;e.send(JSON.stringify({eventType:t,event:r,view:o}))}}}function Gr(e){let t=Ie();return!!t&&t.getCapabilities().includes(e)}function le(e=W().location?.hostname){let t=Ie();return!!t&&t.getAllowedWebViewHosts().some(r=>e===r||e.endsWith(`.${r}`))}function uu(){return W().DatadogEventBridge}function P(e,t,r,n,o){return Le(e,t,[r],n,o)}function Le(e,t,r,n,{once:o,capture:i,passive:s}={}){let a=_(f=>{!f.isTrusted&&!f.__ddIsTrusted&&!e.allowUntrustedEvents||(o&&p(),n(f))}),u=s?{capture:i,passive:s}:i,c=window.EventTarget&&t instanceof EventTarget?window.EventTarget.prototype:t,l=ge(c,"addEventListener");r.forEach(f=>l.call(t,f,a,u));function p(){let f=ge(c,"removeEventListener");r.forEach(d=>f.call(t,d,a,u))}return{stop:p}}function $r(e,t){for(let r=e.length-1;r>=0;r-=1){let n=e[r];if(t(n,r,e))return n}}function Kr(e){return Object.values(e)}function He(e){return Object.entries(e)}var bt={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function dr(e){return new y(t=>{if(Ee)return;let{stop:r}=Le(e,window,["visibilitychange","freeze"],o=>{o.type==="visibilitychange"&&document.visibilityState==="hidden"?t.notify({reason:bt.HIDDEN}):o.type==="freeze"&&t.notify({reason:bt.FROZEN})},{capture:!0}),n=P(e,window,"beforeunload",()=>{t.notify({reason:bt.UNLOADING})}).stop;return()=>{r(),n()}})}function Xn(e){return Kr(bt).includes(e)}function Te(e,t,r){if(typeof e!="object"||e===null)return JSON.stringify(e);let n=yt(Object.prototype),o=yt(Array.prototype),i=yt(Object.getPrototypeOf(e)),s=yt(e);try{return JSON.stringify(e,t,r)}catch(a){return"<error: unable to serialize object>"}finally{n(),o(),i(),s()}}function yt(e){let t=e,r=t.toJSON;return r?(delete t.toJSON,()=>{t.toJSON=r}):M}var ki=256*1024;function Dt({encoder:e,request:t,flushController:r}){let n={},o=r.flushObservable.subscribe(u=>a(u));function i(u,c,l){if(l!==void 0){let p;n[l]!==void 0?p=c-e.estimateEncodedBytesCount(n[l]):(r.notifyBeforeAddMessage(c),p=0),n[l]=u,r.notifyAfterAddMessage(p)}else r.notifyBeforeAddMessage(c),e.write(e.isEmpty?u:` 2${u}`,p=>{r.notifyAfterAddMessage(p-c)})}function s(u,c){let l=Te(u),p=e.estimateEncodedBytesCount(l);
2if(p>=ki){b.warn(`Discarded a message whose size was bigger than the maximum allowed size ${ki/1024}KiB. ${Mt} ${mi}/#technical-limitations`);return}i(l,p,c)}function a(u){let c=Kr(n).join(` 3`);n={};let l=Xn(u.reason),p=l?t.sendOnExit:t.send;if(l&&e.isAsync){let f=e.finishSync();f.outputBytesCount&&p(Li(f));let d=[f.pendingData,c].filter(Boolean).join(` 4`);d&&p({data:d,bytesCount:Br(d)})}else c&&e.write(e.isEmpty?c:` 5${c}`),e.finish(f=>{p(Li(f))})}return{flushController:r,add:s,upsert:s,stop:o.unsubscribe}}function Li(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}var Jn=30*B,lu=Ee?1:50;function Pt({pageMayExitObservable:e,sessionExpireObservable:t}){let r,n=new y,o=e.subscribe(d=>{r=d.reason;try{n.notify(d.reason)}finally{r=void 0}c(d.reason)}),i=t.subscribe(()=>c("session_expire")),s=new y(()=>()=>{o.unsubscribe(),i.unsubscribe()}),a=0,u=0;function c(d){if(u===0)return;let m=u,g=a;u=0,a=0,f(),s.notify({reason:d,messagesCount:m,bytesCount:g})}let l;function p(){l===void 0&&(l=G(()=>{c("duration_limit")},Jn))}function f(){q(l),l=void 0}return{flushObservable:s,preparePageExitFlushObservable:n,get messagesCount(){return u},notifyBeforeAddMessage(d){a+d>=Hr&&c(r??"bytes_limit"),u+=1,a+=d,p()},notifyAfterAddMessage(d=0){a+=d,u>=lu?c(r??"messages_limit"):a>=Hr&&c(r??"bytes_limit")}}}var pu=220*1024,du="$",fu=3;function R(e,t=pu){let r=yt(Object.prototype),n=yt(Array.prototype),o=[],i=new WeakMap,s=Qn(e,du,void 0,o,i),a=JSON.stringify(s),u=a?a.length:0;if(u>t){Zn(t,"discarded",e);return}for(;o.length>0&&u<t;){let c=o.shift(),l=0;if(Array.isArray(c.source))for(let p=0;p<c.source.length;p++){let f=Qn(c.source[p],c.path,p,o,i);if(f!==void 0?u+=JSON.stringify(f).length:u+=4,u+=l,l=1,u>t){Zn(t,"truncated",e);break}c.target[p]=f}else for(let p in c.source)if(Object.prototype.hasOwnProperty.call(c.source,p)){let f=Qn(c.source[p],c.path,p,o,i);if(f!==void 0&&(u+=JSON.stringify(f).length+l+p.length+fu,l=1),u>t){Zn(t,"truncated",e);break}c.target[p]=f}}return r(),n(),s}function Qn(e,t,r,n,o){let i=gu(e);if(!i||typeof i!="object")return mu(i);let s=eo(i);if(s!=="[Object]"&&s!=="[Array]"&&s!=="[Error]")return s;let a=e;if(o.has(a))return`[Reference seen at ${o.get(a)}]`;let u=r!==void 0?`${t}.${r}`:t,c=Array.isArray(i)?[]:{};return o.set(a,u),n.push({source:i,target:c,path:u}),c}function mu(e){return typeof e=="bigint"?`[BigInt] ${e.toString()}`:typeof e=="function"?`[Function] ${e.name||"unknown"}`:typeof e=="symbol"?`[Symbol] ${e.description||e.toString()}`:e}function eo(e){try{if(e instanceof Event)return Eu(e);if(e instanceof RegExp)return`[RegExp] ${e.toString()}`;let r=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(r&&r[1])return`[${r[1]}]`}catch(t){}return"[Unserializable]"}function Eu(e){return{type:e.type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?eo(e.currentTarget):null,target:e.target?eo(e.target):null}}function gu(e){let t=e;if(t&&typeof t.toJSON=="function")try{return t.toJSON()}catch(r){}return e}function Zn(e,t,r){b.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,r)}function Ge(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function Ce(e){return Ge(e)==="object"}var Ut="?";function Re(e){let t=[],r=to(e,"stack"),n=String(e);if(r&&r.startsWith(n)&&(r=r.slice(n.length)),r&&r.split(` 6`).forEach(o=>{let i=yu(o)||hu(o)||Au(o)||Ru(o);i&&(!i.func&&i.line&&(i.func=Ut),t.push(i))}),t.length>0&&wu()&&e instanceof Error){let o=[],i=e;for(;(i=Object.getPrototypeOf(i))&&Pi(i);){let s=i.constructor?.name||Ut;o.push(s)}for(let s=o.length-1;s>=0&&t[0]?.func===o[s];s--)t.shift()}return{message:to(e,"message"),name:to(e,"name"),stack:t}}var Mi="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",Vt="(?::(\\d+))",Su=new RegExp(`^\\s*at (.*?) ?\\(${Mi}${Vt}?${Vt}?\\)?\\s*$`,"i"),bu=new RegExp(`\\((\\S*)${Vt}${Vt}\\)`);function yu(e){let t=Su.exec(e);if(!t)return;let r=t[2]&&t[2].indexOf("native")===0,n=t[2]&&t[2].indexOf("eval")===0,o=bu.exec(t[2]);return n&&o&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]),{args:r?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||Ut,line:t[3]?+t[3]:void 0,url:r?void 0:t[2]}}var Tu="(?:(.*)?(?: @))",xu=new RegExp(`^\\s*at\\s*${Tu}?\\s*${Mi}${Vt}?${Vt}??\\s*$`,"i");function hu(e){let t=xu.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||Ut,line:t[3]?+t[3]:void 0,url:t[2]}}var _u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Au(e){let t=_u.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||Ut,line:+t[3],url:t[2]}}
6var Iu=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,Cu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Ru(e){let t=Iu.exec(e);if(!t)return;let r=t[3]&&t[3].indexOf(" > eval")>-1,n=Cu.exec(t[3]);return r&&n&&(t[3]=n[1],t[4]=n[2],t[5]=void 0),{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||Ut,line:t[4]?+t[4]:void 0,url:t[3]}}function to(e,t){return Ce(e)&&typeof e[t]=="string"?e[t]:void 0}function Di(e,t,r,n){if(t===void 0)return;let{name:o,message:i}=vu(e);return{name:o,message:i,stack:[{url:t,column:n,line:r}]}}var Ou=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function vu(e){let t,r;return{}.toString.call(e)==="[object String]"&&([,t,r]=Ou.exec(e)),{name:t,message:r}}function Pi(e){return String(e.constructor).startsWith("class ")}var jr;function wu(){if(jr!==void 0)return jr;class e extends Error{constructor(){super(),this.name="Error"}}let[t,r]=[e,Error].map(n=>new n);return jr=Pi(Object.getPrototypeOf(t))&&r.stack!==t.stack,jr}function Me(e){let r=new Error(e);r.name="HandlingStack";let n;return ee(()=>{let o=Re(r);o.stack=o.stack.slice(2),n=Tt(o)}),n}function Tt(e){let t=ro(e);return e.stack.forEach(r=>{let n=r.func==="?"?"<anonymous>":r.func,o=r.args&&r.args.length>0?`(${r.args.join(", ")})`:"",i=r.line?`:${r.line}`:"",s=r.line&&r.column?`:${r.column}`:"";t+=` 7 at ${n}${o} @ ${r.url}${i}${s}`}),t}function ro(e){return`${e.name||"Error"}: ${e.message}`}var qr="No stack, consider using an instance of Error";function Ui({originalError:e,stackTrace:t,source:r,useFallbackStack:n=!0,nonErrorPrefix:o}){let i=Oe(e);return!t&&i&&(t=Re(e)),{source:r,type:t?t.name:void 0,message:Nu(t,i,o,e),stack:t?Tt(t):n?qr:void 0}}function xt({stackTrace:e,originalError:t,handlingStack:r,componentStack:n,startClocks:o,nonErrorPrefix:i,useFallbackStack:s=!0,source:a,handling:u}){let c=Ui({originalError:t,stackTrace:e,source:a,useFallbackStack:s,nonErrorPrefix:i});return O(E({startClocks:o,handling:u,handlingStack:r,componentStack:n,originalError:t},c),{causes:Oe(t)?Mu(t,a):void 0,fingerprint:ku(t),context:Lu(t)})}function Nu(e,t,r,n){return e?.message&&e?.name?e.message:t?"Empty message":r?`${r} ${Te(R(n))}`:Te(R(n))}function ku(e){return Oe(e)&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function Lu(e){if(Ce(e))return e.dd_context}function Oe(e){return e instanceof Error||Object.prototype.toString.call(e)==="[object Error]"}function Mu(e,t){let r=[],n=e.cause;for(;n!=null&&r.length<10;){let o=Ui({originalError:n,source:t,useFallbackStack:!1});r.push(o),n=Oe(n)?n.cause:void 0}return r.length?r:void 0}function Ft(e){try{return JSON.parse(e)}catch(t){}}function Ze(e){return E({},e)}function ht(e,t){return Object.keys(e).some(r=>e[r]===t)}function te(e){return Object.keys(e).length===0}function Yr(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n]);return r}var re=(function(e){return e.TRACK_INTAKE_REQUESTS="track_intake_requests",e.FEATURE_OPERATION_VITAL="feature_operation_vital",e.START_STOP_ACTION="start_stop_action",e.START_STOP_RESOURCE="start_stop_resource",e.TOO_MANY_REQUESTS_INVESTIGATION="too_many_requests_investigation",e.SESSION_RENEWAL_DEBUG_CONTEXT="session_renewal_debug_context",e})(re||{}),no=new Set;function oo(e){Array.isArray(e)&&Vi(e.filter(t=>ht(re,t)))}function Vi(e){e.forEach(t=>{no.add(t)})}function pe(e){return no.has(e)}function io(){return no}var Du=200;function zr(e){let{env:t,service:r,version:n,datacenter:o,sdkVersion:i,variant:s}=e,a=[Bt("sdk_version",i??"7.1.0")];return t&&a.push(Bt("env",t)),r&&a.push(Bt("service",r)),n&&a.push(Bt("version",n)),o&&a.push(Bt("datacenter",o)),s&&a.push(Bt("variant",s)),a}function Bt(e,t){let r=t?`${e}:${t}`:e;return(r.length>Du||Uu(r))&&b.warn(`Tag ${r} doesn't meet tag requirements and will be sanitized. ${Mt} ${cr}/getting_started/tagging/#defining-tags`),Pu(r)}function Pu(e){return e.replace(/,/g,"_")}function Uu(e){return new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e)}var Wr="datad0g.com",_t="datadoghq.com",Fi="datadoghq.eu",Bi="ddog-gov.com",Hi="us2.ddog-gov.com",Gi=["ddsource","dd-api-key","dd-request-id"];function fr(e,t){let r=X.__ddBrowserSdkExtensionCallback;r&&r({type:e,payload:t})}function Xr(e,t,r=Vu()){if(t===void 0)return e;if(typeof t!="object"||t===null)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t.source,t.flags);if(r.hasAlreadyBeenSeen(t))return;if(Array.isArray(t)){let o=Array.isArray(e)?e:[];for(let i=0;i<t.length;++i)o[i]=Xr(o[i],t[i],r);return o}let n=Ge(e)==="object"?e:{};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=Xr(n[o],t[o],r));return n}function Ht(e){return Xr(void 0,e)}function de(...e){let t;for(let r of e)r!=null&&(t=Xr(t,r));return t}function Vu(){if(typeof WeakSet<"u"){let t=new WeakSet;return{hasAlreadyBeenSeen(r){let n=t.has(r);return n||t.add(r),n}}}let e=[];return{hasAlreadyBeenSeen(t){let r=e.indexOf(t)>=0;return r||e.push(t),r}}}function Jr(){let e=X.navigator;return{status:e.onLine?"connected":"not_connected",interfaces:e.connection&&e.connection.type?[e.connection.type]:void 0,effective_type:e.connection?.effectiveType}}function mr(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(r,n){let o=Br(r);t+=o,e+=r,n&&n(o)},finish(r){r(this.finishSync())},finishSync(){let r={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,r},estimateEncodedBytesCount(r){return r.length}}}var Se="DISCARDED",$="SKIPPED";function $i(){let e={};return{register(t,r){return e[t]||(e[t]=[]),e[t].push(r),{unregister:()=>{e[t]=e[t].filter(n=>n!==r)}}},triggerHook(t,r){let n=e[t]||[],o=[];for(let i of n){let s=i(r);if(s===Se)return Se;s!==$&&o.push(s)}return de(...o)}}}var et={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"};var Fu=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Bu=1,Hu=[Bi,Hi],Gu=15,so;function At(){return so||(so=new Je(100)),so}function Qr(e,t,r){let n=new y,{enabled:o,metricsEnabled:i}=$u(e,t,r,n),{stop:s}=Ku(t,n);return{stop:s,enabled:o,metricsEnabled:i}}function $u(e,t,r,n,o=Bu,i=Gu){let s={},a=!Hu.includes(t.site)&&ur(t.telemetrySampleRate),u={[et.LOG]:a,[et.CONFIGURATION]:a&&ur(t.telemetryConfigurationSampleRate),[et.USAG
7E]:a&&ur(t.telemetryUsageSampleRate),metric:a&&ur(o)},c=ju(),l=At();return l.subscribe(({rawEvent:f,metricName:d})=>{if(d&&!u.metric||!u[f.type])return;let m=d||f.status||f.type,g=s[m];if(g||(g=s[m]=new Set),g.size>=i)return;let x=Te(f);if(g.has(x))return;let A=r.triggerHook(1,{startTime:w().relative});if(A===Se)return;let k=p(A,e,f,c);n.notify(k),fr("telemetry",k),g.add(x)}),l.unbuffer(),yi(Er),{enabled:a,metricsEnabled:u.metric};function p(f,d,m,g){let A={type:"telemetry",date:w().timeStamp,service:d,version:"7.1.0",source:"browser",_dd:{format_version:2},telemetry:de(m,{runtime_env:g,connectivity:Jr(),sdk_setup:"npm"}),ddtags:zr(t).join(","),experimental_features:Array.from(io())};return de(A,f)}}function Ku(e,t){let r=[];if(le()){let n=Ie(),o=t.subscribe(i=>n.send("internal_telemetry",i));r.push(o.unsubscribe)}else{let n=[e.rumEndpointBuilder];e.replica&&qu(e)&&n.push(e.replica.rumEndpointBuilder);let o=Dt({encoder:mr(),request:lt(n,M),flushController:Pt({pageMayExitObservable:dr(e),sessionExpireObservable:new y})});r.push(o.stop);let i=t.subscribe(o.add);r.push(i.unsubscribe)}return{stop:()=>r.forEach(n=>n())}}function ju(){return{is_local_file:X.location?.protocol==="file:",is_worker:Ee}}function qu(e){return e.site===Wr}function ne(e,t){Vr(ze.debug,e,t),At().notify({rawEvent:E({type:et.LOG,message:e,status:"debug"},t)})}function Er(e,t){At().notify({rawEvent:E(E({type:et.LOG,status:"error"},Yu(e)),t)})}function Zr(e){At().notify({rawEvent:{type:et.CONFIGURATION,configuration:e}})}function $e(e,t){At().notify({rawEvent:E({type:et.LOG,message:e,status:"debug"},t),metricName:e})}function K(e){At().notify({rawEvent:{type:et.USAGE,usage:e}})}function Yu(e){if(Oe(e)){let t=Re(e);return{error:{kind:t.name,stack:Tt(zu(t))},message:t.message}}return{error:{stack:qr},message:`Uncaught ${Te(e)}`}}function zu(e){return e.stack=e.stack.filter(t=>!t.url||Fu.some(r=>t.url.startsWith(r))),e}function en(e,t){return(...r)=>{try{return e(...r)}catch(n){b.error(t,n)}}}var fe=4*lr,Ki=15*H,ji=Kn;var se={COOKIE:"cookie",MEMORY:"memory",LOCAL_STORAGE:"local-storage"};function V(e){return e?(parseInt(e,10)^Math.random()*16>>parseInt(e,10)/4).toString(16):`10000000-1000-4000-8000-${1e11}`.replace(/[018]/g,V)}var Gt=/(\S+?)\s*=\s*(.*?)(?:;|$)/g;function gr(e,t){for(Gt.lastIndex=0;;){let r=Gt.exec(e);if(r){if(r[1]===t)return r[2]}else break}}function qi(e){let t=new Map;for(Gt.lastIndex=0;;){let r=Gt.exec(e);if(r){let n=r[1],o=r[2];t.has(n)?t.get(n).push(o):t.set(n,[o])}else break}return t}function Yi(e){let t=new Map;for(Gt.lastIndex=0;;){let r=Gt.exec(e);if(r)t.set(r[1],r[2]);else break}return t}function Ke(e,t,r=""){let n=e.charCodeAt(t-1),i=n>=55296&&n<=56319?t+1:t;return e.length<=i?e:`${e.slice(0,i)}${r}`}function $t(e){return tt(e,location.href).href}function zi(e){try{return!!tt(e)}catch(t){return!1}}function Wi(e){let t=tt(e).pathname;return t[0]==="/"?t:`/${t}`}function tt(e,t){let{URL:r}=Wu();try{return t!==void 0?new r(e,t):new r(e)}catch(n){throw new Error(`Failed to construct URL: ${String(n)}`)}}var ao;function Wu(){if(!ao){let e,t;try{e=document.createElement("iframe"),e.style.display="none",document.body.appendChild(e),t=e.contentWindow??X}catch(r){t=X}ao={URL:t.URL},e?.remove()}return ao}function Kt(e,t,r=0,n){let o=new Date;o.setTime(o.getTime()+r);let i=`expires=${o.toUTCString()}`,s=n&&n.crossSite?"none":"strict",a=n&&n.domain?`;domain=${n.domain}`:"",u=n&&n.secure?";secure":"",c=n&&n.partitioned?";partitioned":"";document.cookie=`${e}=${t};${i};path=/;samesite=${s}${a}${u}${c}`}function pt(e){let t=gr(document.cookie,e);if(t!=="")return t}function De(e){return qi(document.cookie).get(e)||[]}var co;function dt(e){return co||(co=Yi(document.cookie)),co.get(e)}function lo(e,t){Kt(e,"",0,t)}function po(e){if(document.cookie===void 0||document.cookie===null)return!1;try{let t=`dd_cookie_test_${V()}`,r="test";Kt(t,r,H,e);let n=pt(t)===r;return lo(t,e),n}catch(t){return b.error(t),!1}}var uo;function Xi(e=location.hostname,t=document.referrer){if(uo===void 0){let r=Xu(e,t);if(r){let n=`dd_site_test_${V()}`,o="test",i=r.split("."),s=i.pop();for(;i.length&&!pt(n);)s=`${i.pop()}.${s}`,Kt(n,o,B,{domain:s});lo(n,{domain:s}),uo=s}}return uo}function Xu(e,t){try{return e||tt(t).hostname}catch(r){}}var fo=/^([a-zA-Z]+)=([a-z0-9-]+)$/;function Ji(e){return!!e&&(e.indexOf("&")!==-1||fo.test(e))}var Ju="1";function mo(e){return e.created?Number(e.created):void 0}function Eo(e){let t=e.expire&&Number(e.expire),r=mo(e);if(t&&r)return Math.min(t,r+fe)}function jt(e,t){let r={isExpired:Ju};
7return t.trackAnonymousUser&&e?.anonymousId&&(r.anonymousId=e?.anonymousId),r}function Sr(e){return te(e)}function tn(e){return e.isExpired!==void 0||!Qu(e)}function Qu(e){let t=Eo(e);return t?ue()<t:!1}function Zi(e){e.expire=String(ue()+Ki)}function rn(e){return He(e).map(([t,r])=>t==="anonymousId"?`aid=${r}`:`${t}=${r}`).join("&")}function qt(e){let t={};return Ji(e)&&e.split("&").forEach(r=>{let n=fo.exec(r);if(n!==null){let[,o,i]=n;o==="aid"?t.anonymousId=i:t[o]=i}}),t}function go(e,t){return Sr(e)?(t.trackAnonymousUser&&(e.anonymousId=V()),jt(e,t)):e}function nn(e,t){if(Sr(e))return e;let r=e;return tn(e)&&(r=jt(e,t)),r.id||(r.id=V(),r.created=String(ue())),t.trackAnonymousUser&&!r.anonymousId&&(r.anonymousId=V()),delete r.isExpired,Zi(r),r}function es(e){return tn(e)||Sr(e)||!e.id||Zi(e),e}function ts(e,t,r){let n=window.cookieStore;return n?Zu(e,t,r,n):tl(e,r)}function Zu(e,t,r,n){let o=new y(()=>P(t,n,"change",a=>{(a.changed.some(c=>c.name===e)||a.deleted.some(c=>c.name===e))&&o.notify()}).stop);return{getAll(){return j(this,null,function*(){return(yield n.getAll(e)).map(a=>a.value)})},getAllAndSet(s){return j(this,null,function*(){let a=yield n.getAll(e),u=a.map(p=>p.value),{value:c,expireDelay:l}=s(u);try{yield n.set({name:e,value:c,expires:ue()+l,path:"/",sameSite:r.crossSite?"none":"strict",domain:r.domain,secure:r.secure,partitioned:r.partitioned})}catch(p){let f=De(e);ne("Failed to set cookie using Cookie Store API",{"error.message":p.message,newValue:c,cookieOptions:E({},r),cookies:a.map(d=>E({},d)),cookieCount:a.length,documentCookies:f})}})},observable:o}}var el=B;function tl(e,t){let r=De(e),n=new y(()=>{let s=Ae(()=>{let a=De(e);o(a)},el);return()=>{Be(s)}});function o(s){String(s)!==String(r)&&(r=s,n.notify())}return{getAll(){return Promise.resolve(De(e))},getAllAndSet(s){return j(this,null,function*(){let a=De(e),{value:u,expireDelay:c}=s(a);Kt(e,u,c,t),yield Promise.resolve(),o([u])})},observable:n}}var je="_dd_s_v2",on="_dd_s";var rl=0;function rs(e){let t=ol(e);return t&&po(t)?{type:se.COOKIE,cookieOptions:t}:void 0}var So;function ns(e,t){let r=new y,n=!!t.trackAnonymousUser,o=os(e),i=ts(je,t,e),s=!0;i.observable.subscribe(()=>{i.getAll().then(c=>{r.notify({cookieValues:c,sessionState:bo(c,o)})}).catch(J)});function a(c){return i.getAllAndSet(l=>{let p=bo(l,o);s&&te(p)&&(p=bo(De(on),o)),s=!1;let f=c(p);return{value:nl(f,e),expireDelay:n?ji:fe}})}return{setSessionState(c){return j(this,null,function*(){typeof navigator<"u"&&navigator.locks?yield navigator.locks.request(je,()=>a(c)):(So=(So??Promise.resolve()).then(()=>a(c)),yield So)})},sessionObservable:r}}function bo(e,t){let r;for(let n of e.slice().reverse())if(r=qt(n),r.c===t)break;return delete r?.c,r??{}}function nl(e,t){return rn(te(e)?e:O(E({},e),{c:os(t)}))}function ol(e){let t={};if(t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains){let r=Xi();if(!r)return;t.domain=r}return t}function os(e){let t=e.domain?e.domain.split(".").length-1:0,r=0;return r|=rl<<5,r|=t<<1,r|=e.crossSite?1:0,r.toString(16)}var il="_dd_test_";function is(){try{let e=V(),t=`${il}${e}`;localStorage.setItem(t,e);let r=localStorage.getItem(t);return localStorage.removeItem(t),e===r?{type:se.LOCAL_STORAGE}:void 0}catch(e){return}}function ss(e){let t=new y(o=>P(e,window,"storage",i=>{i.key===je&&i.storageArea===localStorage&&o.notify({sessionState:qt(i.newValue)})}).stop),r=!0;return{setSessionState(o){return j(this,null,function*(){let i=qt(localStorage.getItem(je));r&&Sr(i)&&(i=qt(localStorage.getItem(on))),r=!1;let s=o(i);localStorage.setItem(je,rn(s)),yield Promise.resolve(),t.notify({sessionState:s})})},sessionObservable:t}}var yo="_DD_SESSION";function as(){return{type:se.MEMORY}}function cs(){let e=W();e[yo]||(e[yo]={});let t=e[yo],r=new y,n=t.onChange;return t.onChange=i=>{n?.(i),r.notify({sessionState:i})},{setSessionState(i){return j(this,null,function*(){let s=t.state??{},a=Ze(i(s));t.state=a,yield Promise.resolve(),t.onChange?.(a)})},sessionObservable:r}}function us(e){let{sessionPersistence:t}=e,r=sl(t);for(let n of r){let o=al(n,e);if(o!==void 0)return o}}function sl(e){return Array.isArray(e)?e:e!==void 0?[e]:Ee?[se.MEMORY]:[se.COOKIE]}function al(e,t){switch(e){case se.COOKIE:return rs(t);case se.LOCAL_STORAGE:return is();case se.MEMORY:return as();default:b.error(`Invalid session persistence '${String(e)}'`);return}}function ls(e,t){switch(e.type){case se.COOKIE:return ns(e.cookieOptions,t);case se.LOCAL_STORAGE:return ss(t);case se.MEMORY:return cs()}}var br={GRANTED:"granted",NOT_GRANTED:"not-granted"};function To(e){let t=new y;function r(){return e===br.GRANTED}return{tryToInit(n){e||(e=n)}
7,onGrantedOnce(n){if(r())n();else{let o=t.subscribe(()=>{r()&&(n(),o.unsubscribe())})}},update(n){e=n,t.notify()},isGranted:r,observable:t}}function It(e){let t=Ge(e);return t==="string"||t==="function"||e instanceof RegExp}function Pe(e,t,r=!1){return e.some(n=>{try{if(typeof n=="function")return n(t);if(n instanceof RegExp)return n.lastIndex=0,n.test(t);if(typeof n=="string")return r?t.startsWith(n):n===t}catch(o){b.error(o)}return!1})}var cl=["chrome-extension://","moz-extension://"];function ps(e){return cl.some(t=>e.includes(t))}function ds(e,t=""){if(ps(e))return!1;let n=t.split(` 8`).filter(o=>{let i=o.trim();return i.length&&/^at\s+|@/.test(i)})[1]||"";return ps(n)}var ul="Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided.",ll="SDK initialized on a non-allowed domain.";function fs(e,t){let r=W().location,n=r?r.origin:"",o=e.allowedTrackingOrigins;if(!o)return ds(n,t)?(b.error(ul),!1):!0;let i=Pe(o,n);return i||b.error(ll),i}function qe(e,t,r){let n=pl(e,t);return{build(o,i){let s=dl(e,t,o,i,r);return n(s)},trackType:t}}function pl(e,t){let r=`/api/v2/${t}`,n=e.proxy;if(typeof n=="string"){let i=$t(n);return s=>`${i}?ddforward=${encodeURIComponent(`${r}?${s}`)}`}if(typeof n=="function")return i=>n({path:r,parameters:i});let o=yr(e);return i=>`https://${o}${r}?${i}`}function yr(e){let{site:t=_t}=e,r=t.split("."),n=r.pop();return`browser-intake-${r.join("-")}.${n}`}function dl({clientToken:e,source:t="browser"},r,n,{retry:o,encoding:i},s=[]){let a=[`ddsource=${t}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("7.1.0")}`,"dd-evp-origin=browser",`dd-request-id=${V()}`].concat(s);return i&&a.push(`dd-evp-encoding=${i}`),r==="rum"&&(a.push(`batch_time=${F()}`,`_dd.api=${n}`),o&&a.push(`_dd.retry_count=${o.count}`,`_dd.retry_after=${o.lastFailureStatus}`)),a.join("&")}function xo(e){let t=e.site||_t,r=fl(e.source),n=ml(O(E({},e),{site:t,source:r})),o=El(O(E({},e),{site:t,source:r}));return E({replica:o,site:t,source:r},n)}function fl(e){return e==="flutter"||e==="unity"?e:"browser"}function ml(e){return{logsEndpointBuilder:qe(e,"logs"),rumEndpointBuilder:qe(e,"rum"),profilingEndpointBuilder:qe(e,"profile"),sessionReplayEndpointBuilder:qe(e,"replay"),exposuresEndpointBuilder:qe(e,"exposures"),flagEvaluationEndpointBuilder:qe(e,"flagevaluation")}}function El(e){if(!e.replica)return;let t=O(E({},e),{site:_t,clientToken:e.replica.clientToken});return{logsEndpointBuilder:qe(t,"logs"),rumEndpointBuilder:qe(t,"rum",[`application.id=${e.replica.applicationId}`])}}function sn(e){return Gi.every(t=>e.includes(t))}var Ye={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input",MASK_UNLESS_ALLOWLISTED:"mask-unless-allowlisted"},Ct={ALL:"all",SAMPLED:"sampled"};function ho(e,t){return e!=null&&typeof e!="string"?(b.error(`${t} must be defined as a string`),!1):!0}function gl(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(b.error(`Site should be a valid Datadog site. ${Mt} ${cr}/getting_started/site/.`),!1):!0}function rt(e,t){return e!==void 0&&!Ei(e)?(b.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function an(e,t){if(!e||!e.clientToken){b.error("Client Token is not configured, we will not send any data.");return}if(e.allowedTrackingOrigins!==void 0&&!Array.isArray(e.allowedTrackingOrigins)){b.error("Allowed Tracking Origins must be an array");return}if(!(!gl(e.site)||!rt(e.sessionSampleRate,"Session")||!rt(e.telemetrySampleRate,"Telemetry")||!rt(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!rt(e.telemetryUsageSampleRate,"Telemetry Usage")||!ho(e.version,"Version")||!ho(e.env,"Env")||!ho(e.service,"Service")||!fs(e,t??""))){if(e.trackingConsent!==void 0&&!ht(br,e.trackingConsent)){b.error('Tracking Consent should be either "granted" or "not-granted"');return}return E({beforeSend:e.beforeSend&&en(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:us(e),sessionSampleRate:e.sessionSampleRate??100,telemetrySampleRate:e.telemetrySampleRate??20,telemetryConfigurationSampleRate:e.telemetryConfigurationSampleRate??5,telemetryUsageSampleRate:e.telemetryUsageSampleRate??5,service:e.service??void 0,env:e.env??void 0,version:e.version??void 0,datacenter:e.datacenter??void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:e.trackingConsent??br.GRANTED,trackAnonymousUser:e.trackA
8nonymousUser??!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,variant:e.variant,sdkVersion:e.sdkVersion},xo(e))}}function cn(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:Array.isArray(e.sessionPersistence)?e.sessionPersistence[0]:e.sessionPersistence,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent,use_allowed_tracking_origins:Array.isArray(e.allowedTrackingOrigins),source:e.source,sdk_version:e.sdkVersion,variant:e.variant}}function ae(e,t,r,{computeHandlingStack:n}={}){let o=e[t];if(typeof o!="function")if(t in e&&typeof t=="string"&&t.startsWith("on"))o=M;else return{stop:M};let i=!1,s=function(){if(i)return o.apply(this,arguments);let a=Array.from(arguments),u;ee(r,null,[{target:this,parameters:a,onPostCall:l=>{u=l},handlingStack:n?Me("instrumented method"):void 0}]);let c=o.apply(this,a);return u&&ee(u,null,[c]),c};return e[t]=s,{stop:()=>{i=!0,e[t]===s&&(e[t]=o)}}}function Sl(e,t,r){let n=Object.getOwnPropertyDescriptor(e,t);if(!n||!n.set||!n.configurable)return{stop:M};let o=M,i=(a,u)=>{G(()=>{i!==o&&r(a,u)},0)},s=function(a){n.set.call(this,a),i(this,a)};return Object.defineProperty(e,t,{set:s}),{stop:()=>{Object.getOwnPropertyDescriptor(e,t)?.set===s&&Object.defineProperty(e,t,n),i=o}}}function ms(){return new y(e=>{let t=(o,i)=>{let s=xt({stackTrace:i,originalError:o,startClocks:w(),nonErrorPrefix:"Uncaught",source:ye.SOURCE,handling:"unhandled"});e.notify(s)},{stop:r}=bl(t),{stop:n}=yl(t);return()=>{r(),n()}})}function bl(e){return ae(W(),"onerror",({parameters:[t,r,n,o,i]})=>{let s;Oe(i)||(s=Di(t,r,n,o)),e(i??t,s)})}function yl(e){return ae(W(),"onunhandledrejection",({parameters:[t]})=>{e(t.reason||"Empty reason")})}function _o(e){let t=E({version:"7.1.0",onReady(r){r()}},e);return Object.defineProperty(t,"_setDebug",{get(){return Yn},enumerable:!1}),t}function Tl(e,t,r){let n=e[t];n&&!n.q&&n.version&&b.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=r,n&&n.q&&n.q.forEach(o=>en(o,"onReady callback threw an error:")())}function Tr(e,t){t.silentMultipleInit||b.error(`${e} is already initialized.`)}var Rt={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Ao(e,t){let r=[];t.includes(Rt.cspViolation)&&r.push(hl(e));let n=t.filter(o=>o!==Rt.cspViolation);return n.length&&r.push(xl(n)),Fr(...r)}function xl(e){return new y(t=>{if(!window.ReportingObserver)return;let r=_((o,i)=>o.forEach(s=>t.notify(_l(s)))),n=new window.ReportingObserver(r,{types:e,buffered:!0});return n.observe(),()=>{n.disconnect()}})}function hl(e){return new y(t=>{let{stop:r}=P(e,document,"securitypolicyviolation",n=>{t.notify(Al(n))});return r})}function _l(e){let{type:t,body:r}=e;return Es({type:r.id,message:`${t}: ${r.message}`,originalError:e,stack:gs(r.id,r.message,r.sourceFile,r.lineNumber,r.columnNumber)})}function Al(e){let t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return Es({type:e.effectiveDirective,message:`${Rt.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:gs(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${Ke(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function Es(e){return E({startClocks:w(),source:ye.REPORT,handling:"unhandled"},e)}function gs(e,t,r,n,o){return r?Tt({name:e,message:t,stack:[{func:"?",url:r,line:n??void 0,column:o??void 0}]}):void 0}function Ss(e,t){let r=e.indexOf(t);r>=0&&e.splice(r,1)}function nt(e){return Array.isArray(e)&&e.length>0}var un=1/0,bs=H,xr,ln=new Set;
8function Il(){ln.forEach(e=>e())}function xe({expireDelay:e,maxEntries:t}){let r=[];xr||(xr=Ae(()=>Il(),bs));let n=()=>{let p=Y()-e;for(;r.length>0&&r[r.length-1].endTime<p;)r.pop()};ln.add(n);function o(p,f){let d={value:p,startTime:f,endTime:un,remove:()=>{Ss(r,d)},close:m=>{d.endTime=m}};return t&&r.length>=t&&r.pop(),r.unshift(d),d}function i(p=un,f={returnInactive:!1}){for(let d of r)if(d.startTime<=p){if(f.returnInactive||p<=d.endTime)return d.value;break}}function s(p){let f=r[0];f&&f.endTime===un&&f.close(p)}function a(p=un,f=0){let d=gt(p,f);return r.filter(m=>m.startTime<=d&&p<=m.endTime).map(m=>m.value)}function u(p){return r.filter(f=>f.startTime===p)}function c(){r=[]}function l(){ln.delete(n),ln.size===0&&xr&&(Be(xr),xr=void 0)}return{add:o,find:i,closeActive:s,findAll:a,getEntries:u,reset:c,stop:l}}function hr(e,t){return e*t/100}var ys=new Map;function Ot(e,t){if(t===100)return!0;if(t===0)return!1;let r=ys.get(t);if(r&&e===r.sessionId)return r.decision;let n=Ts(BigInt(`0x${e.split("-")[4]}`),t);return ys.set(t,{sessionId:e,decision:n}),n}function Ts(e,t){let r=1111111111111111111n,n=2n**64n,o=e*r%n;return Number(o)<=t/100*Number(n)}var Cl=H,Rl=fe,Ol=lr*12,ot=[];function Io(e,t){return j(this,null,function*(){let r=Y(),n=new y,o=new y,i;if(!e.sessionStoreStrategyType){b.warn("No storage available for session. We will not send any data.");return}let s=ls(e.sessionStoreStrategyType,e),a=xe({expireDelay:Rl});ot.push(()=>a.stop());let u=!1,{throttled:c,cancel:l}=ut(()=>{u=!1,s.setSessionState(v=>nn(v,e)).catch(J)},B);ot.push(l);let p;ot.push(()=>q(p));let f=!1;ot.push(()=>{f=!0});let d=yield m().catch(J);if(!d||f)return;if(!t.isGranted()){Z();return}return a.add(we(d),Ur().relative),x(d),g(),A(),$e("Session manager init metrics",{metrics:{duration:D(r,Y())}}),k();function m(){return j(this,null,function*(){let v={};return yield s.setSessionState(S=>{let T=go(S,e);return v=nn(T,e),v}),v})}function g(){let v=s.sessionObservable.subscribe(({cookieValues:S,sessionState:T})=>{x(T),Q(T,{from:"sessionObservable",cookieValues:S})});ot.push(()=>v.unsubscribe())}function x(v){q(p);let S=Eo(v);if(S){let T=S-ue();p=G(()=>{s.setSessionState(C=>tn(C)?(t.isGranted()||delete C.anonymousId,jt(C,e)):C).catch(J)},T)}}function A(){t.observable.subscribe(()=>{t.isGranted()?(u=!1,s.setSessionState(v=>nn(v,e)).catch(J)):Z()}),Ee||(vl(e,()=>{t.isGranted()&&c()}),wl(e,()=>{u||s.setSessionState(v=>es(v)).catch(J)}),Nl(e,()=>{s.setSessionState(v=>go(v,e)).catch(J)}))}function k(){return{findSession:(v,S)=>a.find(v,S),findTrackedSession:(v,S)=>{let T=a.find(v,S);if(!(!T||T.id==="invalid"||!Ot(T.id,e.sessionSampleRate))&&!(ue()-T.createdAt>Ol))return T},renewObservable:n,expireObservable:o,expire:Z,updateSessionState:v=>{s.setSessionState(S=>E(E({},S),v)).catch(J)}}}function Q(v,{from:S,cookieValues:T}){let C=a.find(),N=C?.id!==void 0,Ne=v.id!==void 0,Ue=N&&Ne&&C.id!==v.id;if(N&&(!Ne||Ue)&&(pe(re.SESSION_RENEWAL_DEBUG_CONTEXT)&&(i={previousSession:C&&E({},C),newState:E({},v),from:S,cookieValues:T,cookies:De(je),locksAvailable:!!globalThis.navigator?.locks,cookieStoreAvailable:!!globalThis.cookieStore}),u=!0,o.notify(),a.closeActive(Y())),Ne&&(!N||Ue)){if(u)return;a.add(we(v),Y()),n.notify(pe(re.SESSION_RENEWAL_DEBUG_CONTEXT)?{expire:i,renew:{previousSession:C&&E({},C),newState:E({},v),from:S,cookieValues:T,cookies:De(je),locksAvailable:!!globalThis.navigator?.locks,cookieStoreAvailable:!!globalThis.cookieStore}}:void 0)}else N&&Ne&&!Ue&&(C.isReplayForced=!!v.forcedReplay)}function Z(){l();let v=jt(a.find(),e);t.isGranted()||delete v.anonymousId,Q(v,{from:"expire"}),s.setSessionState(S=>(t.isGranted()||delete S.anonymousId,jt(S,e))).catch(J)}function we(v){let S=mo(v)??F();return v.id?{id:v.id,isReplayForced:!!v.forcedReplay,anonymousId:v.anonymousId,createdAt:S}:{id:"invalid",isReplayForced:!1,anonymousId:void 0,createdAt:S}}})}function Co(){let t={id:V(),isReplayForced:!1,anonymousId:void 0,createdAt:F()};return Promise.resolve({findSession:()=>t,findTrackedSession:()=>t,renewObservable:new y,expireObservable:new y,expire:M,updateSessionState:r=>{t=E(E({},t),r)}})}function vl(e,t){let{stop:r}=Le(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0});ot.push(r)}function wl(e,t){let r=()=>{document.visibilityState==="visible"&&t()},{stop:n}=P(e,document,"visibilitychange",r);ot.push(n);let o=Ae(r,Cl);ot.push(()=>{Be(o)})}function Nl(e,t){let{stop:r}=P(e,window,"resume",t,{capture:!0});ot.push(r)}var _r=class{constructor(){this.callbacks={}}notify(t,r){let n=this.callbacks[t];
8n&&n.forEach(o=>o(r))}subscribe(t,r){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(r),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(n=>r!==n)}}}};var kl=3e3;function pn(e,t,r=kl){let n=0,o=!1;return{isLimitReached(){if(n===0&&G(()=>{n=0},H),n+=1,n<=r||o)return o=!1,!1;if(n===r+1){o=!0;try{t({message:`Reached max number of ${e}s by minute: ${r}`,source:ye.AGENT,startClocks:w()})}finally{o=!1}}return!0}}}function vy(){return Ll()===1}var xs;function Ll(){return xs??(xs=Ml())}function Ml(e=window){let t=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(t)?0:e.navigator.vendor?.indexOf("Apple")===0||/safari/i.test(t)&&!/chrome|android/i.test(t)?1:2}function Yt(e,t,r){return document.readyState===t||document.readyState==="complete"?(r(),{stop:M}):P(e,window,t==="complete"?"load":"DOMContentLoaded",r,{once:!0})}function Dl(e,t){return new Promise(r=>{Yt(e,t,r)})}var Ro,Oo=new WeakMap;function Ar(e){return Ro||(Ro=Pl(e)),Ro}function Pl(e){return"XMLHttpRequest"in X?new y(t=>{let{stop:r}=ae(XMLHttpRequest.prototype,"open",Ul),{stop:n}=ae(XMLHttpRequest.prototype,"send",i=>{Vl(i,e,t)},{computeHandlingStack:!0}),{stop:o}=ae(XMLHttpRequest.prototype,"abort",Fl);return()=>{r(),n(),o()}}):new y}function Ul({target:e,parameters:[t,r]}){Oo.set(e,{state:"open",method:String(t).toUpperCase(),url:$t(String(r))})}function Vl({target:e,parameters:[t],handlingStack:r},n,o){let i=Oo.get(e);if(!i)return;let s=i;s.state="start",s.startClocks=w(),s.isAborted=!1,s.xhr=e,s.handlingStack=r,s.requestBody=t;let a=!1,{stop:u}=ae(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&c()}),c=()=>{if(l(),u(),a)return;a=!0;let p=i;p.duration=D(s.startClocks.timeStamp,F()),p.status=e.status,typeof e.response=="string"&&(p.responseBody=e.response),o.notify(O(E({},p),{state:"complete"}))},{stop:l}=P(n,e,"loadend",c);o.notify(s)}function Fl({target:e}){let t=Oo.get(e);t&&(t.isAborted=!0)}function hs(e){return j(this,null,function*(){let t=e.getReader(),r=[];for(;;){let n=yield t.read();if(n.done)break;r.push(n.value)}return t.cancel().catch(M),Ti(r)})}var vo,_s=[];function Ir({responseBodyAction:e}={}){return e&&_s.push(e),vo||(vo=Bl()),vo}function Bl(){return new y(e=>{if(!X.fetch)return;let{stop:t}=ae(X,"fetch",r=>Hl(r,e),{computeHandlingStack:!0});return t})}function Hl({parameters:e,onPostCall:t,handlingStack:r},n){let[o,i]=e,s=i&&i.method;s===void 0&&o instanceof Request&&(s=o.method);let a=s!==void 0?String(s).toUpperCase():"GET",u=o instanceof Request?o.url:$t(String(o)),c=w(),l={state:"start",init:i,input:o,method:a,startClocks:c,url:u,handlingStack:r,isAbortedOnStart:o instanceof Request&&o.signal?.aborted||i?.signal?.aborted||!1};n.notify(l),e[0]=l.input,e[1]=l.init,t(p=>{Gl(n,p,l).catch(J)})}function Gl(e,t,r){return j(this,null,function*(){let n=r,o;try{o=yield t}catch(s){e.notify(O(E({},n),{state:"resolve",status:0,isAborted:n.init?.signal?.aborted||s instanceof DOMException&&s.code===DOMException.ABORT_ERR,error:s}));return}if(n.response=o,n.status=o.status,n.responseType=o.type,n.isAborted=!1,_s.reduce((s,a)=>Math.max(s,a(n)),0)===1){let s=hi(o);if(s&&s.body)try{let a=yield hs(s.body);n.responseBody=new TextDecoder().decode(a)}catch(a){}}e.notify(O(E({},n),{state:"resolve"}))})}function wo(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){let r=window.requestIdleCallback(_(e),t);return()=>window.cancelIdleCallback(r)}return Kl(e)}var $l=50;function Kl(e){let t=ue(),r=G(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,$l-(ue()-t))})},0);return()=>q(r)}var jl=B,ql=30;function As(){let e=[];function t(n){let o;if(!n||n.didTimeout){let i=performance.now();o=()=>ql-(performance.now()-i)}else o=n.timeRemaining.bind(n);for(;o()>0&&e.length;)e.shift()();e.length&&r()}function r(){wo(t,{timeout:jl})}return{push(n){e.push(n)===1&&r()},stop(){e.length=0}}}var No={};function Is(e){let t=e.map(r=>(No[r]||(No[r]=Yl(r)),No[r]));return Fr(...t)}function Yl(e){return new y(t=>{let r=Ve[e];return Ve[e]=(...n)=>{r.apply(console,n);let o=Me("console error");ee(()=>{t.notify(zl(n,e,o))})},()=>{Ve[e]=r}})}function zl(e,t,r){let n=e.map(o=>Wl(o)).join(" ");
8if(t===ze.error){let o=e.find(Oe),i=xt({originalError:o,handlingStack:r,startClocks:w(),source:ye.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return i.message=n,{api:t,message:n,handlingStack:r,error:i}}return{api:t,message:n,error:void 0,handlingStack:r}}function Wl(e){return typeof e=="string"?R(e):Oe(e)?ro(Re(e)):Te(R(e),void 0,2)}function Cs(e){let t=Ge(e)==="object";return t||b.error("Unsupported context:",e),t}function ko(e,t,r){let n=E({},e);for(let[o,{required:i,type:s}]of Object.entries(t))s==="string"&&!Rs(n[o])&&(n[o]=String(n[o])),i&&Rs(n[o])&&b.warn(`The property ${o} of ${r} is required; context will not be sent to the intake.`);return n}function Rs(e){return e==null||e===""}function it(e="",{propertiesConfig:t={}}={}){let r={},n=new y,o={getContext:()=>Ht(r),setContext:i=>{Cs(i)?r=R(ko(i,t,e)):o.clearContext(),n.notify()},setContextProperty:(i,s)=>{r=R(ko(O(E({},r),{[i]:s}),t,e)),n.notify()},removeContextProperty:i=>{delete r[i],ko(r,t,e),n.notify()},clearContext:()=>{r={},n.notify()},changeObservable:n};return o}function oe(e,t,r,n){return _((...o)=>(n&&K({feature:n}),e()[t][r](...o)))}function Cr(e,t,r){e.changeObservable.subscribe(()=>{let n=e.getContext();r.notify(o=>o[t].setContext(n))})}var Xl="_dd_c",Jl=[];function zt(e,t,r,n){let o=Ql(r,n);Jl.push(P(e,window,"storage",({key:c})=>{o===c&&s()})),t.changeObservable.subscribe(a);let i=de(u(),t.getContext());te(i)||t.setContext(i);function s(){t.setContext(u())}function a(){localStorage.setItem(o,JSON.stringify(t.getContext()))}function u(){let c=localStorage.getItem(o);return c?JSON.parse(c):{}}}function Ql(e,t){return`${Xl}_${e}_${t}`}function Lo(e,t,r){let n=dn();return t.storeContextsAcrossPages&&zt(t,n,r,4),e.register(0,()=>{let o=n.getContext();return te(o)||!o.id?$:{account:o}}),n}function dn(){return it("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}var Os="_dd_tab_id",Mo;function Do(e){let t=Zl();e.register(0,()=>({tab:{id:t}}))}function Zl(){return Mo||(Mo=ep()??V()),Mo}function ep(){try{let e=sessionStorage.getItem(Os);if(e)return e;let t=V();return sessionStorage.setItem(Os,t),t}catch(e){return}}function Po(e,t,r,n){let o=fn();return t.storeContextsAcrossPages&&zt(t,o,r,2),e.register(0,()=>{let i=o.getContext();return n?{context:i}:i}),o}function fn(){return it("global context")}function Uo(e,t,r,n){let o=mn();return t.storeContextsAcrossPages&&zt(t,o,n,1),e.register(0,({eventType:i,startTime:s})=>{let a=o.getContext(),u=r.findTrackedSession(s);return u&&u.anonymousId&&!a.anonymous_id&&t.trackAnonymousUser&&(a.anonymous_id=u.anonymousId),te(a)?$:{type:i,usr:a}}),o}function mn(){return it("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}var z={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},ie={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"};var En="datadog-synthetics-",tp=`${En}public-id`,rp=`${En}result-id`,np=`${En}injects-rum`,op=`${En}rum-context`;function Rr(){return Ee?!1:!!(X._DATADOG_SYNTHETICS_INJECTS_RUM||dt(np))}function gn(){let e=ip();return sp(e)?e:void 0}function Vo(){return!!gn()}function ip(){let e=X._DATADOG_SYNTHETICS_RUM_CONTEXT;if(e)return e;let t=dt(op);return t?Ft(decodeURIComponent(t)):{test_id:window._DATADOG_SYNTHETICS_PUBLIC_ID||dt(tp),result_id:window._DATADOG_SYNTHETICS_RESULT_ID||dt(rp)}}function sp(e){return typeof e=="object"&&e!==null&&typeof e.test_id=="string"&&typeof e.result_id=="string"}var ce={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},st={FETCH:ce.FETCH,XHR:ce.XHR};var ap=500;function vs(){let e=new Je(ap,n=>{ne("Early data collection dropped data on unbuffer",{count:n})}),t=[];function r(n,o){t.push(o.subscribe(i=>{e.notify({type:n,data:i})}))}return r(0,ms()),r(1,Ir()),r(2,Ar({allowUntrustedEvents:!0})),r(3,Is(Object.values(ze))),{observable:e,stop:()=>t.forEach(n=>n.unsubscribe())}}function ws(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Fo(e,t,r){e.register(1,({startTime:n})=>{let o=t.findTrackedSession(n);return o?E({session:{id:o.id},anonymous_id:o.anonymousId},r):$})}function cp(e,t,r,n){let o=u=>{t.notify(14,{error:u}),ne("Error reported to customer",{"error.message":u.message})},i=lt([e.profilingEndpointBuilder],o),s=r(n);return{send(l){return j(this,null,function*(){var p=l,{event:u}=p,c=Dr(p,["event"]);let f=new FormData,d=Te(u);if(!d)throw new Error("Failed to serialize event");f.append("event",new Blob([d],{type:"application/json"}),"event.json");let m=d.length;for(let[g,x]of He(c)){let A=Te(x);if(!A)throw new Error("Failed to serialize attachment");let k=yield up(s,A);m+=k.outputBytesCount,f.append(g,new Blob([k.output]),g)}i.send({data:f,bytesCount:m})})}}}function up(e,t){return new Promise(r=>{e.write(t),e.finish(n=>{r(n)})})}var h={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},Sn={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},ve={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",SESSION_RENEWAL:"session_renewal",BF_CACHE:"bf_cache"},vt={CLICK:"click",CUSTOM:"custom",TAP:"tap",SCROLL:"scroll",SWIPE:"swipe",APPLICATION_START:"application_start",BACK:"back"},at={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"}
8,ft={DURATION:"duration",OPERATION_STEP:"operation_step"};var Ns=["tracecontext","datadog"],bn=["cache-control","etag","age","expires","content-type","content-encoding","vary","content-length","server-timing","x-cache"];function ks(e,t){if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&b.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){b.error("Application ID is not configured, no RUM data will be collected.");return}if(!rt(e.sessionReplaySampleRate,"Session Replay")||!rt(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){b.error("Excluded Activity Urls should be an array");return}let r=lp(e);if(!r)return;let n=an(e,t),o=dp(e);if(!n)return;let i=e.sessionReplaySampleRate??0;return E({applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:i,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:i===0,traceSampleRate:e.traceSampleRate??100,rulePsr:Xe(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:r,excludedActivityUrls:e.excludedActivityUrls??[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(e.trackUserInteractions??!0),trackViewsManually:!!e.trackViewsManually,trackResources:!!(e.trackResources??!0),trackResourceHeaders:mp(e),trackLongTasks:!!(e.trackLongTasks??!0),subdomain:e.subdomain,defaultPrivacyLevel:ht(Ye,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:Ye.MASK_USER_INPUT,enablePrivacyForActionName:e.enablePrivacyForActionName!==!1,traceContextInjection:ht(Ct,e.traceContextInjection)?e.traceContextInjection:Ct.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:e.profilingSampleRate??0,propagateTraceBaggage:e.propagateTraceBaggage!==!1,allowedGraphQlUrls:o},n)}function lp(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){b.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){b.error("Service needs to be configured when tracing is enabled");return}let t=[];return e.allowedTracingUrls.forEach(r=>{let n=Ls(r);n?t.push(n):b.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",r)}),t}function pp(e){let t=new Set;return nt(e.allowedTracingUrls)&&e.allowedTracingUrls.forEach(r=>{Ls(r)?.propagatorTypes.forEach(n=>t.add(n))}),Array.from(t)}function Ls(e){if(It(e))return{match:e,propagatorTypes:Ns};if(Ce(e)&&It(e.match)&&(e.propagatorTypes===null||e.propagatorTypes===void 0||Array.isArray(e.propagatorTypes)))return{match:e.match,propagatorTypes:e.propagatorTypes||Ns}}function dp(e){if(!e.allowedGraphQlUrls)return[];if(!Array.isArray(e.allowedGraphQlUrls))return b.warn("allowedGraphQlUrls should be an array"),[];let t=[];
8return e.allowedGraphQlUrls.forEach(r=>{It(r)?t.push({match:r,trackPayload:!1,trackResponseErrors:!1}):Ce(r)&&It(r.match)&&t.push({match:r.match,trackPayload:!!r.trackPayload,trackResponseErrors:!!r.trackResponseErrors})}),t}var fp=["request","response","any"];function mp(e){let t=e.trackResourceHeaders;if(t===void 0||t===!1)return[];if(t===!0)return bn.map(n=>({name:n}));if(!Array.isArray(t))return b.warn("trackResourceHeaders should be true or an array of MatchHeader"),[];if(t.length===0)return b.warn("trackResourceHeaders is an empty array, no headers will be captured"),[];let r=[];return t.forEach((n,o)=>{if(!Ce(n)||!It(n.name)){b.warn(`trackResourceHeaders[${o}] should be a MatchHeader object with a 'name' property`);return}if(n.url!==void 0&&!It(n.url)){b.warn(`trackResourceHeaders[${o}].url should be a MatchOption`);return}if(n.extractor!==void 0&&!(n.extractor instanceof RegExp)){b.warn(`trackResourceHeaders[${o}].extractor should be a RegExp`);return}if(n.location!==void 0&&!fp.includes(n.location)){b.warn(`trackResourceHeaders[${o}].location should be 'request', 'response', or 'any'`);return}r.push(O(E({},n),{name:typeof n.name=="string"?n.name.toLowerCase():n.name}))}),r}function Ep(e){return nt(e)&&e.some(t=>Ce(t)&&t.trackPayload)}function gp(e){return nt(e)&&e.some(t=>Ce(t)&&t.trackResponseErrors)}function Sp(e){if(e===!0)return"default_headers";if(Array.isArray(e))return"custom"}function Ms(e){let t=cn(e);return E({session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,propagate_trace_baggage:e.propagateTraceBaggage,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:nt(e.allowedTracingUrls),use_allowed_graph_ql_urls:nt(e.allowedGraphQlUrls),use_track_graph_ql_payload:Ep(e.allowedGraphQlUrls),use_track_graph_ql_response_errors:gp(e.allowedGraphQlUrls),selected_tracing_propagators:pp(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:nt(e.excludedActivityUrls),use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,plugins:e.plugins?.map(r=>E({name:r.name},r.getConfigurationTelemetry?.())),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:e.remoteConfigurationId,profiling_sample_rate:e.profilingSampleRate,use_remote_configuration_proxy:!!e.remoteConfigurationProxy,track_resource_headers:Sp(e.trackResourceHeaders)},t)}function yn(e,t){t.lastIndex=0;let r=t.exec(e);if(!r)return;let[n,o]=r;return o||n}function Ps(e){let t=[],r=0,n,o={quote:void 0,escapeSequence:void 0},i="";for(let s of e){if(n=Ds[r].find(a=>_p[a](s,o)),!n)return[];if(o.escapeSequence!==void 0&&n!==12){if(!Cp(o.escapeSequence))return[];i+=Op(o.escapeSequence),o.escapeSequence=void 0}Ap.includes(n)?i+=s:Ip.includes(n)&&i!==""?(t.push(i),i=""):n===12?o.escapeSequence=o.escapeSequence?`${o.escapeSequence}${s}`:s:n===8?o.quote=s:n===9&&(o.quote=void 0),r=n}return Ds[r].includes(1)?(i!==""&&t.push(i),t):[]}var bp=/[a-zA-Z_$]/,yp=/[a-zA-Z0-9_$]/,Tp=/[0-9]/,xp=/[a-fA-F0-9]/,hp=`'"`,_p={0:()=>!1,1:()=>!1,2:e=>bp.test(e),3:e=>yp.test(e),4:e=>e===".",5:e=>e==="[",6:e=>e==="]",7:e=>Tp.test(e),8:e=>hp.includes(e),9:(e,t)=>e===t.quote,10:()=>!0,11:e=>e==="\\",12:(e,t)=>t.escapeSequence===void 0?`${t.quote}/\\bfnrtu`.includes(e):t.escapeSequence.startsWith("u")&&t.escapeSequence.length<5?xp.test(e):!1},Ds={0:[2,5],1:[],2:[3,4,5,1],3:[3,4,5,1],4:[2],5:[8,7],6:[4,5,1],7:[7,6],8:[11,9,10],9:[6],10:[11,9,10],11:[12],12:[12,11,9,10]},Ap=[2,3,7,10],Ip=[4,5,6];function Cp(e){return`"'/\\bfnrt`.includes(e)||e.startsWith("u")&&e.length===5}var Rp={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:` 9`,r:"\r",t:" "};function Op(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):Rp[e]}
9var vp="v1",wp=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];function Us(e,t){return j(this,null,function*(){let r,n=kp(),o=yield Dp(e);return o.ok?(n.increment("fetch","success"),r=Np(e,o.value,t,n)):(n.increment("fetch","failure"),b.error(o.error)),$e("remote configuration metrics",{metrics:n.get()}),r})}function Np(e,t,r,n){let o=E({},e);return wp.forEach(d=>{d in t&&(o[d]=i(t[d]))}),Object.keys(r).forEach(d=>{t[d]!==void 0&&s(r[d],t[d])}),o;function i(d){if(Array.isArray(d))return d.map(i);if(Ce(d)){if(Lp(d)){let m=d.rcSerializedType;switch(m){case"string":return d.value;case"regex":return Vs(d.value);case"dynamic":return a(d);default:b.error(`Unsupported remote configuration: "rcSerializedType": "${m}"`);return}}return Yr(d,i)}return d}function s(d,m){m.forEach(({key:g,value:x})=>{d.setContextProperty(g,i(x))})}function a(d){let m=d.strategy,g;switch(m){case"cookie":g=u(d);break;case"dom":g=l(d);break;case"js":g=f(d);break;case"localStorage":g=c(d);break;default:b.error(`Unsupported remote configuration: "strategy": "${m}"`);return}let x=d.extractor;return x!==void 0&&typeof g=="string"?Mp(x,g):g}function u({name:d}){let m=pt(d);return n.increment("cookie",m!==void 0?"success":"missing"),m}function c({key:d}){let m;try{m=localStorage.getItem(d)}catch(g){n.increment("localStorage","failure");return}return n.increment("localStorage",m!==null?"success":"missing"),m??void 0}function l({selector:d,attribute:m}){let g;try{g=document.querySelector(d)}catch(A){b.error(`Invalid selector in the remote configuration: '${d}'`),n.increment("dom","failure");return}if(!g){n.increment("dom","missing");return}if(p(g,m)){b.error(`Forbidden element selected by the remote configuration: '${d}'`),n.increment("dom","failure");return}let x=m!==void 0?g.getAttribute(m):g.textContent;if(x===null){n.increment("dom","missing");return}return n.increment("dom","success"),x}function p(d,m){return d.getAttribute("type")==="password"&&m==="value"}function f({path:d}){let m=window,g=Ps(d);if(g.length===0){b.error(`Invalid JSON path in the remote configuration: '${d}'`),n.increment("js","failure");return}for(let x of g){if(!(x in m)){n.increment("js","missing");return}try{m=m[x]}catch(A){b.error(`Error accessing: '${d}'`,A),n.increment("js","failure");return}}return n.increment("js","success"),m}}function kp(){let e={fetch:{}};return{get:()=>e,increment:(t,r)=>{e[t]||(e[t]={}),e[t][r]||(e[t][r]=0),e[t][r]=e[t][r]+1}}}function Lp(e){return"rcSerializedType"in e}function Vs(e){try{return new RegExp(e)}catch(t){b.error(`Invalid regex in the remote configuration: '${e}'`)}}function Mp(e,t){let r=Vs(e.value);if(r!==void 0)return yn(t,r)}function Dp(e){return j(this,null,function*(){let t;try{t=yield pr(Pp(e))}catch(n){t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};let r=yield t.json();return r.rum?{ok:!0,value:r.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}})}function Pp(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${yr(e)}/${vp}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function Tn(e,t,r){if(e)for(let n of e){let o=n[t];o&&o(r)}}var Bo=$i;function Fs(e,t){e.register(1,()=>t.isGranted()?$:Se)}function Bs({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},r,n){let i=new Je(500,S=>{ne("preStartRum buffer data lost",{count:S})}),s=fn();Cr(s,z.globalContext,i);let a=mn();Cr(a,z.userContext,i);let u=dn();Cr(u,z.accountContext,i);let c,l,p,f,d,m,g=Bo(),x=r.observable.subscribe(Q),A={},k=!1;function Q(){if(k||!p||!f||!d||!m)return;x.unsubscribe();let S;if(f.trackViewsManually){if(!c)return;S=c.options}let T=f.trackViewsManually?c?.callback:void 0,C=n(f,d,l,S,m,g);k=!0,i.subscribe(N=>{N!==T&&N(C)}),i.unbuffer()}function Z(S,T){let C=le();if(C&&(S=Up(S)),p=S,f){Tr("DD_RUM",S);return}let N=ks(S,T);N&&(N.compressIntakeRequests&&!C&&t&&(l=t(N,"Datadog RUM",M),!l)||(f=N,r.tryToInit(N.trackingConsent),r.onGrantedOnce(()=>{if(Fs(g,r),m=Qr("browser-rum-sdk",N,g),Ee){b.warn("The RUM SDK is not supported in a web or service worker environment.");return}(le()?Co():Io(N,r)).then(Ue=>{Ue&&(d=Ue,Fo(g,d,{application:{id:N.applicationId}}),Zr(Ms(S)),Q())}).catch(J)})))}
9return{init(S,T,C){if(!S){b.error("Missing configuration");return}oo(S.enableExperimentalFeatures),p=S,!(e&&Rr())&&(Tn(S.plugins,"onInit",{initConfiguration:S,publicApi:T}),S.remoteConfigurationId?Us(S,{user:a,context:s}).then(N=>{N&&Z(N,C)}).catch(J):Z(S,C))},get initConfiguration(){return p},getInternalContext:M,stopSession:M,addTiming(S,T=F()){i.notify(C=>C.addTiming(S,T))},setLoadingTime:S=>{i.notify(T=>T.setLoadingTime(S))},startView(S,T=w()){let C=N=>{N.startView(S,T)};i.notify(C),c||(c={options:S,callback:C},Q())},setViewName(S){i.notify(T=>T.setViewName(S))},setViewContext(S){i.notify(T=>T.setViewContext(S))},setViewContextProperty(S,T){i.notify(C=>C.setViewContextProperty(S,T))},getViewContext:()=>A,globalContext:s,userContext:a,accountContext:u,addAction(S){i.notify(T=>T.addAction(S))},startAction(S,T){let C=w();i.notify(N=>N.startAction(S,T,C))},stopAction(S,T){let C=w();i.notify(N=>N.stopAction(S,T,C))},startResource(S,T){let C=w();i.notify(N=>N.startResource(S,T,C))},stopResource(S,T){let C=w();i.notify(N=>N.stopResource(S,T,C))},addError(S){i.notify(T=>T.addError(S))},addFeatureFlagEvaluation(S,T){i.notify(C=>C.addFeatureFlagEvaluation(S,T))},startDurationVital(S,T){let C=w();i.notify(N=>N.startDurationVital(S,T,C))},stopDurationVital(S,T){let C=w();i.notify(N=>N.stopDurationVital(S,T,C))},addDurationVital(S){i.notify(T=>T.addDurationVital(S))},addOperationStepVital:(S,T,C,N)=>{i.notify(Ne=>Ne.addOperationStepVital(R(S),T,R(C),R(N)))}}}function Up(e){return O(E({},e),{applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:e.defaultPrivacyLevel??Ie()?.getPrivacyLevel()})}function Hs(){let e=Gs();return new y(t=>{let r=new e(_(n=>t.notify(n)));return r.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>r.disconnect()})}function Gs(){let e,t=window;if(t.Zone&&(e=ge(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){let r=new t.MutationObserver(M),n=ge(r,"originalInstance");e=n&&n.constructor}return e||(e=t.MutationObserver),e}function $s(){let e=new y,{stop:t}=ae(window,"open",()=>e.notify());return{observable:e,stop:t}}function Ks(e,t,r,n,o){return{get:i=>{let s=r.findView(i),a=o.findUrl(i),u=t.findTrackedSession(i);if(u&&s&&a){let c=n.findActionId(i);return{application_id:e,session_id:u.id,user_action:c?{id:c}:void 0,view:{id:s.id,name:s.name,referrer:a.referrer,url:a.url}}}}}}var Ho=_r;var Vp=fe;function Go(e){let t=xe({expireDelay:Vp});e.subscribe(1,n=>{t.add(r(n),n.startClocks.relative)}),e.subscribe(6,({endClocks:n})=>{t.closeActive(n.relative)}),e.subscribe(3,n=>{let o=t.find(n.startClocks.relative);o&&(n.name&&(o.name=n.name),n.context&&(o.context=n.context),o.sessionIsActive=n.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function r(n){return{service:n.service,version:n.version,context:n.context,id:n.id,name:n.name,startClocks:n.startClocks}}return{findView:n=>t.find(n),stop:()=>{t.stop()}}}var Fp=[[ce.DOCUMENT,e=>e==="navigation"],[ce.XHR,e=>e==="xmlhttprequest"],[ce.FETCH,e=>e==="fetch"],[ce.BEACON,e=>e==="beacon"],[ce.CSS,(e,t)=>/\.css$/i.test(t)],[ce.JS,(e,t)=>/\.js$/i.test(t)],[ce.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[ce.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[ce.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function qs(e){let t=e.name;if(!zi(t))return ce.OTHER;let r=Wi(t);for(let[n,o]of Fp)if(o(e.initiatorType,r))return n;return ce.OTHER}function js(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function Ys(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function zs(e){let{duration:t,startTime:r,responseEnd:n}=e;return e.initiatorType==="navigation"||t===0&&r<n?D(r,n):t}function Ws(e){if(!Bp(e))return;let{startTime:t,fetchStart:r,workerStart:n,redirectStart:o,redirectEnd:i,domainLookupStart:s,domainLookupEnd:a,connectStart:u,secureConnectionStart:c,connectEnd:l,requestStart:p,responseStart:f,responseEnd:d}=e,m={download:wt(t,f,d),first_byte:wt(t,p,f)};return 0<n&&n<r&&(m.worker=wt(t,n,r)),r<l&&(m.connect=wt(t,u,l),u<=c&&c<=l&&(m.ssl=wt(t,c,l))),r<a&&(m.dns=wt(t,s,a)),t<i&&(m.redirect=wt(t,o,i)),m}function Xs(e){return e.duration>=0}function Bp(e){let t=js(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),r=Hp(e)?js(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&r}function Hp(e){return e.redirectEnd>e.startTime}function wt(e,t,r){if(e<=t&&t<=r)return{duration:I(D(t,r)),start:I(D(e,t))}}function Js(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function Qs(e){return e.deliveryType===""?"other":e.deliveryType}function Zs(e){if(e.startTime<e.responseStart){let{encodedBodySize:t,decodedBodySize:r,transferSize:n}=e;return{size:r,encoded_body_size:t,decoded_body_size:r,transfer_size:n}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function Nt(e){return e&&(!sn(e)||pe(re.TRACK_INTAKE_REQUESTS))}var Gp=/data:(.+)?(;base64)?,/g,$p=24e3;function Or(e,t=$p){if(e.length<=t||!e.startsWith("data:"))return e;let r=e.substring(0,100).match(Gp);return r?`${r[0]}[...]`:e}function ea(){return ta(64)}function xn(){return ta(63)}function ta(e){let t=crypto.getRandomValues(new Uint32Array(2)),r=BigInt(t[0])+(BigInt(t[1])<<32n);return e===63&&(r&=0x7fffffffffffffffn),r}function kt(e){return e.toString(16).padStart(16,"0")}function Kp(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function na(e,t,r,n){return{clearTracingIfNeeded:Kp,traceFetch:o=>ra(e,o,t,r,n,i=>{if(o.input instanceof Request&&!o.init?.headers)o.input=new Request
9(o.input),Object.keys(i).forEach(s=>{o.input.headers.append(s,i[s])});else{o.init=Ze(o.init);let s=[];o.init.headers instanceof Headers?o.init.headers.forEach((a,u)=>{s.push([u,a])}):Array.isArray(o.init.headers)?o.init.headers.forEach(a=>{s.push(a)}):o.init.headers&&Object.keys(o.init.headers).forEach(a=>{s.push([a,o.init.headers[a]])}),o.init.headers=s.concat(He(i))}}),traceXhr:(o,i)=>ra(e,o,t,r,n,s=>{try{Object.keys(s).forEach(a=>{i.setRequestHeader(a,s[a])})}catch(a){}})}}function ra(e,t,r,n,o,i){let s=r.findTrackedSession();if(!s)return;let a=e.allowedTracingUrls.find(p=>Pe([p.match],t.url,!0));if(!a)return;let u=Ot(s.id,hr(e.sessionSampleRate,e.traceSampleRate)),c=le()?Ie()?.getIsTraceSampled()??u:u;(c||e.traceContextInjection===Ct.ALL)&&(t.traceSampled=c,t.traceId=ea(),t.spanId=xn(),i(jp(t.traceId,t.spanId,t.traceSampled,s.id,a.propagatorTypes,n,o,e)))}function jp(e,t,r,n,o,i,s,a){let u={};if(o.forEach(c=>{switch(c){case"datadog":{Object.assign(u,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":r?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(u,{traceparent:`00-0000000000000000${kt(e)}-${kt(t)}-0${r?"1":"0"}`,tracestate:`dd=s:${r?"1":"0"};o:rum`});break}case"b3":{Object.assign(u,{b3:`${kt(e)}-${kt(t)}-${r?"1":"0"}`});break}case"b3multi":{Object.assign(u,{"X-B3-TraceId":kt(e),"X-B3-SpanId":kt(t),"X-B3-Sampled":r?"1":"0"});break}}}),a.propagateTraceBaggage){let c={"session.id":n},l=i.getContext().id;typeof l=="string"&&(c["user.id"]=l);let p=s.getContext().id;typeof p=="string"&&(c["account.id"]=p);let f=Object.entries(c).map(([d,m])=>`${d}=${encodeURIComponent(m)}`).join(",");f&&(u.baggage=f)}return u}var qp=32*1024;function oa(e,t){let r=zp(e,t.trackPayload);if(r){if(t.trackResponseErrors&&e.responseBody){let n=Yp(e.responseBody);n&&(r.error_count=n.length,r.errors=n)}return r}}function Yp(e){let t=Ft(e);if(!t||typeof t!="object")return;let r=t;return nt(r.errors)?r.errors.map(o=>({message:o.message,path:o.path,locations:o.locations,code:o.extensions?.code})):void 0}function hn(e,t){return t.allowedGraphQlUrls.find(r=>Pe([r.match],e))}function zp(e,t=!1){let r;if(e.method==="POST"?r=Wp(e.requestBody):e.method==="GET"&&(r=Xp(e.url)),!!r)return Jp(r,t)}function Wp(e){if(!e||typeof e!="string")return;let t=Ft(e);if(t)return{query:t.query,operationName:t.operationName,variables:t.variables?JSON.stringify(t.variables):void 0}}function Xp(e){let t=tt(e).searchParams,r=t.get("variables"),n=r&&Ft(r)!==void 0?r:void 0;return{query:t.get("query")||void 0,operationName:t.get("operationName")||void 0,variables:n}}function Jp(e,t){let r,n,o;if(e.query){let i=e.query.trim();r=Qp(i),t&&(n=Ke(i,qp,"..."))}return e.variables&&(o=e.variables),{operationType:r,operationName:e.operationName,variables:o,payload:n}}function Qp(e){return e.match(/^\s*(query|mutation|subscription)\b/i)?.[1]}var Zp=1;function ia(e,t,r,n,o,i){let s=na(t,r,n,o);ed(e,t,s,i),td(e,t,s,i)}function ed(e,t,r,n){let o=[];return o.push(Ar(t).subscribe(i=>{i.state==="start"&&Nt(i.url)&&(r.traceXhr(i,i.xhr),_n(i))})),o.push(n.subscribe(({data:i,type:s})=>{if(s!==2)return;let a=i;if(Nt(a.url))switch(a.state){case"start":_n(a),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"complete":r.clearTracingIfNeeded(a),e.notify(8,O(E({},a),{type:st.XHR,isAbortedOnStart:!1}));break}})),{stop:()=>o.forEach(i=>i.unsubscribe())}}function td(e,t,r,n){let o=[];return o.push(Ir({responseBodyAction:i=>hn(i.url,t)?.trackResponseErrors?1:0}).subscribe(i=>{i.state==="start"&&Nt(i.url)&&(r.traceFetch(i),_n(i))})),o.push(n.subscribe(({data:i,type:s})=>{if(s!==1)return;let a=i;if(Nt(a.url))switch(a.state){case"start":_n(a),e.notify(7,{requestIndex:a.requestIndex,url:a.url});break;case"resolve":r.clearTracingIfNeeded(a),e.notify(8,O(E({},a),{duration:D(a.startClocks.timeStamp,F()),type:st.FETCH,requestBody:a.init?.body}));break}})),{stop:()=>o.forEach(i=>i.unsubscribe())}}function _n(e){e.requestIndex||(e.requestIndex=Zp++)}function An(e){return Xe(e)&&e<0?void 0:e}function vr(e){return e.nodeType===Node.TEXT_NODE}
9function sa(e){return e.nodeType===Node.COMMENT_NODE}function he(e){return e.nodeType===Node.ELEMENT_NODE}function $o(e){return he(e)&&!!e.shadowRoot}function In(e){let t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&he(t.host)}function V_(e,t){let r=e.firstChild;for(;r;)t(r),r=r.nextSibling;$o(e)&&t(e.shadowRoot)}function aa(e){return In(e)?e.host:e.parentNode}function Ko(e){if(e.parentElement)return e.parentElement;let t=e.parentNode;return t&&In(t)?t.host:null}var U=(function(e){return e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state",e})(U||{});function me(e,t){return new y(r=>{let n=a=>{let u=od(a);u.length>0&&r.notify(u)},o,i=!0,s=new PerformanceObserver(_(a=>{i?o=G(()=>n(a.getEntries())):n(a.getEntries())}));return s.observe(t),i=!1,rd(e),()=>{s.disconnect(),q(o)}})}var ca;function rd(e){!ca&&nd()&&"addEventListener"in performance&&(ca=P(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()}))}function nd(){return window.performance!==void 0&&"getEntries"in performance}function be(e){return PerformanceObserver.supportedEntryTypes.includes(e)}function od(e){return e.filter(t=>!id(t))}function id(e){return e.entryType===U.RESOURCE&&(!Nt(e.name)||!Xs(e))}var qo=100,sd=100,ua="data-dd-excluded-activity-mutations";function wr(e,t,r,n,o,i){let s=ad(e,t,r,n),a,u=!1,c=G(_(()=>d({hadActivity:!1})),qo),l=i!==void 0?G(_(()=>d({hadActivity:!0,end:F()})),i):void 0,p=s.subscribe(({isBusy:m})=>{q(c),q(a);let g=F();m||(a=G(_(()=>d({hadActivity:!0,end:g})),sd))}),f=()=>{u=!0,q(c),q(a),q(l),p.unsubscribe()};function d(m){u||(f(),o(m))}return{stop:f}}function ad(e,t,r,n){return new y(o=>{let i=[],s,a=0;return i.push(t.subscribe(c=>{c.every(cd)||u()}),r.subscribe(u),me(n,{type:U.RESOURCE}).subscribe(c=>{c.some(l=>!jo(n,l.name))&&u()}),e.subscribe(7,c=>{jo(n,c.url)||(s===void 0&&(s=c.requestIndex),a+=1,u())}),e.subscribe(8,c=>{jo(n,c.url)||s===void 0||c.requestIndex<s||(a-=1,u())})),()=>{i.forEach(c=>c.unsubscribe())};function u(){o.notify({isBusy:a>0})}})}function jo(e,t){return Pe(e.excludedActivityUrls,t)}function cd(e){let t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&he(t)&&t.matches(`[${ua}], [${ua}] *`))}var Xt="data-dd-action-name",Yo="Masked Element";var ud="::shadow ",Jt=[Xt,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],ld=[pa,zo],pd=[pa,md,Wo];function mt(e,t){if(!e.isConnected)return;let r=dd(e),n=[];for(let{rootNode:o,target:i}of r){let s=fd(i,o,t);if(!s)return;n.push(s)}return n.join(ud)}function dd(e){let t=[],r=e;for(;r;){let n=r.getRootNode();if(t.push({rootNode:n,target:r}),In(n))r=n.host;else break}return t.reverse()}function fd(e,t,r){let n,o=e;for(;o&&o.nodeName!=="HTML";){let i=la(o,t,ld,gd,r,n);if(i)return Cn(i,n);let a=la(o,t,pd,Sd,r,n)||Ed(o);n=Cn(a,n),o=o.parentElement}return n}function Rn(e){return/[0-9]/.test(e)}function zo(e){if(e.id&&!Rn(e.id))return`#${CSS.escape(e.id)}`}function md(e){if(e.tagName==="BODY")return;let t=e.classList;for(let r=0;r<t.length;r+=1){let n=t[r];if(!Rn(n))return`${CSS.escape(e.tagName)}.${CSS.escape(n)}`}}function Wo(e){return CSS.escape(e.tagName)}function pa(e,t){if(t){let n=r(t);if(n)return n}for(let n of Jt){let o=r(n);if(o)return o}function r(n){if(e.hasAttribute(n))return`${CSS.escape(e.tagName)}${Xo(n,e.getAttribute(n))}`}}function Xo(e,t){return`[${e}="${CSS.escape(t)}"]`}function Ed(e){let t=Jo(e);return`${CSS.escape(e.tagName)}:nth-of-type(${t})`}function Jo(e){let r=e.parentNode.firstElementChild,n=1;for(;r&&r!==e;)r.tagName===e.tagName&&(n+=1),r=r.nextElementSibling;return n}function la(e,t,r,n,o,i){for(let s of r){let a=s(e,o);if(a&&n(e,t,a,i))return a}}function gd(e,t,r,n){return t.querySelectorAll(Cn(r,n)).length===1}function Sd(e,t,r,n){let o;if(n===void 0)o=s=>s.matches(r);else{let s=Cn(`${r}:scope`,n);o=a=>a.querySelector(s)!==null}let i=e.previousElementSibling;for(;i;){if(o(i))return!1;i=i.previousElementSibling}for(i=e.nextElementSibling;i;){if(o(i))return!1;i=i.nextElementSibling}return!0}function Cn(e,t){return t?`${e}>${t}`:e}var L={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:Ye.ALLOW,MASK:Ye.MASK,MASK_USER_INPUT:Ye.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:Ye.MASK_UNLESS_ALLOWLISTED},Qo="data-dd-privacy";var Q_="hidden",bd="dd-privacy-",On="***",Z_="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",da={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},fa="x";function Qt(e){return`[${Qo}="${e}"], .${bd}${e}`}function Zt(e,t,r){if(r&&r.has(e))return r.get(e);let n=aa(e),o=n?Zt(n,t,r):t,i=Td(e),s=yd(i,o);return r&&r.set(e,s),s}function yd(e,t){switch(t){case L.HIDDEN:case L.IGNORE:return t}switch(e){case L.ALLOW:case L.MASK:case L.MASK_USER_INPUT:case L.MASK_UNLESS_ALLOWLISTED:case L.HIDDEN:case L.IGNORE:return e;default:return t}}function Td(e){if(he(e)){if(e.tagName==="BASE")return L.ALLOW;if(e.tagName==="INPUT"){let t=e;if(t.type==="password"||t.type==="email"||t.type==="tel")return L.MASK;if(t.type==="hidden")return L.MASK;let r=t.getAttribute("autocomplete");if(r&&(r.startsWith("cc-")||r.endsWith("-password")))return L.MASK}if(e.matches(Qt(L.HIDDEN)))return L.HIDDEN;if(e.matches(Qt(L.MASK)))return L.MASK;if(e.matches(Qt(L.MASK_UNLESS_ALLOWLISTED)))return L.MASK_UNLESS_ALLOWLISTED;if(e.matches(Qt(L.MASK_USER_INPUT)))return L.MASK_USER_INPUT;if(e.matches(Qt(L.ALLOW)))return L.ALLOW;if(xd(e))return L.IGNORE}}function Zo(e,t){switch(t){case L.MASK:case L.HIDDEN:case L.IGNORE:return!0;case L.MASK_UNLESS_ALLOWLISTED:return vr(e)?vn(e.parentNode)?!0:!ga(e.textContent||""):vn(e);case L.MASK_USER_INPUT:return vr(e)?vn(e.parentNode):vn(e);default:return!1}}function ma(e,t,r,n,o){if(n!==L.MASK&&n!==L.MASK_UNLESS_ALLOWLISTED||t===Qo||Jt.includes(t)||t===o.actionNameAttribute)return!1;switch(t){case"title":case"alt":case"placeholder":case"aria-label":case"name":return!0}return!!(e==="A"&&t==="href"||e==="IFRAME"&&t==="srcdoc"||r&&t.startsWith("data-")||(e==="IMG"||e==="SOURCE")&&(t==="src"||t==="srcset"))}function vn(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;let t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!da[t.tagName]}function Ea(e){return e.replace(/\S/g,fa)}function oA(e,t){let r=e.parentElement?.tagName,n=e.textContent||"";if(r==="HEAD"&&!n.trim())return;let i=t;if(r==="SCRIPT")n=On;else if(i===L.HIDDEN)n=On;else if(Zo(e,i))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!n.trim())return}else r==="OPTION"?n=On:n=Ea(n);return n}function xd(e){if(e.nodeName==="SCRIPT")return!0;
9if(e.nodeName==="LINK"){let r=t("rel");return/preload|prefetch/i.test(r)&&t("as")==="script"||r==="shortcut icon"||r==="icon"}if(e.nodeName==="META"){let r=t("name"),n=t("rel"),o=t("property");return/^msapplication-tile(image|color)$/.test(r)||r==="application-name"||n==="icon"||n==="apple-touch-icon"||n==="shortcut icon"||r==="keywords"||r==="description"||/^(og|twitter|fb):/.test(o)||/^(og|twitter):/.test(r)||r==="pinterest"||r==="robots"||r==="googlebot"||r==="bingbot"||e.hasAttribute("http-equiv")||r==="author"||r==="generator"||r==="framework"||r==="publisher"||r==="progid"||/^article:/.test(o)||/^product:/.test(o)||r==="google-site-verification"||r==="yandex-verification"||r==="csrf-token"||r==="p:domain_verify"||r==="verify-v1"||r==="verification"||r==="shopify-checkout-api-token"}function t(r){return(e.getAttribute(r)||"").toLowerCase()}return!1}function ga(e){return!e||!e.trim()?!0:window.$DD_ALLOW?.has(e.toLocaleLowerCase())||!1}function Sa(e,t){return ga(e)?e:t||Ea(e)}function wn({lifeCycle:e,isChildEvent:t,onChange:r=M}){let n={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},o=e.subscribe(13,i=>{if(!(i.type==="view"||i.type==="vital"||!t(i)))switch(i.type){case h.ERROR:n.errorCount+=1,r();break;case h.ACTION:n.actionCount+=1,i.action.frustration&&(n.frustrationCount+=i.action.frustration.type.length),r();break;case h.LONG_TASK:n.longTaskCount+=1,r();break;case h.RESOURCE:i._dd?.discarded||(n.resourceCount+=1,r());break}});return{stop:()=>{o.unsubscribe()},eventCounts:n}}var hd=5*H;function Et(e){let t=xe({expireDelay:hd}),r=new Map;function n(f){r.delete(f.key),f.eventCounts?.stop()}function o(){r.forEach(f=>{n(f)}),t.reset()}let i=e.subscribe(10,o);function s(f,d,m,g){let x=V(),A=t.add(x,d.relative),k=r.get(f);k&&n(k);let Q=g?.isChildEvent?wn({lifeCycle:e,isChildEvent:g.isChildEvent(x)}):void 0,Z={id:x,key:f,startClocks:d,data:m,historyEntry:A,eventCounts:Q};return r.set(f,Z),Z}function a(f,d,m){let g=r.get(f);if(!g)return;let x=m?de(g.data,m):g.data;g.historyEntry.close(d.relative);let A=D(g.startClocks.timeStamp,d.timeStamp),k=g.eventCounts?.eventCounts;return n(g),O(E({},x),{id:g.id,startClocks:g.startClocks,duration:A,counts:k})}function u(f){let d=r.get(f);if(!d)return;let m=d.eventCounts?.eventCounts;return n(d),d.historyEntry.remove(),O(E({},d.data),{id:d.id,startClocks:d.startClocks,counts:m})}function c(f){return t.findAll(f)}function l(f){return r.get(f)?.eventCounts?.eventCounts}function p(){i.unsubscribe(),o(),t.stop()}return{start:s,stop:a,discard:u,getCounts:l,findId:c,stopAll:p}}var _d=["HTML","BODY"],ba=2*1024,ya=Jt.concat(["role","type","disabled","readonly","tabindex","draggable","target","rel","download","method","action","enctype","autocomplete"]);function Ta(e,t){let r=e.filter(i=>i instanceof Element&&!_d.includes(i.tagName));if(r.length===0)return"";let n=t?[t].concat(ya):ya,o="";for(let i of r){let s=Ad(i,n);if(o+=s,o.length>=ba)return Ke(o,ba)}return o}function Ad(e,t){let r=Wo(e),n=zo(e),o=Id(e),i=Rd(e,t),s=Cd(e);return`${r}${n||""}${i}${o}${s};`}function Id(e){return Array.from(e.classList).filter(t=>!Rn(t)).sort().map(t=>`.${CSS.escape(t)}`).join("")}function Cd(e){let t=Array.from(e.parentNode.children);if(t.length<=1)return"";let r=t.filter(i=>i.tagName===e.tagName),n=t.indexOf(e),o=Jo(e);return`:nth-child(${n+1})${r.length>1?`:nth-of-type(${o})`:""}`}function Rd(e,t){let r=[],n=Array.from(e.attributes);for(let o of n)t.includes(o.name)&&r.push(Xo(o.name,o.value));return r.sort().join("")}var xa=B,Od=100;function ha(e,t){let r=[],n=0,o;i(e);function i(u){u.stopObservable.subscribe(s),r.push(u),q(o),o=G(a,xa)}function s(){n===1&&r.every(u=>u.isStopped())&&(n=2,t(r))}function a(){q(o),n===0&&(n=1,s())}return{tryAppend:u=>n!==0?!1:r.length>0&&!vd(r[r.length-1].event,u.event)?(a(),!1):(i(u),!0),stop:()=>{a()}}}function vd(e,t){return e.target===t.target&&wd(e,t)<=Od&&e.timeStamp-t.timeStamp<=xa}function wd(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function Ia(e,t,r=L.ALLOW){let n=new Map,{actionNameAttribute:o}=t,i=_a(e,Xt)||o&&_a(e,o);return i?{name:i,nameSource:"custom_attribute"}:r===L.MASK?{name:Yo,nameSource:"mask_placeholder"}:Aa(e,kd,t,n)||Aa(e,Ld,t,n)||{name:"",nameSource:"blank"}}function _a(e,t){let r=Nd(e,`[${t}]`);
9if(!r)return;let n=r.getAttribute(t);return Ra(Ca(n.trim()))}function Nd(e,t){let r=e;for(;r;){if(r.matches(t))return r;r=Ko(r)}return null}var kd=[(e,t,r)=>{if("labels"in e&&e.labels&&e.labels.length>0)return Nn(e.labels[0],t,r)},e=>{if(e.nodeName==="INPUT"){let t=e,r=t.getAttribute("type");if(r==="button"||r==="submit"||r==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,r)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return Nn(e,t,r)},(e,t,r)=>Nr(e,"aria-label",t,r),(e,t,r)=>{let n=e.getAttribute("aria-labelledby");if(n)return{name:n.split(/\s+/).map(o=>Dd(e,o)).filter(o=>!!o).map(o=>Oa(o,t,r)).join(" "),nameSource:"text_content"}},(e,t,r)=>Nr(e,"alt",t,r),(e,t,r)=>Nr(e,"name",t,r),(e,t,r)=>Nr(e,"title",t,r),(e,t,r)=>Nr(e,"placeholder",t,r),(e,t,r)=>{if("options"in e&&e.options.length>0)return Nn(e.options[0],t,r)}],Ld=[(e,t,r)=>Nn(e,t,r)],Md=10;function Aa(e,t,r,n){let o=e,i=0;for(;i<=Md&&o&&o.nodeName!=="BODY"&&o.nodeName!=="HTML"&&o.nodeName!=="HEAD";){for(let s of t){let a=s(o,r,n);if(a){let{name:u,nameSource:c}=a,l=u&&u.trim();if(l)return{name:Ra(Ca(l)),nameSource:c}}}if(o.nodeName==="FORM")break;o=Ko(o),i+=1}}function Ca(e){return e.replace(/\s+/g," ")}function Ra(e){return e.length>100?`${Ke(e,100)} [...]`:e}function Dd(e,t){let r=e.getRootNode();if(r instanceof ShadowRoot){let n=r.getElementById(t);if(n)return n}return e.ownerDocument?e.ownerDocument.getElementById(t):null}function Nr(e,t,r,n){let{enablePrivacyForActionName:o,defaultPrivacyLevel:i}=r,s=e.getAttribute(t);if(s&&o){let a=Zt(e,i,n);ma(e.tagName,t,s,a,r)&&(s=Sa(s,Yo))}else s||(s="");return{name:s,nameSource:"standard_attribute"}}function Nn(e,t,r){return{name:Oa(e,t,r)||"",nameSource:"text_content"}}function Oa(e,t,r){if(e.isContentEditable)return;let{enablePrivacyForActionName:n,actionNameAttribute:o,defaultPrivacyLevel:i}=t,s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,u),a="";for(;s.nextNode();){let c=s.currentNode;if(he(c)){(c.nodeName==="BR"||c.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(c).display))&&(a+=" ");continue}a+=c.textContent||""}return a.replace(/\s+/g," ").trim();function u(c){let l=Zt(c,i,r);if(n&&l&&Zo(c,l))return NodeFilter.FILTER_REJECT;if(he(c)){if(c.hasAttribute(Xt)||o&&c.hasAttribute(o))return NodeFilter.FILTER_REJECT;let p=getComputedStyle(c);if(p.visibility!=="visible"||p.display==="none"||p.contentVisibility&&p.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}function Na(e,{onPointerDown:t,onPointerUp:r}){let n,o={selection:!1,input:!1,scroll:!1},i,s=[P(e,window,"pointerdown",a=>{wa(a)&&(n=va(),o={selection:!1,input:!1,scroll:!1},i=t(a))},{capture:!0}),P(e,window,"selectionchange",()=>{(!n||!va())&&(o.selection=!0)},{capture:!0}),P(e,window,"scroll",()=>{o.scroll=!0},{capture:!0,passive:!0}),P(e,window,"pointerup",a=>{if(wa(a)&&i){let u=o;r(i,a,()=>u),i=void 0}},{capture:!0}),P(e,window,"input",()=>{o.input=!0},{capture:!0})];return{stop:()=>{s.forEach(a=>a.stop())}}}function va(){let e=window.getSelection();return!e||e.isCollapsed}function wa(e){return e.target instanceof Element&&e.isPrimary!==!1}var ka=3;function Ma(e,t){if(Pd(e))return t.addFrustration(at.RAGE_CLICK),e.some(La)&&t.addFrustration(at.DEAD_CLICK),t.hasError&&t.addFrustration(at.ERROR_CLICK),{isRage:!0};let r=e.some(n=>n.getUserActivity().selection);return e.forEach(n=>{n.hasError&&n.addFrustration(at.ERROR_CLICK),La(n)&&!r&&n.addFrustration(at.DEAD_CLICK)}),{isRage:!1}}function Pd(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(ka-1);t+=1)if(e[t+ka-1].event.timeStamp-e[t].event.timeStamp<=B)return!0;return!1}var Ud='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 La(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(Ud)}var ei=10*B,kr=new Map;function Da(e){let t=kr.get(e);return kr.delete(e),t}function ti(e,t){kr.set(e,t),kr.forEach((r,n)=>{D(n,Y())>ei&&kr.delete(n)})}function kn(e){return t=>t.action!==void 0&&t.action.id!==void 0&&t.action.id.includes(e)}function Pa(e,t,r,n){let o=Et(e),i=new y,s;e.subscribe(5,c),e.subscribe(11,c);let{stop:a}=Na(n,{onPointerDown:l=>Vd(n,e,t,l,r),onPointerUp:({clickActionBase:l,hadActivityOnPointerDown:p},f,d)=>{Fd(n,e,t,r,o,i,u,l,f,d,p)}});return{stop:()=>{c(),i.notify(),a(),o.stopAll()},findActionId:o.findId};function u(l){if(!s||!s.tryAppend(l)){let p=l.clone();s=ha(l,f=>{Hd(f,p),s=void 0})}}function c(){s&&s.stop()}}function Vd(e,t,r,n,o){let i;
9if(e.enablePrivacyForActionName?i=Zt(Ua(n),e.defaultPrivacyLevel):i=L.ALLOW,i===L.HIDDEN)return;let s=Bd(n,i,e),a=!1;return wr(t,r,o,e,u=>{a=u.hadActivity},qo),{clickActionBase:s,hadActivityOnPointerDown:()=>a}}function Fd(e,t,r,n,o,i,s,a,u,c,l){let p=Va(t,o,c,a,u);s(p);let f=a?.target?.selector;f&&ti(u.timeStamp,f);let{stop:d}=wr(t,r,n,e,A=>{A.hadActivity&&A.end<p.startClocks.timeStamp?p.discard():A.hadActivity?p.stop(A.end):l()?p.stop(p.startClocks.timeStamp):p.stop()},ei),m=t.subscribe(5,({endClocks:A})=>{p.stop(A.timeStamp)}),g=t.subscribe(11,()=>{p.stop(F())}),x=i.subscribe(()=>{p.stop()});p.stopObservable.subscribe(()=>{g.unsubscribe(),m.unsubscribe(),d(),x.unsubscribe()})}function Bd(e,t,r){let n=Ua(e),o=n.getBoundingClientRect(),i=mt(n,r.actionNameAttribute),s=Ta(e.composedPath(),r.actionNameAttribute);i&&ti(e.timeStamp,i);let{name:a,nameSource:u}=Ia(n,r,t);return{type:vt.CLICK,target:{width:Math.round(o.width),height:Math.round(o.height),selector:i,composedPathSelector:s||void 0},position:{x:Math.round(e.clientX-o.left),y:Math.round(e.clientY-o.top)},name:a,nameSource:u}}function Ua(e){if(e.composed&&$o(e.target)&&typeof e.composedPath=="function"){let t=e.composedPath();if(t.length>0&&t[0]instanceof Element)return t[0]}return e.target}function Va(e,t,r,n,o){let i=V(),s=Fe(o.timeStamp),a=t.start(i,s,n,{isChildEvent:kn});e.notify(15,a);let u=0,c,l=[],p=new y;function f(d){u===0&&(u=1,c=d?t.stop(i,Pr(d)):t.discard(i),p.notify())}return{event:o,stop:f,stopObservable:p,get hasError(){let d=c?.counts??t.getCounts(i);return d?d.errorCount>0:!1},get hasPageActivity(){return c&&"duration"in c},getUserActivity:r,addFrustration:d=>{l.push(d)},get startClocks(){return s},isStopped:()=>u===1||u===2,clone:()=>Va(e,t,r,n,o),validate:d=>{if(f(),u!==1||!c)return;let m=O(E({frustrationTypes:l,events:d??[o],event:o},c),{counts:c.counts});e.notify(0,m),u=2},discard:()=>{f(),u=2}}}function Hd(e,t){let{isRage:r}=Ma(e,t);r?(e.forEach(n=>n.discard()),t.stop(F()),t.validate(e.map(n=>n.event))):(t.discard(),e.forEach(n=>n.validate()))}function Fa(e,t){let r=Et(e);function n(s,a={},u=w()){let c=a.actionKey??s,l=r.start(c,u,E({name:s},a),{isChildEvent:kn});e.notify(15,l)}function o(s,a={},u=w()){let c=a.actionKey??s,l=r.stop(c,u,a);if(!l)return;let p=[];l.counts&&l.counts.errorCount>0&&p.push(at.ERROR_CLICK);let f=O(E({},l),{type:l.type||vt.CUSTOM,frustrationTypes:p});t(f)}function i(s){t(E({id:V(),frustrationTypes:[]},s))}return{addAction:i,startAction:n,stopAction:o,findActionId:r.findId,stop:r.stopAll}}var Gd=1;function Ha(e,t,r,n,o){let{unsubscribe:i}=e.subscribe(0,l=>{e.notify(12,Ba(l))}),s=M,a;o.trackUserInteractions&&(a=Pa(e,r,n,o));let u=Fa(e,l=>{e.notify(12,Ba(l))}),c={findActionId:l=>{let p=u.findActionId(l),f=a?.findActionId(l)??[];return p.concat(f)}};return t.register(0,({startTime:l,eventType:p})=>{if(p!==h.ERROR&&p!==h.RESOURCE&&p!==h.LONG_TASK)return $;let f=p===h.LONG_TASK?gt(l,Gd):l,d=c.findActionId(f);return d.length?{type:p,action:{id:d}}:$}),t.register(1,({startTime:l})=>({action:{id:c.findActionId(l)}})),{addAction:u.addAction,startAction:u.startAction,stopAction:u.stopAction,actionContexts:c,stop:()=>{i(),s(),u.stop(),a?.stop()}}}function Ba(e){let t=$d(e),r=An(I(e.duration));return{rawRumEvent:E({type:h.ACTION,date:e.startClocks.timeStamp,action:O(E(E({id:e.id,target:{name:e.name},type:e.type},r!==void 0&&{loading_time:r}),e.counts&&{error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}}),{frustration:{type:e.frustrationTypes}})},t?{_dd:{action:{target:{selector:e.target?.selector||void 0,width:e.target?.width||void 0,height:e.target?.height||void 0,composed_path_selector:e.target?.composedPathSelector},position:e.position,name_source:e.nameSource}}}:{context:e.context}),duration:e.duration,startClocks:e.startClocks,domainContext:t?{events:e.events}:{handlingStack:e.handlingStack}}}function $d(e){return"events"in e}function Ga(e,t){let r=Ao(e,[Rt.cspViolation,Rt.intervention]).subscribe(n=>t.notify(n));return{stop:()=>{r.unsubscribe()}}}function $a(e,t,r){let n=new y;return r.subscribe(({data:o,type:i})=>{i===0?n.notify(o):i===3&&o.api===ze.error&&n.notify(o.error)}),Ga(t,n),n.subscribe(o=>e.notify(14,{error:o})),Kd(e)}function Kd(e){return e.subscribe(14,({error:t})=>{e.notify(12,jd(t))}),{addError:({error:t,handlingStack:r,componentStack:n,startClocks:o,context:i})=>{let s=xt({originalError:t,handlingStack:r,componentStack:n,startClocks:o,nonErrorPrefix:"Provided",source:ye.CUSTOM,handling:"handled"});s.context=de(s.context,i),e.notify(14,{error:s})}}}
9function jd(e){let t={date:e.startClocks.timeStamp,error:{id:V(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:h.ERROR,context:e.context},r={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startClocks:e.startClocks,domainContext:r}}var qd=2*H;function ja(e){let t=Yd(e)||zd(e);if(!(!t||t.traceTime<=St()-qd))return t.traceId}function Yd(e){let t=e.querySelector("meta[name=dd-trace-id]"),r=e.querySelector("meta[name=dd-trace-time]");return qa(t&&t.content,r&&r.content)}function zd(e){let t=Wd(e);if(t)return qa(gr(t,"trace-id"),gr(t,"trace-time"))}function qa(e,t){let r=t&&Number(t);if(!(!e||!r))return{traceId:e,traceTime:r}}function Wd(e){for(let t=0;t<e.childNodes.length;t+=1){let r=Ka(e.childNodes[t]);if(r)return r}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){let r=e.body.childNodes[t],n=Ka(r);if(n)return n;if(!vr(r))break}}function Ka(e){if(e&&sa(e)){let t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function er(){if(be(U.NAVIGATION)){let r=performance.getEntriesByType(U.NAVIGATION)[0];if(r)return r}let e=Xd(),t=E({entryType:U.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>O(E({},t),{toJSON:void 0})},e);return t}function Xd(){let e={},t=performance.timing;for(let r in t)if(Xe(t[r])){let n=r,o=t[n];e[n]=o===0?0:jn(o)}return e}function Ln(e){return e.responseStart>=0&&e.responseStart<=Y()?e.responseStart:void 0}function Jd(){if(be(U.RESOURCE))return performance.getEntriesByType(U.RESOURCE)}function Ya(e,t){let r=Jd();if(r)return $r(r,n=>n.name===e&&n.startTime<=t)}var Qd=1e3;function za(e){let t=new Set,r=!1,n=e.subscribe(8,o=>{if(t.add(o),t.size>Qd){let i=t.values().next().value;if(!r){r=!0;let s;if(pe(re.TOO_MANY_REQUESTS_INVESTIGATION)){let a=0,u=0,c=0,l=0;for(let f of t)f.isAborted&&a++,f.isAbortedOnStart&&u++,f.type===st.XHR&&c++,performance.getEntriesByName(f.url,"resource").some(g=>g.startTime>=f.startClocks.relative)||l++;let p=F()-i.startClocks.timeStamp;s={abortedCount:a,abortedOnStartCount:u,xhrCount:c,fetchCount:t.size-c,oldestRequestAge:p,oldestRequestEndAge:p-i.duration,withoutMatchingEntryCount:l}}ne("Too many requests",s)}t.delete(i)}});return{getMatchingRequest(o){let i=1/0,s;for(let a of t){let u=o.startTime-a.startClocks.relative;0<=u&&u<i&&a.url===o.name&&(i=Math.abs(u),s=a)}return s&&t.delete(s),s},stop(){n.unsubscribe()}}}function Wa(e,t){function r(o,i={},s=w()){let a=i.resourceKey??o;t.start(a,s,E({url:o},i))}function n(o,i={},s=w()){let a=i.resourceKey??o,u=t.stop(a,s,{context:i.context,type:i.type});if(!u)return;let c=D(u.startClocks.relative,s.relative),l={date:u.startClocks.timeStamp,type:h.RESOURCE,resource:{id:u.id,type:u.type||ce.OTHER,url:Or(u.url),duration:I(c),method:u.method,status_code:i.statusCode,size:i.size},_dd:{},context:u.context};e.notify(12,{rawRumEvent:l,startClocks:u.startClocks,duration:c,domainContext:{isManual:!0}})}return{startResource:r,stopResource:n}}function Qa(e,t){let r=As(),n=za(e),o=me(t,{type:U.RESOURCE,buffered:!0}).subscribe(c=>{for(let l of c)s(()=>Xa(l,n,t))}),{stop:i}=Yt(t,"interactive",()=>{s(()=>Xa(er(),n,t))});function s(c){r.push(()=>{let l=c();l&&e.notify(12,l)})}let a=Et(e),u=Wa(e,a);return{startResource:u.startResource,stopResource:u.stopResource,stop:()=>{i(),r.stop(),o.unsubscribe(),a.stopAll()}}}function Xa(e,t,r){let n=Ys(e)?t.getMatchingRequest(e):void 0,o=n?rf(n,r):nf(e,r);if(!r.trackResources&&!o)return;let i=Fe(e.startTime),s=zs(e),a=sf(n,r),u=de({date:i.timeStamp,resource:E(E({id:V(),duration:I(s),type:qs(e),method:n?.method,status_code:n?n.status:of(e.responseStatus),url:n?Or(n.url):e.name,protocol:Js(e),delivery_type:Qs(e),graphql:n&&Zd(n,r),render_blocking_status:e.renderBlockingStatus},Zs(e)),Ws(e)),type:h.RESOURCE,_dd:{discarded:!r.trackResources}},o,ef(e),a);return{startClocks:i,duration:s,rawRumEvent:u,domainContext:tf(e,n)}}function Zd(e,t){let r=hn(e.url,t);if(r)return oa(e,r)}function ef(e){let t=e.contentType;if(t)return{resource:{response:{headers:{"content-type":t}}}}}function tf(e,t){return{performanceEntry:e,isManual:!1,isAborted:t?t.isAborted:!1,handlingStack:t?.handlingStack,requestInit:t?.init,requestInput:t?.input,response:t?.response,error:t?.error,xhr:t?.xhr}}function rf(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function nf(e,t){if(e.initiatorType!=="navigation")return;let r=ja(document);if(r)return{_dd:{trace_id:r,span_id:xn().toString(),rule_psr:t.rulePsr}}}function of(e){return e===0?void 0:e}function sf(e,t){let r=t.trackResourceHeaders;if(r.length===0||!e)return;let n=r.filter(u=>
9u.url!==void 0?Pe([u.url],e.url,!0):!0);if(n.length===0)return;let o=n.filter(u=>u.location===void 0||u.location==="any"||u.location==="response"),i=n.filter(u=>u.location===void 0||u.location==="any"||u.location==="request"),s=o.length>0?af(e,o):void 0,a=i.length>0?cf(e,i):void 0;if(!(!s&&!a))return{resource:{request:a?{headers:a}:void 0,response:s?{headers:s}:void 0}}}function af(e,t){if(e.type===st.FETCH&&e.response)return ri(e.response.headers,t);if(e.type===st.XHR&&e.xhr){let r=e.xhr.getAllResponseHeaders();if(r)try{return ri(new Headers(lf(r)),t)}catch(n){}}}function cf(e,t){if(e.type!==st.FETCH)return;let r;return e.init?.headers?r=new Headers(e.init.headers):e.input instanceof Request&&(r=e.input.headers),r?ri(r,t):void 0}var uf=/(token|cookie|secret|authorization|(api|secret|access|app).?key|(client|connecting|real).?ip|forwarded)/,Ja=100,Mn=128;function ri(e,t){let r={},n=0,o=0,i=!1;return e.forEach((s,a)=>{if(o++,n>=Ja){i||(b.warn(`Maximum number of headers (${Ja}) has been reached. Further headers are dropped.`),i=!0);return}let u=a.toLowerCase();if(uf.test(u))return;let c=t.find(f=>Pe([f.name],u));if(!c)return;let{extractor:l}=c,p=l?yn(s,l):s;p!==void 0&&(p.length>Mn&&(b.warn(`Header "${u}" value was truncated from ${p.length} to ${Mn} characters.`),ne("Resource header value was truncated",{header_name:u,original_length:p.length,limit:Mn})),r[u]=Ke(p,Mn),n++)}),i&&ne("Maximum number of resource headers reached",{collectedHeaderCount:n,totalHeaderCount:o}),n>0?r:void 0}function lf(e){let t=[],r=e.trim().split(/\r\n/);for(let n of r){let o=n.indexOf(":");o>0&&t.push([n.substring(0,o).trim(),n.substring(o+1).trim()])}return t}function Za(e,t,r){let{stop:n,eventCounts:o}=wn({lifeCycle:e,isChildEvent:i=>i.view.id===t,onChange:r});return{stop:n,eventCounts:o}}var pf=10*H;function ec(e,t,r){return{stop:me(e,{type:U.PAINT,buffered:!0}).subscribe(o=>{let i=o.find(s=>s.name==="first-contentful-paint"&&s.startTime<t.timeStamp&&s.startTime<pf);i&&r(i.startTime)}).unsubscribe}}function tc(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(D(e,Y()))})})}function rc(e,t){return mf(e,()=>{let r=er();ff(r)||t(df(r))})}function df(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:Ln(e)}}function ff(e){return e.loadEventEnd<=0}function mf(e,t){let r,{stop:n}=Yt(e,"complete",()=>{r=G(()=>t())});return{stop:()=>{n(),q(r)}}}var Ef=10*H;function nc(e,t,r,n){let o=1/0,{stop:i}=Le(e,r,["pointerdown","keydown"],u=>{o=u.timeStamp},{capture:!0,once:!0}),s=0,a=me(e,{type:U.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(u=>{let c=$r(u,l=>l.entryType===U.LARGEST_CONTENTFUL_PAINT&&l.startTime<o&&l.startTime<t.timeStamp&&l.startTime<Ef&&l.size>s);if(c){let l;c.element&&(l=mt(c.element,e.actionNameAttribute));let p=gf(c),f=c.startTime,d=Sf(p,f);n({value:f,targetSelector:l,resourceUrl:p,subParts:d}),s=c.size}});return{stop:()=>{i(),a.unsubscribe()}}}function gf(e){return e.url===""?void 0:e.url}function Sf(e,t){let r=Ln(er());if(r===void 0)return;let n=e?Ya(e,t):void 0,o=n?Math.max(r,n.requestStart||n.startTime):r,i=Math.min(t,Math.max(o,n?.responseEnd||0));return{loadDelay:o-r,loadTime:i-o,renderDelay:t-i}}function Dn(e,t,r=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:M};if(be(U.VISIBILITY_STATE)){let i=performance.getEntriesByType(U.VISIBILITY_STATE).filter(s=>s.name==="hidden").find(s=>s.startTime>=t.relative);if(i)return{timeStamp:i.startTime,stop:M}}let n=1/0,{stop:o}=Le(e,r,["pagehide","visibilitychange"],i=>{(i.type==="pagehide"||document.visibilityState==="hidden")&&(n=i.timeStamp,o())},{capture:!0});return{get timeStamp(){return n},stop:o}}function oc(e,t,r,n){let o={},{stop:i}=rc(e,l=>{r(l.loadEvent),o.navigationTimings=l,n()}),s=Dn(e,t),{stop:a}=ec(e,s,l=>{o.firstContentfulPaint=l,n()}),{stop:u}=nc(e,s,window,l=>{o.largestContentfulPaint=l,n()});function c(){i(),a(),u(),s.stop()}return{stop:c,initialViewMetrics:o}}var ni=(e,t)=>e*t,bf=(e,t)=>{let r=Math.max(e.left,t.left),n=Math.max(e.top,t.top),o=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom);return r>=o||n>=i?0:ni(o-r,i-n)},oi=e=>{let t=ni(e.previousRect.width,e.previousRect.height),r=ni(e.currentRect.width,e.currentRect.height),n=bf(e.previousRect,e.currentRect);return t+r-n};function sc(e,t,r){if(!_f())return{stop:M};let n=0,o;r({value:0});let i=hf(),s=me(e,{type:U.LAYOUT_SHIFT,buffered:!0}).subscribe(a=>{for(let u of a){if(u.hadRecentInput||u.startTime<t)continue;let{cumulatedValue:c,isMaxValue:l}=i.update(u);if(l){let p=yf(u.sources);o={target:p?.node?new WeakRef(p.node):void 0,time:D(t,u.startTime),previousRect:p?.previousRect,currentRect:p?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(c>n){n=c;let p=o?.target?.deref();r({value:We(n,4),targetSelector:p&&mt(p,e.actionNameAttribute),time:o?.time,previousRect:o?.previousRect?ic(o.previousRect):void 0,currentRect:o?.currentRect?ic(o.currentRect):void 0,devicePixelRatio:o?.devicePixelRatio})}}});return{stop:()=>{s.unsubscribe()}}}function yf(e){let t;for(let r of e)if(r.node&&he(r.node)){let n=oi(r);(!t||oi(t)<n)&&(t=r)}return t}function ic({x:e,y:t,width:r,height:n}){return{x:e,y:t,width:r,height:n}}var Tf=5*B,xf=B;function hf(){let e=0,t,r,n=0;return{update:o=>{let i=t===void 0||o.startTime-r>=xf||o.startTime-t>=Tf,s;return i?(t=r=o.startTime,n=e=o.value,s=!0):(e+=o.value,r=o.startTime,s=o.value>n,s&&(n=o.value)),{cumulatedValue:e,isMaxValue:s}}}}function _f(){return be(U.LAYOUT_SHIFT)&&"WeakRef"in window}var Pn,ac=0,ii=1/0,si=0;function cc(){"interactionCount"in performance||Pn||(Pn=new window.PerformanceObserver(_(e=>
9{e.getEntries().forEach(t=>{let r=t;r.interactionId&&(ii=Math.min(ii,r.interactionId),si=Math.max(si,r.interactionId),ac=(si-ii)/7+1)})})),Pn.observe({type:"event",buffered:!0,durationThreshold:0}))}var ai=()=>Pn?ac:window.performance.interactionCount||0;var uc=10,Af=1*H,If=8;function pc(e,t,r){if(!vf())return{getInteractionToNextPaint:()=>{},setViewEnd:M,stop:M};let n=1/0,o,{getViewInteractionCount:i,stopViewInteractionCount:s}=Rf(r),a=Cf(i),u=Of(a),c=me(e,{type:U.FIRST_INPUT,buffered:!0}).subscribe(p),l=me(e,{type:U.EVENT,durationThreshold:40,buffered:!0}).subscribe(p);function p(d){for(let g of d)g.interactionId&&g.startTime>=t&&g.startTime<=n&&(a.process(g),u.process(g));u.pruneUntracked();let m=a.estimateP98Interaction();m&&f(m)}function f(d){let m=D(t,d.startTime);if(!o||d.duration!==o.duration||m!==o.startTime){let g=Da(d.startTime);!g&&d.target&&he(d.target)&&(g=mt(d.target,e.actionNameAttribute)),o={duration:d.duration,startTime:m,targetSelector:g}}o.subParts=u.computeSubParts(d,lc(o.duration))}return{getInteractionToNextPaint:()=>{if(o)return{value:lc(o.duration),targetSelector:o.targetSelector,time:o.startTime,subParts:o.subParts};if(i())return{value:0}}
9,setViewEnd:d=>{n=d,s()},stop:()=>{l.unsubscribe(),c.unsubscribe(),u.stop()}}}function Cf(e){let t=[];function r(){t.sort((n,o)=>o.duration-n.duration).splice(uc)}return{process(n){let o=t.findIndex(s=>n.interactionId===s.interactionId),i=t[t.length-1];o!==-1?n.duration>t[o].duration&&(t[o]=n,r()):(t.length<uc||n.duration>i.duration)&&(t.push(n),r())},estimateP98Interaction(){let n=Math.min(t.length-1,Math.floor(e()/50));return t[n]},isTracked(n){return t.some(o=>o.interactionId===n)}}}function Rf(e){cc();let t=e===ve.INITIAL_LOAD?0:ai(),r={stopped:!1};function n(){return ai()-t}return{getViewInteractionCount:()=>r.stopped?r.interactionCount:n(),stopViewInteractionCount:()=>{r={stopped:!0,interactionCount:n()}}}}function Of(e){let t=new Map;function r(n,o){n.startTime=Math.min(o.startTime,n.startTime),n.processingStart=Math.min(o.processingStart,n.processingStart),n.processingEnd=Math.max(o.processingEnd,n.processingEnd)}return{process(n){if(n.interactionId===void 0||!n.processingStart||!n.processingEnd)return;let o=n.startTime+n.duration,i=t.get(n.interactionId);if(i){r(i,n);return}for(let[,s]of t.entries())if(Math.abs(o-s.referenceRenderTime)<=If){r(s,n),t.set(n.interactionId,s);return}t.set(n.interactionId,{startTime:n.startTime,processingStart:n.processingStart,processingEnd:n.processingEnd,referenceRenderTime:o})},pruneUntracked(){for(let[n]of t)e.isTracked(n)||t.delete(n)},computeSubParts(n,o){if(!n.processingStart||!n.processingEnd||n.interactionId===void 0)return;let i=t.get(n.interactionId);if(!i)return;let s=Math.max(i.startTime+o,i.processingStart),a=Math.min(i.processingEnd,s);return{inputDelay:D(i.startTime,i.processingStart),processingDuration:D(i.processingStart,a),presentationDelay:D(a,s)}},stop(){t.clear()}}}function vf(){return be(U.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function lc(e){return Math.min(e,Af)}function dc(e,t,r,n,o,i,s){let a=o===ve.INITIAL_LOAD,u=!0,c=[],l=Dn(n,i);function p(){if(!u&&!a&&c.length>0){let d=Math.max(...c);d<l.timeStamp-i.relative&&s(d)}}let{stop:f}=wr(e,t,r,n,d=>{u&&(u=!1,d.hadActivity&&c.push(D(i.timeStamp,d.end)),p())});return{stop:()=>{f(),l.stop()},setLoadEvent:d=>{a&&(a=!1,c.push(d),p())}}}function wf(){let e,t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function ci(){let e,t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}var ui;function li(e){return ui||(ui=Nf(e)),ui}function Nf(e){return new y(t=>{let{throttled:r}=ut(()=>{t.notify(tr())},200);return P(e,window,"resize",r,{capture:!0,passive:!0}).stop})}function tr(){let e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}var kf=B;function fc(e,t,r,n=Mf(e)){let o=0,i=0,s=0,a=n.subscribe(({scrollDepth:u,scrollTop:c,scrollHeight:l})=>{let p=!1;if(u>o&&(o=u,p=!0),l>i){i=l;let f=Y();s=D(t.relative,f),p=!0}p&&r({maxDepth:Math.min(o,i),maxDepthScrollTop:c,maxScrollHeight:i,maxScrollHeightTime:s})});return{stop:()=>a.unsubscribe()}}function Lf(){let e=ci(),{height:t}=tr(),r=Math.round((document.scrollingElement||document.documentElement).scrollHeight),n=Math.round(t+e);return{scrollHeight:r,scrollDepth:n,scrollTop:e}}function Mf(e,t=kf){return new y(r=>{function n(){r.notify(Lf())}let o=ut(n,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,s=new ResizeObserver(_(o.throttled));i&&s.observe(i);let a=P(e,window,"scroll",o.throttled,{passive:!0});return()=>{o.cancel(),s.disconnect(),a.stop()}})}function mc(e,t,r,n,o,i,s){let a={},u=!1,c=!1,{stop:l,setLoadEvent:p}=dc(e,t,r,n,i,s,A=>{u||(a.loadingTime=A,o())}),{stop:f}=fc(n,s,A=>{a.scroll=A}),{stop:d}=sc(n,s.relative,A=>{a.cumulativeLayoutShift=A,o()}),{stop:m,getInteractionToNextPaint:g,setViewEnd:x}=pc(n,s.relative,i);return{stop:()=>{l(),d(),f()}
9,stopINPTracking:m,setLoadEvent:p,setViewEnd:A=>{c=!0,x(A)},getCommonViewMetrics:()=>(a.interactionToNextPaint=g(),a),setLoadingTime:A=>{if(c)return;let k=D(s.timeStamp,A??F());u||l(),u=!0,a.loadingTime=k,o()}}}function Ec(e,t){let{stop:r}=P(e,window,"pageshow",n=>{n.persisted&&t(n)},{capture:!0});return r}function gc(e,t,r){tc(e.relative,n=>{t.firstContentfulPaint=n,t.largestContentfulPaint={value:n},r()})}var Df=3e3,Pf=5*H,Uf=5*H;function bc(e,t,r,n,o,i,s){let a=new Set,u=p(ve.INITIAL_LOAD,Ur(),s),c;f();let l;i&&(l=d(o),c=Ec(n,m=>{u.end();let g=Fe(m.timeStamp);u=p(ve.BF_CACHE,g,void 0)}));function p(m,g,x){let A=Vf(e,t,r,n,m,g,x);return a.add(A),A.stopObservable.subscribe(()=>{a.delete(A)}),A}function f(){e.subscribe(10,m=>{let g=u.contextManager.getContext();m&&(g.is_session_renewal=!0,g.renew_event=m),u=p(ve.SESSION_RENEWAL,void 0,{name:u.name,service:u.service,version:u.version,context:g})}),e.subscribe(9,()=>{u.end({sessionIsActive:!1})})}function d(m){return m.subscribe(({oldLocation:g,newLocation:x})=>{Bf(g,x)&&(u.end(),u=p(ve.ROUTE_CHANGE))})}return{addTiming:(m,g=F())=>{u.addTiming(m,g)},setLoadingTime:m=>u.setLoadingTime(m),startView:(m,g)=>{u.end({endClocks:g}),u=p(ve.ROUTE_CHANGE,g,m)},setViewContext:m=>{u.contextManager.setContext(m)},setViewContextProperty:(m,g)=>{u.contextManager.setContextProperty(m,g)},setViewName:m=>{u.setViewName(m)},getViewContext:()=>u.contextManager.getContext(),stop:()=>{l&&l.unsubscribe(),c&&c(),u.end(),a.forEach(m=>m.stop())}}}function Vf(e,t,r,n,o,i=w(),s){let a=V(),u=new y,c={},l=0,p,f=Ze(window.location),d=it(),m=!0,g=s?.name,x=s?.service||n.service,A=s?.version||n.version,k=s?.context,Q=s?.handlingStack;k&&d.setContext(k);let Z={id:a,name:g,startClocks:i,service:x,version:A,context:k,url:s?.url};e.notify(1,Z),e.notify(2,Z);let{throttled:we,cancel:v}=ut(ct,Df,{leading:!1}),{setLoadEvent:S,setViewEnd:T,stop:C,stopINPTracking:N,getCommonViewMetrics:Ne,setLoadingTime:Ue}=mc(e,t,r,n,ke,o,i),{stop:Vn,initialViewMetrics:Lr}=o===ve.INITIAL_LOAD?oc(n,i,S,ke):{stop:M,initialViewMetrics:{}};o===ve.BF_CACHE&&gc(i,Lr,ke);let{stop:Fn,eventCounts:Bn}=Za(e,a,ke),sr=Ae(ct,Pf),Hn=e.subscribe(11,_e=>{_e.reason===bt.UNLOADING&&ct()});ct(),d.changeObservable.subscribe(ke);function Mr(){e.notify(3,{id:a,name:g,context:d.getContext(),startClocks:i,sessionIsActive:m})}function ke(){Mr(),we()}function ct(){v(),Mr(),l+=1;let _e=p===void 0?F():p.timeStamp;e.notify(4,{customTimings:c,documentVersion:l,id:a,name:g,service:x,version:A,context:d.getContext(),loadingType:o,location:f,handlingStack:Q,startClocks:i,commonViewMetrics:Ne(),initialViewMetrics:Lr,duration:D(i.timeStamp,_e),isActive:p===void 0,sessionIsActive:m,eventCounts:Bn})}return{get name(){return g},service:x,version:A,contextManager:d,stopObservable:u,end(_e={}){p||(p=_e.endClocks??w(),m=_e.sessionIsActive??!0,e.notify(5,{endClocks:p}),e.notify(6,{endClocks:p}),Be(sr),T(p.relative),C(),Hn.unsubscribe(),ct(),G(()=>{this.stop()},Uf))},stop(){Vn(),Fn(),N(),u.notify()},addTiming(_e,Gn){if(p)return;let Xc=Si(Gn)?Gn:D(i.timeStamp,Gn);c[Ff(_e)]=Xc,ke()},setLoadingTime:Ue,setViewName(_e){g=_e,ct()}}}function Ff(e){let t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&b.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function Bf(e,t){return e.pathname!==t.pathname||!Hf(t.hash)&&Sc(t.hash)!==Sc(e.hash)}function Hf(e){let t=e.substring(1);return t!==""&&!!document.getElementById(t)}function Sc(e){let t=e.indexOf("?");return t<0?e:e.slice(0,t)}function yc(e,t,r,n,o,i,s,a,u){return e.subscribe(4,c=>e.notify(12,Gf(c,r,s))),t.register(0,({startTime:c,eventType:l})=>{let p=a.findView(c);return p?{type:l,service:p.service,version:p.version,context:p.context,view:{id:p.id,name:p.name}}:Se}),t.register(1,({startTime:c})=>({view:{id:a.findView(c)?.id}})),bc(e,n,o,r,i,!r.trackViewsManually,u)}function Gf(e,t,r){let n=r.getReplayStats(e.id),o=e.commonViewMetrics?.cumulativeLayoutShift?.devicePixelRatio,i={_dd:{document_version:e.documentVersion,replay_stats:n,cls:o?{device_pixel_ratio:o}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:h.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:e.commonViewMetrics.cumulativeLayoutShift?.value,cumulative_layout_shift_time:I(e.commonViewMetrics.cumulativeLayoutShift?.time),cumulative_layout_shift_target_selector:e.commonViewMetrics.cumulativeLayoutShift?.targetSelector,first_byte:I(e.initialViewMetrics.navigationTimings?.firstByte),dom_complete:I(e.initialViewMetrics.navigationTimings?.domComplete),dom_content_loaded:I(e.initialViewMetrics.navigationTimings?.domContentLoaded),dom_interactive:I(e.initialViewMetrics.navigationTimings?.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:I(e.initialViewMetrics.firstContentfulPaint),interaction_to_next_paint:I(e.commonViewMetrics.interactionToNextPaint?.value),interaction_to_next_paint_time:I(e.commonViewMetrics.interactionToNextPaint?.time),interaction_to_next_paint_target_selector:e.commonViewMetrics.interactionToNextPaint?.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:I(e.initialViewMetrics.largestContentfulPaint?.value),largest_contentful_paint_target_selector:e.initialViewMetrics.largestContentfulPaint?.targetSelector,load_event:I(e.initialViewMetrics.navigationTimings?.loadEvent),loading_time:An(I(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:$f(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:I(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:I(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:ws()}};return te(e.customTimings)||(i.view.custom_timings=Yr(e.customTimings,I)),{rawRumEvent:i,startClocks:e.startClocks,duration:e.duration,domainContext:{location:e.location,handlingStack:e.handlingStack}}}function $f({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:r,largestContentfulPaint:n}){return{cls:e&&{score:e.value,timestamp:I(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:r&&{timestamp:I(r)},inp:t&&{duration:I(t.value),timestamp:I(t.time),target_selector:t.targetSelector,sub_parts:t.subParts?{input_delay:I(t.subParts.inputDelay),processing_duration:I(t.subParts.processingDuration),presentation_delay:I(t.subParts.presentationDelay)}:void 0},lcp:n&&{timestamp:I(n.value),target_selector:n.targetSelector,resource_url:n.resourceUrl,sub_parts:n.subParts?{load_delay:I(n.subParts.loadDelay),load_time:I(n.subParts.loadTime),render_delay:I(n.subParts.renderDelay)}:void 0}}}function Tc(e,t,r,n,o,i){let s=[e.rumEndpointBuilder];e.replica&&s.push(e.replica.rumEndpointBuilder);let a=Dt({encoder:i(2),request:lt(s,r),flushController:Pt({pageMayExitObservable:n,sessionExpireOb
9servable:o})});return t.subscribe(13,u=>{u.type===h.VIEW?a.upsert(u,u.view.id):a.add(u)}),a}function xc(e){let t=Ie();e.subscribe(13,r=>{t.send("rum",r)})}var Kf=fe;function hc(e,t,r){let n=xe({expireDelay:Kf}),o;e.subscribe(1,({startClocks:a,url:u})=>{let c=location.href,l=u!==void 0?tt(u,c).href:c;n.add(s({url:l,referrer:o||document.referrer}),a.relative),o=l}),e.subscribe(6,({endClocks:a})=>{n.closeActive(a.relative)});let i=r.subscribe(({newLocation:a})=>{let u=n.find();if(u){let c=Y();n.closeActive(c),n.add(s({url:a.href,referrer:u.referrer}),c)}});function s({url:a,referrer:u}){return{url:a,referrer:u}}return t.register(0,({startTime:a,eventType:u})=>{let c=n.find(a);return c?{type:u,view:{url:c.url,referrer:c.referrer}}:Se}),{findUrl:a=>n.find(a),stop:()=>{i.unsubscribe(),n.stop()}}}function Ac(e){let t=Ze(location);return new y(r=>{let{stop:n}=jf(e,i),{stop:o}=qf(e,i);function i(){if(t.href===location.href)return;let s=Ze(location);r.notify({newLocation:s,oldLocation:t}),t=s}return()=>{n(),o()}})}function jf(e,t){let{stop:r}=ae(_c("pushState"),"pushState",({onPostCall:i})=>{i(t)}),{stop:n}=ae(_c("replaceState"),"replaceState",({onPostCall:i})=>{i(t)}),{stop:o}=P(e,window,"popstate",t);return{stop:()=>{r(),n(),o()}}}function qf(e,t){return P(e,window,"hashchange",t)}function _c(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}var Yf=fe;function Ic(e,t,r){let n=xe({expireDelay:Yf});return e.subscribe(1,({startClocks:o})=>{n.add({},o.relative)}),e.subscribe(6,({endClocks:o})=>{n.closeActive(o.relative)}),t.register(0,({startTime:o,eventType:i})=>{if(!r.trackFeatureFlagsForEvents.concat([h.VIEW,h.ERROR]).includes(i))return $;let a=n.find(o);return!a||te(a)?$:{type:i,feature_flags:a}}),{addFeatureFlagEvaluation:(o,i)=>{let s=n.find();s&&(s[o]=i)}}}var zf=10*B,rr,Un;function Oc(e,t,r){e.metricsEnabled&&(vc(),Un=!1,t.subscribe(13,()=>{Un=!0}),r.subscribe(({bytesCount:n,messagesCount:o})=>{Un&&(Un=!1,rr.batchCount+=1,Rc(rr.batchBytesCount,n),Rc(rr.batchMessagesCount,o))}),Ae(Wf,zf))}function Wf(){rr.batchCount!==0&&($e("Customer data measures",rr),vc())}function Cc(){return{min:1/0,max:0,sum:0}}function Rc(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function vc(){rr={batchCount:0,batchBytesCount:Cc(),batchMessagesCount:Cc()}}var Xf=4e3,Jf=500,Qf=fe;function wc(e,t,r=Jf){let n=xe({expireDelay:Qf,maxEntries:Xf}),o;be(U.VISIBILITY_STATE)&&performance.getEntriesByType(U.VISIBILITY_STATE).forEach(c=>{let l=c.name==="hidden"?"hidden":"active";s(l,c.startTime)}),s(Nc(),Y());let{stop:i}=Le(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],u=>{s(em(u),u.timeStamp)},{capture:!0});function s(u,c=Y()){u!==o&&(o=u,n.closeActive(c),n.add({state:o,startTime:c},c))}function a(u,c,l){return n.findAll(c,l).some(p=>p.state===u)}return e.register(0,({startTime:u,duration:c=0,eventType:l})=>{if(l===h.VIEW){let p=n.findAll(u,c);return{type:l,_dd:{page_states:Zf(p,u,r)}}}return l===h.ACTION||l===h.ERROR?{type:l,view:{in_foreground:a("active",u,0)}}:$}),{wasInPageStateDuringPeriod:a,addPageState:s,stop:()=>{i(),n.stop()}}}function Zf(e,t,r){if(e.length!==0)return e.slice(-r).reverse().map(({state:n,startTime:o})=>({state:n,start:I(D(t,o))}))}function em(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":Nc()}function Nc(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function kc(e,t){let r,n=requestAnimationFrame(_(()=>{r=tr()})),o=li(t).subscribe(i=>{r=i}).unsubscribe;return e.register(0,({eventType:i})=>({type:i,display:r?{viewport:r}:void 0})),{stop:()=>{o(),n&&cancelAnimationFrame(n)}}}function Mc(e,t){let r=Et(e);function n(u){return!t.wasInPageStateDuringPeriod("frozen",u.startClocks.relative,u.duration)}function o(u){n(u)&&e.notify(12,Lc(u))}function i(u,c,l,p){if(!pe(re.FEATURE_OPERATION_VITAL))return;let{operationKey:f,context:d,description:m,handlingStack:g}=l||{},x={name:u,type:ft.OPERATION_STEP,operationKey:f,failureReason:p,stepType:c,startClocks:w(),context:R(d),description:m,handlingStack:g};e.notify(12,Lc(x))}function s(u,c={},l=w()){let{id:p}=r.start(c.vitalKey??u,l,E({name:u},c));e.notify(16,E({id:p,name:u,startClocks:l},c))}function a(u,c={},l=w()){let p=r.stop(c.vitalKey??u,l,c);p&&o(E({type:ft.DURATION},p))}return{addOperationStepVital:i,addDurationVital:o,startDurationVital:s,stopDurationVital:a}}function Lc(e){let{startClocks:t,type:r,name:n,description:o,context:i,handlingStack:s}=e,a=e.type===ft.DURATION?e.id:void 0,u=E({id:a??V(),type:r,name:n,description:o},r===ft.DURATION?{duration:I(e.duration)}:{step_type:e.stepType,operation_key:e.operationKey,failure_reason:e.failureReason});return{rawRumEvent:{date:t.timeStamp,vital:u,type:h.VITAL,context:i},startClocks:t,duration:r===ft.DURATION?e.duration:void 0,domainContext:s?{handlingStack:s}:{}}}function Dc(e,t){let r=window.cookieStore?tm(e):nm;return new y(n=>r(t,o=>n.notify(o)))}function tm(e){return(t,r)=>P(e,window.cookieStore,"change",o=>{let i=o.changed.find(s=>s.name===t)||o.deleted.find(s=>s.name===t);i&&r(i.value)}).stop}var rm=B;function nm(e,t){let r=pt(e),n=Ae(()=>{let o=pt(e);o!==r&&(r=o,t(o))},rm);return()=>{Be(n)}}var Pc="datadog-ci-visibility-test-execution-id";function Uc(e,t,r=Dc(e,Pc)){let n=dt(Pc)||om(),o=r.subscribe(i=>{n=i}
9);return t.register(0,({eventType:i})=>typeof n!="string"?$:{type:i,session:{type:"ci_test"},ci_test:{test_execution_id:n}}),{stop:()=>{o.unsubscribe()}}}function om(){let e=window.Cypress;if(e)try{return e.env("traceId")}catch(t){b.warn("Failed to read Cypress test execution id via Cypress.env(). Upgrade dd-trace-js to >= 5.88.0 to keep RUM \u2194 test correlation working.");return}}function Vc(e,t){let r=be(U.LONG_ANIMATION_FRAME)?U.LONG_ANIMATION_FRAME:U.LONG_TASK,n=me(t,{type:r,buffered:!0}).subscribe(o=>{for(let i of o){if(!t.trackLongTasks)break;let s=Fe(i.startTime),a=im(i,s);e.notify(12,{rawRumEvent:a,startClocks:s,duration:i.duration,domainContext:{performanceEntry:i}})}});return{stop:()=>n.unsubscribe()}}function im(e,t){let r=V(),n=I(e.duration),o={date:t.timeStamp,type:h.LONG_TASK,_dd:{discarded:!1}};return e.entryType===U.LONG_TASK?O(E({},o),{long_task:{id:r,entry_type:Sn.LONG_TASK,duration:n}}):O(E({},o),{long_task:{id:r,entry_type:Sn.LONG_ANIMATION_FRAME,duration:n,blocking_duration:I(e.blockingDuration),first_ui_event_timestamp:I(e.firstUIEventTimestamp),render_start:I(e.renderStart),style_and_layout_start:I(e.styleAndLayoutStart),start_time:I(e.startTime),scripts:e.scripts.map(i=>({duration:I(i.duration),pause_duration:I(i.pauseDuration),forced_style_and_layout_duration:I(i.forcedStyleAndLayoutDuration),start_time:I(i.startTime),execution_start:I(i.executionStart),source_url:i.sourceURL,source_function_name:i.sourceFunctionName,source_char_position:i.sourceCharPosition,invoker:i.invoker,invoker_type:i.invokerType,window_attribution:i.windowAttribution}))}})}function Fc(e){e.register(0,({eventType:t})=>Vo()?{type:t,session:{type:"synthetics"},synthetics:O(E({},gn()),{injected:Rr()})}:$)}function Hc(e,t,r){let n=Ht(e),o=r(n);return He(t).forEach(([i,s])=>pi(e,n,i.split(/\.|(?=\[\])/),s)),o}function pi(e,t,r,n){let[o,...i]=r;if(o==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((s,a)=>pi(s,t[a],i,n));return}if(!(!Bc(e)||!Bc(t))){if(i.length>0)return pi(e[o],t[o],i,n);sm(e,o,t[o],n)}}function sm(e,t,r,n){if(e[t]===r)return;let o=Ge(r);o===n?e[t]=R(r):n==="object"&&(o==="undefined"||o==="null")&&(e[t]={})}function Bc(e){return Ge(e)==="object"}var nr={"view.name":"string","view.url":"string","view.referrer":"string"},or={context:"object"},ir={service:"string",version:"string"},Gc;function $c(e,t,r,n,o){Gc={[h.VIEW]:E(E(E({"view.performance.lcp.resource_url":"string"},or),nr),ir),[h.ERROR]:E(E(E({"error.message":"string","error.stack":"string","error.handling_stack":"string","error.resource.url":"string","error.fingerprint":"string"},or),nr),ir),[h.RESOURCE]:E(E(E({"resource.url":"string","resource.graphql.variables":"string","resource.request.headers":"object","resource.response.headers":"object"},or),nr),ir),[h.ACTION]:E(E(E({"action.target.name":"string"},or),nr),ir),[h.LONG_TASK]:E(E(E({"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string"},or),nr),ir),[h.VITAL]:E(E(E({},or),nr),ir)};let i={[h.ERROR]:pn(h.ERROR,n,o),[h.ACTION]:pn(h.ACTION,n,o),[h.VITAL]:pn(h.VITAL,n,o)};t.subscribe(12,({startClocks:s,duration:a,rawRumEvent:u,domainContext:c})=>{let l=r.triggerHook(0,{eventType:u.type,rawRumEvent:u,domainContext:c,startTime:s.relative,duration:a});if(l===Se)return;let p=de(l,u,{ddtags:zr(e).join(",")});am(p,e.beforeSend,c,i)&&(te(p.context)&&delete p.context,t.notify(13,p))})}function am(e,t,r,n){if(t){let i=Hc(e,Gc[e.type],s=>t(s,r));if(i===!1&&e.type!==h.VIEW)return!1;i===!1&&b.warn("Can't dismiss view events using beforeSend!")}return!n[e.type]?.isLimitReached()}function di(e,t){return le()?Gr("records")?1:0:Ot(e.id,hr(t.sessionSampleRate,t.sessionReplaySampleRate))?1:e.isReplayForced?2:0}function Kc(e,t,r,n,o){e.register(0,({eventType:i,startTime:s})=>{let a=r.findTrackedSession(s),u=o.findView(s);if(!a||!u)return Se;let c,l,p;return i===h.VIEW?(c=n.getReplayStats(u.id)?!0:void 0,l=di(a,t)===1,p=u.sessionIsActive?void 0:!1):c=n.isRecording()?!0:void 0,{type:i,session:{id:a.id,type:"user",has_replay:c,sampled_for_replay:l,is_active:p}}})}function jc(e){e.register(0,({eventType:t})=>({type:t,connectivity:Jr()}))}function qc(e,t,r){e.register(0,({eventType:n})=>{let o=t.source;return{type:n,_dd:{format_version:2,drift:gi(),configuration:{session_sample_rate:We(t.sessionSampleRate,3),session_replay_sample_rate:We(t.sessionReplaySampleRate,3),profiling_sample_rate:We(t.profilingSampleRate,3),trace_sample_rate:We(t.traceSampleRate,3)},browser_sdk_version:le()?"7.1.0":void 0,sdk_name:r},application:{id:t.applicationId},date:F(),source:o}})}var cm=[h.ACTION,h.ERROR,h.LONG_TASK,h.RESOURCE,h.VITAL];function Yc(e){return{addEvent:(t,r,n,o)=>{cm.includes(r.type)&&e.notify(12,{startClocks:Fe(t),rawRumEvent:r,domainContext:n,duration:o})}}}function zc(e,t){if(!t.metricsEnabled)return{stop:M};let{unsubscribe:r}=e.subscribe(4,({initialViewMetrics:n})=>{!n.largestContentfulPaint||!n.navigationTimings||($e("Initial view metrics",{metrics:um(n.largestContentfulPaint,n.navigationTimings)}),r())});return{stop:r}}function um(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function Wc(e){let t=window,r=new Map;function n(){t.DD_SOURCE_CODE_CONTEXT&&(He(t.DD_SOURCE_CODE_CONTEXT).forEach(([o,i])=>{let a=Re({stack:o}).stack[0];
9if(!a.url){Er("Source code context: missing frame url",{stack:o});return}r.has(a.url)||r.set(a.url,i)}),t.DD_SOURCE_CODE_CONTEXT={})}n(),e.register(0,({domainContext:o,rawRumEvent:i})=>{if(n(),r.size===0)return $;let s=lm(o,i),a=s&&r.get(s);return a?{type:i.type,service:a.service,version:a.version}:$})}function lm(e,t){if(t.type==="long_task"&&t.long_task.entry_type==="long-animation-frame")return t.long_task.scripts[0]?.source_url;let r;return"handlingStack"in e&&(r=e.handlingStack),t.type==="error"&&t.error.stack&&(r=t.error.stack),Re({stack:r}).stack[0]?.url}function fi(e,t,r,n,o,i,s,a,u,c){let l=[],p=new Ho;p.subscribe(13,k=>fr("rum",k)),t.expireObservable.subscribe(()=>p.notify(9)),t.renewObservable.subscribe(k=>p.notify(10,k));let f=k=>{p.notify(14,{error:k}),ne("Error reported to customer",{"error.message":k.message})},d=dr(e);if(le()){xc(p);let k=d.subscribe(Q=>{p.notify(11,Q)});l.push(()=>k.unsubscribe())}else{let k=Tc(e,p,f,d,t.expireObservable,i),Q=k.flushController.preparePageExitFlushObservable.subscribe(Z=>{p.notify(11,{reason:Z})});l.push(()=>Q.unsubscribe()),l.push(()=>k.stop()),Oc(a,p,k.flushController.flushObservable)}let{stop:m}=zc(p,a);l.push(m);let A=pm(p,u,e,t,r,o,s,c,f),{stop:g}=A,x=Dr(A,["stop"]);return l.push(g),s.unbuffer(),l.push(()=>n.stop()),O(E({},x),{lifeCycle:p,sessionManager:t,stopSession:()=>t.expire(),telemetry:a,stop:()=>{l.forEach(k=>k())},hooks:u})}function pm(e,t,r,n,o,i,s,a,u){let c=[],l=Hs(),p=Ac(r),{observable:f,stop:d}=$s();c.push(d),qc(t,r,a);let m=wc(t,r);c.push(()=>m.stop());let g=Go(e);c.push(()=>g.stop());let x=hc(e,t,p);c.push(()=>x.stop());let A=Ic(e,t,r);Kc(t,r,n,o,g),jc(t),Do(t);let k=Po(t,r,"rum",!0),Q=Uo(t,r,n,"rum"),Z=Lo(t,r,"rum"),we=Ha(e,t,l,f,r);c.push(we.stop);let v=Yc(e),S=kc(t,r);c.push(S.stop);let T=Uc(r,t);c.push(T.stop),Fc(t),$c(r,e,t,u);let{addTiming:C,setLoadingTime:N,startView:Ne,setViewName:Ue,setViewContext:Vn,setViewContextProperty:Lr,getViewContext:Fn,stop:Bn}=yc(e,t,r,l,f,p,o,g,i);Wc(t),c.push(Bn);let sr=Qa(e,r);c.push(sr.stop);let{stop:Hn}=Vc(e,r);c.push(Hn);let{addError:Mr}=$a(e,r,s);ia(e,r,n,Q,Z,s);let ke=Mc(e,m),ct=Ks(r.applicationId,n,g,we.actionContexts,x);return{addAction:we.addAction,startAction:we.startAction,stopAction:we.stopAction,startResource:sr.startResource,stopResource:sr.stopResource,addEvent:v.addEvent,addError:Mr,addTiming:C,setLoadingTime:N,addFeatureFlagEvaluation:A.addFeatureFlagEvaluation,startView:Ne,setViewContext:Vn,setViewContextProperty:Lr,getViewContext:Fn,setViewName:Ue,viewHistory:g,sessionManager:n,stopSession:()=>n.expire(),getInternalContext:ct.get,startDurationVital:ke.startDurationVital,stopDurationVital:ke.stopDurationVital,addDurationVital:ke.addDurationVital,addOperationStepVital:ke.addOperationStepVital,globalContext:k,userContext:Q,accountContext:Z,stop:()=>c.forEach(_e=>_e())}}function dm(e,t,r={}){let n=To(),o=vs(),i=Bs(r,n,(c,l,p,f,d,m)=>{let g=p&&r.createDeflateEncoder?A=>r.createDeflateEncoder(c,p,A):mr,x=fi(c,l,e,t,f,g,o.observable,d,m,r.sdkName);return e.onRumStart(x.lifeCycle,c,l,x.viewHistory,p,x.telemetry),t.onRumStart(x.lifeCycle,x.hooks,c,l,x.viewHistory,g),i=fm(i,x),Tn(c.plugins,"onRumStart",{addEvent:x.addEvent,addError:x.addError}),x}),s=()=>i,a=c=>{let l=Me("view");ee(()=>{let p=typeof c=="object"?c:{name:c};i.startView(O(E({},p),{handlingStack:l})),K({feature:"start-view"})})},u=_o({init:c=>{let l=new Error().stack;ee(()=>i.init(c,u,l))},setTrackingConsent:_(c=>{n.update(c),K({feature:"set-tracking-consent",tracking_consent:c})}),setViewName:_(c=>{i.setViewName(c),K({feature:"set-view-name"})}),setViewContext:_(c=>{i.setViewContext(c),K({feature:"set-view-context"})}),setViewContextProperty:_((c,l)=>{i.setViewContextProperty(c,l),K({feature:"set-view-context-property"})}),getViewContext:_(()=>(K({feature:"set-view-context-property"}),i.getViewContext())),getInternalContext:_(c=>i.getInternalContext(c)),getInitConfiguration:_(()=>Ht(i.initConfiguration)),addAction:(c,l)=>{let p=Me("action");ee(()=>{i.addAction({name:R(c),context:R(l),startClocks:w(),type:vt.CUSTOM,handlingStack:p}),K({feature:"add-action"})})},startAction:_((c,l)=>{i.initConfiguration&&!pe(re.START_STOP_ACTION)||i.startAction(R(c),{type:R(l&&l.type),context:R(l&&l.context),actionKey:l&&l.actionKey})}),stopAction:_((c,l)=>{i.initConfiguration&&!pe(re.START_STOP_ACTION)||i.stopAction(R(c),{type:R(l&&l.type),context:R(l&&l.context),actionKey:l&&l.actionKey})}),startResource:_((c,l)=>{i.initConfiguration&&!pe(re.START_STOP_RESOURCE)||i.startResource(R(c),{type:R(l&&l.type),method:R(l&&l.method),context:R(l&&l.context),resourceKey:l&&l.resourceKey})}),stopResource:_((c,l)=>{i.initConfiguration&&!pe(re.START_STOP_RESOURCE)||i.stopResource(R(c),{type:R(l&&l.type),statusCode:l&&l.statusCode,size:l&&l.size,context:R(l&&l.context),resourceKey:l&&l.resourceKey})}),addError:(c,l)=>{let p=Me("error");ee(()=>{i.addError({error:c,handlingStack:p,context:R(l),startClocks:w()}),K({feature:"add-error"})})},addTiming:_((c,l)=>{i.addTiming(R(c),l)}
9),setViewLoadingTime:_(()=>{let c=F();i.setLoadingTime(c),K({feature:"addViewLoadingTime"})}),setGlobalContext:oe(s,z.globalContext,ie.setContext,"set-global-context"),getGlobalContext:oe(s,z.globalContext,ie.getContext,"get-global-context"),setGlobalContextProperty:oe(s,z.globalContext,ie.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:oe(s,z.globalContext,ie.removeContextProperty,"remove-global-context-property"),clearGlobalContext:oe(s,z.globalContext,ie.clearContext,"clear-global-context"),setUser:oe(s,z.userContext,ie.setContext,"set-user"),getUser:oe(s,z.userContext,ie.getContext,"get-user"),setUserProperty:oe(s,z.userContext,ie.setContextProperty,"set-user-property"),removeUserProperty:oe(s,z.userContext,ie.removeContextProperty,"remove-user-property"),clearUser:oe(s,z.userContext,ie.clearContext,"clear-user"),setAccount:oe(s,z.accountContext,ie.setContext,"set-account"),getAccount:oe(s,z.accountContext,ie.getContext,"get-account"),setAccountProperty:oe(s,z.accountContext,ie.setContextProperty,"set-account-property"),removeAccountProperty:oe(s,z.accountContext,ie.removeContextProperty,"remove-account-property"),clearAccount:oe(s,z.accountContext,ie.clearContext,"clear-account"),startView:a,stopSession:_(()=>{i.stopSession(),K({feature:"stop-session"})}),addFeatureFlagEvaluation:_((c,l)=>{i.addFeatureFlagEvaluation(R(c),R(l)),K({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:_(()=>e.getSessionReplayLink()),startSessionReplayRecording:_(c=>{e.start(c),K({feature:"start-session-replay-recording",force:c&&c.force})}),stopSessionReplayRecording:_(()=>e.stop()),addDurationVital:(c,l)=>{let p=Me("vital");ee(()=>{K({feature:"add-duration-vital"}),i.addDurationVital({id:V(),name:R(c),type:ft.DURATION,startClocks:Pr(l.startTime),duration:l.duration,context:R(l&&l.context),description:R(l&&l.description),handlingStack:p})})},startDurationVital:(c,l)=>{let p=Me("vital");ee(()=>{K({feature:"start-duration-vital"}),i.startDurationVital(R(c),{vitalKey:l&&l.vitalKey,context:R(l&&l.context),description:R(l&&l.description),handlingStack:p})})},stopDurationVital:_((c,l)=>{K({feature:"stop-duration-vital"}),i.stopDurationVital(R(c),{vitalKey:l&&l.vitalKey,context:R(l&&l.context),description:R(l&&l.description)})}),startFeatureOperation:(c,l)=>{let p=Me("vital");ee(()=>{K({feature:"add-operation-step-vital",action_type:"start"}),i.addOperationStepVital(c,"start",O(E({},l),{handlingStack:p}))})},succeedFeatureOperation:_((c,l)=>{K({feature:"add-operation-step-vital",action_type:"succeed"}),i.addOperationStepVital(c,"end",l)}),failFeatureOperation:_((c,l,p)=>{K({feature:"add-operation-step-vital",action_type:"fail"}),i.addOperationStepVital(c,"end",p,l)}),DEFAULT_TRACKED_RESOURCE_HEADERS:bn});return u}function fm(e,t){return O(E({},e),{init:r=>{Tr("DD_RUM",r)},getInternalContext:t.getInternalContext,stopSession:t.stopSession,getViewContext:t.getViewContext,globalContext:t.globalContext,userContext:t.userContext,accountContext:t.accountContext})}function mm(e,{session:t,viewContext:r,errorType:n}){let o=t?t.id:"no-session-id",i=[];n!==void 0&&i.push(`error-type=${n}`),r&&(i.push(`seed=${r.id}`),i.push(`from=${r.startClocks.timeStamp}`));let s=Em(e),a=`/rum/replay/sessions/${o}`;return`${s}${a}?${i.join("&")}`}function Em(e){let t=e.site,r=e.subdomain||gm(e);return`https://${r?`${r}.`:""}${t}`}function gm(e){switch(e.site){case _t:case Fi:return"app";case Wr:return"dd";default:return}}export{b as a,cr as b,W as c,B as d,gi as e,F as f,w as g,Ur as h,D as i,gt as j,fe as k,tt as l,_ as m,J as n,y as o,G as p,q,Ti as r,ut as s,M as t,zr as u,fr as v,lt as w,Ie as x,Gr as y,le as z,P as A,Le as B,Xn as C,$ as D,ne as E,Er as F,$e as G,ae as H,Sl as I,Tl as J,xe as K,hr as L,Ot as M,vy as N,Dl as O,wo as P,h as Q,Sn as R,Gs as S,Or as T,he as U,$o as V,In as W,V_ as X,aa as Y,U as Z,L as _,Qo as $,Q_ as aa,On as ba,Z_ as ca,Zt as da,yd as ea,Td as fa,Zo as ga,ma as ha,oA as ia,wf as ja,ci as ka,li as la,tr as ma,di as na,dm as oa,mm as pa,cp as qa};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.