Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@datadog/browser-logs

Package Overview
Dependencies
Maintainers
1
Versions
259
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 1.15.1 to 1.15.2

2

bundle/datadog-logs.js

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

!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){"use strict";n.r(t),n.d(t,"datadogLogs",(function(){return et})),n.d(t,"makeLogsGlobal",(function(){return tt}));var r=function(){return(r=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 o(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=(o=a.trys).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 i(){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 a,s,u,c=6e4,l=60*c;!function(e){e.BEFORE_UNLOAD="beforeunload",e.CLICK="click",e.KEY_DOWN="keydown",e.LOAD="load",e.POP_STATE="popstate",e.SCROLL="scroll",e.TOUCH_START="touchstart",e.VISIBILITY_CHANGE="visibilitychange"}(a||(a={})),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"}(s||(s={})),function(e){e.FETCH="fetch",e.XHR="xhr"}(u||(u={}));var f,d=function(e){return Array.isArray(e)},p=function(e){return!Array.isArray(e)&&"object"==typeof e};function h(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(e,t){return d(e)&&d(t)?i(Array(Math.max(e.length,t.length))).map((function(n,r){return h(e[r],t[r])})):p(e)&&p(t)?Object.keys(t).reduce((function(n,o){var i;return r(r({},n),((i={})[o]=h(e[o],t[o]),i))}),e):void 0===t?e:t}),e)}function g(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])}))}function v(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,v)}function m(){}function y(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];b(e)&&(r=[!0,e.toJSON],delete e.toJSON);var o,i,a=[!1,void 0];"object"==typeof e&&b(o=Object.getPrototypeOf(e))&&(a=[!0,o.toJSON],delete o.toJSON);try{i=JSON.stringify(e,void 0,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 b(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function w(){return void 0===f&&(f=performance.timing.navigationStart),f}function E(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}var x={isCollectingError:!0,maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,trackInteractions:!1,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function T(e,t,n){var r="sdk_version:"+t.sdkVersion+(t.env?",env:"+t.env:"")+(t.service?",service:"+t.service:"")+(t.version?",version:"+t.version:""),o=e+"-http-intake.logs."+t.site,i=t.proxyHost?t.proxyHost:o,a=t.proxyHost?"ddhost="+o+"&":"",s=""+(t.applicationId?"_dd.application_id="+t.applicationId+"&":"")+a+"ddsource="+(n||"browser")+"&ddtags="+r;return"https://"+i+"/v1/input/"+t.clientToken+"?"+s}var S=1e3;function O(e,t,n){var r=new Date;r.setTime(r.getTime()+n);var o="expires="+r.toUTCString();document.cookie=e+"="+t+";"+o+";path=/;samesite=strict"}function C(e){var t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():void 0}function L(){if(void 0===document.cookie||null===document.cookie)return!1;try{return O("dd_rum_test","test",1e3),"test"===C("dd_rum_test")}catch(e){return console.error(e),!1}}var _="?",R=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var M=function(){var e,t,n,r,o,i,a=[];function s(e,t,n){var r;for(var o in a)if(k(a,o))try{a[o](e,t,n)}catch(e){r=e}if(r)throw r}function u(e,r,o,i,a){if(t)I.augmentStackTraceWithInitialElement(t,r,o,""+e),l();else if(a)s(I(a),!0,a);else{var u,c={url:r,column:i,line:o},f=e;if("[object String]"==={}.toString.call(e)){var d=f.match(R);d&&(u=d[1],f=d[2])}s({name:u,message:f,stack:[c]},!0)}return!!n&&n.apply(this,arguments)}function c(e){var t=e.reason||"Empty reason";s(I(t),!0,t)}function l(){var n=t,r=e;t=void 0,e=void 0,s(n,!1,r)}function f(n){if(t){if(e===n)return;l()}var r=I(n);throw t=r,e=n,setTimeout((function(){e===n&&l()}),r.incomplete?2e3:0),n}return f.subscribe=function(e){!function(){if(r)return;n=window.onerror,window.onerror=K(u),r=!0}(),function(){if(i)return;o=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=K(c),i=!0}(),a.push(e)},f.unsubscribe=function(e){for(var t=a.length-1;t>=0;t-=1)a[t]===e&&a.splice(t,1);0===a.length&&(r&&(window.onerror=n,r=!1),i&&(window.onunhandledrejection=o,i=!1))},f.traceKitWindowOnError=u,f}(),I=function(){var e=!1;function t(e){if(e.stack){for(var t,n,r,o,i=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,s=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,u=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,c=/\((\S*)(?::(\d+))(?::(\d+))\)/,l=e.stack.split("\n"),f=[],d=0,p=l.length;d<p;d+=1){if(i.exec(l[d])){var h=(r=i.exec(l[d]))[2]&&0===r[2].indexOf("native");t=r[2]&&0===r[2].indexOf("eval"),n=c.exec(r[2]),t&&n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3]),o={args:h?[r[2]]:[],column:r[4]?+r[4]:void 0,func:r[1]||_,line:r[3]?+r[3]:void 0,url:h?void 0:r[2]}}else if(s.exec(l[d]))o={args:[],column:(r=s.exec(l[d]))[4]?+r[4]:void 0,func:r[1]||_,line:+r[3],url:r[2]};else{if(!a.exec(l[d]))continue;t=(r=a.exec(l[d]))[3]&&r[3].indexOf(" > eval")>-1,n=u.exec(r[3]),t&&n?(r[3]=n[1],r[4]=n[2],r[5]=void 0):0!==d||r[5]||void 0===e.columnNumber||(f[0].column=e.columnNumber+1),o={args:r[2]?r[2].split(","):[],column:r[5]?+r[5]:void 0,func:r[1]||_,line:r[4]?+r[4]:void 0,url:r[3]}}!o.func&&o.line&&(o.func=_),f.push(o)}if(f.length)return{stack:f,message:e.message,name:e.name}}}function n(e,t,n,r){var o={url:t,line:n?+n:void 0};if(o.url&&o.line){e.incomplete=!1;var i=e.stack;if(i.length>0&&i[0].url===o.url){if(i[0].line===o.line)return!1;if(!i[0].line&&i[0].func===o.func)return i[0].line=o.line,i[0].context=o.context,!1}return i.unshift(o),e.partial=!0,!0}return e.incomplete=!0,!1}function r(e,t){for(var o,i,a=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,s=[],u={},c=!1,l=r.caller;l&&!c;l=l.caller)l!==I&&l!==M&&(i={args:[],column:void 0,func:_,line:void 0,url:void 0},o=a.exec(l.toString()),l.name?i.func=l.name:o&&(i.func=o[1]),void 0===i.func&&(i.func=o?o.input.substring(0,o.input.indexOf("{")):void 0),u[""+l]?c=!0:u[""+l]=!0,s.push(i));t&&s.splice(0,t);var f={stack:s,message:e.message,name:e.name};return n(f,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),f}function o(n,o){var i,a=void 0===o?0:+o;try{if(i=function(e){var t=e.stacktrace;if(t){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=_),u.context=[i[s+1]],a.push(u))}if(a.length)return{stack:a,message:e.message,name:e.name}}}(n))return i}catch(t){if(e)throw t}try{if(i=t(n))return i}catch(t){if(e)throw t}try{if(i=function(e){var t=e.message.split("\n");if(!(t.length<4)){var n,r=/^\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,i=/^\s*Line (\d+) of function script\s*$/i,a=[],s=window&&window.document&&window.document.getElementsByTagName("script"),u=[];for(var c in s)k(s,c)&&!s[c].src&&u.push(s[c]);for(var l=2;l<t.length;l+=2){var f=void 0;if(r.exec(t[l]))f={args:[],column:void 0,func:(n=r.exec(t[l]))[3],line:+n[1],url:n[2]};else if(o.exec(t[l]))f={args:[],column:void 0,func:(n=o.exec(t[l]))[4],line:+n[1],url:n[3]};else if(i.exec(t[l])){n=i.exec(t[l]),f={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+n[1]}}f&&(f.func||(f.func=_),f.context=[t[l+1]],a.push(f))}if(a.length)return{stack:a,message:t[0],name:e.name}}}(n))return i}catch(t){if(e)throw t}try{if(i=r(n,a+1))return i}catch(t){if(e)throw t}return{message:n.message,name:n.name,stack:[]}}return o.augmentStackTraceWithInitialElement=n,o.computeStackTraceFromStackProp=t,o.ofCaller=function(e){var t=1+(void 0===e?0:+e);try{throw new Error}catch(e){return I(e,t+1)}},o}();var B=/[^\u0000-\u007F]/,A=function(){function e(e,t,n){void 0===n&&(n=!1),this.endpointUrl=e,this.bytesLimit=t,this.withBatchTime=n}return e.prototype.send=function(e,t){var n=this.withBatchTime?function(e){return e+(-1===e.indexOf("?")?"?":"&")+"batch_time="+(new Date).getTime()}(this.endpointUrl):this.endpointUrl;if(navigator.sendBeacon&&t<this.bytesLimit&&navigator.sendBeacon(n,e))return;var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(e)},e}();var j,N=function(){function e(e,t,n,r,o,i){void 0===i&&(i=m),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=i(this.pushOnlyBuffer,(t=this.upsertBuffer,n=[],Object.keys(t).forEach((function(e){n.push(t[e])})),n));this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var t,n},e.prototype.sizeInBytes=function(e){return B.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),r=n.processedMessage,o=n.messageBytesSize;o>=this.maxMessageSize?console.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(r,o,t),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=y(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&&(window.addEventListener(a.BEFORE_UNLOAD,K(this.beforeUnloadCallback)),document.addEventListener(a.VISIBILITY_CHANGE,K((function(){"hidden"===document.visibilityState&&e.flush()}))),window.addEventListener(a.BEFORE_UNLOAD,K((function(){return e.flush()}))))},e}();!function(e){e.info="info",e.error="error"}(j||(j={}));var D,P,z,U,H={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 N(new A(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var r=function(e){return h({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==D?D():{},e)}(e);n.add(r),t&&t.add(r)}}}(e);g(H,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){D=e}}}function F(e,t,n){var r=n.value;n.value=function(){var e=H.batch?K(r):r;return e.apply(this,arguments)}}function K(e){return function(){try{return e.apply(this,arguments)}catch(e){X(e);try{q(e)}catch(e){X(e)}}}}function q(e){$(r(r({},function(e){if(e instanceof Error){var t=I(e);return{error:{kind:t.name,stack:ge(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+y(e)}}(e)),{status:j.error}))}function $(e){H.batch&&H.sentMessageCount<H.maxMessagesPerPage&&(H.sentMessageCount+=1,H.batch.add(e))}function V(e){H.debugMode=e}function X(e){H.debugMode&&console.warn("[INTERNAL ERROR]",e)}function J(e){return W(e,E(window.location)).href}function W(e,t){if(function(){if(void 0!==P)return P;try{var e=new URL("http://test/path");return P="http://test/path"===e.href}catch(e){P=!1}return P}())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 Y=[],Z=[];function Q(){return z||(!function(){if(!window.fetch)return;U=window.fetch,window.fetch=K((function(e,t){var n=this,r={method:t&&t.method||"object"==typeof e&&e.method||"GET",startTime:performance.now()},i=function(t){return i=n,a=void 0,u=function(){var n,i;return o(this,(function(o){switch(o.label){case 0:return r.duration=performance.now()-r.startTime,r.url=J("object"==typeof e&&e.url||e),"stack"in t||t instanceof Error?(r.status=0,r.response=ge(I(t)),Z.forEach((function(e){return e(r)})),[3,6]):[3,1];case 1:if(!("status"in t))return[3,6];n=void 0,o.label=2;case 2:return o.trys.push([2,4,,5]),[4,t.clone().text()];case 3:return n=o.sent(),[3,5];case 4:return i=o.sent(),n="Unable to retrieve response: "+i,[3,5];case 5:r.response=n,r.responseType=t.type,r.status=t.status,Z.forEach((function(e){return e(r)})),o.label=6;case 6:return[2]}}))},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{o(u.next(e))}catch(e){t(e)}}function r(e){try{o(u.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new s((function(e){e(t.value)})).then(n,r)}o((u=u.apply(i,a||[])).next())}));var i,a,s,u};Y.forEach((function(e){return e(r)}));var a=U.call(this,e,t);return a.then(K(i),K(i)),a}))}(),z={beforeSend:function(e){Y.push(e)},onRequestComplete:function(e){Z.push(e)}}),z}var ee,te,ne,re,oe,ie,ae,se,ue,ce=function(){function e(){this.observers=[]}return e.prototype.subscribe=function(e){this.observers.push(e)},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}(),le=[],fe=[];function de(){return ee||(te=XMLHttpRequest.prototype.open,ne=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.open=K((function(e,t){return this._datadog_xhr={method:e,url:J(t)},te.apply(this,arguments)})),XMLHttpRequest.prototype.send=K((function(e){var t=this;if(this._datadog_xhr){this._datadog_xhr.startTime=performance.now();var n=this.onreadystatechange;this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&K(o)(),n&&n.apply(this,arguments)};var r=!1,o=function(){r||(r=!0,t._datadog_xhr.duration=performance.now()-t._datadog_xhr.startTime,t._datadog_xhr.response=t.response,t._datadog_xhr.status=t.status,fe.forEach((function(e){return e(t._datadog_xhr)})))};this.addEventListener("loadend",K(o)),le.forEach((function(e){return e(t._datadog_xhr)}))}return ne.apply(this,arguments)})),ee={beforeSend:function(e){le.push(e)},onRequestComplete:function(e){fe.push(e)}}),ee}function pe(e){if(!oe){var t=new ce;e.isCollectingError&&(function(e,t){function n(n,r){(function(e){return 0===e.status&&"opaque"!==e.responseType}(r)||function(e){return e.status>=500}(r))&&t.notify({context:{error:{origin:re.NETWORK,stack:ve(r.response,e)||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url}},message:me(n)+" error "+r.method+" "+r.url,startTime:r.startTime})}de().onRequestComplete((function(e){return n(u.XHR,e)})),Q().onRequestComplete((function(e){return n(u.FETCH,e)}))}(e,t),function(e){ie=console.error,console.error=K((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ie.apply(console,i([t],n)),e.notify({context:{error:{origin:re.CONSOLE}},message:i(["console error:",t],n).map(he).join(" "),startTime:performance.now()})}))}(t),function(e){ae=function(t,n,r){e.notify(function(e,t){var n,r;void 0!==e.message||t instanceof Error?(n=e.message||"Empty message",r=ge(e)):(n="Uncaught "+y(t),r="No stack, consider using an instance of Error");return{message:n,context:{error:{stack:r,kind:e.name,origin:re.SOURCE}},startTime:performance.now()}}(t,r))},M.subscribe(ae)}(t)),oe=function(e,t){var n=0,r=new ce;return t.subscribe((function(t){n<e.maxErrorsByMinute?(n+=1,r.notify(t)):n===e.maxErrorsByMinute&&(n+=1,r.notify({context:{error:{origin:re.AGENT}},message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,startTime:performance.now()}))})),setInterval((function(){return n=0}),c),r}(e,t)}return oe}function he(e){return"string"==typeof e?e:e instanceof Error?ge(I(e)):y(e,0,2)}function ge(e){var t=(e.name||"Error")+": "+e.message;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 ve(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function me(e){return u.XHR===e?"XHR":"Fetch"}function ye(e){console.warn("'"+e+"' not yet available, please call '.init()' first.")}!function(e){e.AGENT="agent",e.CONSOLE="console",e.NETWORK="network",e.SOURCE="source",e.LOGGER="logger"}(re||(re={})),function(e){e.US="us",e.EU="eu"}(ue||(ue={}));var be,we=((se={})[ue.EU]="datadoghq.eu",se[ue.US]="datadoghq.com",se);function Ee(e,t){var n=function(e,t){var n={applicationId:e.applicationId,buildMode:t.buildMode,clientToken:e.clientToken,env:e.env,proxyHost:e.proxyHost,sdkVersion:t.sdkVersion,service:e.service,site:e.site||we[e.datacenter||t.datacenter],version:e.version},o=Array.isArray(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],i=r({isEnabled:function(e){return t=e,-1!==o.indexOf(t);var t},logsEndpoint:T("browser",n),rumEndpoint:T("rum",n),traceEndpoint:T("public-trace",n)},x);if(e.internalMonitoringApiKey&&(i.internalMonitoringEndpoint=T("browser",n,"browser-agent-internal-monitoring")),"isCollectingError"in e&&(i.isCollectingError=!!e.isCollectingError),"sampleRate"in e&&(i.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(i.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(i.trackInteractions=!!e.trackInteractions),n.buildMode===be.E2E_TEST&&(void 0!==e.internalMonitoringEndpoint&&(i.internalMonitoringEndpoint=e.internalMonitoringEndpoint),void 0!==e.logsEndpoint&&(i.logsEndpoint=e.logsEndpoint),void 0!==e.rumEndpoint&&(i.rumEndpoint=e.rumEndpoint)),n.buildMode===be.STAGING&&void 0!==e.replica){var a=r(r({},n),{applicationId:e.replica.applicationId,clientToken:e.replica.clientToken,site:we[ue.US]});i.replica={applicationId:e.replica.applicationId,internalMonitoringEndpoint:T("browser",a,"browser-agent-internal-monitoring"),logsEndpoint:T("browser",a),rumEndpoint:T("rum",a)}}return i}(e,t),o=G(n);return{configuration:n,errorObservable:pe(n),internalMonitoring:o}}function xe(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}!function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(be||(be={}));var Te,Se,Oe={buildMode:"release",datacenter:"us",sdkVersion:"1.15.1"};!function(e){e.debug="debug",e.info="info",e.warn="warn",e.error="error"}(Se||(Se={}));var Ce,Le,_e=((Te={})[Se.debug]=0,Te[Se.info]=1,Te[Se.warn]=2,Te[Se.error]=3,Te);Object.keys(Se);function Re(e,t,n,o){var i,a={};o.setExternalContextProvider((function(){return h({session_id:n.getId()},a,Ie())}));var s=function(e,t,n){var r,o=i(e.logsEndpoint);void 0!==e.replica&&(r=i(e.replica.logsEndpoint));function i(t){return new N(new A(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var i=function(e){return h({date:(new Date).getTime(),session_id:t.getId(),view:{referrer:document.referrer,url:window.location.href}},n(),Ie(),e)}(e);o.add(i),r&&r.add(i)}}}(t,n,(function(){return a})),u=((i={})[Ce.console]=function(e){return console.log(e.status+": "+e.message)},i[Ce.http]=function(e){return s.add(e)},i[Ce.silent]=m,i),c=new Me(n,u);Le={},e.subscribe((function(e){return c.error(e.message,h(r({date:(t=e.startTime,Math.floor(w()+t))},e.context),Ie(e.startTime)));var t}));var l={setLoggerGlobalContext:function(e){a=e},addLoggerGlobalContext:function(e,t){a[e]=t}};return l.createLogger=function(e,t){return function(n,o){return void 0===o&&(o={}),Le[n]=new Me(e,t,o.handler,o.level,r(r({},o.context),{logger:{name:n}})),Le[n]}}(n,u),l.getLogger=ke,l.logger=c,l}function ke(e){return Le[e]}!function(e){e.http="http",e.console="console",e.silent="silent"}(Ce||(Ce={}));var Me=function(){function e(e,t,n,r,o){void 0===n&&(n=Ce.http),void 0===r&&(r=Se.debug),void 0===o&&(o={}),this.session=e,this.handlers=t,this.level=r,this.loggerContext=o,this.handler=this.handlers[n]}return e.prototype.log=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n=Se.info),this.session.isTracked()&&_e[n]>=_e[this.level]&&this.handler(r({message:e,status:n},h({},this.loggerContext,t)))},e.prototype.debug=function(e,t){void 0===t&&(t={}),this.log(e,t,Se.debug)},e.prototype.info=function(e,t){void 0===t&&(t={}),this.log(e,t,Se.info)},e.prototype.warn=function(e,t){void 0===t&&(t={}),this.log(e,t,Se.warn)},e.prototype.error=function(e,t){void 0===t&&(t={});var n={error:{origin:re.LOGGER}};this.log(e,h({},n,t),Se.error)},e.prototype.setContext=function(e){this.loggerContext=e},e.prototype.addContext=function(e,t){this.loggerContext[e]=t},e.prototype.removeContext=function(e){delete this.loggerContext[e]},e.prototype.setHandler=function(e){this.handler=this.handlers[e]},e.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)}([F],e.prototype,"log",null),e}();function Ie(e){var t=window.DD_RUM;return t&&t.getInternalContext?t.getInternalContext(e):void 0}var Be="_dd",Ae="_dd_r",je="_dd_l",Ne="rum",De="logs";var Pe="_dd_s",ze=15*c,Ue=4*l,He=c;function Ge(e,t){var n,r,o,i,s,u=(n=Pe,i=!1,s=function(){i=!0,window.clearTimeout(r),r=window.setTimeout((function(){i=!1}),S)},{get:function(){return i?o:(o=C(n),s(),o)},set:function(e,t){O(n,e,t),o=e,s()}});!function(e){var t=e.get(),n=C(Be),r=C(Ae),o=C(je);if(!t){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i[De]=o),r&&/^[012]$/.test(r)&&(i[Ne]=r),$e(i,e)}}(u);var c,l,f,d,p,h,g,m,y,b=new ce,w=qe(u).id,E=(c=function(){var n=qe(u),r=t(n[e]),o=r.trackingType,i=r.isTracked;n[e]=o,i&&!n.id&&(n.id=v(),n.created=String(Date.now())),$e(n,u),i&&w!==n.id&&(w=n.id,b.notify())},l=S,p=!f||void 0===f.leading||f.leading,h=!f||void 0===f.trailing||f.trailing,g=!1,m=!1,y=!1,{throttled:function(){var e=this;y||(g?m=!0:(p?c.apply(this):m=!0,g=!0,d=window.setTimeout((function(){h&&m&&c.apply(e),g=!1,m=!1}),l)))},stop:function(){window.clearTimeout(d),y=!0}}).throttled;return E(),function(e){var t=K(e),n={capture:!0,passive:!0};[a.CLICK,a.TOUCH_START,a.KEY_DOWN,a.SCROLL].forEach((function(e){document.addEventListener(e,t,n),Xe.push((function(){return document.removeEventListener(e,t,n)}))}))}(E),function(e){var t=K((function(){"visible"===document.visibilityState&&e()})),n=window.setInterval(t,He);document.addEventListener(a.VISIBILITY_CHANGE,t),Xe.push((function(){clearInterval(n),document.removeEventListener(a.VISIBILITY_CHANGE,t)}))}((function(){$e(qe(u),u)})),{getId:function(){return qe(u).id},getTrackingType:function(){return qe(u)[e]},renewObservable:b}}var Fe=/^([a-z]+)=([a-z0-9-]+)$/,Ke="&";function qe(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf(Ke)||Fe.test(e))})(t)&&t.split(Ke).forEach((function(e){var t=Fe.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)<Ue)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(Ve(e),{})}function $e(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+ze);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(Ke);t.set(r,ze)}else Ve(t)}function Ve(e){e.set("",0)}var Xe=[];var Je,We="logs";function Ye(e,t){if(!t){var n=Ze(e)===Je.TRACKED;return{getId:function(){},isTracked:function(){return n}}}var r=Ge(We,(function(t){return function(e,t){var n=function(e){return e===Je.NOT_TRACKED||e===Je.TRACKED}(t)?t:Ze(e);return{trackingType:n,isTracked:n===Je.TRACKED}}(e,t)}));return{getId:r.getId,isTracked:function(){return r.getTrackingType()===Je.TRACKED}}}function Ze(e){return 0!==(t=e.sampleRate)&&100*Math.random()<=t?Je.TRACKED:Je.NOT_TRACKED;var t}!function(e){e.NOT_TRACKED="0",e.TRACKED="1"}(Je||(Je={}));var Qe={debug:function(e,t){ye("logs.logger.debug")},error:function(e,t){ye("logs.logger.error")},info:function(e,t){ye("logs.logger.info")},log:function(e,t,n){ye("logs.logger.log")},warn:function(e,t){ye("logs.logger.warn")},setContext:function(e){ye("logs.logger.setContext")},addContext:function(e,t){ye("logs.logger.addContext")},removeContext:function(e){ye("logs.logger.removeContext")},setHandler:function(e){ye("logs.logger.setHandler")},setLevel:function(e){ye("logs.logger.setLevel")}},et=tt({logger:Qe,init:function(e){ye("core.init")},addLoggerGlobalContext:function(e,t){ye("addLoggerGlobalContext")},setLoggerGlobalContext:function(e){ye("setLoggerGlobalContext")},createLogger:function(e,t){return ye("createLogger"),Qe},getLogger:function(e){ye("getLogger")}});function tt(e){var t=function(e){var t=r({},e);return Object.defineProperty(t,"_setDebug",{get:function(){return V},enumerable:!1}),t}(e),n=!1;return t.init=K((function(e){if(xe()&&function(e){if(n)return e.silentMultipleInit||console.error("DD_LOGS is already initialized."),!1;if(!e||!e.publicApiKey&&!e.clientToken)return console.error("Client Token is not configured, we will not send any data."),!1;if(void 0!==e.sampleRate&&(t=e.sampleRate,!(function(e){return"number"==typeof e}(t)&&t>=0&&t<=100)))return console.error("Sample Rate should be a number between 0 and 100"),!1;var t;return!0}(e)){e.publicApiKey&&(e.clientToken=e.publicApiKey,console.warn("Public API Key is deprecated. Please use Client Token instead."));var o=!1!==e.forwardErrorsToLogs,i=Ee(r(r({},e),{isCollectingError:o}),Oe),a=i.errorObservable,s=i.configuration,u=i.internalMonitoring,c=Re(a,s,Ye(s,L()),u);g(t,c),n=!0}})),t}(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}()).DD_LOGS=et}]);
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){"use strict";n.r(t),n.d(t,"datadogLogs",(function(){return et})),n.d(t,"makeLogsGlobal",(function(){return tt}));var r=function(){return(r=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 o(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=(o=a.trys).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 i(){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 a,s,u,c=6e4,l=60*c;!function(e){e.BEFORE_UNLOAD="beforeunload",e.CLICK="click",e.KEY_DOWN="keydown",e.LOAD="load",e.POP_STATE="popstate",e.SCROLL="scroll",e.TOUCH_START="touchstart",e.VISIBILITY_CHANGE="visibilitychange"}(a||(a={})),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"}(s||(s={})),function(e){e.FETCH="fetch",e.XHR="xhr"}(u||(u={}));var f,d=function(e){return Array.isArray(e)},p=function(e){return!Array.isArray(e)&&"object"==typeof e};function h(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(e,t){return d(e)&&d(t)?i(Array(Math.max(e.length,t.length))).map((function(n,r){return h(e[r],t[r])})):p(e)&&p(t)?Object.keys(t).reduce((function(n,o){var i;return r(r({},n),((i={})[o]=h(e[o],t[o]),i))}),e):void 0===t?e:t}),e)}function g(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])}))}function v(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,v)}function m(){}function y(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];b(e)&&(r=[!0,e.toJSON],delete e.toJSON);var o,i,a=[!1,void 0];"object"==typeof e&&b(o=Object.getPrototypeOf(e))&&(a=[!0,o.toJSON],delete o.toJSON);try{i=JSON.stringify(e,void 0,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 b(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function w(){return void 0===f&&(f=performance.timing.navigationStart),f}function E(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}var x={isCollectingError:!0,maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,trackInteractions:!1,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function T(e,t,n){var r="sdk_version:"+t.sdkVersion+(t.env?",env:"+t.env:"")+(t.service?",service:"+t.service:"")+(t.version?",version:"+t.version:""),o=e+"-http-intake.logs."+t.site,i=t.proxyHost?t.proxyHost:o,a=t.proxyHost?"ddhost="+o+"&":"",s=""+(t.applicationId?"_dd.application_id="+t.applicationId+"&":"")+a+"ddsource="+(n||"browser")+"&ddtags="+r;return"https://"+i+"/v1/input/"+t.clientToken+"?"+s}var S=1e3;function O(e,t,n){var r=new Date;r.setTime(r.getTime()+n);var o="expires="+r.toUTCString();document.cookie=e+"="+t+";"+o+";path=/;samesite=strict"}function C(e){var t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():void 0}function L(){if(void 0===document.cookie||null===document.cookie)return!1;try{return O("dd_rum_test","test",1e3),"test"===C("dd_rum_test")}catch(e){return console.error(e),!1}}var _="?",R=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var M=function(){var e,t,n,r,o,i,a=[];function s(e,t,n){var r;for(var o in a)if(k(a,o))try{a[o](e,t,n)}catch(e){r=e}if(r)throw r}function u(e,r,o,i,a){if(t)I.augmentStackTraceWithInitialElement(t,r,o,""+e),l();else if(a)s(I(a),!0,a);else{var u,c={url:r,column:i,line:o},f=e;if("[object String]"==={}.toString.call(e)){var d=f.match(R);d&&(u=d[1],f=d[2])}s({name:u,message:f,stack:[c]},!0)}return!!n&&n.apply(this,arguments)}function c(e){var t=e.reason||"Empty reason";s(I(t),!0,t)}function l(){var n=t,r=e;t=void 0,e=void 0,s(n,!1,r)}function f(n){if(t){if(e===n)return;l()}var r=I(n);throw t=r,e=n,setTimeout((function(){e===n&&l()}),r.incomplete?2e3:0),n}return f.subscribe=function(e){!function(){if(r)return;n=window.onerror,window.onerror=K(u),r=!0}(),function(){if(i)return;o=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=K(c),i=!0}(),a.push(e)},f.unsubscribe=function(e){for(var t=a.length-1;t>=0;t-=1)a[t]===e&&a.splice(t,1);0===a.length&&(r&&(window.onerror=n,r=!1),i&&(window.onunhandledrejection=o,i=!1))},f.traceKitWindowOnError=u,f}(),I=function(){var e=!1;function t(e){if(e.stack){for(var t,n,r,o,i=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,s=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,u=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,c=/\((\S*)(?::(\d+))(?::(\d+))\)/,l=e.stack.split("\n"),f=[],d=0,p=l.length;d<p;d+=1){if(i.exec(l[d])){var h=(r=i.exec(l[d]))[2]&&0===r[2].indexOf("native");t=r[2]&&0===r[2].indexOf("eval"),n=c.exec(r[2]),t&&n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3]),o={args:h?[r[2]]:[],column:r[4]?+r[4]:void 0,func:r[1]||_,line:r[3]?+r[3]:void 0,url:h?void 0:r[2]}}else if(s.exec(l[d]))o={args:[],column:(r=s.exec(l[d]))[4]?+r[4]:void 0,func:r[1]||_,line:+r[3],url:r[2]};else{if(!a.exec(l[d]))continue;t=(r=a.exec(l[d]))[3]&&r[3].indexOf(" > eval")>-1,n=u.exec(r[3]),t&&n?(r[3]=n[1],r[4]=n[2],r[5]=void 0):0!==d||r[5]||void 0===e.columnNumber||(f[0].column=e.columnNumber+1),o={args:r[2]?r[2].split(","):[],column:r[5]?+r[5]:void 0,func:r[1]||_,line:r[4]?+r[4]:void 0,url:r[3]}}!o.func&&o.line&&(o.func=_),f.push(o)}if(f.length)return{stack:f,message:e.message,name:e.name}}}function n(e,t,n,r){var o={url:t,line:n?+n:void 0};if(o.url&&o.line){e.incomplete=!1;var i=e.stack;if(i.length>0&&i[0].url===o.url){if(i[0].line===o.line)return!1;if(!i[0].line&&i[0].func===o.func)return i[0].line=o.line,i[0].context=o.context,!1}return i.unshift(o),e.partial=!0,!0}return e.incomplete=!0,!1}function r(e,t){for(var o,i,a=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,s=[],u={},c=!1,l=r.caller;l&&!c;l=l.caller)l!==I&&l!==M&&(i={args:[],column:void 0,func:_,line:void 0,url:void 0},o=a.exec(l.toString()),l.name?i.func=l.name:o&&(i.func=o[1]),void 0===i.func&&(i.func=o?o.input.substring(0,o.input.indexOf("{")):void 0),u[""+l]?c=!0:u[""+l]=!0,s.push(i));t&&s.splice(0,t);var f={stack:s,message:e.message,name:e.name};return n(f,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),f}function o(n,o){var i,a=void 0===o?0:+o;try{if(i=function(e){var t=e.stacktrace;if(t){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=_),u.context=[i[s+1]],a.push(u))}if(a.length)return{stack:a,message:e.message,name:e.name}}}(n))return i}catch(t){if(e)throw t}try{if(i=t(n))return i}catch(t){if(e)throw t}try{if(i=function(e){var t=e.message.split("\n");if(!(t.length<4)){var n,r=/^\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,i=/^\s*Line (\d+) of function script\s*$/i,a=[],s=window&&window.document&&window.document.getElementsByTagName("script"),u=[];for(var c in s)k(s,c)&&!s[c].src&&u.push(s[c]);for(var l=2;l<t.length;l+=2){var f=void 0;if(r.exec(t[l]))f={args:[],column:void 0,func:(n=r.exec(t[l]))[3],line:+n[1],url:n[2]};else if(o.exec(t[l]))f={args:[],column:void 0,func:(n=o.exec(t[l]))[4],line:+n[1],url:n[3]};else if(i.exec(t[l])){n=i.exec(t[l]),f={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+n[1]}}f&&(f.func||(f.func=_),f.context=[t[l+1]],a.push(f))}if(a.length)return{stack:a,message:t[0],name:e.name}}}(n))return i}catch(t){if(e)throw t}try{if(i=r(n,a+1))return i}catch(t){if(e)throw t}return{message:n.message,name:n.name,stack:[]}}return o.augmentStackTraceWithInitialElement=n,o.computeStackTraceFromStackProp=t,o.ofCaller=function(e){var t=1+(void 0===e?0:+e);try{throw new Error}catch(e){return I(e,t+1)}},o}();var B=/[^\u0000-\u007F]/,A=function(){function e(e,t,n){void 0===n&&(n=!1),this.endpointUrl=e,this.bytesLimit=t,this.withBatchTime=n}return e.prototype.send=function(e,t){var n=this.withBatchTime?function(e){return e+(-1===e.indexOf("?")?"?":"&")+"batch_time="+(new Date).getTime()}(this.endpointUrl):this.endpointUrl;if(navigator.sendBeacon&&t<this.bytesLimit&&navigator.sendBeacon(n,e))return;var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(e)},e}();var j,N=function(){function e(e,t,n,r,o,i){void 0===i&&(i=m),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=i(this.pushOnlyBuffer,(t=this.upsertBuffer,n=[],Object.keys(t).forEach((function(e){n.push(t[e])})),n));this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var t,n},e.prototype.sizeInBytes=function(e){return B.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),r=n.processedMessage,o=n.messageBytesSize;o>=this.maxMessageSize?console.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(r,o,t),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=y(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&&(window.addEventListener(a.BEFORE_UNLOAD,K(this.beforeUnloadCallback)),document.addEventListener(a.VISIBILITY_CHANGE,K((function(){"hidden"===document.visibilityState&&e.flush()}))),window.addEventListener(a.BEFORE_UNLOAD,K((function(){return e.flush()}))))},e}();!function(e){e.info="info",e.error="error"}(j||(j={}));var D,P,z,U,H={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 N(new A(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var r=function(e){return h({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==D?D():{},e)}(e);n.add(r),t&&t.add(r)}}}(e);g(H,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){D=e}}}function F(e,t,n){var r=n.value;n.value=function(){var e=H.batch?K(r):r;return e.apply(this,arguments)}}function K(e){return function(){try{return e.apply(this,arguments)}catch(e){X(e);try{q(e)}catch(e){X(e)}}}}function q(e){$(r(r({},function(e){if(e instanceof Error){var t=I(e);return{error:{kind:t.name,stack:ge(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+y(e)}}(e)),{status:j.error}))}function $(e){H.batch&&H.sentMessageCount<H.maxMessagesPerPage&&(H.sentMessageCount+=1,H.batch.add(e))}function V(e){H.debugMode=e}function X(e){H.debugMode&&console.warn("[INTERNAL ERROR]",e)}function J(e){return W(e,E(window.location)).href}function W(e,t){if(function(){if(void 0!==P)return P;try{var e=new URL("http://test/path");return P="http://test/path"===e.href}catch(e){P=!1}return P}())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 Y=[],Z=[];function Q(){return z||(!function(){if(!window.fetch)return;U=window.fetch,window.fetch=K((function(e,t){var n=this,r={method:t&&t.method||"object"==typeof e&&e.method||"GET",startTime:performance.now()},i=function(t){return i=n,a=void 0,u=function(){var n,i;return o(this,(function(o){switch(o.label){case 0:return r.duration=performance.now()-r.startTime,r.url=J("object"==typeof e&&e.url||e),"stack"in t||t instanceof Error?(r.status=0,r.response=ge(I(t)),Z.forEach((function(e){return e(r)})),[3,6]):[3,1];case 1:if(!("status"in t))return[3,6];n=void 0,o.label=2;case 2:return o.trys.push([2,4,,5]),[4,t.clone().text()];case 3:return n=o.sent(),[3,5];case 4:return i=o.sent(),n="Unable to retrieve response: "+i,[3,5];case 5:r.response=n,r.responseType=t.type,r.status=t.status,Z.forEach((function(e){return e(r)})),o.label=6;case 6:return[2]}}))},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{o(u.next(e))}catch(e){t(e)}}function r(e){try{o(u.throw(e))}catch(e){t(e)}}function o(t){t.done?e(t.value):new s((function(e){e(t.value)})).then(n,r)}o((u=u.apply(i,a||[])).next())}));var i,a,s,u};Y.forEach((function(e){return e(r)}));var a=U.call(this,e,t);return a.then(K(i),K(i)),a}))}(),z={beforeSend:function(e){Y.push(e)},onRequestComplete:function(e){Z.push(e)}}),z}var ee,te,ne,re,oe,ie,ae,se,ue,ce=function(){function e(){this.observers=[]}return e.prototype.subscribe=function(e){this.observers.push(e)},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}(),le=[],fe=[];function de(){return ee||(te=XMLHttpRequest.prototype.open,ne=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.open=K((function(e,t){return this._datadog_xhr={method:e,url:J(t)},te.apply(this,arguments)})),XMLHttpRequest.prototype.send=K((function(e){var t=this;if(this._datadog_xhr){this._datadog_xhr.startTime=performance.now();var n=this.onreadystatechange;this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&K(o)(),n&&n.apply(this,arguments)};var r=!1,o=function(){r||(r=!0,t._datadog_xhr.duration=performance.now()-t._datadog_xhr.startTime,t._datadog_xhr.response=t.response,t._datadog_xhr.status=t.status,fe.forEach((function(e){return e(t._datadog_xhr)})))};this.addEventListener("loadend",K(o)),le.forEach((function(e){return e(t._datadog_xhr)}))}return ne.apply(this,arguments)})),ee={beforeSend:function(e){le.push(e)},onRequestComplete:function(e){fe.push(e)}}),ee}function pe(e){if(!oe){var t=new ce;e.isCollectingError&&(function(e,t){function n(n,r){(function(e){return 0===e.status&&"opaque"!==e.responseType}(r)||function(e){return e.status>=500}(r))&&t.notify({context:{error:{origin:re.NETWORK,stack:ve(r.response,e)||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url}},message:me(n)+" error "+r.method+" "+r.url,startTime:r.startTime})}de().onRequestComplete((function(e){return n(u.XHR,e)})),Q().onRequestComplete((function(e){return n(u.FETCH,e)}))}(e,t),function(e){ie=console.error,console.error=K((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ie.apply(console,i([t],n)),e.notify({context:{error:{origin:re.CONSOLE}},message:i(["console error:",t],n).map(he).join(" "),startTime:performance.now()})}))}(t),function(e){ae=function(t,n,r){e.notify(function(e,t){var n,r;void 0!==e.message||t instanceof Error?(n=e.message||"Empty message",r=ge(e)):(n="Uncaught "+y(t),r="No stack, consider using an instance of Error");return{message:n,context:{error:{stack:r,kind:e.name,origin:re.SOURCE}},startTime:performance.now()}}(t,r))},M.subscribe(ae)}(t)),oe=function(e,t){var n=0,r=new ce;return t.subscribe((function(t){n<e.maxErrorsByMinute?(n+=1,r.notify(t)):n===e.maxErrorsByMinute&&(n+=1,r.notify({context:{error:{origin:re.AGENT}},message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,startTime:performance.now()}))})),setInterval((function(){return n=0}),c),r}(e,t)}return oe}function he(e){return"string"==typeof e?e:e instanceof Error?ge(I(e)):y(e,0,2)}function ge(e){var t=(e.name||"Error")+": "+e.message;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 ve(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function me(e){return u.XHR===e?"XHR":"Fetch"}function ye(e){console.warn("'"+e+"' not yet available, please call '.init()' first.")}!function(e){e.AGENT="agent",e.CONSOLE="console",e.NETWORK="network",e.SOURCE="source",e.LOGGER="logger"}(re||(re={})),function(e){e.US="us",e.EU="eu"}(ue||(ue={}));var be,we=((se={})[ue.EU]="datadoghq.eu",se[ue.US]="datadoghq.com",se);function Ee(e,t){var n=function(e,t){var n={applicationId:e.applicationId,buildMode:t.buildMode,clientToken:e.clientToken,env:e.env,proxyHost:e.proxyHost,sdkVersion:t.sdkVersion,service:e.service,site:e.site||we[e.datacenter||t.datacenter],version:e.version},o=Array.isArray(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],i=r({isEnabled:function(e){return t=e,-1!==o.indexOf(t);var t},logsEndpoint:T("browser",n),rumEndpoint:T("rum",n),traceEndpoint:T("public-trace",n)},x);if(e.internalMonitoringApiKey&&(i.internalMonitoringEndpoint=T("browser",n,"browser-agent-internal-monitoring")),"isCollectingError"in e&&(i.isCollectingError=!!e.isCollectingError),"sampleRate"in e&&(i.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(i.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(i.trackInteractions=!!e.trackInteractions),n.buildMode===be.E2E_TEST&&(void 0!==e.internalMonitoringEndpoint&&(i.internalMonitoringEndpoint=e.internalMonitoringEndpoint),void 0!==e.logsEndpoint&&(i.logsEndpoint=e.logsEndpoint),void 0!==e.rumEndpoint&&(i.rumEndpoint=e.rumEndpoint)),n.buildMode===be.STAGING&&void 0!==e.replica){var a=r(r({},n),{applicationId:e.replica.applicationId,clientToken:e.replica.clientToken,site:we[ue.US]});i.replica={applicationId:e.replica.applicationId,internalMonitoringEndpoint:T("browser",a,"browser-agent-internal-monitoring"),logsEndpoint:T("browser",a),rumEndpoint:T("rum",a)}}return i}(e,t),o=G(n);return{configuration:n,errorObservable:pe(n),internalMonitoring:o}}function xe(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}!function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(be||(be={}));var Te,Se,Oe={buildMode:"release",datacenter:"us",sdkVersion:"1.15.2"};!function(e){e.debug="debug",e.info="info",e.warn="warn",e.error="error"}(Se||(Se={}));var Ce,Le,_e=((Te={})[Se.debug]=0,Te[Se.info]=1,Te[Se.warn]=2,Te[Se.error]=3,Te);Object.keys(Se);function Re(e,t,n,o){var i,a={};o.setExternalContextProvider((function(){return h({session_id:n.getId()},a,Ie())}));var s=function(e,t,n){var r,o=i(e.logsEndpoint);void 0!==e.replica&&(r=i(e.replica.logsEndpoint));function i(t){return new N(new A(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var i=function(e){return h({date:(new Date).getTime(),session_id:t.getId(),view:{referrer:document.referrer,url:window.location.href}},n(),Ie(),e)}(e);o.add(i),r&&r.add(i)}}}(t,n,(function(){return a})),u=((i={})[Ce.console]=function(e){return console.log(e.status+": "+e.message)},i[Ce.http]=function(e){return s.add(e)},i[Ce.silent]=m,i),c=new Me(n,u);Le={},e.subscribe((function(e){return c.error(e.message,h(r({date:(t=e.startTime,Math.floor(w()+t))},e.context),Ie(e.startTime)));var t}));var l={setLoggerGlobalContext:function(e){a=e},addLoggerGlobalContext:function(e,t){a[e]=t}};return l.createLogger=function(e,t){return function(n,o){return void 0===o&&(o={}),Le[n]=new Me(e,t,o.handler,o.level,r(r({},o.context),{logger:{name:n}})),Le[n]}}(n,u),l.getLogger=ke,l.logger=c,l}function ke(e){return Le[e]}!function(e){e.http="http",e.console="console",e.silent="silent"}(Ce||(Ce={}));var Me=function(){function e(e,t,n,r,o){void 0===n&&(n=Ce.http),void 0===r&&(r=Se.debug),void 0===o&&(o={}),this.session=e,this.handlers=t,this.level=r,this.loggerContext=o,this.handler=this.handlers[n]}return e.prototype.log=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n=Se.info),this.session.isTracked()&&_e[n]>=_e[this.level]&&this.handler(r({message:e,status:n},h({},this.loggerContext,t)))},e.prototype.debug=function(e,t){void 0===t&&(t={}),this.log(e,t,Se.debug)},e.prototype.info=function(e,t){void 0===t&&(t={}),this.log(e,t,Se.info)},e.prototype.warn=function(e,t){void 0===t&&(t={}),this.log(e,t,Se.warn)},e.prototype.error=function(e,t){void 0===t&&(t={});var n={error:{origin:re.LOGGER}};this.log(e,h({},n,t),Se.error)},e.prototype.setContext=function(e){this.loggerContext=e},e.prototype.addContext=function(e,t){this.loggerContext[e]=t},e.prototype.removeContext=function(e){delete this.loggerContext[e]},e.prototype.setHandler=function(e){this.handler=this.handlers[e]},e.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)}([F],e.prototype,"log",null),e}();function Ie(e){var t=window.DD_RUM;return t&&t.getInternalContext?t.getInternalContext(e):void 0}var Be="_dd",Ae="_dd_r",je="_dd_l",Ne="rum",De="logs";var Pe="_dd_s",ze=15*c,Ue=4*l,He=c;function Ge(e,t){var n,r,o,i,s,u=(n=Pe,i=!1,s=function(){i=!0,window.clearTimeout(r),r=window.setTimeout((function(){i=!1}),S)},{get:function(){return i?o:(o=C(n),s(),o)},set:function(e,t){O(n,e,t),o=e,s()}});!function(e){var t=e.get(),n=C(Be),r=C(Ae),o=C(je);if(!t){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i[De]=o),r&&/^[012]$/.test(r)&&(i[Ne]=r),$e(i,e)}}(u);var c,l,f,d,p,h,g,m,y=new ce,b=qe(u).id,w=(c=function(){var n=qe(u),r=t(n[e]),o=r.trackingType,i=r.isTracked;n[e]=o,i&&!n.id&&(n.id=v(),n.created=String(Date.now())),$e(n,u),i&&b!==n.id&&(b=n.id,y.notify())},l=S,p=!f||void 0===f.leading||f.leading,h=!f||void 0===f.trailing||f.trailing,g=!1,m=!1,{throttled:function(){var e=this;g?m=!0:(p?c.apply(this):m=!0,g=!0,d=window.setTimeout((function(){h&&m&&c.apply(e),g=!1,m=!1}),l))},cancel:function(){window.clearTimeout(d),g=!1,m=!1}}).throttled;return w(),function(e){var t=K(e),n={capture:!0,passive:!0};[a.CLICK,a.TOUCH_START,a.KEY_DOWN,a.SCROLL].forEach((function(e){document.addEventListener(e,t,n),Xe.push((function(){return document.removeEventListener(e,t,n)}))}))}(w),function(e){var t=K((function(){"visible"===document.visibilityState&&e()})),n=window.setInterval(t,He);document.addEventListener(a.VISIBILITY_CHANGE,t),Xe.push((function(){clearInterval(n),document.removeEventListener(a.VISIBILITY_CHANGE,t)}))}((function(){$e(qe(u),u)})),{getId:function(){return qe(u).id},getTrackingType:function(){return qe(u)[e]},renewObservable:y}}var Fe=/^([a-z]+)=([a-z0-9-]+)$/,Ke="&";function qe(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf(Ke)||Fe.test(e))})(t)&&t.split(Ke).forEach((function(e){var t=Fe.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)<Ue)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(Ve(e),{})}function $e(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+ze);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(Ke);t.set(r,ze)}else Ve(t)}function Ve(e){e.set("",0)}var Xe=[];var Je,We="logs";function Ye(e,t){if(!t){var n=Ze(e)===Je.TRACKED;return{getId:function(){},isTracked:function(){return n}}}var r=Ge(We,(function(t){return function(e,t){var n=function(e){return e===Je.NOT_TRACKED||e===Je.TRACKED}(t)?t:Ze(e);return{trackingType:n,isTracked:n===Je.TRACKED}}(e,t)}));return{getId:r.getId,isTracked:function(){return r.getTrackingType()===Je.TRACKED}}}function Ze(e){return 0!==(t=e.sampleRate)&&100*Math.random()<=t?Je.TRACKED:Je.NOT_TRACKED;var t}!function(e){e.NOT_TRACKED="0",e.TRACKED="1"}(Je||(Je={}));var Qe={debug:function(e,t){ye("logs.logger.debug")},error:function(e,t){ye("logs.logger.error")},info:function(e,t){ye("logs.logger.info")},log:function(e,t,n){ye("logs.logger.log")},warn:function(e,t){ye("logs.logger.warn")},setContext:function(e){ye("logs.logger.setContext")},addContext:function(e,t){ye("logs.logger.addContext")},removeContext:function(e){ye("logs.logger.removeContext")},setHandler:function(e){ye("logs.logger.setHandler")},setLevel:function(e){ye("logs.logger.setLevel")}},et=tt({logger:Qe,init:function(e){ye("core.init")},addLoggerGlobalContext:function(e,t){ye("addLoggerGlobalContext")},setLoggerGlobalContext:function(e){ye("setLoggerGlobalContext")},createLogger:function(e,t){return ye("createLogger"),Qe},getLogger:function(e){ye("getLogger")}});function tt(e){var t=function(e){var t=r({},e);return Object.defineProperty(t,"_setDebug",{get:function(){return V},enumerable:!1}),t}(e),n=!1;return t.init=K((function(e){if(xe()&&function(e){if(n)return e.silentMultipleInit||console.error("DD_LOGS is already initialized."),!1;if(!e||!e.publicApiKey&&!e.clientToken)return console.error("Client Token is not configured, we will not send any data."),!1;if(void 0!==e.sampleRate&&(t=e.sampleRate,!(function(e){return"number"==typeof e}(t)&&t>=0&&t<=100)))return console.error("Sample Rate should be a number between 0 and 100"),!1;var t;return!0}(e)){e.publicApiKey&&(e.clientToken=e.publicApiKey,console.warn("Public API Key is deprecated. Please use Client Token instead."));var o=!1!==e.forwardErrorsToLogs,i=Ee(r(r({},e),{isCollectingError:o}),Oe),a=i.errorObservable,s=i.configuration,u=i.internalMonitoring,c=Re(a,s,Ye(s,L()),u);g(t,c),n=!0}})),t}(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}()).DD_LOGS=et}]);

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

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

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

"dependencies": {
"@datadog/browser-core": "1.15.1",
"@datadog/browser-core": "1.15.2",
"tslib": "1.10.0"

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

},
"gitHead": "7d7cef5e04a1cffeb5773501b77b3b63e7709691"
"gitHead": "a8ab56be3315d82fc4814b418aa452aa40b6cb46"
}
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