Socket
Socket
Sign inDemoInstall

@datadog/browser-logs

Package Overview
Dependencies
Maintainers
1
Versions
256
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datadog/browser-logs - npm Package Compare versions

Comparing version 4.23.0 to 4.23.1

2

bundle/datadog-logs.js

@@ -1,1 +0,1 @@

!function(){"use strict";var e={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},t=function(n){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];Object.prototype.hasOwnProperty.call(e,n)||(n=e.log),t[n].apply(t,r)};function n(e,n){return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];try{return e.apply(void 0,r)}catch(e){t.error(n,e)}}}t.debug=console.debug.bind(console),t.log=console.log.bind(console),t.info=console.info.bind(console),t.warn=console.warn.bind(console),t.error=console.error.bind(console);var r,o=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},i=!1;function s(e){i=e}function a(e,t,n){var o=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r?u(o):o;return n.apply(this,e)}}function u(e){return function(){return c(e,this,arguments)}}function c(t,n,o){try{return t.apply(n,o)}catch(t){if(f(e.error,t),r)try{r(t)}catch(t){f(e.error,t)}}}function f(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];i&&t.apply(void 0,o([e,"[MONITOR]"],n,!1))}var l=1e3,d=6e4;function p(e,t,n){var r,o,i=!n||void 0===n.leading||n.leading,s=!n||void 0===n.trailing||n.trailing,a=!1;return{throttled:function(){for(var n=[],u=0;u<arguments.length;u++)n[u]=arguments[u];a?r=n:(i?e.apply(void 0,n):r=n,a=!0,o=setTimeout((function(){s&&r&&e.apply(void 0,r),a=!1,r=void 0}),t))},cancel:function(){clearTimeout(o),a=!1,r=void 0}}}function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})),e}function h(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,h)}function g(e){return 0!==e&&100*Math.random()<=e}function y(){}function m(e,t,n){if("object"!=typeof e||null===e)return JSON.stringify(e);var r=b(Object.prototype),o=b(Array.prototype),i=b(Object.getPrototypeOf(e)),s=b(e);try{return JSON.stringify(e,t,n)}catch(e){return"<error: unable to serialize object>"}finally{r(),o(),i(),s()}}function b(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):y}function w(e,t){return-1!==e.indexOf(t)}function C(e){if(Array.from)return Array.from(e);var t=[];if(e instanceof Set)e.forEach((function(e){return t.push(e)}));else for(var n=0;n<e.length;n++)t.push(e[n]);return t}function k(e){return function(e){return"number"==typeof e}(e)&&e>=0&&e<=100}function x(e){return Object.keys(e).map((function(t){return e[t]}))}function S(e,t){return e.slice(0,t.length)===t}function E(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var e=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof e&&(e="object"==typeof self?self:"object"==typeof window?window:{}),e}function R(e,t,n){void 0===n&&(n="");var r=e.charCodeAt(t-1),o=r>=55296&&r<=56319?t+1:t;return e.length<=o?e:"".concat(e.slice(0,o)).concat(n)}function T(e,t,n,r){return L(e,[t],n,r)}function L(e,t,n,r){var o=void 0===r?{}:r,i=o.once,s=o.capture,a=o.passive,c=u(i?function(e){l(),n(e)}:n),f=a?{capture:s,passive:a}:s;t.forEach((function(t){return e.addEventListener(t,c,f)}));var l=function(){return t.forEach((function(t){return e.removeEventListener(t,c,f)}))};return{stop:l}}function _(e,t,n){if(void 0===n&&(n=function(){if("undefined"!=typeof WeakSet){var e=new WeakSet;return{hasAlreadyBeenSeen:function(t){var n=e.has(t);return n||e.add(t),n}}}var t=[];return{hasAlreadyBeenSeen:function(e){var n=t.indexOf(e)>=0;return n||t.push(e),n}}}()),void 0===t)return e;if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){var r=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,r)}if(!n.hasAlreadyBeenSeen(t)){if(Array.isArray(t)){for(var o=Array.isArray(e)?e:[],i=0;i<t.length;++i)o[i]=_(o[i],t[i],n);return o}var s,a="object"==(null===(s=e)?"null":Array.isArray(s)?"array":typeof s)?e:{};for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(a[u]=_(a[u],t[u],n));return a}}function O(e){return _(void 0,e)}function B(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=0,o=t;r<o.length;r++){var i=o[r];null!=i&&(e=_(e,i))}return e}function M(){var e={};return{get:function(){return e},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},set:function(t){e=t},getContext:function(){return O(e)},setContext:function(t){e=O(t)},setContextProperty:function(t,n){e[t]=O(n)},removeContextProperty:function(t){delete e[t]},clearContext:function(){e={}}}}var q,I=function(){function e(){this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>500&&this.buffer.splice(0,1)},e.prototype.drain=function(){this.buffer.forEach((function(e){return e()})),this.buffer.length=0},e}();function P(){return(new Date).getTime()}function A(){return P()}function j(){return performance.now()}function U(){return{relative:j(),timeStamp:A()}}function D(e,t){return t-e}function F(){return void 0===q&&(q=performance.timing.navigationStart),q}function N(){var e=E().DatadogEventBridge;if(e)return{getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,n){e.send(JSON.stringify({eventType:t,event:n}))}}}function H(e){var t;void 0===e&&(e=null===(t=E().location)||void 0===t?void 0:t.hostname);var n=N();return!!n&&n.getAllowedWebViewHosts().some((function(t){return e===t||(n=e,r=".".concat(t),n.slice(-r.length)===r);var n,r}))}var G,z,V;function $(e,t,n,r){var o=new Date;o.setTime(o.getTime()+n);var i="expires=".concat(o.toUTCString()),s=r&&r.crossSite?"none":"strict",a=r&&r.domain?";domain=".concat(r.domain):"",u=r&&r.secure?";secure":"";document.cookie="".concat(e,"=").concat(t,";").concat(i,";path=/;samesite=").concat(s).concat(a).concat(u)}function J(e){return function(e,t){var n=new RegExp("(?:^|;)\\s*".concat(t,"\\s*=\\s*([^;]+)")).exec(e);return n?n[1]:void 0}(document.cookie,e)}function W(e,t){$(e,"",0,t)}function X(){return z||new Set}function Y(e){return K(e,function(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return"".concat(e.protocol,"//").concat(t)}(window.location)).href}function K(e,t){if(function(){if(void 0!==V)return V;try{var e=new URL("http://test/path");return V="http://test/path"===e.href}catch(e){V=!1}return V}())return void 0!==t?new URL(e,t):new URL(e);if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: '".concat(e,"'"));var n=document,r=n.createElement("a");if(void 0!==t){var o=(n=document.implementation.createHTMLDocument("")).createElement("base");o.href=t,n.head.appendChild(o),n.body.appendChild(r)}return r.href=e,r}var Q="datadoghq.com",Z={logs:"logs",rum:"rum",sessionReplay:"session-replay"},ee={logs:"logs",rum:"rum",sessionReplay:"replay"};function te(e,t,n){var r=e.site,o=void 0===r?Q:r,i=e.clientToken,s=o.split("."),a=s.pop(),u="".concat(Z[t],".browser-intake-").concat(s.join("-"),".").concat(a),c="https://".concat(u,"/api/v2/").concat(ee[t]),f=e.proxyUrl&&Y(e.proxyUrl);return{build:function(){var e="ddsource=browser"+"&ddtags=".concat(encodeURIComponent(["sdk_version:".concat("4.23.0")].concat(n).join(",")))+"&dd-api-key=".concat(i)+"&dd-evp-origin-version=".concat(encodeURIComponent("4.23.0"))+"&dd-evp-origin=browser"+"&dd-request-id=".concat(h());"rum"===t&&(e+="&batch_time=".concat(A()));var r="".concat(c,"?").concat(e);return f?"".concat(f,"?ddforward=").concat(encodeURIComponent(r)):r},buildIntakeUrl:function(){return f?"".concat(f,"?ddforward"):c},endpointType:t}}var ne=/[^a-z0-9_:./-]/;function re(e,n){var r=200-e.length-1;(n.length>r||ne.test(n))&&t.warn("".concat(e," value doesn't meet tag requirements and will be sanitized"));var o=n.replace(/,/g,"_");return"".concat(e,":").concat(o)}function oe(e){var t=function(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,i=[];return t&&i.push(re("env",t)),n&&i.push(re("service",n)),r&&i.push(re("version",r)),o&&i.push(re("datacenter",o)),i}(e),n=function(e,t){return{logsEndpointBuilder:te(e,"logs",t),rumEndpointBuilder:te(e,"rum",t),sessionReplayEndpointBuilder:te(e,"sessionReplay",t)}}(e,t),r=x(n).map((function(e){return e.buildIntakeUrl()})),o=function(e,t,n){if(!e.replica)return;var r=v({},e,{site:Q,clientToken:e.replica.clientToken}),o={logsEndpointBuilder:te(r,"logs",n),rumEndpointBuilder:te(r,"rum",n)};return t.push.apply(t,x(o).map((function(e){return e.buildIntakeUrl()}))),v({applicationId:e.replica.applicationId},o)}(e,r,t);return v({isIntakeUrl:function(e){return r.some((function(t){return 0===e.indexOf(t)}))},replica:o,site:e.site||Q},n)}function ie(e){var r,o,i;if(e&&e.clientToken)if(void 0===e.sampleRate||k(e.sampleRate))if(void 0===e.telemetrySampleRate||k(e.telemetrySampleRate)){var s;if(void 0===e.telemetryConfigurationSampleRate||k(e.telemetryConfigurationSampleRate))return s=e.enableExperimentalFeatures,Array.isArray(s)&&(z||(z=new Set(s)),s.filter((function(e){return"string"==typeof e})).forEach((function(e){w(e,"-")&&t.warn("please use snake case for '".concat(e,"'")),z.add(e)}))),v({beforeSend:e.beforeSend&&n(e.beforeSend,"beforeSend threw an error:"),cookieOptions:se(e),sampleRate:null!==(r=e.sampleRate)&&void 0!==r?r:100,telemetrySampleRate:null!==(o=e.telemetrySampleRate)&&void 0!==o?o:20,telemetryConfigurationSampleRate:null!==(i=e.telemetryConfigurationSampleRate)&&void 0!==i?i:5,service:e.service,silentMultipleInit:!!e.silentMultipleInit,batchBytesLimit:16384,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:3e4,batchMessagesLimit:50,messageBytesLimit:262144},oe(e));t.error("Telemetry Configuration Sample Rate should be a number between 0 and 100")}else t.error("Telemetry Sample Rate should be a number between 0 and 100");else t.error("Sample Rate should be a number between 0 and 100");else t.error("Client Token is not configured, we will not send any data.")}function se(e){var t={};return t.secure=function(e){return!!e.useSecureSessionCookie||!!e.useCrossSiteSessionCookie}(e),t.crossSite=!!e.useCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===G){for(var e="dd_site_test_".concat(h()),t=window.location.hostname.split("."),n=t.pop();t.length&&!J(e);)n="".concat(t.pop(),".").concat(n),$(e,"test",l,{domain:n});W(e,{domain:n}),G=n}return G}()),t}var ae="?";function ue(e){var t=[],n=ye(e,"stack"),r=String(e);return n&&S(n,r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((function(e){var n=function(e){var t=le.exec(e);if(!t)return;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),o=de.exec(t[2]);r&&o&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]);return{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||ae,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){var t=pe.exec(e);if(!t)return;return{args:[],column:t[3]?+t[3]:void 0,func:ae,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){var t=ve.exec(e);if(!t)return;return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||ae,line:+t[3],url:t[2]}}(e)||function(e){var t=he.exec(e);if(!t)return;var n=t[3]&&t[3].indexOf(" > eval")>-1,r=ge.exec(t[3]);n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0);return{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||ae,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=ae),t.push(n))})),{message:ye(e,"message"),name:ye(e,"name"),stack:t}}var ce="((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\\w+\\.|\\/).*?)",fe="(?::(\\d+))",le=new RegExp("^\\s*at (.*?) ?\\(".concat(ce).concat(fe,"?").concat(fe,"?\\)?\\s*$"),"i"),de=new RegExp("\\((\\S*)".concat(fe).concat(fe,"\\)"));var pe=new RegExp("^\\s*at ?".concat(ce).concat(fe,"?").concat(fe,"??\\s*$"),"i");var ve=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var he=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,ge=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function ye(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}var me="agent",be="console",we="logger",Ce="network",ke="source",xe="report";function Se(e){var t=Ee(e);return e.stack.forEach((function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"(".concat(e.args.join(", "),")"):"",o=e.line?":".concat(e.line):"",i=e.line&&e.column?":".concat(e.column):"";t+="\n at ".concat(n).concat(r," @ ").concat(e.url).concat(o).concat(i)})),t}function Ee(e){return"".concat(e.name||"Error",": ").concat(e.message)}function Re(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return c((function(){var n=ue(t);n.stack=n.stack.slice(2),e=Se(n)})),e}function Te(e,t){for(var n=e,r=[];(null==n?void 0:n.cause)instanceof Error&&r.length<10;){var o=ue(n.cause);r.push({message:n.cause.message,source:t,type:null==o?void 0:o.name,stack:o&&Se(o)}),n=n.cause}return r.length?r:void 0}var Le=function(){function e(e){this.onFirstSubscribe=e,this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return!this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe()||void 0),this.observers.push(e),{unsubscribe:function(){t.observers=t.observers.filter((function(t){return e!==t})),!t.observers.length&&t.onLastUnsubscribe&&t.onLastUnsubscribe()}}},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}();function _e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=new Le((function(){var t=e.map((function(e){return e.subscribe((function(e){return n.notify(e)}))}));return function(){return t.forEach((function(e){return e.unsubscribe()}))}}));return n}var Oe={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Be(e){var t,n=[];w(e,Oe.cspViolation)&&n.push(t=new Le((function(){var e=u((function(e){t.notify(function(e){var t=Oe.cspViolation,n="'".concat(e.blockedURI,"' blocked by '").concat(e.effectiveDirective,"' directive");return{type:Oe.cspViolation,subtype:e.effectiveDirective,message:"".concat(t,": ").concat(n),stack:Me(e.effectiveDirective,e.originalPolicy?"".concat(n,' of the policy "').concat(R(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber)}}(e))}));return T(document,"securitypolicyviolation",e).stop})));var r=e.filter((function(e){return e!==Oe.cspViolation}));return r.length&&n.push(function(e){var t=new Le((function(){if(window.ReportingObserver){var n=u((function(e){return e.forEach((function(e){t.notify(function(e){var t=e.type,n=e.body;return{type:t,subtype:n.id,message:"".concat(t,": ").concat(n.message),stack:Me(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)}}(e))}))})),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),function(){r.disconnect()}}}));return t}(r)),_e.apply(void 0,n)}function Me(e,t,n,r,o){return n&&Se({name:e,message:t,stack:[{func:"?",url:n,line:r,column:o}]})}function qe(e,n,r){return void 0===e?[]:"all"===e||Array.isArray(e)&&e.every((function(e){return w(n,e)}))?"all"===e?n:(o=e,i=new Set,o.forEach((function(e){return i.add(e)})),C(i)):void t.error("".concat(r,' should be "all" or an array with allowed values "').concat(n.join('", "'),'"'));var o,i}var Ie=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},Pe={debug:"debug",error:"error",info:"info",warn:"warn"},Ae="console",je="http",Ue=Object.keys(Pe),De=function(){function e(e,t,n,r,o){void 0===n&&(n=je),void 0===r&&(r=Pe.debug),void 0===o&&(o={}),this.handleLogStrategy=e,this.handlerType=n,this.level=r,this.contextManager=M(),this.contextManager.set(v({},o,t?{logger:{name:t}}:void 0))}return e.prototype.log=function(e,t,n){void 0===n&&(n=Pe.info),this.handleLogStrategy({message:e,context:O(t),status:n},this)},e.prototype.debug=function(e,t){this.log(e,t,Pe.debug)},e.prototype.info=function(e,t){this.log(e,t,Pe.info)},e.prototype.warn=function(e,t){this.log(e,t,Pe.warn)},e.prototype.error=function(e,t){var n={error:{origin:we}};this.log(e,B(n,t),Pe.error)},e.prototype.setContext=function(e){this.contextManager.set(e)},e.prototype.getContext=function(){return this.contextManager.get()},e.prototype.addContext=function(e,t){this.contextManager.add(e,t)},e.prototype.removeContext=function(e){this.contextManager.remove(e)},e.prototype.setHandler=function(e){this.handlerType=e},e.prototype.getHandler=function(){return this.handlerType},e.prototype.setLevel=function(e){this.level=e},e.prototype.getLevel=function(){return this.level},Ie([a],e.prototype,"log",null),e}();function Fe(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||J("datadog-synthetics-injects-rum"))}function Ne(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||J("datadog-synthetics-result-id");return"string"==typeof e?e:void 0}var He,Ge="log",ze="configuration",Ve=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","http://localhost","<anonymous>"],$e=["ddog-gov.com"],Je={maxEventsPerPage:0,sentEventCount:0,telemetryEnabled:!1,telemetryConfigurationEnabled:!1};function We(e,t){var n,o=new Le;return Je.telemetryEnabled=g(t.telemetrySampleRate),Je.telemetryConfigurationEnabled=Je.telemetryEnabled&&g(t.telemetryConfigurationSampleRate),He=function(r){!w($e,t.site)&&Je.telemetryEnabled&&o.notify(function(e,t){return B({type:"telemetry",date:A(),service:e,version:"4.23.0",source:"browser",_dd:{format_version:2},telemetry:t,experimental_features:C(X())},void 0!==n?n():{})}(e,r))},r=Ye,v(Je,{maxEventsPerPage:t.maxTelemetryEventsPerPage,sentEventCount:0}),{setContextProvider:function(e){n=e},observable:o}}function Xe(t,n){f(e.debug,t,n),Ke(v({type:Ge,message:t,status:"debug"},n))}function Ye(e){Ke(v({type:Ge,status:"error"},function(e){if(e instanceof Error){var t=ue(e);return{error:{kind:t.name,stack:Se(Qe(t))},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught ".concat(m(e))}}(e)))}function Ke(e){He&&Je.sentEventCount<Je.maxEventsPerPage&&(Je.sentEventCount+=1,He(e))}function Qe(e){return e.stack=e.stack.filter((function(e){return!e.url||Ve.some((function(t){return S(e.url,t)}))})),e}var Ze=/[^\u0000-\u007F]/,et=function(){function e(e,t,n,r,o,i){void 0===i&&(i=y),this.request=e,this.batchMessagesLimit=t,this.batchBytesLimit=n,this.messageBytesLimit=r,this.flushTimeout=o,this.beforeUnloadCallback=i,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesCount=0,this.bufferMessagesCount=0,this.setupFlushOnExit(),this.flushPeriodically()}return e.prototype.add=function(e){this.addOrUpdate(e)},e.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},e.prototype.flush=function(e){if(void 0===e&&(e=this.request.send),0!==this.bufferMessagesCount){var t=this.pushOnlyBuffer.concat(x(this.upsertBuffer)),n=this.bufferBytesCount;this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesCount=0,this.bufferMessagesCount=0,e({data:t.join("\n"),bytesCount:n})}},e.prototype.flushOnExit=function(){this.flush(this.request.sendOnExit)},e.prototype.computeBytesCount=function(e){return Ze.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length},e.prototype.addOrUpdate=function(e,n){var r=this.process(e),o=r.processedMessage,i=r.messageBytesCount;i>=this.messageBytesLimit?t.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(this.messageBytesLimit,"KB.")):(this.hasMessageFor(n)&&this.remove(n),this.willReachedBytesLimitWith(i)&&this.flush(),this.push(o,i,n),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=m(e);return{processedMessage:t,messageBytesCount:this.computeBytesCount(t)}},e.prototype.push=function(e,t,n){this.bufferMessagesCount>0&&(this.bufferBytesCount+=1),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.bufferBytesCount+=t,this.bufferMessagesCount+=1},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.computeBytesCount(t);this.bufferBytesCount-=n,this.bufferMessagesCount-=1,this.bufferMessagesCount>0&&(this.bufferBytesCount-=1)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e.prototype.willReachedBytesLimitWith=function(e){return this.bufferBytesCount+e+1>=this.batchBytesLimit},e.prototype.isFull=function(){return this.bufferMessagesCount===this.batchMessagesLimit||this.bufferBytesCount>=this.batchBytesLimit},e.prototype.flushPeriodically=function(){var e=this;setTimeout(u((function(){e.flush(),e.flushPeriodically()})),this.flushTimeout)},e.prototype.setupFlushOnExit=function(){var e=this;navigator.sendBeacon&&(T(window,"beforeunload",this.beforeUnloadCallback),T(document,"visibilitychange",(function(){"hidden"===document.visibilityState&&e.flushOnExit()})),T(window,"beforeunload",(function(){return e.flushOnExit()})))},e}(),tt=3145728;function nt(e,t,n,r,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?ot(e,t,n,{onSuccess:function(){return it(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),rt(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function rt(e,t,n,r){2===e.transportStatus&&setTimeout(u((function(){ot(e.queuedPayloads.first(),e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),0!==e.lastFailureStatus&&Xe("resuming after transport down",{failureStatus:e.lastFailureStatus}),e.currentBackoffTime=1e3,it(1,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(6e4,2*e.currentBackoffTime),rt(e,t,n,r)}})})),e.currentBackoffTime)}function ot(e,t,n,r){var o=r.onSuccess,i=r.onFailure;t.bandwidthMonitor.add(e),n(e,(function(n){t.bandwidthMonitor.remove(e),!function(e){return 0===e.status||408===e.status||429===e.status||e.status>=500}(n)?(t.transportStatus=0,o()):(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,t.lastFailureStatus=n.status,i())}))}function it(e,t,n,r,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(3,"MiB"),source:me,startClocks:U()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=st();i.size()>0;)nt(i.dequeue(),t,n,r,o)}function st(){var e=[];return{bytesCount:0,enqueue:function(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first:function(){return e[0]},dequeue:function(){var t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size:function(){return e.length},isFull:function(){return this.bytesCount>=tt}}}function at(e,t,n){var r={transportStatus:0,lastFailureStatus:0,currentBackoffTime:1e3,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=81920&&this.ongoingRequestCount<32},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:st(),queueFullReported:!1},o=function(n,r){return function(e,t,n,r){var o=n.data,i=n.bytesCount,s=e.build();(function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(e){return!1}})()&&i<t?fetch(s,{method:"POST",body:o,keepalive:!0}).then(u((function(e){return null==r?void 0:r({status:e.status})})),u((function(){ct(s,o,r)}))):ct(s,o,r)}(e,t,n,r)};return{send:function(t){nt(t,r,o,e.endpointType,n)},sendOnExit:function(n){!function(e,t,n){var r=n.data,o=n.bytesCount,i=e.build();if(navigator.sendBeacon&&o<t)try{if(navigator.sendBeacon(i,r))return}catch(e){!function(e){ut||(ut=!0,Ye(e))}(e)}ct(i,r)}(e,t,n)}}}var ut=!1;function ct(e,t,n){var r=new XMLHttpRequest;r.open("POST",e,!0),r.send(t),r.addEventListener("loadend",u((function(){null==n||n({status:r.status})})))}function ft(e,t,n,r){var o,i=s(t);function s(t){return new et(at(t,e.batchBytesLimit,n),e.batchMessagesLimit,e.batchBytesLimit,e.messageBytesLimit,e.flushTimeout)}return r&&(o=s(r)),{add:function(e,t){void 0===t&&(t=!0),i.add(e),o&&t&&o.add(e)}}}var lt=1/0,dt=function(){function e(e){var t=this;this.expireDelay=e,this.entries=[],this.clearOldContextsInterval=setInterval((function(){return t.clearOldContexts()}),6e4)}return e.prototype.add=function(e,t){var n=this,r={context:e,startTime:t,endTime:lt,remove:function(){var e=n.entries.indexOf(r);e>=0&&n.entries.splice(e,1)},close:function(e){r.endTime=e}};return this.entries.unshift(r),r},e.prototype.find=function(e){void 0===e&&(e=lt);for(var t=0,n=this.entries;t<n.length;t++){var r=n[t];if(r.startTime<=e){if(e<=r.endTime)return r.context;break}}},e.prototype.closeActive=function(e){var t=this.entries[0];t&&t.endTime===lt&&t.close(e)},e.prototype.findAll=function(e){return void 0===e&&(e=lt),this.entries.filter((function(t){return t.startTime<=e&&e<=t.endTime})).map((function(e){return e.context}))},e.prototype.reset=function(){this.entries=[]},e.prototype.stop=function(){clearInterval(this.clearOldContextsInterval)},e.prototype.clearOldContexts=function(){for(var e=j()-this.expireDelay;this.entries.length>0&&this.entries[this.entries.length-1].endTime<e;)this.entries.pop()},e}();var pt,vt=144e5,ht=9e5,gt=/^([a-z]+)=([a-z0-9-]+)$/,yt="&",mt="_dd_s",bt=[];function wt(e,t){var n;if(void 0===t&&(t=0),pt||(pt=e),e===pt)if(t>=100)xt();else{var r,o=Rt();if(Ct()){if(o.lock)return void kt(e,t);if(r=h(),o.lock=r,Et(o,e.options),(o=Rt()).lock!==r)return void kt(e,t)}var i=e.process(o);if(Ct()&&(o=Rt()).lock!==r)kt(e,t);else{if(i&&St(i,e.options),Ct()&&(!i||!Tt(i))){if((o=Rt()).lock!==r)return void kt(e,t);delete o.lock,Et(o,e.options),i=o}null===(n=e.after)||void 0===n||n.call(e,i||o),xt()}}else bt.push(e)}function Ct(){return!!window.chrome||/HeadlessChrome/.test(window.navigator.userAgent)}function kt(e,t){setTimeout(u((function(){wt(e,t+1)})),10)}function xt(){pt=void 0;var e=bt.shift();e&&wt(e)}function St(e,t){Tt(e)?function(e){$(mt,"",0,e)}(t):(e.expire=String(P()+ht),Et(e,t))}function Et(e,t){$(mt,function(e){return(t=e,Object.keys(t).map((function(e){return[e,t[e]]}))).map((function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)})).join(yt);var t}(e),ht,t)}function Rt(){var e=J(mt),t={};return function(e){return void 0!==e&&(-1!==e.indexOf(yt)||gt.test(e))}(e)&&e.split(yt).forEach((function(e){var n=gt.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}})),t}function Tt(e){return t=e,0===Object.keys(t).length;var t}function Lt(e,t,n){var r=new Le,o=new Le,i=setInterval(u((function(){wt({options:e,process:function(e){return f(e)?void 0:{}},after:a})})),1e3),s=function(){var e=Rt();if(f(e))return e;return{}}();function a(e){return f(e)||(e={}),c()&&(!function(e){return s.id!==e.id||s[t]!==e[t]}(e)?s=e:(s={},o.notify())),e}function c(){return void 0!==s[t]}function f(e){return(void 0===e.created||P()-Number(e.created)<vt)&&(void 0===e.expire||P()<Number(e.expire))}return{expandOrRenewSession:p(u((function(){var o;wt({options:e,process:function(e){var r=a(e);return o=function(e){var r=n(e[t]),o=r.trackingType,i=r.isTracked;e[t]=o,i&&!e.id&&(e.id=h(),e.created=String(P()));return i}(r),r},after:function(e){o&&!c()&&function(e){s=e,r.notify()}(e),s=e}})})),1e3).throttled,expandSession:function(){wt({options:e,process:function(e){return c()?a(e):void 0}})},getSession:function(){return s},renewObservable:r,expireObservable:o,stop:function(){clearInterval(i)}}}var _t=[];function Ot(e,t,n){!function(e){var t=J(mt),n=J("_dd"),r=J("_dd_r"),o=J("_dd_l");if(!t){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i.logs=o),r&&/^[012]$/.test(r)&&(i.rum=r),St(i,e)}}(e);var r=Lt(e,t,n);_t.push((function(){return r.stop()}));var o,i=new dt(144e5);function s(){return{id:r.getSession().id,trackingType:r.getSession()[t]}}return _t.push((function(){return i.stop()})),r.renewObservable.subscribe((function(){i.add(s(),j())})),r.expireObservable.subscribe((function(){i.closeActive(j())})),r.expandOrRenewSession(),i.add(s(),[0,F()][0]),o=L(window,["click","touchstart","keydown","scroll"],(function(){return r.expandOrRenewSession()}),{capture:!0,passive:!0}).stop,_t.push(o),function(e){var t=u((function(){"visible"===document.visibilityState&&e()})),n=T(document,"visibilitychange",t).stop;_t.push(n);var r=setInterval(t,6e4);_t.push((function(){clearInterval(r)}))}((function(){return r.expandSession()})),{findActiveSession:function(e){return i.find(e)},renewObservable:r.renewObservable,expireObservable:r.expireObservable}}var Bt;function Mt(e){var t=Ot(e.cookieOptions,"logs",(function(t){return function(e,t){var n=function(e){return"0"===e||"1"===e}(t)?t:qt(e);return{trackingType:n,isTracked:"1"===n}}(e,t)}));return{findTrackedSession:function(e){var n=t.findActiveSession(e);return n&&"1"===n.trackingType?{id:n.id}:void 0}}}function qt(e){return g(e.sampleRate)?"1":"0"}var It=((Bt={})[Pe.debug]=0,Bt[Pe.info]=1,Bt[Pe.warn]=2,Bt[Pe.error]=3,Bt);function Pt(e,t,n){var r=n.getHandler(),o=Array.isArray(r)?r:[r];return It[e]>=It[n.getLevel()]&&w(o,t)}function At(e,t,n,r,o,i){var s=Ue.concat(["custom"]),a={};s.forEach((function(e){var n,r,o,s,u;a[e]=(n=e,r=t.eventRateLimiterThreshold,o=i,s=0,u=!1,{isLimitReached:function(){if(0===s&&setTimeout((function(){s=0}),d),(s+=1)<=r||u)return u=!1,!1;if(s===r+1){u=!0;try{o({message:"Reached max number of ".concat(n,"s by minute: ").concat(r),source:me,startClocks:U()})}finally{u=!1}}return!0}})})),n.subscribe(0,(function(i){var s,u,c,f=i.rawLogsEvent,l=i.messageContext,d=void 0===l?void 0:l,p=i.savedCommonContext,v=void 0===p?void 0:p,h=i.logger,g=void 0===h?o:h,y=f.date-F(),m=e.findTrackedSession(y);if(m){var b=v||r(),w=B({service:t.service,session_id:m.id,view:b.view},b.context,Ut(y),f,g.getContext(),d);!Pt(f.status,je,g)||!1===(null===(s=t.beforeSend)||void 0===s?void 0:s.call(t,w))||(null===(u=w.error)||void 0===u?void 0:u.origin)!==me&&(null!==(c=a[w.status])&&void 0!==c?c:a.custom).isLimitReached()||n.notify(1,w)}}))}var jt=!1;function Ut(e){var t,n=window;if(Fe()){var r=o(n.DD_RUM_SYNTHETICS);return r||jt||(jt=!0,Xe("Logs sent before RUM is injected by the synthetics worker",{testId:(t=window._DATADOG_SYNTHETICS_PUBLIC_ID||J("datadog-synthetics-public-id"),"string"==typeof t?t:void 0),resultId:Ne()})),r}return o(n.DD_RUM);function o(t){if(t&&t.getInternalContext)return t.getInternalContext(e)}}var Dt,Ft={};function Nt(e){var t=e.map((function(e){return Ft[e]||(Ft[e]=function(e){var t=new Le((function(){var n=console[e];return console[e]=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.apply(console,r);var i=Re();c((function(){t.notify(Ht(r,e,i))}))},function(){console[e]=n}}));return t}(e)),Ft[e]}));return _e.apply(void 0,t)}function Ht(t,n,r){var o,i=t.map((function(e){return function(e){if("string"==typeof e)return e;if(e instanceof Error)return Ee(ue(e));return m(e,void 0,2)}(e)})).join(" ");if(n===e.error){var s=function(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n))return r}}(t,(function(e){return e instanceof Error}));o=s?Se(ue(s)):void 0,i="console error: ".concat(i)}return{api:n,message:i,stack:o,handlingStack:r}}var Gt,zt=((Dt={})[e.log]=Pe.info,Dt[e.debug]=Pe.debug,Dt[e.info]=Pe.info,Dt[e.warn]=Pe.warn,Dt[e.error]=Pe.error,Dt);var Vt,$t=((Gt={})[Oe.cspViolation]=Pe.error,Gt[Oe.intervention]=Pe.error,Gt[Oe.deprecation]=Pe.warn,Gt);function Jt(e,t,n){var r=e[t],o=n(r),i=function(){if("function"==typeof o)return o.apply(this,arguments)};return e[t]=i,{stop:function(){e[t]===i?e[t]=r:o=r}}}function Wt(e,t,n){var r=n.before,o=n.after;return Jt(e,t,(function(e){return function(){var t,n=arguments;return r&&c(r,this,n),"function"==typeof e&&(t=e.apply(this,n)),o&&c(o,this,n),t}}))}var Xt,Yt=new WeakMap;function Kt(){var e;return Vt||(e=new Le((function(){var t=Wt(XMLHttpRequest.prototype,"open",{before:Qt}).stop,n=Wt(XMLHttpRequest.prototype,"send",{before:function(){Zt.call(this,e)}}).stop,r=Wt(XMLHttpRequest.prototype,"abort",{before:en}).stop;return function(){t(),n(),r()}})),Vt=e),Vt}function Qt(e,t){Yt.set(this,{state:"open",method:e,url:Y(String(t))})}function Zt(e){var t=this,n=Yt.get(this);if(n){var r=n;r.state="start",r.startTime=j(),r.startClocks=U(),r.isAborted=!1,r.xhr=this;var o=!1,i=Wt(this,"onreadystatechange",{before:function(){this.readyState===XMLHttpRequest.DONE&&s()}}).stop,s=u((function(){if(t.removeEventListener("loadend",s),i(),!o){o=!0;var a=n;a.state="complete",a.duration=D(r.startClocks.timeStamp,A()),a.status=t.status,e.notify(v({},a))}}));this.addEventListener("loadend",s),e.notify(r)}}function en(){var e=Yt.get(this);e&&(e.isAborted=!0)}function tn(){var e;return Xt||(e=new Le((function(){if(window.fetch)return Jt(window,"fetch",(function(t){return function(n,r){var o,i=c(nn,null,[e,n,r]);return i?(o=t.call(this,i.input,i.init),c(rn,null,[e,o,i])):o=t.call(this,n,r),o}})).stop})),Xt=e),Xt}function nn(e,t,n){var r=n&&n.method||"object"==typeof t&&t.method||"GET",o=Y("object"==typeof t&&t.url||t),i={state:"start",init:n,input:t,method:r,startClocks:U(),url:o};return e.notify(i),i}function rn(e,t,n){var r=function(t){var r=n;r.state="complete",r.duration=D(r.startClocks.timeStamp,A()),"stack"in t||t instanceof Error?(r.status=0,r.isAborted=t instanceof DOMException&&t.code===DOMException.ABORT_ERR,r.error=t,e.notify(r)):"status"in t&&(r.response=t,r.responseType=t.type,r.status=t.status,r.isAborted=!1,e.notify(r))};t.then(u(r),u(r))}function on(e,t){if(!e.forwardErrorsToLogs)return{stop:y};var n=Kt().subscribe((function(e){"complete"===e.state&&o("xhr",e)})),r=tn().subscribe((function(e){"complete"===e.state&&o("fetch",e)}));function o(n,r){function o(e){t.notify(0,{rawLogsEvent:{message:"".concat(an(n)," error ").concat(r.method," ").concat(r.url),date:r.startClocks.timeStamp,error:{origin:Ce,stack:e||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url},status:Pe.error,origin:Ce}})}e.isIntakeUrl(r.url)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!function(e){return e.status>=500}(r)||("xhr"in r?function(e,t,n){"string"==typeof e.response?n(sn(e.response,t)):n(e.response)}(r.xhr,e,o):r.response?function(e,t,n){window.TextDecoder?e.body?function(e,t,n){!function(e,t,n){var r=e.getReader(),o=[],i=0;function s(){r.read().then(u((function(e){e.done?a():(o.push(e.value),(i+=e.value.length)>t?a():s())})),u((function(e){return n(e)})))}function a(){var e;if(r.cancel().catch(y),1===o.length)e=o[0];else{e=new Uint8Array(i);var s=0;o.forEach((function(t){e.set(t,s),s+=t.length}))}n(void 0,e.slice(0,t),e.length>t)}s()}(e,t,(function(e,t,r){if(e)n(e);else{var o=(new TextDecoder).decode(t);r&&(o+="..."),n(void 0,o)}}))}(e.clone().body,t.requestErrorResponseLengthLimit,(function(e,t){n(e?"Unable to retrieve response: ".concat(e):t)})):n():e.clone().text().then(u((function(e){return n(sn(e,t))})),u((function(e){return n("Unable to retrieve response: ".concat(e))})))}(r.response,e,o):r.error&&function(e,t,n){n(sn(Se(ue(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function sn(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function an(e){return"xhr"===e?"XHR":"Fetch"}var un=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function cn(e){var t=function(e){return Wt(window,"onerror",{before:function(t,n,r,o,i){var s;if(i)s=ue(i),e(s,i);else{var a,u={url:n,column:o,line:r},c=t;if("[object String]"==={}.toString.call(t)){var f=un.exec(c);f&&(a=f[1],c=f[2])}e(s={name:a,message:"string"==typeof c?c:void 0,stack:[u]},t)}}})}(e).stop,n=function(e){return Wt(window,"onunhandledrejection",{before:function(t){var n=t.reason||"Empty reason",r=ue(n);e(r,n)}})}(e).stop;return{stop:function(){t(),n()}}}function fn(e){return cn((function(t,n){e.notify(function(e){var t=e.stackTrace,n=e.originalError,r=e.handlingStack,o=e.startClocks,i=e.nonErrorPrefix,s=e.source,a=e.handling;return t&&(void 0!==t.message||n instanceof Error)?{startClocks:o,source:s,handling:a,originalError:n,message:t.message||"Empty message",stack:Se(t),handlingStack:r,type:t.name,causes:Te(n,s)}:{startClocks:o,source:s,handling:a,originalError:n,message:"".concat(i," ").concat(m(n)),stack:"No stack, consider using an instance of Error",handlingStack:r,type:t&&t.name}}({stackTrace:t,originalError:n,startClocks:U(),nonErrorPrefix:"Uncaught",source:ke,handling:"unhandled"}))}))}var ln=function(){function e(){this.callbacks={}}return e.prototype.notify=function(e,t){var n=this.callbacks[e];n&&n.forEach((function(e){return e(t)}))},e.prototype.subscribe=function(e,t){var n=this;return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:function(){n.callbacks[e]=n.callbacks[e].filter((function(e){return t!==e}))}}},e}();var dn,pn,vn,hn,gn=function(n){var r,o,i=!1,a=M(),c={},f=function(){},l=new I,d=function(e,t,n,r){void 0===n&&(n=O(g())),void 0===r&&(r=A()),l.add((function(){return d(e,t,n,r)}))},p=function(){},h=new De((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return d.apply(void 0,e)}));function g(){return{view:{referrer:document.referrer,url:window.location.href},context:a.get()}}return r={logger:h,init:u((function(r){var o;if(H()&&(r=function(e){return v({},e,{clientToken:"empty"})}(r)),function(e){return!i||(e.silentMultipleInit||t.error("DD_LOGS is already initialized."),!1)}(r)){var s=function(t){var n=ie(t),r=qe(t.forwardConsoleLogs,x(e),"Forward Console Logs"),o=qe(t.forwardReports,x(Oe),"Forward Reports");if(n&&r&&o)return t.forwardErrorsToLogs&&!w(r,e.error)&&r.push(e.error),v({forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:o,requestErrorResponseLengthLimit:32768},n)}(r);s&&(o=n(r,s,g,h),d=o.handleLog,f=o.getInternalContext,p=function(){return O(r)},l.drain(),i=!0)}})),getLoggerGlobalContext:u(a.get),getGlobalContext:u(a.getContext),setLoggerGlobalContext:u(a.set),setGlobalContext:u(a.setContext),addLoggerGlobalContext:u(a.add),setGlobalContextProperty:u(a.setContextProperty),removeLoggerGlobalContext:u(a.remove),removeGlobalContextProperty:u(a.removeContextProperty),clearGlobalContext:u(a.clearContext),createLogger:u((function(e,t){return void 0===t&&(t={}),c[e]=new De((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return d.apply(void 0,e)}),e,t.handler,t.level,t.context),c[e]})),getLogger:u((function(e){return c[e]})),getInitConfiguration:u((function(){return p()})),getInternalContext:u((function(e){return f(e)}))},o=v({version:"4.23.0",onReady:function(e){e()}},r),Object.defineProperty(o,"_setDebug",{get:function(){return s},enumerable:!1}),o}((function(n,r,o,i){var s=new ln,a=function(e){return s.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:{origin:me},origin:me,status:Pe.error}})},u=function(e,t){var n,r=We("browser-logs-sdk",e);if(H()){var o=N();r.observable.subscribe((function(e){return o.send("internal_telemetry",e)}))}else{var i=ft(e,e.rumEndpointBuilder,t,null===(n=e.replica)||void 0===n?void 0:n.rumEndpointBuilder);r.observable.subscribe((function(t){return i.add(t,function(e){return"datad0g.com"===e.site}(e))}))}return r}(r,a);u.setContextProvider((function(){var e,t,n,r,o,i;return{application:{id:null===(e=Ut())||void 0===e?void 0:e.application_id},session:{id:null===(t=d.findTrackedSession())||void 0===t?void 0:t.id},view:{id:null===(r=null===(n=Ut())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(i=null===(o=Ut())||void 0===o?void 0:o.user_action)||void 0===i?void 0:i.id}}})),on(r,s),function(e,t){if(!e.forwardErrorsToLogs)return{stop:y};var n=new Le,r=fn(n).stop,o=n.subscribe((function(e){t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:{kind:e.type,origin:ke,stack:e.stack},origin:ke,status:Pe.error}})}))}(r,s),function(t,n){var r=Nt(t.forwardConsoleLogs).subscribe((function(t){n.notify(0,{rawLogsEvent:{date:A(),message:t.message,origin:be,error:t.api===e.error?{origin:be,stack:t.stack}:void 0,status:zt[t.api]}})}))}(r,s),function(e,t){var n=Be(e.forwardReports).subscribe((function(e){var n,r=e.message,o=$t[e.type];o===Pe.error?n={kind:e.subtype,origin:xe,stack:e.stack}:e.stack&&(r+=" Found in ".concat(function(e){var t;return null===(t=/@ (.+)/.exec(e))||void 0===t?void 0:t[1]}(e.stack))),t.notify(0,{rawLogsEvent:{date:A(),message:r,origin:xe,error:n,status:o}})}))}(r,s);var c,f=function(e){return{handleLog:function(n,r,o,i){var s=n.context;Pt(n.status,Ae,r)&&t(n.status,n.message,B(r.getContext(),s)),e.notify(0,{rawLogsEvent:{date:i||A(),message:n.message,status:n.status,origin:we},messageContext:s,savedCommonContext:o,logger:r})}}}(s).handleLog,d=!function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var n="dd_cookie_test_".concat(h()),r="test";$(n,r,l,e);var o=J(n)===r;return W(n,e),o}catch(e){return t.error(e),!1}}(r.cookieOptions)||H()||Fe()?function(e){var t="1"===qt(e)?{}:void 0;return{findTrackedSession:function(){return t}}}(r):Mt(r);return At(d,r,s,o,i,a),H()?function(e){var t=N();e.subscribe(1,(function(e){t.send("log",e)}))}(s):function(e,t,n){var r,o=ft(e,e.logsEndpointBuilder,n,null===(r=e.replica)||void 0===r?void 0:r.logsEndpointBuilder);t.subscribe(1,(function(e){o.add(e)}))}(r,s,a),function(e){Je.telemetryConfigurationEnabled&&Ke({type:ze,configuration:e})}(function(e){var t=function(e){return{session_sample_rate:e.sampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,use_before_send:!!e.beforeSend,use_cross_site_session_cookie:e.useCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:void 0!==e.proxyUrl?!!e.proxyUrl:void 0,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains}}(e);return v({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports},t)}(n)),{handleLog:f,getInternalContext:(c=d,{get:function(e){var t=c.findTrackedSession(e);if(t)return{session_id:t.id}}}).get}}));dn=E(),vn=gn,hn=dn[pn="DD_LOGS"],dn[pn]=vn,hn&&hn.q&&hn.q.forEach((function(e){return n(e,"onReady callback threw an error:")()}))}();
!function(){"use strict";var e={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},t=function(n){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];Object.prototype.hasOwnProperty.call(e,n)||(n=e.log),t[n].apply(t,r)};function n(e,n){return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];try{return e.apply(void 0,r)}catch(e){t.error(n,e)}}}t.debug=console.debug.bind(console),t.log=console.log.bind(console),t.info=console.info.bind(console),t.warn=console.warn.bind(console),t.error=console.error.bind(console);var r,o=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},i=!1;function s(e){i=e}function a(e,t,n){var o=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r?u(o):o;return n.apply(this,e)}}function u(e){return function(){return c(e,this,arguments)}}function c(t,n,o){try{return t.apply(n,o)}catch(t){if(f(e.error,t),r)try{r(t)}catch(t){f(e.error,t)}}}function f(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];i&&t.apply(void 0,o([e,"[MONITOR]"],n,!1))}var l=1e3,d=6e4;function p(e,t,n){var r,o,i=!n||void 0===n.leading||n.leading,s=!n||void 0===n.trailing||n.trailing,a=!1;return{throttled:function(){for(var n=[],u=0;u<arguments.length;u++)n[u]=arguments[u];a?r=n:(i?e.apply(void 0,n):r=n,a=!0,o=setTimeout((function(){s&&r&&e.apply(void 0,r),a=!1,r=void 0}),t))},cancel:function(){clearTimeout(o),a=!1,r=void 0}}}function v(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})),e}function h(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,h)}function g(e){return 0!==e&&100*Math.random()<=e}function y(){}function m(e,t,n){if("object"!=typeof e||null===e)return JSON.stringify(e);var r=b(Object.prototype),o=b(Array.prototype),i=b(Object.getPrototypeOf(e)),s=b(e);try{return JSON.stringify(e,t,n)}catch(e){return"<error: unable to serialize object>"}finally{r(),o(),i(),s()}}function b(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):y}function w(e,t){return-1!==e.indexOf(t)}function C(e){if(Array.from)return Array.from(e);var t=[];if(e instanceof Set)e.forEach((function(e){return t.push(e)}));else for(var n=0;n<e.length;n++)t.push(e[n]);return t}function k(e){return function(e){return"number"==typeof e}(e)&&e>=0&&e<=100}function x(e){return Object.keys(e).map((function(t){return e[t]}))}function S(e,t){return e.slice(0,t.length)===t}function E(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var e=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof e&&(e="object"==typeof self?self:"object"==typeof window?window:{}),e}function R(e,t,n){void 0===n&&(n="");var r=e.charCodeAt(t-1),o=r>=55296&&r<=56319?t+1:t;return e.length<=o?e:"".concat(e.slice(0,o)).concat(n)}function T(e,t,n,r){return _(e,[t],n,r)}function _(e,t,n,r){var o=void 0===r?{}:r,i=o.once,s=o.capture,a=o.passive,c=u(i?function(e){l(),n(e)}:n),f=a?{capture:s,passive:a}:s;t.forEach((function(t){return e.addEventListener(t,c,f)}));var l=function(){return t.forEach((function(t){return e.removeEventListener(t,c,f)}))};return{stop:l}}function L(e,t,n){if(void 0===n&&(n=function(){if("undefined"!=typeof WeakSet){var e=new WeakSet;return{hasAlreadyBeenSeen:function(t){var n=e.has(t);return n||e.add(t),n}}}var t=[];return{hasAlreadyBeenSeen:function(e){var n=t.indexOf(e)>=0;return n||t.push(e),n}}}()),void 0===t)return e;if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){var r=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,r)}if(!n.hasAlreadyBeenSeen(t)){if(Array.isArray(t)){for(var o=Array.isArray(e)?e:[],i=0;i<t.length;++i)o[i]=L(o[i],t[i],n);return o}var s,a="object"==(null===(s=e)?"null":Array.isArray(s)?"array":typeof s)?e:{};for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(a[u]=L(a[u],t[u],n));return a}}function O(e){return L(void 0,e)}function B(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=0,o=t;r<o.length;r++){var i=o[r];null!=i&&(e=L(e,i))}return e}function q(){var e={};return{get:function(){return e},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},set:function(t){e=t},getContext:function(){return O(e)},setContext:function(t){e=O(t)},setContextProperty:function(t,n){e[t]=O(n)},removeContextProperty:function(t){delete e[t]},clearContext:function(){e={}}}}var M,P=function(){function e(){this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>500&&this.buffer.splice(0,1)},e.prototype.drain=function(){this.buffer.forEach((function(e){return e()})),this.buffer.length=0},e}();function I(){return(new Date).getTime()}function A(){return I()}function j(){return performance.now()}function U(){return{relative:j(),timeStamp:A()}}function D(e,t){return t-e}function F(){return void 0===M&&(M=performance.timing.navigationStart),M}function N(){var e=E().DatadogEventBridge;if(e)return{getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,n){e.send(JSON.stringify({eventType:t,event:n}))}}}function H(e){var t;void 0===e&&(e=null===(t=E().location)||void 0===t?void 0:t.hostname);var n=N();return!!n&&n.getAllowedWebViewHosts().some((function(t){return e===t||(n=e,r=".".concat(t),n.slice(-r.length)===r);var n,r}))}var z,G,V;function $(e,t,n,r){var o=new Date;o.setTime(o.getTime()+n);var i="expires=".concat(o.toUTCString()),s=r&&r.crossSite?"none":"strict",a=r&&r.domain?";domain=".concat(r.domain):"",u=r&&r.secure?";secure":"";document.cookie="".concat(e,"=").concat(t,";").concat(i,";path=/;samesite=").concat(s).concat(a).concat(u)}function J(e){return function(e,t){var n=new RegExp("(?:^|;)\\s*".concat(t,"\\s*=\\s*([^;]+)")).exec(e);return n?n[1]:void 0}(document.cookie,e)}function W(e,t){$(e,"",0,t)}function X(){return G||new Set}function Y(e){return K(e,function(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return"".concat(e.protocol,"//").concat(t)}(window.location)).href}function K(e,t){if(function(){if(void 0!==V)return V;try{var e=new URL("http://test/path");return V="http://test/path"===e.href}catch(e){V=!1}return V}())return void 0!==t?new URL(e,t):new URL(e);if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: '".concat(e,"'"));var n=document,r=n.createElement("a");if(void 0!==t){var o=(n=document.implementation.createHTMLDocument("")).createElement("base");o.href=t,n.head.appendChild(o),n.body.appendChild(r)}return r.href=e,r}var Q="datadoghq.com",Z={logs:"logs",rum:"rum",sessionReplay:"session-replay"},ee={logs:"logs",rum:"rum",sessionReplay:"replay"};function te(e,t,n){var r=e.site,o=void 0===r?Q:r,i=e.clientToken,s=o.split("."),a=s.pop(),u="".concat(Z[t],".browser-intake-").concat(s.join("-"),".").concat(a),c="https://".concat(u,"/api/v2/").concat(ee[t]),f=e.proxyUrl&&Y(e.proxyUrl);return{build:function(){var e="ddsource=browser"+"&ddtags=".concat(encodeURIComponent(["sdk_version:".concat("4.23.1")].concat(n).join(",")))+"&dd-api-key=".concat(i)+"&dd-evp-origin-version=".concat(encodeURIComponent("4.23.1"))+"&dd-evp-origin=browser"+"&dd-request-id=".concat(h());"rum"===t&&(e+="&batch_time=".concat(A()));var r="".concat(c,"?").concat(e);return f?"".concat(f,"?ddforward=").concat(encodeURIComponent(r)):r},buildIntakeUrl:function(){return f?"".concat(f,"?ddforward"):c},endpointType:t}}var ne=/[^a-z0-9_:./-]/;function re(e,n){var r=200-e.length-1;(n.length>r||ne.test(n))&&t.warn("".concat(e," value doesn't meet tag requirements and will be sanitized"));var o=n.replace(/,/g,"_");return"".concat(e,":").concat(o)}function oe(e){var t=function(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,i=[];return t&&i.push(re("env",t)),n&&i.push(re("service",n)),r&&i.push(re("version",r)),o&&i.push(re("datacenter",o)),i}(e),n=function(e,t){return{logsEndpointBuilder:te(e,"logs",t),rumEndpointBuilder:te(e,"rum",t),sessionReplayEndpointBuilder:te(e,"sessionReplay",t)}}(e,t),r=x(n).map((function(e){return e.buildIntakeUrl()})),o=function(e,t,n){if(!e.replica)return;var r=v({},e,{site:Q,clientToken:e.replica.clientToken}),o={logsEndpointBuilder:te(r,"logs",n),rumEndpointBuilder:te(r,"rum",n)};return t.push.apply(t,x(o).map((function(e){return e.buildIntakeUrl()}))),v({applicationId:e.replica.applicationId},o)}(e,r,t);return v({isIntakeUrl:function(e){return r.some((function(t){return 0===e.indexOf(t)}))},replica:o,site:e.site||Q},n)}function ie(e){var r,o,i;if(e&&e.clientToken)if(void 0===e.sampleRate||k(e.sampleRate))if(void 0===e.telemetrySampleRate||k(e.telemetrySampleRate)){var s;if(void 0===e.telemetryConfigurationSampleRate||k(e.telemetryConfigurationSampleRate))return s=e.enableExperimentalFeatures,Array.isArray(s)&&(G||(G=new Set(s)),s.filter((function(e){return"string"==typeof e})).forEach((function(e){w(e,"-")&&t.warn("please use snake case for '".concat(e,"'")),G.add(e)}))),v({beforeSend:e.beforeSend&&n(e.beforeSend,"beforeSend threw an error:"),cookieOptions:se(e),sampleRate:null!==(r=e.sampleRate)&&void 0!==r?r:100,telemetrySampleRate:null!==(o=e.telemetrySampleRate)&&void 0!==o?o:20,telemetryConfigurationSampleRate:null!==(i=e.telemetryConfigurationSampleRate)&&void 0!==i?i:5,service:e.service,silentMultipleInit:!!e.silentMultipleInit,batchBytesLimit:16384,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:3e4,batchMessagesLimit:50,messageBytesLimit:262144},oe(e));t.error("Telemetry Configuration Sample Rate should be a number between 0 and 100")}else t.error("Telemetry Sample Rate should be a number between 0 and 100");else t.error("Sample Rate should be a number between 0 and 100");else t.error("Client Token is not configured, we will not send any data.")}function se(e){var t={};return t.secure=function(e){return!!e.useSecureSessionCookie||!!e.useCrossSiteSessionCookie}(e),t.crossSite=!!e.useCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===z){for(var e="dd_site_test_".concat(h()),t=window.location.hostname.split("."),n=t.pop();t.length&&!J(e);)n="".concat(t.pop(),".").concat(n),$(e,"test",l,{domain:n});W(e,{domain:n}),z=n}return z}()),t}var ae="?";function ue(e){var t=[],n=ye(e,"stack"),r=String(e);return n&&S(n,r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((function(e){var n=function(e){var t=le.exec(e);if(!t)return;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),o=de.exec(t[2]);r&&o&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]);return{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||ae,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){var t=pe.exec(e);if(!t)return;return{args:[],column:t[3]?+t[3]:void 0,func:ae,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){var t=ve.exec(e);if(!t)return;return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||ae,line:+t[3],url:t[2]}}(e)||function(e){var t=he.exec(e);if(!t)return;var n=t[3]&&t[3].indexOf(" > eval")>-1,r=ge.exec(t[3]);n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0);return{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||ae,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=ae),t.push(n))})),{message:ye(e,"message"),name:ye(e,"name"),stack:t}}var ce="((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\\w+\\.|\\/).*?)",fe="(?::(\\d+))",le=new RegExp("^\\s*at (.*?) ?\\(".concat(ce).concat(fe,"?").concat(fe,"?\\)?\\s*$"),"i"),de=new RegExp("\\((\\S*)".concat(fe).concat(fe,"\\)"));var pe=new RegExp("^\\s*at ?".concat(ce).concat(fe,"?").concat(fe,"??\\s*$"),"i");var ve=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var he=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,ge=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function ye(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}var me="agent",be="console",we="logger",Ce="network",ke="source",xe="report";function Se(e){var t=Ee(e);return e.stack.forEach((function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"(".concat(e.args.join(", "),")"):"",o=e.line?":".concat(e.line):"",i=e.line&&e.column?":".concat(e.column):"";t+="\n at ".concat(n).concat(r," @ ").concat(e.url).concat(o).concat(i)})),t}function Ee(e){return"".concat(e.name||"Error",": ").concat(e.message)}function Re(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return c((function(){var n=ue(t);n.stack=n.stack.slice(2),e=Se(n)})),e}function Te(e,t){for(var n=e,r=[];(null==n?void 0:n.cause)instanceof Error&&r.length<10;){var o=ue(n.cause);r.push({message:n.cause.message,source:t,type:null==o?void 0:o.name,stack:o&&Se(o)}),n=n.cause}return r.length?r:void 0}var _e=function(){function e(e){this.onFirstSubscribe=e,this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return!this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe()||void 0),this.observers.push(e),{unsubscribe:function(){t.observers=t.observers.filter((function(t){return e!==t})),!t.observers.length&&t.onLastUnsubscribe&&t.onLastUnsubscribe()}}},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}();function Le(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=new _e((function(){var t=e.map((function(e){return e.subscribe((function(e){return n.notify(e)}))}));return function(){return t.forEach((function(e){return e.unsubscribe()}))}}));return n}var Oe={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Be(e){var t,n=[];w(e,Oe.cspViolation)&&n.push(t=new _e((function(){var e=u((function(e){t.notify(function(e){var t=Oe.cspViolation,n="'".concat(e.blockedURI,"' blocked by '").concat(e.effectiveDirective,"' directive");return{type:Oe.cspViolation,subtype:e.effectiveDirective,message:"".concat(t,": ").concat(n),stack:qe(e.effectiveDirective,e.originalPolicy?"".concat(n,' of the policy "').concat(R(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber)}}(e))}));return T(document,"securitypolicyviolation",e).stop})));var r=e.filter((function(e){return e!==Oe.cspViolation}));return r.length&&n.push(function(e){var t=new _e((function(){if(window.ReportingObserver){var n=u((function(e){return e.forEach((function(e){t.notify(function(e){var t=e.type,n=e.body;return{type:t,subtype:n.id,message:"".concat(t,": ").concat(n.message),stack:qe(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)}}(e))}))})),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),function(){r.disconnect()}}}));return t}(r)),Le.apply(void 0,n)}function qe(e,t,n,r,o){return n&&Se({name:e,message:t,stack:[{func:"?",url:n,line:r,column:o}]})}function Me(e,n,r){return void 0===e?[]:"all"===e||Array.isArray(e)&&e.every((function(e){return w(n,e)}))?"all"===e?n:(o=e,i=new Set,o.forEach((function(e){return i.add(e)})),C(i)):void t.error("".concat(r,' should be "all" or an array with allowed values "').concat(n.join('", "'),'"'));var o,i}var Pe=function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},Ie={debug:"debug",error:"error",info:"info",warn:"warn"},Ae="console",je="http",Ue=Object.keys(Ie),De=function(){function e(e,t,n,r,o){void 0===n&&(n=je),void 0===r&&(r=Ie.debug),void 0===o&&(o={}),this.handleLogStrategy=e,this.handlerType=n,this.level=r,this.contextManager=q(),this.contextManager.set(v({},o,t?{logger:{name:t}}:void 0))}return e.prototype.log=function(e,t,n){void 0===n&&(n=Ie.info),this.handleLogStrategy({message:e,context:O(t),status:n},this)},e.prototype.debug=function(e,t){this.log(e,t,Ie.debug)},e.prototype.info=function(e,t){this.log(e,t,Ie.info)},e.prototype.warn=function(e,t){this.log(e,t,Ie.warn)},e.prototype.error=function(e,t){var n={error:{origin:we}};this.log(e,B(n,t),Ie.error)},e.prototype.setContext=function(e){this.contextManager.set(e)},e.prototype.getContext=function(){return this.contextManager.get()},e.prototype.addContext=function(e,t){this.contextManager.add(e,t)},e.prototype.removeContext=function(e){this.contextManager.remove(e)},e.prototype.setHandler=function(e){this.handlerType=e},e.prototype.getHandler=function(){return this.handlerType},e.prototype.setLevel=function(e){this.level=e},e.prototype.getLevel=function(){return this.level},Pe([a],e.prototype,"log",null),e}();function Fe(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||J("datadog-synthetics-injects-rum"))}function Ne(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||J("datadog-synthetics-result-id");return"string"==typeof e?e:void 0}var He,ze="log",Ge="configuration",Ve=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","http://localhost","<anonymous>"],$e=["ddog-gov.com"],Je={maxEventsPerPage:0,sentEventCount:0,telemetryEnabled:!1,telemetryConfigurationEnabled:!1};function We(e,t){var n,o=new _e;return Je.telemetryEnabled=g(t.telemetrySampleRate),Je.telemetryConfigurationEnabled=Je.telemetryEnabled&&g(t.telemetryConfigurationSampleRate),He=function(r){!w($e,t.site)&&Je.telemetryEnabled&&o.notify(function(e,t){return B({type:"telemetry",date:A(),service:e,version:"4.23.1",source:"browser",_dd:{format_version:2},telemetry:t,experimental_features:C(X())},void 0!==n?n():{})}(e,r))},r=Ye,v(Je,{maxEventsPerPage:t.maxTelemetryEventsPerPage,sentEventCount:0}),{setContextProvider:function(e){n=e},observable:o}}function Xe(t,n){f(e.debug,t,n),Ke(v({type:ze,message:t,status:"debug"},n))}function Ye(e){Ke(v({type:ze,status:"error"},function(e){if(e instanceof Error){var t=ue(e);return{error:{kind:t.name,stack:Se(Qe(t))},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught ".concat(m(e))}}(e)))}function Ke(e){He&&Je.sentEventCount<Je.maxEventsPerPage&&(Je.sentEventCount+=1,He(e))}function Qe(e){return e.stack=e.stack.filter((function(e){return!e.url||Ve.some((function(t){return S(e.url,t)}))})),e}var Ze=/[^\u0000-\u007F]/,et=function(){function e(e,t,n,r,o,i){void 0===i&&(i=y),this.request=e,this.batchMessagesLimit=t,this.batchBytesLimit=n,this.messageBytesLimit=r,this.flushTimeout=o,this.beforeUnloadCallback=i,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesCount=0,this.bufferMessagesCount=0,this.setupFlushOnExit(),this.flushPeriodically()}return e.prototype.add=function(e){this.addOrUpdate(e)},e.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},e.prototype.flush=function(e){if(void 0===e&&(e=this.request.send),0!==this.bufferMessagesCount){var t=this.pushOnlyBuffer.concat(x(this.upsertBuffer)),n=this.bufferBytesCount;this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesCount=0,this.bufferMessagesCount=0,e({data:t.join("\n"),bytesCount:n})}},e.prototype.flushOnExit=function(){this.flush(this.request.sendOnExit)},e.prototype.computeBytesCount=function(e){return Ze.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length},e.prototype.addOrUpdate=function(e,n){var r=this.process(e),o=r.processedMessage,i=r.messageBytesCount;i>=this.messageBytesLimit?t.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(this.messageBytesLimit,"KB.")):(this.hasMessageFor(n)&&this.remove(n),this.willReachedBytesLimitWith(i)&&this.flush(),this.push(o,i,n),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=m(e);return{processedMessage:t,messageBytesCount:this.computeBytesCount(t)}},e.prototype.push=function(e,t,n){this.bufferMessagesCount>0&&(this.bufferBytesCount+=1),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.bufferBytesCount+=t,this.bufferMessagesCount+=1},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.computeBytesCount(t);this.bufferBytesCount-=n,this.bufferMessagesCount-=1,this.bufferMessagesCount>0&&(this.bufferBytesCount-=1)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e.prototype.willReachedBytesLimitWith=function(e){return this.bufferBytesCount+e+1>=this.batchBytesLimit},e.prototype.isFull=function(){return this.bufferMessagesCount===this.batchMessagesLimit||this.bufferBytesCount>=this.batchBytesLimit},e.prototype.flushPeriodically=function(){var e=this;setTimeout(u((function(){e.flush(),e.flushPeriodically()})),this.flushTimeout)},e.prototype.setupFlushOnExit=function(){var e=this;navigator.sendBeacon&&(T(window,"beforeunload",this.beforeUnloadCallback),T(document,"visibilitychange",(function(){"hidden"===document.visibilityState&&e.flushOnExit()})),T(window,"beforeunload",(function(){return e.flushOnExit()})))},e}(),tt=3145728;function nt(e,t,n,r,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?ot(e,t,n,{onSuccess:function(){return it(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),rt(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function rt(e,t,n,r){2===e.transportStatus&&setTimeout(u((function(){var o=e.queuedPayloads.first();o||Xe("no payload to retry",{debug:{queue:{size:e.queuedPayloads.size(),is_full:e.queuedPayloads.isFull(),bytes_count:e.queuedPayloads.bytesCount},transport_status:e.transportStatus}}),ot(o,e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=1e3,it(1,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(6e4,2*e.currentBackoffTime),rt(e,t,n,r)}})})),e.currentBackoffTime)}function ot(e,t,n,r){var o=r.onSuccess,i=r.onFailure;t.bandwidthMonitor.add(e),n(e,(function(n){t.bandwidthMonitor.remove(e),!function(e){return 0===e.status||408===e.status||429===e.status||e.status>=500}(n)?(t.transportStatus=0,o()):(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,i())}))}function it(e,t,n,r,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(3,"MiB"),source:me,startClocks:U()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=st();i.size()>0;)nt(i.dequeue(),t,n,r,o)}function st(){var e=[];return{bytesCount:0,enqueue:function(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first:function(){return e[0]},dequeue:function(){var t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size:function(){return e.length},isFull:function(){return this.bytesCount>=tt}}}function at(e,t,n){var r={transportStatus:0,currentBackoffTime:1e3,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=81920&&this.ongoingRequestCount<32},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:st(),queueFullReported:!1},o=function(n,r){return function(e,t,n,r){var o=n.data,i=n.bytesCount,s=e.build();(function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(e){return!1}})()&&i<t?fetch(s,{method:"POST",body:o,keepalive:!0}).then(u((function(e){return null==r?void 0:r({status:e.status})})),u((function(){ct(s,o,r)}))):ct(s,o,r)}(e,t,n,r)};return{send:function(t){nt(t,r,o,e.endpointType,n)},sendOnExit:function(n){!function(e,t,n){var r=n.data,o=n.bytesCount,i=e.build();if(navigator.sendBeacon&&o<t)try{if(navigator.sendBeacon(i,r))return}catch(e){!function(e){ut||(ut=!0,Ye(e))}(e)}ct(i,r)}(e,t,n)}}}var ut=!1;function ct(e,t,n){var r=new XMLHttpRequest;r.open("POST",e,!0),r.send(t),r.addEventListener("loadend",u((function(){null==n||n({status:r.status})})))}function ft(e,t,n,r){var o,i=s(t);function s(t){return new et(at(t,e.batchBytesLimit,n),e.batchMessagesLimit,e.batchBytesLimit,e.messageBytesLimit,e.flushTimeout)}return r&&(o=s(r)),{add:function(e,t){void 0===t&&(t=!0),i.add(e),o&&t&&o.add(e)}}}var lt=1/0,dt=function(){function e(e){var t=this;this.expireDelay=e,this.entries=[],this.clearOldContextsInterval=setInterval((function(){return t.clearOldContexts()}),6e4)}return e.prototype.add=function(e,t){var n=this,r={context:e,startTime:t,endTime:lt,remove:function(){var e=n.entries.indexOf(r);e>=0&&n.entries.splice(e,1)},close:function(e){r.endTime=e}};return this.entries.unshift(r),r},e.prototype.find=function(e){void 0===e&&(e=lt);for(var t=0,n=this.entries;t<n.length;t++){var r=n[t];if(r.startTime<=e){if(e<=r.endTime)return r.context;break}}},e.prototype.closeActive=function(e){var t=this.entries[0];t&&t.endTime===lt&&t.close(e)},e.prototype.findAll=function(e){return void 0===e&&(e=lt),this.entries.filter((function(t){return t.startTime<=e&&e<=t.endTime})).map((function(e){return e.context}))},e.prototype.reset=function(){this.entries=[]},e.prototype.stop=function(){clearInterval(this.clearOldContextsInterval)},e.prototype.clearOldContexts=function(){for(var e=j()-this.expireDelay;this.entries.length>0&&this.entries[this.entries.length-1].endTime<e;)this.entries.pop()},e}();var pt,vt=144e5,ht=9e5,gt=/^([a-z]+)=([a-z0-9-]+)$/,yt="&",mt="_dd_s",bt=[];function wt(e,t){var n;if(void 0===t&&(t=0),pt||(pt=e),e===pt)if(t>=100)xt();else{var r,o=Rt();if(Ct()){if(o.lock)return void kt(e,t);if(r=h(),o.lock=r,Et(o,e.options),(o=Rt()).lock!==r)return void kt(e,t)}var i=e.process(o);if(Ct()&&(o=Rt()).lock!==r)kt(e,t);else{if(i&&St(i,e.options),Ct()&&(!i||!Tt(i))){if((o=Rt()).lock!==r)return void kt(e,t);delete o.lock,Et(o,e.options),i=o}null===(n=e.after)||void 0===n||n.call(e,i||o),xt()}}else bt.push(e)}function Ct(){return!!window.chrome||/HeadlessChrome/.test(window.navigator.userAgent)}function kt(e,t){setTimeout(u((function(){wt(e,t+1)})),10)}function xt(){pt=void 0;var e=bt.shift();e&&wt(e)}function St(e,t){Tt(e)?function(e){$(mt,"",0,e)}(t):(e.expire=String(I()+ht),Et(e,t))}function Et(e,t){$(mt,function(e){return(t=e,Object.keys(t).map((function(e){return[e,t[e]]}))).map((function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)})).join(yt);var t}(e),ht,t)}function Rt(){var e=J(mt),t={};return function(e){return void 0!==e&&(-1!==e.indexOf(yt)||gt.test(e))}(e)&&e.split(yt).forEach((function(e){var n=gt.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}})),t}function Tt(e){return t=e,0===Object.keys(t).length;var t}function _t(e,t,n){var r=new _e,o=new _e,i=setInterval(u((function(){wt({options:e,process:function(e){return f(e)?void 0:{}},after:a})})),1e3),s=function(){var e=Rt();if(f(e))return e;return{}}();function a(e){return f(e)||(e={}),c()&&(!function(e){return s.id!==e.id||s[t]!==e[t]}(e)?s=e:(s={},o.notify())),e}function c(){return void 0!==s[t]}function f(e){return(void 0===e.created||I()-Number(e.created)<vt)&&(void 0===e.expire||I()<Number(e.expire))}return{expandOrRenewSession:p(u((function(){var o;wt({options:e,process:function(e){var r=a(e);return o=function(e){var r=n(e[t]),o=r.trackingType,i=r.isTracked;e[t]=o,i&&!e.id&&(e.id=h(),e.created=String(I()));return i}(r),r},after:function(e){o&&!c()&&function(e){s=e,r.notify()}(e),s=e}})})),1e3).throttled,expandSession:function(){wt({options:e,process:function(e){return c()?a(e):void 0}})},getSession:function(){return s},renewObservable:r,expireObservable:o,stop:function(){clearInterval(i)}}}var Lt=[];function Ot(e,t,n){!function(e){var t=J(mt),n=J("_dd"),r=J("_dd_r"),o=J("_dd_l");if(!t){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i.logs=o),r&&/^[012]$/.test(r)&&(i.rum=r),St(i,e)}}(e);var r=_t(e,t,n);Lt.push((function(){return r.stop()}));var o,i=new dt(144e5);function s(){return{id:r.getSession().id,trackingType:r.getSession()[t]}}return Lt.push((function(){return i.stop()})),r.renewObservable.subscribe((function(){i.add(s(),j())})),r.expireObservable.subscribe((function(){i.closeActive(j())})),r.expandOrRenewSession(),i.add(s(),[0,F()][0]),o=_(window,["click","touchstart","keydown","scroll"],(function(){return r.expandOrRenewSession()}),{capture:!0,passive:!0}).stop,Lt.push(o),function(e){var t=u((function(){"visible"===document.visibilityState&&e()})),n=T(document,"visibilitychange",t).stop;Lt.push(n);var r=setInterval(t,6e4);Lt.push((function(){clearInterval(r)}))}((function(){return r.expandSession()})),{findActiveSession:function(e){return i.find(e)},renewObservable:r.renewObservable,expireObservable:r.expireObservable}}var Bt;function qt(e){var t=Ot(e.cookieOptions,"logs",(function(t){return function(e,t){var n=function(e){return"0"===e||"1"===e}(t)?t:Mt(e);return{trackingType:n,isTracked:"1"===n}}(e,t)}));return{findTrackedSession:function(e){var n=t.findActiveSession(e);return n&&"1"===n.trackingType?{id:n.id}:void 0}}}function Mt(e){return g(e.sampleRate)?"1":"0"}var Pt=((Bt={})[Ie.debug]=0,Bt[Ie.info]=1,Bt[Ie.warn]=2,Bt[Ie.error]=3,Bt);function It(e,t,n){var r=n.getHandler(),o=Array.isArray(r)?r:[r];return Pt[e]>=Pt[n.getLevel()]&&w(o,t)}function At(e,t,n,r,o,i){var s=Ue.concat(["custom"]),a={};s.forEach((function(e){var n,r,o,s,u;a[e]=(n=e,r=t.eventRateLimiterThreshold,o=i,s=0,u=!1,{isLimitReached:function(){if(0===s&&setTimeout((function(){s=0}),d),(s+=1)<=r||u)return u=!1,!1;if(s===r+1){u=!0;try{o({message:"Reached max number of ".concat(n,"s by minute: ").concat(r),source:me,startClocks:U()})}finally{u=!1}}return!0}})})),n.subscribe(0,(function(i){var s,u,c,f=i.rawLogsEvent,l=i.messageContext,d=void 0===l?void 0:l,p=i.savedCommonContext,v=void 0===p?void 0:p,h=i.logger,g=void 0===h?o:h,y=f.date-F(),m=e.findTrackedSession(y);if(m){var b=v||r(),w=B({service:t.service,session_id:m.id,view:b.view},b.context,Ut(y),f,g.getContext(),d);!It(f.status,je,g)||!1===(null===(s=t.beforeSend)||void 0===s?void 0:s.call(t,w))||(null===(u=w.error)||void 0===u?void 0:u.origin)!==me&&(null!==(c=a[w.status])&&void 0!==c?c:a.custom).isLimitReached()||n.notify(1,w)}}))}var jt=!1;function Ut(e){var t,n=window;if(Fe()){var r=o(n.DD_RUM_SYNTHETICS);return r||jt||(jt=!0,Xe("Logs sent before RUM is injected by the synthetics worker",{testId:(t=window._DATADOG_SYNTHETICS_PUBLIC_ID||J("datadog-synthetics-public-id"),"string"==typeof t?t:void 0),resultId:Ne()})),r}return o(n.DD_RUM);function o(t){if(t&&t.getInternalContext)return t.getInternalContext(e)}}var Dt,Ft={};function Nt(e){var t=e.map((function(e){return Ft[e]||(Ft[e]=function(e){var t=new _e((function(){var n=console[e];return console[e]=function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];n.apply(console,r);var i=Re();c((function(){t.notify(Ht(r,e,i))}))},function(){console[e]=n}}));return t}(e)),Ft[e]}));return Le.apply(void 0,t)}function Ht(t,n,r){var o,i=t.map((function(e){return function(e){if("string"==typeof e)return e;if(e instanceof Error)return Ee(ue(e));return m(e,void 0,2)}(e)})).join(" ");if(n===e.error){var s=function(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n))return r}}(t,(function(e){return e instanceof Error}));o=s?Se(ue(s)):void 0,i="console error: ".concat(i)}return{api:n,message:i,stack:o,handlingStack:r}}var zt,Gt=((Dt={})[e.log]=Ie.info,Dt[e.debug]=Ie.debug,Dt[e.info]=Ie.info,Dt[e.warn]=Ie.warn,Dt[e.error]=Ie.error,Dt);var Vt,$t=((zt={})[Oe.cspViolation]=Ie.error,zt[Oe.intervention]=Ie.error,zt[Oe.deprecation]=Ie.warn,zt);function Jt(e,t,n){var r=e[t],o=n(r),i=function(){if("function"==typeof o)return o.apply(this,arguments)};return e[t]=i,{stop:function(){e[t]===i?e[t]=r:o=r}}}function Wt(e,t,n){var r=n.before,o=n.after;return Jt(e,t,(function(e){return function(){var t,n=arguments;return r&&c(r,this,n),"function"==typeof e&&(t=e.apply(this,n)),o&&c(o,this,n),t}}))}var Xt,Yt=new WeakMap;function Kt(){var e;return Vt||(e=new _e((function(){var t=Wt(XMLHttpRequest.prototype,"open",{before:Qt}).stop,n=Wt(XMLHttpRequest.prototype,"send",{before:function(){Zt.call(this,e)}}).stop,r=Wt(XMLHttpRequest.prototype,"abort",{before:en}).stop;return function(){t(),n(),r()}})),Vt=e),Vt}function Qt(e,t){Yt.set(this,{state:"open",method:e,url:Y(String(t))})}function Zt(e){var t=this,n=Yt.get(this);if(n){var r=n;r.state="start",r.startTime=j(),r.startClocks=U(),r.isAborted=!1,r.xhr=this;var o=!1,i=Wt(this,"onreadystatechange",{before:function(){this.readyState===XMLHttpRequest.DONE&&s()}}).stop,s=u((function(){if(t.removeEventListener("loadend",s),i(),!o){o=!0;var a=n;a.state="complete",a.duration=D(r.startClocks.timeStamp,A()),a.status=t.status,e.notify(v({},a))}}));this.addEventListener("loadend",s),e.notify(r)}}function en(){var e=Yt.get(this);e&&(e.isAborted=!0)}function tn(){var e;return Xt||(e=new _e((function(){if(window.fetch)return Jt(window,"fetch",(function(t){return function(n,r){var o,i=c(nn,null,[e,n,r]);return i?(o=t.call(this,i.input,i.init),c(rn,null,[e,o,i])):o=t.call(this,n,r),o}})).stop})),Xt=e),Xt}function nn(e,t,n){var r=n&&n.method||"object"==typeof t&&t.method||"GET",o=Y("object"==typeof t&&t.url||t),i={state:"start",init:n,input:t,method:r,startClocks:U(),url:o};return e.notify(i),i}function rn(e,t,n){var r=function(t){var r=n;r.state="complete",r.duration=D(r.startClocks.timeStamp,A()),"stack"in t||t instanceof Error?(r.status=0,r.isAborted=t instanceof DOMException&&t.code===DOMException.ABORT_ERR,r.error=t,e.notify(r)):"status"in t&&(r.response=t,r.responseType=t.type,r.status=t.status,r.isAborted=!1,e.notify(r))};t.then(u(r),u(r))}function on(e,t){if(!e.forwardErrorsToLogs)return{stop:y};var n=Kt().subscribe((function(e){"complete"===e.state&&o("xhr",e)})),r=tn().subscribe((function(e){"complete"===e.state&&o("fetch",e)}));function o(n,r){function o(e){t.notify(0,{rawLogsEvent:{message:"".concat(an(n)," error ").concat(r.method," ").concat(r.url),date:r.startClocks.timeStamp,error:{origin:Ce,stack:e||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url},status:Ie.error,origin:Ce}})}e.isIntakeUrl(r.url)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!function(e){return e.status>=500}(r)||("xhr"in r?function(e,t,n){"string"==typeof e.response?n(sn(e.response,t)):n(e.response)}(r.xhr,e,o):r.response?function(e,t,n){window.TextDecoder?e.body?function(e,t,n){!function(e,t,n){var r=e.getReader(),o=[],i=0;function s(){r.read().then(u((function(e){e.done?a():(o.push(e.value),(i+=e.value.length)>t?a():s())})),u((function(e){return n(e)})))}function a(){var e;if(r.cancel().catch(y),1===o.length)e=o[0];else{e=new Uint8Array(i);var s=0;o.forEach((function(t){e.set(t,s),s+=t.length}))}n(void 0,e.slice(0,t),e.length>t)}s()}(e,t,(function(e,t,r){if(e)n(e);else{var o=(new TextDecoder).decode(t);r&&(o+="..."),n(void 0,o)}}))}(e.clone().body,t.requestErrorResponseLengthLimit,(function(e,t){n(e?"Unable to retrieve response: ".concat(e):t)})):n():e.clone().text().then(u((function(e){return n(sn(e,t))})),u((function(e){return n("Unable to retrieve response: ".concat(e))})))}(r.response,e,o):r.error&&function(e,t,n){n(sn(Se(ue(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function sn(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function an(e){return"xhr"===e?"XHR":"Fetch"}var un=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function cn(e){var t=function(e){return Wt(window,"onerror",{before:function(t,n,r,o,i){var s;if(i)s=ue(i),e(s,i);else{var a,u={url:n,column:o,line:r},c=t;if("[object String]"==={}.toString.call(t)){var f=un.exec(c);f&&(a=f[1],c=f[2])}e(s={name:a,message:"string"==typeof c?c:void 0,stack:[u]},t)}}})}(e).stop,n=function(e){return Wt(window,"onunhandledrejection",{before:function(t){var n=t.reason||"Empty reason",r=ue(n);e(r,n)}})}(e).stop;return{stop:function(){t(),n()}}}function fn(e){return cn((function(t,n){e.notify(function(e){var t=e.stackTrace,n=e.originalError,r=e.handlingStack,o=e.startClocks,i=e.nonErrorPrefix,s=e.source,a=e.handling;return t&&(void 0!==t.message||n instanceof Error)?{startClocks:o,source:s,handling:a,originalError:n,message:t.message||"Empty message",stack:Se(t),handlingStack:r,type:t.name,causes:Te(n,s)}:{startClocks:o,source:s,handling:a,originalError:n,message:"".concat(i," ").concat(m(n)),stack:"No stack, consider using an instance of Error",handlingStack:r,type:t&&t.name}}({stackTrace:t,originalError:n,startClocks:U(),nonErrorPrefix:"Uncaught",source:ke,handling:"unhandled"}))}))}var ln=function(){function e(){this.callbacks={}}return e.prototype.notify=function(e,t){var n=this.callbacks[e];n&&n.forEach((function(e){return e(t)}))},e.prototype.subscribe=function(e,t){var n=this;return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:function(){n.callbacks[e]=n.callbacks[e].filter((function(e){return t!==e}))}}},e}();var dn,pn,vn,hn,gn=function(n){var r,o,i=!1,a=q(),c={},f=function(){},l=new P,d=function(e,t,n,r){void 0===n&&(n=O(g())),void 0===r&&(r=A()),l.add((function(){return d(e,t,n,r)}))},p=function(){},h=new De((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return d.apply(void 0,e)}));function g(){return{view:{referrer:document.referrer,url:window.location.href},context:a.get()}}return r={logger:h,init:u((function(r){var o;if(H()&&(r=function(e){return v({},e,{clientToken:"empty"})}(r)),function(e){return!i||(e.silentMultipleInit||t.error("DD_LOGS is already initialized."),!1)}(r)){var s=function(t){var n=ie(t),r=Me(t.forwardConsoleLogs,x(e),"Forward Console Logs"),o=Me(t.forwardReports,x(Oe),"Forward Reports");if(n&&r&&o)return t.forwardErrorsToLogs&&!w(r,e.error)&&r.push(e.error),v({forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:o,requestErrorResponseLengthLimit:32768},n)}(r);s&&(o=n(r,s,g,h),d=o.handleLog,f=o.getInternalContext,p=function(){return O(r)},l.drain(),i=!0)}})),getLoggerGlobalContext:u(a.get),getGlobalContext:u(a.getContext),setLoggerGlobalContext:u(a.set),setGlobalContext:u(a.setContext),addLoggerGlobalContext:u(a.add),setGlobalContextProperty:u(a.setContextProperty),removeLoggerGlobalContext:u(a.remove),removeGlobalContextProperty:u(a.removeContextProperty),clearGlobalContext:u(a.clearContext),createLogger:u((function(e,t){return void 0===t&&(t={}),c[e]=new De((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return d.apply(void 0,e)}),e,t.handler,t.level,t.context),c[e]})),getLogger:u((function(e){return c[e]})),getInitConfiguration:u((function(){return p()})),getInternalContext:u((function(e){return f(e)}))},o=v({version:"4.23.1",onReady:function(e){e()}},r),Object.defineProperty(o,"_setDebug",{get:function(){return s},enumerable:!1}),o}((function(n,r,o,i){var s=new ln,a=function(e){return s.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:{origin:me},origin:me,status:Ie.error}})},u=function(e,t){var n,r=We("browser-logs-sdk",e);if(H()){var o=N();r.observable.subscribe((function(e){return o.send("internal_telemetry",e)}))}else{var i=ft(e,e.rumEndpointBuilder,t,null===(n=e.replica)||void 0===n?void 0:n.rumEndpointBuilder);r.observable.subscribe((function(t){return i.add(t,function(e){return"datad0g.com"===e.site}(e))}))}return r}(r,a);u.setContextProvider((function(){var e,t,n,r,o,i;return{application:{id:null===(e=Ut())||void 0===e?void 0:e.application_id},session:{id:null===(t=d.findTrackedSession())||void 0===t?void 0:t.id},view:{id:null===(r=null===(n=Ut())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(i=null===(o=Ut())||void 0===o?void 0:o.user_action)||void 0===i?void 0:i.id}}})),on(r,s),function(e,t){if(!e.forwardErrorsToLogs)return{stop:y};var n=new _e,r=fn(n).stop,o=n.subscribe((function(e){t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:{kind:e.type,origin:ke,stack:e.stack},origin:ke,status:Ie.error}})}))}(r,s),function(t,n){var r=Nt(t.forwardConsoleLogs).subscribe((function(t){n.notify(0,{rawLogsEvent:{date:A(),message:t.message,origin:be,error:t.api===e.error?{origin:be,stack:t.stack}:void 0,status:Gt[t.api]}})}))}(r,s),function(e,t){var n=Be(e.forwardReports).subscribe((function(e){var n,r=e.message,o=$t[e.type];o===Ie.error?n={kind:e.subtype,origin:xe,stack:e.stack}:e.stack&&(r+=" Found in ".concat(function(e){var t;return null===(t=/@ (.+)/.exec(e))||void 0===t?void 0:t[1]}(e.stack))),t.notify(0,{rawLogsEvent:{date:A(),message:r,origin:xe,error:n,status:o}})}))}(r,s);var c,f=function(e){return{handleLog:function(n,r,o,i){var s=n.context;It(n.status,Ae,r)&&t(n.status,n.message,B(r.getContext(),s)),e.notify(0,{rawLogsEvent:{date:i||A(),message:n.message,status:n.status,origin:we},messageContext:s,savedCommonContext:o,logger:r})}}}(s).handleLog,d=!function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var n="dd_cookie_test_".concat(h()),r="test";$(n,r,l,e);var o=J(n)===r;return W(n,e),o}catch(e){return t.error(e),!1}}(r.cookieOptions)||H()||Fe()?function(e){var t="1"===Mt(e)?{}:void 0;return{findTrackedSession:function(){return t}}}(r):qt(r);return At(d,r,s,o,i,a),H()?function(e){var t=N();e.subscribe(1,(function(e){t.send("log",e)}))}(s):function(e,t,n){var r,o=ft(e,e.logsEndpointBuilder,n,null===(r=e.replica)||void 0===r?void 0:r.logsEndpointBuilder);t.subscribe(1,(function(e){o.add(e)}))}(r,s,a),function(e){Je.telemetryConfigurationEnabled&&Ke({type:Ge,configuration:e})}(function(e){var t=function(e){return{session_sample_rate:e.sampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,use_before_send:!!e.beforeSend,use_cross_site_session_cookie:e.useCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:void 0!==e.proxyUrl?!!e.proxyUrl:void 0,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains}}(e);return v({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports},t)}(n)),{handleLog:f,getInternalContext:(c=d,{get:function(e){var t=c.findTrackedSession(e);if(t)return{session_id:t.id}}}).get}}));dn=E(),vn=gn,hn=dn[pn="DD_LOGS"],dn[pn]=vn,hn&&hn.q&&hn.q.forEach((function(e){return n(e,"onReady callback threw an error:")()}))}();
{
"name": "@datadog/browser-logs",
"version": "4.23.0",
"version": "4.23.1",
"license": "Apache-2.0",

@@ -16,6 +16,6 @@ "main": "cjs/entries/main.js",

"dependencies": {
"@datadog/browser-core": "4.23.0"
"@datadog/browser-core": "4.23.1"
},
"peerDependencies": {
"@datadog/browser-rum": "4.23.0"
"@datadog/browser-rum": "4.23.1"
},

@@ -36,3 +36,3 @@ "peerDependenciesMeta": {

},
"gitHead": "e48a9a9dcabd83507edfc3a32ad83e136b61e188"
"gitHead": "57c22e3d7f59739732a903dff00d0cdc5a757bc2"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc