Socket
Socket
Sign inDemoInstall

@datadog/browser-rum

Package Overview
Dependencies
Maintainers
1
Versions
255
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datadog/browser-rum - npm Package Compare versions

Comparing version 2.10.0 to 2.11.1

2

bundle/datadog-rum.js

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

!function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function e(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}function n(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r}var r={log:console.log.bind(console),warn:console.warn.bind(console),error:console.error.bind(console)},i=function(t){return Array.isArray(t)},o=function(t){return!Array.isArray(t)&&"object"==typeof t&&null!==t};function a(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];null!=o&&(t=c(t,o,s()))}return t}function u(t){return c(void 0,t,s())}function s(){if("undefined"!=typeof WeakSet){var t=new WeakSet;return{hasAlreadyBeenSeen:function(e){var n=t.has(e);return n||t.add(e),n}}}var e=[];return{hasAlreadyBeenSeen:function(t){var n=e.indexOf(t)>=0;return n||e.push(t),n}}}function c(t,e,n){if(void 0===e)return t;if(!o(e)&&!i(e))return e;if(!n.hasAlreadyBeenSeen(e)){if(o(e)&&(void 0===t||o(t))){var r=t||{};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=c(r[a],e[a],n));return r}if(i(e)&&(void 0===t||i(t))){(r=t||[]).length=Math.max(r.length,e.length);for(var u=0;u<e.length;u+=1)r[u]=c(r[u],e[u],n);return r}return e}}var f="agent",d="console",l="custom",p="network",v="source";function m(t,e,n){return t&&(void 0!==t.message||e instanceof Error)?{message:t.message||"Empty message",stack:h(t),type:t.name}:{message:n+" "+ct(e),stack:"No stack, consider using an instance of Error",type:t&&t.name}}function h(t){var e=E(t);return t.stack.forEach((function(t){var n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?"("+t.args.join(", ")+")":"",i=t.line?":"+t.line:"",o=t.line&&t.column?":"+t.column:"";e+="\n at "+n+r+" @ "+t.url+i+o})),e}function E(t){return(t.name||"Error")+": "+t.message}var g=/[^\u0000-\u007F]/,T=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)try{if(navigator.sendBeacon(n,t))return}catch(t){!function(t){y||(y=!0,Y(t))}(t)}var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(t)},t}();var y=!1;var b=function(){function t(t,e,n,r,i,o){void 0===o&&(o=st),this.request=t,this.maxSize=e,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=i,this.beforeUnloadCallback=o,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),this.flushPeriodically()}return 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=n(this.pushOnlyBuffer,(e=this.upsertBuffer,r=[],Object.keys(e).forEach((function(t){r.push(e[t])})),r));this.request.send(t.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var e,r},t.prototype.sizeInBytes=function(t){return g.test(t)?void 0!==window.TextEncoder?(new TextEncoder).encode(t).length:new Blob([t]).size:t.length},t.prototype.addOrUpdate=function(t,e){var n=this.process(t),i=n.processedMessage,o=n.messageBytesSize;o>=this.maxMessageSize?r.warn("Discarded a message whose size was bigger than the maximum allowed size "+this.maxMessageSize+"KB."):(this.hasMessageFor(e)&&this.remove(e),this.willReachedBytesLimitWith(o)&&this.flush(),this.push(i,o,e),this.isFull()&&this.flush())},t.prototype.process=function(t){var e=ct(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.flushPeriodically=function(){var t=this;setTimeout(K((function(){t.flush(),t.flushPeriodically()})),this.flushTimeout)},t.prototype.flushOnVisibilityHidden=function(){var t=this;navigator.sendBeacon&&(gt(window,"beforeunload",this.beforeUnloadCallback),gt(document,"visibilitychange",(function(){"hidden"===document.visibilityState&&t.flush()})),gt(window,"beforeunload",(function(){return t.flush()})))},t}(),C=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function R(t){if(S){if(_===t)return;N()}var e=U(t);throw S=e,_=t,setTimeout(K((function(){_===t&&N()})),e.incomplete?2e3:0),t}var _,S,O,w,A,I=[];function D(t){!function(){if(w)return;O=window.onerror,window.onerror=K(x),w=!0}(),function(){if(A)return;null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=K(L),A=!0}(),I.push(t)}function k(t,e,n){var r;if(I.forEach((function(i){try{i(t,e,n)}catch(t){r=t}})),r)throw r}function x(t,e,n,r,i){if(S)H(S,e,n),N();else if(i)k(U(i),!0,i);else{var o,a={url:e,column:r,line:n},u=t;if("[object String]"==={}.toString.call(t)){var s=C.exec(u);s&&(o=s[1],u=s[2])}k({name:o,message:"string"==typeof u?u:void 0,stack:[a]},!0,t)}return!!O&&O.apply(this,arguments)}function L(t){var e=t.reason||"Empty reason";k(U(e),!0,e)}function N(){var t=S,e=_;S=void 0,_=void 0,k(t,!1,e)}var M="?";function U(t,e){var n,r=void 0===e?0:+e;try{if(n=function(t){var e=V(t,"stacktrace");if(!e)return;for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=e.split("\n"),a=[],u=0;u<o.length;u+=2){var s=void 0;r.exec(o[u])?s={args:[],column:void 0,func:(n=r.exec(o[u]))[3],line:+n[1],url:n[2]}:i.exec(o[u])&&(s={args:(n=i.exec(o[u]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),s&&(!s.func&&s.line&&(s.func=M),s.context=[o[u+1]],a.push(s))}if(!a.length)return;return{stack:a,message:V(t,"message"),name:V(t,"name")}}(t))return n}catch(t){if(B)throw t}try{if(n=function(t){var e=V(t,"stack");if(!e)return;for(var n,r,i,o,a=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,s=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,f=/\((\S*)(?::(\d+))(?::(\d+))\)/,d=e.split("\n"),l=[],p=0,v=d.length;p<v;p+=1){if(a.exec(d[p])){var m=(i=a.exec(d[p]))[2]&&0===i[2].indexOf("native");n=i[2]&&0===i[2].indexOf("eval"),r=f.exec(i[2]),n&&r&&(i[2]=r[1],i[3]=r[2],i[4]=r[3]),o={args:m?[i[2]]:[],column:i[4]?+i[4]:void 0,func:i[1]||M,line:i[3]?+i[3]:void 0,url:m?void 0:i[2]}}else if(s.exec(d[p]))o={args:[],column:(i=s.exec(d[p]))[4]?+i[4]:void 0,func:i[1]||M,line:+i[3],url:i[2]};else{if(!u.exec(d[p]))continue;n=(i=u.exec(d[p]))[3]&&i[3].indexOf(" > eval")>-1,r=c.exec(i[3]),n&&r?(i[3]=r[1],i[4]=r[2],i[5]=void 0):0!==p||i[5]||q(t.columnNumber)||(l[0].column=t.columnNumber+1),o={args:i[2]?i[2].split(","):[],column:i[5]?+i[5]:void 0,func:i[1]||M,line:i[4]?+i[4]:void 0,url:i[3]}}!o.func&&o.line&&(o.func=M),l.push(o)}if(!l.length)return;return{stack:l,message:V(t,"message"),name:V(t,"name")}}(t))return n}catch(t){if(B)throw t}try{if(n=function(t){var e=V(t,"message");if(!e)return;var n=e.split("\n");if(n.length<4)return;var r,i=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,o=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,a=/^\s*Line (\d+) of function script\s*$/i,u=[],s=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var f in s)j(s,f)&&!s[f].src&&c.push(s[f]);for(var d=2;d<n.length;d+=2){var l=void 0;if(i.exec(n[d]))l={args:[],column:void 0,func:(r=i.exec(n[d]))[3],line:+r[1],url:r[2]};else if(o.exec(n[d]))l={args:[],column:void 0,func:(r=o.exec(n[d]))[4],line:+r[1],url:r[3]};else if(a.exec(n[d])){r=a.exec(n[d]),l={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+r[1]}}l&&(l.func||(l.func=M),l.context=[n[d+1]],u.push(l))}if(!u.length)return;return{stack:u,message:n[0],name:V(t,"name")}}(t))return n}catch(t){if(B)throw t}try{if(n=W(t,r+1))return n}catch(t){if(B)throw t}return{message:V(t,"message"),name:V(t,"name"),stack:[]}}var P,B=!1;function H(t,e,n){var r={url:e,line:n?+n:void 0};if(r.url&&r.line){t.incomplete=!1;var i=t.stack;if(i.length>0&&i[0].url===r.url){if(i[0].line===r.line)return!1;if(!i[0].line&&i[0].func===r.func)return i[0].line=r.line,i[0].context=r.context,!1}return i.unshift(r),t.partial=!0,!0}return t.incomplete=!0,!1}function W(t,e){for(var n,r,i=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,o=[],a={},u=!1,s=W.caller;s&&!u;s=s.caller)s!==U&&s!==R&&(r={args:[],column:void 0,func:M,line:void 0,url:void 0},n=i.exec(s.toString()),s.name?r.func=s.name:n&&(r.func=n[1]),void 0===r.func&&(r.func=n?n.input.substring(0,n.input.indexOf("{")):void 0),a[s.toString()]?u=!0:a[s.toString()]=!0,o.push(r));e&&o.splice(0,e);var c={stack:o,message:V(t,"message"),name:V(t,"name")};return H(c,V(t,"sourceURL")||V(t,"fileName"),V(t,"line")||V(t,"lineNumber")),c}function V(t,e){if("object"==typeof t&&t&&e in t){var n=t[e];return"string"==typeof n?n:void 0}}function j(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function q(t){return void 0===t}!function(t){t.info="info",t.error="error"}(P||(P={}));var F,z={maxMessagesPerPage:0,sentMessageCount:0};function G(t){if(t.internalMonitoringEndpoint){var e=function(t){var e,n=r(t.internalMonitoringEndpoint);void 0!==t.replica&&(e=r(t.replica.internalMonitoringEndpoint));function r(e){return new b(new T(e,t.batchBytesLimit),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout)}function i(t){return a({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==F?F():{},t)}return{add:function(t){var r=i(t);n.add(r),e&&e.add(r)}}}(t);!function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];e.forEach((function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}))}(z,{batch:e,maxMessagesPerPage:t.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(t){F=t}}}function K(t){return function(){return $(t,this,arguments)}}function $(t,e,n){try{return t.apply(e,n)}catch(t){Z(t);try{Y(t)}catch(t){Z(t)}}}function X(e,n){!function(t){z.debugMode&&r.log("[MONITORING MESSAGE]",t)}(e),J(t(t({message:e},n),{status:P.info}))}function Y(e){J(t(t({},function(t){if(t instanceof Error){var e=U(t);return{error:{kind:e.name,stack:h(e)},message:e.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+ct(t)}}(e)),{status:P.error}))}function J(t){z.batch&&z.sentMessageCount<z.maxMessagesPerPage&&(z.sentMessageCount+=1,z.batch.add(t))}function Q(t){z.debugMode=t}function Z(t){z.debugMode&&r.error("[INTERNAL ERROR]",t)}var tt,et,nt=1e3,rt=6e4;function it(t,e,n){var r,i,o=!n||void 0===n.leading||n.leading,a=!n||void 0===n.trailing||n.trailing,u=!1;return{throttled:function(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];u?r=n:(o?t.apply(void 0,n):r=n,u=!0,i=setTimeout((function(){a&&r&&t.apply(void 0,r),u=!1,r=void 0}),e))},cancel:function(){clearTimeout(i),u=!1,r=void 0}}}function ot(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,ot)}function at(t){return 0!==t&&100*Math.random()<=t}function ut(t,e){return+t.toFixed(e)}function st(){}function ct(t,e,n){if(null==t)return JSON.stringify(t);var r=[!1,void 0];ft(t)&&(r=[!0,t.toJSON],delete t.toJSON);var i,o,a=[!1,void 0];"object"==typeof t&&ft(i=Object.getPrototypeOf(t))&&(a=[!0,i.toJSON],delete i.toJSON);try{o=JSON.stringify(t,e,n)}catch(t){o="<error: unable to serialize object>"}finally{r[0]&&(t.toJSON=r[1]),a[0]&&(i.toJSON=a[1])}return o}function ft(t){return"object"==typeof t&&null!==t&&t.hasOwnProperty("toJSON")}function dt(t,e){return-1!==t.indexOf(e)}function lt(t){return pt(t)&&t>=0&&t<=100}function pt(t){return"number"==typeof t}function vt(t){return Object.keys(t).map((function(e){return[e,t[e]]}))}function mt(t){return 0===Object.keys(t).length}function ht(t){if(t.origin)return t.origin;var e=t.host.replace(/(:80|:443)$/,"");return t.protocol+"//"+e}function Et(t,e){var n=new RegExp("(?:^|;)\\s*"+e+"\\s*=\\s*([^;]+)").exec(t);return n?n[1]:void 0}function gt(t,e,n,r){return Tt(t,[e],n,r)}function Tt(t,e,n,r){var i=void 0===r?{}:r,o=i.once,a=i.capture,u=i.passive,s=K(o?function(t){f(),n(t)}:n),c=u?{capture:a,passive:u}:a;e.forEach((function(e){return t.addEventListener(e,s,c)}));var f=function(){return e.forEach((function(e){return t.removeEventListener(e,s,c)}))};return{stop:f}}function yt(t,e){document.readyState===t||"complete"===document.readyState?e():gt(window,"complete"===t?"load":"DOMContentLoaded",e,{once:!0})}!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"}(tt||(tt={})),function(t){t.FETCH="fetch",t.XHR="xhr"}(et||(et={}));var bt,Ct;function Rt(t,e,n,r){var i=new Date;i.setTime(i.getTime()+n);var o="expires="+i.toUTCString(),a=r&&r.crossSite?"none":"strict",u=r&&r.domain?";domain="+r.domain:"",s=r&&r.secure?";secure":"";document.cookie=t+"="+e+";"+o+";path=/;samesite="+a+u+s}function _t(t){return Et(document.cookie,t)}function St(t,e){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];try{return t.apply(void 0,n)}catch(t){r.error(e,t)}}}var Ot={alternate:{logs:"logs",rum:"rum",sessionReplay:"session-replay",trace:"trace"},classic:{logs:"browser",rum:"rum",sessionReplay:void 0,trace:"public-trace"}},wt="eu",At="us",It=((Ct={})[wt]="datadoghq.eu",Ct[At]="datadoghq.com",Ct),Dt=[It[At],It[wt]];function kt(e,n){var r={buildMode:n.buildMode,clientToken:e.clientToken,env:e.env,proxyHost:e.proxyHost,sdkVersion:n.sdkVersion,service:e.service,site:e.site||It[e.datacenter||n.datacenter],version:e.version},i=function(t,e){return!e.useAlternateIntakeDomains&&dt(Dt,t)?"classic":"alternate"}(r.site,e),o=function(t,e,n){if(e.proxyHost)return["https://"+e.proxyHost+"/v1/input/"];var r=[e.site];e.buildMode===Nt.STAGING&&n&&r.push(It[At]);for(var i=[],o=Object.keys(Ot[t]),a=0,u=r;a<u.length;a++)for(var s=u[a],c=0,f=o;c<f.length;c++){var d=f[c];i.push("https://"+xt(t,d,s)+"/v1/input/")}return i}(i,r,void 0!==e.replica),a={isIntakeUrl:function(t){return o.some((function(e){return 0===t.indexOf(e)}))},logsEndpoint:Lt(i,"logs",r),rumEndpoint:Lt(i,"rum",r),sessionReplayEndpoint:Lt(i,"sessionReplay",r),traceEndpoint:Lt(i,"trace",r)};if(e.internalMonitoringApiKey&&(a.internalMonitoringEndpoint=Lt(i,"logs",r,"browser-agent-internal-monitoring")),r.buildMode===Nt.E2E_TEST&&(a.internalMonitoringEndpoint="<<< E2E INTERNAL MONITORING ENDPOINT >>>",a.logsEndpoint="<<< E2E LOGS ENDPOINT >>>",a.rumEndpoint="<<< E2E RUM ENDPOINT >>>",a.sessionReplayEndpoint="<<< E2E SESSION REPLAY ENDPOINT >>>"),r.buildMode===Nt.STAGING&&void 0!==e.replica){var u=t(t({},r),{applicationId:e.replica.applicationId,clientToken:e.replica.clientToken,site:It[At]});a.replica={applicationId:e.replica.applicationId,internalMonitoringEndpoint:Lt(i,"logs",u,"browser-agent-internal-monitoring"),logsEndpoint:Lt(i,"logs",u),rumEndpoint:Lt(i,"rum",u)}}return a}function xt(t,e,n){return"classic"===t&&function(t,e){var n=Ot.classic[t];return n&&n+"-http-intake.logs."+e}(e,n)||function(t,e){var n=Ot.alternate[t],r=e.split("."),i=r.pop(),o=r.join("-")+"."+i;return n+".browser-intake-"+o}(e,n)}function Lt(t,e,n,r){var i="sdk_version:"+n.sdkVersion+(n.env?",env:"+n.env:"")+(n.service?",service:"+n.service:"")+(n.version?",version:"+n.version:""),o=xt(t,e,n.site),a=n.proxyHost?n.proxyHost:o,u=(n.proxyHost?"ddhost="+o+"&":"")+"ddsource="+(r||"browser")+"&ddtags="+encodeURIComponent(i);return"https://"+a+"/v1/input/"+n.clientToken+"?"+u}var Nt,Mt={allowedTracingOrigins:[],maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,trackInteractions:!1,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function Ut(t){var e={};return e.secure=function(t){return!!t.useSecureSessionCookie||!!t.useCrossSiteSessionCookie}(t),e.crossSite=!!t.useCrossSiteSessionCookie,t.trackSessionAcrossSubdomains&&(e.domain=function(){if(void 0===bt){for(var t="dd_site_test_"+ot(),e=window.location.hostname.split("."),n=e.pop();e.length&&!_t(t);)n=e.pop()+"."+n,Rt(t,"test",nt,{domain:n});bt=n}return bt}()),e}function Pt(e,n){var r=function(e,n){var r=Array.isArray(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],i=t(t({beforeSend:e.beforeSend&&St(e.beforeSend,"beforeSend threw an error:"),cookieOptions:Ut(e),isEnabled:function(t){return dt(r,t)},service:e.service},kt(e,n)),Mt);return"allowedTracingOrigins"in e&&(i.allowedTracingOrigins=e.allowedTracingOrigins),"sampleRate"in e&&(i.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(i.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(i.trackInteractions=!!e.trackInteractions),i}(e,n);return{configuration:r,internalMonitoring:G(r)}}function Bt(t){return!!function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{var e="dd_cookie_test_"+ot(),n="test";return Rt(e,n,nt,t),_t(e)===n}catch(t){return r.error(t),!1}}(t)||(r.warn("Cookies are not authorized, we will not send any data."),!1)}function Ht(){return"file:"!==window.location.protocol||(r.error("Execution is not allowed in the current context."),!1)}!function(t){t.RELEASE="release",t.STAGING="staging",t.E2E_TEST="e2e-test"}(Nt||(Nt={}));var Wt,Vt,jt,qt,Ft,zt=function(){function t(t){void 0===t&&(t=1e4),this.limit=t,this.buffer=[]}return t.prototype.add=function(t){this.buffer.push(t)>this.limit&&this.buffer.splice(0,1)},t.prototype.drain=function(t){this.buffer.forEach((function(e){return t(e)})),this.buffer.length=0},t}();function Gt(t){return{relative:t,timeStamp:Kt(t)}}function Kt(t){var e=Date.now()-performance.now();return e>Zt()?Math.round(e+t):function(t){return Math.round(Zt()+t)}(t)}function $t(t){return pt(t)?ut(1e6*t,0):t}function Xt(){return Date.now()}function Yt(){return performance.now()}function Jt(){return{relative:Yt(),timeStamp:Xt()}}function Qt(t,e){return e-t}function Zt(){return void 0===Wt&&(Wt=performance.timing.navigationStart),Wt}!function(t){t.ACTION="action",t.ERROR="error",t.LONG_TASK="long_task",t.VIEW="view",t.RESOURCE="resource"}(Vt||(Vt={})),function(t){t.INITIAL_LOAD="initial_load",t.ROUTE_CHANGE="route_change"}(jt||(jt={})),function(t){t.CLICK="click",t.CUSTOM="custom"}(qt||(qt={})),function(t){t[t.PERFORMANCE_ENTRY_COLLECTED=0]="PERFORMANCE_ENTRY_COLLECTED",t[t.AUTO_ACTION_CREATED=1]="AUTO_ACTION_CREATED",t[t.AUTO_ACTION_COMPLETED=2]="AUTO_ACTION_COMPLETED",t[t.AUTO_ACTION_DISCARDED=3]="AUTO_ACTION_DISCARDED",t[t.VIEW_CREATED=4]="VIEW_CREATED",t[t.VIEW_UPDATED=5]="VIEW_UPDATED",t[t.VIEW_ENDED=6]="VIEW_ENDED",t[t.REQUEST_STARTED=7]="REQUEST_STARTED",t[t.REQUEST_COMPLETED=8]="REQUEST_COMPLETED",t[t.SESSION_RENEWED=9]="SESSION_RENEWED",t[t.DOM_MUTATED=10]="DOM_MUTATED",t[t.BEFORE_UNLOAD=11]="BEFORE_UNLOAD",t[t.RAW_RUM_EVENT_COLLECTED=12]="RAW_RUM_EVENT_COLLECTED",t[t.RUM_EVENT_COLLECTED=13]="RUM_EVENT_COLLECTED",t[t.RECORD_STARTED=14]="RECORD_STARTED",t[t.RECORD_STOPPED=15]="RECORD_STOPPED",t[t.RAW_ERROR_COLLECTED=16]="RAW_ERROR_COLLECTED"}(Ft||(Ft={}));var te,ee=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 ne(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(K((function(){t.notify(Ft.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){e&&e.disconnect()}}}function re(t){return oe(t,ht(window.location)).href}function ie(t){return ht(oe(t))}function oe(t,e){if(function(){if(void 0!==te)return te;try{var t=new URL("http://test/path");return te="http://test/path"===t.href}catch(t){te=!1}return te}())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 i=(n=document.implementation.createHTMLDocument("")).createElement("base");i.href=e,n.head.appendChild(i),n.body.appendChild(r)}return r.href=t,r}var ae="initial_document",ue=[[tt.DOCUMENT,function(t){return ae===t}],[tt.XHR,function(t){return"xmlhttprequest"===t}],[tt.FETCH,function(t){return"fetch"===t}],[tt.BEACON,function(t){return"beacon"===t}],[tt.CSS,function(t,e){return/\.css$/i.test(e)}],[tt.JS,function(t,e){return/\.js$/i.test(e)}],[tt.IMAGE,function(t,e){return dt(["image","img","icon"],t)||null!==/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(e)}],[tt.FONT,function(t,e){return null!==/\.(woff|eot|woff2|ttf)$/i.exec(e)}],[tt.MEDIA,function(t,e){return dt(["audio","video"],t)||null!==/\.(mp3|mp4)$/i.exec(e)}]];function se(t){var e=t.name;if(!function(t){try{return!!oe(t)}catch(t){return!1}}(e))return X('Failed to construct URL for "'+t.name+'"'),tt.OTHER;for(var n=function(t){var e=oe(t).pathname;return"/"===e[0]?e:"/"+e}(e),r=0,i=ue;r<i.length;r++){var o=i[r],a=o[0];if((0,o[1])(t.initiatorType,n))return a}return tt.OTHER}function ce(){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 fe(t){var e=de(t);if(e){var n=e.startTime,r=e.fetchStart,i=e.redirectStart,o=e.redirectEnd,a=e.domainLookupStart,u=e.domainLookupEnd,s=e.connectStart,c=e.secureConnectionStart,f=e.connectEnd,d=e.requestStart,l=e.responseStart,p={download:pe(n,l,e.responseEnd),first_byte:pe(n,d,l)};return f!==r&&(p.connect=pe(n,s,f),ce(s,c,f)&&(p.ssl=pe(n,c,f))),u!==r&&(p.dns=pe(n,a,u)),le(t)&&(p.redirect=pe(n,i,o)),p}}function de(e){if(ce(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd)){if(!le(e))return e;var n=e.redirectStart,r=e.redirectEnd;if(n<e.startTime&&(n=e.startTime),r<e.startTime&&(r=e.fetchStart),ce(e.startTime,n,r,e.fetchStart))return t(t({},e),{redirectEnd:r,redirectStart:n})}}function le(t){return t.fetchStart!==t.startTime}function pe(t,e,n){return{duration:$t(Qt(e,n)),start:$t(Qt(t,e))}}function ve(t){if(t.startTime<t.responseStart)return t.decodedBodySize}function me(t,e){return e&&!t.isIntakeUrl(e)}var he;function Ee(t){var e=function(t){var e=t.querySelector("meta[name=dd-trace-id]"),n=t.querySelector("meta[name=dd-trace-time]");return ge(e&&e.content,n&&n.content)}(t)||function(t){var e=function(t){for(var e=0;e<t.childNodes.length;e+=1){if(n=Te(t.childNodes[e]))return n}if(t.body)for(e=t.body.childNodes.length-1;e>=0;e-=1){var n,r=t.body.childNodes[e];if(n=Te(r))return n;if(!ye(r))break}}(t);if(!e)return;return ge(Et(e,"trace-id"),Et(e,"trace-time"))}(t);if(e&&!(e.traceTime<=Date.now()-12e4))return e.traceId}function ge(t,e){var n=e&&Number(e);if(t&&n)return{traceId:t,traceTime:n}}function Te(t){if(t&&function(t){return"#comment"===t.nodeName}(t)){var e=/^\s*DATADOG;(.*?)\s*$/.exec(t.data);if(e)return e[1]}}function ye(t){return"#text"===t.nodeName}function be(){return void 0!==window.performance&&"getEntries"in performance}function Ce(t){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes(t)}function Re(e,n){var r;if(r=function(t){Oe(e,n,t)},yt("interactive",(function(){var e,n={entryType:"resource",initiatorType:ae,traceId:Ee(document)};if(Ce("navigation")&&performance.getEntriesByType("navigation").length>0){var i=performance.getEntriesByType("navigation")[0];e=t(t({},i.toJSON()),n)}else{var o=_e();e=t(t(t({},o),{decodedBodySize:0,duration:o.responseEnd,name:window.location.href,startTime:0}),n)}r(e)})),be()&&Se(e,n,performance.getEntries()),window.PerformanceObserver){new PerformanceObserver(K((function(t){return Se(e,n,t.getEntries())}))).observe({entryTypes:["resource","navigation","longtask","paint","largest-contentful-paint","first-input","layout-shift"]}),be()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}Ce("navigation")||function(e){function n(){e(t(t({},_e()),{entryType:"navigation"}))}yt("complete",(function(){setTimeout(K(n))}))}((function(t){Oe(e,n,t)})),Ce("first-input")||function(t){var e=Date.now(),n=!1,r=Tt(window,["click","mousedown","keydown","touchstart","pointerdown"],(function(t){if(t.cancelable){var e={entryType:"first-input",processingStart:Yt(),startTime:t.timeStamp};"pointerdown"===t.type?i(e):o(e)}}),{passive:!0,capture:!0}).stop;function i(t){Tt(window,["pointerup","pointercancel"],(function(e){"pointerup"===e.type&&o(t)}),{once:!0})}function o(i){if(!n){n=!0,r();var o=i.processingStart-i.startTime;o>=0&&o<Date.now()-e&&t(i)}}}((function(t){Oe(e,n,t)}))}function _e(){var t={},e=performance.timing;for(var n in e)if(pt(e[n])){var r=n,i=e[r];t[r]=0===i?0:i-Zt()}return t}function Se(t,e,n){n.forEach((function(n){"resource"!==n.entryType&&"navigation"!==n.entryType&&"paint"!==n.entryType&&"longtask"!==n.entryType&&"largest-contentful-paint"!==n.entryType&&"first-input"!==n.entryType&&"layout-shift"!==n.entryType||Oe(t,e,n)}))}function Oe(t,e,n){(function(t){return"navigation"===t.entryType&&t.loadEventEnd<=0})(n)||function(t,e){return"resource"===e.entryType&&!me(t,e.name)}(e,n)||t.notify(Ft.PERFORMANCE_ENTRY_COLLECTED,n)}function we(t,e,n){var r=u(t),i=n(r);return e.forEach((function(e){var n=Ae(t,e),i=Ae(r,e);"string"==typeof n&&"string"==typeof i&&function(t,e,n){for(var r=t,i=e.split("."),o=0;o<i.length;o+=1){var a=i[o];if(!Ie(r,a))return;o!==i.length-1?r=r[a]:r[a]=n}}(t,e,i)})),i}function Ae(t,e){for(var n=t,r=0,i=e.split(".");r<i.length;r++){var o=i[r];if(!Ie(n,o))return;n=n[o]}return n}function Ie(t,e){return"object"==typeof t&&null!==t&&e in t}!function(t){t.SYNTHETICS="synthetics",t.USER="user"}(he||(he={}));var De=["view.url","view.referrer","action.target.name","error.message","error.stack","error.resource.url","resource.url"];function ke(t,e,n,i,o,u){var s=function(t,e){var n=0,r=!1;return{isLimitReached:function(){if(0===n&&setTimeout((function(){n=0}),rt),(n+=1)<=t.maxErrorsByMinute||r)return r=!1,!1;if(n===t.maxErrorsByMinute+1){r=!0;try{e({message:"Reached max number of errors by minute: "+t.maxErrorsByMinute,source:f,startClocks:Jt()})}finally{r=!1}}return!0}}}(e,(function(t){n.notify(Ft.RAW_ERROR_COLLECTED,{error:t})}));n.subscribe(Ft.RAW_RUM_EVENT_COLLECTED,(function(c){var f,d=c.startTime,l=c.rawRumEvent,p=c.savedCommonContext,v=c.customerContext,m=o.findView(d);if(i.isTracked()&&m&&m.session.id===i.getId()){var h=o.findAction(d),E=p||u(),g={_dd:{format_version:2,drift:Math.round(Date.now()-(Zt()+performance.now()))},application:{id:t},date:Xt(),service:e.service,session:{type:void 0===window._DATADOG_SYNTHETICS_BROWSER?he.USER:he.SYNTHETICS}},T=(f=l,-1!==[Vt.ERROR,Vt.RESOURCE,Vt.LONG_TASK].indexOf(f.type)?a(g,m,h,l):a(g,m,l)),y=a(E.context,v);mt(y)||(T.context=y),"has_replay"in T.session||(T.session.has_replay=E.hasReplay),mt(E.user)||(T.usr=E.user),function(t,e,n){if(e){var i=we(t,De,e);if(!1===i&&t.type!==Vt.VIEW)return!1;!1===i&&r.warn("Can't dismiss view events using beforeSend!")}if(t.type===Vt.ERROR)return!n.isLimitReached();return!0}(T,e.beforeSend,s)&&n.notify(Ft.RUM_EVENT_COLLECTED,T)}}))}var xe=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}();var Le=9e5,Ne=144e5;function Me(t,e,n){var r=function(t,e){var n,r,i=!1,o=function(){i=!0,clearTimeout(n),n=setTimeout((function(){i=!1}),1e3)};return{get:function(){return i||(r=_t(t),o()),r},set:function(n,i){Rt(t,n,i,e),r=n,o()}}}("_dd_s",t);!function(t){var e=t.get(),n=_t("_dd"),r=_t("_dd_r"),i=_t("_dd_l");if(!e){var o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o.logs=i),r&&/^[012]$/.test(r)&&(o.rum=r),He(o,t)}}(r);var i=new xe,o=Be(r).id,a=it(K((function(){var t=Be(r),a=n(t[e]),u=a.trackingType,s=a.isTracked;t[e]=u,s&&!t.id&&(t.id=ot(),t.created=String(Date.now())),He(t,r),s&&o!==t.id&&(o=t.id,i.notify())})),1e3).throttled;return a(),function(t){var e=Tt(window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0}).stop;Ve.push(e)}(a),function(t){var e=K((function(){"visible"===document.visibilityState&&t()})),n=gt(document,"visibilitychange",e).stop;Ve.push(n);var r=setInterval(e,6e4);Ve.push((function(){clearInterval(r)}))}((function(){He(Be(r),r)})),{getId:function(){return Be(r).id},getTrackingType:function(){return Be(r)[e]},renewObservable:i}}var Ue=/^([a-z]+)=([a-z0-9-]+)$/,Pe="&";function Be(t){var e=function(t){var e=t.get(),n={};(function(t){return void 0!==t&&(-1!==t.indexOf("&")||Ue.test(t))})(e)&&e.split(Pe).forEach((function(t){var e=Ue.exec(t);if(null!==e){var r=e[1],i=e[2];n[r]=i}}));return n}(t);return function(t){return(void 0===t.created||Date.now()-Number(t.created)<Ne)&&(void 0===t.expire||Date.now()<Number(t.expire))}(e)?e:(We(t),{})}function He(t,e){if(mt(t))We(e);else{t.expire=String(Date.now()+Le);var n=vt(t).map((function(t){return t[0]+"="+t[1]})).join(Pe);e.set(n,Le)}}function We(t){t.set("",0)}var Ve=[];var je;var qe,Fe,ze,Ge,Ke,$e=[],Xe=[];function Ye(){return je||(qe=XMLHttpRequest.prototype.open,Fe=XMLHttpRequest.prototype.send,ze=XMLHttpRequest.prototype.abort,XMLHttpRequest.prototype.open=function(t,e){var n=this;return $((function(){n._datadog_xhr={method:t,url:re(e)}})),qe.apply(this,arguments)},XMLHttpRequest.prototype.send=function(){var e=this;return $((function(){if(e._datadog_xhr){var n=e._datadog_xhr;n.startTime=Yt(),n.startClocks=Jt(),n.isAborted=!1;var r=e.onreadystatechange;e.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&$(o),r&&r.apply(this,arguments)};var i=!1,o=function(){if(!i){i=!0;var r=t(t({},n),{duration:Qt(n.startClocks.timeStamp,Xt()),response:e.response,status:e.status});Xe.forEach((function(t){return t(r)}))}};e.addEventListener("loadend",K(o)),$e.forEach((function(t){return t(n,e)}))}})),Fe.apply(this,arguments)},XMLHttpRequest.prototype.abort=function(){var t=this;return $((function(){t._datadog_xhr&&(t._datadog_xhr.isAborted=!0)})),ze.apply(this,arguments)},je={beforeSend:function(t){$e.push(t)},onRequestComplete:function(t){Xe.push(t)}}),je}var Je=[],Qe=[];function Ze(){return Ge||(!function(){if(!window.fetch)return;Ke=window.fetch,window.fetch=function(t,e){var n,r=$(tn,null,[t,e]);return r?$(en,null,[n=Ke.call(this,r.input,r.init),r]):n=Ke.call(this,t,e),n}}(),Ge={beforeSend:function(t){Je.push(t)},onRequestComplete:function(t){Qe.push(t)}}),Ge}function tn(t,e){var n=e&&e.method||"object"==typeof t&&t.method||"GET",r=re("object"==typeof t&&t.url||t),i={init:e,input:t,method:n,startClocks:Jt(),url:r};return Je.forEach((function(t){return t(i)})),i}function en(t,n){var r=this,i=function(t){return i=r,o=void 0,u=function(){var r,i;return e(this,(function(e){switch(e.label){case 0:return n.duration=Qt(n.startClocks.timeStamp,Xt()),"stack"in t||t instanceof Error?(n.status=0,n.response=h(U(t)),n.isAborted=t instanceof DOMException&&t.code===DOMException.ABORT_ERR,Qe.forEach((function(t){return t(n)})),[3,6]):[3,1];case 1:if(!("status"in t))return[3,6];r=void 0,e.label=2;case 2:return e.trys.push([2,4,,5]),[4,t.clone().text()];case 3:return r=e.sent(),[3,5];case 4:return i=e.sent(),r="Unable to retrieve response: "+i,[3,5];case 5:n.response=r,n.responseType=t.type,n.status=t.status,n.isAborted=!1,Qe.forEach((function(t){return t(n)})),e.label=6;case 6:return[2]}}))},new((a=void 0)||(a=Promise))((function(t,e){function n(t){try{s(u.next(t))}catch(t){e(t)}}function r(t){try{s(u.throw(t))}catch(t){e(t)}}function s(e){e.done?t(e.value):new a((function(t){t(e.value)})).then(n,r)}s((u=u.apply(i,o||[])).next())}));var i,o,a,u};t.then(K(i),K(i))}function nn(t){0===t.status&&(t.traceId=void 0,t.spanId=void 0)}function rn(t,e,n){var r;void 0!==on()&&function(t,e){for(var n=ie(e),r=0,i=t.allowedTracingOrigins;r<i.length;r++){var o=i[r];if(n===o||o instanceof RegExp&&o.test(n))return!0}return!1}(t,e.url)&&(e.traceId=new an,e.spanId=new an,n((r=e.traceId,{"x-datadog-origin":"rum","x-datadog-parent-id":e.spanId.toDecimalString(),"x-datadog-sampled":"1","x-datadog-sampling-priority":"1","x-datadog-trace-id":r.toDecimalString()})))}function on(){return window.crypto||window.msCrypto}var an=function(){function t(){this.buffer=new Uint8Array(8),on().getRandomValues(this.buffer),this.buffer[0]=127&this.buffer[0]}return t.prototype.toString=function(t){for(var e=this.readInt32(0),n=this.readInt32(4),r="";;){var i=e%t*4294967296+n;if(e=Math.floor(e/t),n=Math.floor(i/t),r=(i%t).toString(t)+r,!e&&!n)break}return r},t.prototype.toDecimalString=function(){return this.toString(10)},t.prototype.readInt32=function(t){return 16777216*this.buffer[t]+(this.buffer[t+1]<<16)+(this.buffer[t+2]<<8)+this.buffer[t+3]},t}(),un=1;function sn(e,n){var r=function(e){return{clearTracingIfCancelled:nn,traceFetch:function(n){return rn(e,n,(function(e){var r;if(n.input instanceof Request&&!(null===(r=n.init)||void 0===r?void 0:r.headers))n.input=new Request(n.input),Object.keys(e).forEach((function(t){n.input.headers.append(t,e[t])}));else{n.init=t({},n.init);var i=[];n.init.headers instanceof Headers?n.init.headers.forEach((function(t,e){i.push([e,t])})):Array.isArray(n.init.headers)?n.init.headers.forEach((function(t){i.push(t)})):n.init.headers&&Object.keys(n.init.headers).forEach((function(t){i.push([t,n.init.headers[t]])})),n.init.headers=i.concat(vt(e))}}))},traceXhr:function(t,n){return rn(e,t,(function(t){Object.keys(t).forEach((function(e){n.setRequestHeader(e,t[e])}))}))}}}(n);!function(t,e,n){var r=Ye();r.beforeSend((function(r,i){me(e,r.url)&&(n.traceXhr(r,i),r.requestIndex=cn(),t.notify(Ft.REQUEST_STARTED,{requestIndex:r.requestIndex}))})),r.onRequestComplete((function(r){me(e,r.url)&&(n.clearTracingIfCancelled(r),t.notify(Ft.REQUEST_COMPLETED,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,response:r.response,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,type:et.XHR,url:r.url}))}))}(e,n,r),function(t,e,n){var r=Ze();r.beforeSend((function(r){me(e,r.url)&&(n.traceFetch(r),r.requestIndex=cn(),t.notify(Ft.REQUEST_STARTED,{requestIndex:r.requestIndex}))})),r.onRequestComplete((function(r){me(e,r.url)&&(n.clearTracingIfCancelled(r),t.notify(Ft.REQUEST_COMPLETED,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,response:r.response,responseType:r.responseType,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,type:et.FETCH,url:r.url}))}))}(e,n,r)}function cn(){var t=un;return un+=1,t}function fn(t,e){void 0===e&&(e=st);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=t.subscribe(Ft.RUM_EVENT_COLLECTED,(function(t){switch(t.type){case Vt.ERROR:n.errorCount+=1,e(n);break;case Vt.ACTION:n.userActionCount+=1,e(n);break;case Vt.LONG_TASK:n.longTaskCount+=1,e(n);break;case Vt.RESOURCE:n.resourceCount+=1,e(n)}}));return{stop:function(){r.unsubscribe()},eventCounts:n}}function dn(t,e){var n=function(t){var e,n=new xe,r=[],i=0;function o(){n.notify({isBusy:i>0})}return r.push(t.subscribe(Ft.DOM_MUTATED,(function(){return o()}))),r.push(t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(t){"resource"===t.entryType&&o()}))),r.push(t.subscribe(Ft.REQUEST_STARTED,(function(t){void 0===e&&(e=t.requestIndex),i+=1,o()}))),r.push(t.subscribe(Ft.REQUEST_COMPLETED,(function(t){void 0===e||t.requestIndex<e||(i-=1,o())}))),{observable:n,stop:function(){r.forEach((function(t){return t.unsubscribe()}))}}}(t),r=n.observable,i=n.stop,o=function(t,e,n){var r,i=!1,o=setTimeout(K((function(){return s({hadActivity:!1})})),100),a=setTimeout(K((function(){return s({hadActivity:!0,endTime:Xt()})})),1e4);t.subscribe((function(t){var e=t.isBusy;clearTimeout(o),clearTimeout(r);var n=Xt();e||(r=setTimeout(K((function(){return s({hadActivity:!0,endTime:n})})),100))}));var u=function(){i=!0,clearTimeout(o),clearTimeout(r),clearTimeout(a),e()};function s(t){i||(u(),n(t))}return{stop:u}}(r,i,e).stop;return{stop:function(){o(),i()}}}function ln(t){return function(t){var e;if(function(){void 0===hn&&(hn="closest"in HTMLElement.prototype);return hn}())e=t.closest("[data-dd-action-name]");else for(var n=t;n;){if(n.hasAttribute(pn)){e=n;break}n=n.parentElement}if(!e)return;return bn(yn(e.getAttribute(pn).trim()))}(t)||Tn(t,En)||Tn(t,gn)||""}var pn="data-dd-action-name";var vn,mn,hn,En=[function(t){if(function(){void 0===mn&&(mn="labels"in HTMLInputElement.prototype);return mn}()){if("labels"in t&&t.labels&&t.labels.length>0)return Cn(t.labels[0])}else if(t.id){var e=t.ownerDocument&&t.ownerDocument.querySelector('label[for="'+t.id.replace('"','\\"')+'"]');return e&&Cn(e)}},function(t){if("INPUT"===t.nodeName){var e=t,n=e.getAttribute("type");if("button"===n||"submit"===n||"reset"===n)return e.value}},function(t){if("BUTTON"===t.nodeName||"LABEL"===t.nodeName||"button"===t.getAttribute("role"))return Cn(t)},function(t){return t.getAttribute("aria-label")},function(t){var e=t.getAttribute("aria-labelledby");if(e)return e.split(/\s+/).map((function(e){return function(t,e){return t.ownerDocument?t.ownerDocument.getElementById(e):null}(t,e)})).filter((function(t){return Boolean(t)})).map(Cn).join(" ")},function(t){return t.getAttribute("alt")},function(t){return t.getAttribute("name")},function(t){return t.getAttribute("title")},function(t){return t.getAttribute("placeholder")},function(t){if("options"in t&&t.options.length>0)return Cn(t.options[0])}],gn=[function(t){return Cn(t)}];function Tn(t,e){for(var n=t,r=0;r<=10&&n&&"BODY"!==n.nodeName&&"HTML"!==n.nodeName&&"HEAD"!==n.nodeName;){for(var i=0,o=e;i<o.length;i++){var a=(0,o[i])(n);if("string"==typeof a){var u=a.trim();if(u)return bn(yn(u))}}if("FORM"===n.nodeName)break;n=n.parentElement,r+=1}}function yn(t){return t.replace(/\s+/g," ")}function bn(t){return t.length>100?(n=100,((r=(e=t).charCodeAt(n-1))>=55296&&r<=56319?e.slice(0,n+1):e.slice(0,n))+" [...]"):t;var e,n,r}function Cn(t){if(!t.isContentEditable){if("innerText"in t){var e=t.innerText;if(!function(){if(void 0===vn){var t=document.createElement("style");t.textContent="*";var e=document.createElement("div");e.appendChild(t),document.body.appendChild(e),vn=""===e.innerText,document.body.removeChild(e)}return vn}())for(var n=t.querySelectorAll("script, style"),r=0;r<n.length;r+=1){var i=n[r].innerText;i.trim().length>0&&(e=e.replace(i,""))}return e}return t.textContent}}function Rn(t){var e=function(t){var e,n;return{create:function(r,i){if(!e){var o=new wn(t,r,i);e=o,n=dn(t,(function(t){t.hadActivity?o.complete(t.endTime):o.discard(),e=void 0}))}},discardCurrent:function(){e&&(n.stop(),e.discard(),e=void 0)}}}(t);t.subscribe(Ft.VIEW_CREATED,(function(){e.discardCurrent()}));var n=gt(window,"click",(function(t){if(t.target instanceof Element){var n=ln(t.target);n&&e.create(qt.CLICK,n)}}),{capture:!0}).stop;return{stop:function(){e.discardCurrent(),n()}}}var _n,Sn,On,wn=function(){function t(t,e,n){this.lifeCycle=t,this.type=e,this.name=n,this.id=ot(),this.startClocks=Jt(),this.eventCountsSubscription=fn(t),this.lifeCycle.notify(Ft.AUTO_ACTION_CREATED,{id:this.id,startClocks:this.startClocks})}return t.prototype.complete=function(t){var e=this.eventCountsSubscription.eventCounts;this.lifeCycle.notify(Ft.AUTO_ACTION_COMPLETED,{counts:{errorCount:e.errorCount,longTaskCount:e.longTaskCount,resourceCount:e.resourceCount},duration:Qt(this.startClocks.timeStamp,t),id:this.id,name:this.name,startClocks:this.startClocks,type:this.type}),this.eventCountsSubscription.stop()},t.prototype.discard=function(){this.lifeCycle.notify(Ft.AUTO_ACTION_DISCARDED),this.eventCountsSubscription.stop()},t}();function An(e,n){return e.subscribe(Ft.AUTO_ACTION_COMPLETED,(function(t){return e.notify(Ft.RAW_RUM_EVENT_COLLECTED,In(t))})),n.trackInteractions&&Rn(e),{addAction:function(n,r){e.notify(Ft.RAW_RUM_EVENT_COLLECTED,t({savedCommonContext:r},In(n)))}}}function In(t){var e=Dn(t)?{action:{error:{count:t.counts.errorCount},id:t.id,loading_time:$t(t.duration),long_task:{count:t.counts.longTaskCount},resource:{count:t.counts.resourceCount}}}:void 0;return{customerContext:Dn(t)?void 0:t.context,rawRumEvent:a({action:{target:{name:t.name},type:t.type},date:t.startClocks.timeStamp,type:Vt.ACTION},e),startTime:t.startClocks.relative}}function Dn(t){return t.type!==qt.CUSTOM}function kn(e){return _n||(function(t,e){function n(n,r){t.isIntakeUrl(r.url)||t.isEnabled("remove-network-errors")&&r.isAborted||!function(t){return 0===t.status&&"opaque"!==t.responseType}(r)&&!function(t){return t.status>=500}(r)||e.notify({message:Nn(n)+" error "+r.method+" "+r.url,resource:{method:r.method,statusCode:r.status,url:r.url},source:p,stack:Ln(r.response,t)||"Failed to load",startClocks:r.startClocks})}Ye().onRequestComplete((function(t){return n(et.XHR,t)})),Ze().onRequestComplete((function(t){return n(et.FETCH,t)}))}(e,_n=new xe),function(e){Sn=console.error,console.error=K((function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Sn.apply(console,n),e.notify(t(t({},xn(n)),{source:d,startClocks:Jt()}))}))}(_n),function(t){D((function(e,n,r){var i=m(e,r,"Uncaught"),o=i.stack,a=i.message,u=i.type;t.notify({message:a,stack:o,type:u,source:v,startClocks:Jt()})}))}(_n)),_n}function xn(t){var e=function(t,e){for(var n=0;n<t.length;n+=1){var r=t[n];if(e(r,n,t))return r}}(t,(function(t){return t instanceof Error}));return{message:n(["console error:"],t).map((function(t){return function(t){if("string"==typeof t)return t;if(t instanceof Error)return E(U(t));return ct(t,void 0,2)}(t)})).join(" "),stack:e?h(U(e)):void 0}}function Ln(t,e){return t&&t.length>e.requestErrorResponseLengthLimit?t.substring(0,e.requestErrorResponseLengthLimit)+"...":t}function Nn(t){return et.XHR===t?"XHR":"Fetch"}function Mn(e,n){return kn(n).subscribe((function(t){return e.notify(Ft.RAW_ERROR_COLLECTED,{error:t})})),function(e){return e.subscribe(Ft.RAW_ERROR_COLLECTED,(function(n){var r=n.error,i=n.customerContext,o=n.savedCommonContext;e.notify(Ft.RAW_RUM_EVENT_COLLECTED,t({customerContext:i,savedCommonContext:o},function(t){return{rawRumEvent:{date:t.startClocks.timeStamp,error:{message:t.message,resource:t.resource?{method:t.resource.method,status_code:t.resource.statusCode,url:t.resource.url}:void 0,source:t.source,stack:t.stack,type:t.type},type:Vt.ERROR},startTime:t.startClocks.relative}}(r)))})),{addError:function(n,r){var i=n.error,o=n.startClocks,a=n.context,u=function(e,n,r){var i=e instanceof Error?U(e):void 0;return t({startClocks:n,source:r},m(i,e,"Provided"))}(i,o,n.source);e.notify(Ft.RAW_ERROR_COLLECTED,{customerContext:a,savedCommonContext:r,error:u})}}}(e)}function Un(t){if(performance&&"getEntriesByName"in performance){var e=performance.getEntriesByName(t.url,"resource");if(e.length&&"toJSON"in e[0]){var n,r=e.map((function(t){return t.toJSON()})).filter(de).filter((function(e){return n=e,r=t.startClocks.relative,i=Pn({startTime:t.startClocks.relative,duration:t.duration}),o=1,n.startTime>=r-o&&Pn(n)<=i+o;var n,r,i,o}));return 1===r.length?r[0]:2===r.length&&Pn((n=r)[0])<=n[1].startTime?r[1]:void 0}}}function Pn(t){return t.startTime+t.duration}function Bn(t,e){t.subscribe(Ft.REQUEST_COMPLETED,(function(n){e.isTrackedWithResource()&&t.notify(Ft.RAW_RUM_EVENT_COLLECTED,function(t){var e=t.type===et.XHR?tt.XHR:tt.FETCH,n=Un(t),r=n?Gt(n.startTime):t.startClocks,i=n?Hn(n):void 0,o=function(t){if(!t.traceId||!t.spanId)return;return{_dd:{span_id:t.spanId.toDecimalString(),trace_id:t.traceId.toDecimalString()},resource:{id:ot()}}}(t),u=a({date:r.timeStamp,resource:{type:e,duration:$t(t.duration),method:t.method,status_code:t.status,url:t.url},type:Vt.RESOURCE},o,i);return{startTime:r.relative,rawRumEvent:u}}(n))})),t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(n){var r;e.isTrackedWithResource()&&"resource"===n.entryType&&("xmlhttprequest"!==(r=n).initiatorType&&"fetch"!==r.initiatorType)&&t.notify(Ft.RAW_RUM_EVENT_COLLECTED,function(t){var e=se(t),n=Hn(t),r=function(t){return t.traceId?{_dd:{trace_id:t.traceId}}:void 0}(t),i=Gt(t.startTime),o=a({date:i.timeStamp,resource:{type:e,url:t.name},type:Vt.RESOURCE},r,n);return{startTime:i.relative,rawRumEvent:o}}(n))}))}function Hn(e){return{resource:t({duration:(n=e,r=n.duration,i=n.startTime,o=n.responseEnd,$t(0===r&&i<o?Qt(i,o):r)),size:ve(e)},fe(e))};var n,r,i,o}function Wn(t){return void 0===t&&(t=window),On||("hidden"===document.visibilityState?On={timeStamp:0}:(On={timeStamp:1/0},gt(t,"pagehide",(function(t){var e=t.timeStamp;On.timeStamp=e}),{capture:!0,once:!0}).stop)),On}function Vn(e,n){var r;function i(e){r=t(t({},r),e),n(r)}var o=function(t,e){return{stop:t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(t){"navigation"===t.entryType&&e({domComplete:t.domComplete,domContentLoaded:t.domContentLoadedEventEnd,domInteractive:t.domInteractive,loadEvent:t.loadEventEnd})})).unsubscribe}}(e,i).stop,a=function(t,e){var n=Wn();return{stop:t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(t){"paint"===t.entryType&&"first-contentful-paint"===t.name&&t.startTime<n.timeStamp&&e(t.startTime)})).unsubscribe}}(e,(function(t){return i({firstContentfulPaint:t})})).stop,u=function(t,e,n){var r=Wn(),i=1/0,o=Tt(e,["pointerdown","keydown"],(function(t){i=t.timeStamp}),{capture:!0,once:!0}).stop,a=t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(t){"largest-contentful-paint"===t.entryType&&t.startTime<i&&t.startTime<r.timeStamp&&n(t.startTime)})).unsubscribe;return{stop:function(){o(),a()}}}(e,window,(function(t){i({largestContentfulPaint:t})})).stop,s=function(t,e){var n=Wn();return{stop:t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(t){if("first-input"===t.entryType&&t.startTime<n.timeStamp){var r=Qt(t.startTime,t.processingStart);e({firstInputDelay:r>=0?r:0,firstInputTime:t.startTime})}})).unsubscribe}}(e,(function(t){i({firstInputDelay:t.firstInputDelay,firstInputTime:t.firstInputTime})})).stop;return{stop:function(){o(),a(),u(),s()}}}function jn(t){var e,n=function(t){var e=history.pushState;history.pushState=K((function(){e.apply(this,arguments),t()}));var n=history.replaceState;history.replaceState=K((function(){n.apply(this,arguments),t()}));var r=gt(window,"popstate",t).stop;return{stop:function(){r(),history.pushState=e,history.replaceState=n}}}(t).stop,r=(e=t,gt(window,"hashchange",e)).stop;return{stop:function(){n(),r()}}}function qn(t,e){return t.pathname!==e.pathname||(n=e.hash,r=n.substr(1),!document.getElementById(r)&&Fn(e.hash)!==Fn(t.hash));var n,r}function Fn(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function zn(t,e,n){var r,i={eventCounts:{errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0}},o=fn(t,(function(t){i.eventCounts=t,e()})).stop,a=function(t,e){var n=t===jt.INITIAL_LOAD,r=!0,i=[];function o(){!r&&!n&&i.length>0&&e(Math.max.apply(Math,i))}return{setLoadEvent:function(t){n&&(n=!1,i.push(t),o())},setActivityLoadingTime:function(t){r&&(r=!1,void 0!==t&&i.push(t),o())}}}(n,(function(t){i.loadingTime=t,e()})),u=a.setActivityLoadingTime,s=a.setLoadEvent,c=function(t,e){var n=Xt();return{stop:dn(t,(function(t){t.hadActivity?e(Qt(n,t.endTime)):e(void 0)})).stop}}(t,u).stop;return Ce("layout-shift")?(i.cumulativeLayoutShift=0,r=function(t,e){return{stop:t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(t){"layout-shift"!==t.entryType||t.hadRecentInput||e(t.value)})).unsubscribe}}(t,(function(t){i.cumulativeLayoutShift=ut(i.cumulativeLayoutShift+t,4),e()})).stop):r=st,{stop:function(){o(),c(),r()},setLoadEvent:s,viewMetrics:i}}function Gn(t,e){var n,r,i=!1,o=(n=Kn(e,t,i,jt.INITIAL_LOAD,document.referrer,{relative:0,timeStamp:Zt()}),r=Vn(e,(function(t){n.updateTimings(t),n.scheduleUpdate()})).stop,{initialView:n,stop:r}),a=o.stop,u=o.initialView,s=jn((function(){if(qn(u.getLocation(),t))return u.end(),u.triggerUpdate(),void(u=f());u.updateLocation(t),u.triggerUpdate()})).stop;e.subscribe(Ft.SESSION_RENEWED,(function(){u.end(),u=f()})),e.subscribe(Ft.BEFORE_UNLOAD,(function(){u.end(),u.triggerUpdate()})),e.subscribe(Ft.RECORD_STARTED,(function(){i=!0,u.updateHasReplay(!0)})),e.subscribe(Ft.RECORD_STOPPED,(function(){i=!1}));var c=window.setInterval(K((function(){u.triggerUpdate()})),3e5);function f(){return Kn(e,t,i,jt.ROUTE_CHANGE,u.url)}return{addTiming:function(t,e){void 0===e&&(e=Xt()),u.addTiming(t,e),u.triggerUpdate()},stop:function(){a(),s(),u.end(),clearInterval(c)}}}function Kn(e,n,i,o,a,u,s){void 0===u&&(u=Jt());var c,f=ot(),d={},l={},p=0,v=t({},n),m=i;e.notify(Ft.VIEW_CREATED,{id:f,startClocks:u,location:v,referrer:a});var h=it(K(R),3e3,{leading:!1}),E=h.throttled,g=h.cancel,T=zn(e,E,o),y=T.setLoadEvent,b=T.stop,C=T.viewMetrics;function R(){p+=1;var n=void 0===c?Xt():c.timeStamp;e.notify(Ft.VIEW_UPDATED,t(t({},C),{customTimings:l,documentVersion:p,id:f,name:s,loadingType:o,location:v,hasReplay:m,referrer:a,startClocks:u,timings:d,duration:Qt(u.timeStamp,n),isActive:void 0===c}))}return R(),{scheduleUpdate:E,end:function(){c=Jt(),b(),e.notify(Ft.VIEW_ENDED,{endClocks:c})},getLocation:function(){return v},triggerUpdate:function(){g(),R()},updateTimings:function(t){d=t,void 0!==t.loadEvent&&y(t.loadEvent)},addTiming:function(t,e){l[function(t){var e=t.replace(/[^a-zA-Z0-9-_.@$]/g,"_");e!==t&&r.warn("Invalid timing name: "+t+", sanitized to: "+e);return e}(t)]=Qt(u.timeStamp,e)},updateLocation:function(e){v=t({},e)},updateHasReplay:function(t){m=t},get url(){return v.href}}}function $n(t,e){return t.subscribe(Ft.VIEW_UPDATED,(function(e){return t.notify(Ft.RAW_RUM_EVENT_COLLECTED,function(t){var e={_dd:{document_version:t.documentVersion},date:t.startClocks.timeStamp,type:Vt.VIEW,view:{action:{count:t.eventCounts.userActionCount},cumulative_layout_shift:t.cumulativeLayoutShift,dom_complete:$t(t.timings.domComplete),dom_content_loaded:$t(t.timings.domContentLoaded),dom_interactive:$t(t.timings.domInteractive),error:{count:t.eventCounts.errorCount},first_contentful_paint:$t(t.timings.firstContentfulPaint),first_input_delay:$t(t.timings.firstInputDelay),first_input_time:$t(t.timings.firstInputTime),is_active:t.isActive,name:t.name,largest_contentful_paint:$t(t.timings.largestContentfulPaint),load_event:$t(t.timings.loadEvent),loading_time:$t(t.loadingTime),loading_type:t.loadingType,long_task:{count:t.eventCounts.longTaskCount},resource:{count:t.eventCounts.resourceCount},time_spent:$t(t.duration)},session:{has_replay:t.hasReplay||void 0}};mt(t.customTimings)||(e.view.custom_timings=function(t,e){for(var n={},r=0,i=Object.keys(t);r<i.length;r++){var o=i[r];n[o]=e(t[o])}return n}(t.customTimings,$t));return{rawRumEvent:e,startTime:t.startClocks.relative}}(e))})),Gn(e,t)}var Xn;function Yn(t,e){var n=Me(t.cookieOptions,"rum",(function(e){return function(t,e){var n;n=function(t){return t===Xn.NOT_TRACKED||t===Xn.TRACKED_WITH_RESOURCES||t===Xn.TRACKED_WITHOUT_RESOURCES}(e)?e:at(t.sampleRate)?at(t.resourceSampleRate)?Xn.TRACKED_WITH_RESOURCES:Xn.TRACKED_WITHOUT_RESOURCES:Xn.NOT_TRACKED;return{trackingType:n,isTracked:Jn(n)}}(t,e)}));return n.renewObservable.subscribe((function(){e.notify(Ft.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&Jn(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===Xn.TRACKED_WITH_RESOURCES}}}function Jn(t){return t===Xn.TRACKED_WITH_RESOURCES||t===Xn.TRACKED_WITHOUT_RESOURCES}function Qn(t,e){var n=function(t,e){var n,r=o(t.rumEndpoint,(function(){return e.notify(Ft.BEFORE_UNLOAD)})),i=t.replica;void 0!==i&&(n=o(i.rumEndpoint));function o(e,n){return new b(new T(e,t.batchBytesLimit,!0),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout,n)}function u(t){return a(t,{application:{id:i.applicationId}})}var s=!1;return{add:function(t){s||(r.add(t),n&&n.add(u(t)))},stop:function(){s=!0},upsert:function(t,e){s||(r.upsert(t,e),n&&n.upsert(u(t),e))}}}(t,e);return e.subscribe(Ft.RUM_EVENT_COLLECTED,(function(t){t.type===Vt.VIEW?n.upsert(t,t.view.id):n.add(t)})),{stop:function(){n.stop()}}}!function(t){t.NOT_TRACKED="0",t.TRACKED_WITH_RESOURCES="1",t.TRACKED_WITHOUT_RESOURCES="2"}(Xn||(Xn={}));var Zn={buildMode:"release",datacenter:"us",sdkVersion:"2.10.0"};var tr,er,nr,rr,ir=function(e){var n,i=!1,o=(n={},{get:function(){return n},add:function(t,e){n[t]=e},remove:function(t){delete n[t]},set:function(t){n=t}}),a={},s=function(){},c=new zt,f=function(t){c.add([t,Xt()])},d=new zt,m=function(t){d.add([t,g()])},h=new zt,E=function(t){h.add([t,g()])};function g(){return u({context:o.get(),user:a})}var T,y,b=(T={init:K((function(t){var n;Bt(Ut(t))&&Ht()&&function(t){return i?(t.silentMultipleInit||r.error("DD_RUM is already initialized."),!1):t&&(t.clientToken||t.publicApiKey)?t.applicationId?void 0===t.sampleRate||lt(t.sampleRate)?void 0===t.resourceSampleRate||lt(t.resourceSampleRate)?!Array.isArray(t.allowedTracingOrigins)||0===t.allowedTracingOrigins.length||void 0!==t.service||(r.error("Service need to be configured when tracing is enabled"),!1):(r.error("Resource Sample Rate should be a number between 0 and 100"),!1):(r.error("Sample Rate should be a number between 0 and 100"),!1):(r.error("Application ID is not configured, no RUM data will be collected."),!1):(r.error("Client Token is not configured, we will not send any data."),!1)}(t)&&(t.publicApiKey&&(t.clientToken=t.publicApiKey),n=e(t,(function(){return{user:a,context:o.get()}})),m=n.addAction,E=n.addError,f=n.addTiming,s=n.getInternalContext,d.drain((function(t){var e=t[0],n=t[1];return m(e,n)})),h.drain((function(t){var e=t[0],n=t[1];return E(e,n)})),c.drain((function(t){var e=t[0],n=t[1];return f(e,n)})),i=!0)})),addRumGlobalContext:K(o.add),removeRumGlobalContext:K(o.remove),getRumGlobalContext:K(o.get),setRumGlobalContext:K(o.set),getInternalContext:K((function(t){return s(t)})),addAction:K((function(t,e){m({name:t,context:u(e),startClocks:Jt(),type:qt.CUSTOM})})),addUserAction:function(t,e){b.addAction(t,e)},addError:K((function(t,e,n){var i;void 0===n&&(n=l),n===l||n===p||n===v?i=n:(r.error("DD_RUM.addError: Invalid source '"+n+"'"),i=l),E({error:t,context:u(e),source:i,startClocks:Jt()})})),addTiming:K((function(t){f(t)})),setUser:K((function(t){var e=function(t){if("object"==typeof t&&t){var e=u(t);return"id"in e&&(e.id=String(e.id)),"name"in e&&(e.name=String(e.name)),"email"in e&&(e.email=String(e.email)),e}}(t);e?a=e:r.error("Unsupported user:",t)})),removeUser:K((function(){a={}}))},y=t(t({},T),{onReady:function(t){t()}}),Object.defineProperty(y,"_setDebug",{get:function(){return Q},enumerable:!1}),y);return b}((function(t,e){var n=new ee,r=Pt(t,Zn),i=r.configuration,o=r.internalMonitoring,u=Yn(i,n);o.setExternalContextProvider((function(){return a({application_id:t.applicationId},c.findView(),e().context)}));var s=function(t,e,n,r,i,o){var a=function(t,e){var n,r,i,o=[],a=[];t.subscribe(Ft.VIEW_CREATED,(function(t){n=t,i=e.getId()})),t.subscribe(Ft.VIEW_UPDATED,(function(t){n&&n.id===t.id&&(n=t)})),t.subscribe(Ft.VIEW_ENDED,(function(t){var e=t.endClocks;n&&(o.unshift({endTime:e.relative,context:c(),startTime:n.startClocks.relative}),n=void 0)})),t.subscribe(Ft.AUTO_ACTION_CREATED,(function(t){r=t})),t.subscribe(Ft.AUTO_ACTION_COMPLETED,(function(t){r&&a.unshift({context:f(),endTime:r.startClocks.relative+t.duration,startTime:r.startClocks.relative}),r=void 0})),t.subscribe(Ft.AUTO_ACTION_DISCARDED,(function(){r=void 0})),t.subscribe(Ft.SESSION_RENEWED,(function(){o=[],a=[],n=void 0,r=void 0}));var u=setInterval(K((function(){s(o,144e5),s(a,3e5)})),6e4);function s(t,e){for(var n=Yt()-e;t.length>0&&t[t.length-1].startTime<n;)t.pop()}function c(){return{session:{id:i},view:{id:n.id,name:n.name,referrer:n.referrer,url:n.location.href}}}function f(){return{action:{id:r.id}}}function d(t,e,n,r){if(void 0===r)return n?t():void 0;if(n&&r>=n.startClocks.relative)return t();for(var i=0,o=e;i<o.length;i++){var a=o[i];if(r>a.endTime)break;if(r>=a.startTime)return a.context}}return{findAction:function(t){return d(f,a,r,t)},findView:function(t){return d(c,o,n,t)},stop:function(){clearInterval(u)}}}(n,i),u=Qn(r,n);ke(t,r,n,i,a,o),function(t){t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(e){if("longtask"===e.entryType){var n=Gt(e.startTime),r={date:n.timeStamp,long_task:{duration:$t(e.duration)},type:Vt.LONG_TASK};t.notify(Ft.RAW_RUM_EVENT_COLLECTED,{rawRumEvent:r,startTime:n.relative})}}))}(n),Bn(n,i);var s=$n(n,e),c=s.addTiming,f=s.stop,d=Mn(n,r).addError;return{addAction:An(n,r).addAction,addError:d,parentContexts:a,addTiming:c,stop:function(){f(),u.stop()}}}(t.applicationId,location,n,i,u,e),c=s.parentContexts,f=s.addError,d=s.addAction,l=s.addTiming;sn(n,i),Re(n,i),ne(n);var p=function(t,e,n){return{get:function(r){var i=n.findView(r);if(e.isTracked()&&i&&i.session.id){var o=n.findAction(r);return{application_id:t,session_id:i.session.id,user_action:o?{id:o.action.id}:void 0,view:i.view}}}}}(t.applicationId,u,c);return{addAction:d,addError:f,addTiming:l,configuration:i,lifeCycle:n,parentContexts:c,session:u,getInternalContext:p.get}}));tr=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}(),nr=ir,rr=tr[er="DD_RUM"],tr[er]=nr,rr&&rr.q&&rr.q.forEach((function(t){return St(t,"onReady callback threw an error:")()}))}();
!function(){"use strict";var t=function(){return(t=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function e(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}function n(){for(var t=0,e=0,n=arguments.length;e<n;e++)t+=arguments[e].length;var r=Array(t),i=0;for(e=0;e<n;e++)for(var o=arguments[e],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r}var r={log:console.log.bind(console),warn:console.warn.bind(console),error:console.error.bind(console)},i=function(t){return Array.isArray(t)},o=function(t){return!Array.isArray(t)&&"object"==typeof t&&null!==t};function a(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var r=0,i=e;r<i.length;r++){var o=i[r];null!=o&&(t=c(t,o,s()))}return t}function u(t){return c(void 0,t,s())}function s(){if("undefined"!=typeof WeakSet){var t=new WeakSet;return{hasAlreadyBeenSeen:function(e){var n=t.has(e);return n||t.add(e),n}}}var e=[];return{hasAlreadyBeenSeen:function(t){var n=e.indexOf(t)>=0;return n||e.push(t),n}}}function c(t,e,n){if(void 0===e)return t;if(!o(e)&&!i(e))return e;if(!n.hasAlreadyBeenSeen(e)){if(o(e)&&(void 0===t||o(t))){var r=t||{};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=c(r[a],e[a],n));return r}if(i(e)&&(void 0===t||i(t))){(r=t||[]).length=Math.max(r.length,e.length);for(var u=0;u<e.length;u+=1)r[u]=c(r[u],e[u],n);return r}return e}}var f="agent",d="console",l="custom",p="network",v="source";function m(t,e,n){return t&&(void 0!==t.message||e instanceof Error)?{message:t.message||"Empty message",stack:h(t),type:t.name}:{message:n+" "+ct(e),stack:"No stack, consider using an instance of Error",type:t&&t.name}}function h(t){var e=E(t);return t.stack.forEach((function(t){var n="?"===t.func?"<anonymous>":t.func,r=t.args&&t.args.length>0?"("+t.args.join(", ")+")":"",i=t.line?":"+t.line:"",o=t.line&&t.column?":"+t.column:"";e+="\n at "+n+r+" @ "+t.url+i+o})),e}function E(t){return(t.name||"Error")+": "+t.message}var g=/[^\u0000-\u007F]/,T=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)try{if(navigator.sendBeacon(n,t))return}catch(t){!function(t){y||(y=!0,Y(t))}(t)}var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(t)},t}();var y=!1;var b=function(){function t(t,e,n,r,i,o){void 0===o&&(o=st),this.request=t,this.maxSize=e,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=i,this.beforeUnloadCallback=o,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),this.flushPeriodically()}return 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=n(this.pushOnlyBuffer,(e=this.upsertBuffer,r=[],Object.keys(e).forEach((function(t){r.push(e[t])})),r));this.request.send(t.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var e,r},t.prototype.sizeInBytes=function(t){return g.test(t)?void 0!==window.TextEncoder?(new TextEncoder).encode(t).length:new Blob([t]).size:t.length},t.prototype.addOrUpdate=function(t,e){var n=this.process(t),i=n.processedMessage,o=n.messageBytesSize;o>=this.maxMessageSize?r.warn("Discarded a message whose size was bigger than the maximum allowed size "+this.maxMessageSize+"KB."):(this.hasMessageFor(e)&&this.remove(e),this.willReachedBytesLimitWith(o)&&this.flush(),this.push(i,o,e),this.isFull()&&this.flush())},t.prototype.process=function(t){var e=ct(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.flushPeriodically=function(){var t=this;setTimeout(K((function(){t.flush(),t.flushPeriodically()})),this.flushTimeout)},t.prototype.flushOnVisibilityHidden=function(){var t=this;navigator.sendBeacon&&(gt(window,"beforeunload",this.beforeUnloadCallback),gt(document,"visibilitychange",(function(){"hidden"===document.visibilityState&&t.flush()})),gt(window,"beforeunload",(function(){return t.flush()})))},t}(),C=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function R(t){if(S){if(_===t)return;N()}var e=U(t);throw S=e,_=t,setTimeout(K((function(){_===t&&N()})),e.incomplete?2e3:0),t}var _,S,O,w,A,I=[];function D(t){!function(){if(w)return;O=window.onerror,window.onerror=K(x),w=!0}(),function(){if(A)return;null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=K(L),A=!0}(),I.push(t)}function k(t,e,n){var r;if(I.forEach((function(i){try{i(t,e,n)}catch(t){r=t}})),r)throw r}function x(t,e,n,r,i){if(S)H(S,e,n),N();else if(i)k(U(i),!0,i);else{var o,a={url:e,column:r,line:n},u=t;if("[object String]"==={}.toString.call(t)){var s=C.exec(u);s&&(o=s[1],u=s[2])}k({name:o,message:"string"==typeof u?u:void 0,stack:[a]},!0,t)}return!!O&&O.apply(this,arguments)}function L(t){var e=t.reason||"Empty reason";k(U(e),!0,e)}function N(){var t=S,e=_;S=void 0,_=void 0,k(t,!1,e)}var M="?";function U(t,e){var n,r=void 0===e?0:+e;try{if(n=function(t){var e=V(t,"stacktrace");if(!e)return;for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=e.split("\n"),a=[],u=0;u<o.length;u+=2){var s=void 0;r.exec(o[u])?s={args:[],column:void 0,func:(n=r.exec(o[u]))[3],line:+n[1],url:n[2]}:i.exec(o[u])&&(s={args:(n=i.exec(o[u]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),s&&(!s.func&&s.line&&(s.func=M),s.context=[o[u+1]],a.push(s))}if(!a.length)return;return{stack:a,message:V(t,"message"),name:V(t,"name")}}(t))return n}catch(t){if(B)throw t}try{if(n=function(t){var e=V(t,"stack");if(!e)return;for(var n,r,i,o,a=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,s=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,f=/\((\S*)(?::(\d+))(?::(\d+))\)/,d=e.split("\n"),l=[],p=0,v=d.length;p<v;p+=1){if(a.exec(d[p])){var m=(i=a.exec(d[p]))[2]&&0===i[2].indexOf("native");n=i[2]&&0===i[2].indexOf("eval"),r=f.exec(i[2]),n&&r&&(i[2]=r[1],i[3]=r[2],i[4]=r[3]),o={args:m?[i[2]]:[],column:i[4]?+i[4]:void 0,func:i[1]||M,line:i[3]?+i[3]:void 0,url:m?void 0:i[2]}}else if(s.exec(d[p]))o={args:[],column:(i=s.exec(d[p]))[4]?+i[4]:void 0,func:i[1]||M,line:+i[3],url:i[2]};else{if(!u.exec(d[p]))continue;n=(i=u.exec(d[p]))[3]&&i[3].indexOf(" > eval")>-1,r=c.exec(i[3]),n&&r?(i[3]=r[1],i[4]=r[2],i[5]=void 0):0!==p||i[5]||q(t.columnNumber)||(l[0].column=t.columnNumber+1),o={args:i[2]?i[2].split(","):[],column:i[5]?+i[5]:void 0,func:i[1]||M,line:i[4]?+i[4]:void 0,url:i[3]}}!o.func&&o.line&&(o.func=M),l.push(o)}if(!l.length)return;return{stack:l,message:V(t,"message"),name:V(t,"name")}}(t))return n}catch(t){if(B)throw t}try{if(n=function(t){var e=V(t,"message");if(!e)return;var n=e.split("\n");if(n.length<4)return;var r,i=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,o=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,a=/^\s*Line (\d+) of function script\s*$/i,u=[],s=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var f in s)j(s,f)&&!s[f].src&&c.push(s[f]);for(var d=2;d<n.length;d+=2){var l=void 0;if(i.exec(n[d]))l={args:[],column:void 0,func:(r=i.exec(n[d]))[3],line:+r[1],url:r[2]};else if(o.exec(n[d]))l={args:[],column:void 0,func:(r=o.exec(n[d]))[4],line:+r[1],url:r[3]};else if(a.exec(n[d])){r=a.exec(n[d]),l={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+r[1]}}l&&(l.func||(l.func=M),l.context=[n[d+1]],u.push(l))}if(!u.length)return;return{stack:u,message:n[0],name:V(t,"name")}}(t))return n}catch(t){if(B)throw t}try{if(n=W(t,r+1))return n}catch(t){if(B)throw t}return{message:V(t,"message"),name:V(t,"name"),stack:[]}}var P,B=!1;function H(t,e,n){var r={url:e,line:n?+n:void 0};if(r.url&&r.line){t.incomplete=!1;var i=t.stack;if(i.length>0&&i[0].url===r.url){if(i[0].line===r.line)return!1;if(!i[0].line&&i[0].func===r.func)return i[0].line=r.line,i[0].context=r.context,!1}return i.unshift(r),t.partial=!0,!0}return t.incomplete=!0,!1}function W(t,e){for(var n,r,i=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,o=[],a={},u=!1,s=W.caller;s&&!u;s=s.caller)s!==U&&s!==R&&(r={args:[],column:void 0,func:M,line:void 0,url:void 0},n=i.exec(s.toString()),s.name?r.func=s.name:n&&(r.func=n[1]),void 0===r.func&&(r.func=n?n.input.substring(0,n.input.indexOf("{")):void 0),a[s.toString()]?u=!0:a[s.toString()]=!0,o.push(r));e&&o.splice(0,e);var c={stack:o,message:V(t,"message"),name:V(t,"name")};return H(c,V(t,"sourceURL")||V(t,"fileName"),V(t,"line")||V(t,"lineNumber")),c}function V(t,e){if("object"==typeof t&&t&&e in t){var n=t[e];return"string"==typeof n?n:void 0}}function j(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function q(t){return void 0===t}!function(t){t.info="info",t.error="error"}(P||(P={}));var F,z={maxMessagesPerPage:0,sentMessageCount:0};function G(t){if(t.internalMonitoringEndpoint){var e=function(t){var e,n=r(t.internalMonitoringEndpoint);void 0!==t.replica&&(e=r(t.replica.internalMonitoringEndpoint));function r(e){return new b(new T(e,t.batchBytesLimit),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout)}function i(t){return a({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==F?F():{},t)}return{add:function(t){var r=i(t);n.add(r),e&&e.add(r)}}}(t);!function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];e.forEach((function(e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}))}(z,{batch:e,maxMessagesPerPage:t.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(t){F=t}}}function K(t){return function(){return $(t,this,arguments)}}function $(t,e,n){try{return t.apply(e,n)}catch(t){Z(t);try{Y(t)}catch(t){Z(t)}}}function X(e,n){!function(t){z.debugMode&&r.log("[MONITORING MESSAGE]",t)}(e),J(t(t({message:e},n),{status:P.info}))}function Y(e){J(t(t({},function(t){if(t instanceof Error){var e=U(t);return{error:{kind:e.name,stack:h(e)},message:e.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+ct(t)}}(e)),{status:P.error}))}function J(t){z.batch&&z.sentMessageCount<z.maxMessagesPerPage&&(z.sentMessageCount+=1,z.batch.add(t))}function Q(t){z.debugMode=t}function Z(t){z.debugMode&&r.error("[INTERNAL ERROR]",t)}var tt,et,nt=1e3,rt=6e4;function it(t,e,n){var r,i,o=!n||void 0===n.leading||n.leading,a=!n||void 0===n.trailing||n.trailing,u=!1;return{throttled:function(){for(var n=[],s=0;s<arguments.length;s++)n[s]=arguments[s];u?r=n:(o?t.apply(void 0,n):r=n,u=!0,i=setTimeout((function(){a&&r&&t.apply(void 0,r),u=!1,r=void 0}),e))},cancel:function(){clearTimeout(i),u=!1,r=void 0}}}function ot(t){return t?(parseInt(t,10)^16*Math.random()>>parseInt(t,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,ot)}function at(t){return 0!==t&&100*Math.random()<=t}function ut(t,e){return+t.toFixed(e)}function st(){}function ct(t,e,n){if(null==t)return JSON.stringify(t);var r=[!1,void 0];ft(t)&&(r=[!0,t.toJSON],delete t.toJSON);var i,o,a=[!1,void 0];"object"==typeof t&&ft(i=Object.getPrototypeOf(t))&&(a=[!0,i.toJSON],delete i.toJSON);try{o=JSON.stringify(t,e,n)}catch(t){o="<error: unable to serialize object>"}finally{r[0]&&(t.toJSON=r[1]),a[0]&&(i.toJSON=a[1])}return o}function ft(t){return"object"==typeof t&&null!==t&&t.hasOwnProperty("toJSON")}function dt(t,e){return-1!==t.indexOf(e)}function lt(t){return pt(t)&&t>=0&&t<=100}function pt(t){return"number"==typeof t}function vt(t){return Object.keys(t).map((function(e){return[e,t[e]]}))}function mt(t){return 0===Object.keys(t).length}function ht(t){if(t.origin)return t.origin;var e=t.host.replace(/(:80|:443)$/,"");return t.protocol+"//"+e}function Et(t,e){var n=new RegExp("(?:^|;)\\s*"+e+"\\s*=\\s*([^;]+)").exec(t);return n?n[1]:void 0}function gt(t,e,n,r){return Tt(t,[e],n,r)}function Tt(t,e,n,r){var i=void 0===r?{}:r,o=i.once,a=i.capture,u=i.passive,s=K(o?function(t){f(),n(t)}:n),c=u?{capture:a,passive:u}:a;e.forEach((function(e){return t.addEventListener(e,s,c)}));var f=function(){return e.forEach((function(e){return t.removeEventListener(e,s,c)}))};return{stop:f}}function yt(t,e){document.readyState===t||"complete"===document.readyState?e():gt(window,"complete"===t?"load":"DOMContentLoaded",e,{once:!0})}!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"}(tt||(tt={})),function(t){t.FETCH="fetch",t.XHR="xhr"}(et||(et={}));var bt,Ct;function Rt(t,e,n,r){var i=new Date;i.setTime(i.getTime()+n);var o="expires="+i.toUTCString(),a=r&&r.crossSite?"none":"strict",u=r&&r.domain?";domain="+r.domain:"",s=r&&r.secure?";secure":"";document.cookie=t+"="+e+";"+o+";path=/;samesite="+a+u+s}function _t(t){return Et(document.cookie,t)}function St(t,e){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];try{return t.apply(void 0,n)}catch(t){r.error(e,t)}}}var Ot={alternate:{logs:"logs",rum:"rum",sessionReplay:"session-replay",trace:"trace"},classic:{logs:"browser",rum:"rum",sessionReplay:void 0,trace:"public-trace"}},wt="eu",At="us",It=((Ct={})[wt]="datadoghq.eu",Ct[At]="datadoghq.com",Ct),Dt=[It[At],It[wt]];function kt(e,n){var r={buildMode:n.buildMode,clientToken:e.clientToken,env:e.env,proxyHost:e.proxyHost,sdkVersion:n.sdkVersion,service:e.service,site:e.site||It[e.datacenter||n.datacenter],version:e.version},i=function(t,e){return!e.useAlternateIntakeDomains&&dt(Dt,t)?"classic":"alternate"}(r.site,e),o=function(t,e,n){if(e.proxyHost)return["https://"+e.proxyHost+"/v1/input/"];var r=[e.site];e.buildMode===Nt.STAGING&&n&&r.push(It[At]);for(var i=[],o=Object.keys(Ot[t]),a=0,u=r;a<u.length;a++)for(var s=u[a],c=0,f=o;c<f.length;c++){var d=f[c];i.push("https://"+xt(t,d,s)+"/v1/input/")}return i}(i,r,void 0!==e.replica),a={isIntakeUrl:function(t){return o.some((function(e){return 0===t.indexOf(e)}))},logsEndpoint:Lt(i,"logs",r),rumEndpoint:Lt(i,"rum",r),sessionReplayEndpoint:Lt(i,"sessionReplay",r),traceEndpoint:Lt(i,"trace",r)};if(e.internalMonitoringApiKey&&(a.internalMonitoringEndpoint=Lt(i,"logs",r,"browser-agent-internal-monitoring")),r.buildMode===Nt.E2E_TEST&&(a.internalMonitoringEndpoint="<<< E2E INTERNAL MONITORING ENDPOINT >>>",a.logsEndpoint="<<< E2E LOGS ENDPOINT >>>",a.rumEndpoint="<<< E2E RUM ENDPOINT >>>",a.sessionReplayEndpoint="<<< E2E SESSION REPLAY ENDPOINT >>>"),r.buildMode===Nt.STAGING&&void 0!==e.replica){var u=t(t({},r),{applicationId:e.replica.applicationId,clientToken:e.replica.clientToken,site:It[At]});a.replica={applicationId:e.replica.applicationId,internalMonitoringEndpoint:Lt(i,"logs",u,"browser-agent-internal-monitoring"),logsEndpoint:Lt(i,"logs",u),rumEndpoint:Lt(i,"rum",u)}}return a}function xt(t,e,n){return"classic"===t&&function(t,e){var n=Ot.classic[t];return n&&n+"-http-intake.logs."+e}(e,n)||function(t,e){var n=Ot.alternate[t],r=e.split("."),i=r.pop(),o=r.join("-")+"."+i;return n+".browser-intake-"+o}(e,n)}function Lt(t,e,n,r){var i="sdk_version:"+n.sdkVersion+(n.env?",env:"+n.env:"")+(n.service?",service:"+n.service:"")+(n.version?",version:"+n.version:""),o=xt(t,e,n.site),a=n.proxyHost?n.proxyHost:o,u=(n.proxyHost?"ddhost="+o+"&":"")+"ddsource="+(r||"browser")+"&ddtags="+encodeURIComponent(i);return"https://"+a+"/v1/input/"+n.clientToken+"?"+u}var Nt,Mt={allowedTracingOrigins:[],maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,trackInteractions:!1,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function Ut(t){var e={};return e.secure=function(t){return!!t.useSecureSessionCookie||!!t.useCrossSiteSessionCookie}(t),e.crossSite=!!t.useCrossSiteSessionCookie,t.trackSessionAcrossSubdomains&&(e.domain=function(){if(void 0===bt){for(var t="dd_site_test_"+ot(),e=window.location.hostname.split("."),n=e.pop();e.length&&!_t(t);)n=e.pop()+"."+n,Rt(t,"test",nt,{domain:n});bt=n}return bt}()),e}function Pt(e,n){var r=function(e,n){var r=Array.isArray(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],i=t(t({beforeSend:e.beforeSend&&St(e.beforeSend,"beforeSend threw an error:"),cookieOptions:Ut(e),isEnabled:function(t){return dt(r,t)},service:e.service},kt(e,n)),Mt);return"allowedTracingOrigins"in e&&(i.allowedTracingOrigins=e.allowedTracingOrigins),"sampleRate"in e&&(i.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(i.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(i.trackInteractions=!!e.trackInteractions),i}(e,n);return{configuration:r,internalMonitoring:G(r)}}function Bt(t){return!!function(t){if(void 0===document.cookie||null===document.cookie)return!1;try{var e="dd_cookie_test_"+ot(),n="test";return Rt(e,n,nt,t),_t(e)===n}catch(t){return r.error(t),!1}}(t)||(r.warn("Cookies are not authorized, we will not send any data."),!1)}function Ht(){return"file:"!==window.location.protocol||(r.error("Execution is not allowed in the current context."),!1)}!function(t){t.RELEASE="release",t.STAGING="staging",t.E2E_TEST="e2e-test"}(Nt||(Nt={}));var Wt,Vt,jt,qt,Ft,zt=function(){function t(t){void 0===t&&(t=1e4),this.limit=t,this.buffer=[]}return t.prototype.add=function(t){this.buffer.push(t)>this.limit&&this.buffer.splice(0,1)},t.prototype.drain=function(){this.buffer.forEach((function(t){return t()})),this.buffer.length=0},t}();function Gt(t){return{relative:t,timeStamp:Kt(t)}}function Kt(t){var e=Date.now()-performance.now();return e>Zt()?Math.round(e+t):function(t){return Math.round(Zt()+t)}(t)}function $t(t){return pt(t)?ut(1e6*t,0):t}function Xt(){return Date.now()}function Yt(){return performance.now()}function Jt(){return{relative:Yt(),timeStamp:Xt()}}function Qt(t,e){return e-t}function Zt(){return void 0===Wt&&(Wt=performance.timing.navigationStart),Wt}!function(t){t.ACTION="action",t.ERROR="error",t.LONG_TASK="long_task",t.VIEW="view",t.RESOURCE="resource"}(Vt||(Vt={})),function(t){t.INITIAL_LOAD="initial_load",t.ROUTE_CHANGE="route_change"}(jt||(jt={})),function(t){t.CLICK="click",t.CUSTOM="custom"}(qt||(qt={})),function(t){t[t.PERFORMANCE_ENTRY_COLLECTED=0]="PERFORMANCE_ENTRY_COLLECTED",t[t.AUTO_ACTION_CREATED=1]="AUTO_ACTION_CREATED",t[t.AUTO_ACTION_COMPLETED=2]="AUTO_ACTION_COMPLETED",t[t.AUTO_ACTION_DISCARDED=3]="AUTO_ACTION_DISCARDED",t[t.VIEW_CREATED=4]="VIEW_CREATED",t[t.VIEW_UPDATED=5]="VIEW_UPDATED",t[t.VIEW_ENDED=6]="VIEW_ENDED",t[t.REQUEST_STARTED=7]="REQUEST_STARTED",t[t.REQUEST_COMPLETED=8]="REQUEST_COMPLETED",t[t.SESSION_RENEWED=9]="SESSION_RENEWED",t[t.DOM_MUTATED=10]="DOM_MUTATED",t[t.BEFORE_UNLOAD=11]="BEFORE_UNLOAD",t[t.RAW_RUM_EVENT_COLLECTED=12]="RAW_RUM_EVENT_COLLECTED",t[t.RUM_EVENT_COLLECTED=13]="RUM_EVENT_COLLECTED",t[t.RECORD_STARTED=14]="RECORD_STARTED",t[t.RECORD_STOPPED=15]="RECORD_STOPPED",t[t.RAW_ERROR_COLLECTED=16]="RAW_ERROR_COLLECTED"}(Ft||(Ft={}));var te,ee=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 ne(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(K((function(){t.notify(Ft.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){e&&e.disconnect()}}}function re(t){return oe(t,ht(window.location)).href}function ie(t){return ht(oe(t))}function oe(t,e){if(function(){if(void 0!==te)return te;try{var t=new URL("http://test/path");return te="http://test/path"===t.href}catch(t){te=!1}return te}())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 i=(n=document.implementation.createHTMLDocument("")).createElement("base");i.href=e,n.head.appendChild(i),n.body.appendChild(r)}return r.href=t,r}var ae="initial_document",ue=[[tt.DOCUMENT,function(t){return ae===t}],[tt.XHR,function(t){return"xmlhttprequest"===t}],[tt.FETCH,function(t){return"fetch"===t}],[tt.BEACON,function(t){return"beacon"===t}],[tt.CSS,function(t,e){return/\.css$/i.test(e)}],[tt.JS,function(t,e){return/\.js$/i.test(e)}],[tt.IMAGE,function(t,e){return dt(["image","img","icon"],t)||null!==/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(e)}],[tt.FONT,function(t,e){return null!==/\.(woff|eot|woff2|ttf)$/i.exec(e)}],[tt.MEDIA,function(t,e){return dt(["audio","video"],t)||null!==/\.(mp3|mp4)$/i.exec(e)}]];function se(t){var e=t.name;if(!function(t){try{return!!oe(t)}catch(t){return!1}}(e))return X('Failed to construct URL for "'+t.name+'"'),tt.OTHER;for(var n=function(t){var e=oe(t).pathname;return"/"===e[0]?e:"/"+e}(e),r=0,i=ue;r<i.length;r++){var o=i[r],a=o[0];if((0,o[1])(t.initiatorType,n))return a}return tt.OTHER}function ce(){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 fe(t){var e=de(t);if(e){var n=e.startTime,r=e.fetchStart,i=e.redirectStart,o=e.redirectEnd,a=e.domainLookupStart,u=e.domainLookupEnd,s=e.connectStart,c=e.secureConnectionStart,f=e.connectEnd,d=e.requestStart,l=e.responseStart,p={download:pe(n,l,e.responseEnd),first_byte:pe(n,d,l)};return f!==r&&(p.connect=pe(n,s,f),ce(s,c,f)&&(p.ssl=pe(n,c,f))),u!==r&&(p.dns=pe(n,a,u)),le(t)&&(p.redirect=pe(n,i,o)),p}}function de(e){if(ce(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd)){if(!le(e))return e;var n=e.redirectStart,r=e.redirectEnd;if(n<e.startTime&&(n=e.startTime),r<e.startTime&&(r=e.fetchStart),ce(e.startTime,n,r,e.fetchStart))return t(t({},e),{redirectEnd:r,redirectStart:n})}}function le(t){return t.fetchStart!==t.startTime}function pe(t,e,n){return{duration:$t(Qt(e,n)),start:$t(Qt(t,e))}}function ve(t){if(t.startTime<t.responseStart)return t.decodedBodySize}function me(t,e){return e&&!t.isIntakeUrl(e)}var he;function Ee(t){var e=function(t){var e=t.querySelector("meta[name=dd-trace-id]"),n=t.querySelector("meta[name=dd-trace-time]");return ge(e&&e.content,n&&n.content)}(t)||function(t){var e=function(t){for(var e=0;e<t.childNodes.length;e+=1){if(n=Te(t.childNodes[e]))return n}if(t.body)for(e=t.body.childNodes.length-1;e>=0;e-=1){var n,r=t.body.childNodes[e];if(n=Te(r))return n;if(!ye(r))break}}(t);if(!e)return;return ge(Et(e,"trace-id"),Et(e,"trace-time"))}(t);if(e&&!(e.traceTime<=Date.now()-12e4))return e.traceId}function ge(t,e){var n=e&&Number(e);if(t&&n)return{traceId:t,traceTime:n}}function Te(t){if(t&&function(t){return"#comment"===t.nodeName}(t)){var e=/^\s*DATADOG;(.*?)\s*$/.exec(t.data);if(e)return e[1]}}function ye(t){return"#text"===t.nodeName}function be(){return void 0!==window.performance&&"getEntries"in performance}function Ce(t){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes(t)}function Re(e,n){var r;if(r=function(t){Oe(e,n,t)},yt("interactive",(function(){var e,n={entryType:"resource",initiatorType:ae,traceId:Ee(document)};if(Ce("navigation")&&performance.getEntriesByType("navigation").length>0){var i=performance.getEntriesByType("navigation")[0];e=t(t({},i.toJSON()),n)}else{var o=_e();e=t(t(t({},o),{decodedBodySize:0,duration:o.responseEnd,name:window.location.href,startTime:0}),n)}r(e)})),be()&&Se(e,n,performance.getEntries()),window.PerformanceObserver){new PerformanceObserver(K((function(t){return Se(e,n,t.getEntries())}))).observe({entryTypes:["resource","navigation","longtask","paint","largest-contentful-paint","first-input","layout-shift"]}),be()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}Ce("navigation")||function(e){function n(){e(t(t({},_e()),{entryType:"navigation"}))}yt("complete",(function(){setTimeout(K(n))}))}((function(t){Oe(e,n,t)})),Ce("first-input")||function(t){var e=Date.now(),n=!1,r=Tt(window,["click","mousedown","keydown","touchstart","pointerdown"],(function(t){if(t.cancelable){var e={entryType:"first-input",processingStart:Yt(),startTime:t.timeStamp};"pointerdown"===t.type?i(e):o(e)}}),{passive:!0,capture:!0}).stop;function i(t){Tt(window,["pointerup","pointercancel"],(function(e){"pointerup"===e.type&&o(t)}),{once:!0})}function o(i){if(!n){n=!0,r();var o=i.processingStart-i.startTime;o>=0&&o<Date.now()-e&&t(i)}}}((function(t){Oe(e,n,t)}))}function _e(){var t={},e=performance.timing;for(var n in e)if(pt(e[n])){var r=n,i=e[r];t[r]=0===i?0:i-Zt()}return t}function Se(t,e,n){n.forEach((function(n){"resource"!==n.entryType&&"navigation"!==n.entryType&&"paint"!==n.entryType&&"longtask"!==n.entryType&&"largest-contentful-paint"!==n.entryType&&"first-input"!==n.entryType&&"layout-shift"!==n.entryType||Oe(t,e,n)}))}function Oe(t,e,n){(function(t){return"navigation"===t.entryType&&t.loadEventEnd<=0})(n)||function(t,e){return"resource"===e.entryType&&!me(t,e.name)}(e,n)||t.notify(Ft.PERFORMANCE_ENTRY_COLLECTED,n)}function we(t,e,n){var r=u(t),i=n(r);return e.forEach((function(e){var n=Ae(t,e),i=Ae(r,e);"string"==typeof n&&"string"==typeof i&&function(t,e,n){for(var r=t,i=e.split("."),o=0;o<i.length;o+=1){var a=i[o];if(!Ie(r,a))return;o!==i.length-1?r=r[a]:r[a]=n}}(t,e,i)})),i}function Ae(t,e){for(var n=t,r=0,i=e.split(".");r<i.length;r++){var o=i[r];if(!Ie(n,o))return;n=n[o]}return n}function Ie(t,e){return"object"==typeof t&&null!==t&&e in t}!function(t){t.SYNTHETICS="synthetics",t.USER="user"}(he||(he={}));var De=["view.url","view.referrer","action.target.name","error.message","error.stack","error.resource.url","resource.url"];function ke(t,e,n,i,o,u){var s=function(t,e){var n=0,r=!1;return{isLimitReached:function(){if(0===n&&setTimeout((function(){n=0}),rt),(n+=1)<=t.maxErrorsByMinute||r)return r=!1,!1;if(n===t.maxErrorsByMinute+1){r=!0;try{e({message:"Reached max number of errors by minute: "+t.maxErrorsByMinute,source:f,startClocks:Jt()})}finally{r=!1}}return!0}}}(e,(function(t){n.notify(Ft.RAW_ERROR_COLLECTED,{error:t})}));n.subscribe(Ft.RAW_RUM_EVENT_COLLECTED,(function(c){var f,d=c.startTime,l=c.rawRumEvent,p=c.savedCommonContext,v=c.customerContext,m=o.findView(d);if(i.isTracked()&&m&&m.session.id===i.getId()){var h=o.findAction(d),E=p||u(),g={_dd:{format_version:2,drift:Math.round(Date.now()-(Zt()+performance.now()))},application:{id:t},date:Xt(),service:e.service,session:{type:void 0===window._DATADOG_SYNTHETICS_BROWSER?he.USER:he.SYNTHETICS}},T=(f=l,-1!==[Vt.ERROR,Vt.RESOURCE,Vt.LONG_TASK].indexOf(f.type)?a(g,m,h,l):a(g,m,l)),y=a(E.context,v);mt(y)||(T.context=y),"has_replay"in T.session||(T.session.has_replay=E.hasReplay),mt(E.user)||(T.usr=E.user),function(t,e,n){if(e){var i=we(t,De,e);if(!1===i&&t.type!==Vt.VIEW)return!1;!1===i&&r.warn("Can't dismiss view events using beforeSend!")}if(t.type===Vt.ERROR)return!n.isLimitReached();return!0}(T,e.beforeSend,s)&&n.notify(Ft.RUM_EVENT_COLLECTED,T)}}))}var xe=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}();var Le=9e5,Ne=144e5;function Me(t,e,n){var r=function(t,e){var n,r,i=!1,o=function(){i=!0,clearTimeout(n),n=setTimeout((function(){i=!1}),1e3)};return{get:function(){return i||(r=_t(t),o()),r},set:function(n,i){Rt(t,n,i,e),r=n,o()}}}("_dd_s",t);!function(t){var e=t.get(),n=_t("_dd"),r=_t("_dd_r"),i=_t("_dd_l");if(!e){var o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o.logs=i),r&&/^[012]$/.test(r)&&(o.rum=r),He(o,t)}}(r);var i=new xe,o=Be(r).id,a=it(K((function(){var t=Be(r),a=n(t[e]),u=a.trackingType,s=a.isTracked;t[e]=u,s&&!t.id&&(t.id=ot(),t.created=String(Date.now())),He(t,r),s&&o!==t.id&&(o=t.id,i.notify())})),1e3).throttled;return a(),function(t){var e=Tt(window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0}).stop;Ve.push(e)}(a),function(t){var e=K((function(){"visible"===document.visibilityState&&t()})),n=gt(document,"visibilitychange",e).stop;Ve.push(n);var r=setInterval(e,6e4);Ve.push((function(){clearInterval(r)}))}((function(){He(Be(r),r)})),{getId:function(){return Be(r).id},getTrackingType:function(){return Be(r)[e]},renewObservable:i}}var Ue=/^([a-z]+)=([a-z0-9-]+)$/,Pe="&";function Be(t){var e=function(t){var e=t.get(),n={};(function(t){return void 0!==t&&(-1!==t.indexOf("&")||Ue.test(t))})(e)&&e.split(Pe).forEach((function(t){var e=Ue.exec(t);if(null!==e){var r=e[1],i=e[2];n[r]=i}}));return n}(t);return function(t){return(void 0===t.created||Date.now()-Number(t.created)<Ne)&&(void 0===t.expire||Date.now()<Number(t.expire))}(e)?e:(We(t),{})}function He(t,e){if(mt(t))We(e);else{t.expire=String(Date.now()+Le);var n=vt(t).map((function(t){return t[0]+"="+t[1]})).join(Pe);e.set(n,Le)}}function We(t){t.set("",0)}var Ve=[];var je;var qe,Fe,ze,Ge,Ke,$e=[],Xe=[];function Ye(){return je||(qe=XMLHttpRequest.prototype.open,Fe=XMLHttpRequest.prototype.send,ze=XMLHttpRequest.prototype.abort,XMLHttpRequest.prototype.open=function(t,e){var n=this;return $((function(){n._datadog_xhr={method:t,url:re(e)}})),qe.apply(this,arguments)},XMLHttpRequest.prototype.send=function(){var e=this;return $((function(){if(e._datadog_xhr){var n=e._datadog_xhr;n.startTime=Yt(),n.startClocks=Jt(),n.isAborted=!1;var r=e.onreadystatechange;e.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&$(o),r&&r.apply(this,arguments)};var i=!1,o=function(){if(!i){i=!0;var r=t(t({},n),{duration:Qt(n.startClocks.timeStamp,Xt()),response:e.response,status:e.status});Xe.forEach((function(t){return t(r)}))}};e.addEventListener("loadend",K(o)),$e.forEach((function(t){return t(n,e)}))}})),Fe.apply(this,arguments)},XMLHttpRequest.prototype.abort=function(){var t=this;return $((function(){t._datadog_xhr&&(t._datadog_xhr.isAborted=!0)})),ze.apply(this,arguments)},je={beforeSend:function(t){$e.push(t)},onRequestComplete:function(t){Xe.push(t)}}),je}var Je=[],Qe=[];function Ze(){return Ge||(!function(){if(!window.fetch)return;Ke=window.fetch,window.fetch=function(t,e){var n,r=$(tn,null,[t,e]);return r?$(en,null,[n=Ke.call(this,r.input,r.init),r]):n=Ke.call(this,t,e),n}}(),Ge={beforeSend:function(t){Je.push(t)},onRequestComplete:function(t){Qe.push(t)}}),Ge}function tn(t,e){var n=e&&e.method||"object"==typeof t&&t.method||"GET",r=re("object"==typeof t&&t.url||t),i={init:e,input:t,method:n,startClocks:Jt(),url:r};return Je.forEach((function(t){return t(i)})),i}function en(t,n){var r=this,i=function(t){return i=r,o=void 0,u=function(){var r,i;return e(this,(function(e){switch(e.label){case 0:return n.duration=Qt(n.startClocks.timeStamp,Xt()),"stack"in t||t instanceof Error?(n.status=0,n.response=h(U(t)),n.isAborted=t instanceof DOMException&&t.code===DOMException.ABORT_ERR,Qe.forEach((function(t){return t(n)})),[3,6]):[3,1];case 1:if(!("status"in t))return[3,6];r=void 0,e.label=2;case 2:return e.trys.push([2,4,,5]),[4,t.clone().text()];case 3:return r=e.sent(),[3,5];case 4:return i=e.sent(),r="Unable to retrieve response: "+i,[3,5];case 5:n.response=r,n.responseType=t.type,n.status=t.status,n.isAborted=!1,Qe.forEach((function(t){return t(n)})),e.label=6;case 6:return[2]}}))},new((a=void 0)||(a=Promise))((function(t,e){function n(t){try{s(u.next(t))}catch(t){e(t)}}function r(t){try{s(u.throw(t))}catch(t){e(t)}}function s(e){e.done?t(e.value):new a((function(t){t(e.value)})).then(n,r)}s((u=u.apply(i,o||[])).next())}));var i,o,a,u};t.then(K(i),K(i))}function nn(t){0===t.status&&(t.traceId=void 0,t.spanId=void 0)}function rn(t,e,n){var r;void 0!==on()&&function(t,e){for(var n=ie(e),r=0,i=t.allowedTracingOrigins;r<i.length;r++){var o=i[r];if(n===o||o instanceof RegExp&&o.test(n))return!0}return!1}(t,e.url)&&(e.traceId=new an,e.spanId=new an,n((r=e.traceId,{"x-datadog-origin":"rum","x-datadog-parent-id":e.spanId.toDecimalString(),"x-datadog-sampled":"1","x-datadog-sampling-priority":"1","x-datadog-trace-id":r.toDecimalString()})))}function on(){return window.crypto||window.msCrypto}var an=function(){function t(){this.buffer=new Uint8Array(8),on().getRandomValues(this.buffer),this.buffer[0]=127&this.buffer[0]}return t.prototype.toString=function(t){for(var e=this.readInt32(0),n=this.readInt32(4),r="";;){var i=e%t*4294967296+n;if(e=Math.floor(e/t),n=Math.floor(i/t),r=(i%t).toString(t)+r,!e&&!n)break}return r},t.prototype.toDecimalString=function(){return this.toString(10)},t.prototype.readInt32=function(t){return 16777216*this.buffer[t]+(this.buffer[t+1]<<16)+(this.buffer[t+2]<<8)+this.buffer[t+3]},t}(),un=1;function sn(e,n){var r=function(e){return{clearTracingIfCancelled:nn,traceFetch:function(n){return rn(e,n,(function(e){var r;if(n.input instanceof Request&&!(null===(r=n.init)||void 0===r?void 0:r.headers))n.input=new Request(n.input),Object.keys(e).forEach((function(t){n.input.headers.append(t,e[t])}));else{n.init=t({},n.init);var i=[];n.init.headers instanceof Headers?n.init.headers.forEach((function(t,e){i.push([e,t])})):Array.isArray(n.init.headers)?n.init.headers.forEach((function(t){i.push(t)})):n.init.headers&&Object.keys(n.init.headers).forEach((function(t){i.push([t,n.init.headers[t]])})),n.init.headers=i.concat(vt(e))}}))},traceXhr:function(t,n){return rn(e,t,(function(t){Object.keys(t).forEach((function(e){n.setRequestHeader(e,t[e])}))}))}}}(n);!function(t,e,n){var r=Ye();r.beforeSend((function(r,i){me(e,r.url)&&(n.traceXhr(r,i),r.requestIndex=cn(),t.notify(Ft.REQUEST_STARTED,{requestIndex:r.requestIndex}))})),r.onRequestComplete((function(r){me(e,r.url)&&(n.clearTracingIfCancelled(r),t.notify(Ft.REQUEST_COMPLETED,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,response:r.response,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,type:et.XHR,url:r.url}))}))}(e,n,r),function(t,e,n){var r=Ze();r.beforeSend((function(r){me(e,r.url)&&(n.traceFetch(r),r.requestIndex=cn(),t.notify(Ft.REQUEST_STARTED,{requestIndex:r.requestIndex}))})),r.onRequestComplete((function(r){me(e,r.url)&&(n.clearTracingIfCancelled(r),t.notify(Ft.REQUEST_COMPLETED,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,response:r.response,responseType:r.responseType,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,type:et.FETCH,url:r.url}))}))}(e,n,r)}function cn(){var t=un;return un+=1,t}function fn(t,e){void 0===e&&(e=st);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=t.subscribe(Ft.RUM_EVENT_COLLECTED,(function(t){switch(t.type){case Vt.ERROR:n.errorCount+=1,e(n);break;case Vt.ACTION:n.userActionCount+=1,e(n);break;case Vt.LONG_TASK:n.longTaskCount+=1,e(n);break;case Vt.RESOURCE:n.resourceCount+=1,e(n)}}));return{stop:function(){r.unsubscribe()},eventCounts:n}}function dn(t,e){var n=function(t){var e,n=new xe,r=[],i=0;function o(){n.notify({isBusy:i>0})}return r.push(t.subscribe(Ft.DOM_MUTATED,(function(){return o()}))),r.push(t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(t){"resource"===t.entryType&&o()}))),r.push(t.subscribe(Ft.REQUEST_STARTED,(function(t){void 0===e&&(e=t.requestIndex),i+=1,o()}))),r.push(t.subscribe(Ft.REQUEST_COMPLETED,(function(t){void 0===e||t.requestIndex<e||(i-=1,o())}))),{observable:n,stop:function(){r.forEach((function(t){return t.unsubscribe()}))}}}(t),r=n.observable,i=n.stop,o=function(t,e,n){var r,i=!1,o=setTimeout(K((function(){return s({hadActivity:!1})})),100),a=setTimeout(K((function(){return s({hadActivity:!0,endTime:Xt()})})),1e4);t.subscribe((function(t){var e=t.isBusy;clearTimeout(o),clearTimeout(r);var n=Xt();e||(r=setTimeout(K((function(){return s({hadActivity:!0,endTime:n})})),100))}));var u=function(){i=!0,clearTimeout(o),clearTimeout(r),clearTimeout(a),e()};function s(t){i||(u(),n(t))}return{stop:u}}(r,i,e).stop;return{stop:function(){o(),i()}}}function ln(t){return function(t){var e;if(function(){void 0===hn&&(hn="closest"in HTMLElement.prototype);return hn}())e=t.closest("[data-dd-action-name]");else for(var n=t;n;){if(n.hasAttribute(pn)){e=n;break}n=n.parentElement}if(!e)return;return bn(yn(e.getAttribute(pn).trim()))}(t)||Tn(t,En)||Tn(t,gn)||""}var pn="data-dd-action-name";var vn,mn,hn,En=[function(t){if(function(){void 0===mn&&(mn="labels"in HTMLInputElement.prototype);return mn}()){if("labels"in t&&t.labels&&t.labels.length>0)return Cn(t.labels[0])}else if(t.id){var e=t.ownerDocument&&t.ownerDocument.querySelector('label[for="'+t.id.replace('"','\\"')+'"]');return e&&Cn(e)}},function(t){if("INPUT"===t.nodeName){var e=t,n=e.getAttribute("type");if("button"===n||"submit"===n||"reset"===n)return e.value}},function(t){if("BUTTON"===t.nodeName||"LABEL"===t.nodeName||"button"===t.getAttribute("role"))return Cn(t)},function(t){return t.getAttribute("aria-label")},function(t){var e=t.getAttribute("aria-labelledby");if(e)return e.split(/\s+/).map((function(e){return function(t,e){return t.ownerDocument?t.ownerDocument.getElementById(e):null}(t,e)})).filter((function(t){return Boolean(t)})).map(Cn).join(" ")},function(t){return t.getAttribute("alt")},function(t){return t.getAttribute("name")},function(t){return t.getAttribute("title")},function(t){return t.getAttribute("placeholder")},function(t){if("options"in t&&t.options.length>0)return Cn(t.options[0])}],gn=[function(t){return Cn(t)}];function Tn(t,e){for(var n=t,r=0;r<=10&&n&&"BODY"!==n.nodeName&&"HTML"!==n.nodeName&&"HEAD"!==n.nodeName;){for(var i=0,o=e;i<o.length;i++){var a=(0,o[i])(n);if("string"==typeof a){var u=a.trim();if(u)return bn(yn(u))}}if("FORM"===n.nodeName)break;n=n.parentElement,r+=1}}function yn(t){return t.replace(/\s+/g," ")}function bn(t){return t.length>100?(n=100,((r=(e=t).charCodeAt(n-1))>=55296&&r<=56319?e.slice(0,n+1):e.slice(0,n))+" [...]"):t;var e,n,r}function Cn(t){if(!t.isContentEditable){if("innerText"in t){var e=t.innerText;if(!function(){if(void 0===vn){var t=document.createElement("style");t.textContent="*";var e=document.createElement("div");e.appendChild(t),document.body.appendChild(e),vn=""===e.innerText,document.body.removeChild(e)}return vn}())for(var n=t.querySelectorAll("script, style"),r=0;r<n.length;r+=1){var i=n[r].innerText;i.trim().length>0&&(e=e.replace(i,""))}return e}return t.textContent}}function Rn(t){var e=function(t){var e,n;return{create:function(r,i){if(!e){var o=new wn(t,r,i);e=o,n=dn(t,(function(t){t.hadActivity?o.complete(t.endTime):o.discard(),e=void 0}))}},discardCurrent:function(){e&&(n.stop(),e.discard(),e=void 0)}}}(t);t.subscribe(Ft.VIEW_CREATED,(function(){e.discardCurrent()}));var n=gt(window,"click",(function(t){if(t.target instanceof Element){var n=ln(t.target);n&&e.create(qt.CLICK,n)}}),{capture:!0}).stop;return{stop:function(){e.discardCurrent(),n()}}}var _n,Sn,On,wn=function(){function t(t,e,n){this.lifeCycle=t,this.type=e,this.name=n,this.id=ot(),this.startClocks=Jt(),this.eventCountsSubscription=fn(t),this.lifeCycle.notify(Ft.AUTO_ACTION_CREATED,{id:this.id,startClocks:this.startClocks})}return t.prototype.complete=function(t){var e=this.eventCountsSubscription.eventCounts;this.lifeCycle.notify(Ft.AUTO_ACTION_COMPLETED,{counts:{errorCount:e.errorCount,longTaskCount:e.longTaskCount,resourceCount:e.resourceCount},duration:Qt(this.startClocks.timeStamp,t),id:this.id,name:this.name,startClocks:this.startClocks,type:this.type}),this.eventCountsSubscription.stop()},t.prototype.discard=function(){this.lifeCycle.notify(Ft.AUTO_ACTION_DISCARDED),this.eventCountsSubscription.stop()},t}();function An(t){var e=In(t)?{action:{error:{count:t.counts.errorCount},id:t.id,loading_time:$t(t.duration),long_task:{count:t.counts.longTaskCount},resource:{count:t.counts.resourceCount}}}:void 0;return{customerContext:In(t)?void 0:t.context,rawRumEvent:a({action:{target:{name:t.name},type:t.type},date:t.startClocks.timeStamp,type:Vt.ACTION},e),startTime:t.startClocks.relative}}function In(t){return t.type!==qt.CUSTOM}function Dn(e){return _n||(function(t,e){function n(n,r){t.isIntakeUrl(r.url)||t.isEnabled("remove-network-errors")&&r.isAborted||!function(t){return 0===t.status&&"opaque"!==t.responseType}(r)&&!function(t){return t.status>=500}(r)||e.notify({message:Ln(n)+" error "+r.method+" "+r.url,resource:{method:r.method,statusCode:r.status,url:r.url},source:p,stack:xn(r.response,t)||"Failed to load",startClocks:r.startClocks})}Ye().onRequestComplete((function(t){return n(et.XHR,t)})),Ze().onRequestComplete((function(t){return n(et.FETCH,t)}))}(e,_n=new xe),function(e){Sn=console.error,console.error=K((function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Sn.apply(console,n),e.notify(t(t({},kn(n)),{source:d,startClocks:Jt()}))}))}(_n),function(t){D((function(e,n,r){var i=m(e,r,"Uncaught"),o=i.stack,a=i.message,u=i.type;t.notify({message:a,stack:o,type:u,source:v,startClocks:Jt()})}))}(_n)),_n}function kn(t){var e=function(t,e){for(var n=0;n<t.length;n+=1){var r=t[n];if(e(r,n,t))return r}}(t,(function(t){return t instanceof Error}));return{message:n(["console error:"],t).map((function(t){return function(t){if("string"==typeof t)return t;if(t instanceof Error)return E(U(t));return ct(t,void 0,2)}(t)})).join(" "),stack:e?h(U(e)):void 0}}function xn(t,e){return t&&t.length>e.requestErrorResponseLengthLimit?t.substring(0,e.requestErrorResponseLengthLimit)+"...":t}function Ln(t){return et.XHR===t?"XHR":"Fetch"}function Nn(e,n){return Dn(n).subscribe((function(t){return e.notify(Ft.RAW_ERROR_COLLECTED,{error:t})})),function(e){return e.subscribe(Ft.RAW_ERROR_COLLECTED,(function(n){var r=n.error,i=n.customerContext,o=n.savedCommonContext;e.notify(Ft.RAW_RUM_EVENT_COLLECTED,t({customerContext:i,savedCommonContext:o},function(t){return{rawRumEvent:{date:t.startClocks.timeStamp,error:{message:t.message,resource:t.resource?{method:t.resource.method,status_code:t.resource.statusCode,url:t.resource.url}:void 0,source:t.source,stack:t.stack,type:t.type},type:Vt.ERROR},startTime:t.startClocks.relative}}(r)))})),{addError:function(n,r){var i=n.error,o=n.startClocks,a=n.context,u=function(e,n,r){var i=e instanceof Error?U(e):void 0;return t({startClocks:n,source:r},m(i,e,"Provided"))}(i,o,n.source);e.notify(Ft.RAW_ERROR_COLLECTED,{customerContext:a,savedCommonContext:r,error:u})}}}(e)}function Mn(t){if(performance&&"getEntriesByName"in performance){var e=performance.getEntriesByName(t.url,"resource");if(e.length&&"toJSON"in e[0]){var n,r=e.map((function(t){return t.toJSON()})).filter(de).filter((function(e){return n=e,r=t.startClocks.relative,i=Un({startTime:t.startClocks.relative,duration:t.duration}),o=1,n.startTime>=r-o&&Un(n)<=i+o;var n,r,i,o}));return 1===r.length?r[0]:2===r.length&&Un((n=r)[0])<=n[1].startTime?r[1]:void 0}}}function Un(t){return t.startTime+t.duration}function Pn(t,e){t.subscribe(Ft.REQUEST_COMPLETED,(function(n){e.isTrackedWithResource()&&t.notify(Ft.RAW_RUM_EVENT_COLLECTED,function(t){var e=t.type===et.XHR?tt.XHR:tt.FETCH,n=Mn(t),r=n?Gt(n.startTime):t.startClocks,i=n?Bn(n):void 0,o=function(t){if(!t.traceId||!t.spanId)return;return{_dd:{span_id:t.spanId.toDecimalString(),trace_id:t.traceId.toDecimalString()},resource:{id:ot()}}}(t),u=a({date:r.timeStamp,resource:{type:e,duration:$t(t.duration),method:t.method,status_code:t.status,url:t.url},type:Vt.RESOURCE},o,i);return{startTime:r.relative,rawRumEvent:u}}(n))})),t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(n){var r;e.isTrackedWithResource()&&"resource"===n.entryType&&("xmlhttprequest"!==(r=n).initiatorType&&"fetch"!==r.initiatorType)&&t.notify(Ft.RAW_RUM_EVENT_COLLECTED,function(t){var e=se(t),n=Bn(t),r=function(t){return t.traceId?{_dd:{trace_id:t.traceId}}:void 0}(t),i=Gt(t.startTime),o=a({date:i.timeStamp,resource:{type:e,url:t.name},type:Vt.RESOURCE},r,n);return{startTime:i.relative,rawRumEvent:o}}(n))}))}function Bn(e){return{resource:t({duration:(n=e,r=n.duration,i=n.startTime,o=n.responseEnd,$t(0===r&&i<o?Qt(i,o):r)),size:ve(e)},fe(e))};var n,r,i,o}function Hn(t){return void 0===t&&(t=window),On||("hidden"===document.visibilityState?On={timeStamp:0}:(On={timeStamp:1/0},gt(t,"pagehide",(function(t){var e=t.timeStamp;On.timeStamp=e}),{capture:!0,once:!0}).stop)),On}function Wn(e,n){var r;function i(e){r=t(t({},r),e),n(r)}var o=function(t,e){return{stop:t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(t){"navigation"===t.entryType&&e({domComplete:t.domComplete,domContentLoaded:t.domContentLoadedEventEnd,domInteractive:t.domInteractive,loadEvent:t.loadEventEnd})})).unsubscribe}}(e,i).stop,a=function(t,e){var n=Hn();return{stop:t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(t){"paint"===t.entryType&&"first-contentful-paint"===t.name&&t.startTime<n.timeStamp&&e(t.startTime)})).unsubscribe}}(e,(function(t){return i({firstContentfulPaint:t})})).stop,u=function(t,e,n){var r=Hn(),i=1/0,o=Tt(e,["pointerdown","keydown"],(function(t){i=t.timeStamp}),{capture:!0,once:!0}).stop,a=t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(t){"largest-contentful-paint"===t.entryType&&t.startTime<i&&t.startTime<r.timeStamp&&n(t.startTime)})).unsubscribe;return{stop:function(){o(),a()}}}(e,window,(function(t){i({largestContentfulPaint:t})})).stop,s=function(t,e){var n=Hn();return{stop:t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(t){if("first-input"===t.entryType&&t.startTime<n.timeStamp){var r=Qt(t.startTime,t.processingStart);e({firstInputDelay:r>=0?r:0,firstInputTime:t.startTime})}})).unsubscribe}}(e,(function(t){i({firstInputDelay:t.firstInputDelay,firstInputTime:t.firstInputTime})})).stop;return{stop:function(){o(),a(),u(),s()}}}function Vn(t){var e,n=function(t){var e=history.pushState;history.pushState=K((function(){e.apply(this,arguments),t()}));var n=history.replaceState;history.replaceState=K((function(){n.apply(this,arguments),t()}));var r=gt(window,"popstate",t).stop;return{stop:function(){r(),history.pushState=e,history.replaceState=n}}}(t).stop,r=(e=t,gt(window,"hashchange",e)).stop;return{stop:function(){n(),r()}}}function jn(t,e){return t.pathname!==e.pathname||(n=e.hash,r=n.substr(1),!document.getElementById(r)&&qn(e.hash)!==qn(t.hash));var n,r}function qn(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}function Fn(t,e,n){var r,i={eventCounts:{errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0}},o=fn(t,(function(t){i.eventCounts=t,e()})).stop,a=function(t,e){var n=t===jt.INITIAL_LOAD,r=!0,i=[];function o(){!r&&!n&&i.length>0&&e(Math.max.apply(Math,i))}return{setLoadEvent:function(t){n&&(n=!1,i.push(t),o())},setActivityLoadingTime:function(t){r&&(r=!1,void 0!==t&&i.push(t),o())}}}(n,(function(t){i.loadingTime=t,e()})),u=a.setActivityLoadingTime,s=a.setLoadEvent,c=function(t,e){var n=Xt();return{stop:dn(t,(function(t){t.hadActivity?e(Qt(n,t.endTime)):e(void 0)})).stop}}(t,u).stop;return Ce("layout-shift")?(i.cumulativeLayoutShift=0,r=function(t,e){return{stop:t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(t){"layout-shift"!==t.entryType||t.hadRecentInput||e(t.value)})).unsubscribe}}(t,(function(t){i.cumulativeLayoutShift=ut(i.cumulativeLayoutShift+t,4),e()})).stop):r=st,{stop:function(){o(),c(),r()},setLoadEvent:s,viewMetrics:i}}function zn(t,e){var n,r,i=!1,o=(n=Gn(e,t,i,jt.INITIAL_LOAD,document.referrer,{relative:0,timeStamp:Zt()}),r=Wn(e,(function(t){n.updateTimings(t),n.scheduleUpdate()})).stop,{initialView:n,stop:r}),a=o.stop,u=o.initialView,s=Vn((function(){if(jn(u.getLocation(),t))return u.end(),u.triggerUpdate(),void(u=f());u.updateLocation(t),u.triggerUpdate()})).stop;e.subscribe(Ft.SESSION_RENEWED,(function(){u.end(),u=f()})),e.subscribe(Ft.BEFORE_UNLOAD,(function(){u.end(),u.triggerUpdate()})),e.subscribe(Ft.RECORD_STARTED,(function(){i=!0,u.updateHasReplay(!0)})),e.subscribe(Ft.RECORD_STOPPED,(function(){i=!1}));var c=window.setInterval(K((function(){u.triggerUpdate()})),3e5);function f(n,r){return Gn(e,t,i,jt.ROUTE_CHANGE,u.url,n,r)}return{addTiming:function(t,e){void 0===e&&(e=Xt()),u.addTiming(t,e),u.triggerUpdate()},startView:function(t,e){u.end(e),u.triggerUpdate(),u=f(e,t)},stop:function(){a(),s(),u.end(),clearInterval(c)}}}function Gn(e,n,i,o,a,u,s){void 0===u&&(u=Jt());var c,f=ot(),d={},l={},p=0,v=t({},n),m=i;e.notify(Ft.VIEW_CREATED,{id:f,startClocks:u,location:v,referrer:a});var h=it(K(R),3e3,{leading:!1}),E=h.throttled,g=h.cancel,T=Fn(e,E,o),y=T.setLoadEvent,b=T.stop,C=T.viewMetrics;function R(){p+=1;var n=void 0===c?Xt():c.timeStamp;e.notify(Ft.VIEW_UPDATED,t(t({},C),{customTimings:l,documentVersion:p,id:f,name:s,loadingType:o,location:v,hasReplay:m,referrer:a,startClocks:u,timings:d,duration:Qt(u.timeStamp,n),isActive:void 0===c}))}return R(),{scheduleUpdate:E,end:function(t){void 0===t&&(t=Jt()),c=t,b(),e.notify(Ft.VIEW_ENDED,{endClocks:c})},getLocation:function(){return v},triggerUpdate:function(){g(),R()},updateTimings:function(t){d=t,void 0!==t.loadEvent&&y(t.loadEvent)},addTiming:function(t,e){l[function(t){var e=t.replace(/[^a-zA-Z0-9-_.@$]/g,"_");e!==t&&r.warn("Invalid timing name: "+t+", sanitized to: "+e);return e}(t)]=Qt(u.timeStamp,e)},updateLocation:function(e){v=t({},e)},updateHasReplay:function(t){m=t},get url(){return v.href}}}function Kn(t,e){return t.subscribe(Ft.VIEW_UPDATED,(function(e){return t.notify(Ft.RAW_RUM_EVENT_COLLECTED,function(t){var e={_dd:{document_version:t.documentVersion},date:t.startClocks.timeStamp,type:Vt.VIEW,view:{action:{count:t.eventCounts.userActionCount},cumulative_layout_shift:t.cumulativeLayoutShift,dom_complete:$t(t.timings.domComplete),dom_content_loaded:$t(t.timings.domContentLoaded),dom_interactive:$t(t.timings.domInteractive),error:{count:t.eventCounts.errorCount},first_contentful_paint:$t(t.timings.firstContentfulPaint),first_input_delay:$t(t.timings.firstInputDelay),first_input_time:$t(t.timings.firstInputTime),is_active:t.isActive,name:t.name,largest_contentful_paint:$t(t.timings.largestContentfulPaint),load_event:$t(t.timings.loadEvent),loading_time:$t(t.loadingTime),loading_type:t.loadingType,long_task:{count:t.eventCounts.longTaskCount},resource:{count:t.eventCounts.resourceCount},time_spent:$t(t.duration)},session:{has_replay:t.hasReplay||void 0}};mt(t.customTimings)||(e.view.custom_timings=function(t,e){for(var n={},r=0,i=Object.keys(t);r<i.length;r++){var o=i[r];n[o]=e(t[o])}return n}(t.customTimings,$t));return{rawRumEvent:e,startTime:t.startClocks.relative}}(e))})),zn(e,t)}var $n;function Xn(t,e){var n=Me(t.cookieOptions,"rum",(function(e){return function(t,e){var n;n=function(t){return t===$n.NOT_TRACKED||t===$n.TRACKED_WITH_RESOURCES||t===$n.TRACKED_WITHOUT_RESOURCES}(e)?e:at(t.sampleRate)?at(t.resourceSampleRate)?$n.TRACKED_WITH_RESOURCES:$n.TRACKED_WITHOUT_RESOURCES:$n.NOT_TRACKED;return{trackingType:n,isTracked:Yn(n)}}(t,e)}));return n.renewObservable.subscribe((function(){e.notify(Ft.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&Yn(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===$n.TRACKED_WITH_RESOURCES}}}function Yn(t){return t===$n.TRACKED_WITH_RESOURCES||t===$n.TRACKED_WITHOUT_RESOURCES}function Jn(t,e){var n=function(t,e){var n,r=o(t.rumEndpoint,(function(){return e.notify(Ft.BEFORE_UNLOAD)})),i=t.replica;void 0!==i&&(n=o(i.rumEndpoint));function o(e,n){return new b(new T(e,t.batchBytesLimit,!0),t.maxBatchSize,t.batchBytesLimit,t.maxMessageSize,t.flushTimeout,n)}function u(t){return a(t,{application:{id:i.applicationId}})}var s=!1;return{add:function(t){s||(r.add(t),n&&n.add(u(t)))},stop:function(){s=!0},upsert:function(t,e){s||(r.upsert(t,e),n&&n.upsert(u(t),e))}}}(t,e);return e.subscribe(Ft.RUM_EVENT_COLLECTED,(function(t){t.type===Vt.VIEW?n.upsert(t,t.view.id):n.add(t)})),{stop:function(){n.stop()}}}!function(t){t.NOT_TRACKED="0",t.TRACKED_WITH_RESOURCES="1",t.TRACKED_WITHOUT_RESOURCES="2"}($n||($n={}));var Qn={buildMode:"release",datacenter:"us",sdkVersion:"2.11.1"};var Zn,tr,er,nr,rr=function(e){var n,i=!1,o=(n={},{get:function(){return n},add:function(t,e){n[t]=e},remove:function(t){delete n[t]},set:function(t){n=t}}),a={},s=function(){},c=new zt,f=function(t){var e=Xt();c.add((function(){return f(t,e)}))},d=function(t){var e=Jt();c.add((function(){return d(t,e)}))},m=function(t){var e=E();c.add((function(){return m(t,e)}))},h=function(t){var e=E();c.add((function(){return h(t,e)}))};function E(){return u({context:o.get(),user:a})}var g,T,y=(g={init:K((function(t){var n,u,l;Bt(Ut(t))&&Ht()&&function(t){return i?(t.silentMultipleInit||r.error("DD_RUM is already initialized."),!1):t&&(t.clientToken||t.publicApiKey)?t.applicationId?void 0===t.sampleRate||lt(t.sampleRate)?void 0===t.resourceSampleRate||lt(t.resourceSampleRate)?!Array.isArray(t.allowedTracingOrigins)||0===t.allowedTracingOrigins.length||void 0!==t.service||(r.error("Service need to be configured when tracing is enabled"),!1):(r.error("Resource Sample Rate should be a number between 0 and 100"),!1):(r.error("Sample Rate should be a number between 0 and 100"),!1):(r.error("Application ID is not configured, no RUM data will be collected."),!1):(r.error("Client Token is not configured, we will not send any data."),!1)}(t)&&(t.publicApiKey&&(t.clientToken=t.publicApiKey),u=(n=e(t,(function(){return{user:a,context:o.get()}}))).configuration,l=n.startView,m=n.addAction,h=n.addError,f=n.addTiming,s=n.getInternalContext,u.isEnabled("view-renaming")&&(d=l),c.drain(),i=!0)})),addRumGlobalContext:K(o.add),removeRumGlobalContext:K(o.remove),getRumGlobalContext:K(o.get),setRumGlobalContext:K(o.set),getInternalContext:K((function(t){return s(t)})),addAction:K((function(t,e){m({name:t,context:u(e),startClocks:Jt(),type:qt.CUSTOM})})),addUserAction:function(t,e){y.addAction(t,e)},addError:K((function(t,e,n){var i;void 0===n&&(n=l),n===l||n===p||n===v?i=n:(r.error("DD_RUM.addError: Invalid source '"+n+"'"),i=l),h({error:t,context:u(e),source:i,startClocks:Jt()})})),addTiming:K((function(t){f(t)})),setUser:K((function(t){var e=function(t){if("object"==typeof t&&t){var e=u(t);return"id"in e&&(e.id=String(e.id)),"name"in e&&(e.name=String(e.name)),"email"in e&&(e.email=String(e.email)),e}}(t);e?a=e:r.error("Unsupported user:",t)})),removeUser:K((function(){a={}}))},T=t(t({},g),{onReady:function(t){t()}}),Object.defineProperty(T,"_setDebug",{get:function(){return Q},enumerable:!1}),T);return y.startView=K((function(t){d(t)})),y}((function(e,n){var r=new ee,i=Pt(e,Qn),o=i.configuration,u=i.internalMonitoring,s=Xn(o,r);u.setExternalContextProvider((function(){return a({application_id:e.applicationId},c.findView(),n().context)}));var c=function(t,e,n,r,i){var o=function(t,e){var n,r,i,o=[],a=[];t.subscribe(Ft.VIEW_CREATED,(function(t){n=t,i=e.getId()})),t.subscribe(Ft.VIEW_UPDATED,(function(t){n&&n.id===t.id&&(n=t)})),t.subscribe(Ft.VIEW_ENDED,(function(t){var e=t.endClocks;n&&(o.unshift({endTime:e.relative,context:c(),startTime:n.startClocks.relative}),n=void 0)})),t.subscribe(Ft.AUTO_ACTION_CREATED,(function(t){r=t})),t.subscribe(Ft.AUTO_ACTION_COMPLETED,(function(t){r&&a.unshift({context:f(),endTime:r.startClocks.relative+t.duration,startTime:r.startClocks.relative}),r=void 0})),t.subscribe(Ft.AUTO_ACTION_DISCARDED,(function(){r=void 0})),t.subscribe(Ft.SESSION_RENEWED,(function(){o=[],a=[],n=void 0,r=void 0}));var u=setInterval(K((function(){s(o,144e5),s(a,3e5)})),6e4);function s(t,e){for(var n=Yt()-e;t.length>0&&t[t.length-1].startTime<n;)t.pop()}function c(){return{session:{id:i},view:{id:n.id,name:n.name,referrer:n.referrer,url:n.location.href}}}function f(){return{action:{id:r.id}}}function d(t,e,n,r){if(void 0===r)return n?t():void 0;if(n&&r>=n.startClocks.relative)return t();for(var i=0,o=e;i<o.length;i++){var a=o[i];if(r>a.endTime)break;if(r>=a.startTime)return a.context}}return{findAction:function(t){return d(f,a,r,t)},findView:function(t){return d(c,o,n,t)},stop:function(){clearInterval(u)}}}(e,r),a=Jn(n,e);return ke(t,n,e,r,o,i),{parentContexts:o,stop:function(){a.stop()}}}(e.applicationId,r,o,s,n).parentContexts;!function(t){t.subscribe(Ft.PERFORMANCE_ENTRY_COLLECTED,(function(e){if("longtask"===e.entryType){var n=Gt(e.startTime),r={date:n.timeStamp,long_task:{duration:$t(e.duration)},type:Vt.LONG_TASK};t.notify(Ft.RAW_RUM_EVENT_COLLECTED,{rawRumEvent:r,startTime:n.relative})}}))}(r),Pn(r,s);var f=Kn(r,location),d=f.addTiming,l=f.startView,p=Nn(r,o).addError,v=function(e,n){return e.subscribe(Ft.AUTO_ACTION_COMPLETED,(function(t){return e.notify(Ft.RAW_RUM_EVENT_COLLECTED,An(t))})),n.trackInteractions&&Rn(e),{addAction:function(n,r){e.notify(Ft.RAW_RUM_EVENT_COLLECTED,t({savedCommonContext:r},An(n)))}}}(r,o).addAction;sn(r,o),Re(r,o),ne(r);var m=function(t,e,n){return{get:function(r){var i=n.findView(r);if(e.isTracked()&&i&&i.session.id){var o=n.findAction(r);return{application_id:t,session_id:i.session.id,user_action:o?{id:o.action.id}:void 0,view:i.view}}}}}(e.applicationId,s,c);return{addAction:v,addError:p,addTiming:d,startView:l,configuration:o,lifeCycle:r,parentContexts:c,session:s,getInternalContext:m.get}}));Zn=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}(),er=rr,nr=Zn[tr="DD_RUM"],Zn[tr]=er,nr&&nr.q&&nr.q.forEach((function(t){return St(t,"onReady callback threw an error:")()}))}();
{
"name": "@datadog/browser-rum",
"version": "2.10.0",
"version": "2.11.1",
"license": "Apache-2.0",

@@ -15,4 +15,4 @@ "main": "cjs/index.js",

"dependencies": {
"@datadog/browser-core": "2.10.0",
"@datadog/browser-rum-core": "2.10.0",
"@datadog/browser-core": "2.11.1",
"@datadog/browser-rum-core": "2.11.1",
"tslib": "^1.10.0"

@@ -25,3 +25,3 @@ },

},
"gitHead": "b096bbce392494bdec53fbd17394ca74511c604b"
"gitHead": "6e95f9755e7926c30395bd29f484848da80bb37d"
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc