Socket
Socket
Sign inDemoInstall

@datadog/browser-rum

Package Overview
Dependencies
4
Maintainers
1
Versions
248
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.11.5 to 1.11.6

cjs/trackPageActivities.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]",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,R=O&&O.exports===_,C=R&&b.process,w=function(){try{var t=O&&O.require&&O.require("util").types;return t||C&&C.binding&&C.binding("util")}catch(t){}}(),S=w&&w.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,D=Array.prototype,j=Function.prototype,M=Object.prototype,k=T["__core-js_shared__"],N=j.toString,U=M.hasOwnProperty,B=(L=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"",P=M.toString,z=N.call(Object),H=RegExp("^"+N.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=R?T.Buffer:void 0,W=T.Symbol,K=T.Uint8Array,$=F?F.allocUnsafe:void 0,q=(x=Object.getPrototypeOf,I=Object,function(t){return x(I(t))}),G=Object.create,V=M.propertyIsEnumerable,Y=D.splice,X=W?W.toStringTag:void 0,J=function(){try{var t=_t(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Q=F?F.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(!Mt(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&&!U.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];U.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 U.call(e,t)?e[t]:void 0},ot.prototype.has=function(t){var e=this.__data__;return nt?void 0!==e[t]:U.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():Y.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:X&&X in Object(t)?function(t){var e=U.call(t,X),n=t[X];try{t[X]=void 0;var r=!0}catch(t){}var o=P.call(t);r&&(e?t[X]=n:delete t[X]);return o}(t):function(t){return P.call(t)}(t)}function mt(t){return kt(t)&&ht(t)==c}function yt(t){return!(!Mt(t)||function(t){return!!B&&B in t}(t))&&(Dt(t)?H: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(!Mt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Rt(t),n=[];for(var r in t)("constructor"!=r||!e&&U.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),Mt(i))!function(t,e,n,r,o,i,u){var a=Ct(t,n),c=Ct(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:kt(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(!kt(t)||ht(t)!=p)return!1;var e=q(t);if(null===e)return!0;var n=U.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&N.call(n)==z}(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,Ut(t))}(a):Mt(a)&&!Dt(a)||(f=function(t){return"function"!=typeof t.constructor||Rt(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(Ct(t,u),i,u+"",t,e,o):void 0;void 0===a&&(a=i),st(t,u,a)}}),Ut)}function gt(t,e){return wt(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,zt),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 Rt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||M)}function Ct(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var wt=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}:zt);function St(t,e){return t===e||t!=t&&e!=e}var At=mt(function(){return arguments}())?mt:function(t){return kt(t)&&U.call(t,"callee")&&!V.call(t,"callee")},Lt=Array.isArray;function xt(t){return null!=t&&jt(t.length)&&!Dt(t)}var It=Q||function(){return!1};function Dt(t){if(!Mt(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 Mt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function kt(t){return null!=t&&"object"==typeof t}var Nt=S?function(t){return function(e){return t(e)}}(S):function(t){return kt(t)&&jt(t.length)&&!!E[ht(t)]};function Ut(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(!Mt(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 zt(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=R(t)?d.call(t):"";return e==o||e==i}(t)}function R(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var C,w=(C=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=C.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(t,e,n){if(!R(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&&C(t,u,n,o)}return t})));t.exports=w},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 Ae}));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,o=!n||void 0===n.leading||n.leading,i=!n||void 0===n.trailing||n.trailing,u=!1,a=!1,c=!1;return{throttled:function(){var n=this;c||(u?a=!0:(o?t.apply(this):a=!0,u=!0,r=window.setTimeout((function(){i&&a&&t.apply(n),u=!1,a=!1}),e)))},stop:function(){window.clearTimeout(r),c=!0}}}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(R()+t)}function R(){return void 0===s&&(s=performance.timing.navigationStart),s}function C(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 w={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.sdkEnv?"datadoghq."+r:"datad0g."+r,i="sdk_version:"+e.sdkVersion+(e.env?",env:"+e.env:"")+(e.service?",service:"+e.service:"")+(e.version?",version:"+e.version:""),u=t+"-http-intake.logs."+o,a=e.proxyHost?e.proxyHost:u,c=e.proxyHost?"ddhost="+u+"&":"";return"https://"+a+"/v1/input/"+e.clientToken+"?"+c+"ddsource="+(n||"browser")+"&ddtags="+i}var A=n(1),L=n.n(A),x=n(0),I=n.n(x),D="?",j=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=function(){var t,e,n,r,o,i,u=[];function a(t,e,n){var r;for(var o in u)if(M(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=F(c),r=!0}(),function(){if(i)return;o=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=F(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]||D,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]||D,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]||D,line:r[4]?+r[4]:void 0,url:r[3]}}!o.func&&o.line&&(o.func=D),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!==k&&(i={args:[],column:void 0,func:D,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=D),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)M(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=D),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 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 B,P=function(){function t(t,e,n,r,o,i,u){void 0===u&&(u=y),this.request=t,this.maxSize=e,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=o,this.contextProvider=i,this.beforeUnloadCallback=u,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.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,F(this.beforeUnloadCallback)),document.addEventListener(a.VISIBILITY_CHANGE,F((function(){"hidden"===document.visibilityState&&t.flush()}))),window.addEventListener(a.BEFORE_UNLOAD,F((function(){return t.flush()}))))},t}();!function(t){t.info="info",t.error="error"}(B||(B={}));var z,H={maxMessagesPerPage:0,sentMessageCount:0};function F(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){H.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){H.batch&&H.sentMessageCount<H.maxMessagesPerPage&&(H.sentMessageCount+=1,H.batch.add(t))}function q(t){H.debugMode=t}function G(t){H.debugMode&&console.warn("[INTERNAL ERROR]",t)}var V,Y,X=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,C(window.location)).href}function Q(t,e){return Z(t)===Z(e)}function Z(t){return C(tt(t))}function tt(t,e){if(function(){if(void 0!==V)return V;try{var t=new URL("http://test/path");return V="http://test/path"===t.href}catch(t){V=!1}return V}())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"}(Y||(Y={}));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=F((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:Y.XHR,url:J(r._datadog_xhr.url)}))},s=this.onreadystatechange;return this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&F(c)(),s&&s.apply(this,arguments)},this.addEventListener("loadend",F(c)),o.apply(this,arguments)}}(et=[new X,new X]),function(t){var e=t[0],n=t[1];if(!window.fetch)return;var r=window.fetch;window.fetch=F((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:Y.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:Y.FETCH}),i.label=6;case 6:return[2]}}))}))},d=r.call(this,t,u);return d.then(F(l),F(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 X;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=F((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))},k.subscribe(it)}(e);rt=function(t,e){var n=0,r=new X;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 Y.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={buildMode:e.buildMode,clientToken:t.clientToken,datacenter:t.datacenter||e.datacenter,env:t.env,proxyHost:t.proxyHost,sdkEnv:e.sdkEnv,sdkVersion:e.sdkVersion,service:t.service,version:t.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)},w);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.buildMode&&(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 U(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!==z?z():{})}));L()(H,{batch:e,maxMessagesPerPage:t.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(t){z=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",Rt="_dd_l",Ct="rum",wt="logs";var St="_dd_s",At=15*f,Lt=4*l,xt=f;function It(t,e){var n,r,o,i,u,c=(n=St,i=!1,u=function(){i=!0,window.clearTimeout(r),r=window.setTimeout((function(){i=!1}),ht)},{get:function(){return i?o:(o=yt(n),u(),o)},set:function(t,e){mt(n,t,e),o=t,u()}});!function(t){var e=t.get(),n=yt(_t),r=yt(Ot),o=yt(Rt);if(!e){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i[wt]=o),r&&/^[012]$/.test(r)&&(i[Ct]=r),kt(i,t)}}(c);var s=new X,f=Mt(c).id,l=d((function(){var n=Mt(c),r=e(n[t]),o=r.trackingType,i=r.isTracked;n[t]=o,i&&!n.id&&(n.id=p(),n.created=String(Date.now())),kt(n,c),i&&f!==n.id&&(f=n.id,s.notify())}),ht).throttled;return l(),function(t){var e=F(t),n={capture:!0,passive:!0};[a.CLICK,a.TOUCH_START,a.KEY_DOWN,a.SCROLL].forEach((function(t){document.addEventListener(t,e,n),Ut.push((function(){return document.removeEventListener(t,e,n)}))}))}(l),function(t){var e=F((function(){"visible"===document.visibilityState&&t()})),n=window.setInterval(e,xt);document.addEventListener(a.VISIBILITY_CHANGE,e),Ut.push((function(){clearInterval(n),document.removeEventListener(a.VISIBILITY_CHANGE,e)}))}((function(){kt(Mt(c),c)})),{getId:function(){return Mt(c).id},getTrackingType:function(){return Mt(c)[t]},renewObservable:s}}var Dt=/^([a-z]+)=([a-z0-9-]+)$/,jt="&";function Mt(t){var e=function(t){var e=t.get(),n={};(function(t){return void 0!==t&&(-1!==t.indexOf(jt)||Dt.test(t))})(e)&&e.split(jt).forEach((function(t){var e=Dt.exec(t);if(null!==e){var r=e[1],o=e[2];n[r]=o}}));return n}(t);return function(t){return(void 0===t.created||Date.now()-Number(t.created)<Lt)&&(void 0===t.expire||Date.now()<Number(t.expire))}(e)?e:(Nt(t),{})}function kt(t,e){if(n=t,0!==Object.keys(n).length){var n;t.expire=String(Date.now()+At);var r=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(r,At)}else Nt(e)}function Nt(t){t.set("",0)}var Ut=[];(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.getEntryTypes=function(){return this.instance.entryTypes},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&&(e.instance.entryTypes=t.entryTypes)},t}()).supportedEntryTypes=["navigation"],t}}();var Bt,Pt={buildMode:"release",datacenter:"us",sdkEnv:"production",sdkVersion:"1.11.5"};!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.VIEW_COLLECTED=3]="VIEW_COLLECTED",t[t.REQUEST_STARTED=4]="REQUEST_STARTED",t[t.REQUEST_COMPLETED=5]="REQUEST_COMPLETED",t[t.SESSION_RENEWED=6]="SESSION_RENEWED",t[t.RESOURCE_ADDED_TO_BATCH=7]="RESOURCE_ADDED_TO_BATCH",t[t.DOM_MUTATED=8]="DOM_MUTATED",t[t.BEFORE_UNLOAD=9]="BEFORE_UNLOAD"}(Bt||(Bt={}));var zt=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}();function Ht(t){var e,n=function(){var t,e=window;if(e.Zone){var n=e.Zone.__symbol__("MutationObserver");t=e[n]}return t||(t=e.MutationObserver),t}();return n&&(e=new n(F((function(){t.notify(Bt.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){e&&e.disconnect()}}}var Ft="initial_document",Wt=[[c.DOCUMENT,function(t){return Ft===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 Kt(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=Wt;r<o.length;r++){var i=o[r],u=i[0];if((0,i[1])(t.initiatorType,n))return u}return c.OTHER}function $t(){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 qt(t){var e=t.duration,n=t.startTime,r=t.responseEnd;return h(0===e&&n<r?r-n:e)}function Gt(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($t(e,n,r,o,i,a,c,s,f)){var p=n!==e;if(!p||(l<e&&(l=e),d<e&&(d=n),$t(e,l,d,n))){var v={download:Vt(e,s,f),firstByte:Vt(e,c,s)};return a!==n&&(v.connect=Vt(e,i,a),$t(i,u,a)&&(v.ssl=Vt(e,u,a))),o!==n&&(v.dns=Vt(e,r,o)),p&&(v.redirect=Vt(e,l,d)),v}}}function Vt(t,e,n){return{duration:h(n-e),start:h(e-t)}}function Yt(t){if(t.startTime<t.responseStart)return t.decodedBodySize}function Xt(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 Jt(){return void 0!==window.performance&&"getEntries"in performance}function Qt(){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("navigation")}function Zt(t,e){if(function(t){var e;if(Qt()&&performance.getEntriesByType("navigation").length>0){var n=performance.getEntriesByType("navigation")[0];e=r({},n.toJSON())}else e=r(r({},te()),{name:window.location.href,decodedBodySize:0,startTime:0});e.entryType="resource",e.initiatorType=Ft,e.duration=e.responseEnd,t(e)}((function(n){ee(e,t,[n])})),Jt()&&ee(e,t,performance.getEntries()),window.PerformanceObserver){var n=new PerformanceObserver(F((function(n){return ee(e,t,n.getEntries())}))),o=["resource","navigation","longtask"];"visible"===document.visibilityState&&o.push("paint"),n.observe({entryTypes:o}),Jt()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}Qt()||function(t){function e(){var e=r(r({},te()),{entryType:"navigation"});t(e)}if("complete"===document.readyState)e();else{var n=F((function(){window.removeEventListener(a.LOAD,n),setTimeout(F(e))}));window.addEventListener(a.LOAD,n)}}((function(n){ee(e,t,[n])}))}function te(){var t={},e=performance.timing;for(var n in e)_(e[n])&&(t[n]=0===e[n]?0:e[n]-R());return t}function ee(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 ne(t){if(performance&&"getEntriesByName"in performance){var e,n=performance.getEntriesByName(t.url,"resource").filter((function(e){return n=e,r=t.startTime,o=re(t),n.startTime>=r&&re(n)<=o;var n,r,o}));return 1===n.length?n[0]:2===n.length&&re((e=n)[0])<=e[1].startTime?n[1]:void 0}}function re(t){return t.startTime+t.duration}var oe=[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")}];function ie(t,e){void 0===e&&(e=y);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=[];return r.push(t.subscribe(Bt.ERROR_COLLECTED,(function(){n.errorCount+=1,e(n)}))),r.push(t.subscribe(Bt.USER_ACTION_COLLECTED,(function(){n.userActionCount+=1,e(n)}))),r.push(t.subscribe(Bt.PERFORMANCE_ENTRY_COLLECTED,(function(t){"longtask"===t.entryType&&(n.longTaskCount+=1,e(n))}))),r.push(t.subscribe(Bt.RESOURCE_ADDED_TO_BATCH,(function(){n.resourceCount+=1,e(n)}))),{stop:function(){r.forEach((function(t){return t.unsubscribe()}))},eventCounts:n}}var ue,ae,ce=100,se=100,fe=1e4;function le(t){function e(e){e.target instanceof Element&&de(t,ue.CLICK,function t(e){for(var n=0,r=oe;n<r.length;n++){var o=(0,r[n])(e);if("string"==typeof o){var i=o.trim();if(i)return(u=i).length>100?u.slice(0,100)+" [...]":u}}var u;return e.parentElement?t(e.parentElement):""}(e.target))}return addEventListener(a.CLICK,e,{capture:!0}),{stop:function(){removeEventListener(a.CLICK,e,{capture:!0})}}}function de(t,e,n){if(!ae){var r=p(),o=performance.now();ae={id:r,startTime:o};var i=ve(t),u=i.observable,a=i.stop,c=ie(t),s=c.eventCounts,f=c.stop;he(u,(function(i){a(),f(),void 0!==i&&t.notify(Bt.USER_ACTION_COLLECTED,{id:r,name:n,startTime:o,type:e,duration:i-o,measures:{errorCount:s.errorCount,longTaskCount:s.longTaskCount,resourceCount:s.resourceCount}})}))}}function pe(t){if(ae&&!(void 0!==t&&t<ae.startTime))return{id:ae.id}}function ve(t){var e,n=new X,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()}))}}}function he(t,e){var n,r=!1,o=setTimeout(F((function(){return u(void 0)})),ce),i=setTimeout(F((function(){return u(performance.now())})),fe);function u(t){r||(r=!0,clearTimeout(o),clearTimeout(n),clearTimeout(i),ae=void 0,e(t))}t.subscribe((function(t){var e=t.isBusy;clearTimeout(o),clearTimeout(n);var r=performance.now();e||(n=setTimeout(F((function(){return u(r)})),se))}))}!function(t){t.CLICK="click",t.LOAD_VIEW="load_view",t.CUSTOM="custom"}(ue||(ue={}));var me,ye,Ee,be=3e3;function ge(t,e,n){var o=r({},t),i=Te(e,o,n,0);!function(t){var e=history.pushState;history.pushState=F((function(){e.apply(this,arguments),t()}));var n=history.replaceState;history.replaceState=F((function(){n.apply(this,arguments),t()})),window.addEventListener(a.POP_STATE,F(t))}((function(){var u;u=t,o.pathname!==u.pathname&&(o=r({},t),i.end(),i=Te(e,o,n))})),e.subscribe(Bt.SESSION_RENEWED,(function(){i.end(),i=Te(e,o,n)})),e.subscribe(Bt.BEFORE_UNLOAD,(function(){i.end()}))}function Te(t,e,n,o){void 0===o&&(o=performance.now());var i=p(),u={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},a=0;me={id:i,location:e,sessionId:n.getId()};var c=d(F(y),be,{leading:!1}),s=c.throttled,f=c.stop;function l(t){u=r(r({},u),t),s()}var v=function(t,e){var n={};return{stop:t.subscribe(Bt.PERFORMANCE_ENTRY_COLLECTED,(function(t){if("navigation"===t.entryType){var o=t;n=r(r({},n),{domComplete:h(o.domComplete),domContentLoaded:h(o.domContentLoadedEventEnd),domInteractive:h(o.domInteractive),loadEventEnd:h(o.loadEventEnd)}),e(n)}else if("paint"===t.entryType&&"first-contentful-paint"===t.name){var i=t;n=r(r({},n),{firstContentfulPaint:h(i.startTime)}),e(n)}})).unsubscribe}}(t,l).stop,m=ie(t,l).stop;function y(){a+=1,t.notify(Bt.VIEW_COLLECTED,{documentVersion:a,id:i,location:e,measures:u,duration:performance.now()-o,startTime:o})}return(y(),{end:function(){v(),m(),f(),y()}})}function _e(t,e,n,o,i){var u={};i.setExternalContextProvider((function(){return I()({application_id:t,session_id:me.sessionId,view:{id:me.id}},u)}));var a=function(t,e,n,o,i){var u=new P(new U(t.rumEndpoint,t.batchBytesLimit,!0),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout,(function(){return I()(m(n()),o())}),i);return{addRumEvent:function(t,n){e.isTracked()&&u.add(r(r({},n),m(t)))},upsertRumEvent:function(t,n){e.isTracked()&&u.upsert(m(t),n)}}}(n,o,(function(){return{applicationId:t,date:(new Date).getTime(),session:{type:void 0===window._DATADOG_SYNTHETICS_BROWSER?Ee.USER:Ee.SYNTHETICS},sessionId:me.sessionId,view:{id:me.id,referrer:document.referrer,url:me.location.href}}}),(function(){return u}),(function(){return e.notify(Bt.BEFORE_UNLOAD)}));return function(t,e){t.subscribe(Bt.VIEW_COLLECTED,(function(t){e({date:O(t.startTime),duration:h(t.duration),evt:{category:ye.VIEW},rum:{documentVersion:t.documentVersion},view:{measures:t.measures}},t.id)}))}(e,a.upsertRumEvent),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:pe(o)},i))}))}(e,a.addRumEvent),function(t,e,n,r){e.subscribe(Bt.REQUEST_COMPLETED,(function(o){if(n.isTrackedWithResource()&&Xt(o.url,t)){var i=ne(o),u=o.type===Y.XHR?c.XHR:c.FETCH,a=i?i.startTime:o.startTime;r({date:O(a),duration:i?qt(i):h(o.duration),evt:{category:ye.RESOURCE},http:{method:o.method,performance:i?Gt(i):void 0,statusCode:o.status,url:o.url},network:{bytesWritten:i?Yt(i):void 0},resource:{kind:u},traceId:o.traceId,userAction:pe(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(!Xt(e.name,t))return;var o=Kt(e);if(g([c.XHR,c.FETCH],o))return;n({date:O(e.startTime),duration:qt(e),evt:{category:ye.RESOURCE},http:{performance:Gt(e),url:e.name},network:{bytesWritten:Yt(e)},resource:{kind:o},userAction:pe(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:pe(t.startTime)})}(r,n)}}))}(n,e,a.addRumEvent),function(t,e){t.subscribe(Bt.USER_ACTION_COLLECTED,(function(t){t.type===ue.CUSTOM&&e({evt:{category:ye.USER_ACTION,name:t.name},userAction:{type:t.type}},t.context)}))}(e,a.addRumEvent),function(t,e){t.subscribe(Bt.USER_ACTION_COLLECTED,(function(t){t.type!==ue.CUSTOM&&e({date:O(t.startTime),duration:h(t.duration),evt:{category:ye.USER_ACTION,name:t.name},userAction:{id:t.id,measures:t.measures,type:t.type}})}))}(e,a.addRumEvent),{addRumGlobalContext:F((function(t,e){u[t]=e})),addUserAction:F((function(t,n){e.notify(Bt.USER_ACTION_COLLECTED,{context:n,name:t,type:ue.CUSTOM})})),getInternalContext:F((function(){return{application_id:t,session_id:me.sessionId,user_action:pe(),view:{id:me.id}}})),setRumGlobalContext:F((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"}(ye||(ye={})),function(t){t.SYNTHETICS="synthetics",t.USER="user"}(Ee||(Ee={}));var Oe,Re="rum";function Ce(t,e){var n=It(Re,(function(e){return function(t,e){var n;n=function(t){return t===Oe.NOT_TRACKED||t===Oe.TRACKED_WITH_RESOURCES||t===Oe.TRACKED_WITHOUT_RESOURCES}(e)?e:v(t.sampleRate)?v(t.resourceSampleRate)?Oe.TRACKED_WITH_RESOURCES:Oe.TRACKED_WITHOUT_RESOURCES:Oe.NOT_TRACKED;return{trackingType:n,isTracked:we(n)}}(t,e)}));return n.renewObservable.subscribe((function(){e.notify(Bt.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&we(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===Oe.TRACKED_WITH_RESOURCES}}}function we(t){return t===Oe.TRACKED_WITH_RESOURCES||t===Oe.TRACKED_WITHOUT_RESOURCES}!function(t){t.NOT_TRACKED="0",t.TRACKED_WITH_RESOURCES="1",t.TRACKED_WITHOUT_RESOURCES="2"}(Oe||(Oe={}));var Se,Ae=(Se=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(Se,"_setDebug",{get:function(){return q},enumerable:!1}),Se),Le=!1;Ae.init=F((function(t){if(gt()&&Tt()&&function(t){if(Le)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 zt,o=bt(e,Pt),i=o.errorObservable,u=o.configuration,a=o.internalMonitoring,c=Ce(u,n),s=_e(e.applicationId,n,u,c,a);ge(location,n,c);var f=ct(),l=f[0],d=f[1];Zt(n,c),Ht(n),u.isEnabled("collect-user-actions")&&le(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()(Ae,s),Le=!0}})),(function(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var t=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof t&&(t="object"==typeof self?self:"object"==typeof window?window:{}),t}()).DD_RUM=Ae}]);
!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,C=O&&O.exports===_,R=C&&b.process,w=function(){try{var t=O&&O.require&&O.require("util").types;return t||R&&R.binding&&R.binding("util")}catch(t){}}(),S=w&&w.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,I,x,D=Array.prototype,M=Function.prototype,j=Object.prototype,k=T["__core-js_shared__"],N=M.toString,U=j.hasOwnProperty,B=(L=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+L:"",P=j.toString,H=N.call(Object),z=RegExp("^"+N.call(U).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),F=C?T.Buffer:void 0,W=T.Symbol,K=T.Uint8Array,G=F?F.allocUnsafe:void 0,$=(I=Object.getPrototypeOf,x=Object,function(t){return I(x(t))}),q=Object.create,V=j.propertyIsEnumerable,Y=D.splice,X=W?W.toStringTag:void 0,J=function(){try{var t=_t(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Q=F?F.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(!jt(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=Lt(t),r=!n&&At(t),o=!n&&!r&&xt(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&&!U.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];U.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 U.call(e,t)?e[t]:void 0},ot.prototype.has=function(t){var e=this.__data__;return nt?void 0!==e[t]:U.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():Y.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:X&&X in Object(t)?function(t){var e=U.call(t,X),n=t[X];try{t[X]=void 0;var r=!0}catch(t){}var o=P.call(t);r&&(e?t[X]=n:delete t[X]);return o}(t):function(t){return P.call(t)}(t)}function mt(t){return kt(t)&&ht(t)==c}function yt(t){return!(!jt(t)||function(t){return!!B&&B in t}(t))&&(Dt(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(!jt(t))return function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e}(t);var e=Ct(t),n=[];for(var r in t)("constructor"!=r||!e&&U.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),jt(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&&xt(c),h=!d&&!v&&Nt(c);f=c,d||v||h?Lt(a)?f=a:kt(g=a)&&It(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=G?G(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(!kt(t)||ht(t)!=p)return!1;var e=$(t);if(null===e)return!0;var n=U.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&N.call(n)==H}(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,Ut(t))}(a):jt(a)&&!Dt(a)||(f=function(t){return"function"!=typeof t.constructor||Ct(t)?{}:rt($(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)}}),Ut)}function gt(t,e){return wt(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,Ht),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 Ct(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||j)}function Rt(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var wt=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}:Ht);function St(t,e){return t===e||t!=t&&e!=e}var At=mt(function(){return arguments}())?mt:function(t){return kt(t)&&U.call(t,"callee")&&!V.call(t,"callee")},Lt=Array.isArray;function It(t){return null!=t&&Mt(t.length)&&!Dt(t)}var xt=Q||function(){return!1};function Dt(t){if(!jt(t))return!1;var e=ht(t);return e==f||e==l||e==s||e==v}function Mt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=a}function jt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function kt(t){return null!=t&&"object"==typeof t}var Nt=S?function(t){return function(e){return t(e)}}(S):function(t){return kt(t)&&Mt(t.length)&&!!E[ht(t)]};function Ut(t){return It(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(!jt(n))return!1;var r=typeof e;return!!("number"==r?It(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 Ht(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=C(t)?d.call(t):"";return e==o||e==i}(t)}function C(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}var R,w=(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(!C(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=w},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 Ae}));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,o=!n||void 0===n.leading||n.leading,i=!n||void 0===n.trailing||n.trailing,u=!1,a=!1,c=!1;return{throttled:function(){var n=this;c||(u?a=!0:(o?t.apply(this):a=!0,u=!0,r=window.setTimeout((function(){i&&a&&t.apply(n),u=!1,a=!1}),e)))},stop:function(){window.clearTimeout(r),c=!0}}}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(C()+t)}function C(){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 w={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.sdkEnv?"datadoghq."+r:"datad0g."+r,i="sdk_version:"+e.sdkVersion+(e.env?",env:"+e.env:"")+(e.service?",service:"+e.service:"")+(e.version?",version:"+e.version:""),u=t+"-http-intake.logs."+o,a=e.proxyHost?e.proxyHost:u,c=e.proxyHost?"ddhost="+u+"&":"";return"https://"+a+"/v1/input/"+e.clientToken+"?"+c+"ddsource="+(n||"browser")+"&ddtags="+i}var A=n(1),L=n.n(A),I=n(0),x=n.n(I),D="?",M=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function j(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=function(){var t,e,n,r,o,i,u=[];function a(t,e,n){var r;for(var o in u)if(j(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(M);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=F(c),r=!0}(),function(){if(i)return;o=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=F(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]||D,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]||D,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]||D,line:r[4]?+r[4]:void 0,url:r[3]}}!o.func&&o.line&&(o.func=D),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!==k&&(i={args:[],column:void 0,func:D,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=D),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)j(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=D),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 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 B,P=function(){function t(t,e,n,r,o,i,u){void 0===u&&(u=y),this.request=t,this.maxSize=e,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=o,this.contextProvider=i,this.beforeUnloadCallback=u,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.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(x()({},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,F(this.beforeUnloadCallback)),document.addEventListener(a.VISIBILITY_CHANGE,F((function(){"hidden"===document.visibilityState&&t.flush()}))),window.addEventListener(a.BEFORE_UNLOAD,F((function(){return t.flush()}))))},t}();!function(t){t.info="info",t.error="error"}(B||(B={}));var H,z={maxMessagesPerPage:0,sentMessageCount:0};function F(t){return function(){try{return t.apply(this,arguments)}catch(t){q(t);try{K(t)}catch(t){q(t)}}}}function W(t){!function(t){z.debugMode&&console.log("[MONITORING MESSAGE]",t)}(t),G({message:t,status:B.info})}function K(t){G(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 G(t){z.batch&&z.sentMessageCount<z.maxMessagesPerPage&&(z.sentMessageCount+=1,z.batch.add(t))}function $(t){z.debugMode=t}function q(t){z.debugMode&&console.warn("[INTERNAL ERROR]",t)}var V,Y,X=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!==V)return V;try{var t=new URL("http://test/path");return V="http://test/path"===t.href}catch(t){V=!1}return V}())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"}(Y||(Y={}));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=F((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:Y.XHR,url:J(r._datadog_xhr.url)}))},s=this.onreadystatechange;return this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&F(c)(),s&&s.apply(this,arguments)},this.addEventListener("loadend",F(c)),o.apply(this,arguments)}}(et=[new X,new X]),function(t){var e=t[0],n=t[1];if(!window.fetch)return;var r=window.fetch;window.fetch=F((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:Y.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:Y.FETCH}),i.label=6;case 6:return[2]}}))}))},d=r.call(this,t,u);return d.then(F(l),F(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 X;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=F((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))},k.subscribe(it)}(e);rt=function(t,e){var n=0,r=new X;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 Y.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={buildMode:e.buildMode,clientToken:t.clientToken,datacenter:t.datacenter||e.datacenter,env:t.env,proxyHost:t.proxyHost,sdkEnv:e.sdkEnv,sdkVersion:e.sdkVersion,service:t.service,version:t.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)},w);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.buildMode&&(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 U(t.internalMonitoringEndpoint,t.batchBytesLimit),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout,(function(){return x()({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==H?H():{})}));L()(z,{batch:e,maxMessagesPerPage:t.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(t){H=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",Ct="_dd_l",Rt="rum",wt="logs";var St="_dd_s",At=15*f,Lt=4*l,It=f;function xt(t,e){var n,r,o,i,u,c=(n=St,i=!1,u=function(){i=!0,window.clearTimeout(r),r=window.setTimeout((function(){i=!1}),ht)},{get:function(){return i?o:(o=yt(n),u(),o)},set:function(t,e){mt(n,t,e),o=t,u()}});!function(t){var e=t.get(),n=yt(_t),r=yt(Ot),o=yt(Ct);if(!e){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i[wt]=o),r&&/^[012]$/.test(r)&&(i[Rt]=r),kt(i,t)}}(c);var s=new X,f=jt(c).id,l=d((function(){var n=jt(c),r=e(n[t]),o=r.trackingType,i=r.isTracked;n[t]=o,i&&!n.id&&(n.id=p(),n.created=String(Date.now())),kt(n,c),i&&f!==n.id&&(f=n.id,s.notify())}),ht).throttled;return l(),function(t){var e=F(t),n={capture:!0,passive:!0};[a.CLICK,a.TOUCH_START,a.KEY_DOWN,a.SCROLL].forEach((function(t){document.addEventListener(t,e,n),Ut.push((function(){return document.removeEventListener(t,e,n)}))}))}(l),function(t){var e=F((function(){"visible"===document.visibilityState&&t()})),n=window.setInterval(e,It);document.addEventListener(a.VISIBILITY_CHANGE,e),Ut.push((function(){clearInterval(n),document.removeEventListener(a.VISIBILITY_CHANGE,e)}))}((function(){kt(jt(c),c)})),{getId:function(){return jt(c).id},getTrackingType:function(){return jt(c)[t]},renewObservable:s}}var Dt=/^([a-z]+)=([a-z0-9-]+)$/,Mt="&";function jt(t){var e=function(t){var e=t.get(),n={};(function(t){return void 0!==t&&(-1!==t.indexOf(Mt)||Dt.test(t))})(e)&&e.split(Mt).forEach((function(t){var e=Dt.exec(t);if(null!==e){var r=e[1],o=e[2];n[r]=o}}));return n}(t);return function(t){return(void 0===t.created||Date.now()-Number(t.created)<Lt)&&(void 0===t.expire||Date.now()<Number(t.expire))}(e)?e:(Nt(t),{})}function kt(t,e){if(n=t,0!==Object.keys(n).length){var n;t.expire=String(Date.now()+At);var r=function(t){return Object.keys(t).map((function(e){return[e,t[e]]}))}(t).map((function(t){return t[0]+"="+t[1]})).join(Mt);e.set(r,At)}else Nt(e)}function Nt(t){t.set("",0)}var Ut=[];(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.getEntryTypes=function(){return this.instance.entryTypes},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&&(e.instance.entryTypes=t.entryTypes)},t}()).supportedEntryTypes=["navigation"],t}}();var Bt,Pt={buildMode:"release",datacenter:"us",sdkEnv:"production",sdkVersion:"1.11.6"};!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.VIEW_COLLECTED=3]="VIEW_COLLECTED",t[t.REQUEST_STARTED=4]="REQUEST_STARTED",t[t.REQUEST_COMPLETED=5]="REQUEST_COMPLETED",t[t.SESSION_RENEWED=6]="SESSION_RENEWED",t[t.RESOURCE_ADDED_TO_BATCH=7]="RESOURCE_ADDED_TO_BATCH",t[t.DOM_MUTATED=8]="DOM_MUTATED",t[t.BEFORE_UNLOAD=9]="BEFORE_UNLOAD"}(Bt||(Bt={}));var Ht=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}();function zt(t){var e,n=function(){var t,e=window;if(e.Zone){var n=e.Zone.__symbol__("MutationObserver");t=e[n]}return t||(t=e.MutationObserver),t}();return n&&(e=new n(F((function(){t.notify(Bt.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){e&&e.disconnect()}}}var Ft="initial_document",Wt=[[c.DOCUMENT,function(t){return Ft===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 Kt(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=Wt;r<o.length;r++){var i=o[r],u=i[0];if((0,i[1])(t.initiatorType,n))return u}return c.OTHER}function Gt(){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(Gt(e,n,r,o,i,a,c,s,f)){var p=n!==e;if(!p||(l<e&&(l=e),d<e&&(d=n),Gt(e,l,d,n))){var v={download:Vt(e,s,f),firstByte:Vt(e,c,s)};return a!==n&&(v.connect=Vt(e,i,a),Gt(i,u,a)&&(v.ssl=Vt(e,u,a))),o!==n&&(v.dns=Vt(e,r,o)),p&&(v.redirect=Vt(e,l,d)),v}}}function Vt(t,e,n){return{duration:h(n-e),start:h(e-t)}}function Yt(t){if(t.startTime<t.responseStart)return t.decodedBodySize}function Xt(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 Jt(){return void 0!==window.performance&&"getEntries"in performance}function Qt(){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("navigation")}function Zt(t,e){if(function(t){var e;if(Qt()&&performance.getEntriesByType("navigation").length>0){var n=performance.getEntriesByType("navigation")[0];e=r({},n.toJSON())}else e=r(r({},te()),{name:window.location.href,decodedBodySize:0,startTime:0});e.entryType="resource",e.initiatorType=Ft,e.duration=e.responseEnd,t(e)}((function(n){ee(e,t,[n])})),Jt()&&ee(e,t,performance.getEntries()),window.PerformanceObserver){var n=new PerformanceObserver(F((function(n){return ee(e,t,n.getEntries())}))),o=["resource","navigation","longtask"];"visible"===document.visibilityState&&o.push("paint"),n.observe({entryTypes:o}),Jt()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}Qt()||function(t){function e(){var e=r(r({},te()),{entryType:"navigation"});t(e)}if("complete"===document.readyState)e();else{var n=F((function(){window.removeEventListener(a.LOAD,n),setTimeout(F(e))}));window.addEventListener(a.LOAD,n)}}((function(n){ee(e,t,[n])}))}function te(){var t={},e=performance.timing;for(var n in e)_(e[n])&&(t[n]=0===e[n]?0:e[n]-C());return t}function ee(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 ne(t){if(performance&&"getEntriesByName"in performance){var e,n=performance.getEntriesByName(t.url,"resource").filter((function(e){return n=e,r=t.startTime,o=re(t),n.startTime>=r&&re(n)<=o;var n,r,o}));return 1===n.length?n[0]:2===n.length&&re((e=n)[0])<=e[1].startTime?n[1]:void 0}}function re(t){return t.startTime+t.duration}var oe=[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")}];function ie(t,e){void 0===e&&(e=y);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=[];return r.push(t.subscribe(Bt.ERROR_COLLECTED,(function(){n.errorCount+=1,e(n)}))),r.push(t.subscribe(Bt.USER_ACTION_COLLECTED,(function(){n.userActionCount+=1,e(n)}))),r.push(t.subscribe(Bt.PERFORMANCE_ENTRY_COLLECTED,(function(t){"longtask"===t.entryType&&(n.longTaskCount+=1,e(n))}))),r.push(t.subscribe(Bt.RESOURCE_ADDED_TO_BATCH,(function(){n.resourceCount+=1,e(n)}))),{stop:function(){r.forEach((function(t){return t.unsubscribe()}))},eventCounts:n}}var ue,ae,ce=100,se=100,fe=1e4;function le(t,e){var n=function(t){var e,n=new X,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()}))}}}(t),r=n.observable,o=n.stop,i=function(t,e,n){var r,o=!1,i=setTimeout(F((function(){return c(!1,0)})),ce),u=setTimeout(F((function(){return c(!0,performance.now())})),fe);function a(){o=!0,clearTimeout(i),clearTimeout(r),clearTimeout(u),e()}function c(t,e){o||(a(),n(t,e))}return t.subscribe((function(t){var e=t.isBusy;clearTimeout(i),clearTimeout(r);var n=performance.now();e||(r=setTimeout(F((function(){return c(!0,n)})),se))})),{stop:a}}(r,o,e).stop;return{stop:function(){i(),o()}}}function de(t){function e(e){e.target instanceof Element&&pe(t,ue.CLICK,function t(e){for(var n=0,r=oe;n<r.length;n++){var o=(0,r[n])(e);if("string"==typeof o){var i=o.trim();if(i)return(u=i).length>100?u.slice(0,100)+" [...]":u}}var u;return e.parentElement?t(e.parentElement):""}(e.target))}return addEventListener(a.CLICK,e,{capture:!0}),t.subscribe(Bt.VIEW_COLLECTED,(function(){ae&&ae.stop()})),{stop:function(){ae&&ae.stop(),removeEventListener(a.CLICK,e,{capture:!0})}}}function pe(t,e,n){if(!ae){var r=p(),o=performance.now(),i=ie(t),u=i.eventCounts,a=i.stop,c=le(t,(function(i,c){i&&t.notify(Bt.USER_ACTION_COLLECTED,{id:r,name:n,startTime:o,type:e,duration:c-o,measures:{errorCount:u.errorCount,longTaskCount:u.longTaskCount,resourceCount:u.resourceCount}}),a(),ae=void 0})).stop;ae={id:r,startTime:o,stop:function(){a(),c(),ae=void 0}}}}function ve(t){if(ae&&!(void 0!==t&&t<ae.startTime))return{id:ae.id}}!function(t){t.CLICK="click",t.CUSTOM="custom"}(ue||(ue={}));var he;!function(t){t.INITIAL_LOAD="initial_load",t.ROUTE_CHANGE="route_change"}(he||(he={}));var me,ye,Ee,be=3e3;function ge(t,e,n){var o=r({},t),i=Te(e,o,n,he.INITIAL_LOAD,0);!function(t){var e=history.pushState;history.pushState=F((function(){e.apply(this,arguments),t()}));var n=history.replaceState;history.replaceState=F((function(){n.apply(this,arguments),t()})),window.addEventListener(a.POP_STATE,F(t))}((function(){var u;u=t,o.pathname!==u.pathname&&(o=r({},t),i.end(),i=Te(e,o,n,he.ROUTE_CHANGE))})),e.subscribe(Bt.SESSION_RENEWED,(function(){i.end(),i=Te(e,o,n,he.ROUTE_CHANGE)})),e.subscribe(Bt.BEFORE_UNLOAD,(function(){i.end()}))}function Te(t,e,n,o,i){void 0===i&&(i=performance.now());var u,a=p(),c={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},s=0;me={id:a,location:e,sessionId:n.getId()};var f=d(F(T),be,{leading:!1}),l=f.throttled,v=f.stop;function m(t){c=r(r({},c),t),l()}var E=function(t,e){var n={};return{stop:t.subscribe(Bt.PERFORMANCE_ENTRY_COLLECTED,(function(t){if("navigation"===t.entryType){var o=t;n=r(r({},n),{domComplete:h(o.domComplete),domContentLoaded:h(o.domContentLoadedEventEnd),domInteractive:h(o.domInteractive),loadEventEnd:h(o.loadEventEnd)}),e(n)}else if("paint"===t.entryType&&"first-contentful-paint"===t.name){var i=t;n=r(r({},n),{firstContentfulPaint:h(i.startTime)}),e(n)}})).unsubscribe}}(t,m).stop,b=ie(t,m).stop;var g=function(t,e,n){var r=1,o=[],i=y;e===he.INITIAL_LOAD&&(r+=1,i=function(t,e){return{stop:t.subscribe(Bt.PERFORMANCE_ENTRY_COLLECTED,(function(t){"navigation"===t.entryType&&e(t.loadEventEnd)})).unsubscribe}}(t,a).stop);var u=function(t,e){var n=performance.now();return{stop:le(t,(function(t,r){e(t?r-n:void 0)})).stop}}(t,a).stop;function a(t){r-=1,t&&o.push(t),0===r&&o.length&&n(Math.max.apply(Math,o))}return{stop:function(){u(),i()}}}(t,o,(function(t){u=t,l()})).stop;function T(){s+=1,t.notify(Bt.VIEW_COLLECTED,{documentVersion:s,id:a,loadingTime:u,loadingType:o,location:e,measures:c,duration:performance.now()-i,startTime:i})}return T(),{end:function(){E(),b(),g(),v(),T()}}}function _e(t,e,n,o,i){var u={};i.setExternalContextProvider((function(){return x()({application_id:t,session_id:me.sessionId,view:{id:me.id}},u)}));var a=function(t,e,n,o,i){var u=new P(new U(t.rumEndpoint,t.batchBytesLimit,!0),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout,(function(){return x()(m(n()),o())}),i);return{addRumEvent:function(t,n){e.isTracked()&&u.add(r(r({},n),m(t)))},upsertRumEvent:function(t,n){e.isTracked()&&u.upsert(m(t),n)}}}(n,o,(function(){return{applicationId:t,date:(new Date).getTime(),session:{type:void 0===window._DATADOG_SYNTHETICS_BROWSER?Ee.USER:Ee.SYNTHETICS},sessionId:me.sessionId,view:{id:me.id,referrer:document.referrer,url:me.location.href}}}),(function(){return u}),(function(){return e.notify(Bt.BEFORE_UNLOAD)}));return function(t,e){t.subscribe(Bt.VIEW_COLLECTED,(function(t){e({date:O(t.startTime),duration:h(t.duration),evt:{category:ye.VIEW},rum:{documentVersion:t.documentVersion},view:{loadingTime:t.loadingTime?h(t.loadingTime):void 0,loadingType:t.loadingType,measures:t.measures}},t.id)}))}(e,a.upsertRumEvent),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:ve(o)},i))}))}(e,a.addRumEvent),function(t,e,n,r){e.subscribe(Bt.REQUEST_COMPLETED,(function(o){if(n.isTrackedWithResource()&&Xt(o.url,t)){var i=ne(o),u=o.type===Y.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?Yt(i):void 0},resource:{kind:u},traceId:o.traceId,userAction:ve(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(!Xt(e.name,t))return;var o=Kt(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:Yt(e)},resource:{kind:o},userAction:ve(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:ve(t.startTime)})}(r,n)}}))}(n,e,a.addRumEvent),function(t,e){t.subscribe(Bt.USER_ACTION_COLLECTED,(function(t){t.type===ue.CUSTOM&&e({evt:{category:ye.USER_ACTION,name:t.name},userAction:{type:t.type}},t.context)}))}(e,a.addRumEvent),function(t,e){t.subscribe(Bt.USER_ACTION_COLLECTED,(function(t){t.type!==ue.CUSTOM&&e({date:O(t.startTime),duration:h(t.duration),evt:{category:ye.USER_ACTION,name:t.name},userAction:{id:t.id,measures:t.measures,type:t.type}})}))}(e,a.addRumEvent),{addRumGlobalContext:F((function(t,e){u[t]=e})),addUserAction:F((function(t,n){e.notify(Bt.USER_ACTION_COLLECTED,{context:n,name:t,type:ue.CUSTOM})})),getInternalContext:F((function(){return{application_id:t,session_id:me.sessionId,user_action:ve(),view:{id:me.id}}})),setRumGlobalContext:F((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"}(ye||(ye={})),function(t){t.SYNTHETICS="synthetics",t.USER="user"}(Ee||(Ee={}));var Oe,Ce="rum";function Re(t,e){var n=xt(Ce,(function(e){return function(t,e){var n;n=function(t){return t===Oe.NOT_TRACKED||t===Oe.TRACKED_WITH_RESOURCES||t===Oe.TRACKED_WITHOUT_RESOURCES}(e)?e:v(t.sampleRate)?v(t.resourceSampleRate)?Oe.TRACKED_WITH_RESOURCES:Oe.TRACKED_WITHOUT_RESOURCES:Oe.NOT_TRACKED;return{trackingType:n,isTracked:we(n)}}(t,e)}));return n.renewObservable.subscribe((function(){e.notify(Bt.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&we(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===Oe.TRACKED_WITH_RESOURCES}}}function we(t){return t===Oe.TRACKED_WITH_RESOURCES||t===Oe.TRACKED_WITHOUT_RESOURCES}!function(t){t.NOT_TRACKED="0",t.TRACKED_WITH_RESOURCES="1",t.TRACKED_WITHOUT_RESOURCES="2"}(Oe||(Oe={}));var Se,Ae=(Se=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(Se,"_setDebug",{get:function(){return $},enumerable:!1}),Se),Le=!1;Ae.init=F((function(t){if(gt()&&Tt()&&function(t){if(Le)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 Ht,o=bt(e,Pt),i=o.errorObservable,u=o.configuration,a=o.internalMonitoring,c=Re(u,n),s=_e(e.applicationId,n,u,c,a);ge(location,n,c);var f=ct(),l=f[0],d=f[1];Zt(n,c),zt(n),u.isEnabled("collect-user-actions")&&de(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()(Ae,s),Le=!0}})),(function(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var t=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof t&&(t="object"==typeof self?self:"object"==typeof window?window:{}),t}()).DD_RUM=Ae}]);

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

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

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

import { UserActionMeasures, UserActionReference, UserActionType } from './userActionCollection';
import { ViewMeasures } from './viewCollection';
import { ViewLoadingType, ViewMeasures } from './viewCollection';
export interface PerformancePaintTiming extends PerformanceEntry {

@@ -75,2 +75,4 @@ entryType: 'paint';

view: {
loadingTime?: number;
loadingType: ViewLoadingType;
measures: ViewMeasures;

@@ -77,0 +79,0 @@ };

@@ -106,2 +106,4 @@ "use strict";

view: {
loadingTime: view.loadingTime ? browser_core_1.msToNs(view.loadingTime) : undefined,
loadingType: view.loadingType,
measures: view.measures,

@@ -108,0 +110,0 @@ },

@@ -1,9 +0,5 @@

import { Context, Observable } from '@datadog/browser-core';
import { Context } from '@datadog/browser-core';
import { LifeCycle } from './lifeCycle';
export declare const USER_ACTION_VALIDATION_DELAY = 100;
export declare const USER_ACTION_END_DELAY = 100;
export declare const USER_ACTION_MAX_DURATION = 10000;
export declare enum UserActionType {
CLICK = "click",
LOAD_VIEW = "load_view",
CUSTOM = "custom"

@@ -22,3 +18,3 @@ }

export interface AutoUserAction {
type: UserActionType.LOAD_VIEW | UserActionType.CLICK;
type: UserActionType.CLICK;
id: string;

@@ -39,16 +35,6 @@ name: string;

export declare function getUserActionReference(time?: number): UserActionReference | undefined;
export interface PageActivityEvent {
isBusy: boolean;
}
declare function trackPageActivities(lifeCycle: LifeCycle): {
observable: Observable<PageActivityEvent>;
stop(): void;
};
declare function waitUserActionCompletion(pageActivitiesObservable: Observable<PageActivityEvent>, completionCallback: (endTime: number | undefined) => void): void;
export declare const $$tests: {
newUserAction: typeof newUserAction;
trackPageActivities: typeof trackPageActivities;
resetUserAction(): void;
waitUserActionCompletion: typeof waitUserActionCompletion;
};
export {};

@@ -7,40 +7,11 @@ "use strict";

var trackEventCounts_1 = require("./trackEventCounts");
// Automatic user action collection lifecycle overview:
//
// (Start)
// .--------------'----------------------.
// v v
// [Wait for a page activity ] [Wait for a maximum duration]
// [timeout: VALIDATION_DELAY] [ timeout: MAX_DURATION ]
// / \ |
// v v |
// [No page activity] [Page activity] |
// | |,----------------------. |
// v v | |
// (Discard) [Wait for a page activity] | |
// [ timeout: END_DELAY ] | |
// / \ | |
// v v | |
// [No page activity] [Page activity] | |
// | | | |
// | '------------' |
// '-----------. ,--------------------'
// v
// (End)
//
// Note: because MAX_DURATION > VALIDATION_DELAY, we are sure that if the user action is still alive
// after MAX_DURATION, it has been validated.
// Delay to wait for a page activity to validate the user action
exports.USER_ACTION_VALIDATION_DELAY = 100;
// Delay to wait after a page activity to end the user action
exports.USER_ACTION_END_DELAY = 100;
// Maximum duration of a user action
exports.USER_ACTION_MAX_DURATION = 10000;
var trackPageActivities_1 = require("./trackPageActivities");
var UserActionType;
(function (UserActionType) {
UserActionType["CLICK"] = "click";
UserActionType["LOAD_VIEW"] = "load_view";
UserActionType["CUSTOM"] = "custom";
})(UserActionType = exports.UserActionType || (exports.UserActionType = {}));
var pendingAutoUserAction;
function startUserActionCollection(lifeCycle) {
addEventListener(browser_core_1.DOM_EVENT.CLICK, processClick, { capture: true });
function processClick(event) {

@@ -52,5 +23,13 @@ if (!(event.target instanceof Element)) {

}
addEventListener(browser_core_1.DOM_EVENT.CLICK, processClick, { capture: true });
// New views trigger the cancellation of the current pending User Action
lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.VIEW_COLLECTED, function () {
if (pendingAutoUserAction) {
pendingAutoUserAction.stop();
}
});
return {
stop: function () {
if (pendingAutoUserAction) {
pendingAutoUserAction.stop();
}
removeEventListener(browser_core_1.DOM_EVENT.CLICK, processClick, { capture: true });

@@ -61,6 +40,5 @@ },

exports.startUserActionCollection = startUserActionCollection;
var currentUserAction;
function newUserAction(lifeCycle, type, name) {
if (currentUserAction) {
// Discard any new user action if another one is already occuring.
if (pendingAutoUserAction) {
// Discard any new user action if another one is already occurring.
return;

@@ -70,9 +48,5 @@ }

var startTime = performance.now();
currentUserAction = { id: id, startTime: startTime };
var _a = trackPageActivities(lifeCycle), pageActivitiesObservable = _a.observable, stopPageActivitiesTracking = _a.stop;
var _b = trackEventCounts_1.trackEventCounts(lifeCycle), eventCounts = _b.eventCounts, stopEventCountsTracking = _b.stop;
waitUserActionCompletion(pageActivitiesObservable, function (endTime) {
stopPageActivitiesTracking();
stopEventCountsTracking();
if (endTime !== undefined) {
var _a = trackEventCounts_1.trackEventCounts(lifeCycle), eventCounts = _a.eventCounts, stopEventCountsTracking = _a.stop;
var stopWaitIdlePageActivity = trackPageActivities_1.waitIdlePageActivity(lifeCycle, function (hadActivity, endTime) {
if (hadActivity) {
lifeCycle.notify(lifeCycle_1.LifeCycleEventType.USER_ACTION_COLLECTED, {

@@ -91,82 +65,28 @@ id: id,

}
});
stopEventCountsTracking();
pendingAutoUserAction = undefined;
}).stop;
pendingAutoUserAction = {
id: id,
startTime: startTime,
stop: function () {
stopEventCountsTracking();
stopWaitIdlePageActivity();
pendingAutoUserAction = undefined;
},
};
}
function getUserActionReference(time) {
if (!currentUserAction || (time !== undefined && time < currentUserAction.startTime)) {
if (!pendingAutoUserAction || (time !== undefined && time < pendingAutoUserAction.startTime)) {
return undefined;
}
return { id: currentUserAction.id };
return { id: pendingAutoUserAction.id };
}
exports.getUserActionReference = getUserActionReference;
function trackPageActivities(lifeCycle) {
var observable = new browser_core_1.Observable();
var subscriptions = [];
var firstRequestId;
var pendingRequestsCount = 0;
subscriptions.push(lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.DOM_MUTATED, function () { return notifyPageActivity(); }));
subscriptions.push(lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, function (entry) {
if (entry.entryType !== 'resource') {
return;
}
notifyPageActivity();
}));
subscriptions.push(lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.REQUEST_STARTED, function (startEvent) {
if (firstRequestId === undefined) {
firstRequestId = startEvent.requestId;
}
pendingRequestsCount += 1;
notifyPageActivity();
}));
subscriptions.push(lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.REQUEST_COMPLETED, function (request) {
// If the request started before the tracking start, ignore it
if (firstRequestId === undefined || request.requestId < firstRequestId) {
return;
}
pendingRequestsCount -= 1;
notifyPageActivity();
}));
function notifyPageActivity() {
observable.notify({ isBusy: pendingRequestsCount > 0 });
}
return {
observable: observable,
stop: function () {
subscriptions.forEach(function (s) { return s.unsubscribe(); });
},
};
}
function waitUserActionCompletion(pageActivitiesObservable, completionCallback) {
var idleTimeoutId;
var hasCompleted = false;
var validationTimeoutId = setTimeout(browser_core_1.monitor(function () { return complete(undefined); }), exports.USER_ACTION_VALIDATION_DELAY);
var maxDurationTimeoutId = setTimeout(browser_core_1.monitor(function () { return complete(performance.now()); }), exports.USER_ACTION_MAX_DURATION);
pageActivitiesObservable.subscribe(function (_a) {
var isBusy = _a.isBusy;
clearTimeout(validationTimeoutId);
clearTimeout(idleTimeoutId);
var lastChangeTime = performance.now();
if (!isBusy) {
idleTimeoutId = setTimeout(browser_core_1.monitor(function () { return complete(lastChangeTime); }), exports.USER_ACTION_END_DELAY);
}
});
function complete(endTime) {
if (hasCompleted) {
return;
}
hasCompleted = true;
clearTimeout(validationTimeoutId);
clearTimeout(idleTimeoutId);
clearTimeout(maxDurationTimeoutId);
currentUserAction = undefined;
completionCallback(endTime);
}
}
exports.$$tests = {
newUserAction: newUserAction,
trackPageActivities: trackPageActivities,
resetUserAction: function () {
currentUserAction = undefined;
pendingAutoUserAction = undefined;
},
waitUserActionCompletion: waitUserActionCompletion,
};
//# sourceMappingURL=userActionCollection.js.map

@@ -10,2 +10,4 @@ import { LifeCycle } from './lifeCycle';

duration: number;
loadingTime?: number | undefined;
loadingType: ViewLoadingType;
}

@@ -23,2 +25,6 @@ export interface ViewMeasures {

}
export declare enum ViewLoadingType {
INITIAL_LOAD = "initial_load",
ROUTE_CHANGE = "route_change"
}
export declare const THROTTLE_VIEW_UPDATE_PERIOD = 3000;

@@ -25,0 +31,0 @@ export declare function startViewCollection(location: Location, lifeCycle: LifeCycle, session: RumSession): void;

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

var trackEventCounts_1 = require("./trackEventCounts");
var trackPageActivities_1 = require("./trackPageActivities");
var ViewLoadingType;
(function (ViewLoadingType) {
ViewLoadingType["INITIAL_LOAD"] = "initial_load";
ViewLoadingType["ROUTE_CHANGE"] = "route_change";
})(ViewLoadingType = exports.ViewLoadingType || (exports.ViewLoadingType = {}));
exports.THROTTLE_VIEW_UPDATE_PERIOD = 3000;

@@ -12,3 +18,3 @@ function startViewCollection(location, lifeCycle, session) {

var startOrigin = 0;
var currentView = newView(lifeCycle, currentLocation, session, startOrigin);
var currentView = newView(lifeCycle, currentLocation, session, ViewLoadingType.INITIAL_LOAD, startOrigin);
// Renew view on history changes

@@ -19,3 +25,3 @@ trackHistory(function () {

currentView.end();
currentView = newView(lifeCycle, currentLocation, session);
currentView = newView(lifeCycle, currentLocation, session, ViewLoadingType.ROUTE_CHANGE);
}

@@ -26,3 +32,3 @@ });

currentView.end();
currentView = newView(lifeCycle, currentLocation, session);
currentView = newView(lifeCycle, currentLocation, session, ViewLoadingType.ROUTE_CHANGE);
});

@@ -35,3 +41,3 @@ // End the current view on page unload

exports.startViewCollection = startViewCollection;
function newView(lifeCycle, location, session, startOrigin) {
function newView(lifeCycle, location, session, loadingType, startOrigin) {
if (startOrigin === void 0) { startOrigin = performance.now(); }

@@ -47,2 +53,3 @@ // Setup initial values

var documentVersion = 0;
var loadingTime;
exports.viewContext = { id: id, location: location, sessionId: session.getId() };

@@ -59,2 +66,7 @@ // Update the view every time the measures are changing

var stopEventCountsTracking = trackEventCounts_1.trackEventCounts(lifeCycle, updateMeasures).stop;
function updateLoadingTime(loadingTimeValue) {
loadingTime = loadingTimeValue;
scheduleViewUpdate();
}
var stopLoadingTimeTracking = trackLoadingTime(lifeCycle, loadingType, updateLoadingTime).stop;
// Initial view update

@@ -67,2 +79,4 @@ updateView();

id: id,
loadingTime: loadingTime,
loadingType: loadingType,
location: location,

@@ -78,2 +92,3 @@ measures: measures,

stopEventCountsTracking();
stopLoadingTimeTracking();
// prevent pending view updates execution

@@ -118,2 +133,48 @@ stopScheduleViewUpdate();

}
function trackLoadingTime(lifeCycle, loadingType, callback) {
var expectedTiming = 1;
var receivedTimings = [];
var stopLoadEventLoadingTime = browser_core_1.noop;
if (loadingType === ViewLoadingType.INITIAL_LOAD) {
expectedTiming += 1;
(stopLoadEventLoadingTime = trackLoadEventLoadingTime(lifeCycle, onTimingValue).stop);
}
var stopActivityLoadingTimeTracking = trackActivityLoadingTime(lifeCycle, onTimingValue).stop;
function onTimingValue(timingValue) {
expectedTiming -= 1;
if (timingValue) {
receivedTimings.push(timingValue);
}
if (expectedTiming === 0 && receivedTimings.length) {
callback(Math.max.apply(Math, receivedTimings));
}
}
return {
stop: function () {
stopActivityLoadingTimeTracking();
stopLoadEventLoadingTime();
},
};
}
function trackLoadEventLoadingTime(lifeCycle, callback) {
var stopPerformanceTracking = lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, function (entry) {
if (entry.entryType === 'navigation') {
var navigationEntry = entry;
callback(navigationEntry.loadEventEnd);
}
}).unsubscribe;
return { stop: stopPerformanceTracking };
}
function trackActivityLoadingTime(lifeCycle, callback) {
var startTime = performance.now();
var stopWaitIdlePageActivity = trackPageActivities_1.waitIdlePageActivity(lifeCycle, function (hadActivity, endTime) {
if (hadActivity) {
callback(endTime - startTime);
}
else {
callback(undefined);
}
}).stop;
return { stop: stopWaitIdlePageActivity };
}
//# sourceMappingURL=viewCollection.js.map

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

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

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

import { UserActionMeasures, UserActionReference, UserActionType } from './userActionCollection';
import { ViewMeasures } from './viewCollection';
import { ViewLoadingType, ViewMeasures } from './viewCollection';
export interface PerformancePaintTiming extends PerformanceEntry {

@@ -75,2 +75,4 @@ entryType: 'paint';

view: {
loadingTime?: number;
loadingType: ViewLoadingType;
measures: ViewMeasures;

@@ -77,0 +79,0 @@ };

@@ -103,2 +103,4 @@ import { __assign } from "tslib";

view: {
loadingTime: view.loadingTime ? msToNs(view.loadingTime) : undefined,
loadingType: view.loadingType,
measures: view.measures,

@@ -105,0 +107,0 @@ },

@@ -1,9 +0,5 @@

import { Context, Observable } from '@datadog/browser-core';
import { Context } from '@datadog/browser-core';
import { LifeCycle } from './lifeCycle';
export declare const USER_ACTION_VALIDATION_DELAY = 100;
export declare const USER_ACTION_END_DELAY = 100;
export declare const USER_ACTION_MAX_DURATION = 10000;
export declare enum UserActionType {
CLICK = "click",
LOAD_VIEW = "load_view",
CUSTOM = "custom"

@@ -22,3 +18,3 @@ }

export interface AutoUserAction {
type: UserActionType.LOAD_VIEW | UserActionType.CLICK;
type: UserActionType.CLICK;
id: string;

@@ -39,16 +35,6 @@ name: string;

export declare function getUserActionReference(time?: number): UserActionReference | undefined;
export interface PageActivityEvent {
isBusy: boolean;
}
declare function trackPageActivities(lifeCycle: LifeCycle): {
observable: Observable<PageActivityEvent>;
stop(): void;
};
declare function waitUserActionCompletion(pageActivitiesObservable: Observable<PageActivityEvent>, completionCallback: (endTime: number | undefined) => void): void;
export declare const $$tests: {
newUserAction: typeof newUserAction;
trackPageActivities: typeof trackPageActivities;
resetUserAction(): void;
waitUserActionCompletion: typeof waitUserActionCompletion;
};
export {};

@@ -1,43 +0,14 @@

import { DOM_EVENT, generateUUID, monitor, Observable } from '@datadog/browser-core';
import { DOM_EVENT, generateUUID } from '@datadog/browser-core';
import { getElementContent } from './getElementContent';
import { LifeCycleEventType } from './lifeCycle';
import { trackEventCounts } from './trackEventCounts';
// Automatic user action collection lifecycle overview:
//
// (Start)
// .--------------'----------------------.
// v v
// [Wait for a page activity ] [Wait for a maximum duration]
// [timeout: VALIDATION_DELAY] [ timeout: MAX_DURATION ]
// / \ |
// v v |
// [No page activity] [Page activity] |
// | |,----------------------. |
// v v | |
// (Discard) [Wait for a page activity] | |
// [ timeout: END_DELAY ] | |
// / \ | |
// v v | |
// [No page activity] [Page activity] | |
// | | | |
// | '------------' |
// '-----------. ,--------------------'
// v
// (End)
//
// Note: because MAX_DURATION > VALIDATION_DELAY, we are sure that if the user action is still alive
// after MAX_DURATION, it has been validated.
// Delay to wait for a page activity to validate the user action
export var USER_ACTION_VALIDATION_DELAY = 100;
// Delay to wait after a page activity to end the user action
export var USER_ACTION_END_DELAY = 100;
// Maximum duration of a user action
export var USER_ACTION_MAX_DURATION = 10000;
import { waitIdlePageActivity } from './trackPageActivities';
export var UserActionType;
(function (UserActionType) {
UserActionType["CLICK"] = "click";
UserActionType["LOAD_VIEW"] = "load_view";
UserActionType["CUSTOM"] = "custom";
})(UserActionType || (UserActionType = {}));
var pendingAutoUserAction;
export function startUserActionCollection(lifeCycle) {
addEventListener(DOM_EVENT.CLICK, processClick, { capture: true });
function processClick(event) {

@@ -49,5 +20,13 @@ if (!(event.target instanceof Element)) {

}
addEventListener(DOM_EVENT.CLICK, processClick, { capture: true });
// New views trigger the cancellation of the current pending User Action
lifeCycle.subscribe(LifeCycleEventType.VIEW_COLLECTED, function () {
if (pendingAutoUserAction) {
pendingAutoUserAction.stop();
}
});
return {
stop: function () {
if (pendingAutoUserAction) {
pendingAutoUserAction.stop();
}
removeEventListener(DOM_EVENT.CLICK, processClick, { capture: true });

@@ -57,6 +36,5 @@ },

}
var currentUserAction;
function newUserAction(lifeCycle, type, name) {
if (currentUserAction) {
// Discard any new user action if another one is already occuring.
if (pendingAutoUserAction) {
// Discard any new user action if another one is already occurring.
return;

@@ -66,9 +44,5 @@ }

var startTime = performance.now();
currentUserAction = { id: id, startTime: startTime };
var _a = trackPageActivities(lifeCycle), pageActivitiesObservable = _a.observable, stopPageActivitiesTracking = _a.stop;
var _b = trackEventCounts(lifeCycle), eventCounts = _b.eventCounts, stopEventCountsTracking = _b.stop;
waitUserActionCompletion(pageActivitiesObservable, function (endTime) {
stopPageActivitiesTracking();
stopEventCountsTracking();
if (endTime !== undefined) {
var _a = trackEventCounts(lifeCycle), eventCounts = _a.eventCounts, stopEventCountsTracking = _a.stop;
var stopWaitIdlePageActivity = waitIdlePageActivity(lifeCycle, function (hadActivity, endTime) {
if (hadActivity) {
lifeCycle.notify(LifeCycleEventType.USER_ACTION_COLLECTED, {

@@ -87,81 +61,27 @@ id: id,

}
});
}
export function getUserActionReference(time) {
if (!currentUserAction || (time !== undefined && time < currentUserAction.startTime)) {
return undefined;
}
return { id: currentUserAction.id };
}
function trackPageActivities(lifeCycle) {
var observable = new Observable();
var subscriptions = [];
var firstRequestId;
var pendingRequestsCount = 0;
subscriptions.push(lifeCycle.subscribe(LifeCycleEventType.DOM_MUTATED, function () { return notifyPageActivity(); }));
subscriptions.push(lifeCycle.subscribe(LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, function (entry) {
if (entry.entryType !== 'resource') {
return;
}
notifyPageActivity();
}));
subscriptions.push(lifeCycle.subscribe(LifeCycleEventType.REQUEST_STARTED, function (startEvent) {
if (firstRequestId === undefined) {
firstRequestId = startEvent.requestId;
}
pendingRequestsCount += 1;
notifyPageActivity();
}));
subscriptions.push(lifeCycle.subscribe(LifeCycleEventType.REQUEST_COMPLETED, function (request) {
// If the request started before the tracking start, ignore it
if (firstRequestId === undefined || request.requestId < firstRequestId) {
return;
}
pendingRequestsCount -= 1;
notifyPageActivity();
}));
function notifyPageActivity() {
observable.notify({ isBusy: pendingRequestsCount > 0 });
}
return {
observable: observable,
stopEventCountsTracking();
pendingAutoUserAction = undefined;
}).stop;
pendingAutoUserAction = {
id: id,
startTime: startTime,
stop: function () {
subscriptions.forEach(function (s) { return s.unsubscribe(); });
stopEventCountsTracking();
stopWaitIdlePageActivity();
pendingAutoUserAction = undefined;
},
};
}
function waitUserActionCompletion(pageActivitiesObservable, completionCallback) {
var idleTimeoutId;
var hasCompleted = false;
var validationTimeoutId = setTimeout(monitor(function () { return complete(undefined); }), USER_ACTION_VALIDATION_DELAY);
var maxDurationTimeoutId = setTimeout(monitor(function () { return complete(performance.now()); }), USER_ACTION_MAX_DURATION);
pageActivitiesObservable.subscribe(function (_a) {
var isBusy = _a.isBusy;
clearTimeout(validationTimeoutId);
clearTimeout(idleTimeoutId);
var lastChangeTime = performance.now();
if (!isBusy) {
idleTimeoutId = setTimeout(monitor(function () { return complete(lastChangeTime); }), USER_ACTION_END_DELAY);
}
});
function complete(endTime) {
if (hasCompleted) {
return;
}
hasCompleted = true;
clearTimeout(validationTimeoutId);
clearTimeout(idleTimeoutId);
clearTimeout(maxDurationTimeoutId);
currentUserAction = undefined;
completionCallback(endTime);
export function getUserActionReference(time) {
if (!pendingAutoUserAction || (time !== undefined && time < pendingAutoUserAction.startTime)) {
return undefined;
}
return { id: pendingAutoUserAction.id };
}
export var $$tests = {
newUserAction: newUserAction,
trackPageActivities: trackPageActivities,
resetUserAction: function () {
currentUserAction = undefined;
pendingAutoUserAction = undefined;
},
waitUserActionCompletion: waitUserActionCompletion,
};
//# sourceMappingURL=userActionCollection.js.map

@@ -10,2 +10,4 @@ import { LifeCycle } from './lifeCycle';

duration: number;
loadingTime?: number | undefined;
loadingType: ViewLoadingType;
}

@@ -23,2 +25,6 @@ export interface ViewMeasures {

}
export declare enum ViewLoadingType {
INITIAL_LOAD = "initial_load",
ROUTE_CHANGE = "route_change"
}
export declare const THROTTLE_VIEW_UPDATE_PERIOD = 3000;

@@ -25,0 +31,0 @@ export declare function startViewCollection(location: Location, lifeCycle: LifeCycle, session: RumSession): void;

import { __assign } from "tslib";
import { DOM_EVENT, generateUUID, monitor, msToNs, throttle } from '@datadog/browser-core';
import { DOM_EVENT, generateUUID, monitor, msToNs, noop, throttle } from '@datadog/browser-core';
import { LifeCycleEventType } from './lifeCycle';
import { trackEventCounts } from './trackEventCounts';
import { waitIdlePageActivity } from './trackPageActivities';
export var ViewLoadingType;
(function (ViewLoadingType) {
ViewLoadingType["INITIAL_LOAD"] = "initial_load";
ViewLoadingType["ROUTE_CHANGE"] = "route_change";
})(ViewLoadingType || (ViewLoadingType = {}));
export var THROTTLE_VIEW_UPDATE_PERIOD = 3000;

@@ -9,3 +15,3 @@ export function startViewCollection(location, lifeCycle, session) {

var startOrigin = 0;
var currentView = newView(lifeCycle, currentLocation, session, startOrigin);
var currentView = newView(lifeCycle, currentLocation, session, ViewLoadingType.INITIAL_LOAD, startOrigin);
// Renew view on history changes

@@ -16,3 +22,3 @@ trackHistory(function () {

currentView.end();
currentView = newView(lifeCycle, currentLocation, session);
currentView = newView(lifeCycle, currentLocation, session, ViewLoadingType.ROUTE_CHANGE);
}

@@ -23,3 +29,3 @@ });

currentView.end();
currentView = newView(lifeCycle, currentLocation, session);
currentView = newView(lifeCycle, currentLocation, session, ViewLoadingType.ROUTE_CHANGE);
});

@@ -32,3 +38,3 @@ // End the current view on page unload

export var viewContext;
function newView(lifeCycle, location, session, startOrigin) {
function newView(lifeCycle, location, session, loadingType, startOrigin) {
if (startOrigin === void 0) { startOrigin = performance.now(); }

@@ -44,2 +50,3 @@ // Setup initial values

var documentVersion = 0;
var loadingTime;
viewContext = { id: id, location: location, sessionId: session.getId() };

@@ -56,2 +63,7 @@ // Update the view every time the measures are changing

var stopEventCountsTracking = trackEventCounts(lifeCycle, updateMeasures).stop;
function updateLoadingTime(loadingTimeValue) {
loadingTime = loadingTimeValue;
scheduleViewUpdate();
}
var stopLoadingTimeTracking = trackLoadingTime(lifeCycle, loadingType, updateLoadingTime).stop;
// Initial view update

@@ -64,2 +76,4 @@ updateView();

id: id,
loadingTime: loadingTime,
loadingType: loadingType,
location: location,

@@ -75,2 +89,3 @@ measures: measures,

stopEventCountsTracking();
stopLoadingTimeTracking();
// prevent pending view updates execution

@@ -115,2 +130,48 @@ stopScheduleViewUpdate();

}
function trackLoadingTime(lifeCycle, loadingType, callback) {
var expectedTiming = 1;
var receivedTimings = [];
var stopLoadEventLoadingTime = noop;
if (loadingType === ViewLoadingType.INITIAL_LOAD) {
expectedTiming += 1;
(stopLoadEventLoadingTime = trackLoadEventLoadingTime(lifeCycle, onTimingValue).stop);
}
var stopActivityLoadingTimeTracking = trackActivityLoadingTime(lifeCycle, onTimingValue).stop;
function onTimingValue(timingValue) {
expectedTiming -= 1;
if (timingValue) {
receivedTimings.push(timingValue);
}
if (expectedTiming === 0 && receivedTimings.length) {
callback(Math.max.apply(Math, receivedTimings));
}
}
return {
stop: function () {
stopActivityLoadingTimeTracking();
stopLoadEventLoadingTime();
},
};
}
function trackLoadEventLoadingTime(lifeCycle, callback) {
var stopPerformanceTracking = lifeCycle.subscribe(LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, function (entry) {
if (entry.entryType === 'navigation') {
var navigationEntry = entry;
callback(navigationEntry.loadEventEnd);
}
}).unsubscribe;
return { stop: stopPerformanceTracking };
}
function trackActivityLoadingTime(lifeCycle, callback) {
var startTime = performance.now();
var stopWaitIdlePageActivity = waitIdlePageActivity(lifeCycle, function (hadActivity, endTime) {
if (hadActivity) {
callback(endTime - startTime);
}
else {
callback(undefined);
}
}).stop;
return { stop: stopWaitIdlePageActivity };
}
//# sourceMappingURL=viewCollection.js.map
{
"name": "@datadog/browser-rum",
"version": "1.11.5",
"version": "1.11.6",
"license": "Apache-2.0",

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

"dependencies": {
"@datadog/browser-core": "1.11.5",
"@datadog/browser-core": "1.11.6",
"lodash.assign": "4.2.0",

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

},
"gitHead": "78bca239857afdb3d860574bb399bfc4caf832ba"
"gitHead": "2e24db5c62f408d9f08344745368b29b1768fcc0"
}

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