Socket
Socket
Sign inDemoInstall

@datadog/browser-logs

Package Overview
Dependencies
Maintainers
1
Versions
254
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.12.0 to 1.12.1

2

bundle/datadog-logs-us.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=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"datadogLogs",(function(){return Ke}));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,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(s,u)}a((r=r.apply(e,t||[])).next())}))}function i(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}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,u])}}}function s(){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],s=0,u=i.length;s<u;s++,o++)r[o]=i[s];return r}var u,a,c=6e4,f=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"}(u||(u={})),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"}(a||(a={}));var l,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)?s(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,s=[!1,void 0];"object"==typeof e&&b(o=Object.getPrototypeOf(e))&&(s=[!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]),s[0]&&(o.toJSON=s[1])}return i}function b(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function w(){return void 0===l&&(l=performance.timing.navigationStart),l}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,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function T(e,t,n){var r="us"===t.datacenter?"com":"eu",o="production"===t.sdkEnv?"datadoghq."+r:"datad0g."+r,i="sdk_version:"+t.sdkVersion+(t.env?",env:"+t.env:"")+(t.service?",service:"+t.service:"")+(t.version?",version:"+t.version:""),s=e+"-http-intake.logs."+o,u=t.proxyHost?t.proxyHost:s,a=t.proxyHost?"ddhost="+s+"&":"";return"https://"+u+"/v1/input/"+t.clientToken+"?"+a+"ddsource="+(n||"browser")+"&ddtags="+i}var O="?",S=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var L=function(){var e,t,n,r,o,i,s=[];function u(e,t,n){var r;for(var o in s)if(C(s,o))try{s[o](e,t,n)}catch(e){r=e}if(r)throw r}function a(e,r,o,i,s){if(t)k.augmentStackTraceWithInitialElement(t,r,o,""+e),f();else if(s)u(k(s),!0,s);else{var a,c={url:r,column:i,line:o},l=e;if("[object String]"==={}.toString.call(e)){var d=l.match(S);d&&(a=d[1],l=d[2])}u({name:a,message:l,stack:[c]},!0)}return!!n&&n.apply(this,arguments)}function c(e){var t=e.reason||"Empty reason";u(k(t),!0,t)}function f(){var n=t,r=e;t=void 0,e=void 0,u(n,!1,r)}function l(n){if(t){if(e===n)return;f()}var r=k(n);throw t=r,e=n,setTimeout((function(){e===n&&f()}),r.incomplete?2e3:0),n}return l.subscribe=function(e){!function(){if(r)return;n=window.onerror,window.onerror=j(a),r=!0}(),function(){if(i)return;o=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=j(c),i=!0}(),s.push(e)},l.unsubscribe=function(e){for(var t=s.length-1;t>=0;t-=1)s[t]===e&&s.splice(t,1);0===s.length&&(r&&(window.onerror=n,r=!1),i&&(window.onunhandledrejection=o,i=!1))},l.traceKitWindowOnError=a,l}(),k=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,s=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,a=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,c=/\((\S*)(?::(\d+))(?::(\d+))\)/,f=e.stack.split("\n"),l=[],d=0,p=f.length;d<p;d+=1){if(i.exec(f[d])){var h=(r=i.exec(f[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]||O,line:r[3]?+r[3]:void 0,url:h?void 0:r[2]}}else if(u.exec(f[d]))o={args:[],column:(r=u.exec(f[d]))[4]?+r[4]:void 0,func:r[1]||O,line:+r[3],url:r[2]};else{if(!s.exec(f[d]))continue;t=(r=s.exec(f[d]))[3]&&r[3].indexOf(" > eval")>-1,n=a.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||(l[0].column=e.columnNumber+1),o={args:r[2]?r[2].split(","):[],column:r[5]?+r[5]:void 0,func:r[1]||O,line:r[4]?+r[4]:void 0,url:r[3]}}!o.func&&o.line&&(o.func=O),l.push(o)}if(l.length)return{stack:l,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,s=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,u=[],a={},c=!1,f=r.caller;f&&!c;f=f.caller)f!==k&&f!==L&&(i={args:[],column:void 0,func:O,line:void 0,url:void 0},o=s.exec(f.toString()),f.name?i.func=f.name:o&&(i.func=o[1]),void 0===i.func&&(i.func=o?o.input.substring(0,o.input.indexOf("{")):void 0),a[""+f]?c=!0:a[""+f]=!0,u.push(i));t&&u.splice(0,t);var l={stack:u,message:e.message,name:e.name};return n(l,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),l}function o(n,o){var i,s=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"),s=[],u=0;u<i.length;u+=2){var a=void 0;r.exec(i[u])?a={args:[],column:void 0,func:(n=r.exec(i[u]))[3],line:+n[1],url:n[2]}:o.exec(i[u])&&(a={args:(n=o.exec(i[u]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),a&&(!a.func&&a.line&&(a.func=O),a.context=[i[u+1]],s.push(a))}if(s.length)return{stack:s,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,s=[],u=window&&window.document&&window.document.getElementsByTagName("script"),a=[];for(var c in u)C(u,c)&&!u[c].src&&a.push(u[c]);for(var f=2;f<t.length;f+=2){var l=void 0;if(r.exec(t[f]))l={args:[],column:void 0,func:(n=r.exec(t[f]))[3],line:+n[1],url:n[2]};else if(o.exec(t[f]))l={args:[],column:void 0,func:(n=o.exec(t[f]))[4],line:+n[1],url:n[3]};else if(i.exec(t[f])){n=i.exec(t[f]),l={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+n[1]}}l&&(l.func||(l.func=O),l.context=[t[f+1]],s.push(l))}if(s.length)return{stack:s,message:t[0],name:e.name}}}(n))return i}catch(t){if(e)throw t}try{if(i=r(n,s+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 k(e,t+1)}},o}();var R=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 M,_=function(){function e(e,t,n,r,o,i,s){void 0===s&&(s=m),this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=o,this.contextProvider=i,this.beforeUnloadCallback=s,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=s(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.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(h({},this.contextProvider(),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.sizeInBytes=function(e){return~-encodeURI(e).split(/%..|./).length},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(u.BEFORE_UNLOAD,j(this.beforeUnloadCallback)),document.addEventListener(u.VISIBILITY_CHANGE,j((function(){"hidden"===document.visibilityState&&e.flush()}))),window.addEventListener(u.BEFORE_UNLOAD,j((function(){return e.flush()}))))},e}();!function(e){e.info="info",e.error="error"}(M||(M={}));var I,B={maxMessagesPerPage:0,sentMessageCount:0};function A(e,t,n){var r=n.value;n.value=function(){var e=B.batch?j(r):r;return e.apply(this,arguments)}}function j(e){return function(){try{return e.apply(this,arguments)}catch(e){z(e);try{N(e)}catch(e){z(e)}}}}function N(e){D(r(r({},function(e){if(e instanceof Error){var t=k(e);return{error:{kind:t.name,stack:ne(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+y(e)}}(e)),{status:M.error}))}function D(e){B.batch&&B.sentMessageCount<B.maxMessagesPerPage&&(B.sentMessageCount+=1,B.batch.add(e))}function P(e){B.debugMode=e}function z(e){B.debugMode&&console.warn("[INTERNAL ERROR]",e)}var H,U,F=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}();function G(e){return K(e,E(window.location)).href}function K(e,t){if(function(){if(void 0!==H)return H;try{var e=new URL("http://test/path");return H="http://test/path"===e.href}catch(e){H=!1}return H}())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}!function(e){e.FETCH="fetch",e.XHR="xhr"}(U||(U={}));var q,$,V,W,X,J=1;function Y(){var e=J;return J+=1,e}function Z(){return q||(function(e){var t=e[0],n=e[1],r=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=j((function(e,t){return this._datadog_xhr={method:e,url:t},r.apply(this,arguments)}));var o=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(e){var r=this,i=performance.now(),s=Y();t.notify({requestId:s});var u=!1,a=function(){u||(u=!0,n.notify({requestId:s,startTime:i,duration:performance.now()-i,method:r._datadog_xhr.method,response:r.response,status:r.status,traceId:Q(),type:U.XHR,url:G(r._datadog_xhr.url)}))},c=this.onreadystatechange;return this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&j(a)(),c&&c.apply(this,arguments)},this.addEventListener("loadend",j(a)),o.apply(this,arguments)}}(q=[new F,new F]),function(e){var t=e[0],n=e[1];if(!window.fetch)return;var r=window.fetch;window.fetch=j((function(e,s){var u=this,a=s&&s.method||"object"==typeof e&&e.method||"GET",c=performance.now(),f=Y();t.notify({requestId:f});var l=function(t){return o(u,void 0,void 0,(function(){var r,o,s,u,l;return i(this,(function(i){switch(i.label){case 0:return r=performance.now()-c,o=G("object"==typeof e&&e.url||e),"stack"in t||t instanceof Error?(s=k(t),n.notify({duration:r,method:a,requestId:f,startTime:c,url:o,response:ne(s),status:0,traceId:Q(),type:U.FETCH}),[3,6]):[3,1];case 1:if(!("status"in t))return[3,6];u=void 0,i.label=2;case 2:return i.trys.push([2,4,,5]),[4,t.clone().text()];case 3:return u=i.sent(),[3,5];case 4:return l=i.sent(),u="Unable to retrieve response: "+l,[3,5];case 5:n.notify({duration:r,method:a,requestId:f,startTime:c,url:o,response:u,responseType:t.type,status:t.status,traceId:Q(),type:U.FETCH}),i.label=6;case 6:return[2]}}))}))},d=r.call(this,e,s);return d.then(j(l),j(l)),d}))}(q)),q}function Q(){return"ddtrace"in window&&window.ddtrace.tracer.scope().active()?window.ddtrace.tracer.scope().active().context().toTraceId():void 0}function ee(e){if(!V){var t=new F;if(e.isCollectingError)!function(e,t,n){n.subscribe((function(n){(function(e){return 0===e.status&&"opaque"!==e.responseType}(n)||function(e){return e.status>=500}(n))&&t.notify({context:{error:{origin:$.NETWORK,stack:re(n.response,e)||"Failed to load"},http:{method:n.method,status_code:n.status,url:n.url}},message:oe(n.type)+" error "+n.method+" "+n.url,startTime:n.startTime})}))}(e,t,Z()[1]),function(e){W=console.error,console.error=j((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];W.apply(console,s([t],n)),e.notify({context:{error:{origin:$.CONSOLE}},message:s(["console error:",t],n).map(te).join(" "),startTime:performance.now()})}))}(t),function(e){X=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=ne(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:$.SOURCE}},startTime:performance.now()}}(t,r))},L.subscribe(X)}(t);V=function(e,t){var n=0,r=new F;return t.subscribe((function(t){n<e.maxErrorsByMinute?(n+=1,r.notify(t)):n===e.maxErrorsByMinute&&(n+=1,r.notify({context:{error:{origin:$.AGENT}},message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,startTime:performance.now()}))})),setInterval((function(){return n=0}),c),r}(e,t)}return V}function te(e){return"string"==typeof e?e:e instanceof Error?ne(k(e)):y(e,0,2)}function ne(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 re(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function oe(e){return U.XHR===e?"XHR":"Fetch"}!function(e){e.AGENT="agent",e.CONSOLE="console",e.NETWORK="network",e.SOURCE="source",e.LOGGER="logger"}($||($={}));var ie=1e3;function se(e,t,n){var r=new Date;r.setTime(r.getTime()+n);var o="expires="+r.toUTCString();document.cookie=e+"="+t+";"+o+";path=/"}function ue(e){var t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():void 0}function ae(){if(void 0===document.cookie||null===document.cookie)return!1;try{return se("dd_rum_test","test",1e3),"test"===ue("dd_rum_test")}catch(e){return console.error(e),!1}}function ce(e){console.warn("'"+e+"' not yet available, please call '.init()' first.")}function fe(e,t){var n=function(e,t){var n={buildMode:t.buildMode,clientToken:e.clientToken,datacenter:e.datacenter||t.datacenter,env:e.env,proxyHost:e.proxyHost,sdkEnv:t.sdkEnv,sdkVersion:t.sdkVersion,service:e.service,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);return 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),"e2e-test"===n.buildMode&&(void 0!==e.internalMonitoringEndpoint&&(i.internalMonitoringEndpoint=e.internalMonitoringEndpoint),void 0!==e.logsEndpoint&&(i.logsEndpoint=e.logsEndpoint),void 0!==e.rumEndpoint&&(i.rumEndpoint=e.rumEndpoint)),i}(e,t),o=function(e){if(e.internalMonitoringEndpoint){var t=new _(new R(e.internalMonitoringEndpoint,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout,(function(){return h({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==I?I():{})}));g(B,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){I=e}}}(n);return{configuration:n,errorObservable:ee(n),internalMonitoring:o}}function le(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}var de="_dd",pe="_dd_r",he="_dd_l",ge="rum",ve="logs";var me="_dd_s",ye=15*c,be=4*f,we=c;function Ee(e,t){var n,r,o,i,s,a=(n=me,i=!1,s=function(){i=!0,window.clearTimeout(r),r=window.setTimeout((function(){i=!1}),ie)},{get:function(){return i?o:(o=ue(n),s(),o)},set:function(e,t){se(n,e,t),o=e,s()}});!function(e){var t=e.get(),n=ue(de),r=ue(pe),o=ue(he);if(!t){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i[ve]=o),r&&/^[012]$/.test(r)&&(i[ge]=r),Se(i,e)}}(a);var c,f,l,d,p,h,g,m,y,b=new F,w=Oe(a).id,E=(c=function(){var n=Oe(a),r=t(n[e]),o=r.trackingType,i=r.isTracked;n[e]=o,i&&!n.id&&(n.id=v(),n.created=String(Date.now())),Se(n,a),i&&w!==n.id&&(w=n.id,b.notify())},f=ie,p=!l||void 0===l.leading||l.leading,h=!l||void 0===l.trailing||l.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}),f)))},stop:function(){window.clearTimeout(d),y=!0}}).throttled;return E(),function(e){var t=j(e),n={capture:!0,passive:!0};[u.CLICK,u.TOUCH_START,u.KEY_DOWN,u.SCROLL].forEach((function(e){document.addEventListener(e,t,n),Le.push((function(){return document.removeEventListener(e,t,n)}))}))}(E),function(e){var t=j((function(){"visible"===document.visibilityState&&e()})),n=window.setInterval(t,we);document.addEventListener(u.VISIBILITY_CHANGE,t),Le.push((function(){clearInterval(n),document.removeEventListener(u.VISIBILITY_CHANGE,t)}))}((function(){Se(Oe(a),a)})),{getId:function(){return Oe(a).id},getTrackingType:function(){return Oe(a)[e]},renewObservable:b}}var xe=/^([a-z]+)=([a-z0-9-]+)$/,Te="&";function Oe(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf(Te)||xe.test(e))})(t)&&t.split(Te).forEach((function(e){var t=xe.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)<be)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(Ce(e),{})}function Se(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+ye);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(Te);t.set(r,ye)}else Ce(t)}function Ce(e){e.set("",0)}var Le=[];(function(){function e(e){var t=this,n=e[0],r=e[1];this.requests=[],this.whenAllCompleteFn=m;var o=0;n.subscribe((function(){o+=1})),r.subscribe((function(e){t.requests.push(e),0===(o-=1)&&setTimeout((function(){t.whenAllCompleteFn(t.requests)}))}))}e.prototype.whenAllComplete=function(e){this.whenAllCompleteFn=e},e.prototype.getStub=function(){var e=this;return function(){var t,n,s=new Promise((function(e,r){t=e,n=r}));return s.resolveWith=function(n){return o(e,void 0,void 0,(function(){var e=this;return i(this,(function(s){return[2,t(r(r({},n),{clone:function(){return{text:function(){return o(e,void 0,void 0,(function(){return i(this,(function(e){if(n.responseTextError)throw n.responseTextError;return[2,n.responseText]}))}))}}}}))]}))}))},s.rejectWith=function(t){return o(e,void 0,void 0,(function(){return i(this,(function(e){return[2,n(t)]}))}))},s}}})(),function(){function e(){}e.prototype.getEntryTypes=function(){return this.instance.entryTypes},e.prototype.fakeEntry=function(e,t){var n=function(){return[e]};this.instance.callback({getEntries:n,getEntriesByName:n,getEntriesByType:function(e){return e===t?n():[]}})},e.prototype.getStub=function(){var e,t=this;return(e=function(){function e(e){this.callback=e,t.instance=this}return e.prototype.observe=function(e){e&&(t.instance.entryTypes=e.entryTypes)},e}()).supportedEntryTypes=["navigation"],e}}();var ke,Re,Me={buildMode:"release",datacenter:"us",sdkEnv:"production",sdkVersion:"1.12.0"};!function(e){e.debug="debug",e.info="info",e.warn="warn",e.error="error"}(Re||(Re={}));var _e,Ie,Be=((ke={})[Re.debug]=0,ke[Re.info]=1,ke[Re.warn]=2,ke[Re.error]=3,ke);Object.keys(Re);function Ae(e,t,n,o){var i,s={};o.setExternalContextProvider((function(){return h({session_id:n.getId()},s,De())}));var u=new _(new R(t.logsEndpoint,t.batchBytesLimit),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout,(function(){return h({date:(new Date).getTime(),session_id:n.getId(),view:{referrer:document.referrer,url:window.location.href}},s,De())})),a=((i={})[_e.console]=function(e){return console.log(e.status+": "+e.message)},i[_e.http]=function(e){return u.add(e)},i[_e.silent]=m,i),c=new Ne(n,a);Ie={},e.subscribe((function(e){return c.error(e.message,r({date:(t=e.startTime,Math.floor(w()+t))},e.context));var t}));var f={setLoggerGlobalContext:function(e){s=e},addLoggerGlobalContext:function(e,t){s[e]=t}};return f.createLogger=function(e,t){return function(n,o){return void 0===o&&(o={}),Ie[n]=new Ne(e,t,o.handler,o.level,r(r({},o.context),{logger:{name:n}})),Ie[n]}}(n,a),f.getLogger=je,f.logger=c,f}function je(e){return Ie[e]}!function(e){e.http="http",e.console="console",e.silent="silent"}(_e||(_e={}));var Ne=function(){function e(e,t,n,r,o){void 0===n&&(n=_e.http),void 0===r&&(r=Re.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=Re.info),this.session.isTracked()&&Be[n]>=Be[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,Re.debug)},e.prototype.info=function(e,t){void 0===t&&(t={}),this.log(e,t,Re.info)},e.prototype.warn=function(e,t){void 0===t&&(t={}),this.log(e,t,Re.warn)},e.prototype.error=function(e,t){void 0===t&&(t={});var n={error:{origin:$.LOGGER}};this.log(e,h({},n,t),Re.error)},e.prototype.setContext=function(e){this.loggerContext=e},e.prototype.addContext=function(e,t){this.loggerContext[e]=t},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,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);i>3&&s&&Object.defineProperty(t,n,s)}([A],e.prototype,"log",null),e}();function De(){var e=window.DD_RUM;return e&&e.getInternalContext?e.getInternalContext():void 0}var Pe,ze="logs";function He(e,t){if(!t){var n=Ue(e)===Pe.TRACKED;return{getId:function(){},isTracked:function(){return n}}}var r=Ee(ze,(function(t){return function(e,t){var n=function(e){return e===Pe.NOT_TRACKED||e===Pe.TRACKED}(t)?t:Ue(e);return{trackingType:n,isTracked:n===Pe.TRACKED}}(e,t)}));return{getId:r.getId,isTracked:function(){return r.getTrackingType()===Pe.TRACKED}}}function Ue(e){return 0!==(t=e.sampleRate)&&100*Math.random()<=t?Pe.TRACKED:Pe.NOT_TRACKED;var t}!function(e){e.NOT_TRACKED="0",e.TRACKED="1"}(Pe||(Pe={}));var Fe,Ge={debug:function(e,t){ce("logs.logger.debug")},error:function(e,t){ce("logs.logger.error")},info:function(e,t){ce("logs.logger.info")},log:function(e,t,n){ce("logs.logger.log")},warn:function(e,t){ce("logs.logger.warn")},setContext:function(e){ce("logs.logger.setContext")},addContext:function(e,t){ce("logs.logger.addContext")},setHandler:function(e){ce("logs.logger.setHandler")},setLevel:function(e){ce("logs.logger.setLevel")}},Ke=(Fe=r({},{logger:Ge,init:function(e){ce("core.init")},addLoggerGlobalContext:function(e,t){ce("addLoggerGlobalContext")},setLoggerGlobalContext:function(e){ce("setLoggerGlobalContext")},createLogger:function(e,t){return ce("createLogger"),Ge},getLogger:function(e){ce("getLogger")}}),Object.defineProperty(Fe,"_setDebug",{get:function(){return P},enumerable:!1}),Fe),qe=!1;Ke.init=j((function(e){if(le()&&function(e){if(qe)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 t=!1!==e.forwardErrorsToLogs,n=fe(r(r({},e),{isCollectingError:t}),Me),o=n.errorObservable,i=n.configuration,s=n.internalMonitoring,u=Ae(o,i,He(i,ae()),s);g(Ke,u),qe=!0}})),(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=Ke}]);
!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=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"datadogLogs",(function(){return Ke}));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,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function u(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){e.done?o(e.value):new n((function(t){t(e.value)})).then(s,u)}a((r=r.apply(e,t||[])).next())}))}function i(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,r=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}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,u])}}}function s(){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],s=0,u=i.length;s<u;s++,o++)r[o]=i[s];return r}var u,a,c=6e4,f=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"}(u||(u={})),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"}(a||(a={}));var l,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)?s(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,s=[!1,void 0];"object"==typeof e&&b(o=Object.getPrototypeOf(e))&&(s=[!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]),s[0]&&(o.toJSON=s[1])}return i}function b(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function w(){return void 0===l&&(l=performance.timing.navigationStart),l}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,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function T(e,t,n){var r="us"===t.datacenter?"com":"eu",o="production"===t.sdkEnv?"datadoghq."+r:"datad0g."+r,i="sdk_version:"+t.sdkVersion+(t.env?",env:"+t.env:"")+(t.service?",service:"+t.service:"")+(t.version?",version:"+t.version:""),s=e+"-http-intake.logs."+o,u=t.proxyHost?t.proxyHost:s,a=t.proxyHost?"ddhost="+s+"&":"",c=""+(t.applicationId?"_dd.application_id="+t.applicationId+"&":"")+a+"ddsource="+(n||"browser")+"&ddtags="+i;return"https://"+u+"/v1/input/"+t.clientToken+"?"+c}var O="?",S=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var L=function(){var e,t,n,r,o,i,s=[];function u(e,t,n){var r;for(var o in s)if(C(s,o))try{s[o](e,t,n)}catch(e){r=e}if(r)throw r}function a(e,r,o,i,s){if(t)k.augmentStackTraceWithInitialElement(t,r,o,""+e),f();else if(s)u(k(s),!0,s);else{var a,c={url:r,column:i,line:o},l=e;if("[object String]"==={}.toString.call(e)){var d=l.match(S);d&&(a=d[1],l=d[2])}u({name:a,message:l,stack:[c]},!0)}return!!n&&n.apply(this,arguments)}function c(e){var t=e.reason||"Empty reason";u(k(t),!0,t)}function f(){var n=t,r=e;t=void 0,e=void 0,u(n,!1,r)}function l(n){if(t){if(e===n)return;f()}var r=k(n);throw t=r,e=n,setTimeout((function(){e===n&&f()}),r.incomplete?2e3:0),n}return l.subscribe=function(e){!function(){if(r)return;n=window.onerror,window.onerror=j(a),r=!0}(),function(){if(i)return;o=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=j(c),i=!0}(),s.push(e)},l.unsubscribe=function(e){for(var t=s.length-1;t>=0;t-=1)s[t]===e&&s.splice(t,1);0===s.length&&(r&&(window.onerror=n,r=!1),i&&(window.onunhandledrejection=o,i=!1))},l.traceKitWindowOnError=a,l}(),k=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,s=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,a=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,c=/\((\S*)(?::(\d+))(?::(\d+))\)/,f=e.stack.split("\n"),l=[],d=0,p=f.length;d<p;d+=1){if(i.exec(f[d])){var h=(r=i.exec(f[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]||O,line:r[3]?+r[3]:void 0,url:h?void 0:r[2]}}else if(u.exec(f[d]))o={args:[],column:(r=u.exec(f[d]))[4]?+r[4]:void 0,func:r[1]||O,line:+r[3],url:r[2]};else{if(!s.exec(f[d]))continue;t=(r=s.exec(f[d]))[3]&&r[3].indexOf(" > eval")>-1,n=a.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||(l[0].column=e.columnNumber+1),o={args:r[2]?r[2].split(","):[],column:r[5]?+r[5]:void 0,func:r[1]||O,line:r[4]?+r[4]:void 0,url:r[3]}}!o.func&&o.line&&(o.func=O),l.push(o)}if(l.length)return{stack:l,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,s=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,u=[],a={},c=!1,f=r.caller;f&&!c;f=f.caller)f!==k&&f!==L&&(i={args:[],column:void 0,func:O,line:void 0,url:void 0},o=s.exec(f.toString()),f.name?i.func=f.name:o&&(i.func=o[1]),void 0===i.func&&(i.func=o?o.input.substring(0,o.input.indexOf("{")):void 0),a[""+f]?c=!0:a[""+f]=!0,u.push(i));t&&u.splice(0,t);var l={stack:u,message:e.message,name:e.name};return n(l,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),l}function o(n,o){var i,s=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"),s=[],u=0;u<i.length;u+=2){var a=void 0;r.exec(i[u])?a={args:[],column:void 0,func:(n=r.exec(i[u]))[3],line:+n[1],url:n[2]}:o.exec(i[u])&&(a={args:(n=o.exec(i[u]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),a&&(!a.func&&a.line&&(a.func=O),a.context=[i[u+1]],s.push(a))}if(s.length)return{stack:s,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,s=[],u=window&&window.document&&window.document.getElementsByTagName("script"),a=[];for(var c in u)C(u,c)&&!u[c].src&&a.push(u[c]);for(var f=2;f<t.length;f+=2){var l=void 0;if(r.exec(t[f]))l={args:[],column:void 0,func:(n=r.exec(t[f]))[3],line:+n[1],url:n[2]};else if(o.exec(t[f]))l={args:[],column:void 0,func:(n=o.exec(t[f]))[4],line:+n[1],url:n[3]};else if(i.exec(t[f])){n=i.exec(t[f]),l={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+n[1]}}l&&(l.func||(l.func=O),l.context=[t[f+1]],s.push(l))}if(s.length)return{stack:s,message:t[0],name:e.name}}}(n))return i}catch(t){if(e)throw t}try{if(i=r(n,s+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 k(e,t+1)}},o}();var R=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 M,_=function(){function e(e,t,n,r,o,i,s){void 0===s&&(s=m),this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=o,this.contextProvider=i,this.beforeUnloadCallback=s,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=s(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.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(h({},this.contextProvider(),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.sizeInBytes=function(e){return~-encodeURI(e).split(/%..|./).length},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(u.BEFORE_UNLOAD,j(this.beforeUnloadCallback)),document.addEventListener(u.VISIBILITY_CHANGE,j((function(){"hidden"===document.visibilityState&&e.flush()}))),window.addEventListener(u.BEFORE_UNLOAD,j((function(){return e.flush()}))))},e}();!function(e){e.info="info",e.error="error"}(M||(M={}));var I,B={maxMessagesPerPage:0,sentMessageCount:0};function A(e,t,n){var r=n.value;n.value=function(){var e=B.batch?j(r):r;return e.apply(this,arguments)}}function j(e){return function(){try{return e.apply(this,arguments)}catch(e){z(e);try{N(e)}catch(e){z(e)}}}}function N(e){D(r(r({},function(e){if(e instanceof Error){var t=k(e);return{error:{kind:t.name,stack:ne(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+y(e)}}(e)),{status:M.error}))}function D(e){B.batch&&B.sentMessageCount<B.maxMessagesPerPage&&(B.sentMessageCount+=1,B.batch.add(e))}function P(e){B.debugMode=e}function z(e){B.debugMode&&console.warn("[INTERNAL ERROR]",e)}var H,U,F=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}();function G(e){return K(e,E(window.location)).href}function K(e,t){if(function(){if(void 0!==H)return H;try{var e=new URL("http://test/path");return H="http://test/path"===e.href}catch(e){H=!1}return H}())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}!function(e){e.FETCH="fetch",e.XHR="xhr"}(U||(U={}));var q,$,V,W,X,J=1;function Y(){var e=J;return J+=1,e}function Z(){return q||(function(e){var t=e[0],n=e[1],r=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=j((function(e,t){return this._datadog_xhr={method:e,url:t},r.apply(this,arguments)}));var o=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(e){var r=this,i=performance.now(),s=Y();t.notify({requestId:s});var u=!1,a=function(){u||(u=!0,n.notify({requestId:s,startTime:i,duration:performance.now()-i,method:r._datadog_xhr.method,response:r.response,status:r.status,traceId:Q(),type:U.XHR,url:G(r._datadog_xhr.url)}))},c=this.onreadystatechange;return this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&j(a)(),c&&c.apply(this,arguments)},this.addEventListener("loadend",j(a)),o.apply(this,arguments)}}(q=[new F,new F]),function(e){var t=e[0],n=e[1];if(!window.fetch)return;var r=window.fetch;window.fetch=j((function(e,s){var u=this,a=s&&s.method||"object"==typeof e&&e.method||"GET",c=performance.now(),f=Y();t.notify({requestId:f});var l=function(t){return o(u,void 0,void 0,(function(){var r,o,s,u,l;return i(this,(function(i){switch(i.label){case 0:return r=performance.now()-c,o=G("object"==typeof e&&e.url||e),"stack"in t||t instanceof Error?(s=k(t),n.notify({duration:r,method:a,requestId:f,startTime:c,url:o,response:ne(s),status:0,traceId:Q(),type:U.FETCH}),[3,6]):[3,1];case 1:if(!("status"in t))return[3,6];u=void 0,i.label=2;case 2:return i.trys.push([2,4,,5]),[4,t.clone().text()];case 3:return u=i.sent(),[3,5];case 4:return l=i.sent(),u="Unable to retrieve response: "+l,[3,5];case 5:n.notify({duration:r,method:a,requestId:f,startTime:c,url:o,response:u,responseType:t.type,status:t.status,traceId:Q(),type:U.FETCH}),i.label=6;case 6:return[2]}}))}))},d=r.call(this,e,s);return d.then(j(l),j(l)),d}))}(q)),q}function Q(){return"ddtrace"in window&&window.ddtrace.tracer.scope().active()?window.ddtrace.tracer.scope().active().context().toTraceId():void 0}function ee(e){if(!V){var t=new F;if(e.isCollectingError)!function(e,t,n){n.subscribe((function(n){(function(e){return 0===e.status&&"opaque"!==e.responseType}(n)||function(e){return e.status>=500}(n))&&t.notify({context:{error:{origin:$.NETWORK,stack:re(n.response,e)||"Failed to load"},http:{method:n.method,status_code:n.status,url:n.url}},message:oe(n.type)+" error "+n.method+" "+n.url,startTime:n.startTime})}))}(e,t,Z()[1]),function(e){W=console.error,console.error=j((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];W.apply(console,s([t],n)),e.notify({context:{error:{origin:$.CONSOLE}},message:s(["console error:",t],n).map(te).join(" "),startTime:performance.now()})}))}(t),function(e){X=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=ne(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:$.SOURCE}},startTime:performance.now()}}(t,r))},L.subscribe(X)}(t);V=function(e,t){var n=0,r=new F;return t.subscribe((function(t){n<e.maxErrorsByMinute?(n+=1,r.notify(t)):n===e.maxErrorsByMinute&&(n+=1,r.notify({context:{error:{origin:$.AGENT}},message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,startTime:performance.now()}))})),setInterval((function(){return n=0}),c),r}(e,t)}return V}function te(e){return"string"==typeof e?e:e instanceof Error?ne(k(e)):y(e,0,2)}function ne(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 re(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function oe(e){return U.XHR===e?"XHR":"Fetch"}!function(e){e.AGENT="agent",e.CONSOLE="console",e.NETWORK="network",e.SOURCE="source",e.LOGGER="logger"}($||($={}));var ie=1e3;function se(e,t,n){var r=new Date;r.setTime(r.getTime()+n);var o="expires="+r.toUTCString();document.cookie=e+"="+t+";"+o+";path=/"}function ue(e){var t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():void 0}function ae(){if(void 0===document.cookie||null===document.cookie)return!1;try{return se("dd_rum_test","test",1e3),"test"===ue("dd_rum_test")}catch(e){return console.error(e),!1}}function ce(e){console.warn("'"+e+"' not yet available, please call '.init()' first.")}function fe(e,t){var n=function(e,t){var n={applicationId:e.applicationId,buildMode:t.buildMode,clientToken:e.clientToken,datacenter:e.datacenter||t.datacenter,env:e.env,proxyHost:e.proxyHost,sdkEnv:t.sdkEnv,sdkVersion:t.sdkVersion,service:e.service,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);return 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),"e2e-test"===n.buildMode&&(void 0!==e.internalMonitoringEndpoint&&(i.internalMonitoringEndpoint=e.internalMonitoringEndpoint),void 0!==e.logsEndpoint&&(i.logsEndpoint=e.logsEndpoint),void 0!==e.rumEndpoint&&(i.rumEndpoint=e.rumEndpoint)),i}(e,t),o=function(e){if(e.internalMonitoringEndpoint){var t=new _(new R(e.internalMonitoringEndpoint,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout,(function(){return h({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==I?I():{})}));g(B,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){I=e}}}(n);return{configuration:n,errorObservable:ee(n),internalMonitoring:o}}function le(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}var de="_dd",pe="_dd_r",he="_dd_l",ge="rum",ve="logs";var me="_dd_s",ye=15*c,be=4*f,we=c;function Ee(e,t){var n,r,o,i,s,a=(n=me,i=!1,s=function(){i=!0,window.clearTimeout(r),r=window.setTimeout((function(){i=!1}),ie)},{get:function(){return i?o:(o=ue(n),s(),o)},set:function(e,t){se(n,e,t),o=e,s()}});!function(e){var t=e.get(),n=ue(de),r=ue(pe),o=ue(he);if(!t){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i[ve]=o),r&&/^[012]$/.test(r)&&(i[ge]=r),Se(i,e)}}(a);var c,f,l,d,p,h,g,m,y,b=new F,w=Oe(a).id,E=(c=function(){var n=Oe(a),r=t(n[e]),o=r.trackingType,i=r.isTracked;n[e]=o,i&&!n.id&&(n.id=v(),n.created=String(Date.now())),Se(n,a),i&&w!==n.id&&(w=n.id,b.notify())},f=ie,p=!l||void 0===l.leading||l.leading,h=!l||void 0===l.trailing||l.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}),f)))},stop:function(){window.clearTimeout(d),y=!0}}).throttled;return E(),function(e){var t=j(e),n={capture:!0,passive:!0};[u.CLICK,u.TOUCH_START,u.KEY_DOWN,u.SCROLL].forEach((function(e){document.addEventListener(e,t,n),Le.push((function(){return document.removeEventListener(e,t,n)}))}))}(E),function(e){var t=j((function(){"visible"===document.visibilityState&&e()})),n=window.setInterval(t,we);document.addEventListener(u.VISIBILITY_CHANGE,t),Le.push((function(){clearInterval(n),document.removeEventListener(u.VISIBILITY_CHANGE,t)}))}((function(){Se(Oe(a),a)})),{getId:function(){return Oe(a).id},getTrackingType:function(){return Oe(a)[e]},renewObservable:b}}var xe=/^([a-z]+)=([a-z0-9-]+)$/,Te="&";function Oe(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf(Te)||xe.test(e))})(t)&&t.split(Te).forEach((function(e){var t=xe.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)<be)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(Ce(e),{})}function Se(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+ye);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(Te);t.set(r,ye)}else Ce(t)}function Ce(e){e.set("",0)}var Le=[];(function(){function e(e){var t=this,n=e[0],r=e[1];this.requests=[],this.whenAllCompleteFn=m;var o=0;n.subscribe((function(){o+=1})),r.subscribe((function(e){t.requests.push(e),0===(o-=1)&&setTimeout((function(){t.whenAllCompleteFn(t.requests)}))}))}e.prototype.whenAllComplete=function(e){this.whenAllCompleteFn=e},e.prototype.getStub=function(){var e=this;return function(){var t,n,s=new Promise((function(e,r){t=e,n=r}));return s.resolveWith=function(n){return o(e,void 0,void 0,(function(){var e=this;return i(this,(function(s){return[2,t(r(r({},n),{clone:function(){return{text:function(){return o(e,void 0,void 0,(function(){return i(this,(function(e){if(n.responseTextError)throw n.responseTextError;return[2,n.responseText]}))}))}}}}))]}))}))},s.rejectWith=function(t){return o(e,void 0,void 0,(function(){return i(this,(function(e){return[2,n(t)]}))}))},s}}})(),function(){function e(){}e.prototype.getEntryTypes=function(){return this.instance.entryTypes},e.prototype.fakeEntry=function(e,t){var n=function(){return[e]};this.instance.callback({getEntries:n,getEntriesByName:n,getEntriesByType:function(e){return e===t?n():[]}})},e.prototype.getStub=function(){var e,t=this;return(e=function(){function e(e){this.callback=e,t.instance=this}return e.prototype.observe=function(e){e&&(t.instance.entryTypes=e.entryTypes)},e}()).supportedEntryTypes=["navigation"],e}}();var ke,Re,Me={buildMode:"release",datacenter:"us",sdkEnv:"production",sdkVersion:"1.12.1"};!function(e){e.debug="debug",e.info="info",e.warn="warn",e.error="error"}(Re||(Re={}));var _e,Ie,Be=((ke={})[Re.debug]=0,ke[Re.info]=1,ke[Re.warn]=2,ke[Re.error]=3,ke);Object.keys(Re);function Ae(e,t,n,o){var i,s={};o.setExternalContextProvider((function(){return h({session_id:n.getId()},s,De())}));var u=new _(new R(t.logsEndpoint,t.batchBytesLimit),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout,(function(){return h({date:(new Date).getTime(),session_id:n.getId(),view:{referrer:document.referrer,url:window.location.href}},s,De())})),a=((i={})[_e.console]=function(e){return console.log(e.status+": "+e.message)},i[_e.http]=function(e){return u.add(e)},i[_e.silent]=m,i),c=new Ne(n,a);Ie={},e.subscribe((function(e){return c.error(e.message,r({date:(t=e.startTime,Math.floor(w()+t))},e.context));var t}));var f={setLoggerGlobalContext:function(e){s=e},addLoggerGlobalContext:function(e,t){s[e]=t}};return f.createLogger=function(e,t){return function(n,o){return void 0===o&&(o={}),Ie[n]=new Ne(e,t,o.handler,o.level,r(r({},o.context),{logger:{name:n}})),Ie[n]}}(n,a),f.getLogger=je,f.logger=c,f}function je(e){return Ie[e]}!function(e){e.http="http",e.console="console",e.silent="silent"}(_e||(_e={}));var Ne=function(){function e(e,t,n,r,o){void 0===n&&(n=_e.http),void 0===r&&(r=Re.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=Re.info),this.session.isTracked()&&Be[n]>=Be[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,Re.debug)},e.prototype.info=function(e,t){void 0===t&&(t={}),this.log(e,t,Re.info)},e.prototype.warn=function(e,t){void 0===t&&(t={}),this.log(e,t,Re.warn)},e.prototype.error=function(e,t){void 0===t&&(t={});var n={error:{origin:$.LOGGER}};this.log(e,h({},n,t),Re.error)},e.prototype.setContext=function(e){this.loggerContext=e},e.prototype.addContext=function(e,t){this.loggerContext[e]=t},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,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var u=e.length-1;u>=0;u--)(o=e[u])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);i>3&&s&&Object.defineProperty(t,n,s)}([A],e.prototype,"log",null),e}();function De(){var e=window.DD_RUM;return e&&e.getInternalContext?e.getInternalContext():void 0}var Pe,ze="logs";function He(e,t){if(!t){var n=Ue(e)===Pe.TRACKED;return{getId:function(){},isTracked:function(){return n}}}var r=Ee(ze,(function(t){return function(e,t){var n=function(e){return e===Pe.NOT_TRACKED||e===Pe.TRACKED}(t)?t:Ue(e);return{trackingType:n,isTracked:n===Pe.TRACKED}}(e,t)}));return{getId:r.getId,isTracked:function(){return r.getTrackingType()===Pe.TRACKED}}}function Ue(e){return 0!==(t=e.sampleRate)&&100*Math.random()<=t?Pe.TRACKED:Pe.NOT_TRACKED;var t}!function(e){e.NOT_TRACKED="0",e.TRACKED="1"}(Pe||(Pe={}));var Fe,Ge={debug:function(e,t){ce("logs.logger.debug")},error:function(e,t){ce("logs.logger.error")},info:function(e,t){ce("logs.logger.info")},log:function(e,t,n){ce("logs.logger.log")},warn:function(e,t){ce("logs.logger.warn")},setContext:function(e){ce("logs.logger.setContext")},addContext:function(e,t){ce("logs.logger.addContext")},setHandler:function(e){ce("logs.logger.setHandler")},setLevel:function(e){ce("logs.logger.setLevel")}},Ke=(Fe=r({},{logger:Ge,init:function(e){ce("core.init")},addLoggerGlobalContext:function(e,t){ce("addLoggerGlobalContext")},setLoggerGlobalContext:function(e){ce("setLoggerGlobalContext")},createLogger:function(e,t){return ce("createLogger"),Ge},getLogger:function(e){ce("getLogger")}}),Object.defineProperty(Fe,"_setDebug",{get:function(){return P},enumerable:!1}),Fe),qe=!1;Ke.init=j((function(e){if(le()&&function(e){if(qe)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 t=!1!==e.forwardErrorsToLogs,n=fe(r(r({},e),{isCollectingError:t}),Me),o=n.errorObservable,i=n.configuration,s=n.internalMonitoring,u=Ae(o,i,He(i,ae()),s);g(Ke,u),qe=!0}})),(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=Ke}]);

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

sdkEnv: 'production',
sdkVersion: '1.12.0',
sdkVersion: '1.12.1',
};
//# sourceMappingURL=buildEnv.js.map

@@ -5,4 +5,4 @@ export var buildEnv = {

sdkEnv: 'production',
sdkVersion: '1.12.0',
sdkVersion: '1.12.1',
};
//# sourceMappingURL=buildEnv.js.map
{
"name": "@datadog/browser-logs",
"version": "1.12.0",
"version": "1.12.1",
"license": "Apache-2.0",

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

"dependencies": {
"@datadog/browser-core": "1.12.0",
"@datadog/browser-core": "1.12.1",
"tslib": "1.10.0"

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

},
"gitHead": "280cb27d74d72bcd0080df392a7199b5bb496bfa"
"gitHead": "9a75d2ebcec2ad2fb6eebc3c14206526395587df"
}
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