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 3.1.3 to 3.2.0

2

bundle/datadog-logs.js

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

!function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function t(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function n(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}var r={log:console.log.bind(console),warn:console.warn.bind(console),error:console.error.bind(console)},o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function i(e){if(s){if(a===e)return;y()}var t=w(e);throw s=t,a=e,setTimeout($((function(){a===e&&y()})),t.incomplete?2e3:0),e}var a,s,u,c,f,l,d=[];function p(e){!function(){if(c)return;u=window.onerror,window.onerror=$(g),c=!0}(),function(){if(l)return;f=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=$(m),l=!0}(),d.push(e)}function h(e){for(var t=d.length-1;t>=0;t-=1)d[t]===e&&d.splice(t,1);0===d.length&&(c&&(window.onerror=u,c=!1),l&&(window.onunhandledrejection=f,l=!1))}function v(e,t,n){var r;if(d.forEach((function(o){try{o(e,t,n)}catch(e){r=e}})),r)throw r}function g(e,t,n,r,i){if(s)E(s,t,n),y();else if(i)v(w(i),!0,i);else{var a,c={url:t,column:r,line:n},f=e;if("[object String]"==={}.toString.call(e)){var l=o.exec(f);l&&(a=l[1],f=l[2])}v({name:a,message:"string"==typeof f?f:void 0,stack:[c]},!0,e)}return!!u&&u.apply(this,arguments)}function m(e){var t=e.reason||"Empty reason";v(w(t),!0,t)}function y(){var e=s,t=a;s=void 0,a=void 0,v(e,!1,t)}var b="?";function w(e,t){var n,r=void 0===t?0:+t;try{if(n=function(e){var t=S(e,"stacktrace");if(!t)return;for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,o=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,i=t.split("\n"),a=[],s=0;s<i.length;s+=2){var u=void 0;r.exec(i[s])?u={args:[],column:void 0,func:(n=r.exec(i[s]))[3],line:+n[1],url:n[2]}:o.exec(i[s])&&(u={args:(n=o.exec(i[s]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),u&&(!u.func&&u.line&&(u.func=b),u.context=[i[s+1]],a.push(u))}if(!a.length)return;return{stack:a,message:S(e,"message"),name:S(e,"name")}}(e))return n}catch(e){if(x)throw e}try{if(n=function(e){var t=S(e,"stack");if(!t)return;for(var n,r,o,i,a=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,s=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,f=/\((\S*)(?::(\d+))(?::(\d+))\)/,l=t.split("\n"),d=[],p=0,h=l.length;p<h;p+=1){if(a.exec(l[p])){var v=(o=a.exec(l[p]))[2]&&0===o[2].indexOf("native");n=o[2]&&0===o[2].indexOf("eval"),r=f.exec(o[2]),n&&r&&(o[2]=r[1],o[3]=r[2],o[4]=r[3]),i={args:v?[o[2]]:[],column:o[4]?+o[4]:void 0,func:o[1]||b,line:o[3]?+o[3]:void 0,url:v?void 0:o[2]}}else if(u.exec(l[p]))i={args:[],column:(o=u.exec(l[p]))[4]?+o[4]:void 0,func:o[1]||b,line:+o[3],url:o[2]};else{if(!s.exec(l[p]))continue;n=(o=s.exec(l[p]))[3]&&o[3].indexOf(" > eval")>-1,r=c.exec(o[3]),n&&r?(o[3]=r[1],o[4]=r[2],o[5]=void 0):0!==p||o[5]||M(e.columnNumber)||(d[0].column=e.columnNumber+1),i={args:o[2]?o[2].split(","):[],column:o[5]?+o[5]:void 0,func:o[1]||b,line:o[4]?+o[4]:void 0,url:o[3]}}!i.func&&i.line&&(i.func=b),d.push(i)}if(!d.length)return;return{stack:d,message:S(e,"message"),name:S(e,"name")}}(e))return n}catch(e){if(x)throw e}try{if(n=function(e){var t=S(e,"message");if(!t)return;var n=t.split("\n");if(n.length<4)return;var r,o=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,i=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,a=/^\s*Line (\d+) of function script\s*$/i,s=[],u=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var f in u)T(u,f)&&!u[f].src&&c.push(u[f]);for(var l=2;l<n.length;l+=2){var d=void 0;if(o.exec(n[l]))d={args:[],column:void 0,func:(r=o.exec(n[l]))[3],line:+r[1],url:r[2]};else if(i.exec(n[l]))d={args:[],column:void 0,func:(r=i.exec(n[l]))[4],line:+r[1],url:r[3]};else if(a.exec(n[l])){r=a.exec(n[l]),d={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+r[1]}}d&&(d.func||(d.func=b),d.context=[n[l+1]],s.push(d))}if(!s.length)return;return{stack:s,message:n[0],name:S(e,"name")}}(e))return n}catch(e){if(x)throw e}try{if(n=k(e,r+1))return n}catch(e){if(x)throw e}return{message:S(e,"message"),name:S(e,"name"),stack:[]}}var x=!1;function E(e,t,n){var r={url:t,line:n?+n:void 0};if(r.url&&r.line){e.incomplete=!1;var o=e.stack;if(o.length>0&&o[0].url===r.url){if(o[0].line===r.line)return!1;if(!o[0].line&&o[0].func===r.func)return o[0].line=r.line,o[0].context=r.context,!1}return o.unshift(r),e.partial=!0,!0}return e.incomplete=!0,!1}function k(e,t){for(var n,r,o=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,a=[],s={},u=!1,c=k.caller;c&&!u;c=c.caller)c!==w&&c!==i&&(r={args:[],column:void 0,func:b,line:void 0,url:void 0},n=o.exec(c.toString()),c.name?r.func=c.name:n&&(r.func=n[1]),void 0===r.func&&(r.func=n?n.input.substring(0,n.input.indexOf("{")):void 0),s[c.toString()]?u=!0:s[c.toString()]=!0,a.push(r));t&&a.splice(0,t);var f={stack:a,message:S(e,"message"),name:S(e,"name")};return E(f,S(e,"sourceURL")||S(e,"fileName"),S(e,"line")||S(e,"lineNumber")),f}function S(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function M(e){return void 0===e}var R,O="agent",_="console",C="logger",L="network",N="source";function A(e){var t=B(e);return e.stack.forEach((function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",o=e.line?":"+e.line:"",i=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+o+i})),t}function B(e){return(e.name||"Error")+": "+e.message}function I(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return K((function(){var n=w(t);n.stack=n.stack.slice(2),e=A(n)})),e}!function(e){e.HANDLED="handled",e.UNHANDLED="unhandled"}(R||(R={}));var D=/[^\u0000-\u007F]/,j=!1,H=function(){function t(e,t,n){void 0===n&&(n=!1),this.endpointUrl=e,this.bytesLimit=t,this.withBatchTime=n}return t.prototype.send=function(t,n){var o=this.withBatchTime?function(e){return e+(-1===e.indexOf("?")?"?":"&")+"batch_time="+(new Date).getTime()}(this.endpointUrl):this.endpointUrl,i=!!navigator.sendBeacon&&n<this.bytesLimit;if(i)try{if(navigator.sendBeacon(o,t))return}catch(e){!function(e){z||(z=!0,J(e))}(e)}var a=function(t){var a,s,u=null==t?void 0:t.currentTarget;u.status>=200&&u.status<300||(j||(j=!0,a="XHR fallback failed",s={on_line:navigator.onLine,size:n,url:o,try_beacon:i,event:{is_trusted:t.isTrusted,total:t.total,loaded:t.loaded},request:{status:u.status,ready_state:u.readyState,response_text:u.responseText.slice(0,64)}},function(e,t){F.debugMode&&r.log("[MONITORING MESSAGE]",e,t)}(a,s),V(e(e({message:a},s),{status:P.info}))))},s=new XMLHttpRequest;s.addEventListener("loadend",$((function(e){return a(e)}))),s.open("POST",o,!0),s.send(t)},t}();var z=!1;var P,U=function(){function e(e,t,n,r,o,i){void 0===i&&(i=re),this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=o,this.beforeUnloadCallback=i,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),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(){if(0!==this.bufferMessageCount){var e=n(this.pushOnlyBuffer,(t=this.upsertBuffer,r=[],Object.keys(t).forEach((function(e){r.push(t[e])})),r));this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var t,r},e.prototype.sizeInBytes=function(e){return D.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length},e.prototype.addOrUpdate=function(e,t){var n=this.process(e),o=n.processedMessage,i=n.messageBytesSize;i>=this.maxMessageSize?r.warn("Discarded a message whose size was bigger than the maximum allowed size "+this.maxMessageSize+"KB."):(this.hasMessageFor(t)&&this.remove(t),this.willReachedBytesLimitWith(i)&&this.flush(),this.push(o,i,t),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=oe(e);return{processedMessage:t,messageBytesSize:this.sizeInBytes(t)}},e.prototype.push=function(e,t,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.bufferBytesSize+=t,this.bufferMessageCount+=1},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.sizeInBytes(t);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e.prototype.willReachedBytesLimitWith=function(e){return this.bufferBytesSize+e+1>=this.bytesLimit},e.prototype.isFull=function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},e.prototype.flushPeriodically=function(){var e=this;setTimeout($((function(){e.flush(),e.flushPeriodically()})),this.flushTimeout)},e.prototype.flushOnVisibilityHidden=function(){var e=this;navigator.sendBeacon&&(se(window,"beforeunload",this.beforeUnloadCallback),se(document,"visibilitychange",(function(){"hidden"===document.visibilityState&&e.flush()})),se(window,"beforeunload",(function(){return e.flush()})))},e}();!function(e){e.info="info",e.error="error"}(P||(P={}));var q,F={maxMessagesPerPage:0,sentMessageCount:0};function G(e){if(e.internalMonitoringEndpoint){var t=function(e){var t,n=r(e.internalMonitoringEndpoint);void 0!==e.replica&&(t=r(e.replica.internalMonitoringEndpoint));function r(t){return new U(new H(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}function o(e){return fe({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==q?q():{},e)}return{add:function(e){var r=o(e);n.add(r),t&&t.add(r)}}}(e);!function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];t.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))}(F,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){q=e}}}function X(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=F.batch?$(r):r;return n.apply(this,e)}}function $(e){return function(){return K(e,this,arguments)}}function K(e,t,n){try{return e.apply(t,n)}catch(e){Z(e);try{J(e)}catch(e){Z(e)}}}function J(t){V(e(e({},function(e){if(e instanceof Error){var t=w(e);return{error:{kind:t.name,stack:A(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+oe(e)}}(t)),{status:P.error}))}function V(e){F.batch&&F.sentMessageCount<F.maxMessagesPerPage&&(F.sentMessageCount+=1,F.batch.add(e))}function W(e){F.debugMode=e}function Z(e){F.debugMode&&r.error("[INTERNAL ERROR]",e)}var Y,Q,ee=1e3,te=6e4;function ne(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,ne)}function re(){}function oe(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];ie(e)&&(r=[!0,e.toJSON],delete e.toJSON);var o,i,a=[!1,void 0];"object"==typeof e&&ie(o=Object.getPrototypeOf(e))&&(a=[!0,o.toJSON],delete o.toJSON);try{i=JSON.stringify(e,t,n)}catch(e){i="<error: unable to serialize object>"}finally{r[0]&&(e.toJSON=r[1]),a[0]&&(o.toJSON=a[1])}return i}function ie(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function ae(e,t){return-1!==e.indexOf(t)}function se(e,t,n,r){return ue(e,[t],n,r)}function ue(e,t,n,r){var o=void 0===r?{}:r,i=o.once,a=o.capture,s=o.passive,u=$(i?function(e){f(),n(e)}:n),c=s?{capture:a,passive:s}:a;t.forEach((function(t){return e.addEventListener(t,u,c)}));var f=function(){return t.forEach((function(t){return e.removeEventListener(t,u,c)}))};return{stop:f}}function ce(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]=ce(o[i],t[i],n);return o}var a,s="object"==(null===(a=e)?"null":Array.isArray(a)?"array":typeof a)?e:{};for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(s[u]=ce(s[u],t[u],n));return s}}function fe(){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=ce(e,i))}return e}!function(e){e.DOCUMENT="document",e.XHR="xhr",e.BEACON="beacon",e.FETCH="fetch",e.CSS="css",e.JS="js",e.IMAGE="image",e.FONT="font",e.MEDIA="media",e.OTHER="other"}(Y||(Y={})),function(e){e.FETCH="fetch",e.XHR="xhr"}(Q||(Q={}));var le;function de(e,t,n,r){var o=new Date;o.setTime(o.getTime()+n);var i="expires="+o.toUTCString(),a=r&&r.crossSite?"none":"strict",s=r&&r.domain?";domain="+r.domain:"",u=r&&r.secure?";secure":"";document.cookie=e+"="+t+";"+i+";path=/;samesite="+a+s+u}function pe(e){return function(e,t){var n=new RegExp("(?:^|;)\\s*"+t+"\\s*=\\s*([^;]+)").exec(e);return n?n[1]:void 0}(document.cookie,e)}function he(e,t){de(e,"",0,t)}function ve(e,t){return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];try{return e.apply(void 0,n)}catch(e){r.error(t,e)}}}var ge={alternate:{logs:"logs",rum:"rum",sessionReplay:"session-replay"},classic:{logs:"browser",rum:"rum",sessionReplay:void 0}},me="datadoghq.com",ye=[me,"datadoghq.eu"];function be(t,n){var r={buildMode:n.buildMode,clientToken:t.clientToken,env:t.env,proxyHost:t.proxyHost,sdkVersion:n.sdkVersion,service:t.service,site:t.site||me,version:t.version},o=function(e,t){return!t.useAlternateIntakeDomains&&ae(ye,e)?"classic":"alternate"}(r.site,t),i=function(e,t,n){if(t.proxyHost)return["https://"+t.proxyHost+"/v1/input/"];var r=[t.site];t.buildMode===Ee.STAGING&&n&&r.push(me);for(var o=[],i=Object.keys(ge[e]),a=0,s=r;a<s.length;a++)for(var u=s[a],c=0,f=i;c<f.length;c++){var l=f[c];o.push("https://"+we(e,l,u)+"/v1/input/")}return o}(o,r,void 0!==t.replica),a={isIntakeUrl:function(e){return i.some((function(t){return 0===e.indexOf(t)}))},logsEndpoint:xe(o,"logs",r),rumEndpoint:xe(o,"rum",r),sessionReplayEndpoint:xe(o,"sessionReplay",r)};if(t.internalMonitoringApiKey&&(a.internalMonitoringEndpoint=xe(o,"logs",r,"browser-agent-internal-monitoring")),r.buildMode===Ee.E2E_TEST&&(a.internalMonitoringEndpoint="<<< E2E INTERNAL MONITORING ENDPOINT >>>",a.logsEndpoint="<<< E2E LOGS ENDPOINT >>>",a.rumEndpoint="<<< E2E RUM ENDPOINT >>>",a.sessionReplayEndpoint="<<< E2E SESSION REPLAY ENDPOINT >>>"),r.buildMode===Ee.STAGING&&void 0!==t.replica){var s=e(e({},r),{applicationId:t.replica.applicationId,clientToken:t.replica.clientToken,site:me});a.replica={applicationId:t.replica.applicationId,internalMonitoringEndpoint:xe(o,"logs",s,"browser-agent-internal-monitoring"),logsEndpoint:xe(o,"logs",s),rumEndpoint:xe(o,"rum",s)}}return a}function we(e,t,n){return"classic"===e&&function(e,t){var n=ge.classic[e];return n&&n+"-http-intake.logs."+t}(t,n)||function(e,t){var n=ge.alternate[e],r=t.split("."),o=r.pop(),i=r.join("-")+"."+o;return n+".browser-intake-"+i}(t,n)}function xe(e,t,n,r){var o="sdk_version:"+n.sdkVersion+(n.env?",env:"+n.env:"")+(n.service?",service:"+n.service:"")+(n.version?",version:"+n.version:""),i=we(e,t,n.site),a=n.proxyHost?n.proxyHost:i,s=(n.proxyHost?"ddhost="+i+"&":"")+"ddsource="+(r||"browser")+"&ddtags="+encodeURIComponent(o);return"https://"+a+"/v1/input/"+n.clientToken+"?"+s}var Ee,ke={allowedTracingOrigins:[],maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,sampleRate:100,replaySampleRate:100,silentMultipleInit:!1,trackInteractions:!1,trackViewsManually:!1,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};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===le){for(var e="dd_site_test_"+ne(),t=window.location.hostname.split("."),n=t.pop();t.length&&!pe(e);)n=t.pop()+"."+n,de(e,"test",ee,{domain:n});he(e,{domain:n}),le=n}return le}()),t}function Te(t,n){var r=function(t,n){var r=Array.isArray(t.enableExperimentalFeatures)?t.enableExperimentalFeatures:[],o=e(e({beforeSend:t.beforeSend&&ve(t.beforeSend,"beforeSend threw an error:"),cookieOptions:Se(t),isEnabled:function(e){return ae(r,e)},service:t.service},be(t,n)),ke);return"allowedTracingOrigins"in t&&(o.allowedTracingOrigins=t.allowedTracingOrigins),"sampleRate"in t&&(o.sampleRate=t.sampleRate),"replaySampleRate"in t&&(o.replaySampleRate=t.replaySampleRate),"trackInteractions"in t&&(o.trackInteractions=!!t.trackInteractions),"trackViewsManually"in t&&(o.trackViewsManually=!!t.trackViewsManually),"actionNameAttribute"in t&&(o.actionNameAttribute=t.actionNameAttribute),o}(t,n);return{configuration:r,internalMonitoring:G(r)}}function Me(){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}}}!function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(Ee||(Ee={}));var Re,Oe,_e,Ce,Le,Ne=function(){function e(e){void 0===e&&(e=1e4),this.limit=e,this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>this.limit&&this.buffer.splice(0,1)},e.prototype.drain=function(){this.buffer.forEach((function(e){return e()})),this.buffer.length=0},e}(),Ae={debug:"debug",error:"error",info:"info",warn:"warn"},Be=((Re={})[Ae.debug]=0,Re[Ae.info]=1,Re[Ae.warn]=2,Re[Ae.error]=3,Re),Ie=(Object.keys(Ae),"console"),De="http",je=function(){function t(e,t,n,r){void 0===t&&(t=De),void 0===n&&(n=Ae.debug),void 0===r&&(r={}),this.sendLog=e,this.handlerType=t,this.level=n,this.contextManager=Me(),this.contextManager.set(r)}return t.prototype.log=function(t,n,o){if(void 0===o&&(o=Ae.info),Be[o]>=Be[this.level]){var i=Array.isArray(this.handlerType)?this.handlerType:[this.handlerType];ae(i,De)&&this.sendLog(e({message:t,status:o},fe(this.contextManager.get(),n))),ae(i,Ie)&&r.log(o+": "+t,fe(this.contextManager.get(),n))}},t.prototype.debug=function(e,t){this.log(e,t,Ae.debug)},t.prototype.info=function(e,t){this.log(e,t,Ae.info)},t.prototype.warn=function(e,t){this.log(e,t,Ae.warn)},t.prototype.error=function(e,t){var n={error:{origin:C}};this.log(e,fe(n,t),Ae.error)},t.prototype.setContext=function(e){this.contextManager.set(e)},t.prototype.addContext=function(e,t){this.contextManager.add(e,t)},t.prototype.removeContext=function(e){this.contextManager.remove(e)},t.prototype.setHandler=function(e){this.handlerType=e},t.prototype.setLevel=function(e){this.level=e},function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);i>3&&a&&Object.defineProperty(t,n,a)}([X],t.prototype,"log",null),t}(),He=function(){function e(){this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return this.observers.push(e),{unsubscribe:function(){t.observers=t.observers.filter((function(t){return e!==t}))}}},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}();function ze(){return Date.now()}function Pe(){return performance.now()}function Ue(){return{relative:Pe(),timeStamp:ze()}}function qe(e,t){return t-e}function Fe(e,t){var r=function(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n,e))return r}}(e,(function(e){return e instanceof Error}));return{message:n(["console error:"],e).map((function(e){return function(e){if("string"==typeof e)return e;if(e instanceof Error)return B(w(e));return oe(e,void 0,2)}(e)})).join(" "),stack:r?A(w(r)):void 0,handlingStack:t}}function Ge(e){return p(_e=function(t,n,r){var o=function(e,t,n,r){return e&&(void 0!==e.message||t instanceof Error)?{message:e.message||"Empty message",stack:A(e),handlingStack:r,type:e.name}:{message:n+" "+oe(t),stack:"No stack, consider using an instance of Error",handlingStack:r,type:e&&e.name}}(t,r,"Uncaught"),i=o.stack,a=o.message,s=o.type;e.notify({message:a,stack:i,type:s,source:N,startClocks:Ue(),originalError:r,handling:R.UNHANDLED})}),{stop:function(){h(_e)}}}function Xe(e){return $e(e,function(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}(window.location)).href}function $e(e,t){if(function(){if(void 0!==Ce)return Ce;try{var e=new URL("http://test/path");return Ce="http://test/path"===e.href}catch(e){Ce=!1}return Ce}())return void 0!==t?new URL(e,t):new URL(e);if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: '"+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 Ke,Je,Ve,We,Ze,Ye=[],Qe=[];function et(e,t){var n=this;return K((function(){n._datadog_xhr={method:e,url:Xe(t)}})),Ke.apply(this,arguments)}function tt(){var e=this;return K((function(){if(e._datadog_xhr){e._datadog_xhr.startTime=Pe(),e._datadog_xhr.startClocks=Ue(),e._datadog_xhr.isAborted=!1;var t=!1,n=e.onreadystatechange,r=function(){this.readyState===XMLHttpRequest.DONE&&o(),n&&n.apply(this,arguments)},o=$((function(){e.removeEventListener("loadend",o),e.onreadystatechange===r&&(e.onreadystatechange=n),t||(t=!0,rt(e))}));e.onreadystatechange=r,e.addEventListener("loadend",o),Ye.forEach((function(t){return t(e._datadog_xhr,e)}))}})),Je.apply(this,arguments)}function nt(){var e=this;return K((function(){e._datadog_xhr&&(e._datadog_xhr.isAborted=!0)})),Ve.apply(this,arguments)}function rt(t){t._datadog_xhr.duration=qe(t._datadog_xhr.startClocks.timeStamp,ze()),t._datadog_xhr.responseText=t.response,t._datadog_xhr.status=t.status,t._datadog_xhr.xhr=t,Qe.forEach((function(n){return n(e({},t._datadog_xhr))}))}var ot=[],it=[];function at(){return We||(!function(){if(!window.fetch)return;Ze=window.fetch,window.fetch=function(e,t){var n,r=K(st,null,[e,t]);return r?K(ut,null,[n=Ze.call(this,r.input,r.init),r]):n=Ze.call(this,e,t),n}}(),We={beforeSend:function(e){ot.push(e)},onRequestComplete:function(e){it.push(e)}}),We}function st(e,t){var n=t&&t.method||"object"==typeof e&&e.method||"GET",r=Xe("object"==typeof e&&e.url||e),o={init:t,input:e,method:n,startClocks:Ue(),url:r};return ot.forEach((function(e){return e(o)})),o}function ut(e,n){var r=this,o=function(e){return o=r,i=void 0,s=function(){var r,o;return t(this,(function(t){switch(t.label){case 0:return n.duration=qe(n.startClocks.timeStamp,ze()),"stack"in e||e instanceof Error?(n.status=0,n.responseText=A(w(e)),n.isAborted=e instanceof DOMException&&e.code===DOMException.ABORT_ERR,n.error=e,it.forEach((function(e){return e(n)})),[3,6]):[3,1];case 1:if(!("status"in e))return[3,6];r=void 0,t.label=2;case 2:return t.trys.push([2,4,,5]),[4,e.clone().text()];case 3:return r=t.sent(),[3,5];case 4:return o=t.sent(),r="Unable to retrieve response: "+o,[3,5];case 5:n.response=e,n.responseText=r,n.responseType=e.type,n.status=e.status,n.isAborted=!1,it.forEach((function(e){return e(n)})),t.label=6;case 6:return[2]}}))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{u(s.next(e))}catch(e){t(e)}}function r(e){try{u(s.throw(e))}catch(e){t(e)}}function u(t){t.done?e(t.value):new a((function(e){e(t.value)})).then(n,r)}u((s=s.apply(o,i||[])).next())}));var o,i,a,s};e.then($(o),$(o))}function ct(e,t){function n(n,r){e.isIntakeUrl(r.url)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!function(e){return e.status>=500}(r)||t.notify({message:lt(n)+" error "+r.method+" "+r.url,resource:{method:r.method,statusCode:r.status,url:r.url},source:L,stack:ft(r.responseText,e)||"Failed to load",startClocks:r.startClocks})}return(Le||(Ke=XMLHttpRequest.prototype.open,Je=XMLHttpRequest.prototype.send,Ve=XMLHttpRequest.prototype.abort,XMLHttpRequest.prototype.open=et,XMLHttpRequest.prototype.send=tt,XMLHttpRequest.prototype.abort=nt,Le={beforeSend:function(e){Ye.push(e)},onRequestComplete:function(e){Qe.push(e)}}),Le).onRequestComplete((function(e){return n(Q.XHR,e)})),at().onRequestComplete((function(e){return n(Q.FETCH,e)})),{stop:function(){Le&&(Le=void 0,Ye.length=0,Qe.length=0,XMLHttpRequest.prototype.open=Ke,XMLHttpRequest.prototype.send=Je,XMLHttpRequest.prototype.abort=Ve),We&&(We=void 0,ot.splice(0,ot.length),it.splice(0,it.length),window.fetch=Ze)}}}function ft(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function lt(e){return Q.XHR===e?"XHR":"Fetch"}var dt=9e5,pt=144e5;function ht(e,t,n){var r=function(e,t){var n,r,o=!1,i=function(){o=!0,clearTimeout(n),n=setTimeout((function(){o=!1}),1e3)};return{get:function(){return o||(r=pe(e),i()),r},set:function(n,o){de(e,n,o,t),r=n,i()}}}("_dd_s",e);!function(e){var t=e.get(),n=pe("_dd"),r=pe("_dd_r"),o=pe("_dd_l");if(!t){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i.logs=o),r&&/^[012]$/.test(r)&&(i.rum=r),yt(i,e)}}(r);var o=new He,i=mt(r).id,a=function(e,t,n){var r,o,i=!n||void 0===n.leading||n.leading,a=!n||void 0===n.trailing||n.trailing,s=!1;return{throttled:function(){for(var n=[],u=0;u<arguments.length;u++)n[u]=arguments[u];s?r=n:(i?e.apply(void 0,n):r=n,s=!0,o=setTimeout((function(){a&&r&&e.apply(void 0,r),s=!1,r=void 0}),t))},cancel:function(){clearTimeout(o),s=!1,r=void 0}}}($((function(){var e=mt(r),a=n(e[t]),s=a.trackingType,u=a.isTracked;e[t]=s,u&&!e.id&&(e.id=ne(),e.created=String(Date.now())),yt(e,r),u&&i!==e.id&&(i=e.id,o.notify())})),1e3).throttled;return a(),function(e){var t=ue(window,["click","touchstart","keydown","scroll"],e,{capture:!0,passive:!0}).stop;wt.push(t)}(a),function(e){var t=$((function(){"visible"===document.visibilityState&&e()})),n=se(document,"visibilitychange",t).stop;wt.push(n);var r=setInterval(t,6e4);wt.push((function(){clearInterval(r)}))}((function(){yt(mt(r),r)})),{getId:function(){return mt(r).id},getTrackingType:function(){return mt(r)[t]},renewObservable:o}}var vt=/^([a-z]+)=([a-z0-9-]+)$/,gt="&";function mt(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf("&")||vt.test(e))})(t)&&t.split(gt).forEach((function(e){var t=vt.exec(e);if(null!==t){var r=t[1],o=t[2];n[r]=o}}));return n}(e);return function(e){return(void 0===e.created||Date.now()-Number(e.created)<pt)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(bt(e),{})}function yt(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+dt);var r=function(e){return Object.keys(e).map((function(t){return[t,e[t]]}))}(e).map((function(e){return e[0]+"="+e[1]})).join(gt);t.set(r,dt)}else bt(t)}function bt(e){e.set("",0)}var wt=[];var xt;function Et(e,t){if(!t){var n=kt(e)===xt.TRACKED;return{getId:function(){},isTracked:function(){return n}}}var r=ht(e.cookieOptions,"logs",(function(t){return function(e,t){var n=function(e){return e===xt.NOT_TRACKED||e===xt.TRACKED}(t)?t:kt(e);return{trackingType:n,isTracked:n===xt.TRACKED}}(e,t)}));return{getId:r.getId,isTracked:function(){return r.getTrackingType()===xt.TRACKED}}}function kt(e){return 0!==(t=e.sampleRate)&&100*Math.random()<=t?xt.TRACKED:xt.NOT_TRACKED;var t}!function(e){e.NOT_TRACKED="0",e.TRACKED="1"}(xt||(xt={}));var St={buildMode:"release",sdkVersion:"3.1.3"};function Tt(e){var t=window.DD_RUM;return t&&t.getInternalContext?t.getInternalContext(e):void 0}var Mt,Rt,Ot,_t,Ct=function(t){var n=!1,o=Me(),i={},a=new Ne,s=function(e,t){a.add((function(){return s(e,t)}))},u=function(){},c=new je(d);return f={logger:c,init:$((function(e){(function(e){return n?(e.silentMultipleInit||r.error("DD_LOGS is already initialized."),!1):e&&e.clientToken?!!(void 0===e.sampleRate||(t=e.sampleRate,function(e){return"number"==typeof e}(t)&&t>=0&&t<=100))||(r.error("Sample Rate should be a number between 0 and 100"),!1):(r.error("Client Token is not configured, we will not send any data."),!1);var t})(e)&&(s=t(e,c,o.get),u=function(){return ce(void 0,e)},a.drain(),n=!0)})),getLoggerGlobalContext:$(o.get),setLoggerGlobalContext:$(o.set),addLoggerGlobalContext:$(o.add),removeLoggerGlobalContext:$(o.remove),createLogger:$((function(t,n){return void 0===n&&(n={}),i[t]=new je(d,n.handler,n.level,e(e({},n.context),{logger:{name:t}})),i[t]})),getLogger:$((function(e){return i[e]})),getInitConfiguration:$((function(){return u()}))},l=e(e({},f),{onReady:function(e){e()}}),Object.defineProperty(l,"_setDebug",{get:function(){return W},enumerable:!1}),l;var f,l;function d(e){s(e,fe({date:Date.now(),view:{referrer:document.referrer,url:window.location.href}},o.get()))}}((function(t,n,o){var i=Te(t,St),a=i.configuration,s=i.internalMonitoring,u=new He;return!1!==t.forwardErrorsToLogs&&(!function(t){Oe=console.error,console.error=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=I();K((function(){Oe.apply(console,n),t.notify(e(e({},Fe(n,o)),{source:_,startClocks:Ue(),handling:R.HANDLED}))}))}}(u),Ge(u),ct(a,u)),function(e,t,n,r,o,i){n.setExternalContextProvider((function(){return fe({session_id:r.getId()},i(),Tt())}));var a=function(e,t,n){var r=function(e,t){var n=0,r=!1;return{isLimitReached:function(){if(0===n&&setTimeout((function(){n=0}),te),(n+=1)<=e.maxErrorsByMinute||r)return r=!1,!1;if(n===e.maxErrorsByMinute+1){r=!0;try{t({message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,source:O,startClocks:Ue()})}finally{r=!1}}return!0}}}(t,n);return function(n,o){if(e.isTracked()){var i=fe({service:t.service,session_id:e.getId()},o,Tt(),n);if(!(t.beforeSend&&!1===t.beforeSend(i)||i.status===Ae.error&&r.isLimitReached()))return i}}}(r,e,u),s=function(e){var t,n=r(e.logsEndpoint);void 0!==e.replica&&(t=r(e.replica.logsEndpoint));function r(t){return new U(new H(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){n.add(e),t&&t.add(e)}}}(e);function u(e){o.error(e.message,fe({date:e.startClocks.timeStamp,error:{kind:e.type,origin:e.source,stack:e.stack}},e.resource?{http:{method:e.resource.method,status_code:e.resource.statusCode,url:e.resource.url}}:void 0,Tt(e.startClocks.relative)))}return t.subscribe(u),function(e,t){var n=a(e,t);n&&s.add(n)}}(a,u,s,Et(a,function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_"+ne(),n="test";de(t,n,ee,e);var o=pe(t)===n;return he(t,e),o}catch(e){return r.error(e),!1}}(a.cookieOptions)),n,o)}));Mt=function(){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}(),Ot=Ct,_t=Mt[Rt="DD_LOGS"],Mt[Rt]=Ot,_t&&_t.q&&_t.q.forEach((function(e){return ve(e,"onReady callback threw an error:")()}))}();
!function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function t(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function n(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r}var r={log:console.log.bind(console),warn:console.warn.bind(console),error:console.error.bind(console)},i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function o(e){if(s){if(a===e)return;y()}var t=w(e);throw s=t,a=e,setTimeout($((function(){a===e&&y()})),t.incomplete?2e3:0),e}var a,s,u,c,f,l,d=[];function p(e){!function(){if(c)return;u=window.onerror,window.onerror=$(g),c=!0}(),function(){if(l)return;f=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=$(m),l=!0}(),d.push(e)}function h(e){for(var t=d.length-1;t>=0;t-=1)d[t]===e&&d.splice(t,1);0===d.length&&(c&&(window.onerror=u,c=!1),l&&(window.onunhandledrejection=f,l=!1))}function v(e,t,n){var r;if(d.forEach((function(i){try{i(e,t,n)}catch(e){r=e}})),r)throw r}function g(e,t,n,r,o){if(s)E(s,t,n),y();else if(o)v(w(o),!0,o);else{var a,c={url:t,column:r,line:n},f=e;if("[object String]"==={}.toString.call(e)){var l=i.exec(f);l&&(a=l[1],f=l[2])}v({name:a,message:"string"==typeof f?f:void 0,stack:[c]},!0,e)}return!!u&&u.apply(this,arguments)}function m(e){var t=e.reason||"Empty reason";v(w(t),!0,t)}function y(){var e=s,t=a;s=void 0,a=void 0,v(e,!1,t)}var b="?";function w(e,t){var n,r=void 0===t?0:+t;try{if(n=function(e){var t=S(e,"stacktrace");if(!t)return;for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=t.split("\n"),a=[],s=0;s<o.length;s+=2){var u=void 0;r.exec(o[s])?u={args:[],column:void 0,func:(n=r.exec(o[s]))[3],line:+n[1],url:n[2]}:i.exec(o[s])&&(u={args:(n=i.exec(o[s]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),u&&(!u.func&&u.line&&(u.func=b),u.context=[o[s+1]],a.push(u))}if(!a.length)return;return{stack:a,message:S(e,"message"),name:S(e,"name")}}(e))return n}catch(e){if(x)throw e}try{if(n=function(e){var t=S(e,"stack");if(!t)return;for(var n,r,i,o,a=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,s=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,f=/\((\S*)(?::(\d+))(?::(\d+))\)/,l=t.split("\n"),d=[],p=0,h=l.length;p<h;p+=1){if(a.exec(l[p])){var v=(i=a.exec(l[p]))[2]&&0===i[2].indexOf("native");n=i[2]&&0===i[2].indexOf("eval"),r=f.exec(i[2]),n&&r&&(i[2]=r[1],i[3]=r[2],i[4]=r[3]),o={args:v?[i[2]]:[],column:i[4]?+i[4]:void 0,func:i[1]||b,line:i[3]?+i[3]:void 0,url:v?void 0:i[2]}}else if(u.exec(l[p]))o={args:[],column:(i=u.exec(l[p]))[4]?+i[4]:void 0,func:i[1]||b,line:+i[3],url:i[2]};else{if(!s.exec(l[p]))continue;n=(i=s.exec(l[p]))[3]&&i[3].indexOf(" > eval")>-1,r=c.exec(i[3]),n&&r?(i[3]=r[1],i[4]=r[2],i[5]=void 0):0!==p||i[5]||R(e.columnNumber)||(d[0].column=e.columnNumber+1),o={args:i[2]?i[2].split(","):[],column:i[5]?+i[5]:void 0,func:i[1]||b,line:i[4]?+i[4]:void 0,url:i[3]}}!o.func&&o.line&&(o.func=b),d.push(o)}if(!d.length)return;return{stack:d,message:S(e,"message"),name:S(e,"name")}}(e))return n}catch(e){if(x)throw e}try{if(n=function(e){var t=S(e,"message");if(!t)return;var n=t.split("\n");if(n.length<4)return;var r,i=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,o=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,a=/^\s*Line (\d+) of function script\s*$/i,s=[],u=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var f in u)T(u,f)&&!u[f].src&&c.push(u[f]);for(var l=2;l<n.length;l+=2){var d=void 0;if(i.exec(n[l]))d={args:[],column:void 0,func:(r=i.exec(n[l]))[3],line:+r[1],url:r[2]};else if(o.exec(n[l]))d={args:[],column:void 0,func:(r=o.exec(n[l]))[4],line:+r[1],url:r[3]};else if(a.exec(n[l])){r=a.exec(n[l]),d={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+r[1]}}d&&(d.func||(d.func=b),d.context=[n[l+1]],s.push(d))}if(!s.length)return;return{stack:s,message:n[0],name:S(e,"name")}}(e))return n}catch(e){if(x)throw e}try{if(n=k(e,r+1))return n}catch(e){if(x)throw e}return{message:S(e,"message"),name:S(e,"name"),stack:[]}}var x=!1;function E(e,t,n){var r={url:t,line:n?+n:void 0};if(r.url&&r.line){e.incomplete=!1;var i=e.stack;if(i.length>0&&i[0].url===r.url){if(i[0].line===r.line)return!1;if(!i[0].line&&i[0].func===r.func)return i[0].line=r.line,i[0].context=r.context,!1}return i.unshift(r),e.partial=!0,!0}return e.incomplete=!0,!1}function k(e,t){for(var n,r,i=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,a=[],s={},u=!1,c=k.caller;c&&!u;c=c.caller)c!==w&&c!==o&&(r={args:[],column:void 0,func:b,line:void 0,url:void 0},n=i.exec(c.toString()),c.name?r.func=c.name:n&&(r.func=n[1]),void 0===r.func&&(r.func=n?n.input.substring(0,n.input.indexOf("{")):void 0),s[c.toString()]?u=!0:s[c.toString()]=!0,a.push(r));t&&a.splice(0,t);var f={stack:a,message:S(e,"message"),name:S(e,"name")};return E(f,S(e,"sourceURL")||S(e,"fileName"),S(e,"line")||S(e,"lineNumber")),f}function S(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function R(e){return void 0===e}var O,M="agent",L="console",_="logger",C="network",A="source";function I(e){var t=N(e);return e.stack.forEach((function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",i=e.line?":"+e.line:"",o=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+i+o})),t}function N(e){return(e.name||"Error")+": "+e.message}function B(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return K((function(){var n=w(t);n.stack=n.stack.slice(2),e=I(n)})),e}!function(e){e.HANDLED="handled",e.UNHANDLED="unhandled"}(O||(O={}));var D=/[^\u0000-\u007F]/,j=!1,P=function(){function t(e,t,n){void 0===n&&(n=!1),this.endpointUrl=e,this.bytesLimit=t,this.withBatchTime=n}return t.prototype.send=function(t,n){var i=this.withBatchTime?function(e){return e+(-1===e.indexOf("?")?"?":"&")+"batch_time="+(new Date).getTime()}(this.endpointUrl):this.endpointUrl,o=!!navigator.sendBeacon&&n<this.bytesLimit;if(o)try{if(navigator.sendBeacon(i,t))return}catch(e){!function(e){z||(z=!0,J(e))}(e)}var a=function(t){var a,s,u=null==t?void 0:t.currentTarget;u.status>=200&&u.status<300||(j||(j=!0,a="XHR fallback failed",s={on_line:navigator.onLine,size:n,url:i,try_beacon:o,event:{is_trusted:t.isTrusted,total:t.total,loaded:t.loaded},request:{status:u.status,ready_state:u.readyState,response_text:u.responseText.slice(0,64)}},function(e,t){F.debugMode&&r.log("[MONITORING MESSAGE]",e,t)}(a,s),V(e(e({message:a},s),{status:H.info}))))},s=new XMLHttpRequest;s.addEventListener("loadend",$((function(e){return a(e)}))),s.open("POST",i,!0),s.send(t)},t}();var z=!1;var H,U=function(){function e(e,t,n,r,i,o){void 0===o&&(o=re),this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=i,this.beforeUnloadCallback=o,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),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(){if(0!==this.bufferMessageCount){var e=n(this.pushOnlyBuffer,(t=this.upsertBuffer,Object.keys(t).map((function(e){return t[e]}))));this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var t},e.prototype.sizeInBytes=function(e){return D.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length},e.prototype.addOrUpdate=function(e,t){var n=this.process(e),i=n.processedMessage,o=n.messageBytesSize;o>=this.maxMessageSize?r.warn("Discarded a message whose size was bigger than the maximum allowed size "+this.maxMessageSize+"KB."):(this.hasMessageFor(t)&&this.remove(t),this.willReachedBytesLimitWith(o)&&this.flush(),this.push(i,o,t),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=ie(e);return{processedMessage:t,messageBytesSize:this.sizeInBytes(t)}},e.prototype.push=function(e,t,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.bufferBytesSize+=t,this.bufferMessageCount+=1},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.sizeInBytes(t);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e.prototype.willReachedBytesLimitWith=function(e){return this.bufferBytesSize+e+1>=this.bytesLimit},e.prototype.isFull=function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},e.prototype.flushPeriodically=function(){var e=this;setTimeout($((function(){e.flush(),e.flushPeriodically()})),this.flushTimeout)},e.prototype.flushOnVisibilityHidden=function(){var e=this;navigator.sendBeacon&&(se(window,"beforeunload",this.beforeUnloadCallback),se(document,"visibilitychange",(function(){"hidden"===document.visibilityState&&e.flush()})),se(window,"beforeunload",(function(){return e.flush()})))},e}();!function(e){e.info="info",e.error="error"}(H||(H={}));var q,F={maxMessagesPerPage:0,sentMessageCount:0};function G(e){if(e.internalMonitoringEndpoint){var t=function(e){var t,n=r(e.internalMonitoringEndpoint);void 0!==e.replica&&(t=r(e.replica.internalMonitoringEndpoint));function r(t){return new U(new P(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}function i(e){return fe({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==q?q():{},e)}return{add:function(e){var r=i(e);n.add(r),t&&t.add(r)}}}(e);!function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];t.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))}(F,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){q=e}}}function X(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=F.batch?$(r):r;return n.apply(this,e)}}function $(e){return function(){return K(e,this,arguments)}}function K(e,t,n){try{return e.apply(t,n)}catch(e){Y(e);try{J(e)}catch(e){Y(e)}}}function J(t){V(e(e({},function(e){if(e instanceof Error){var t=w(e);return{error:{kind:t.name,stack:I(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+ie(e)}}(t)),{status:H.error}))}function V(e){F.batch&&F.sentMessageCount<F.maxMessagesPerPage&&(F.sentMessageCount+=1,F.batch.add(e))}function W(e){F.debugMode=e}function Y(e){F.debugMode&&r.error("[INTERNAL ERROR]",e)}var Z,Q,ee=1e3,te=6e4;function ne(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,ne)}function re(){}function ie(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];oe(e)&&(r=[!0,e.toJSON],delete e.toJSON);var i,o,a=[!1,void 0];"object"==typeof e&&oe(i=Object.getPrototypeOf(e))&&(a=[!0,i.toJSON],delete i.toJSON);try{o=JSON.stringify(e,t,n)}catch(e){o="<error: unable to serialize object>"}finally{r[0]&&(e.toJSON=r[1]),a[0]&&(i.toJSON=a[1])}return o}function oe(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function ae(e,t){return-1!==e.indexOf(t)}function se(e,t,n,r){return ue(e,[t],n,r)}function ue(e,t,n,r){var i=void 0===r?{}:r,o=i.once,a=i.capture,s=i.passive,u=$(o?function(e){f(),n(e)}:n),c=s?{capture:a,passive:s}:a;t.forEach((function(t){return e.addEventListener(t,u,c)}));var f=function(){return t.forEach((function(t){return e.removeEventListener(t,u,c)}))};return{stop:f}}function ce(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 i=Array.isArray(e)?e:[],o=0;o<t.length;++o)i[o]=ce(i[o],t[o],n);return i}var a,s="object"==(null===(a=e)?"null":Array.isArray(a)?"array":typeof a)?e:{};for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(s[u]=ce(s[u],t[u],n));return s}}function fe(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o=i[r];null!=o&&(e=ce(e,o))}return e}!function(e){e.DOCUMENT="document",e.XHR="xhr",e.BEACON="beacon",e.FETCH="fetch",e.CSS="css",e.JS="js",e.IMAGE="image",e.FONT="font",e.MEDIA="media",e.OTHER="other"}(Z||(Z={})),function(e){e.FETCH="fetch",e.XHR="xhr"}(Q||(Q={}));var le;function de(e,t,n,r){var i=new Date;i.setTime(i.getTime()+n);var o="expires="+i.toUTCString(),a=r&&r.crossSite?"none":"strict",s=r&&r.domain?";domain="+r.domain:"",u=r&&r.secure?";secure":"";document.cookie=e+"="+t+";"+o+";path=/;samesite="+a+s+u}function pe(e){return function(e,t){var n=new RegExp("(?:^|;)\\s*"+t+"\\s*=\\s*([^;]+)").exec(e);return n?n[1]:void 0}(document.cookie,e)}function he(e,t){de(e,"",0,t)}function ve(e,t){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];try{return e.apply(void 0,n)}catch(e){r.error(t,e)}}}var ge={alternate:{logs:"logs",rum:"rum",sessionReplay:"session-replay"},classic:{logs:"browser",rum:"rum",sessionReplay:void 0}},me={logs:"logs",rum:"rum",sessionReplay:"replay"},ye=Object.keys(ge.alternate),be="datadoghq.com",we="datadoghq.eu",xe=[be,we],Ee=[be,"us3.datadoghq.com",we,"ddog-gov.com"];function ke(e,t,n){var r=t.sdkVersion,i=e.site,o=void 0===i?be:i,a=e.clientToken,s=e.env,u=e.proxyHost,c=e.service,f=e.version,l=e.intakeApiVersion,d=e.useAlternateIntakeDomains;function p(e){var t=h(e);return"https://"+(u||t)+function(e){return v(e)?"/api/v2/"+me[e]:"/v1/input/"+a}(e)}function h(e){if(function(e){return d||!ae(xe,o)||"sessionReplay"===e}(e)){var t=ge.alternate[e],n=o.split("."),r=n.pop();return t+".browser-intake-"+(n.join("-")+"."+r)}return ge.classic[e]+"-http-intake.logs."+o}function v(e){return!(!n||2!==l&&ae(Ee,o)&&"sessionReplay"!==e)}return{build:function(e,t){var n="ddsource="+(t||"browser")+"&ddtags="+encodeURIComponent("sdk_version:"+r+(s?",env:"+s:"")+(c?",service:"+c:"")+(f?",version:"+f:""));return u&&(n+="&ddhost="+h(e)),v(e)&&(n+="&dd-api-key="+a+"&dd-evp-origin-version="+r+"&dd-evp-origin=browser&dd-request-id="+ne()),p(e)+"?"+n},buildIntakeUrl:p}}var Se,Te={ALLOW:"allow",MASK:"mask",MASK_FORMS_ONLY:"mask-forms-only"},Re={allowedTracingOrigins:[],maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,sampleRate:100,replaySampleRate:100,silentMultipleInit:!1,trackInteractions:!1,trackViewsManually:!1,initialPrivacyLevel:Te.ALLOW,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function Oe(t,n){var r,i,o=Array.isArray(t.enableExperimentalFeatures)?t.enableExperimentalFeatures:[],a=function(e){return ae(o,e)},s=e(e({beforeSend:t.beforeSend&&ve(t.beforeSend,"beforeSend threw an error:"),cookieOptions:Me(t),isEnabled:a,service:t.service},function(t,n,r){var i=ke(t,n,r),o=ye.map((function(e){return i.buildIntakeUrl(e)})),a={isIntakeUrl:function(e){return o.some((function(t){return 0===e.indexOf(t)}))},logsEndpoint:i.build("logs"),rumEndpoint:i.build("rum"),sessionReplayEndpoint:i.build("sessionReplay")};if(t.internalMonitoringApiKey&&(a.internalMonitoringEndpoint=i.build("logs","browser-agent-internal-monitoring")),n.buildMode===Se.E2E_TEST&&(a.internalMonitoringEndpoint="<<< E2E INTERNAL MONITORING ENDPOINT >>>",a.logsEndpoint="<<< E2E LOGS ENDPOINT >>>",a.rumEndpoint="<<< E2E RUM ENDPOINT >>>",a.sessionReplayEndpoint="<<< E2E SESSION REPLAY ENDPOINT >>>"),n.buildMode===Se.STAGING&&void 0!==t.replica){var s=ke(e(e({},t),{site:be,applicationId:t.replica.applicationId,clientToken:t.replica.clientToken,useAlternateIntakeDomains:!0,intakeApiVersion:r?2:1}),n,r);a.replica={applicationId:t.replica.applicationId,internalMonitoringEndpoint:s.build("logs","browser-agent-internal-monitoring"),logsEndpoint:s.build("logs"),rumEndpoint:s.build("rum")};var u=ye.map((function(e){return s.buildIntakeUrl(e)}));u.forEach((function(e){return o.push(e)})),o.push.apply(o,u)}return a}(t,n,a("support-intake-v2"))),Re);return"allowedTracingOrigins"in t&&(s.allowedTracingOrigins=t.allowedTracingOrigins),"sampleRate"in t&&(s.sampleRate=t.sampleRate),"replaySampleRate"in t&&(s.replaySampleRate=t.replaySampleRate),"trackInteractions"in t&&(s.trackInteractions=!!t.trackInteractions),"trackViewsManually"in t&&(s.trackViewsManually=!!t.trackViewsManually),"actionNameAttribute"in t&&(s.actionNameAttribute=t.actionNameAttribute),s.isEnabled("initial-privacy-level-option")&&(r=Te,i=t.initialPrivacyLevel,Object.keys(r).some((function(e){return r[e]===i})))&&(s.initialPrivacyLevel=t.initialPrivacyLevel),s}function Me(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===le){for(var e="dd_site_test_"+ne(),t=window.location.hostname.split("."),n=t.pop();t.length&&!pe(e);)n=t.pop()+"."+n,de(e,"test",ee,{domain:n});he(e,{domain:n}),le=n}return le}()),t}function Le(){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}}}!function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(Se||(Se={}));var _e,Ce,Ae,Ie,Ne,Be=function(){function e(e){void 0===e&&(e=1e4),this.limit=e,this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>this.limit&&this.buffer.splice(0,1)},e.prototype.drain=function(){this.buffer.forEach((function(e){return e()})),this.buffer.length=0},e}(),De={debug:"debug",error:"error",info:"info",warn:"warn"},je=((_e={})[De.debug]=0,_e[De.info]=1,_e[De.warn]=2,_e[De.error]=3,_e),Pe=(Object.keys(De),"console"),ze="http",He=function(){function t(e,t,n,r){void 0===t&&(t=ze),void 0===n&&(n=De.debug),void 0===r&&(r={}),this.sendLog=e,this.handlerType=t,this.level=n,this.contextManager=Le(),this.contextManager.set(r)}return t.prototype.log=function(t,n,i){if(void 0===i&&(i=De.info),je[i]>=je[this.level]){var o=Array.isArray(this.handlerType)?this.handlerType:[this.handlerType];ae(o,ze)&&this.sendLog(e({message:t,status:i},fe(this.contextManager.get(),n))),ae(o,Pe)&&r.log(i+": "+t,fe(this.contextManager.get(),n))}},t.prototype.debug=function(e,t){this.log(e,t,De.debug)},t.prototype.info=function(e,t){this.log(e,t,De.info)},t.prototype.warn=function(e,t){this.log(e,t,De.warn)},t.prototype.error=function(e,t){var n={error:{origin:_}};this.log(e,fe(n,t),De.error)},t.prototype.setContext=function(e){this.contextManager.set(e)},t.prototype.addContext=function(e,t){this.contextManager.add(e,t)},t.prototype.removeContext=function(e){this.contextManager.remove(e)},t.prototype.setHandler=function(e){this.handlerType=e},t.prototype.setLevel=function(e){this.level=e},function(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);o>3&&a&&Object.defineProperty(t,n,a)}([X],t.prototype,"log",null),t}(),Ue=function(){function e(){this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return this.observers.push(e),{unsubscribe:function(){t.observers=t.observers.filter((function(t){return e!==t}))}}},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}();function qe(){return Date.now()}function Fe(){return performance.now()}function Ge(){return{relative:Fe(),timeStamp:qe()}}function Xe(e,t){return t-e}function $e(e,t){var r=function(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n,e))return r}}(e,(function(e){return e instanceof Error}));return{message:n(["console error:"],e).map((function(e){return function(e){if("string"==typeof e)return e;if(e instanceof Error)return N(w(e));return ie(e,void 0,2)}(e)})).join(" "),stack:r?I(w(r)):void 0,handlingStack:t}}function Ke(e){return p(Ae=function(t,n,r){var i=function(e,t,n,r){return e&&(void 0!==e.message||t instanceof Error)?{message:e.message||"Empty message",stack:I(e),handlingStack:r,type:e.name}:{message:n+" "+ie(t),stack:"No stack, consider using an instance of Error",handlingStack:r,type:e&&e.name}}(t,r,"Uncaught"),o=i.stack,a=i.message,s=i.type;e.notify({message:a,stack:o,type:s,source:A,startClocks:Ge(),originalError:r,handling:O.UNHANDLED})}),{stop:function(){h(Ae)}}}function Je(e){return Ve(e,function(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}(window.location)).href}function Ve(e,t){if(function(){if(void 0!==Ie)return Ie;try{var e=new URL("http://test/path");return Ie="http://test/path"===e.href}catch(e){Ie=!1}return Ie}())return void 0!==t?new URL(e,t):new URL(e);if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: '"+e+"'");var n=document,r=n.createElement("a");if(void 0!==t){var i=(n=document.implementation.createHTMLDocument("")).createElement("base");i.href=t,n.head.appendChild(i),n.body.appendChild(r)}return r.href=e,r}var We,Ye,Ze,Qe,et,tt=[],nt=[];function rt(e,t){var n=this;return K((function(){n._datadog_xhr={method:e,url:Je(t)}})),We.apply(this,arguments)}function it(){var e=this;return K((function(){if(e._datadog_xhr){e._datadog_xhr.startTime=Fe(),e._datadog_xhr.startClocks=Ge(),e._datadog_xhr.isAborted=!1;var t=!1,n=e.onreadystatechange,r=function(){this.readyState===XMLHttpRequest.DONE&&i(),n&&n.apply(this,arguments)},i=$((function(){e.removeEventListener("loadend",i),e.onreadystatechange===r&&(e.onreadystatechange=n),t||(t=!0,at(e))}));e.onreadystatechange=r,e.addEventListener("loadend",i),tt.forEach((function(t){return t(e._datadog_xhr,e)}))}})),Ye.apply(this,arguments)}function ot(){var e=this;return K((function(){e._datadog_xhr&&(e._datadog_xhr.isAborted=!0)})),Ze.apply(this,arguments)}function at(t){t._datadog_xhr.duration=Xe(t._datadog_xhr.startClocks.timeStamp,qe()),t._datadog_xhr.responseText=t.response,t._datadog_xhr.status=t.status,t._datadog_xhr.xhr=t,nt.forEach((function(n){return n(e({},t._datadog_xhr))}))}var st=[],ut=[];function ct(){return Qe||(!function(){if(!window.fetch)return;et=window.fetch,window.fetch=function(e,t){var n,r=K(ft,null,[e,t]);return r?K(lt,null,[n=et.call(this,r.input,r.init),r]):n=et.call(this,e,t),n}}(),Qe={beforeSend:function(e){st.push(e)},onRequestComplete:function(e){ut.push(e)}}),Qe}function ft(e,t){var n=t&&t.method||"object"==typeof e&&e.method||"GET",r=Je("object"==typeof e&&e.url||e),i={init:t,input:e,method:n,startClocks:Ge(),url:r};return st.forEach((function(e){return e(i)})),i}function lt(e,n){var r=this,i=function(e){return i=r,o=void 0,s=function(){var r,i;return t(this,(function(t){switch(t.label){case 0:return n.duration=Xe(n.startClocks.timeStamp,qe()),"stack"in e||e instanceof Error?(n.status=0,n.responseText=I(w(e)),n.isAborted=e instanceof DOMException&&e.code===DOMException.ABORT_ERR,n.error=e,ut.forEach((function(e){return e(n)})),[3,6]):[3,1];case 1:if(!("status"in e))return[3,6];r=void 0,t.label=2;case 2:return t.trys.push([2,4,,5]),[4,e.clone().text()];case 3:return r=t.sent(),[3,5];case 4:return i=t.sent(),r="Unable to retrieve response: "+i,[3,5];case 5:n.response=e,n.responseText=r,n.responseType=e.type,n.status=e.status,n.isAborted=!1,ut.forEach((function(e){return e(n)})),t.label=6;case 6:return[2]}}))},new((a=void 0)||(a=Promise))((function(e,t){function n(e){try{u(s.next(e))}catch(e){t(e)}}function r(e){try{u(s.throw(e))}catch(e){t(e)}}function u(t){t.done?e(t.value):new a((function(e){e(t.value)})).then(n,r)}u((s=s.apply(i,o||[])).next())}));var i,o,a,s};e.then($(i),$(i))}function dt(e,t){function n(n,r){e.isIntakeUrl(r.url)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!function(e){return e.status>=500}(r)||t.notify({message:ht(n)+" error "+r.method+" "+r.url,resource:{method:r.method,statusCode:r.status,url:r.url},source:C,stack:pt(r.responseText,e)||"Failed to load",startClocks:r.startClocks})}return(Ne||(We=XMLHttpRequest.prototype.open,Ye=XMLHttpRequest.prototype.send,Ze=XMLHttpRequest.prototype.abort,XMLHttpRequest.prototype.open=rt,XMLHttpRequest.prototype.send=it,XMLHttpRequest.prototype.abort=ot,Ne={beforeSend:function(e){tt.push(e)},onRequestComplete:function(e){nt.push(e)}}),Ne).onRequestComplete((function(e){return n(Q.XHR,e)})),ct().onRequestComplete((function(e){return n(Q.FETCH,e)})),{stop:function(){Ne&&(Ne=void 0,tt.length=0,nt.length=0,XMLHttpRequest.prototype.open=We,XMLHttpRequest.prototype.send=Ye,XMLHttpRequest.prototype.abort=Ze),Qe&&(Qe=void 0,st.splice(0,st.length),ut.splice(0,ut.length),window.fetch=et)}}}function pt(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function ht(e){return Q.XHR===e?"XHR":"Fetch"}var vt=9e5,gt=144e5;function mt(e,t,n){var r=function(e,t){var n,r,i=!1,o=function(){i=!0,clearTimeout(n),n=setTimeout((function(){i=!1}),1e3)};return{get:function(){return i||(r=pe(e),o()),r},set:function(n,i){de(e,n,i,t),r=n,o()}}}("_dd_s",e);!function(e){var t=e.get(),n=pe("_dd"),r=pe("_dd_r"),i=pe("_dd_l");if(!t){var o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o.logs=i),r&&/^[012]$/.test(r)&&(o.rum=r),xt(o,e)}}(r);var i=new Ue,o=wt(r).id,a=function(e,t,n){var r,i,o=!n||void 0===n.leading||n.leading,a=!n||void 0===n.trailing||n.trailing,s=!1;return{throttled:function(){for(var n=[],u=0;u<arguments.length;u++)n[u]=arguments[u];s?r=n:(o?e.apply(void 0,n):r=n,s=!0,i=setTimeout((function(){a&&r&&e.apply(void 0,r),s=!1,r=void 0}),t))},cancel:function(){clearTimeout(i),s=!1,r=void 0}}}($((function(){var e=wt(r),a=n(e[t]),s=a.trackingType,u=a.isTracked;e[t]=s,u&&!e.id&&(e.id=ne(),e.created=String(Date.now())),xt(e,r),u&&o!==e.id&&(o=e.id,i.notify())})),1e3).throttled;return a(),function(e){var t=ue(window,["click","touchstart","keydown","scroll"],e,{capture:!0,passive:!0}).stop;kt.push(t)}(a),function(e){var t=$((function(){"visible"===document.visibilityState&&e()})),n=se(document,"visibilitychange",t).stop;kt.push(n);var r=setInterval(t,6e4);kt.push((function(){clearInterval(r)}))}((function(){xt(wt(r),r)})),{getId:function(){return wt(r).id},getTrackingType:function(){return wt(r)[t]},renewObservable:i}}var yt=/^([a-z]+)=([a-z0-9-]+)$/,bt="&";function wt(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf("&")||yt.test(e))})(t)&&t.split(bt).forEach((function(e){var t=yt.exec(e);if(null!==t){var r=t[1],i=t[2];n[r]=i}}));return n}(e);return function(e){return(void 0===e.created||Date.now()-Number(e.created)<gt)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(Et(e),{})}function xt(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+vt);var r=function(e){return Object.keys(e).map((function(t){return[t,e[t]]}))}(e).map((function(e){return e[0]+"="+e[1]})).join(bt);t.set(r,vt)}else Et(t)}function Et(e){e.set("",0)}var kt=[];var St;function Tt(e,t){if(!t){var n=Rt(e)===St.TRACKED;return{getId:function(){},isTracked:function(){return n}}}var r=mt(e.cookieOptions,"logs",(function(t){return function(e,t){var n=function(e){return e===St.NOT_TRACKED||e===St.TRACKED}(t)?t:Rt(e);return{trackingType:n,isTracked:n===St.TRACKED}}(e,t)}));return{getId:r.getId,isTracked:function(){return r.getTrackingType()===St.TRACKED}}}function Rt(e){return 0!==(t=e.sampleRate)&&100*Math.random()<=t?St.TRACKED:St.NOT_TRACKED;var t}!function(e){e.NOT_TRACKED="0",e.TRACKED="1"}(St||(St={}));var Ot={buildMode:"release",sdkVersion:"3.2.0"};function Mt(e){var t=window.DD_RUM;return t&&t.getInternalContext?t.getInternalContext(e):void 0}var Lt,_t,Ct,At,It=function(t){var n=!1,i=Le(),o={},a=new Be,s=function(e,t){a.add((function(){return s(e,t)}))},u=function(){},c=new He(d);return f={logger:c,init:$((function(e){(function(e){return n?(e.silentMultipleInit||r.error("DD_LOGS is already initialized."),!1):e&&e.clientToken?!!(void 0===e.sampleRate||(t=e.sampleRate,function(e){return"number"==typeof e}(t)&&t>=0&&t<=100))||(r.error("Sample Rate should be a number between 0 and 100"),!1):(r.error("Client Token is not configured, we will not send any data."),!1);var t})(e)&&(s=t(e,c,i.get),u=function(){return ce(void 0,e)},a.drain(),n=!0)})),getLoggerGlobalContext:$(i.get),setLoggerGlobalContext:$(i.set),addLoggerGlobalContext:$(i.add),removeLoggerGlobalContext:$(i.remove),createLogger:$((function(t,n){return void 0===n&&(n={}),o[t]=new He(d,n.handler,n.level,e(e({},n.context),{logger:{name:t}})),o[t]})),getLogger:$((function(e){return o[e]})),getInitConfiguration:$((function(){return u()}))},l=e(e({},f),{onReady:function(e){e()}}),Object.defineProperty(l,"_setDebug",{get:function(){return W},enumerable:!1}),l;var f,l;function d(e){s(e,fe({date:Date.now(),view:{referrer:document.referrer,url:window.location.href}},i.get()))}}((function(t,n,i){var o=function(e,t){var n=Oe(e,t);return{configuration:n,internalMonitoring:G(n)}}(t,Ot),a=o.configuration,s=o.internalMonitoring,u=new Ue;return!1!==t.forwardErrorsToLogs&&(!function(t){Ce=console.error,console.error=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=B();K((function(){Ce.apply(console,n),t.notify(e(e({},$e(n,i)),{source:L,startClocks:Ge(),handling:O.HANDLED}))}))}}(u),Ke(u),dt(a,u)),function(e,t,n,r,i,o){n.setExternalContextProvider((function(){return fe({session_id:r.getId()},o(),Mt())}));var a=function(e,t,n){var r=function(e,t){var n=0,r=!1;return{isLimitReached:function(){if(0===n&&setTimeout((function(){n=0}),te),(n+=1)<=e.maxErrorsByMinute||r)return r=!1,!1;if(n===e.maxErrorsByMinute+1){r=!0;try{t({message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,source:M,startClocks:Ge()})}finally{r=!1}}return!0}}}(t,n);return function(n,i){if(e.isTracked()){var o=fe({service:t.service,session_id:e.getId()},i,Mt(),n);if(!(t.beforeSend&&!1===t.beforeSend(o)||o.status===De.error&&r.isLimitReached()))return o}}}(r,e,u),s=function(e){var t,n=r(e.logsEndpoint);void 0!==e.replica&&(t=r(e.replica.logsEndpoint));function r(t){return new U(new P(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){n.add(e),t&&t.add(e)}}}(e);function u(e){i.error(e.message,fe({date:e.startClocks.timeStamp,error:{kind:e.type,origin:e.source,stack:e.stack}},e.resource?{http:{method:e.resource.method,status_code:e.resource.statusCode,url:e.resource.url}}:void 0,Mt(e.startClocks.relative)))}return t.subscribe(u),function(e,t){var n=a(e,t);n&&s.add(n)}}(a,u,s,Tt(a,function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_"+ne(),n="test";de(t,n,ee,e);var i=pe(t)===n;return he(t,e),i}catch(e){return r.error(e),!1}}(a.cookieOptions)),n,i)}));Lt=function(){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}(),Ct=It,At=Lt[_t="DD_LOGS"],Lt[_t]=Ct,At&&At.q&&At.q.forEach((function(e){return ve(e,"onReady callback threw an error:")()}))}();

@@ -6,4 +6,4 @@ "use strict";

buildMode: 'release',
sdkVersion: '3.1.3',
sdkVersion: '3.2.0',
};
//# sourceMappingURL=buildEnv.js.map
export var buildEnv = {
buildMode: 'release',
sdkVersion: '3.1.3',
sdkVersion: '3.2.0',
};
//# sourceMappingURL=buildEnv.js.map
{
"name": "@datadog/browser-logs",
"version": "3.1.3",
"version": "3.2.0",
"license": "Apache-2.0",

@@ -16,3 +16,3 @@ "main": "cjs/index.js",

"dependencies": {
"@datadog/browser-core": "3.1.3",
"@datadog/browser-core": "3.2.0",
"tslib": "^1.10.0"

@@ -29,3 +29,3 @@ },

},
"gitHead": "73e642ca3d9fa22c33ecd81fc1e982894ed750e1"
"gitHead": "28c6c1f2c3a74bf603c795a10713ab5420968004"
}

@@ -257,4 +257,6 @@ # Browser Log Collection

For example, to redact email addresses from your web application URLs:
For examples of `beforeSend`, see [Enrich and control browser RUM data with beforeSend][5].
To redact email addresses from your web application URLs:
#### NPM

@@ -313,5 +315,4 @@

| `http.url` | String | The HTTP URL. |
| `context` | String | Extra contextual attributes added with the logger. |
**Note**: The Browser SDK will ignore modifications made to event properties not listed above. For more information about event properties, see the [Browser SDK repository][5].
### Define multiple loggers

@@ -602,2 +603,2 @@

[4]: https://github.com/DataDog/browser-sdk/blob/main/packages/logs/BROWSER_SUPPORT.md
[5]: https://github.com/DataDog/browser-sdk/blob/main/packages/logs/src/logsEvent.types.ts
[5]: /real_user_monitoring/guide/enrich-and-control-rum-data/
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