Socket
Socket
Sign inDemoInstall

@datadog/browser-rum

Package Overview
Dependencies
4
Maintainers
1
Versions
249
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.9.1 to 1.9.2

cjs/domMutationCollection.d.ts

2

bundle/datadog-rum-us.js

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

!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){(function(t,n){var r=200,o="__lodash_hash_undefined__",i=800,u=16,a=9007199254740991,c="[object Arguments]",s="[object AsyncFunction]",f="[object Function]",l="[object GeneratorFunction]",d="[object Null]",p="[object Object]",h="[object Proxy]",v="[object Undefined]",m=/^\[object .+?Constructor\]$/,y=/^(?:0|[1-9]\d*)$/,g={};g["[object Float32Array]"]=g["[object Float64Array]"]=g["[object Int8Array]"]=g["[object Int16Array]"]=g["[object Int32Array]"]=g["[object Uint8Array]"]=g["[object Uint8ClampedArray]"]=g["[object Uint16Array]"]=g["[object Uint32Array]"]=!0,g[c]=g["[object Array]"]=g["[object ArrayBuffer]"]=g["[object Boolean]"]=g["[object DataView]"]=g["[object Date]"]=g["[object Error]"]=g[f]=g["[object Map]"]=g["[object Number]"]=g[p]=g["[object RegExp]"]=g["[object Set]"]=g["[object String]"]=g["[object WeakMap]"]=!1;var b="object"==typeof t&&t&&t.Object===Object&&t,E="object"==typeof self&&self&&self.Object===Object&&self,_=b||E||Function("return this")(),T=e&&!e.nodeType&&e,w=T&&"object"==typeof n&&n&&!n.nodeType&&n,O=w&&w.exports===T,R=O&&b.process,C=function(){try{var t=w&&w.require&&w.require("util").types;return t||R&&R.binding&&R.binding("util")}catch(t){}}(),S=C&&C.isTypedArray;function x(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var j,A,L,k=Array.prototype,M=Function.prototype,I=Object.prototype,U=_["__core-js_shared__"],N=M.toString,D=I.hasOwnProperty,B=(j=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||""))?"Symbol(src)_1."+j:"",F=I.toString,z=N.call(Object),P=RegExp("^"+N.call(D).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H=O?_.Buffer:void 0,W=_.Symbol,$=_.Uint8Array,G=H?H.allocUnsafe:void 0,K=(A=Object.getPrototypeOf,L=Object,function(t){return A(L(t))}),q=Object.create,X=I.propertyIsEnumerable,J=k.splice,V=W?W.toStringTag:void 0,Y=function(){try{var t=Tt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Q=H?H.isBuffer:void 0,Z=Math.max,tt=Date.now,et=Tt(_,"Map"),nt=Tt(Object,"create"),rt=function(){function t(){}return function(e){if(!It(e))return{};if(q)return q(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function ot(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function it(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function ut(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function at(t){var e=this.__data__=new it(t);this.size=e.size}function ct(t,e){var n=jt(t),r=!n&&xt(t),o=!n&&!r&&Lt(t),i=!n&&!r&&!o&&Nt(t),u=n||r||o||i,a=u?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var s in t)!e&&!D.call(t,s)||u&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||wt(s,c))||a.push(s);return a}function st(t,e,n){(void 0===n||St(t[e],n))&&(void 0!==n||e in t)||dt(t,e,n)}function ft(t,e,n){var r=t[e];D.call(t,e)&&St(r,n)&&(void 0!==n||e in t)||dt(t,e,n)}function lt(t,e){for(var n=t.length;n--;)if(St(t[n][0],e))return n;return-1}function dt(t,e,n){"__proto__"==e&&Y?Y(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}ot.prototype.clear=function(){this.__data__=nt?nt(null):{},this.size=0},ot.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ot.prototype.get=function(t){var e=this.__data__;if(nt){var n=e[t];return n===o?void 0:n}return D.call(e,t)?e[t]:void 0},ot.prototype.has=function(t){var e=this.__data__;return nt?void 0!==e[t]:D.call(e,t)},ot.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=nt&&void 0===e?o:e,this},it.prototype.clear=function(){this.__data__=[],this.size=0},it.prototype.delete=function(t){var e=this.__data__,n=lt(e,t);return!(n<0)&&(n==e.length-1?e.pop():J.call(e,n,1),--this.size,!0)},it.prototype.get=function(t){var e=this.__data__,n=lt(e,t);return n<0?void 0:e[n][1]},it.prototype.has=function(t){return lt(this.__data__,t)>-1},it.prototype.set=function(t,e){var n=this.__data__,r=lt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},ut.prototype.clear=function(){this.size=0,this.__data__={hash:new ot,map:new(et||it),string:new ot}},ut.prototype.delete=function(t){var e=_t(this,t).delete(t);return this.size-=e?1:0,e},ut.prototype.get=function(t){return _t(this,t).get(t)},ut.prototype.has=function(t){return _t(this,t).has(t)},ut.prototype.set=function(t,e){var n=_t(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},at.prototype.clear=function(){this.__data__=new it,this.size=0},at.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},at.prototype.get=function(t){return this.__data__.get(t)},at.prototype.has=function(t){return this.__data__.has(t)},at.prototype.set=function(t,e){var n=this.__data__;if(n instanceof it){var o=n.__data__;if(!et||o.length<r-1)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new ut(o)}return n.set(t,e),this.size=n.size,this};var pt,ht=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),u=i.length;u--;){var a=i[pt?u:++r];if(!1===e(o[a],a,o))break}return t};function vt(t){return null==t?void 0===t?v:d:V&&V in Object(t)?function(t){var e=D.call(t,V),n=t[V];try{t[V]=void 0;var r=!0}catch(t){}var o=F.call(t);r&&(e?t[V]=n:delete t[V]);return o}(t):function(t){return F.call(t)}(t)}function mt(t){return Ut(t)&&vt(t)==c}function yt(t){return!(!It(t)||function(t){return!!B&&B in t}(t))&&(kt(t)?P:m).test(function(t){if(null!=t){try{return N.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function gt(t){if(!It(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Ot(t),n=[];for(var r in t)("constructor"!=r||!e&&D.call(t,r))&&n.push(r);return n}function bt(t,e,n,r,o){t!==e&&ht(e,(function(i,u){if(o||(o=new at),It(i))!function(t,e,n,r,o,i,u){var a=Rt(t,n),c=Rt(e,n),s=u.get(c);if(s)return void st(t,n,s);var f=i?i(a,c,n+"",t,e,u):void 0,l=void 0===f;if(l){var d=jt(c),h=!d&&Lt(c),v=!d&&!h&&Nt(c);f=c,d||h||v?jt(a)?f=a:Ut(E=a)&&At(E)?f=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n<r;)e[n]=t[n];return e}(a):h?(l=!1,f=function(t,e){if(e)return t.slice();var n=t.length,r=G?G(n):new t.constructor(n);return t.copy(r),r}(c,!0)):v?(l=!1,m=c,y=!0?(g=m.buffer,b=new g.constructor(g.byteLength),new $(b).set(new $(g)),b):m.buffer,f=new m.constructor(y,m.byteOffset,m.length)):f=[]:function(t){if(!Ut(t)||vt(t)!=p)return!1;var e=K(t);if(null===e)return!0;var n=D.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&N.call(n)==z}(c)||xt(c)?(f=a,xt(a)?f=function(t){return function(t,e,n,r){var o=!n;n||(n={});var i=-1,u=e.length;for(;++i<u;){var a=e[i],c=r?r(n[a],t[a],a,n,t):void 0;void 0===c&&(c=t[a]),o?dt(n,a,c):ft(n,a,c)}return n}(t,Dt(t))}(a):It(a)&&!kt(a)||(f=function(t){return"function"!=typeof t.constructor||Ot(t)?{}:rt(K(t))}(c))):l=!1}var m,y,g,b;var E;l&&(u.set(c,f),o(f,c,r,i,u),u.delete(c));st(t,n,f)}(t,e,u,n,bt,r,o);else{var a=r?r(Rt(t,u),i,u+"",t,e,o):void 0;void 0===a&&(a=i),st(t,u,a)}}),Dt)}function Et(t,e){return Ct(function(t,e,n){return e=Z(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Z(r.length-e,0),u=Array(i);++o<i;)u[o]=r[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=r[o];return a[e]=n(u),x(t,this,a)}}(t,e,zt),t+"")}function _t(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function Tt(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return yt(n)?n:void 0}function wt(t,e){var n=typeof t;return!!(e=null==e?a:e)&&("number"==n||"symbol"!=n&&y.test(t))&&t>-1&&t%1==0&&t<e}function Ot(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||I)}function Rt(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ct=function(t){var e=0,n=0;return function(){var r=tt(),o=u-(r-n);if(n=r,o>0){if(++e>=i)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Y?function(t,e){return Y(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:zt);function St(t,e){return t===e||t!=t&&e!=e}var xt=mt(function(){return arguments}())?mt:function(t){return Ut(t)&&D.call(t,"callee")&&!X.call(t,"callee")},jt=Array.isArray;function At(t){return null!=t&&Mt(t.length)&&!kt(t)}var Lt=Q||function(){return!1};function kt(t){if(!It(t))return!1;var e=vt(t);return e==f||e==l||e==s||e==h}function Mt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function It(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ut(t){return null!=t&&"object"==typeof t}var Nt=S?function(t){return function(e){return t(e)}}(S):function(t){return Ut(t)&&Mt(t.length)&&!!g[vt(t)]};function Dt(t){return At(t)?ct(t,!0):gt(t)}var Bt,Ft=(Bt=function(t,e,n){bt(t,e,n)},Et((function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=Bt.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!It(n))return!1;var r=typeof e;return!!("number"==r?At(n)&&wt(e,n.length):"string"==r&&e in n)&&St(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var u=e[n];u&&Bt(t,u,n,o)}return t})));function zt(t){return t}n.exports=Ft}).call(this,n(2),n(3)(t))},function(t,e){var n=9007199254740991,r="[object Arguments]",o="[object Function]",i="[object GeneratorFunction]",u=/^(?:0|[1-9]\d*)$/;function a(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var c,s,f=Object.prototype,l=f.hasOwnProperty,d=f.toString,p=f.propertyIsEnumerable,h=(c=Object.keys,s=Object,function(t){return c(s(t))}),v=Math.max,m=!p.call({valueOf:1},"valueOf");function y(t,e){var n=T(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&w(t)}(t)&&l.call(t,"callee")&&(!p.call(t,"callee")||d.call(t)==r)}(t)?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],o=n.length,i=!!o;for(var u in t)!e&&!l.call(t,u)||i&&("length"==u||b(u,o))||n.push(u);return n}function g(t,e,n){var r=t[e];l.call(t,e)&&_(r,n)&&(void 0!==n||e in t)||(t[e]=n)}function b(t,e){return!!(e=null==e?n:e)&&("number"==typeof t||u.test(t))&&t>-1&&t%1==0&&t<e}function E(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||f)}function _(t,e){return t===e||t!=t&&e!=e}var T=Array.isArray;function w(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}(t.length)&&!function(t){var e=O(t)?d.call(t):"";return e==o||e==i}(t)}function O(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var R,C=(R=function(t,e){if(m||E(e)||w(e))!function(t,e,n,r){n||(n={});for(var o=-1,i=e.length;++o<i;){var u=e[o],a=r?r(n[u],t[u],u,n,t):void 0;g(n,u,void 0===a?t[u]:a)}}(e,function(t){return w(t)?y(t):function(t){if(!E(t))return h(t);var e=[];for(var n in Object(t))l.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}(e),t);else for(var n in e)l.call(e,n)&&g(t,n,e[n])},function(t,e){return e=v(void 0===e?t.length-1:e,0),function(){for(var n=arguments,r=-1,o=v(n.length-e,0),i=Array(o);++r<o;)i[r]=n[e+r];r=-1;for(var u=Array(e+1);++r<e;)u[r]=n[r];return u[e]=i,a(t,this,u)}}((function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=R.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!O(n))return!1;var r=typeof e;return!!("number"==r?w(n)&&b(e,n.length):"string"==r&&e in n)&&_(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var u=e[n];u&&R(t,u,n,o)}return t})));t.exports=C},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";n.r(e),n.d(e,"datadogRum",(function(){return pe}));var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function o(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n((function(e){e(t.value)})).then(u,a)}c((r=r.apply(t,e||[])).next())}))}function i(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)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 u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function u(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var a,c,s=6e4;function f(t,e,n){var r=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing,i=!1,u=!1;return function(){var n=this;i?u=!0:(r?t.apply(this):u=!0,i=!0,setTimeout((function(){o&&u&&t.apply(n),i=!1,u=!1}),e))}}function l(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,l)}function d(t){return 0!==t&&100*Math.random()<=t}function p(t){return+(1e6*t).toFixed(0)}function h(t){var e={};return Object.keys(t).forEach((function(n){var r;e[(r=n,r.replace(/[A-Z]/g,(function(t,e){return(0!==e?"_":"")+t.toLowerCase()})).replace(/-/g,"_"))]=function t(e){if(Array.isArray(e))return e.map((function(e){return t(e)}));if("object"==typeof e)return h(e);return e}(t[n])})),e}function v(){}function m(t,e,n){if(null==t)return JSON.stringify(t);var r=[!1,void 0];y(t)&&(r=[!0,t.toJSON],delete t.toJSON);var o,i,u=[!1,void 0];"object"==typeof t&&y(o=Object.getPrototypeOf(t))&&(u=[!0,o.toJSON],delete o.toJSON);try{i=JSON.stringify(t,void 0,n)}catch(t){i="<error: unable to serialize object>"}finally{r[0]&&(t.toJSON=r[1]),u[0]&&(o.toJSON=u[1])}return i}function y(t){return"object"==typeof t&&null!==t&&t.hasOwnProperty("toJSON")}function g(t,e){return-1!==t.indexOf(e)}function b(t){return E(t)&&t>=0&&t<=100}function E(t){return"number"==typeof t}function _(t){return Math.floor(T()+t)}function T(){return void 0===c&&(c=performance.timing.navigationStart),c}function w(t){if(t.origin)return t.origin;var e=t.host.replace(/(:80|:443)$/,"");return t.protocol+"//"+e}!function(t){t.DOCUMENT="document",t.XHR="xhr",t.BEACON="beacon",t.FETCH="fetch",t.CSS="css",t.JS="js",t.IMAGE="image",t.FONT="font",t.MEDIA="media",t.OTHER="other"}(a||(a={}));var O={isCollectingError:!0,maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function R(t,e,n){var r="us"===e.datacenter?"com":"eu",o="production"===e.env?"datadoghq."+r:"datad0g."+r,i="version:"+e.version;return"https://"+t+"-http-intake.logs."+o+"/v1/input/"+e.clientToken+"?ddsource="+(n||"browser")+"&ddtags="+i}var C=n(1),S=n.n(C),x=n(0),j=n.n(x),A="?",L=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var M=function(){var t,e,n,r,o,i,u=[];function a(t,e,n){var r;for(var o in u)if(k(u,o))try{u[o](t,e,n)}catch(t){r=t}if(r)throw r}function c(t,r,o,i,u){if(e)I.augmentStackTraceWithInitialElement(e,r,o,""+t),f();else if(u)a(I(u),!0,u);else{var c,s={url:r,column:i,line:o},l=t;if("[object String]"==={}.toString.call(t)){var d=l.match(L);d&&(c=d[1],l=d[2])}a({name:c,message:l,stack:[s]},!0)}return!!n&&n.apply(this,arguments)}function s(t){var e=t.reason||"Empty reason";a(I(e),!0,e)}function f(){var n=e,r=t;e=void 0,t=void 0,a(n,!1,r)}function l(n){if(e){if(t===n)return;f()}var r=I(n);throw e=r,t=n,setTimeout((function(){t===n&&f()}),r.incomplete?2e3:0),n}return l.subscribe=function(t){!function(){if(r)return;n=window.onerror,window.onerror=z(c),r=!0}(),function(){if(i)return;o=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=z(s),i=!0}(),u.push(t)},l.unsubscribe=function(t){for(var e=u.length-1;e>=0;e-=1)u[e]===t&&u.splice(e,1);0===u.length&&(r&&(window.onerror=n,r=!1),i&&(window.onunhandledrejection=o,i=!1))},l.traceKitWindowOnError=c,l}(),I=function(){var t=!1;function e(t){if(t.stack){for(var e,n,r,o,i=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,a=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,s=/\((\S*)(?::(\d+))(?::(\d+))\)/,f=t.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");e=r[2]&&0===r[2].indexOf("eval"),n=s.exec(r[2]),e&&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]||A,line:r[3]?+r[3]:void 0,url:h?void 0:r[2]}}else if(a.exec(f[d]))o={args:[],column:(r=a.exec(f[d]))[4]?+r[4]:void 0,func:r[1]||A,line:+r[3],url:r[2]};else{if(!u.exec(f[d]))continue;e=(r=u.exec(f[d]))[3]&&r[3].indexOf(" > eval")>-1,n=c.exec(r[3]),e&&n?(r[3]=n[1],r[4]=n[2],r[5]=void 0):0!==d||r[5]||void 0===t.columnNumber||(l[0].column=t.columnNumber+1),o={args:r[2]?r[2].split(","):[],column:r[5]?+r[5]:void 0,func:r[1]||A,line:r[4]?+r[4]:void 0,url:r[3]}}!o.func&&o.line&&(o.func=A),l.push(o)}if(l.length)return{stack:l,message:t.message,name:t.name}}}function n(t,e,n,r){var o={url:e,line:n?+n:void 0};if(o.url&&o.line){t.incomplete=!1;var i=t.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),t.partial=!0,!0}return t.incomplete=!0,!1}function r(t,e){for(var o,i,u=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,a=[],c={},s=!1,f=r.caller;f&&!s;f=f.caller)f!==I&&f!==M&&(i={args:[],column:void 0,func:A,line:void 0,url:void 0},o=u.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),c[""+f]?s=!0:c[""+f]=!0,a.push(i));e&&a.splice(0,e);var l={stack:a,message:t.message,name:t.name};return n(l,t.sourceURL||t.fileName,t.line||t.lineNumber,t.message||t.description),l}function o(n,o){var i,u=void 0===o?0:+o;try{if(i=function(t){var e=t.stacktrace;if(e){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=e.split("\n"),u=[],a=0;a<i.length;a+=2){var c=void 0;r.exec(i[a])?c={args:[],column:void 0,func:(n=r.exec(i[a]))[3],line:+n[1],url:n[2]}:o.exec(i[a])&&(c={args:(n=o.exec(i[a]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),c&&(!c.func&&c.line&&(c.func=A),c.context=[i[a+1]],u.push(c))}if(u.length)return{stack:u,message:t.message,name:t.name}}}(n))return i}catch(e){if(t)throw e}try{if(i=e(n))return i}catch(e){if(t)throw e}try{if(i=function(t){var e=t.message.split("\n");if(!(e.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,u=[],a=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var s in a)k(a,s)&&!a[s].src&&c.push(a[s]);for(var f=2;f<e.length;f+=2){var l=void 0;if(r.exec(e[f]))l={args:[],column:void 0,func:(n=r.exec(e[f]))[3],line:+n[1],url:n[2]};else if(o.exec(e[f]))l={args:[],column:void 0,func:(n=o.exec(e[f]))[4],line:+n[1],url:n[3]};else if(i.exec(e[f])){n=i.exec(e[f]),l={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+n[1]}}l&&(l.func||(l.func=A),l.context=[e[f+1]],u.push(l))}if(u.length)return{stack:u,message:e[0],name:t.name}}}(n))return i}catch(e){if(t)throw e}try{if(i=r(n,u+1))return i}catch(e){if(t)throw e}return{message:n.message,name:n.name,stack:[]}}return o.augmentStackTraceWithInitialElement=n,o.computeStackTraceFromStackProp=e,o.ofCaller=function(t){var e=1+(void 0===t?0:+t);try{throw new Error}catch(t){return I(t,e+1)}},o}();var U=function(){function t(t,e,n){void 0===n&&(n=!1),this.endpointUrl=t,this.bytesLimit=e,this.withBatchTime=n}return t.prototype.send=function(t,e){var n=this.withBatchTime?function(t){return t+(-1===t.indexOf("?")?"?":"&")+"batch_time="+(new Date).getTime()}(this.endpointUrl):this.endpointUrl;if(navigator.sendBeacon&&e<this.bytesLimit&&navigator.sendBeacon(n,t))return;var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(t)},t}();var N,D=function(){function t(t,e,n,r,o,i){this.request=t,this.maxSize=e,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=o,this.contextProvider=i,this.beforeFlushOnUnloadHandlers=[],this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),this.flushPeriodically()}return t.prototype.add=function(t){this.addOrUpdate(t)},t.prototype.upsert=function(t,e){this.addOrUpdate(t,e)},t.prototype.beforeFlushOnUnload=function(t){this.beforeFlushOnUnloadHandlers.push(t)},t.prototype.flush=function(){if(0!==this.bufferMessageCount){var t=u(this.pushOnlyBuffer,(e=this.upsertBuffer,n=[],Object.keys(e).forEach((function(t){n.push(e[t])})),n));this.request.send(t.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var e,n},t.prototype.addOrUpdate=function(t,e){var n=this.process(t),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(e)&&this.remove(e),this.willReachedBytesLimitWith(o)&&this.flush(),this.push(r,o,e),this.isFull()&&this.flush())},t.prototype.process=function(t){var e=m(j()({},this.contextProvider(),t));return{processedMessage:e,messageBytesSize:this.sizeInBytes(e)}},t.prototype.push=function(t,e,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=t:this.pushOnlyBuffer.push(t),this.bufferBytesSize+=e,this.bufferMessageCount+=1},t.prototype.remove=function(t){var e=this.upsertBuffer[t];delete this.upsertBuffer[t];var n=this.sizeInBytes(e);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},t.prototype.hasMessageFor=function(t){return void 0!==t&&void 0!==this.upsertBuffer[t]},t.prototype.willReachedBytesLimitWith=function(t){return this.bufferBytesSize+t+1>=this.bytesLimit},t.prototype.isFull=function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},t.prototype.sizeInBytes=function(t){return~-encodeURI(t).split(/%..|./).length},t.prototype.flushPeriodically=function(){var t=this;setTimeout((function(){t.flush(),t.flushPeriodically()}),this.flushTimeout)},t.prototype.flushOnVisibilityHidden=function(){var t=this;navigator.sendBeacon&&(window.addEventListener("beforeunload",z((function(){t.beforeFlushOnUnloadHandlers.forEach((function(t){return t()}))}))),document.addEventListener("visibilitychange",z((function(){"hidden"===document.visibilityState&&t.flush()}))),window.addEventListener("beforeunload",z((function(){return t.flush()}))))},t}();!function(t){t.info="info",t.error="error"}(N||(N={}));var B,F={maxMessagesPerPage:0,sentMessageCount:0};function z(t){return function(){try{return t.apply(this,arguments)}catch(t){G(t);try{H(t)}catch(t){G(t)}}}}function P(t){!function(t){F.debugMode&&console.log("[MONITORING MESSAGE]",t)}(t),W({message:t,status:N.info})}function H(t){W(r(r({},function(t){if(t instanceof Error){var e=I(t);return{error:{kind:e.name,stack:ct(e)},message:e.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+m(t)}}(t)),{status:N.error}))}function W(t){F.batch&&F.sentMessageCount<F.maxMessagesPerPage&&(F.sentMessageCount+=1,F.batch.add(t))}function $(t){F.debugMode=t}function G(t){F.debugMode&&console.warn("[INTERNAL ERROR]",t)}var K,q,X,J,V,Y,Q,Z=function(){function t(){this.observers=[]}return t.prototype.subscribe=function(t){this.observers.push(t)},t.prototype.notify=function(t){this.observers.forEach((function(e){return e(t)}))},t}();function tt(t){return rt(t,w(window.location)).href}function et(t,e){return nt(t)===nt(e)}function nt(t){return w(rt(t))}function rt(t,e){if(function(){if(void 0!==K)return K;try{var t=new URL("http://test/path");return K="http://test/path"===t.href}catch(t){K=!1}return K}())return void 0!==e?new URL(t,e):new URL(t);if(void 0===e&&!/:/.test(t))throw new Error("Invalid URL: '"+t+"'");var n=document,r=n.createElement("a");if(void 0!==e){var o=(n=document.implementation.createHTMLDocument("")).createElement("base");o.href=e,n.head.appendChild(o),n.body.appendChild(r)}return r.href=t,r}function ot(){return X||(function(t){var e=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=z((function(t,n){return this._datadog_xhr={method:t,url:n},e.apply(this,arguments)}));var n=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(e){var r=this,o=performance.now(),i=!1,u=function(){i||(i=!0,t.notify({startTime:o,duration:performance.now()-o,method:r._datadog_xhr.method,response:r.response,status:r.status,traceId:it(),type:q.XHR,url:tt(r._datadog_xhr.url)}))},a=this.onreadystatechange;return this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&z(u)(),a&&a.apply(this,arguments)},this.addEventListener("loadend",z(u)),n.apply(this,arguments)}}(X=new Z),function(t){if(!window.fetch)return;var e=window.fetch;window.fetch=z((function(n,r){var u=this,a=r&&r.method||"object"==typeof n&&n.method||"GET",c=performance.now(),s=function(e){return o(u,void 0,void 0,(function(){var r,o,u,s,f;return i(this,(function(i){switch(i.label){case 0:return r=performance.now()-c,o=tt("object"==typeof n&&n.url||n),"stack"in e||e instanceof Error?(u=I(e),t.notify({duration:r,method:a,startTime:c,url:o,response:ct(u),status:0,traceId:it(),type:q.FETCH}),[3,6]):[3,1];case 1:if(!("status"in e))return[3,6];s=void 0,i.label=2;case 2:return i.trys.push([2,4,,5]),[4,e.clone().text()];case 3:return s=i.sent(),[3,5];case 4:return f=i.sent(),s="Unable to retrieve response: "+f,[3,5];case 5:t.notify({duration:r,method:a,startTime:c,url:o,response:s,responseType:e.type,status:e.status,traceId:it(),type:q.FETCH}),i.label=6;case 6:return[2]}}))}))},f=e.call(this,n,r);return f.then(z(s),z(s)),f}))}(X)),X}function it(){return"ddtrace"in window&&window.ddtrace.tracer.scope().active()?window.ddtrace.tracer.scope().active().context().toTraceId():void 0}function ut(t){if(!V){var e=new Z;if(t.isCollectingError)!function(t,e,n){n.subscribe((function(n){(function(t){return 0===t.status&&"opaque"!==t.responseType}(n)||function(t){return t.status>=500}(n))&&e.notify({context:{error:{origin:J.NETWORK,stack:st(n.response,t)||"Failed to load"},http:{method:n.method,status_code:n.status,url:n.url}},message:ft(n.type)+" error "+n.method+" "+n.url,startTime:n.startTime})}))}(t,e,ot()),function(t){Y=console.error,console.error=z((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];Y.apply(console,u([e],n)),t.notify({context:{error:{origin:J.CONSOLE}},message:u(["console error:",e],n).map(at).join(" "),startTime:performance.now()})}))}(e),function(t){Q=function(e,n,r){t.notify(function(t,e){var n,r;void 0!==t.message||e instanceof Error?(n=t.message||"Empty message",r=ct(t)):(n="Uncaught "+m(e),r="No stack, consider using an instance of Error");return{message:n,context:{error:{stack:r,kind:t.name,origin:J.SOURCE}},startTime:performance.now()}}(e,r))},M.subscribe(Q)}(e);V=function(t,e){var n=0,r=new Z;return e.subscribe((function(e){n<t.maxErrorsByMinute?(n+=1,r.notify(e)):n===t.maxErrorsByMinute&&(n+=1,r.notify({context:{error:{origin:J.AGENT}},message:"Reached max number of errors by minute: "+t.maxErrorsByMinute,startTime:performance.now()}))})),setInterval((function(){return n=0}),s),r}(t,e)}return V}function at(t){return"string"==typeof t?t:t instanceof Error?ct(I(t)):m(t,0,2)}function ct(t){var e=(t.name||"Error")+": "+t.message;return t.stack.forEach((function(t){var n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?"("+t.args.join(", ")+")":"",o=t.line?":"+t.line:"",i=t.line&&t.column?":"+t.column:"";e+="\n at "+n+r+" @ "+t.url+o+i})),e}function st(t,e){return t&&t.length>e.requestErrorResponseLengthLimit?t.substring(0,e.requestErrorResponseLengthLimit)+"...":t}function ft(t){return q.XHR===t?"XHR":"Fetch"}!function(t){t.FETCH="fetch",t.XHR="xhr"}(q||(q={})),function(t){t.AGENT="agent",t.CONSOLE="console",t.NETWORK="network",t.SOURCE="source",t.LOGGER="logger"}(J||(J={}));var lt=1e3;function dt(t,e,n){var r=new Date;r.setTime(r.getTime()+n);var o="expires="+r.toUTCString();document.cookie=t+"="+e+";"+o+";path=/"}function pt(t){var e=document.cookie.match("(^|;)\\s*"+t+"\\s*=\\s*([^;]+)");return e?e.pop():void 0}function ht(t){console.warn("'"+t+"' not yet available, please call '.init()' first.")}function vt(t,e){var n=function(t,e){var n={clientToken:t.clientToken,datacenter:t.datacenter||e.datacenter,env:e.env,version:e.version},o=Array.isArray(t.enableExperimentalFeatures)?t.enableExperimentalFeatures:[],i=r({isEnabled:function(t){return g(o,t)},logsEndpoint:R("browser",n),rumEndpoint:R("rum",n),traceEndpoint:R("public-trace",n)},O);return t.internalMonitoringApiKey&&(i.internalMonitoringEndpoint=R("browser",n,"browser-agent-internal-monitoring")),"isCollectingError"in t&&(i.isCollectingError=!!t.isCollectingError),"sampleRate"in t&&(i.sampleRate=t.sampleRate),"resourceSampleRate"in t&&(i.resourceSampleRate=t.resourceSampleRate),"e2e-test"===n.env&&(void 0!==t.internalMonitoringEndpoint&&(i.internalMonitoringEndpoint=t.internalMonitoringEndpoint),void 0!==t.logsEndpoint&&(i.logsEndpoint=t.logsEndpoint),void 0!==t.rumEndpoint&&(i.rumEndpoint=t.rumEndpoint)),i}(t,e),o=function(t){if(t.internalMonitoringEndpoint){var e=new D(new U(t.internalMonitoringEndpoint,t.batchBytesLimit),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout,(function(){return j()({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==B?B():{})}));S()(F,{batch:e,maxMessagesPerPage:t.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(t){B=t}}}(n);return{configuration:n,errorObservable:ut(n),internalMonitoring:o}}function mt(){return!!function(){if(void 0===document.cookie||null===document.cookie)return!1;try{return dt("dd_rum_test","test",1e3),"test"===pt("dd_rum_test")}catch(t){return console.error(t),!1}}()||(console.warn("Cookies are not authorized, we will not send any data."),!1)}function yt(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}var gt="_dd",bt="_dd_r",Et="_dd_l",_t="rum",Tt="logs";var wt="_dd_s",Ot=15*s;function Rt(t,e){var n,r,o,i,u,a=(n=wt,i=!1,u=function(){i=!0,window.clearTimeout(r),r=window.setTimeout((function(){i=!1}),lt)},{get:function(){return i?o:(o=pt(n),u(),o)},set:function(t,e){dt(n,t,e),o=t,u()}});!function(t){var e=t.get(),n=pt(gt),r=pt(bt),o=pt(Et);if(!e){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i[Tt]=o),r&&/^[012]$/.test(r)&&(i[_t]=r),jt(i,t)}}(a);var c=new Z,s=xt(a).id,d=f((function(){var n=xt(a),r=e(n[t]),o=r.type,i=r.isTracked;n[t]=o,i&&!n.id&&(n.id=l()),jt(n,a),i&&s!==n.id&&(s=n.id,c.notify())}),lt);return d(),function(t){var e={capture:!0,passive:!0};["click","touchstart","keydown","scroll"].forEach((function(n){document.addEventListener(n,t,e),At.push((function(){return document.removeEventListener(n,t,e)}))}))}(d),{getId:function(){return xt(a).id},getType:function(){return xt(a)[t]},renewObservable:c}}var Ct=/^([a-z]+)=([a-z0-9-]+)$/,St="&";function xt(t){var e=t.get(),n={};return function(t){return void 0!==t&&(-1!==t.indexOf(St)||Ct.test(t))}(e)&&e.split(St).forEach((function(t){var e=Ct.exec(t);if(null!==e){var r=e[1],o=e[2];n[r]=o}})),n}function jt(t,e){var n,r=(n=t,Object.keys(n).map((function(t){return[t,n[t]]}))).map((function(t){return t[0]+"="+t[1]})).join(St);e.set(r,Ot)}var At=[];(function(){function t(t){var e=this;this.requests=[],this.pendingFetch=0,this.whenAllCompleteFn=v,t.subscribe((function(t){e.requests.push(t),e.pendingFetch-=1,0===e.pendingFetch&&setTimeout((function(){e.whenAllCompleteFn(e.requests)}))}))}t.prototype.whenAllComplete=function(t){this.whenAllCompleteFn=t},t.prototype.getStub=function(){var t=this;return function(){var e,n;t.pendingFetch+=1;var u=new Promise((function(t,r){e=t,n=r}));return u.resolveWith=function(n){return o(t,void 0,void 0,(function(){var t=this;return i(this,(function(u){return[2,e(r(r({},n),{clone:function(){return{text:function(){return o(t,void 0,void 0,(function(){return i(this,(function(t){if(n.responseTextError)throw n.responseTextError;return[2,n.responseText]}))}))}}}}))]}))}))},u.rejectWith=function(e){return o(t,void 0,void 0,(function(){return i(this,(function(t){return[2,n(e)]}))}))},u}}})(),function(){function t(){}t.prototype.fakeEntry=function(t,e){var n=function(){return[t]};this.instance.callback({getEntries:n,getEntriesByName:n,getEntriesByType:function(t){return t===e?n():[]}})},t.prototype.getStub=function(){var t,e=this;return(t=function(){function t(t){this.callback=t,e.instance=this}return t.prototype.observe=function(t){},t}()).supportedEntryTypes=["navigation"],t}}();var Lt,kt={datacenter:"us",env:"production",version:"1.9.1"};!function(t){t[t.ERROR_COLLECTED=0]="ERROR_COLLECTED",t[t.PERFORMANCE_ENTRY_COLLECTED=1]="PERFORMANCE_ENTRY_COLLECTED",t[t.USER_ACTION_COLLECTED=2]="USER_ACTION_COLLECTED",t[t.REQUEST_COLLECTED=3]="REQUEST_COLLECTED",t[t.SESSION_RENEWED=4]="SESSION_RENEWED",t[t.RESOURCE_ADDED_TO_BATCH=5]="RESOURCE_ADDED_TO_BATCH"}(Lt||(Lt={}));var Mt,It=function(){function t(){this.callbacks={}}return t.prototype.notify=function(t,e){var n=this.callbacks[t];n&&n.forEach((function(t){return t(e)}))},t.prototype.subscribe=function(t,e){var n=this.callbacks[t];n?n.push(e):this.callbacks[t]=[e]},t}(),Ut="initial_document",Nt=[[a.DOCUMENT,function(t){return Ut===t}],[a.XHR,function(t){return"xmlhttprequest"===t}],[a.FETCH,function(t){return"fetch"===t}],[a.BEACON,function(t){return"beacon"===t}],[a.CSS,function(t,e){return null!==e.match(/\.css$/i)}],[a.JS,function(t,e){return null!==e.match(/\.js$/i)}],[a.IMAGE,function(t,e){return g(["image","img","icon"],t)||null!==e.match(/\.(gif|jpg|jpeg|tiff|png|svg)$/i)}],[a.FONT,function(t,e){return null!==e.match(/\.(woff|eot|woff2|ttf)$/i)}],[a.MEDIA,function(t,e){return g(["audio","video"],t)||null!==e.match(/\.(mp3|mp4)$/i)}]];function Dt(t){var e=t.name;if(!function(t){try{return!!rt(t)}catch(t){return!1}}(e))return P('Failed to construct URL for "'+t.name+'"'),a.OTHER;for(var n=function(t){var e=rt(t).pathname;return"/"===e[0]?e:"/"+e}(e),r=0,o=Nt;r<o.length;r++){var i=o[r],u=i[0];if((0,i[1])(t.initiatorType,n))return u}return a.OTHER}function Bt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=1;n<t.length;n+=1)if(t[n-1]>t[n])return!1;return!0}function Ft(t){var e=t.duration,n=t.startTime,r=t.responseEnd;return p(0===e&&n<r?r-n:e)}function zt(t){var e=t.startTime,n=t.fetchStart,r=t.domainLookupStart,o=t.domainLookupEnd,i=t.connectStart,u=t.secureConnectionStart,a=t.connectEnd,c=t.requestStart,s=t.responseStart,f=t.responseEnd,l=t.redirectStart,d=t.redirectEnd;if(Bt(e,n,r,o,i,a,c,s,f)){var p=n!==e;if(!p||(l<e&&(l=e),d<e&&(d=n),Bt(e,l,d,n))){var h={download:Pt(e,s,f),firstByte:Pt(e,c,s)};return a!==n&&(h.connect=Pt(e,i,a),Bt(i,u,a)&&(h.ssl=Pt(e,u,a))),o!==n&&(h.dns=Pt(e,r,o)),p&&(h.redirect=Pt(e,l,d)),h}}}function Pt(t,e,n){return{duration:p(n-e),start:p(e-t)}}function Ht(t){if(t.startTime<t.responseStart)return t.decodedBodySize}function Wt(t,e){return t&&!function(t,e){return et(t,e.logsEndpoint)||et(t,e.rumEndpoint)||et(t,e.traceEndpoint)||e.internalMonitoringEndpoint&&et(t,e.internalMonitoringEndpoint)}(t,e)}function $t(){return void 0!==window.performance&&"getEntries"in performance}function Gt(){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("navigation")}function Kt(t,e){(function(t){var e;if(Gt()&&performance.getEntriesByType("navigation").length>0){var n=performance.getEntriesByType("navigation")[0];e=r({},n.toJSON())}else e=r(r({},qt()),{name:window.location.href,decodedBodySize:0,startTime:0});e.entryType="resource",e.initiatorType=Ut,e.duration=e.responseEnd,t(e)}((function(n){Xt(e,t,[n])})),$t()&&Xt(e,t,performance.getEntries()),window.PerformanceObserver)&&(new PerformanceObserver(z((function(n){return Xt(e,t,n.getEntries())}))).observe({entryTypes:["resource","navigation","paint","longtask"]}),$t()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()})));Gt()||function(t){function e(){var e=r(r({},qt()),{entryType:"navigation"});t(e)}if("complete"===document.readyState)e();else{var n=function(){window.removeEventListener("load",n),setTimeout(z(e))};window.addEventListener("load",n)}}((function(n){Xt(e,t,[n])}))}function qt(){var t={},e=performance.timing;for(var n in e)E(e[n])&&(t[n]=0===e[n]?0:e[n]-T());return t}function Xt(t,e,n){function r(t){e.notify(Lt.PERFORMANCE_ENTRY_COLLECTED,t)}t.isTrackedWithResource()&&n.filter((function(t){return"resource"===t.entryType})).forEach(r),n.filter((function(t){return"navigation"===t.entryType})).filter((function(t){return t.loadEventEnd>0})).forEach(r),n.filter((function(t){return"paint"===t.entryType})).forEach(r),n.filter((function(t){return"longtask"===t.entryType})).forEach(r)}function Jt(t){if(performance&&"getEntriesByName"in performance){var e,n=performance.getEntriesByName(t.url,"resource").filter((function(e){return n=e,r=t.startTime,o=Vt(t),n.startTime>=r&&Vt(n)<=o;var n,r,o}));return 1===n.length?n[0]:2===n.length&&Vt((e=n)[0])<=e[1].startTime?n[1]:void 0}}function Vt(t){return t.startTime+t.duration}var Yt,Qt,Zt,te,ee=3e3;function ne(t,e,n,o,i){var u=f(z((function(){return oe(o)})),ee,{leading:!1});re(t,n,o),function(t,e,n){var r=history.pushState;history.pushState=z((function(){r.apply(this,arguments),ue(t,e,n)}));var o=history.replaceState;history.replaceState=z((function(){o.apply(this,arguments),ue(t,e,n)})),window.addEventListener("popstate",(function(){ue(t,e,n)}))}(t,n,o),function(t,e){t.subscribe(Lt.PERFORMANCE_ENTRY_COLLECTED,(function(t){if("navigation"===t.entryType){var n=t;Zt=r(r({},Zt),{domComplete:p(n.domComplete),domContentLoaded:p(n.domContentLoadedEventEnd),domInteractive:p(n.domInteractive),loadEventEnd:p(n.loadEventEnd)}),e()}else if("paint"===t.entryType&&"first-contentful-paint"===t.name){var o=t;Zt=r(r({},Zt),{firstContentfulPaint:p(o.startTime)}),e()}})),t.subscribe(Lt.ERROR_COLLECTED,(function(){Zt.errorCount+=1,e()})),t.subscribe(Lt.USER_ACTION_COLLECTED,(function(){Zt.userActionCount+=1,e()})),t.subscribe(Lt.PERFORMANCE_ENTRY_COLLECTED,(function(t){"longtask"===t.entryType&&(Zt.longTaskCount+=1,e())})),t.subscribe(Lt.RESOURCE_ADDED_TO_BATCH,(function(){Zt.resourceCount+=1,e()}))}(e,u),function(t,e,n,r){e.subscribe(Lt.SESSION_RENEWED,(function(){oe(r),re(t,n,r)}))}(t,e,n,o),i((function(){return oe(o)}))}function re(t,e,n){Yt=Mt?performance.now():0,Mt={id:l(),location:r({},t),sessionId:e.getId()},Qt=1,Zt={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},ie(n)}function oe(t){Qt+=1,ie(t)}function ie(t){t({date:_(Yt),duration:p(performance.now()-Yt),evt:{category:te.VIEW},rum:{documentVersion:Qt},view:{measures:Zt}},Mt.id)}function ue(t,e,n){var r,o;r=Mt.location,o=t,r.pathname!==o.pathname&&(oe(n),re(t,e,n))}function ae(t,e,n,o,i){var u={};i.setExternalContextProvider((function(){return j()({application_id:t,session_id:Mt.sessionId,view:{id:Mt.id}},u)}));var c=function(t,e,n,r){var o=new D(new U(t.rumEndpoint,t.batchBytesLimit,!0),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout,(function(){return j()(h(n()),r())}));return{addRumEvent:function(t){e.isTracked()&&o.add(h(t))},addUserEvent:function(t){e.isTracked()&&o.add(t)},beforeFlushOnUnload:function(t){return o.beforeFlushOnUnload(t)},upsertRumEvent:function(t,n){e.isTracked()&&o.upsert(h(t),n)}}}(n,o,(function(){return{applicationId:t,date:(new Date).getTime(),sessionId:Mt.sessionId,view:{id:Mt.id,referrer:document.referrer,url:Mt.location.href}}}),(function(){return u}));return ne(window.location,e,o,c.upsertRumEvent,c.beforeFlushOnUnload),function(t,e){t.subscribe(Lt.ERROR_COLLECTED,(function(t){var n=t.message,o=t.startTime,i=t.context;e(r({message:n,date:_(o),evt:{category:te.ERROR}},i))}))}(e,c.addRumEvent),function(t,e,n,r){e.subscribe(Lt.REQUEST_COLLECTED,(function(o){if(n.isTrackedWithResource()&&Wt(o.url,t)){var i=Jt(o),u=o.type===q.XHR?a.XHR:a.FETCH;r({date:_(i?i.startTime:o.startTime),duration:i?Ft(i):p(o.duration),evt:{category:te.RESOURCE},http:{method:o.method,performance:i?zt(i):void 0,statusCode:o.status,url:o.url},network:{bytesWritten:i?Ht(i):void 0},resource:{kind:u},traceId:o.traceId}),e.notify(Lt.RESOURCE_ADDED_TO_BATCH)}}))}(n,e,o,c.addRumEvent),function(t,e,n){e.subscribe(Lt.PERFORMANCE_ENTRY_COLLECTED,(function(r){switch(r.entryType){case"resource":!function(t,e,n,r){if(!Wt(e.name,t))return;var o=Dt(e);if(g([a.XHR,a.FETCH],o))return;n({date:_(e.startTime),duration:Ft(e),evt:{category:te.RESOURCE},http:{performance:zt(e),url:e.name},network:{bytesWritten:Ht(e)},resource:{kind:o}}),r.notify(Lt.RESOURCE_ADDED_TO_BATCH)}(t,r,n,e);break;case"longtask":!function(t,e){e({date:_(t.startTime),duration:p(t.duration),evt:{category:te.LONG_TASK}})}(r,n)}}))}(n,e,c.addRumEvent),function(t,e){t.subscribe(Lt.USER_ACTION_COLLECTED,(function(t){var n=t.name,o=t.context;e(r(r({},o),{evt:{name:n,category:te.USER_ACTION}}))}))}(e,c.addUserEvent),{addRumGlobalContext:z((function(t,e){u[t]=e})),addUserAction:z((function(t,n){e.notify(Lt.USER_ACTION_COLLECTED,{name:t,context:n})})),getInternalContext:z((function(){return{application_id:t,session_id:Mt.sessionId,view:{id:Mt.id}}})),setRumGlobalContext:z((function(t){u=t}))}}!function(t){t.USER_ACTION="user_action",t.ERROR="error",t.LONG_TASK="long_task",t.VIEW="view",t.RESOURCE="resource"}(te||(te={}));var ce,se="rum";function fe(t,e){var n=Rt(se,(function(e){return function(t,e){var n;r=e,n=r===ce.NOT_TRACKED||r===ce.TRACKED_WITH_RESOURCES||r===ce.TRACKED_WITHOUT_RESOURCES?e:d(t.sampleRate)?d(t.resourceSampleRate)?ce.TRACKED_WITH_RESOURCES:ce.TRACKED_WITHOUT_RESOURCES:ce.NOT_TRACKED;var r;return{isTracked:le(n),type:n}}(t,e)}));return n.renewObservable.subscribe((function(){e.notify(Lt.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&le(n.getType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getType()===ce.TRACKED_WITH_RESOURCES}}}function le(t){return t===ce.TRACKED_WITH_RESOURCES||t===ce.TRACKED_WITHOUT_RESOURCES}!function(t){t.NOT_TRACKED="0",t.TRACKED_WITH_RESOURCES="1",t.TRACKED_WITHOUT_RESOURCES="2"}(ce||(ce={}));var de,pe=(de=r({},{init:function(t){ht("core.init")},addRumGlobalContext:function(t,e){ht("addRumGlobalContext")},setRumGlobalContext:function(t){ht("setRumGlobalContext")},addUserAction:function(t,e){ht("addUserAction")},getInternalContext:function(){ht("getInternalContext")}}),Object.defineProperty(de,"_setDebug",{get:function(){return $},enumerable:!1}),de),he=!1;pe.init=z((function(t){if(mt()&&yt()&&function(t){if(he)return t.silentMultipleInit||console.error("DD_RUM is already initialized."),!1;if(!t||!t.clientToken&&!t.publicApiKey)return console.error("Client Token is not configured, we will not send any data."),!1;if(!t.applicationId)return console.error("Application ID is not configured, no RUM data will be collected."),!1;if(void 0!==t.sampleRate&&!b(t.sampleRate))return console.error("Sample Rate should be a number between 0 and 100"),!1;if(void 0!==t.resourceSampleRate&&!b(t.resourceSampleRate))return console.error("Resource Sample Rate should be a number between 0 and 100"),!1;return!0}(t)){t.publicApiKey&&(t.clientToken=t.publicApiKey);var e=r(r({},t),{isCollectingError:!0}),n=new It,o=vt(e,kt),i=o.errorObservable,u=o.configuration,a=o.internalMonitoring,c=fe(u,n),s=ae(e.applicationId,n,u,c,a),f=ot();Kt(n,c),i.subscribe((function(t){return n.notify(Lt.ERROR_COLLECTED,t)})),f.subscribe((function(t){return n.notify(Lt.REQUEST_COLLECTED,t)})),S()(pe,s),he=!0}})),("object"==typeof globalThis?globalThis:Function("return this")()).DD_RUM=pe}]);
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=4)}([function(t,e,n){(function(t,n){var r=200,o="__lodash_hash_undefined__",i=800,u=16,a=9007199254740991,c="[object Arguments]",s="[object AsyncFunction]",f="[object Function]",l="[object GeneratorFunction]",d="[object Null]",p="[object Object]",v="[object Proxy]",h="[object Undefined]",m=/^\[object .+?Constructor\]$/,y=/^(?:0|[1-9]\d*)$/,E={};E["[object Float32Array]"]=E["[object Float64Array]"]=E["[object Int8Array]"]=E["[object Int16Array]"]=E["[object Int32Array]"]=E["[object Uint8Array]"]=E["[object Uint8ClampedArray]"]=E["[object Uint16Array]"]=E["[object Uint32Array]"]=!0,E[c]=E["[object Array]"]=E["[object ArrayBuffer]"]=E["[object Boolean]"]=E["[object DataView]"]=E["[object Date]"]=E["[object Error]"]=E[f]=E["[object Map]"]=E["[object Number]"]=E[p]=E["[object RegExp]"]=E["[object Set]"]=E["[object String]"]=E["[object WeakMap]"]=!1;var b="object"==typeof t&&t&&t.Object===Object&&t,g="object"==typeof self&&self&&self.Object===Object&&self,T=b||g||Function("return this")(),_=e&&!e.nodeType&&e,O=_&&"object"==typeof n&&n&&!n.nodeType&&n,w=O&&O.exports===_,R=w&&b.process,C=function(){try{var t=O&&O.require&&O.require("util").types;return t||R&&R.binding&&R.binding("util")}catch(t){}}(),S=C&&C.isTypedArray;function A(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var L,x,I,M=Array.prototype,j=Function.prototype,D=Object.prototype,U=T["__core-js_shared__"],N=j.toString,k=D.hasOwnProperty,B=(L=/[^.]+$/.exec(U&&U.keys&&U.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"",P=D.toString,F=N.call(Object),z=RegExp("^"+N.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),H=w?T.Buffer:void 0,W=T.Symbol,K=T.Uint8Array,$=H?H.allocUnsafe:void 0,q=(x=Object.getPrototypeOf,I=Object,function(t){return x(I(t))}),G=Object.create,X=D.propertyIsEnumerable,V=M.splice,Y=W?W.toStringTag:void 0,J=function(){try{var t=_t(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Q=H?H.isBuffer:void 0,Z=Math.max,tt=Date.now,et=_t(T,"Map"),nt=_t(Object,"create"),rt=function(){function t(){}return function(e){if(!Dt(e))return{};if(G)return G(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function ot(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function it(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function ut(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function at(t){var e=this.__data__=new it(t);this.size=e.size}function ct(t,e){var n=Lt(t),r=!n&&At(t),o=!n&&!r&&It(t),i=!n&&!r&&!o&&Nt(t),u=n||r||o||i,a=u?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],c=a.length;for(var s in t)!e&&!k.call(t,s)||u&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||Ot(s,c))||a.push(s);return a}function st(t,e,n){(void 0===n||St(t[e],n))&&(void 0!==n||e in t)||dt(t,e,n)}function ft(t,e,n){var r=t[e];k.call(t,e)&&St(r,n)&&(void 0!==n||e in t)||dt(t,e,n)}function lt(t,e){for(var n=t.length;n--;)if(St(t[n][0],e))return n;return-1}function dt(t,e,n){"__proto__"==e&&J?J(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}ot.prototype.clear=function(){this.__data__=nt?nt(null):{},this.size=0},ot.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ot.prototype.get=function(t){var e=this.__data__;if(nt){var n=e[t];return n===o?void 0:n}return k.call(e,t)?e[t]:void 0},ot.prototype.has=function(t){var e=this.__data__;return nt?void 0!==e[t]:k.call(e,t)},ot.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=nt&&void 0===e?o:e,this},it.prototype.clear=function(){this.__data__=[],this.size=0},it.prototype.delete=function(t){var e=this.__data__,n=lt(e,t);return!(n<0)&&(n==e.length-1?e.pop():V.call(e,n,1),--this.size,!0)},it.prototype.get=function(t){var e=this.__data__,n=lt(e,t);return n<0?void 0:e[n][1]},it.prototype.has=function(t){return lt(this.__data__,t)>-1},it.prototype.set=function(t,e){var n=this.__data__,r=lt(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},ut.prototype.clear=function(){this.size=0,this.__data__={hash:new ot,map:new(et||it),string:new ot}},ut.prototype.delete=function(t){var e=Tt(this,t).delete(t);return this.size-=e?1:0,e},ut.prototype.get=function(t){return Tt(this,t).get(t)},ut.prototype.has=function(t){return Tt(this,t).has(t)},ut.prototype.set=function(t,e){var n=Tt(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},at.prototype.clear=function(){this.__data__=new it,this.size=0},at.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},at.prototype.get=function(t){return this.__data__.get(t)},at.prototype.has=function(t){return this.__data__.has(t)},at.prototype.set=function(t,e){var n=this.__data__;if(n instanceof it){var o=n.__data__;if(!et||o.length<r-1)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new ut(o)}return n.set(t,e),this.size=n.size,this};var pt,vt=function(t,e,n){for(var r=-1,o=Object(t),i=n(t),u=i.length;u--;){var a=i[pt?u:++r];if(!1===e(o[a],a,o))break}return t};function ht(t){return null==t?void 0===t?h:d:Y&&Y in Object(t)?function(t){var e=k.call(t,Y),n=t[Y];try{t[Y]=void 0;var r=!0}catch(t){}var o=P.call(t);r&&(e?t[Y]=n:delete t[Y]);return o}(t):function(t){return P.call(t)}(t)}function mt(t){return Ut(t)&&ht(t)==c}function yt(t){return!(!Dt(t)||function(t){return!!B&&B in t}(t))&&(Mt(t)?z:m).test(function(t){if(null!=t){try{return N.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function Et(t){if(!Dt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=wt(t),n=[];for(var r in t)("constructor"!=r||!e&&k.call(t,r))&&n.push(r);return n}function bt(t,e,n,r,o){t!==e&&vt(e,(function(i,u){if(o||(o=new at),Dt(i))!function(t,e,n,r,o,i,u){var a=Rt(t,n),c=Rt(e,n),s=u.get(c);if(s)return void st(t,n,s);var f=i?i(a,c,n+"",t,e,u):void 0,l=void 0===f;if(l){var d=Lt(c),v=!d&&It(c),h=!d&&!v&&Nt(c);f=c,d||v||h?Lt(a)?f=a:Ut(g=a)&&xt(g)?f=function(t,e){var n=-1,r=t.length;e||(e=Array(r));for(;++n<r;)e[n]=t[n];return e}(a):v?(l=!1,f=function(t,e){if(e)return t.slice();var n=t.length,r=$?$(n):new t.constructor(n);return t.copy(r),r}(c,!0)):h?(l=!1,m=c,y=!0?(E=m.buffer,b=new E.constructor(E.byteLength),new K(b).set(new K(E)),b):m.buffer,f=new m.constructor(y,m.byteOffset,m.length)):f=[]:function(t){if(!Ut(t)||ht(t)!=p)return!1;var e=q(t);if(null===e)return!0;var n=k.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&N.call(n)==F}(c)||At(c)?(f=a,At(a)?f=function(t){return function(t,e,n,r){var o=!n;n||(n={});var i=-1,u=e.length;for(;++i<u;){var a=e[i],c=r?r(n[a],t[a],a,n,t):void 0;void 0===c&&(c=t[a]),o?dt(n,a,c):ft(n,a,c)}return n}(t,kt(t))}(a):Dt(a)&&!Mt(a)||(f=function(t){return"function"!=typeof t.constructor||wt(t)?{}:rt(q(t))}(c))):l=!1}var m,y,E,b;var g;l&&(u.set(c,f),o(f,c,r,i,u),u.delete(c));st(t,n,f)}(t,e,u,n,bt,r,o);else{var a=r?r(Rt(t,u),i,u+"",t,e,o):void 0;void 0===a&&(a=i),st(t,u,a)}}),kt)}function gt(t,e){return Ct(function(t,e,n){return e=Z(void 0===e?t.length-1:e,0),function(){for(var r=arguments,o=-1,i=Z(r.length-e,0),u=Array(i);++o<i;)u[o]=r[e+o];o=-1;for(var a=Array(e+1);++o<e;)a[o]=r[o];return a[e]=n(u),A(t,this,a)}}(t,e,Ft),t+"")}function Tt(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function _t(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return yt(n)?n:void 0}function Ot(t,e){var n=typeof t;return!!(e=null==e?a:e)&&("number"==n||"symbol"!=n&&y.test(t))&&t>-1&&t%1==0&&t<e}function wt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||D)}function Rt(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var Ct=function(t){var e=0,n=0;return function(){var r=tt(),o=u-(r-n);if(n=r,o>0){if(++e>=i)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(J?function(t,e){return J(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:Ft);function St(t,e){return t===e||t!=t&&e!=e}var At=mt(function(){return arguments}())?mt:function(t){return Ut(t)&&k.call(t,"callee")&&!X.call(t,"callee")},Lt=Array.isArray;function xt(t){return null!=t&&jt(t.length)&&!Mt(t)}var It=Q||function(){return!1};function Mt(t){if(!Dt(t))return!1;var e=ht(t);return e==f||e==l||e==s||e==v}function jt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function Dt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Ut(t){return null!=t&&"object"==typeof t}var Nt=S?function(t){return function(e){return t(e)}}(S):function(t){return Ut(t)&&jt(t.length)&&!!E[ht(t)]};function kt(t){return xt(t)?ct(t,!0):Et(t)}var Bt,Pt=(Bt=function(t,e,n){bt(t,e,n)},gt((function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=Bt.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!Dt(n))return!1;var r=typeof e;return!!("number"==r?xt(n)&&Ot(e,n.length):"string"==r&&e in n)&&St(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var u=e[n];u&&Bt(t,u,n,o)}return t})));function Ft(t){return t}n.exports=Pt}).call(this,n(2),n(3)(t))},function(t,e){var n=9007199254740991,r="[object Arguments]",o="[object Function]",i="[object GeneratorFunction]",u=/^(?:0|[1-9]\d*)$/;function a(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}var c,s,f=Object.prototype,l=f.hasOwnProperty,d=f.toString,p=f.propertyIsEnumerable,v=(c=Object.keys,s=Object,function(t){return c(s(t))}),h=Math.max,m=!p.call({valueOf:1},"valueOf");function y(t,e){var n=_(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&O(t)}(t)&&l.call(t,"callee")&&(!p.call(t,"callee")||d.call(t)==r)}(t)?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],o=n.length,i=!!o;for(var u in t)!e&&!l.call(t,u)||i&&("length"==u||b(u,o))||n.push(u);return n}function E(t,e,n){var r=t[e];l.call(t,e)&&T(r,n)&&(void 0!==n||e in t)||(t[e]=n)}function b(t,e){return!!(e=null==e?n:e)&&("number"==typeof t||u.test(t))&&t>-1&&t%1==0&&t<e}function g(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||f)}function T(t,e){return t===e||t!=t&&e!=e}var _=Array.isArray;function O(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}(t.length)&&!function(t){var e=w(t)?d.call(t):"";return e==o||e==i}(t)}function w(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var R,C=(R=function(t,e){if(m||g(e)||O(e))!function(t,e,n,r){n||(n={});for(var o=-1,i=e.length;++o<i;){var u=e[o],a=r?r(n[u],t[u],u,n,t):void 0;E(n,u,void 0===a?t[u]:a)}}(e,function(t){return O(t)?y(t):function(t){if(!g(t))return v(t);var e=[];for(var n in Object(t))l.call(t,n)&&"constructor"!=n&&e.push(n);return e}(t)}(e),t);else for(var n in e)l.call(e,n)&&E(t,n,e[n])},function(t,e){return e=h(void 0===e?t.length-1:e,0),function(){for(var n=arguments,r=-1,o=h(n.length-e,0),i=Array(o);++r<o;)i[r]=n[e+r];r=-1;for(var u=Array(e+1);++r<e;)u[r]=n[r];return u[e]=i,a(t,this,u)}}((function(t,e){var n=-1,r=e.length,o=r>1?e[r-1]:void 0,i=r>2?e[2]:void 0;for(o=R.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!w(n))return!1;var r=typeof e;return!!("number"==r?O(n)&&b(e,n.length):"string"==r&&e in n)&&T(n[e],t)}(e[0],e[1],i)&&(o=r<3?void 0:o,r=1),t=Object(t);++n<r;){var u=e[n];u&&R(t,u,n,o)}return t})));t.exports=C},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";n.r(e),n.d(e,"datadogRum",(function(){return xe}));var r=function(){return(r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function o(t,e,n,r){return new(n||(n=Promise))((function(o,i){function u(t){try{c(r.next(t))}catch(t){i(t)}}function a(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?o(t.value):new n((function(e){e(t.value)})).then(u,a)}c((r=r.apply(t,e||[])).next())}))}function i(t,e){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;u;)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 u.label++,{value:i[1],done:!1};case 5:u.label++,r=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){u.label=i[1];break}if(6===i[0]&&u.label<o[1]){u.label=o[1],o=i;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}function u(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),o=0;for(e=0;e<n;e++)for(var i=arguments[e],u=0,a=i.length;u<a;u++,o++)r[o]=i[u];return r}var a,c,s,f=6e4,l=60*f;function d(t,e,n){var r=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing,i=!1,u=!1;return function(){var n=this;i?u=!0:(r?t.apply(this):u=!0,i=!0,setTimeout((function(){o&&u&&t.apply(n),i=!1,u=!1}),e))}}function p(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,p)}function v(t){return 0!==t&&100*Math.random()<=t}function h(t){return+(1e6*t).toFixed(0)}function m(t){var e={};return Object.keys(t).forEach((function(n){var r;e[(r=n,r.replace(/[A-Z]/g,(function(t,e){return(0!==e?"_":"")+t.toLowerCase()})).replace(/-/g,"_"))]=function t(e){if(Array.isArray(e))return e.map((function(e){return t(e)}));if("object"==typeof e)return m(e);return e}(t[n])})),e}function y(){}function E(t,e,n){if(null==t)return JSON.stringify(t);var r=[!1,void 0];b(t)&&(r=[!0,t.toJSON],delete t.toJSON);var o,i,u=[!1,void 0];"object"==typeof t&&b(o=Object.getPrototypeOf(t))&&(u=[!0,o.toJSON],delete o.toJSON);try{i=JSON.stringify(t,void 0,n)}catch(t){i="<error: unable to serialize object>"}finally{r[0]&&(t.toJSON=r[1]),u[0]&&(o.toJSON=u[1])}return i}function b(t){return"object"==typeof t&&null!==t&&t.hasOwnProperty("toJSON")}function g(t,e){return-1!==t.indexOf(e)}function T(t){return _(t)&&t>=0&&t<=100}function _(t){return"number"==typeof t}function O(t){return Math.floor(w()+t)}function w(){return void 0===s&&(s=performance.timing.navigationStart),s}function R(t){if(t.origin)return t.origin;var e=t.host.replace(/(:80|:443)$/,"");return t.protocol+"//"+e}!function(t){t.BEFORE_UNLOAD="beforeunload",t.CLICK="click",t.KEY_DOWN="keydown",t.LOAD="load",t.POP_STATE="popstate",t.SCROLL="scroll",t.TOUCH_START="touchstart",t.VISIBILITY_CHANGE="visibilitychange"}(a||(a={})),function(t){t.DOCUMENT="document",t.XHR="xhr",t.BEACON="beacon",t.FETCH="fetch",t.CSS="css",t.JS="js",t.IMAGE="image",t.FONT="font",t.MEDIA="media",t.OTHER="other"}(c||(c={}));var C={isCollectingError:!0,maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function S(t,e,n){var r="us"===e.datacenter?"com":"eu",o="production"===e.env?"datadoghq."+r:"datad0g."+r,i="version:"+e.version;return"https://"+t+"-http-intake.logs."+o+"/v1/input/"+e.clientToken+"?ddsource="+(n||"browser")+"&ddtags="+i}var A=n(1),L=n.n(A),x=n(0),I=n.n(x),M="?",j=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function D(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var U=function(){var t,e,n,r,o,i,u=[];function a(t,e,n){var r;for(var o in u)if(D(u,o))try{u[o](t,e,n)}catch(t){r=t}if(r)throw r}function c(t,r,o,i,u){if(e)N.augmentStackTraceWithInitialElement(e,r,o,""+t),f();else if(u)a(N(u),!0,u);else{var c,s={url:r,column:i,line:o},l=t;if("[object String]"==={}.toString.call(t)){var d=l.match(j);d&&(c=d[1],l=d[2])}a({name:c,message:l,stack:[s]},!0)}return!!n&&n.apply(this,arguments)}function s(t){var e=t.reason||"Empty reason";a(N(e),!0,e)}function f(){var n=e,r=t;e=void 0,t=void 0,a(n,!1,r)}function l(n){if(e){if(t===n)return;f()}var r=N(n);throw e=r,t=n,setTimeout((function(){t===n&&f()}),r.incomplete?2e3:0),n}return l.subscribe=function(t){!function(){if(r)return;n=window.onerror,window.onerror=H(c),r=!0}(),function(){if(i)return;o=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=H(s),i=!0}(),u.push(t)},l.unsubscribe=function(t){for(var e=u.length-1;e>=0;e-=1)u[e]===t&&u.splice(e,1);0===u.length&&(r&&(window.onerror=n,r=!1),i&&(window.onunhandledrejection=o,i=!1))},l.traceKitWindowOnError=c,l}(),N=function(){var t=!1;function e(t){if(t.stack){for(var e,n,r,o,i=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,a=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,s=/\((\S*)(?::(\d+))(?::(\d+))\)/,f=t.stack.split("\n"),l=[],d=0,p=f.length;d<p;d+=1){if(i.exec(f[d])){var v=(r=i.exec(f[d]))[2]&&0===r[2].indexOf("native");e=r[2]&&0===r[2].indexOf("eval"),n=s.exec(r[2]),e&&n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3]),o={args:v?[r[2]]:[],column:r[4]?+r[4]:void 0,func:r[1]||M,line:r[3]?+r[3]:void 0,url:v?void 0:r[2]}}else if(a.exec(f[d]))o={args:[],column:(r=a.exec(f[d]))[4]?+r[4]:void 0,func:r[1]||M,line:+r[3],url:r[2]};else{if(!u.exec(f[d]))continue;e=(r=u.exec(f[d]))[3]&&r[3].indexOf(" > eval")>-1,n=c.exec(r[3]),e&&n?(r[3]=n[1],r[4]=n[2],r[5]=void 0):0!==d||r[5]||void 0===t.columnNumber||(l[0].column=t.columnNumber+1),o={args:r[2]?r[2].split(","):[],column:r[5]?+r[5]:void 0,func:r[1]||M,line:r[4]?+r[4]:void 0,url:r[3]}}!o.func&&o.line&&(o.func=M),l.push(o)}if(l.length)return{stack:l,message:t.message,name:t.name}}}function n(t,e,n,r){var o={url:e,line:n?+n:void 0};if(o.url&&o.line){t.incomplete=!1;var i=t.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),t.partial=!0,!0}return t.incomplete=!0,!1}function r(t,e){for(var o,i,u=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,a=[],c={},s=!1,f=r.caller;f&&!s;f=f.caller)f!==N&&f!==U&&(i={args:[],column:void 0,func:M,line:void 0,url:void 0},o=u.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),c[""+f]?s=!0:c[""+f]=!0,a.push(i));e&&a.splice(0,e);var l={stack:a,message:t.message,name:t.name};return n(l,t.sourceURL||t.fileName,t.line||t.lineNumber,t.message||t.description),l}function o(n,o){var i,u=void 0===o?0:+o;try{if(i=function(t){var e=t.stacktrace;if(e){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=e.split("\n"),u=[],a=0;a<i.length;a+=2){var c=void 0;r.exec(i[a])?c={args:[],column:void 0,func:(n=r.exec(i[a]))[3],line:+n[1],url:n[2]}:o.exec(i[a])&&(c={args:(n=o.exec(i[a]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),c&&(!c.func&&c.line&&(c.func=M),c.context=[i[a+1]],u.push(c))}if(u.length)return{stack:u,message:t.message,name:t.name}}}(n))return i}catch(e){if(t)throw e}try{if(i=e(n))return i}catch(e){if(t)throw e}try{if(i=function(t){var e=t.message.split("\n");if(!(e.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,u=[],a=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var s in a)D(a,s)&&!a[s].src&&c.push(a[s]);for(var f=2;f<e.length;f+=2){var l=void 0;if(r.exec(e[f]))l={args:[],column:void 0,func:(n=r.exec(e[f]))[3],line:+n[1],url:n[2]};else if(o.exec(e[f]))l={args:[],column:void 0,func:(n=o.exec(e[f]))[4],line:+n[1],url:n[3]};else if(i.exec(e[f])){n=i.exec(e[f]),l={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+n[1]}}l&&(l.func||(l.func=M),l.context=[e[f+1]],u.push(l))}if(u.length)return{stack:u,message:e[0],name:t.name}}}(n))return i}catch(e){if(t)throw e}try{if(i=r(n,u+1))return i}catch(e){if(t)throw e}return{message:n.message,name:n.name,stack:[]}}return o.augmentStackTraceWithInitialElement=n,o.computeStackTraceFromStackProp=e,o.ofCaller=function(t){var e=1+(void 0===t?0:+t);try{throw new Error}catch(t){return N(t,e+1)}},o}();var k=function(){function t(t,e,n){void 0===n&&(n=!1),this.endpointUrl=t,this.bytesLimit=e,this.withBatchTime=n}return t.prototype.send=function(t,e){var n=this.withBatchTime?function(t){return t+(-1===t.indexOf("?")?"?":"&")+"batch_time="+(new Date).getTime()}(this.endpointUrl):this.endpointUrl;if(navigator.sendBeacon&&e<this.bytesLimit&&navigator.sendBeacon(n,t))return;var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(t)},t}();var B,P=function(){function t(t,e,n,r,o,i){this.request=t,this.maxSize=e,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=o,this.contextProvider=i,this.beforeFlushOnUnloadHandlers=[],this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),this.flushPeriodically()}return t.prototype.add=function(t){this.addOrUpdate(t)},t.prototype.upsert=function(t,e){this.addOrUpdate(t,e)},t.prototype.beforeFlushOnUnload=function(t){this.beforeFlushOnUnloadHandlers.push(t)},t.prototype.flush=function(){if(0!==this.bufferMessageCount){var t=u(this.pushOnlyBuffer,(e=this.upsertBuffer,n=[],Object.keys(e).forEach((function(t){n.push(e[t])})),n));this.request.send(t.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var e,n},t.prototype.addOrUpdate=function(t,e){var n=this.process(t),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(e)&&this.remove(e),this.willReachedBytesLimitWith(o)&&this.flush(),this.push(r,o,e),this.isFull()&&this.flush())},t.prototype.process=function(t){var e=E(I()({},this.contextProvider(),t));return{processedMessage:e,messageBytesSize:this.sizeInBytes(e)}},t.prototype.push=function(t,e,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=t:this.pushOnlyBuffer.push(t),this.bufferBytesSize+=e,this.bufferMessageCount+=1},t.prototype.remove=function(t){var e=this.upsertBuffer[t];delete this.upsertBuffer[t];var n=this.sizeInBytes(e);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},t.prototype.hasMessageFor=function(t){return void 0!==t&&void 0!==this.upsertBuffer[t]},t.prototype.willReachedBytesLimitWith=function(t){return this.bufferBytesSize+t+1>=this.bytesLimit},t.prototype.isFull=function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},t.prototype.sizeInBytes=function(t){return~-encodeURI(t).split(/%..|./).length},t.prototype.flushPeriodically=function(){var t=this;setTimeout((function(){t.flush(),t.flushPeriodically()}),this.flushTimeout)},t.prototype.flushOnVisibilityHidden=function(){var t=this;navigator.sendBeacon&&(window.addEventListener(a.BEFORE_UNLOAD,H((function(){t.beforeFlushOnUnloadHandlers.forEach((function(t){return t()}))}))),document.addEventListener(a.VISIBILITY_CHANGE,H((function(){"hidden"===document.visibilityState&&t.flush()}))),window.addEventListener(a.BEFORE_UNLOAD,H((function(){return t.flush()}))))},t}();!function(t){t.info="info",t.error="error"}(B||(B={}));var F,z={maxMessagesPerPage:0,sentMessageCount:0};function H(t){return function(){try{return t.apply(this,arguments)}catch(t){G(t);try{K(t)}catch(t){G(t)}}}}function W(t){!function(t){z.debugMode&&console.log("[MONITORING MESSAGE]",t)}(t),$({message:t,status:B.info})}function K(t){$(r(r({},function(t){if(t instanceof Error){var e=N(t);return{error:{kind:e.name,stack:dt(e)},message:e.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+E(t)}}(t)),{status:B.error}))}function $(t){z.batch&&z.sentMessageCount<z.maxMessagesPerPage&&(z.sentMessageCount+=1,z.batch.add(t))}function q(t){z.debugMode=t}function G(t){z.debugMode&&console.warn("[INTERNAL ERROR]",t)}var X,V,Y=function(){function t(){this.observers=[]}return t.prototype.subscribe=function(t){this.observers.push(t)},t.prototype.notify=function(t){this.observers.forEach((function(e){return e(t)}))},t}();function J(t){return tt(t,R(window.location)).href}function Q(t,e){return Z(t)===Z(e)}function Z(t){return R(tt(t))}function tt(t,e){if(function(){if(void 0!==X)return X;try{var t=new URL("http://test/path");return X="http://test/path"===t.href}catch(t){X=!1}return X}())return void 0!==e?new URL(t,e):new URL(t);if(void 0===e&&!/:/.test(t))throw new Error("Invalid URL: '"+t+"'");var n=document,r=n.createElement("a");if(void 0!==e){var o=(n=document.implementation.createHTMLDocument("")).createElement("base");o.href=e,n.head.appendChild(o),n.body.appendChild(r)}return r.href=t,r}!function(t){t.FETCH="fetch",t.XHR="xhr"}(V||(V={}));var et,nt,rt,ot,it,ut=1;function at(){var t=ut;return ut+=1,t}function ct(){return et||(function(t){var e=t[0],n=t[1],r=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=H((function(t,e){return this._datadog_xhr={method:t,url:e},r.apply(this,arguments)}));var o=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(t){var r=this,i=performance.now(),u=at();e.notify({requestId:u});var a=!1,c=function(){a||(a=!0,n.notify({requestId:u,startTime:i,duration:performance.now()-i,method:r._datadog_xhr.method,response:r.response,status:r.status,traceId:st(),type:V.XHR,url:J(r._datadog_xhr.url)}))},s=this.onreadystatechange;return this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&H(c)(),s&&s.apply(this,arguments)},this.addEventListener("loadend",H(c)),o.apply(this,arguments)}}(et=[new Y,new Y]),function(t){var e=t[0],n=t[1];if(!window.fetch)return;var r=window.fetch;window.fetch=H((function(t,u){var a=this,c=u&&u.method||"object"==typeof t&&t.method||"GET",s=performance.now(),f=at();e.notify({requestId:f});var l=function(e){return o(a,void 0,void 0,(function(){var r,o,u,a,l;return i(this,(function(i){switch(i.label){case 0:return r=performance.now()-s,o=J("object"==typeof t&&t.url||t),"stack"in e||e instanceof Error?(u=N(e),n.notify({duration:r,method:c,requestId:f,startTime:s,url:o,response:dt(u),status:0,traceId:st(),type:V.FETCH}),[3,6]):[3,1];case 1:if(!("status"in e))return[3,6];a=void 0,i.label=2;case 2:return i.trys.push([2,4,,5]),[4,e.clone().text()];case 3:return a=i.sent(),[3,5];case 4:return l=i.sent(),a="Unable to retrieve response: "+l,[3,5];case 5:n.notify({duration:r,method:c,requestId:f,startTime:s,url:o,response:a,responseType:e.type,status:e.status,traceId:st(),type:V.FETCH}),i.label=6;case 6:return[2]}}))}))},d=r.call(this,t,u);return d.then(H(l),H(l)),d}))}(et)),et}function st(){return"ddtrace"in window&&window.ddtrace.tracer.scope().active()?window.ddtrace.tracer.scope().active().context().toTraceId():void 0}function ft(t){if(!rt){var e=new Y;if(t.isCollectingError)!function(t,e,n){n.subscribe((function(n){(function(t){return 0===t.status&&"opaque"!==t.responseType}(n)||function(t){return t.status>=500}(n))&&e.notify({context:{error:{origin:nt.NETWORK,stack:pt(n.response,t)||"Failed to load"},http:{method:n.method,status_code:n.status,url:n.url}},message:vt(n.type)+" error "+n.method+" "+n.url,startTime:n.startTime})}))}(t,e,ct()[1]),function(t){ot=console.error,console.error=H((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];ot.apply(console,u([e],n)),t.notify({context:{error:{origin:nt.CONSOLE}},message:u(["console error:",e],n).map(lt).join(" "),startTime:performance.now()})}))}(e),function(t){it=function(e,n,r){t.notify(function(t,e){var n,r;void 0!==t.message||e instanceof Error?(n=t.message||"Empty message",r=dt(t)):(n="Uncaught "+E(e),r="No stack, consider using an instance of Error");return{message:n,context:{error:{stack:r,kind:t.name,origin:nt.SOURCE}},startTime:performance.now()}}(e,r))},U.subscribe(it)}(e);rt=function(t,e){var n=0,r=new Y;return e.subscribe((function(e){n<t.maxErrorsByMinute?(n+=1,r.notify(e)):n===t.maxErrorsByMinute&&(n+=1,r.notify({context:{error:{origin:nt.AGENT}},message:"Reached max number of errors by minute: "+t.maxErrorsByMinute,startTime:performance.now()}))})),setInterval((function(){return n=0}),f),r}(t,e)}return rt}function lt(t){return"string"==typeof t?t:t instanceof Error?dt(N(t)):E(t,0,2)}function dt(t){var e=(t.name||"Error")+": "+t.message;return t.stack.forEach((function(t){var n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?"("+t.args.join(", ")+")":"",o=t.line?":"+t.line:"",i=t.line&&t.column?":"+t.column:"";e+="\n at "+n+r+" @ "+t.url+o+i})),e}function pt(t,e){return t&&t.length>e.requestErrorResponseLengthLimit?t.substring(0,e.requestErrorResponseLengthLimit)+"...":t}function vt(t){return V.XHR===t?"XHR":"Fetch"}!function(t){t.AGENT="agent",t.CONSOLE="console",t.NETWORK="network",t.SOURCE="source",t.LOGGER="logger"}(nt||(nt={}));var ht=1e3;function mt(t,e,n){var r=new Date;r.setTime(r.getTime()+n);var o="expires="+r.toUTCString();document.cookie=t+"="+e+";"+o+";path=/"}function yt(t){var e=document.cookie.match("(^|;)\\s*"+t+"\\s*=\\s*([^;]+)");return e?e.pop():void 0}function Et(t){console.warn("'"+t+"' not yet available, please call '.init()' first.")}function bt(t,e){var n=function(t,e){var n={clientToken:t.clientToken,datacenter:t.datacenter||e.datacenter,env:e.env,version:e.version},o=Array.isArray(t.enableExperimentalFeatures)?t.enableExperimentalFeatures:[],i=r({isEnabled:function(t){return g(o,t)},logsEndpoint:S("browser",n),rumEndpoint:S("rum",n),traceEndpoint:S("public-trace",n)},C);return t.internalMonitoringApiKey&&(i.internalMonitoringEndpoint=S("browser",n,"browser-agent-internal-monitoring")),"isCollectingError"in t&&(i.isCollectingError=!!t.isCollectingError),"sampleRate"in t&&(i.sampleRate=t.sampleRate),"resourceSampleRate"in t&&(i.resourceSampleRate=t.resourceSampleRate),"e2e-test"===n.env&&(void 0!==t.internalMonitoringEndpoint&&(i.internalMonitoringEndpoint=t.internalMonitoringEndpoint),void 0!==t.logsEndpoint&&(i.logsEndpoint=t.logsEndpoint),void 0!==t.rumEndpoint&&(i.rumEndpoint=t.rumEndpoint)),i}(t,e),o=function(t){if(t.internalMonitoringEndpoint){var e=new P(new k(t.internalMonitoringEndpoint,t.batchBytesLimit),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout,(function(){return I()({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==F?F():{})}));L()(z,{batch:e,maxMessagesPerPage:t.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(t){F=t}}}(n);return{configuration:n,errorObservable:ft(n),internalMonitoring:o}}function gt(){return!!function(){if(void 0===document.cookie||null===document.cookie)return!1;try{return mt("dd_rum_test","test",1e3),"test"===yt("dd_rum_test")}catch(t){return console.error(t),!1}}()||(console.warn("Cookies are not authorized, we will not send any data."),!1)}function Tt(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}var _t="_dd",Ot="_dd_r",wt="_dd_l",Rt="rum",Ct="logs";var St="_dd_s",At=15*f,Lt=4*l,xt=f;function It(t,e,n){void 0===n&&(n=!1);var r,o,i,u,c,s=(r=St,u=!1,c=function(){u=!0,window.clearTimeout(o),o=window.setTimeout((function(){u=!1}),ht)},{get:function(){return u?i:(i=yt(r),c(),i)},set:function(t,e){mt(r,t,e),i=t,c()}});!function(t){var e=t.get(),n=yt(_t),r=yt(Ot),o=yt(wt);if(!e){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i[Ct]=o),r&&/^[012]$/.test(r)&&(i[Rt]=r),Ut(i,t)}}(s);var f=new Y,l=Dt(s,n).id,v=d((function(){var r=Dt(s,n),o=e(r[t]),i=o.type,u=o.isTracked;r[t]=i,u&&!r.id&&(r.id=p(),n&&(r.created=String(Date.now()))),Ut(r,s,n),u&&l!==r.id&&(l=r.id,f.notify())}),ht);return v(),function(t){var e=H(t),n={capture:!0,passive:!0};[a.CLICK,a.TOUCH_START,a.KEY_DOWN,a.SCROLL].forEach((function(t){document.addEventListener(t,e,n),kt.push((function(){return document.removeEventListener(t,e,n)}))}))}(v),n&&function(t){var e=H((function(){"visible"===document.visibilityState&&t()})),n=window.setInterval(e,xt);document.addEventListener(a.VISIBILITY_CHANGE,e),kt.push((function(){clearInterval(n),document.removeEventListener(a.VISIBILITY_CHANGE,e)}))}((function(){Ut(Dt(s,n),s,n)})),{getId:function(){return Dt(s,n).id},getType:function(){return Dt(s,n)[t]},renewObservable:f}}var Mt=/^([a-z]+)=([a-z0-9-]+)$/,jt="&";function Dt(t,e){var n=function(t){var e=t.get(),n={};(function(t){return void 0!==t&&(-1!==t.indexOf(jt)||Mt.test(t))})(e)&&e.split(jt).forEach((function(t){var e=Mt.exec(t);if(null!==e){var r=e[1],o=e[2];n[r]=o}}));return n}(t);return!e||function(t){return(void 0===t.created||Date.now()-Number(t.created)<Lt)&&(void 0===t.expire||Date.now()<Number(t.expire))}(n)?n:(Nt(t),{})}function Ut(t,e,n){if(void 0===n&&(n=!1),r=t,0!==Object.keys(r).length){var r;n&&(t.expire=String(Date.now()+At));var o=function(t){return Object.keys(t).map((function(e){return[e,t[e]]}))}(t).map((function(t){return t[0]+"="+t[1]})).join(jt);e.set(o,At)}else Nt(e)}function Nt(t){t.set("",0)}var kt=[];(function(){function t(t){var e=this,n=t[0],r=t[1];this.requests=[],this.whenAllCompleteFn=y;var o=0;n.subscribe((function(){o+=1})),r.subscribe((function(t){e.requests.push(t),0===(o-=1)&&setTimeout((function(){e.whenAllCompleteFn(e.requests)}))}))}t.prototype.whenAllComplete=function(t){this.whenAllCompleteFn=t},t.prototype.getStub=function(){var t=this;return function(){var e,n,u=new Promise((function(t,r){e=t,n=r}));return u.resolveWith=function(n){return o(t,void 0,void 0,(function(){var t=this;return i(this,(function(u){return[2,e(r(r({},n),{clone:function(){return{text:function(){return o(t,void 0,void 0,(function(){return i(this,(function(t){if(n.responseTextError)throw n.responseTextError;return[2,n.responseText]}))}))}}}}))]}))}))},u.rejectWith=function(e){return o(t,void 0,void 0,(function(){return i(this,(function(t){return[2,n(e)]}))}))},u}}})(),function(){function t(){}t.prototype.fakeEntry=function(t,e){var n=function(){return[t]};this.instance.callback({getEntries:n,getEntriesByName:n,getEntriesByType:function(t){return t===e?n():[]}})},t.prototype.getStub=function(){var t,e=this;return(t=function(){function t(t){this.callback=t,e.instance=this}return t.prototype.observe=function(t){},t}()).supportedEntryTypes=["navigation"],t}}();var Bt,Pt={datacenter:"us",env:"production",version:"1.9.2"};!function(t){t[t.ERROR_COLLECTED=0]="ERROR_COLLECTED",t[t.PERFORMANCE_ENTRY_COLLECTED=1]="PERFORMANCE_ENTRY_COLLECTED",t[t.USER_ACTION_COLLECTED=2]="USER_ACTION_COLLECTED",t[t.REQUEST_STARTED=3]="REQUEST_STARTED",t[t.REQUEST_COMPLETED=4]="REQUEST_COMPLETED",t[t.SESSION_RENEWED=5]="SESSION_RENEWED",t[t.RESOURCE_ADDED_TO_BATCH=6]="RESOURCE_ADDED_TO_BATCH",t[t.DOM_MUTATED=7]="DOM_MUTATED"}(Bt||(Bt={}));var Ft=function(){function t(){this.callbacks={}}return t.prototype.notify=function(t,e){var n=this.callbacks[t];n&&n.forEach((function(t){return t(e)}))},t.prototype.subscribe=function(t,e){var n=this;return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),{unsubscribe:function(){n.callbacks[t]=n.callbacks[t].filter((function(t){return e!==t}))}}},t}();var zt="initial_document",Ht=[[c.DOCUMENT,function(t){return zt===t}],[c.XHR,function(t){return"xmlhttprequest"===t}],[c.FETCH,function(t){return"fetch"===t}],[c.BEACON,function(t){return"beacon"===t}],[c.CSS,function(t,e){return null!==e.match(/\.css$/i)}],[c.JS,function(t,e){return null!==e.match(/\.js$/i)}],[c.IMAGE,function(t,e){return g(["image","img","icon"],t)||null!==e.match(/\.(gif|jpg|jpeg|tiff|png|svg)$/i)}],[c.FONT,function(t,e){return null!==e.match(/\.(woff|eot|woff2|ttf)$/i)}],[c.MEDIA,function(t,e){return g(["audio","video"],t)||null!==e.match(/\.(mp3|mp4)$/i)}]];function Wt(t){var e=t.name;if(!function(t){try{return!!tt(t)}catch(t){return!1}}(e))return W('Failed to construct URL for "'+t.name+'"'),c.OTHER;for(var n=function(t){var e=tt(t).pathname;return"/"===e[0]?e:"/"+e}(e),r=0,o=Ht;r<o.length;r++){var i=o[r],u=i[0];if((0,i[1])(t.initiatorType,n))return u}return c.OTHER}function Kt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=1;n<t.length;n+=1)if(t[n-1]>t[n])return!1;return!0}function $t(t){var e=t.duration,n=t.startTime,r=t.responseEnd;return h(0===e&&n<r?r-n:e)}function qt(t){var e=t.startTime,n=t.fetchStart,r=t.domainLookupStart,o=t.domainLookupEnd,i=t.connectStart,u=t.secureConnectionStart,a=t.connectEnd,c=t.requestStart,s=t.responseStart,f=t.responseEnd,l=t.redirectStart,d=t.redirectEnd;if(Kt(e,n,r,o,i,a,c,s,f)){var p=n!==e;if(!p||(l<e&&(l=e),d<e&&(d=n),Kt(e,l,d,n))){var v={download:Gt(e,s,f),firstByte:Gt(e,c,s)};return a!==n&&(v.connect=Gt(e,i,a),Kt(i,u,a)&&(v.ssl=Gt(e,u,a))),o!==n&&(v.dns=Gt(e,r,o)),p&&(v.redirect=Gt(e,l,d)),v}}}function Gt(t,e,n){return{duration:h(n-e),start:h(e-t)}}function Xt(t){if(t.startTime<t.responseStart)return t.decodedBodySize}function Vt(t,e){return t&&!function(t,e){return Q(t,e.logsEndpoint)||Q(t,e.rumEndpoint)||Q(t,e.traceEndpoint)||e.internalMonitoringEndpoint&&Q(t,e.internalMonitoringEndpoint)}(t,e)}function Yt(){return void 0!==window.performance&&"getEntries"in performance}function Jt(){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("navigation")}function Qt(t,e){(function(t){var e;if(Jt()&&performance.getEntriesByType("navigation").length>0){var n=performance.getEntriesByType("navigation")[0];e=r({},n.toJSON())}else e=r(r({},Zt()),{name:window.location.href,decodedBodySize:0,startTime:0});e.entryType="resource",e.initiatorType=zt,e.duration=e.responseEnd,t(e)}((function(n){te(e,t,[n])})),Yt()&&te(e,t,performance.getEntries()),window.PerformanceObserver)&&(new PerformanceObserver(H((function(n){return te(e,t,n.getEntries())}))).observe({entryTypes:["resource","navigation","paint","longtask"]}),Yt()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()})));Jt()||function(t){function e(){var e=r(r({},Zt()),{entryType:"navigation"});t(e)}if("complete"===document.readyState)e();else{var n=H((function(){window.removeEventListener(a.LOAD,n),setTimeout(H(e))}));window.addEventListener(a.LOAD,n)}}((function(n){te(e,t,[n])}))}function Zt(){var t={},e=performance.timing;for(var n in e)_(e[n])&&(t[n]=0===e[n]?0:e[n]-w());return t}function te(t,e,n){function r(t){e.notify(Bt.PERFORMANCE_ENTRY_COLLECTED,t)}t.isTrackedWithResource()&&n.filter((function(t){return"resource"===t.entryType})).forEach(r),n.filter((function(t){return"navigation"===t.entryType})).filter((function(t){return t.loadEventEnd>0})).forEach(r),n.filter((function(t){return"paint"===t.entryType})).forEach(r),n.filter((function(t){return"longtask"===t.entryType})).forEach(r)}function ee(t){if(performance&&"getEntriesByName"in performance){var e,n=performance.getEntriesByName(t.url,"resource").filter((function(e){return n=e,r=t.startTime,o=ne(t),n.startTime>=r&&ne(n)<=o;var n,r,o}));return 1===n.length?n[0]:2===n.length&&ne((e=n)[0])<=e[1].startTime?n[1]:void 0}}function ne(t){return t.startTime+t.duration}var re=[function(t){return t.textContent},function(t){if("INPUT"===t.tagName){var e=t,n=e.getAttribute("type");if("button"===n||"submit"===n)return e.value}return null},function(t){return t.getAttribute("aria-label")},function(t){return t.getAttribute("alt")},function(t){return t.getAttribute("title")},function(t){return t.getAttribute("placeholder")}];var oe,ie=100,ue=100,ae=1e4;function ce(t){function e(e){if(e.target instanceof Element){var n=function t(e){for(var n=0,r=re;n<r.length;n++){var o=(0,r[n])(e);if("string"==typeof o){var i=o.trim();if(i)return(u=i).length>200?u.slice(0,200)+" [...]":u}}var u;return e.parentElement?t(e.parentElement):""}(e.target),r=le(t),o=r.observable,i=r.stop;fe(o,(function(e){i(),e&&t.notify(Bt.USER_ACTION_COLLECTED,{duration:e.duration,id:e.id,name:n,startTime:e.startTime,type:me.CLICK})}))}}return addEventListener(a.CLICK,e,{capture:!0}),{stop:function(){removeEventListener(a.CLICK,e,{capture:!0})}}}function se(t){if(oe&&t>=oe.startTime)return{id:oe.id}}function fe(t,e){if(oe)e(void 0);else{var n,r=p(),o=performance.now(),i=!1,u=setTimeout(H((function(){return s(void 0)})),ie),a=setTimeout(H((function(){return s(c(performance.now()))})),ae);oe={id:r,startTime:o},t.subscribe((function(t){var e=t.isBusy;clearTimeout(u),clearTimeout(n);var r=performance.now();e||(n=setTimeout(H((function(){return s(c(r))})),ue))}))}function c(t){return{id:r,startTime:o,duration:t-o}}function s(t){i||(i=!0,clearTimeout(u),clearTimeout(n),clearTimeout(a),oe=void 0,e(t))}}function le(t){var e,n=new Y,r=[],o=0;function i(){n.notify({isBusy:o>0})}return r.push(t.subscribe(Bt.DOM_MUTATED,(function(){return i()}))),r.push(t.subscribe(Bt.PERFORMANCE_ENTRY_COLLECTED,(function(t){"resource"===t.entryType&&i()}))),r.push(t.subscribe(Bt.REQUEST_STARTED,(function(t){void 0===e&&(e=t.requestId),o+=1,i()}))),r.push(t.subscribe(Bt.REQUEST_COMPLETED,(function(t){void 0===e||t.requestId<e||(o-=1,i())}))),{observable:n,stop:function(){r.forEach((function(t){return t.unsubscribe()}))}}}var de,pe,ve,he,me,ye,Ee=3e3;function be(t,e,n,o,i){var u=d(H((function(){return Te(o)})),Ee,{leading:!1});ge(t,n,o),function(t,e,n){var r=history.pushState;history.pushState=H((function(){r.apply(this,arguments),Oe(t,e,n)}));var o=history.replaceState;history.replaceState=H((function(){o.apply(this,arguments),Oe(t,e,n)})),window.addEventListener(a.POP_STATE,H((function(){Oe(t,e,n)})))}(t,n,o),function(t,e){t.subscribe(Bt.PERFORMANCE_ENTRY_COLLECTED,(function(t){if("navigation"===t.entryType){var n=t;he=r(r({},he),{domComplete:h(n.domComplete),domContentLoaded:h(n.domContentLoadedEventEnd),domInteractive:h(n.domInteractive),loadEventEnd:h(n.loadEventEnd)}),e()}else if("paint"===t.entryType&&"first-contentful-paint"===t.name){var o=t;he=r(r({},he),{firstContentfulPaint:h(o.startTime)}),e()}})),t.subscribe(Bt.ERROR_COLLECTED,(function(){he.errorCount+=1,e()})),t.subscribe(Bt.USER_ACTION_COLLECTED,(function(){he.userActionCount+=1,e()})),t.subscribe(Bt.PERFORMANCE_ENTRY_COLLECTED,(function(t){"longtask"===t.entryType&&(he.longTaskCount+=1,e())})),t.subscribe(Bt.RESOURCE_ADDED_TO_BATCH,(function(){he.resourceCount+=1,e()}))}(e,u),function(t,e,n,r){e.subscribe(Bt.SESSION_RENEWED,(function(){Te(r),ge(t,n,r)}))}(t,e,n,o),i((function(){return Te(o)}))}function ge(t,e,n){pe=de?performance.now():0,de={id:p(),location:r({},t),sessionId:e.getId()},ve=1,he={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},_e(n)}function Te(t){ve+=1,_e(t)}function _e(t){t({date:O(pe),duration:h(performance.now()-pe),evt:{category:ye.VIEW},rum:{documentVersion:ve},view:{measures:he}},de.id)}function Oe(t,e,n){var r,o;r=de.location,o=t,r.pathname!==o.pathname&&(Te(n),ge(t,e,n))}function we(t,e,n,o,i){var u={};i.setExternalContextProvider((function(){return I()({application_id:t,session_id:de.sessionId,view:{id:de.id}},u)}));var a=function(t,e,n,r){var o=new P(new k(t.rumEndpoint,t.batchBytesLimit,!0),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout,(function(){return I()(m(n()),r())}));return{addRumEvent:function(t){e.isTracked()&&o.add(m(t))},addUserEvent:function(t){e.isTracked()&&o.add(t)},beforeFlushOnUnload:function(t){return o.beforeFlushOnUnload(t)},upsertRumEvent:function(t,n){e.isTracked()&&o.upsert(m(t),n)}}}(n,o,(function(){return{applicationId:t,date:(new Date).getTime(),sessionId:de.sessionId,view:{id:de.id,referrer:document.referrer,url:de.location.href}}}),(function(){return u}));return be(window.location,e,o,a.upsertRumEvent,a.beforeFlushOnUnload),function(t,e){t.subscribe(Bt.ERROR_COLLECTED,(function(t){var n=t.message,o=t.startTime,i=t.context;e(r({message:n,date:O(o),evt:{category:ye.ERROR},userAction:se(o)},i))}))}(e,a.addRumEvent),function(t,e,n,r){e.subscribe(Bt.REQUEST_COMPLETED,(function(o){if(n.isTrackedWithResource()&&Vt(o.url,t)){var i=ee(o),u=o.type===V.XHR?c.XHR:c.FETCH,a=i?i.startTime:o.startTime;r({date:O(a),duration:i?$t(i):h(o.duration),evt:{category:ye.RESOURCE},http:{method:o.method,performance:i?qt(i):void 0,statusCode:o.status,url:o.url},network:{bytesWritten:i?Xt(i):void 0},resource:{kind:u},traceId:o.traceId,userAction:se(a)}),e.notify(Bt.RESOURCE_ADDED_TO_BATCH)}}))}(n,e,o,a.addRumEvent),function(t,e,n){e.subscribe(Bt.PERFORMANCE_ENTRY_COLLECTED,(function(r){switch(r.entryType){case"resource":!function(t,e,n,r){if(!Vt(e.name,t))return;var o=Wt(e);if(g([c.XHR,c.FETCH],o))return;n({date:O(e.startTime),duration:$t(e),evt:{category:ye.RESOURCE},http:{performance:qt(e),url:e.name},network:{bytesWritten:Xt(e)},resource:{kind:o},userAction:se(e.startTime)}),r.notify(Bt.RESOURCE_ADDED_TO_BATCH)}(t,r,n,e);break;case"longtask":!function(t,e){e({date:O(t.startTime),duration:h(t.duration),evt:{category:ye.LONG_TASK},userAction:se(t.startTime)})}(r,n)}}))}(n,e,a.addRumEvent),function(t,e){t.subscribe(Bt.USER_ACTION_COLLECTED,(function(t){t.type===me.CUSTOM&&e(r(r({},t.context),{evt:{category:ye.USER_ACTION,name:t.name},userAction:{type:t.type}}))}))}(e,a.addUserEvent),function(t,e){t.subscribe(Bt.USER_ACTION_COLLECTED,(function(t){t.type!==me.CUSTOM&&e({date:O(t.startTime),duration:h(t.duration),evt:{category:ye.USER_ACTION,name:t.name},userAction:{id:t.id,type:t.type}})}))}(e,a.addRumEvent),{addRumGlobalContext:H((function(t,e){u[t]=e})),addUserAction:H((function(t,n){e.notify(Bt.USER_ACTION_COLLECTED,{context:n,name:t,type:me.CUSTOM})})),getInternalContext:H((function(){return{application_id:t,session_id:de.sessionId,view:{id:de.id}}})),setRumGlobalContext:H((function(t){u=t}))}}!function(t){t.CLICK="click",t.LOAD_VIEW="load_view",t.CUSTOM="custom"}(me||(me={})),function(t){t.USER_ACTION="user_action",t.ERROR="error",t.LONG_TASK="long_task",t.VIEW="view",t.RESOURCE="resource"}(ye||(ye={}));var Re,Ce="rum";function Se(t,e){var n=It(Ce,(function(e){return function(t,e){var n;r=e,n=r===Re.NOT_TRACKED||r===Re.TRACKED_WITH_RESOURCES||r===Re.TRACKED_WITHOUT_RESOURCES?e:v(t.sampleRate)?v(t.resourceSampleRate)?Re.TRACKED_WITH_RESOURCES:Re.TRACKED_WITHOUT_RESOURCES:Re.NOT_TRACKED;var r;return{isTracked:Ae(n),type:n}}(t,e)}),t.isEnabled("new-session"));return n.renewObservable.subscribe((function(){e.notify(Bt.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&Ae(n.getType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getType()===Re.TRACKED_WITH_RESOURCES}}}function Ae(t){return t===Re.TRACKED_WITH_RESOURCES||t===Re.TRACKED_WITHOUT_RESOURCES}!function(t){t.NOT_TRACKED="0",t.TRACKED_WITH_RESOURCES="1",t.TRACKED_WITHOUT_RESOURCES="2"}(Re||(Re={}));var Le,xe=(Le=r({},{init:function(t){Et("core.init")},addRumGlobalContext:function(t,e){Et("addRumGlobalContext")},setRumGlobalContext:function(t){Et("setRumGlobalContext")},addUserAction:function(t,e){Et("addUserAction")},getInternalContext:function(){Et("getInternalContext")}}),Object.defineProperty(Le,"_setDebug",{get:function(){return q},enumerable:!1}),Le),Ie=!1;xe.init=H((function(t){if(gt()&&Tt()&&function(t){if(Ie)return t.silentMultipleInit||console.error("DD_RUM is already initialized."),!1;if(!t||!t.clientToken&&!t.publicApiKey)return console.error("Client Token is not configured, we will not send any data."),!1;if(!t.applicationId)return console.error("Application ID is not configured, no RUM data will be collected."),!1;if(void 0!==t.sampleRate&&!T(t.sampleRate))return console.error("Sample Rate should be a number between 0 and 100"),!1;if(void 0!==t.resourceSampleRate&&!T(t.resourceSampleRate))return console.error("Resource Sample Rate should be a number between 0 and 100"),!1;return!0}(t)){t.publicApiKey&&(t.clientToken=t.publicApiKey);var e=r(r({},t),{isCollectingError:!0}),n=new Ft,o=bt(e,Pt),i=o.errorObservable,u=o.configuration,a=o.internalMonitoring,c=Se(u,n),s=we(e.applicationId,n,u,c,a),f=ct(),l=f[0],d=f[1];Qt(n,c),function(t){var e;window.MutationObserver&&(e=new MutationObserver(H((function(){t.notify(Bt.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0})}(n),u.isEnabled("collect-user-actions")&&ce(n),i.subscribe((function(t){return n.notify(Bt.ERROR_COLLECTED,t)})),l.subscribe((function(t){return n.notify(Bt.REQUEST_STARTED,t)})),d.subscribe((function(t){return n.notify(Bt.REQUEST_COMPLETED,t)})),L()(xe,s),Ie=!0}})),("object"==typeof globalThis?globalThis:Function("return this")()).DD_RUM=xe}]);

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

env: 'production',
version: '1.9.1',
version: '1.9.2',
};
//# sourceMappingURL=buildEnv.js.map
export { RumUserConfiguration, RumGlobal, datadogRum, InternalContext } from './rum.entry';
export { RumEventCategory, RumEvent, RumResourceEvent, RumViewEvent } from './rum';
export { RumEventCategory, RumEvent, RumResourceEvent, RumViewEvent, RumUserActionEvent } from './rum';

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

import { ErrorMessage, RequestDetails } from '@datadog/browser-core';
import { ErrorMessage, RequestCompleteEvent, RequestStartEvent } from '@datadog/browser-core';
import { UserAction } from './rum';

@@ -7,6 +7,11 @@ export declare enum LifeCycleEventType {

USER_ACTION_COLLECTED = 2,
REQUEST_COLLECTED = 3,
SESSION_RENEWED = 4,
RESOURCE_ADDED_TO_BATCH = 5
REQUEST_STARTED = 3,
REQUEST_COMPLETED = 4,
SESSION_RENEWED = 5,
RESOURCE_ADDED_TO_BATCH = 6,
DOM_MUTATED = 7
}
export interface Subscription {
unsubscribe(): void;
}
export declare class LifeCycle {

@@ -16,10 +21,12 @@ private callbacks;

notify(eventType: LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, data: PerformanceEntry): void;
notify(eventType: LifeCycleEventType.REQUEST_COLLECTED, data: RequestDetails): void;
notify(eventType: LifeCycleEventType.REQUEST_STARTED, data: RequestStartEvent): void;
notify(eventType: LifeCycleEventType.REQUEST_COMPLETED, data: RequestCompleteEvent): void;
notify(eventType: LifeCycleEventType.USER_ACTION_COLLECTED, data: UserAction): void;
notify(eventType: LifeCycleEventType.SESSION_RENEWED | LifeCycleEventType.RESOURCE_ADDED_TO_BATCH): void;
subscribe(eventType: LifeCycleEventType.ERROR_COLLECTED, callback: (data: ErrorMessage) => void): void;
subscribe(eventType: LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, callback: (data: PerformanceEntry) => void): void;
subscribe(eventType: LifeCycleEventType.REQUEST_COLLECTED, callback: (data: RequestDetails) => void): void;
subscribe(eventType: LifeCycleEventType.USER_ACTION_COLLECTED, callback: (data: UserAction) => void): void;
subscribe(eventType: LifeCycleEventType.SESSION_RENEWED | LifeCycleEventType.RESOURCE_ADDED_TO_BATCH, callback: () => void): void;
notify(eventType: LifeCycleEventType.SESSION_RENEWED | LifeCycleEventType.RESOURCE_ADDED_TO_BATCH | LifeCycleEventType.DOM_MUTATED): void;
subscribe(eventType: LifeCycleEventType.ERROR_COLLECTED, callback: (data: ErrorMessage) => void): Subscription;
subscribe(eventType: LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, callback: (data: PerformanceEntry) => void): Subscription;
subscribe(eventType: LifeCycleEventType.REQUEST_STARTED, callback: (data: RequestStartEvent) => void): Subscription;
subscribe(eventType: LifeCycleEventType.REQUEST_COMPLETED, callback: (data: RequestCompleteEvent) => void): Subscription;
subscribe(eventType: LifeCycleEventType.USER_ACTION_COLLECTED, callback: (data: UserAction) => void): Subscription;
subscribe(eventType: LifeCycleEventType.SESSION_RENEWED | LifeCycleEventType.RESOURCE_ADDED_TO_BATCH | LifeCycleEventType.DOM_MUTATED, callback: () => void): Subscription;
}

@@ -8,5 +8,7 @@ "use strict";

LifeCycleEventType[LifeCycleEventType["USER_ACTION_COLLECTED"] = 2] = "USER_ACTION_COLLECTED";
LifeCycleEventType[LifeCycleEventType["REQUEST_COLLECTED"] = 3] = "REQUEST_COLLECTED";
LifeCycleEventType[LifeCycleEventType["SESSION_RENEWED"] = 4] = "SESSION_RENEWED";
LifeCycleEventType[LifeCycleEventType["RESOURCE_ADDED_TO_BATCH"] = 5] = "RESOURCE_ADDED_TO_BATCH";
LifeCycleEventType[LifeCycleEventType["REQUEST_STARTED"] = 3] = "REQUEST_STARTED";
LifeCycleEventType[LifeCycleEventType["REQUEST_COMPLETED"] = 4] = "REQUEST_COMPLETED";
LifeCycleEventType[LifeCycleEventType["SESSION_RENEWED"] = 5] = "SESSION_RENEWED";
LifeCycleEventType[LifeCycleEventType["RESOURCE_ADDED_TO_BATCH"] = 6] = "RESOURCE_ADDED_TO_BATCH";
LifeCycleEventType[LifeCycleEventType["DOM_MUTATED"] = 7] = "DOM_MUTATED";
})(LifeCycleEventType = exports.LifeCycleEventType || (exports.LifeCycleEventType = {}));

@@ -24,9 +26,12 @@ var LifeCycle = /** @class */ (function () {

LifeCycle.prototype.subscribe = function (eventType, callback) {
var eventCallbacks = this.callbacks[eventType];
if (eventCallbacks) {
eventCallbacks.push(callback);
var _this = this;
if (!this.callbacks[eventType]) {
this.callbacks[eventType] = [];
}
else {
this.callbacks[eventType] = [callback];
}
this.callbacks[eventType].push(callback);
return {
unsubscribe: function () {
_this.callbacks[eventType] = _this.callbacks[eventType].filter(function (other) { return callback !== other; });
},
};
};

@@ -33,0 +38,0 @@ return LifeCycle;

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

import { RequestDetails } from '@datadog/browser-core';
import { RequestCompleteEvent } from '@datadog/browser-core';
/**

@@ -14,2 +14,2 @@ * Look for corresponding timing in resource timing buffer

*/
export declare function matchRequestTiming(requestDetails: RequestDetails): PerformanceResourceTiming | undefined;
export declare function matchRequestTiming(request: RequestCompleteEvent): PerformanceResourceTiming | undefined;

@@ -15,3 +15,3 @@ "use strict";

*/
function matchRequestTiming(requestDetails) {
function matchRequestTiming(request) {
if (!performance || !('getEntriesByName' in performance)) {

@@ -21,6 +21,4 @@ return;

var candidates = performance
.getEntriesByName(requestDetails.url, 'resource')
.filter(function (entry) {
return isBetween(entry, requestDetails.startTime, endTime(requestDetails));
});
.getEntriesByName(request.url, 'resource')
.filter(function (entry) { return isBetween(entry, request.startTime, endTime(request)); });
if (candidates.length === 1) {

@@ -27,0 +25,0 @@ return candidates[0];

@@ -62,8 +62,8 @@ "use strict";

else {
var listener_1 = function () {
window.removeEventListener('load', listener_1);
var listener_1 = browser_core_1.monitor(function () {
window.removeEventListener(browser_core_1.DOM_EVENT.LOAD, listener_1);
// Send it a bit after the actual load event, so the "loadEventEnd" timing is accurate
setTimeout(browser_core_1.monitor(sendFakeTiming));
};
window.addEventListener('load', listener_1);
});
window.addEventListener(browser_core_1.DOM_EVENT.LOAD, listener_1);
}

@@ -70,0 +70,0 @@ }

@@ -5,2 +5,3 @@ import { Configuration, Context, ContextValue, ErrorContext, HttpContext, InternalMonitoring, Omit, ResourceKind } from '@datadog/browser-core';

import { RumSession } from './rumSession';
import { UserActionReference } from './userActionCollection';
import { ViewMeasures } from './viewTracker';

@@ -14,6 +15,20 @@ export interface PerformancePaintTiming extends PerformanceEntry {

export declare type PerformanceLongTaskTiming = PerformanceEntry;
export interface UserAction {
export declare enum UserActionType {
CLICK = "click",
LOAD_VIEW = "load_view",
CUSTOM = "custom"
}
interface CustomUserAction {
type: UserActionType.CUSTOM;
name: string;
context?: Context;
}
interface AutoUserAction {
type: UserActionType.LOAD_VIEW | UserActionType.CLICK;
id: string;
name: string;
startTime: number;
duration: number;
}
export declare type UserAction = CustomUserAction | AutoUserAction;
export declare enum RumEventCategory {

@@ -57,4 +72,6 @@ USER_ACTION = "user_action",

traceId?: number;
userAction?: UserActionReference;
}
export interface RumErrorEvent {
date: number;
http?: HttpContext;

@@ -66,2 +83,3 @@ error: ErrorContext;

message: string;
userAction?: UserActionReference;
}

@@ -82,2 +100,3 @@ export interface RumViewEvent {

export interface RumLongTaskEvent {
date: number;
duration: number;

@@ -87,4 +106,5 @@ evt: {

};
userAction?: UserActionReference;
}
export interface RumUserAction {
export interface RumUserActionEvent {
evt: {

@@ -94,9 +114,13 @@ category: RumEventCategory.USER_ACTION;

};
userAction: {
id?: string;
type: UserActionType;
};
[key: string]: ContextValue;
}
export declare type RumEvent = RumErrorEvent | RumResourceEvent | RumViewEvent | RumLongTaskEvent | RumUserAction;
export declare type RumEvent = RumErrorEvent | RumResourceEvent | RumViewEvent | RumLongTaskEvent | RumUserActionEvent;
export declare function startRum(applicationId: string, lifeCycle: LifeCycle, configuration: Configuration, session: RumSession, internalMonitoring: InternalMonitoring): Omit<RumGlobal, 'init'>;
export declare function trackRequests(configuration: Configuration, lifeCycle: LifeCycle, session: RumSession, addRumEvent: (event: RumEvent) => void): void;
export declare function handleResourceEntry(configuration: Configuration, entry: PerformanceResourceTiming, addRumEvent: (event: RumResourceEvent) => void, lifeCycle: LifeCycle): void;
export declare function handleLongTaskEntry(entry: PerformanceLongTaskTiming, addRumEvent: (event: RumEvent) => void): void;
export declare function handleLongTaskEntry(entry: PerformanceLongTaskTiming, addRumEvent: (event: RumLongTaskEvent) => void): void;
export {};

@@ -7,2 +7,3 @@ "use strict";

var buildEnv_1 = require("./buildEnv");
var domMutationCollection_1 = require("./domMutationCollection");
var lifeCycle_1 = require("./lifeCycle");

@@ -12,2 +13,3 @@ var performanceCollection_1 = require("./performanceCollection");

var rumSession_1 = require("./rumSession");
var userActionCollection_1 = require("./userActionCollection");
var STUBBED_RUM = {

@@ -45,8 +47,11 @@ init: function (userConfiguration) {

var globalApi = rum_1.startRum(rumUserConfiguration.applicationId, lifeCycle, configuration, session, internalMonitoring);
var requestObservable = browser_core_1.startRequestCollection();
var _b = browser_core_1.startRequestCollection(), requestStartObservable = _b[0], requestCompleteObservable = _b[1];
performanceCollection_1.startPerformanceCollection(lifeCycle, session);
domMutationCollection_1.startDOMMutationCollection(lifeCycle);
if (configuration.isEnabled('collect-user-actions')) {
userActionCollection_1.startUserActionCollection(lifeCycle);
}
errorObservable.subscribe(function (errorMessage) { return lifeCycle.notify(lifeCycle_1.LifeCycleEventType.ERROR_COLLECTED, errorMessage); });
requestObservable.subscribe(function (requestDetails) {
return lifeCycle.notify(lifeCycle_1.LifeCycleEventType.REQUEST_COLLECTED, requestDetails);
});
requestStartObservable.subscribe(function (startEvent) { return lifeCycle.notify(lifeCycle_1.LifeCycleEventType.REQUEST_STARTED, startEvent); });
requestCompleteObservable.subscribe(function (request) { return lifeCycle.notify(lifeCycle_1.LifeCycleEventType.REQUEST_COMPLETED, request); });
lodash_assign_1.default(exports.datadogRum, globalApi);

@@ -53,0 +58,0 @@ isAlreadyInitialized = true;

@@ -9,3 +9,10 @@ "use strict";

var resourceUtils_1 = require("./resourceUtils");
var userActionCollection_1 = require("./userActionCollection");
var viewTracker_1 = require("./viewTracker");
var UserActionType;
(function (UserActionType) {
UserActionType["CLICK"] = "click";
UserActionType["LOAD_VIEW"] = "load_view";
UserActionType["CUSTOM"] = "custom";
})(UserActionType = exports.UserActionType || (exports.UserActionType = {}));
var RumEventCategory;

@@ -44,3 +51,4 @@ (function (RumEventCategory) {

trackPerformanceTiming(configuration, lifeCycle, batch.addRumEvent);
trackUserAction(lifeCycle, batch.addUserEvent);
trackCustomUserAction(lifeCycle, batch.addUserEvent);
trackAutoUserAction(lifeCycle, batch.addRumEvent);
return {

@@ -51,3 +59,3 @@ addRumGlobalContext: browser_core_1.monitor(function (key, value) {

addUserAction: browser_core_1.monitor(function (name, context) {
lifeCycle.notify(lifeCycle_1.LifeCycleEventType.USER_ACTION_COLLECTED, { name: name, context: context });
lifeCycle.notify(lifeCycle_1.LifeCycleEventType.USER_ACTION_COLLECTED, { context: context, name: name, type: UserActionType.CUSTOM });
}),

@@ -95,27 +103,49 @@ getInternalContext: browser_core_1.monitor(function () {

category: RumEventCategory.ERROR,
} }, context));
}, userAction: userActionCollection_1.getUserActionReference(startTime) }, context));
});
}
function trackUserAction(lifeCycle, addUserEvent) {
lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.USER_ACTION_COLLECTED, function (_a) {
var name = _a.name, context = _a.context;
addUserEvent(tslib_1.__assign(tslib_1.__assign({}, context), { evt: {
name: name,
category: RumEventCategory.USER_ACTION,
} }));
function trackCustomUserAction(lifeCycle, addUserEvent) {
lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.USER_ACTION_COLLECTED, function (userAction) {
if (userAction.type === UserActionType.CUSTOM) {
addUserEvent(tslib_1.__assign(tslib_1.__assign({}, userAction.context), { evt: {
category: RumEventCategory.USER_ACTION,
name: userAction.name,
}, userAction: {
type: userAction.type,
} }));
}
});
}
function trackAutoUserAction(lifeCycle, addRumEvent) {
lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.USER_ACTION_COLLECTED, function (userAction) {
if (userAction.type !== UserActionType.CUSTOM) {
addRumEvent({
date: browser_core_1.getTimestamp(userAction.startTime),
duration: browser_core_1.msToNs(userAction.duration),
evt: {
category: RumEventCategory.USER_ACTION,
name: userAction.name,
},
userAction: {
id: userAction.id,
type: userAction.type,
},
});
}
});
}
function trackRequests(configuration, lifeCycle, session, addRumEvent) {
lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.REQUEST_COLLECTED, function (requestDetails) {
lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.REQUEST_COMPLETED, function (request) {
if (!session.isTrackedWithResource()) {
return;
}
if (!resourceUtils_1.isValidResource(requestDetails.url, configuration)) {
if (!resourceUtils_1.isValidResource(request.url, configuration)) {
return;
}
var timing = matchRequestTiming_1.matchRequestTiming(requestDetails);
var kind = requestDetails.type === browser_core_1.RequestType.XHR ? browser_core_1.ResourceKind.XHR : browser_core_1.ResourceKind.FETCH;
var timing = matchRequestTiming_1.matchRequestTiming(request);
var kind = request.type === browser_core_1.RequestType.XHR ? browser_core_1.ResourceKind.XHR : browser_core_1.ResourceKind.FETCH;
var startTime = timing ? timing.startTime : request.startTime;
addRumEvent({
date: browser_core_1.getTimestamp(timing ? timing.startTime : requestDetails.startTime),
duration: timing ? resourceUtils_1.computePerformanceResourceDuration(timing) : browser_core_1.msToNs(requestDetails.duration),
date: browser_core_1.getTimestamp(startTime),
duration: timing ? resourceUtils_1.computePerformanceResourceDuration(timing) : browser_core_1.msToNs(request.duration),
evt: {

@@ -125,6 +155,6 @@ category: RumEventCategory.RESOURCE,

http: {
method: requestDetails.method,
method: request.method,
performance: timing ? resourceUtils_1.computePerformanceResourceDetails(timing) : undefined,
statusCode: requestDetails.status,
url: requestDetails.url,
statusCode: request.status,
url: request.url,
},

@@ -137,3 +167,4 @@ network: {

},
traceId: requestDetails.traceId,
traceId: request.traceId,
userAction: userActionCollection_1.getUserActionReference(startTime),
});

@@ -182,2 +213,3 @@ lifeCycle.notify(lifeCycle_1.LifeCycleEventType.RESOURCE_ADDED_TO_BATCH);

},
userAction: userActionCollection_1.getUserActionReference(entry.startTime),
});

@@ -194,2 +226,3 @@ lifeCycle.notify(lifeCycle_1.LifeCycleEventType.RESOURCE_ADDED_TO_BATCH);

},
userAction: userActionCollection_1.getUserActionReference(entry.startTime),
});

@@ -196,0 +229,0 @@ }

@@ -13,3 +13,3 @@ "use strict";

function startRumSession(configuration, lifeCycle) {
var session = browser_core_1.startSessionManagement(exports.RUM_SESSION_KEY, function (rawType) { return computeSessionState(configuration, rawType); });
var session = browser_core_1.startSessionManagement(exports.RUM_SESSION_KEY, function (rawType) { return computeSessionState(configuration, rawType); }, configuration.isEnabled('new-session'));
session.renewObservable.subscribe(function () {

@@ -16,0 +16,0 @@ lifeCycle.notify(lifeCycle_1.LifeCycleEventType.SESSION_RENEWED);

@@ -68,5 +68,5 @@ "use strict";

});
window.addEventListener('popstate', function () {
window.addEventListener(browser_core_1.DOM_EVENT.POP_STATE, browser_core_1.monitor(function () {
onUrlChange(location, session, upsertRumEvent);
});
}));
}

@@ -73,0 +73,0 @@ function onUrlChange(location, session, upsertRumEvent) {

export var buildEnv = {
datacenter: 'us',
env: 'production',
version: '1.9.1',
version: '1.9.2',
};
//# sourceMappingURL=buildEnv.js.map
export { RumUserConfiguration, RumGlobal, datadogRum, InternalContext } from './rum.entry';
export { RumEventCategory, RumEvent, RumResourceEvent, RumViewEvent } from './rum';
export { RumEventCategory, RumEvent, RumResourceEvent, RumViewEvent, RumUserActionEvent } from './rum';

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

import { ErrorMessage, RequestDetails } from '@datadog/browser-core';
import { ErrorMessage, RequestCompleteEvent, RequestStartEvent } from '@datadog/browser-core';
import { UserAction } from './rum';

@@ -7,6 +7,11 @@ export declare enum LifeCycleEventType {

USER_ACTION_COLLECTED = 2,
REQUEST_COLLECTED = 3,
SESSION_RENEWED = 4,
RESOURCE_ADDED_TO_BATCH = 5
REQUEST_STARTED = 3,
REQUEST_COMPLETED = 4,
SESSION_RENEWED = 5,
RESOURCE_ADDED_TO_BATCH = 6,
DOM_MUTATED = 7
}
export interface Subscription {
unsubscribe(): void;
}
export declare class LifeCycle {

@@ -16,10 +21,12 @@ private callbacks;

notify(eventType: LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, data: PerformanceEntry): void;
notify(eventType: LifeCycleEventType.REQUEST_COLLECTED, data: RequestDetails): void;
notify(eventType: LifeCycleEventType.REQUEST_STARTED, data: RequestStartEvent): void;
notify(eventType: LifeCycleEventType.REQUEST_COMPLETED, data: RequestCompleteEvent): void;
notify(eventType: LifeCycleEventType.USER_ACTION_COLLECTED, data: UserAction): void;
notify(eventType: LifeCycleEventType.SESSION_RENEWED | LifeCycleEventType.RESOURCE_ADDED_TO_BATCH): void;
subscribe(eventType: LifeCycleEventType.ERROR_COLLECTED, callback: (data: ErrorMessage) => void): void;
subscribe(eventType: LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, callback: (data: PerformanceEntry) => void): void;
subscribe(eventType: LifeCycleEventType.REQUEST_COLLECTED, callback: (data: RequestDetails) => void): void;
subscribe(eventType: LifeCycleEventType.USER_ACTION_COLLECTED, callback: (data: UserAction) => void): void;
subscribe(eventType: LifeCycleEventType.SESSION_RENEWED | LifeCycleEventType.RESOURCE_ADDED_TO_BATCH, callback: () => void): void;
notify(eventType: LifeCycleEventType.SESSION_RENEWED | LifeCycleEventType.RESOURCE_ADDED_TO_BATCH | LifeCycleEventType.DOM_MUTATED): void;
subscribe(eventType: LifeCycleEventType.ERROR_COLLECTED, callback: (data: ErrorMessage) => void): Subscription;
subscribe(eventType: LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, callback: (data: PerformanceEntry) => void): Subscription;
subscribe(eventType: LifeCycleEventType.REQUEST_STARTED, callback: (data: RequestStartEvent) => void): Subscription;
subscribe(eventType: LifeCycleEventType.REQUEST_COMPLETED, callback: (data: RequestCompleteEvent) => void): Subscription;
subscribe(eventType: LifeCycleEventType.USER_ACTION_COLLECTED, callback: (data: UserAction) => void): Subscription;
subscribe(eventType: LifeCycleEventType.SESSION_RENEWED | LifeCycleEventType.RESOURCE_ADDED_TO_BATCH | LifeCycleEventType.DOM_MUTATED, callback: () => void): Subscription;
}

@@ -6,5 +6,7 @@ export var LifeCycleEventType;

LifeCycleEventType[LifeCycleEventType["USER_ACTION_COLLECTED"] = 2] = "USER_ACTION_COLLECTED";
LifeCycleEventType[LifeCycleEventType["REQUEST_COLLECTED"] = 3] = "REQUEST_COLLECTED";
LifeCycleEventType[LifeCycleEventType["SESSION_RENEWED"] = 4] = "SESSION_RENEWED";
LifeCycleEventType[LifeCycleEventType["RESOURCE_ADDED_TO_BATCH"] = 5] = "RESOURCE_ADDED_TO_BATCH";
LifeCycleEventType[LifeCycleEventType["REQUEST_STARTED"] = 3] = "REQUEST_STARTED";
LifeCycleEventType[LifeCycleEventType["REQUEST_COMPLETED"] = 4] = "REQUEST_COMPLETED";
LifeCycleEventType[LifeCycleEventType["SESSION_RENEWED"] = 5] = "SESSION_RENEWED";
LifeCycleEventType[LifeCycleEventType["RESOURCE_ADDED_TO_BATCH"] = 6] = "RESOURCE_ADDED_TO_BATCH";
LifeCycleEventType[LifeCycleEventType["DOM_MUTATED"] = 7] = "DOM_MUTATED";
})(LifeCycleEventType || (LifeCycleEventType = {}));

@@ -22,9 +24,12 @@ var LifeCycle = /** @class */ (function () {

LifeCycle.prototype.subscribe = function (eventType, callback) {
var eventCallbacks = this.callbacks[eventType];
if (eventCallbacks) {
eventCallbacks.push(callback);
var _this = this;
if (!this.callbacks[eventType]) {
this.callbacks[eventType] = [];
}
else {
this.callbacks[eventType] = [callback];
}
this.callbacks[eventType].push(callback);
return {
unsubscribe: function () {
_this.callbacks[eventType] = _this.callbacks[eventType].filter(function (other) { return callback !== other; });
},
};
};

@@ -31,0 +36,0 @@ return LifeCycle;

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

import { RequestDetails } from '@datadog/browser-core';
import { RequestCompleteEvent } from '@datadog/browser-core';
/**

@@ -14,2 +14,2 @@ * Look for corresponding timing in resource timing buffer

*/
export declare function matchRequestTiming(requestDetails: RequestDetails): PerformanceResourceTiming | undefined;
export declare function matchRequestTiming(request: RequestCompleteEvent): PerformanceResourceTiming | undefined;

@@ -13,3 +13,3 @@ /**

*/
export function matchRequestTiming(requestDetails) {
export function matchRequestTiming(request) {
if (!performance || !('getEntriesByName' in performance)) {

@@ -19,6 +19,4 @@ return;

var candidates = performance
.getEntriesByName(requestDetails.url, 'resource')
.filter(function (entry) {
return isBetween(entry, requestDetails.startTime, endTime(requestDetails));
});
.getEntriesByName(request.url, 'resource')
.filter(function (entry) { return isBetween(entry, request.startTime, endTime(request)); });
if (candidates.length === 1) {

@@ -25,0 +23,0 @@ return candidates[0];

import { __assign } from "tslib";
import { getRelativeTime, isNumber, monitor } from '@datadog/browser-core';
import { DOM_EVENT, getRelativeTime, isNumber, monitor } from '@datadog/browser-core';
import { LifeCycleEventType } from './lifeCycle';

@@ -59,8 +59,8 @@ import { FAKE_INITIAL_DOCUMENT } from './resourceUtils';

else {
var listener_1 = function () {
window.removeEventListener('load', listener_1);
var listener_1 = monitor(function () {
window.removeEventListener(DOM_EVENT.LOAD, listener_1);
// Send it a bit after the actual load event, so the "loadEventEnd" timing is accurate
setTimeout(monitor(sendFakeTiming));
};
window.addEventListener('load', listener_1);
});
window.addEventListener(DOM_EVENT.LOAD, listener_1);
}

@@ -67,0 +67,0 @@ }

@@ -5,2 +5,3 @@ import { Configuration, Context, ContextValue, ErrorContext, HttpContext, InternalMonitoring, Omit, ResourceKind } from '@datadog/browser-core';

import { RumSession } from './rumSession';
import { UserActionReference } from './userActionCollection';
import { ViewMeasures } from './viewTracker';

@@ -14,6 +15,20 @@ export interface PerformancePaintTiming extends PerformanceEntry {

export declare type PerformanceLongTaskTiming = PerformanceEntry;
export interface UserAction {
export declare enum UserActionType {
CLICK = "click",
LOAD_VIEW = "load_view",
CUSTOM = "custom"
}
interface CustomUserAction {
type: UserActionType.CUSTOM;
name: string;
context?: Context;
}
interface AutoUserAction {
type: UserActionType.LOAD_VIEW | UserActionType.CLICK;
id: string;
name: string;
startTime: number;
duration: number;
}
export declare type UserAction = CustomUserAction | AutoUserAction;
export declare enum RumEventCategory {

@@ -57,4 +72,6 @@ USER_ACTION = "user_action",

traceId?: number;
userAction?: UserActionReference;
}
export interface RumErrorEvent {
date: number;
http?: HttpContext;

@@ -66,2 +83,3 @@ error: ErrorContext;

message: string;
userAction?: UserActionReference;
}

@@ -82,2 +100,3 @@ export interface RumViewEvent {

export interface RumLongTaskEvent {
date: number;
duration: number;

@@ -87,4 +106,5 @@ evt: {

};
userAction?: UserActionReference;
}
export interface RumUserAction {
export interface RumUserActionEvent {
evt: {

@@ -94,9 +114,13 @@ category: RumEventCategory.USER_ACTION;

};
userAction: {
id?: string;
type: UserActionType;
};
[key: string]: ContextValue;
}
export declare type RumEvent = RumErrorEvent | RumResourceEvent | RumViewEvent | RumLongTaskEvent | RumUserAction;
export declare type RumEvent = RumErrorEvent | RumResourceEvent | RumViewEvent | RumLongTaskEvent | RumUserActionEvent;
export declare function startRum(applicationId: string, lifeCycle: LifeCycle, configuration: Configuration, session: RumSession, internalMonitoring: InternalMonitoring): Omit<RumGlobal, 'init'>;
export declare function trackRequests(configuration: Configuration, lifeCycle: LifeCycle, session: RumSession, addRumEvent: (event: RumEvent) => void): void;
export declare function handleResourceEntry(configuration: Configuration, entry: PerformanceResourceTiming, addRumEvent: (event: RumResourceEvent) => void, lifeCycle: LifeCycle): void;
export declare function handleLongTaskEntry(entry: PerformanceLongTaskTiming, addRumEvent: (event: RumEvent) => void): void;
export declare function handleLongTaskEntry(entry: PerformanceLongTaskTiming, addRumEvent: (event: RumLongTaskEvent) => void): void;
export {};

@@ -5,2 +5,3 @@ import { __assign } from "tslib";

import { buildEnv } from './buildEnv';
import { startDOMMutationCollection } from './domMutationCollection';
import { LifeCycle, LifeCycleEventType } from './lifeCycle';

@@ -10,2 +11,3 @@ import { startPerformanceCollection } from './performanceCollection';

import { startRumSession } from './rumSession';
import { startUserActionCollection } from './userActionCollection';
var STUBBED_RUM = {

@@ -43,8 +45,11 @@ init: function (userConfiguration) {

var globalApi = startRum(rumUserConfiguration.applicationId, lifeCycle, configuration, session, internalMonitoring);
var requestObservable = startRequestCollection();
var _b = startRequestCollection(), requestStartObservable = _b[0], requestCompleteObservable = _b[1];
startPerformanceCollection(lifeCycle, session);
startDOMMutationCollection(lifeCycle);
if (configuration.isEnabled('collect-user-actions')) {
startUserActionCollection(lifeCycle);
}
errorObservable.subscribe(function (errorMessage) { return lifeCycle.notify(LifeCycleEventType.ERROR_COLLECTED, errorMessage); });
requestObservable.subscribe(function (requestDetails) {
return lifeCycle.notify(LifeCycleEventType.REQUEST_COLLECTED, requestDetails);
});
requestStartObservable.subscribe(function (startEvent) { return lifeCycle.notify(LifeCycleEventType.REQUEST_STARTED, startEvent); });
requestCompleteObservable.subscribe(function (request) { return lifeCycle.notify(LifeCycleEventType.REQUEST_COMPLETED, request); });
lodashAssign(datadogRum, globalApi);

@@ -51,0 +56,0 @@ isAlreadyInitialized = true;

@@ -7,3 +7,10 @@ import { __assign } from "tslib";

import { computePerformanceResourceDetails, computePerformanceResourceDuration, computeResourceKind, computeSize, isValidResource, } from './resourceUtils';
import { getUserActionReference } from './userActionCollection';
import { trackView, viewContext } from './viewTracker';
export var UserActionType;
(function (UserActionType) {
UserActionType["CLICK"] = "click";
UserActionType["LOAD_VIEW"] = "load_view";
UserActionType["CUSTOM"] = "custom";
})(UserActionType || (UserActionType = {}));
export var RumEventCategory;

@@ -42,3 +49,4 @@ (function (RumEventCategory) {

trackPerformanceTiming(configuration, lifeCycle, batch.addRumEvent);
trackUserAction(lifeCycle, batch.addUserEvent);
trackCustomUserAction(lifeCycle, batch.addUserEvent);
trackAutoUserAction(lifeCycle, batch.addRumEvent);
return {

@@ -49,3 +57,3 @@ addRumGlobalContext: monitor(function (key, value) {

addUserAction: monitor(function (name, context) {
lifeCycle.notify(LifeCycleEventType.USER_ACTION_COLLECTED, { name: name, context: context });
lifeCycle.notify(LifeCycleEventType.USER_ACTION_COLLECTED, { context: context, name: name, type: UserActionType.CUSTOM });
}),

@@ -92,27 +100,49 @@ getInternalContext: monitor(function () {

category: RumEventCategory.ERROR,
} }, context));
}, userAction: getUserActionReference(startTime) }, context));
});
}
function trackUserAction(lifeCycle, addUserEvent) {
lifeCycle.subscribe(LifeCycleEventType.USER_ACTION_COLLECTED, function (_a) {
var name = _a.name, context = _a.context;
addUserEvent(__assign(__assign({}, context), { evt: {
name: name,
category: RumEventCategory.USER_ACTION,
} }));
function trackCustomUserAction(lifeCycle, addUserEvent) {
lifeCycle.subscribe(LifeCycleEventType.USER_ACTION_COLLECTED, function (userAction) {
if (userAction.type === UserActionType.CUSTOM) {
addUserEvent(__assign(__assign({}, userAction.context), { evt: {
category: RumEventCategory.USER_ACTION,
name: userAction.name,
}, userAction: {
type: userAction.type,
} }));
}
});
}
function trackAutoUserAction(lifeCycle, addRumEvent) {
lifeCycle.subscribe(LifeCycleEventType.USER_ACTION_COLLECTED, function (userAction) {
if (userAction.type !== UserActionType.CUSTOM) {
addRumEvent({
date: getTimestamp(userAction.startTime),
duration: msToNs(userAction.duration),
evt: {
category: RumEventCategory.USER_ACTION,
name: userAction.name,
},
userAction: {
id: userAction.id,
type: userAction.type,
},
});
}
});
}
export function trackRequests(configuration, lifeCycle, session, addRumEvent) {
lifeCycle.subscribe(LifeCycleEventType.REQUEST_COLLECTED, function (requestDetails) {
lifeCycle.subscribe(LifeCycleEventType.REQUEST_COMPLETED, function (request) {
if (!session.isTrackedWithResource()) {
return;
}
if (!isValidResource(requestDetails.url, configuration)) {
if (!isValidResource(request.url, configuration)) {
return;
}
var timing = matchRequestTiming(requestDetails);
var kind = requestDetails.type === RequestType.XHR ? ResourceKind.XHR : ResourceKind.FETCH;
var timing = matchRequestTiming(request);
var kind = request.type === RequestType.XHR ? ResourceKind.XHR : ResourceKind.FETCH;
var startTime = timing ? timing.startTime : request.startTime;
addRumEvent({
date: getTimestamp(timing ? timing.startTime : requestDetails.startTime),
duration: timing ? computePerformanceResourceDuration(timing) : msToNs(requestDetails.duration),
date: getTimestamp(startTime),
duration: timing ? computePerformanceResourceDuration(timing) : msToNs(request.duration),
evt: {

@@ -122,6 +152,6 @@ category: RumEventCategory.RESOURCE,

http: {
method: requestDetails.method,
method: request.method,
performance: timing ? computePerformanceResourceDetails(timing) : undefined,
statusCode: requestDetails.status,
url: requestDetails.url,
statusCode: request.status,
url: request.url,
},

@@ -134,3 +164,4 @@ network: {

},
traceId: requestDetails.traceId,
traceId: request.traceId,
userAction: getUserActionReference(startTime),
});

@@ -178,2 +209,3 @@ lifeCycle.notify(LifeCycleEventType.RESOURCE_ADDED_TO_BATCH);

},
userAction: getUserActionReference(entry.startTime),
});

@@ -189,4 +221,5 @@ lifeCycle.notify(LifeCycleEventType.RESOURCE_ADDED_TO_BATCH);

},
userAction: getUserActionReference(entry.startTime),
});
}
//# sourceMappingURL=rum.js.map

@@ -11,3 +11,3 @@ import { performDraw, startSessionManagement } from '@datadog/browser-core';

export function startRumSession(configuration, lifeCycle) {
var session = startSessionManagement(RUM_SESSION_KEY, function (rawType) { return computeSessionState(configuration, rawType); });
var session = startSessionManagement(RUM_SESSION_KEY, function (rawType) { return computeSessionState(configuration, rawType); }, configuration.isEnabled('new-session'));
session.renewObservable.subscribe(function () {

@@ -14,0 +14,0 @@ lifeCycle.notify(LifeCycleEventType.SESSION_RENEWED);

import { __assign } from "tslib";
import { generateUUID, getTimestamp, monitor, msToNs, throttle } from '@datadog/browser-core';
import { DOM_EVENT, generateUUID, getTimestamp, monitor, msToNs, throttle } from '@datadog/browser-core';
import { LifeCycleEventType } from './lifeCycle';

@@ -66,5 +66,5 @@ import { RumEventCategory } from './rum';

});
window.addEventListener('popstate', function () {
window.addEventListener(DOM_EVENT.POP_STATE, monitor(function () {
onUrlChange(location, session, upsertRumEvent);
});
}));
}

@@ -71,0 +71,0 @@ function onUrlChange(location, session, upsertRumEvent) {

{
"name": "@datadog/browser-rum",
"version": "1.9.1",
"version": "1.9.2",
"license": "Apache-2.0",

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

"dependencies": {
"@datadog/browser-core": "1.9.1",
"@datadog/browser-core": "1.9.2",
"lodash.assign": "4.2.0",

@@ -33,3 +33,3 @@ "lodash.merge": "4.6.2",

},
"gitHead": "88a6e91a6e5ad395879cea173c0ac9b4abacd608"
"gitHead": "0cd09ed4844930c19084b9ac9c24635e108678ee"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc