@flashcatcloud/browser-logs
Advanced tools
@@ -1,1 +0,1 @@ | ||
| (()=>{const e={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},t=console,n={};Object.keys(e).forEach((e=>{n[e]=t[e]}));const o="Datadog Browser SDK:",r={debug:n.debug.bind(t,o),log:n.log.bind(t,o),info:n.info.bind(t,o),warn:n.warn.bind(t,o),error:n.error.bind(t,o)},s="https://docs.datadoghq.com",i=s+"/real_user_monitoring/browser/troubleshooting",a="More details:";function c(e,t){return(...n)=>{try{return e(...n)}catch(e){r.error(t,e)}}}let u,l=!1;function d(e){l=e}function f(e){return function(){return p(e,this,arguments)}}function p(e,t,n){try{return e.apply(t,n)}catch(e){g(e)}}function g(e){if(m(e),u)try{u(e)}catch(e){m(e)}}function m(...e){l&&r.error("[MONITOR]",...e)}function y(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let e=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof e&&(e="object"==typeof self?self:"object"==typeof window?window:{}),e}function h(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function b(e,t,n=function(){if("undefined"!=typeof WeakSet){const e=new WeakSet;return{hasAlreadyBeenSeen(t){const n=e.has(t);return n||e.add(t),n}}}const e=[];return{hasAlreadyBeenSeen(t){const n=e.indexOf(t)>=0;return n||e.push(t),n}}}()){if(void 0===t)return e;if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const e=t.flags||(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.sticky?"y":"")+(t.unicode?"u":"");return RegExp(t.source,e)}if(n.hasAlreadyBeenSeen(t))return;if(Array.isArray(t)){const o=Array.isArray(e)?e:[];for(let e=0;e<t.length;++e)o[e]=b(o[e],t[e],n);return o}const o="object"===h(e)?e:{};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(o[e]=b(o[e],t[e],n));return o}function v(e){return b(void 0,e)}function w(...e){let t;for(const n of e)null!=n&&(t=b(t,n));return t}const S=/[^\u0000-\u007F]/;function k(e){return S.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length}function x(e,t){const n=y();let o;return n.Zone&&"function"==typeof n.Zone.__symbol__&&(o=e[n.Zone.__symbol__(t)]),o||(o=e[t]),o}function C(e,t){return x(y(),"setTimeout")(f(e),t)}function _(e){x(y(),"clearTimeout")(e)}function E(e,t){return x(y(),"setInterval")(f(e),t)}function T(e){x(y(),"clearInterval")(e)}function R(){}function O(e,t,n){if("object"!=typeof e||null===e)return JSON.stringify(e);const o=L(Object.prototype),r=L(Array.prototype),s=L(Object.getPrototypeOf(e)),i=L(e);try{return JSON.stringify(e,t,n)}catch(e){return"<error: unable to serialize object>"}finally{o(),r(),s(),i()}}function L(e){const t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):R}function A(e,t=225280){const n=L(Object.prototype),o=L(Array.prototype),r=[],s=new WeakMap,i=I(e,"$",void 0,r,s),a=JSON.stringify(i);let c=a?a.length:0;if(!(c>t)){for(;r.length>0&&c<t;){const n=r.shift();let o=0;if(Array.isArray(n.source))for(let i=0;i<n.source.length;i++){const a=I(n.source[i],n.path,i,r,s);if(c+=void 0!==a?JSON.stringify(a).length:4,c+=o,o=1,c>t){P(t,"truncated",e);break}n.target[i]=a}else for(const i in n.source)if(Object.prototype.hasOwnProperty.call(n.source,i)){const a=I(n.source[i],n.path,i,r,s);if(void 0!==a&&(c+=JSON.stringify(a).length+o+i.length+3,o=1),c>t){P(t,"truncated",e);break}n.target[i]=a}}return n(),o(),i}P(t,"discarded",e)}function I(e,t,n,o,r){const s=function(e){const t=e;if(t&&"function"==typeof t.toJSON)try{return t.toJSON()}catch(e){}return e}(e);if(!s||"object"!=typeof s)return"bigint"==typeof(i=s)?"[BigInt] "+i.toString():"function"==typeof i?"[Function] "+(i.name||"unknown"):"symbol"==typeof i?"[Symbol] "+(i.description||i.toString()):i;var i;const a=$(s);if("[Object]"!==a&&"[Array]"!==a&&"[Error]"!==a)return a;const c=e;if(r.has(c))return`[Reference seen at ${r.get(c)}]`;const u=void 0!==n?`${t}.${n}`:t,l=Array.isArray(s)?[]:{};return r.set(c,u),o.push({source:s,target:l,path:u}),l}function $(e){try{if(e instanceof Event)return{type:(t=e).type,isTrusted:t.isTrusted,currentTarget:t.currentTarget?$(t.currentTarget):null,target:t.target?$(t.target):null};if(e instanceof RegExp)return"[RegExp] "+e.toString();const n=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch(e){}var t;return"[Unserializable]"}function P(e,t,n){r.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,n)}class M{constructor(e){this.onFirstSubscribe=e,this.observers=[]}subscribe(e){return this.observers.push(e),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter((t=>e!==t)),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(e){this.observers.forEach((t=>t(e)))}}function U(...e){return new M((t=>{const n=e.map((e=>e.subscribe((e=>t.notify(e)))));return()=>n.forEach((e=>e.unsubscribe()))}))}function B(e,t,n){const o={...e};for(const[e,{required:s,type:i}]of Object.entries(t))"string"!==i||q(o[e])||(o[e]=o[e]+""),s&&q(o[e])&&r.warn(`The property ${e} of ${n} is required; context will not be sent to the intake.`);return o}function q(e){return null==e||""===e}function D(e="",{propertiesConfig:t={}}={}){let n={};const o=new M,s={getContext:()=>v(n),setContext(i){!function(e){const t="object"===h(e);return t||r.error("Unsupported context:",e),t}(i)?s.clearContext():n=A(B(i,t,e)),o.notify()},setContextProperty(r,s){n=A(B({...n,[r]:s},t,e)),o.notify()},removeContextProperty(r){delete n[r],B(n,t,e),o.notify()},clearContext(){n={},o.notify()},changeObservable:o};return s}const j={GRANTED:"granted",NOT_GRANTED:"not-granted"};function N(e,t,n,o,r){return F(e,t,[n],o,r)}function F(e,t,n,o,{once:r,capture:s,passive:i}={}){const a=f((t=>{(t.isTrusted||t.__ddIsTrusted||e.allowUntrustedEvents)&&(r&&d(),o(t))})),c=i?{capture:s,passive:i}:s,u=window.EventTarget&&t instanceof EventTarget?window.EventTarget.prototype:t,l=x(u,"addEventListener");function d(){const e=x(u,"removeEventListener");n.forEach((n=>e.call(t,n,a,c)))}return n.forEach((e=>l.call(t,e,a,c))),{stop:d}}function H(e,t){return Object.keys(e).some((n=>e[n]===t))}function G(e){return 0===Object.keys(e).length}const z=[];function J(e,t,n,o){const r=function(e,t){return`_dd_c_${e}_${t}`}(n,o);z.push(N(e,window,"storage",(({key:e})=>{r===e&&t.setContext(i())}))),t.changeObservable.subscribe((function(){localStorage.setItem(r,JSON.stringify(t.getContext()))}));const s=w(i(),t.getContext());function i(){const e=localStorage.getItem(r);return e?JSON.parse(e):{}}G(s)||t.setContext(s)}const W="?";function V(e){const t=[];let n=oe(e,"stack");const o=e+"";return n&&n.startsWith(o)&&(n=n.slice(o.length)),n&&n.split("\n").forEach((e=>{const n=function(e){const t=X.exec(e);if(!t)return;const n=t[2]&&0===t[2].indexOf("native"),o=t[2]&&0===t[2].indexOf("eval"),r=Y.exec(t[2]);return o&&r&&(t[2]=r[1],t[3]=r[2],t[4]=r[3]),{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||W,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){const t=Q.exec(e);if(t)return{args:[],column:t[3]?+t[3]:void 0,func:W,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){const t=ee.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||W,line:+t[3],url:t[2]}}(e)||function(e){const t=te.exec(e);if(!t)return;const n=t[3]&&t[3].indexOf(" > eval")>-1,o=ne.exec(t[3]);return n&&o&&(t[3]=o[1],t[4]=o[2],t[5]=void 0),{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||W,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=W),t.push(n))})),{message:oe(e,"message"),name:oe(e,"name"),stack:t}}const K="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",Z="(?::(\\d+))",X=RegExp(`^\\s*at (.*?) ?\\(${K}${Z}?${Z}?\\)?\\s*$`,"i"),Y=RegExp(`\\((\\S*)${Z}${Z}\\)`),Q=RegExp(`^\\s*at ?${K}${Z}?${Z}??\\s*$`,"i"),ee=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,te=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?\s*$/i,ne=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function oe(e,t){if("object"!=typeof e||!e||!(t in e))return;const n=e[t];return"string"==typeof n?n:void 0}const re=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function se(e){const t=Error(e);let n;return t.name="HandlingStack",p((()=>{const e=V(t);e.stack=e.stack.slice(2),n=ie(e)})),n}function ie(e){let t=ae(e);return e.stack.forEach((e=>{const n="?"===e.func?"<anonymous>":e.func,o=e.args&&e.args.length>0?`(${e.args.join(", ")})`:"",r=e.line?":"+e.line:"",s=e.line&&e.column?":"+e.column:"";t+=`\n at ${n}${o} @ ${e.url}${r}${s}`})),t}function ae(e){return`${e.name||"Error"}: ${e.message}`}const ce="No stack, consider using an instance of Error";function ue({stackTrace:e,originalError:t,handlingStack:n,componentStack:o,startClocks:r,nonErrorPrefix:s,useFallbackStack:i=!0,source:a,handling:c}){const u=pe(t);return!e&&u&&(e=V(t)),{startClocks:r,source:a,handling:c,handlingStack:n,componentStack:o,originalError:t,type:e?e.name:void 0,message:le(e,u,s,t),stack:e?ie(e):i?ce:void 0,causes:u?ge(t,a):void 0,fingerprint:de(t),context:fe(t)}}function le(e,t,n,o){return(null==e?void 0:e.message)&&(null==e?void 0:e.name)?e.message:t?"Empty message":`${n} ${O(A(o))}`}function de(e){return pe(e)&&"dd_fingerprint"in e?e.dd_fingerprint+"":void 0}function fe(e){if(null!==e&&"object"==typeof e&&"dd_context"in e)return e.dd_context}function pe(e){return e instanceof Error||"[object Error]"===Object.prototype.toString.call(e)}function ge(e,t){let n=e;const o=[];for(;pe(null==n?void 0:n.cause)&&o.length<10;){const e=V(n.cause);o.push({message:n.cause.message,source:t,type:null==e?void 0:e.name,stack:e&&ie(e)}),n=n.cause}return o.length?o:void 0}var me;!function(e){e.PROFILING="profiling",e.TRACK_INTAKE_REQUESTS="track_intake_requests",e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.DOM_MUTATION_IGNORING="dom_mutation_ignoring"}(me||(me={}));const ye=new Set,he="browser.flashcat.cloud",be=["ddsource","ddtags"];function ve(){return(new Date).getTime()}function we(){return ve()}function Se(){return performance.now()}function ke(){return{relative:Se(),timeStamp:we()}}let xe;function Ce(){return void 0===xe&&(xe=performance.timing.navigationStart),xe}function _e(e,t){const n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function Ee(e){return 0!==e&&100*Math.random()<=e}function Te(){var e;const t=window.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:null===(e=t.connection)||void 0===e?void 0:e.effectiveType}}function Re(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function Oe(){const e=[];return{add(t){e.push(t)>500&&e.splice(0,1)},remove(t){Re(e,t)},drain(t){e.forEach((e=>e(t))),e.length=0}}}const Le="log",Ae="configuration",Ie="usage",$e=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Pe=["browser.flashcat.cloud"];let Me=Oe(),Ue=e=>{Me.add((()=>Ue(e)))};function Be(t,n){m(e.debug,t,n),Ue({type:Le,message:t,status:"debug",...n})}function qe(e,t){Ue({type:Le,status:"error",...De(e),...t})}function De(e){if(pe(e)){const t=V(e);return{error:{kind:t.name,stack:ie(je(t))},message:t.message}}return{error:{stack:ce},message:"Uncaught "+O(e)}}function je(e){return e.stack=e.stack.filter((e=>!e.url||$e.some((t=>e.url.startsWith(t))))),e}function Ne(e,t){t.silentMultipleInit||r.error(e+" is already initialized.")}const Fe="agent",He="console",Ge="logger",ze="source",Je="report";function We(e,t,n){const o=n.getHandler(),r=Array.isArray(o)?o:[o];return Ke[e]>=Ke[n.getLevel()]&&r.includes(t)}const Ve={ok:"ok",debug:"debug",info:"info",notice:"notice",warn:"warn",error:"error",critical:"critical",alert:"alert",emerg:"emerg"},Ke={[Ve.ok]:0,[Ve.debug]:1,[Ve.info]:2,[Ve.notice]:4,[Ve.warn]:5,[Ve.error]:6,[Ve.critical]:7,[Ve.alert]:8,[Ve.emerg]:9};function Ze(e,{includeMessage:t=!1}={}){return{stack:e.stack,kind:e.type,message:t?e.message:void 0,causes:e.causes,fingerprint:e.fingerprint,handling:e.handling}}const Xe="http",Ye=Object.keys(Ve);class Qe{constructor(e,t,n=Xe,o=Ve.debug,r={}){this.handleLogStrategy=e,this.handlerType=n,this.level=o,this.contextManager=D("logger"),this.contextManager.setContext(r),t&&this.contextManager.setContextProperty("logger",{name:t})}logImplementation(e,t,n=Ve.info,o,r){const s=A(t);let i;i=null!=o?w({error:Ze(ue({originalError:o,nonErrorPrefix:"Provided",source:Ge,handling:"handled",startClocks:ke()}),{includeMessage:!0})},s):s,this.handleLogStrategy({message:A(e),context:i,status:n},this,r)}log(e,t,n=Ve.info,o){let r;We(n,Xe,this)&&(r=se("log")),this.logImplementation(e,t,n,o,r)}setContext(e){this.contextManager.setContext(e)}getContext(){return this.contextManager.getContext()}setContextProperty(e,t){this.contextManager.setContextProperty(e,t)}removeContextProperty(e){this.contextManager.removeContextProperty(e)}clearContext(){this.contextManager.clearContext()}setHandler(e){this.handlerType=e}getHandler(){return this.handlerType}setLevel(e){this.level=e}getLevel(){return this.level}}function et(e){return function(t,n,o){let r;We(e,Xe,this)&&(r=se("log")),this.logImplementation(t,n,e,o,r)}}function tt(){const e=y().DatadogEventBridge;if(e)return{getCapabilities(){var t;return JSON.parse((null===(t=e.getCapabilities)||void 0===t?void 0:t.call(e))||"[]")},getPrivacyLevel(){var t;return null===(t=e.getPrivacyLevel)||void 0===t?void 0:t.call(e)},getAllowedWebViewHosts(){return JSON.parse(e.getAllowedWebViewHosts())},send(t,n,o){const r=o?{id:o}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:r}))}}}function nt(e){var t;void 0===e&&(e=null===(t=y().location)||void 0===t?void 0:t.hostname);const n=tt();return!!n&&n.getAllowedWebViewHosts().some((t=>e===t||e.endsWith("."+t)))}function ot(e,t,n,{computeHandlingStack:o}={}){let r=e[t];if("function"!=typeof r){if(!(t in e)||!t.startsWith("on"))return{stop:R};r=R}let s=!1;const i=function(){if(s)return r.apply(this,arguments);const e=Array.from(arguments);let t;p(n,null,[{target:this,parameters:e,onPostCall(e){t=e},handlingStack:o?se("instrumented method"):void 0}]);const i=r.apply(this,e);return t&&p(t,null,[i]),i};return e[t]=i,{stop(){s=!0,e[t]===i&&(e[t]=r)}}}function rt(e){return function(e,t){const n=function(){if(void 0===it)try{const e=new st("http://test/path");it="http://test/path"===e.href}catch(e){it=!1}return it?st:void 0}();if(n)try{return void 0!==t?new n(e,t):new n(e)}catch(n){throw Error(`Failed to construct URL: ${n+""} ${O({url:e,base:t})}`)}if(void 0===t&&!/:/.test(e))throw Error(`Invalid URL: '${e}'`);let o=document;const r=o.createElement("a");if(void 0!==t){o=document.implementation.createHTMLDocument("");const e=o.createElement("base");e.href=t,o.head.appendChild(e),o.body.appendChild(r)}return r.href=e,r}(e,location.href).href}(function(e,t,n,o){var r,s=arguments.length,i=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(i=(s<3?r(i):s>3?r(t,n,i):r(t,n))||i);s>3&&i&&Object.defineProperty(t,n,i)})([function(e,t,n){const o=n.value;n.value=function(...e){return(u?f(o):o).apply(this,e)}}],Qe.prototype,"logImplementation",null),Qe.prototype.ok=et(Ve.ok),Qe.prototype.debug=et(Ve.debug),Qe.prototype.info=et(Ve.info),Qe.prototype.notice=et(Ve.notice),Qe.prototype.warn=et(Ve.warn),Qe.prototype.error=et(Ve.error),Qe.prototype.critical=et(Ve.critical),Qe.prototype.alert=et(Ve.alert),Qe.prototype.emerg=et(Ve.emerg);const st=URL;let it,at;function ct(){return at||(at=new M((e=>{if(!window.fetch)return;const{stop:t}=ot(window,"fetch",(t=>function({parameters:e,onPostCall:t,handlingStack:n},o){const[r,s]=e;let i=s&&s.method;void 0===i&&r instanceof Request&&(i=r.method);const a=void 0!==i?(i+"").toUpperCase():"GET",c=r instanceof Request?r.url:rt(r+""),u={state:"start",init:s,input:r,method:a,startClocks:ke(),url:c,handlingStack:n};o.notify(u),e[0]=u.input,e[1]=u.init,t((e=>function(e,t,n){const o=n;function r(t){o.state="resolve",Object.assign(o,t),e.notify(o)}t.then(f((e=>{r({response:e,responseType:e.type,status:e.status,isAborted:!1})})),f((e=>{var t,n;r({status:0,isAborted:(null===(n=null===(t=o.init)||void 0===t?void 0:t.signal)||void 0===n?void 0:n.aborted)||e instanceof DOMException&&e.code===DOMException.ABORT_ERR,error:e})})))}(o,e,u)))}(t,e)),{computeHandlingStack:!0});return t}))),at}function ut(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,ut)}const lt=/([\w-]+)\s*=\s*([^;]+)/g;function dt(e,t,n=""){const o=e.charCodeAt(t-1),r=o>=55296&&o<=56319?t+1:t;return e.length<=r?e:`${e.slice(0,r)}${n}`}let ft,pt,gt;function mt(e,t,n=0,o){const r=new Date;r.setTime(r.getTime()+n);const s="expires="+r.toUTCString(),i=o&&o.crossSite?"none":"strict",a=o&&o.domain?";domain="+o.domain:"",c=o&&o.secure?";secure":"",u=o&&o.partitioned?";partitioned":"";document.cookie=`${e}=${t};${s};path=/;samesite=${i}${a}${c}${u}`}function yt(e){return function(e,t){for(lt.lastIndex=0;;){const n=lt.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}function ht(e){return pt||(pt=function(e){const t=new Map;for(lt.lastIndex=0;;){const n=lt.exec(e);if(!n)break;t.set(n[1],n[2])}return t}(document.cookie)),pt.get(e)}function bt(e,t){mt(e,"",0,t)}const vt="_dd_s";function wt(e){return Object.values(e)}const St=144e5,kt=9e5,xt="cookie",Ct="local-storage",_t=/^([a-zA-Z]+)=([a-z0-9-]+)$/;function Et(e,t){const n={isExpired:"1"};return t.trackAnonymousUser&&((null==e?void 0:e.anonymousId)?n.anonymousId=null==e?void 0:e.anonymousId:n.anonymousId=ut()),n}function Tt(e){return G(e)}function Rt(e){return!Tt(e)}function Ot(e){return void 0!==e.isExpired||!((void 0===(t=e).created||ve()-Number(t.created)<St)&&(void 0===t.expire||ve()<Number(t.expire)));var t}function Lt(e){e.expire=ve()+kt+""}function At(e){return(t=e,Object.entries(t)).map((([e,t])=>"anonymousId"===e?"aid="+t:`${e}=${t}`)).join("&");var t}function It(e){const t={};return function(e){return!!e&&(-1!==e.indexOf("&")||_t.test(e))}(e)&&e.split("&").forEach((e=>{const n=_t.exec(e);if(null!==n){const[,e,o]=n;"aid"===e?t.anonymousId=o:t[e]=o}})),t}function $t(e){const t=function(e){const t={};return t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===gt){const e="dd_site_test_"+ut(),t="test",n=window.location.hostname.split(".");let o=n.pop();for(;n.length&&!yt(e);)o=`${n.pop()}.${o}`,mt(e,t,1e3,{domain:o});bt(e,{domain:o}),gt=o}return gt}()),t}(e);return function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{const t="dd_cookie_test_"+ut(),n="test";mt(t,n,6e4,e);const o=yt(t)===n;return bt(t,e),o}catch(e){return r.error(e),!1}}(t)?{type:xt,cookieOptions:t}:void 0}function Pt(e,t,n,o){mt(vt,At(n),t.trackAnonymousUser?31536e6:o,e)}function Mt(){return It(yt(vt))}function Ut(){try{const e=ut(),t="_dd_test_"+e;localStorage.setItem(t,e);const n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:Ct}:void 0}catch(e){return}}function Bt(e){localStorage.setItem(vt,At(e))}function qt(){return It(localStorage.getItem(vt))}const Dt=[];let jt;function Nt(e,t,n=0){var o;const{isLockEnabled:r,persistSession:s,expireSession:i}=t,a=e=>s({...e,lock:u}),c=()=>{const e=t.retrieveSession(),n=e.lock;return e.lock&&delete e.lock,{session:e,lock:n}};if(jt||(jt=e),e!==jt)return void Dt.push(e);if(r&&n>=100)return void Ht(t);let u,l=c();if(r){if(l.lock)return void Ft(e,t,n);if(u=ut(),a(l.session),l=c(),l.lock!==u)return void Ft(e,t,n)}let d=e.process(l.session);if(r&&(l=c(),l.lock!==u))Ft(e,t,n);else{if(d&&(Ot(d)?i(d):(Lt(d),r?a(d):s(d))),r&&(!d||!Ot(d))){if(l=c(),l.lock!==u)return void Ft(e,t,n);s(l.session),d=l.session}null===(o=e.after)||void 0===o||o.call(e,d||l.session),Ht(t)}}function Ft(e,t,n){C((()=>{Nt(e,t,n+1)}),10)}function Ht(e){jt=void 0;const t=Dt.shift();t&&Nt(t,e)}function Gt(e){switch(e.sessionPersistence){case xt:return $t(e);case Ct:return Ut();case void 0:{let t=$t(e);return!t&&e.allowFallbackToLocalStorage&&(t=Ut()),t}default:r.error(`Invalid session persistence '${e.sessionPersistence+""}'`)}}function zt(e,t,n){const o=function(e,t){const n="/api/v2/"+t,o=e.proxy;if("string"==typeof o){const e=rt(o);return t=>`${e}?ddforward=${encodeURIComponent(`${n}?${t}`)}`}if("function"==typeof o)return e=>o({path:n,parameters:e});const r=function(e,t){const{site:n=he,internalAnalyticsSubdomain:o}=t;return"logs"===e&&t.usePciIntake&&n===he?"pci.browser-intake-datadoghq.com":o&&n===he?`${o}.${he}`:"http://10.99.1.110:11300"===n?"http-intake.logs."+n:n}(t,e);return e=>`https://${r}${n}?${e}`}(e,t);return{build(r,s){const i=function({clientToken:e,internalAnalyticsSubdomain:t},n,o,r,{retry:s,encoding:i}){const a=["sdk_version:0.0.4-alpha.2","api:"+r].concat(o);s&&a.push("retry_count:"+s.count,"retry_after:"+s.lastFailureStatus);const c=["ddsource=browser","ddtags="+encodeURIComponent(a.join(",")),"dd-api-key="+e,"dd-evp-origin-version="+encodeURIComponent("0.0.4-alpha.2"),"dd-evp-origin=browser","dd-request-id="+ut()];return i&&c.push("dd-evp-encoding="+i),"rum"===n&&c.push("batch_time="+we()),t&&c.reverse(),c.join("&")}(e,t,n,r,s);return o(i)},tags:n,urlPrefix:o(""),trackType:t}}function Jt(e,t){const n=200-e.length-1;return(t.length>n||function(e){return!!function(){try{return RegExp("[\\p{Ll}]","u"),!0}catch(e){return!1}}()&&RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e)}(t))&&r.warn(`${e} value doesn't meet tag requirements and will be sanitized. ${a} ${s}/getting_started/tagging/#defining-tags`),`${e}:${t.replace(/,/g,"_")}`}function Wt(e){const t=e.site||he,n=function(e){const{env:t,service:n,version:o,datacenter:r}=e,s=[];return t&&s.push(Jt("env",t)),n&&s.push(Jt("service",n)),o&&s.push(Jt("version",o)),r&&s.push(Jt("datacenter",r)),s}(e),o=function(e,t){return{logsEndpointBuilder:zt(e,"logs",t),rumEndpointBuilder:zt(e,"rum",t),profilingEndpointBuilder:zt(e,"profile",t),sessionReplayEndpointBuilder:zt(e,"replay",t)}}(e,n),r=function(e,t){if(!e.replica)return;const n={...e,site:he,clientToken:e.replica.clientToken},o={logsEndpointBuilder:zt(n,"logs",t),rumEndpointBuilder:zt(n,"rum",t)};return{applicationId:e.replica.applicationId,...o}}(e,n);return{replica:r,site:t,...o}}function Vt(e,t){return null==e||"string"==typeof e||(r.error(t+" must be defined as a string"),!1)}function Kt(e,t){return!!(void 0===e||(n=e,function(e){return"number"==typeof e}(n)&&n>=0&&n<=100))||(r.error(t+" Sample Rate should be a number between 0 and 100"),!1);var n}const Zt={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Xt(e){return{startClocks:ke(),source:Je,handling:"unhandled",...e}}function Yt(e,t,n,o,r){return n?ie({name:e,message:t,stack:[{func:"?",url:n,line:null!=o?o:void 0,column:null!=r?r:void 0}]}):void 0}function Qt(e,t,n){return void 0===e?[]:"all"===e||Array.isArray(e)&&e.every((e=>t.includes(e)))?"all"===e?t:function(e){const t=new Set;return e.forEach((e=>t.add(e))),Array.from(t)}(e):void r.error(`${n} should be "all" or an array with allowed values "${t.join('", "')}"`)}const en="logs",tn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function nn(){return!(!window._DATADOG_SYNTHETICS_INJECTS_RUM&&!ht("datadog-synthetics-injects-rum"))}function on(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||ht("datadog-synthetics-public-id");return"string"==typeof e?e:void 0}function rn(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||ht("datadog-synthetics-result-id");return"string"==typeof e?e:void 0}const sn=1/0;let an=null;const cn=new Set,un=St;let ln=[];function dn(e,t,n,o){const r=new M,s=new M,i=function(e,t,n,o){const r=new M,s=new M,i=new M,a=e.type===xt?function(e,t){const n={isLockEnabled:0===(null!=ft?ft:ft=function(e=window){var t;const n=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(n)?0:0===(null===(t=e.navigator.vendor)||void 0===t?void 0:t.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n)?1:2}()),persistSession:n=>Pt(t,e,n,kt),retrieveSession:Mt,expireSession:n=>Pt(t,e,Et(n,e),St)};return function(e){if(!ht(vt)){const t=ht("_dd"),n=ht("_dd_r"),o=ht("_dd_l"),r={};t&&(r.id=t),o&&/^[01]$/.test(o)&&(r.logs=o),n&&/^[012]$/.test(n)&&(r.rum=n),Rt(r)&&(Lt(r),e.persistSession(r))}}(n),n}(t,e.cookieOptions):function(e){return{isLockEnabled:!1,persistSession:Bt,retrieveSession:qt,expireSession:t=>function(e,t){Bt(Et(e,t))}(t,e)}}(t),{expireSession:c}=a,u=E((function(){Nt({process(e){return Ot(e)?Et(e,t):void 0},after:p},a)}),1e3);let l;g();const{throttled:d,cancel:f}=function(e){let t,n,o=!1;return{throttled(...r){o?t=r:(e(...r),o=!0,n=C((()=>{t&&e(...t),o=!1,t=void 0}),1e3))},cancel(){_(n),o=!1,t=void 0}}}((()=>{Nt({process(e){if(Tt(e))return;const t=p(e);return function(e){if(Tt(e))return!1;const{trackingType:t,isTracked:r}=o(e[n]);e[n]=t,delete e.isExpired,r&&!e.id&&(e.id=ut(),e.created=ve()+"")}(t),t},after(e){Rt(e)&&!m()&&function(e){l=e,r.notify()}(e),l=e}},a)}));function p(e){return Ot(e)&&(e=Et(e,t)),m()&&(function(e){return l.id!==e.id||l[n]!==e[n]}(e)?(l=Et(l,t),s.notify()):(i.notify({previousState:l,newState:e}),l=e)),e}function g(){Nt({process(e){if(Tt(e))return Et(e,t)},after(e){l=e}},a)}function m(){return void 0!==l[n]}return{expandOrRenewSession:d,expandSession(){Nt({process(e){return m()?p(e):void 0}},a)},getSession(){return l},renewObservable:r,expireObservable:s,sessionStateUpdateObservable:i,restartSession:g,expire(){f(),c(l),p(Et(l,t))},stop(){T(u)},updateSessionState(e){Nt({process(t){return{...t,...e}},after:p},a)}}}(e.sessionStoreStrategyType,e,t,n);ln.push((()=>i.stop()));const a=function({expireDelay:e,maxEntries:t}){let n=[];an||(an=E((()=>{cn.forEach((e=>e()))}),6e4));const o=()=>{const t=Se()-e;for(;n.length>0&&n[n.length-1].endTime<t;)n.pop()};return cn.add(o),{add(e,o){const r={value:e,startTime:o,endTime:sn,remove(){Re(n,r)},close(e){r.endTime=e}};return t&&n.length>=t&&n.pop(),n.unshift(r),r},find(e=1/0,t={returnInactive:!1}){for(const o of n)if(o.startTime<=e){if(t.returnInactive||e<=o.endTime)return o.value;break}},closeActive(e){const t=n[0];t&&t.endTime===sn&&t.close(e)},findAll(e=1/0,t=0){const o=e+t;return n.filter((t=>t.startTime<=o&&e<=t.endTime)).map((e=>e.value))},reset(){n=[]},stop(){cn.delete(o),0===cn.size&&an&&(T(an),an=null)}}}({expireDelay:un});function c(){return{id:i.getSession().id,trackingType:i.getSession()[t],isReplayForced:!!i.getSession().forcedReplay,anonymousId:i.getSession().anonymousId}}return ln.push((()=>a.stop())),i.renewObservable.subscribe((()=>{a.add(c(),Se()),r.notify()})),i.expireObservable.subscribe((()=>{s.notify(),a.closeActive(Se())})),i.expandOrRenewSession(),a.add(c(),[0,Ce()][0]),o.observable.subscribe((()=>{o.isGranted()?i.expandOrRenewSession():i.expire()})),function(e){const{stop:t}=F(e,window,["click","touchstart","keydown","scroll"],(()=>{o.isGranted()&&i.expandOrRenewSession()}),{capture:!0,passive:!0});ln.push(t)}(e),function(e){const t=()=>{"visible"===document.visibilityState&&i.expandSession()},{stop:n}=N(e,document,"visibilitychange",t);ln.push(n);const o=E(t,6e4);ln.push((()=>{T(o)}))}(e),function(e){const{stop:t}=N(e,window,"resume",(()=>i.restartSession()),{capture:!0});ln.push(t)}(e),{findSession:(e,t)=>a.find(e,t),renewObservable:r,expireObservable:s,sessionStateUpdateObservable:i.sessionStateUpdateObservable,expire:i.expire,updateSessionState:i.updateSessionState}}function fn(e){return Ee(e.sessionSampleRate)?"1":"0"}let pn={};const gn={[e.log]:Ve.info,[e.debug]:Ve.debug,[e.info]:Ve.info,[e.warn]:Ve.warn,[e.error]:Ve.error};let mn;const yn=new WeakMap;function hn({target:e,parameters:[t,n]}){yn.set(e,{state:"open",method:(t+"").toUpperCase(),url:rt(n+"")})}function bn({target:e}){const t=yn.get(e);t&&(t.isAborted=!0)}function vn(e){return e>=500}function wn(e,t){return e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function Sn(e){return"xhr"===e?"XHR":"Fetch"}const kn=class{constructor(){this.callbacks={}}notify(e,t){const n=this.callbacks[e];n&&n.forEach((e=>e(t)))}subscribe(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:()=>{this.callbacks[e]=this.callbacks[e].filter((e=>t!==e))}}}},xn={[Ve.ok]:e.debug,[Ve.debug]:e.debug,[Ve.info]:e.info,[Ve.notice]:e.info,[Ve.warn]:e.warn,[Ve.error]:e.error,[Ve.critical]:e.error,[Ve.alert]:e.error,[Ve.emerg]:e.error};function Cn({encoder:e,request:t,flushController:n,messageBytesLimit:o}){let s={};const c=n.flushObservable.subscribe((n=>function(n){const o=wt(s).join("\n");s={};const r=(a=n.reason,wt(tn).includes(a)),i=r?t.sendOnExit:t.send;var a;if(r&&e.isAsync){const t=e.finishSync();t.outputBytesCount&&i(_n(t));const n=[t.pendingData,o].filter(Boolean).join("\n");n&&i({data:n,bytesCount:k(n)})}else o&&e.write(e.isEmpty?o:"\n"+o),e.finish((e=>{i(_n(e))}))}(n)));function u(t,c){const u=O(t),l=e.estimateEncodedBytesCount(u);l>=o?r.warn(`Discarded a message whose size was bigger than the maximum allowed size ${o}KB. ${a} ${i}/#technical-limitations`):(function(e){return void 0!==e&&void 0!==s[e]}(c)&&function(t){const o=s[t];delete s[t];const r=e.estimateEncodedBytesCount(o);n.notifyAfterRemoveMessage(r)}(c),function(t,o,r){n.notifyBeforeAddMessage(o),void 0!==r?(s[r]=t,n.notifyAfterAddMessage()):e.write(e.isEmpty?t:"\n"+t,(e=>{n.notifyAfterAddMessage(e-o)}))}(u,l,c))}return{flushController:n,add:u,upsert:u,stop:c.unsubscribe}}function _n(e){let t;return t="string"==typeof e.output?e.output:new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function En(e,t,n,o,r){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?Rn(e,t,n,{onSuccess:()=>On(0,t,n,o,r),onFailure(){t.queuedPayloads.enqueue(e),Tn(t,n,o,r)}}):t.queuedPayloads.enqueue(e)}function Tn(e,t,n,o){2===e.transportStatus&&C((()=>{Rn(e.queuedPayloads.first(),e,t,{onSuccess(){e.queuedPayloads.dequeue(),e.currentBackoffTime=1e3,On(1,e,t,n,o)},onFailure(){e.currentBackoffTime=Math.min(6e4,2*e.currentBackoffTime),Tn(e,t,n,o)}})}),e.currentBackoffTime)}function Rn(e,t,n,{onSuccess:o,onFailure:r}){t.bandwidthMonitor.add(e),n(e,(n=>{t.bandwidthMonitor.remove(e),function(e){return"opaque"!==e.type&&(0===e.status&&!navigator.onLine||408===e.status||429===e.status||vn(e.status))}(n)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:n.status},r()):(t.transportStatus=0,o())}))}function On(e,t,n,o,r){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(r({message:`Reached max ${o} events size queued for upload: 3MiB`,source:Fe,startClocks:ke()}),t.queueFullReported=!0);const s=t.queuedPayloads;for(t.queuedPayloads=Ln();s.size()>0;)En(s.dequeue(),t,n,o,r)}function Ln(){const e=[];return{bytesCount:0,enqueue(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first(){return e[0]},dequeue(){const t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size(){return e.length},isFull(){return this.bytesCount>=3145728}}}function An(e,t,n){const o={transportStatus:0,currentBackoffTime:1e3,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=81920&&this.ongoingRequestCount<32},add(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:Ln(),queueFullReported:!1},r=(n,o)=>function(e,t,n,o){if(function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(e){return!1}}()&&n.bytesCount<t){const t=e.build("fetch-keepalive",n);fetch(t,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(f((e=>null==o?void 0:o({status:e.status,type:e.type})))).catch(f((()=>$n(e,n,o))))}else $n(e,n,o)}(e,t,n,o);return{send(t){En(t,o,r,e.trackType,n)},sendOnExit(n){!function(e,t,n){if(navigator.sendBeacon&&n.bytesCount<t)try{const t=e.build("beacon",n);if(navigator.sendBeacon(t,n.data))return}catch(e){!function(e){In||(In=!0,g(e))}(e)}$n(e,n)}(e,t,n)}}}let In=!1;function $n(e,t,n){const o=e.build("fetch",t);fetch(o,{method:"POST",body:t.data,mode:"cors"}).then(f((e=>null==n?void 0:n({status:e.status,type:e.type})))).catch(f((()=>null==n?void 0:n({status:0}))))}function Pn({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:o,sessionExpireObservable:r}){const s=o.subscribe((e=>d(e.reason))),i=r.subscribe((()=>d("session_expire"))),a=new M((()=>()=>{s.unsubscribe(),i.unsubscribe()}));let c,u=0,l=0;function d(e){if(0===l)return;const t=l,n=u;l=0,u=0,f(),a.notify({reason:e,messagesCount:t,bytesCount:n})}function f(){_(c),c=void 0}return{flushObservable:a,get messagesCount(){return l},notifyBeforeAddMessage(e){u+e>=t&&d("bytes_limit"),l+=1,u+=e,void 0===c&&(c=C((()=>{d("duration_limit")}),n))},notifyAfterAddMessage(n=0){u+=n,l>=e?d("messages_limit"):u>=t&&d("bytes_limit")},notifyAfterRemoveMessage(e){u-=e,l-=1,0===l&&f()}}}function Mn(e,t,n,o,r,s,i=Cn){const a=u(e,t),c=n&&u(e,n);function u(e,{endpoint:t,encoder:n}){return i({encoder:n,request:An(t,e.batchBytesLimit,o),flushController:Pn({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:r,sessionExpireObservable:s}),messageBytesLimit:e.messageBytesLimit})}return{flushObservable:a.flushController.flushObservable,add(e,t=!0){a.add(e),c&&t&&c.add(n.transformMessage?n.transformMessage(e):e)},upsert(e,t){a.upsert(e,t),c&&c.upsert(n.transformMessage?n.transformMessage(e):e,t)},stop(){a.stop(),c&&c.stop()}}}function Un(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,o){const r=k(n);t+=r,e+=n,o&&o(r)},finish(e){e(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(e){return e.length}}}const Bn="DISCARDED",qn="SKIPPED",Dn=function(){const o=D("global context"),i=D("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}}),l=D("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}}),g=function(e){const t=new M;return{tryToInit(t){e||(e=t)},update(n){e=n,t.notify()},isGranted:()=>e===j.GRANTED,observable:t}}();function m(){return function(e,t,n){return{view:{referrer:document.referrer,url:window.location.href},context:e.getContext(),user:t.getContext(),account:n.getContext()}}(o,i,l)}let y=function(t,n,o){const i=Oe();let u,l;const d=n.observable.subscribe(f);function f(){if(!l||!u||!n.isGranted())return;d.unsubscribe();const e=o(u,l);i.drain(e)}return{init(t){if(!t)return void r.error("Missing configuration");if(o=t.enableExperimentalFeatures,Array.isArray(o)&&o.filter((e=>H(me,e))).forEach((e=>{ye.add(e)})),nt()&&(t=function(e){return{...e,clientToken:"empty"}}(t)),u=t,l)return void Ne("FC_LOGS",t);var o;const i=function(t){!0===t.usePciIntake&&t.site&&"browser.flashcat.cloud"!==t.site&&r.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");const n=function(e){var t,n,o,i,u,l;if(e&&e.clientToken){if((!(d=e.site)||"string"!=typeof d||/(flashcat)/.test(d)||(r.error(`Site should be a valid Flashcat site. ${a} ${s}/getting_started/site/.`),0))&&Kt(e.sessionSampleRate,"Session")&&Kt(e.telemetrySampleRate,"Telemetry")&&Kt(e.telemetryConfigurationSampleRate,"Telemetry Configuration")&&Kt(e.telemetryUsageSampleRate,"Telemetry Usage")&&Vt(e.version,"Version")&&Vt(e.env,"Env")&&Vt(e.service,"Service")){var d;if(void 0===e.trackingConsent||H(j,e.trackingConsent))return{beforeSend:e.beforeSend&&c(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Gt(e),sessionSampleRate:null!==(t=e.sessionSampleRate)&&void 0!==t?t:100,telemetrySampleRate:null!==(n=e.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(o=e.telemetryConfigurationSampleRate)&&void 0!==o?o:5,telemetryUsageSampleRate:null!==(i=e.telemetryUsageSampleRate)&&void 0!==i?i:5,service:e.service||void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:null!==(u=e.trackingConsent)&&void 0!==u?u:j.GRANTED,trackAnonymousUser:null===(l=e.trackAnonymousUser)||void 0===l||l,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16384,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:3e4,batchMessagesLimit:50,messageBytesLimit:262144,...Wt(e)};r.error('Tracking Consent should be either "granted" or "not-granted"')}}else r.error("Client Token is not configured, we will not send any data.")}(t),o=Qt(t.forwardConsoleLogs,wt(e),"Forward Console Logs"),i=Qt(t.forwardReports,wt(Zt),"Forward Reports");if(n&&o&&i)return t.forwardErrorsToLogs&&!o.includes(e.error)&&o.push(e.error),{forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:o,forwardReports:i,requestErrorResponseLengthLimit:32768,...n}}(t);i&&(l=i,ct().subscribe(R),n.tryToInit(i.trackingConsent),f())},get initConfiguration(){return u},getInternalContext:R,handleLog(e,n,o,r=t(),s=we()){i.add((t=>t.handleLog(e,n,o,r,s)))}}}(m,g,((r,s)=>{r.storeContextsAcrossPages&&(J(s,o,en,2),J(s,i,en,1),J(s,l,en,4));const a=function(o,r,s,i){const a=new kn,c=function(){const e={};return{register:(t,n)=>(e[t]||(e[t]=[]),e[t].push(n),{unregister(){e[t]=e[t].filter((e=>e!==n))}}),triggerHook(t,n){const o=e[t]||[],r=[];for(const e of o){const t=e(n);if(t===Bn)return Bn;t!==qn&&r.push(t)}return w(...r)}}}(),l=[];a.subscribe(1,(e=>_e("logs",e)));const d=function(e){return t=>{e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,origin:Fe,status:Ve.error}}),Be("Error reported to customer",{"error.message":t.message})}}(a),g=function(e){return new M((t=>{const{stop:n}=F(e,window,["visibilitychange","freeze"],(e=>{"visibilitychange"===e.type&&"hidden"===document.visibilityState?t.notify({reason:tn.HIDDEN}):"freeze"===e.type&&t.notify({reason:tn.FROZEN})}),{capture:!0}),o=N(e,window,"beforeunload",(()=>{t.notify({reason:tn.UNLOADING})})).stop;return()=>{n(),o()}}))}(r),m=!r.sessionStoreStrategyType||nt()||nn()?function(e){const t="1"===fn(e)?{}:void 0;return{findTrackedSession(){return t},expireObservable:new M}}(r):function(e,t){const n=dn(e,"logs",(t=>function(e,t){const n=function(e){return"0"===e||"1"===e}(t)?t:fn(e);return{trackingType:n,isTracked:"1"===n}}(e,t)),t);return{findTrackedSession(e,t={returnInactive:!1}){const o=n.findSession(e,t);return o&&"1"===o.trackingType?{id:o.id,anonymousId:o.anonymousId}:void 0},expireObservable:n.expireObservable}}(r,i),{stop:y,getRUMInternalContext:h}=function(e){const t=window;let n=!1;function o(e){const o=nn(),r=function(e,t){if(t&&t.getInternalContext)return t.getInternalContext(e)}(e,o?t.DD_RUM_SYNTHETICS:t.FC_RUM);if(r)return r;o&&!n&&(n=!0,Be("Logs sent before RUM is injected by the synthetics worker",{testId:on(),resultId:rn()}))}return e.register(0,(({startTime:e})=>o(e)||qn)),{getRUMInternalContext:o,stop(){n=!1}}}(c),{stop:b}=function(e,t,n,o,r,s){const i=function(e,t){let n;const o=new M,r=new Set,s=!Pe.includes(t.site)&&Ee(t.telemetrySampleRate),i={[Le]:s,[Ae]:s&&Ee(t.telemetryConfigurationSampleRate),[Ie]:s&&Ee(t.telemetryUsageSampleRate)},a={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return Ue=e=>{const s=O(e);if(i[e.type]&&r.size<t.maxTelemetryEventsPerPage&&!r.has(s)){const t=function(e,t,o){return w({type:"telemetry",date:we(),service:"browser-logs-sdk",version:"0.0.4-alpha.2",source:"browser",_dd:{format_version:2},telemetry:w(t,{runtime_env:o,connectivity:Te(),sdk_setup:"cdn"}),experimental_features:Array.from(ye)},void 0!==n?n():{})}(0,e,a);o.notify(t),_e("telemetry",t),r.add(s)}},u=qe,{setContextProvider(e){n=e},observable:o,enabled:s}}(0,t);i.setContextProvider((()=>{var e,t,n,o,i,a;return{application:{id:null===(e=s())||void 0===e?void 0:e.application_id},session:{id:null===(t=r.findTrackedSession())||void 0===t?void 0:t.id},view:{id:null===(o=null===(n=s())||void 0===n?void 0:n.view)||void 0===o?void 0:o.id},action:{id:null===(a=null===(i=s())||void 0===i?void 0:i.user_action)||void 0===a?void 0:a.id}}}));const a=[];if(nt()){const e=tt(),t=i.observable.subscribe((t=>e.send("internal_telemetry",t)));a.push((()=>t.unsubscribe()))}else{const e=Mn(t,{endpoint:t.rumEndpointBuilder,encoder:Un()},t.replica&&{endpoint:t.replica.rumEndpointBuilder,encoder:Un()},n,o,r.expireObservable);a.push((()=>e.stop()));const s=i.observable.subscribe((n=>e.add(n,function(e){return"http://10.99.1.110:11300"===e.site}(t))));a.push((()=>s.unsubscribe()))}return Me.drain(),function(e){Ue({type:Ae,configuration:e})}(function(e){const t={session_sample_rate:(n=e).sessionSampleRate,telemetry_sample_rate:n.telemetrySampleRate,telemetry_configuration_sample_rate:n.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:n.telemetryUsageSampleRate,use_before_send:!!n.beforeSend,use_partitioned_cross_site_session_cookie:n.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:n.useSecureSessionCookie,use_proxy:!!n.proxy,silent_multiple_init:n.silentMultipleInit,track_session_across_subdomains:n.trackSessionAcrossSubdomains,track_anonymous_user:n.trackAnonymousUser,session_persistence:n.sessionPersistence,allow_fallback_to_local_storage:!!n.allowFallbackToLocalStorage,store_contexts_across_pages:!!n.storeContextsAcrossPages,allow_untrusted_events:!!n.allowUntrustedEvents,tracking_consent:n.trackingConsent};var n;return{forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports,use_pci_intake:e.usePciIntake,...t}}(e)),{telemetry:i,stop(){a.forEach((e=>e()))}}}(o,r,d,g,m,h);l.push((()=>b())),function(e,t){if(!e.forwardErrorsToLogs)return{stop:R};(function(e){return mn||(mn=function(e){return new M((t=>{const{stop:n}=ot(XMLHttpRequest.prototype,"open",hn),{stop:o}=ot(XMLHttpRequest.prototype,"send",(n=>{!function({target:e,handlingStack:t},n,o){const r=yn.get(e);if(!r)return;const s=r;s.state="start",s.startClocks=ke(),s.isAborted=!1,s.xhr=e,s.handlingStack=t;let i=!1;const{stop:a}=ot(e,"onreadystatechange",(()=>{e.readyState===XMLHttpRequest.DONE&&c()})),c=()=>{if(u(),a(),i)return;i=!0;const t=r;var n,c;t.state="complete",t.duration=(n=s.startClocks.timeStamp,we()-n),t.status=e.status,o.notify((c=t,{...c}))},{stop:u}=N(n,e,"loadend",c);o.notify(s)}(n,e,t)}),{computeHandlingStack:!0}),{stop:r}=ot(XMLHttpRequest.prototype,"abort",bn);return()=>{n(),o(),r()}}))}(e)),mn})(e).subscribe((e=>{"complete"===e.state&&n("xhr",e)})),ct().subscribe((e=>{"resolve"===e.state&&n("fetch",e)}));function n(n,o){var r;function s(e){const r={isAborted:o.isAborted,handlingStack:o.handlingStack};t.notify(0,{rawLogsEvent:{message:`${Sn(n)} error ${o.method} ${o.url}`,date:o.startClocks.timeStamp,error:{stack:e||"Failed to load",handling:void 0},http:{method:o.method,status_code:o.status,url:o.url},status:Ve.error,origin:"network"},domainContext:r})}r=o.url,be.every((e=>r.includes(e)))||!function(e){return 0===e.status&&"opaque"!==e.responseType}(o)&&!vn(o.status)||("xhr"in o?function(e,t,n){"string"==typeof e.response?n(wn(e.response,t)):n(e.response)}(o.xhr,e,s):o.response?function(e,t,n){const o=function(e){try{return e.clone()}catch(e){return}}(e);o&&o.body?window.TextDecoder?function(e,t,n){!function(e,t,n){const o=e.getReader(),r=[];let s=0;function i(){let e,i;if(o.cancel().catch(R),n.collectStreamBody){let t;if(1===r.length)t=r[0];else{t=new Uint8Array(s);let e=0;r.forEach((n=>{t.set(n,e),e+=n.length}))}e=t.slice(0,n.bytesLimit),i=t.length>n.bytesLimit}t(void 0,e,i)}!function e(){o.read().then(f((t=>{t.done?i():(n.collectStreamBody&&r.push(t.value),s+=t.value.length,s>n.bytesLimit?i():e())})),f((e=>t(e))))}()}(e,((e,t,o)=>{if(e)n(e);else{let e=(new TextDecoder).decode(t);o&&(e+="..."),n(void 0,e)}}),{bytesLimit:t,collectStreamBody:!0})}(o.body,t.requestErrorResponseLengthLimit,((e,t)=>{n(e?"Unable to retrieve response: "+e:t)})):o.text().then(f((e=>n(wn(e,t)))),f((e=>n("Unable to retrieve response: "+e)))):n()}(o.response,e,s):o.error&&function(e,t,n){n(wn(ie(V(e)),t))}(o.error,e,s))}}(r,a),function(e,t){if(!e.forwardErrorsToLogs)return{stop:R};const n=new M,{stop:o}=function(e){const t=(t,n)=>{const o=ue({stackTrace:n,originalError:t,startClocks:ke(),nonErrorPrefix:"Uncaught",source:ze,handling:"unhandled"});e.notify(o)},{stop:n}=(o=t,ot(window,"onerror",(({parameters:[e,t,n,r,s]})=>{let i;pe(s)||(i=function(e,t,n,o){if(void 0===t)return;const{name:r,message:s}=function(e){let t,n;return"[object String]"==={}.toString.call(e)&&([,t,n]=re.exec(e)),{name:t,message:n}}(e);return{name:r,message:s,stack:[{url:t,column:o,line:n}]}}(e,t,n,r)),o(null!=s?s:e,i)})));var o;const{stop:r}=function(e){return ot(window,"onunhandledrejection",(({parameters:[t]})=>{e(t.reason||"Empty reason")}))}(t);return{stop(){n(),r()}}}(n);n.subscribe((e=>{t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:Ze(e),origin:ze,status:Ve.error},messageContext:e.context})}))}(r,a),function(n,o){var r;(r=n.forwardConsoleLogs,U(...r.map((n=>(pn[n]||(pn[n]=function(n){return new M((o=>{const r=t[n];return t[n]=(...t)=>{r.apply(console,t);const s=se("console error");p((()=>{o.notify(function(t,n,o){const r=t.map((e=>function(e){return"string"==typeof e?A(e):pe(e)?ae(V(e)):O(A(e),void 0,2)}(e))).join(" ");if(n===e.error){const e=ue({originalError:t.find(pe),handlingStack:o,startClocks:ke(),source:He,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return e.message=r,{api:n,message:r,handlingStack:o,error:e}}return{api:n,message:r,error:void 0,handlingStack:o}}(t,n,s))}))},()=>{t[n]=r}}))}(n)),pn[n]))))).subscribe((e=>{var t;const n={rawLogsEvent:{date:we(),message:e.message,origin:He,error:e.error&&Ze(e.error),status:gn[e.api]},messageContext:null===(t=e.error)||void 0===t?void 0:t.context,domainContext:{handlingStack:e.handlingStack}};o.notify(0,n)}))}(r,a),function(e,t){(function(e,t){const n=[];t.includes(Zt.cspViolation)&&n.push(function(e){return new M((t=>{const{stop:n}=N(e,document,"securitypolicyviolation",(e=>{t.notify(function(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return Xt({type:e.effectiveDirective,message:`${Zt.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:Yt(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${dt(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}(e))}));return n}))}(e));const o=t.filter((e=>e!==Zt.cspViolation));return o.length&&n.push(function(e){return new M((t=>{if(!window.ReportingObserver)return;const n=f(((e,n)=>e.forEach((e=>t.notify(function(e){const{type:t,body:n}=e;return Xt({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:Yt(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}(e)))))),o=new window.ReportingObserver(n,{types:e,buffered:!0});return o.observe(),()=>{o.disconnect()}}))}(o)),U(...n)})(e,e.forwardReports).subscribe((e=>{let n,o=e.message;const r="deprecation"===e.originalError.type?Ve.warn:Ve.error;var s,i;r===Ve.error?n=Ze(e):e.stack&&(o+=" Found in "+(s=e.stack,null===(i=/@ (.+)/.exec(s))||void 0===i?void 0:i[1])),t.notify(0,{rawLogsEvent:{date:we(),message:o,origin:Je,error:n,status:r}})}))}(r,a);const{handleLog:v}=function(e){return{handleLog(o,r,s,i,a){const c=w(r.getContext(),o.context);if(We(o.status,"console",r)&&function({status:e,message:o},r){n[xn[e]].call(t,o,r)}(o,c),We(o.status,Xe,r)){const t={rawLogsEvent:{date:a||we(),message:o.message,status:o.status,origin:Ge},messageContext:c,savedCommonContext:i};s&&(t.domainContext={handlingStack:s}),e.notify(0,t)}}}}(a);if(function(e,t,n,o,r,s){const i=Ye.concat(["custom"]),a={};i.forEach((e=>{a[e]=function(e,t,n){let o=0,r=!1;return{isLimitReached(){if(0===o&&C((()=>{o=0}),6e4),o+=1,o<=t||r)return r=!1,!1;if(o===t+1){r=!0;try{n({message:`Reached max number of ${e}s by minute: ${t}`,source:Fe,startClocks:ke()})}finally{r=!1}}return!0}}}(e,t.eventRateLimiterThreshold,s)})),n.subscribe(0,(({rawLogsEvent:s,messageContext:i,savedCommonContext:c,domainContext:u})=>{var l,d;const f=s.date-Ce(),p=e.findTrackedSession(f);if(!e.findTrackedSession(f,{returnInactive:!0}))return;const g=c||r();let m;!G(g.account)&&g.account.id&&(m=g.account),p&&p.anonymousId&&!g.user.anonymous_id&&(g.user.id=G(g.user)?p.anonymousId:g.user.id,g.user.anonymous_id=p.anonymousId);const y=o.triggerHook(0,{startTime:f}),h=w({service:t.service,session_id:p?p.id:void 0,session:p?{id:p.id}:void 0,usr:G(g.user)?void 0:g.user,account:m,view:g.view},g.context,y,s,i);!1===(null===(l=t.beforeSend)||void 0===l?void 0:l.call(t,h,u))||h.origin!==Fe&&(null!==(d=a[h.status])&&void 0!==d?d:a.custom).isLimitReached()||n.notify(1,h)}))}(m,r,a,c,s,d),nt())!function(e){const t=tt();e.subscribe(1,(e=>{t.send("log",e)}))}(a);else{const{stop:e}=function(e,t,n,o,r){const s=Mn(e,{endpoint:e.logsEndpointBuilder,encoder:Un()},e.replica&&{endpoint:e.replica.logsEndpointBuilder,encoder:Un()},n,o,r.expireObservable);return t.subscribe(1,(e=>{s.add(e)})),s}(r,a,d,g,m);l.push((()=>e()))}var S;return{handleLog:v,getInternalContext:(S=m,{get(e){const t=S.findTrackedSession(e);if(t)return{session_id:t.id}}}).get,stop(){l.forEach((e=>e())),y()}}}(r,s,m,g);return y=function(e,t){return{init(e){Ne("FC_LOGS",e)},initConfiguration:e,...t}}(r,a),a}));const h={};return function(e){const t={version:"0.0.4-alpha.2",onReady(e){e()},...e};return Object.defineProperty(t,"_setDebug",{get:()=>d,enumerable:!1}),t}({logger:new Qe(((...e)=>y.handleLog(...e))),init:f((e=>y.init(e))),setTrackingConsent:f((e=>{g.update(e),Ue({type:Ie,usage:{feature:"set-tracking-consent",tracking_consent:e}})})),getGlobalContext:f((()=>o.getContext())),setGlobalContext:f((e=>o.setContext(e))),setGlobalContextProperty:f(((e,t)=>o.setContextProperty(e,t))),removeGlobalContextProperty:f((e=>o.removeContextProperty(e))),clearGlobalContext:f((()=>o.clearContext())),createLogger:f(((e,t={})=>(h[e]=new Qe(((...e)=>y.handleLog(...e)),A(e),t.handler,t.level,A(t.context)),h[e]))),getLogger:f((e=>h[e])),getInitConfiguration:f((()=>v(y.initConfiguration))),getInternalContext:f((e=>y.getInternalContext(e))),setUser:f(i.setContext),getUser:f(i.getContext),setUserProperty:f(i.setContextProperty),removeUserProperty:f(i.removeContextProperty),clearUser:f(i.clearContext),setAccount:f(l.setContext),getAccount:f(l.getContext),setAccountProperty:f(l.setContextProperty),removeAccountProperty:f(l.removeContextProperty),clearAccount:f(l.clearContext)})}();!function(e,t,n){const o=e[t];o&&!o.q&&o.version&&r.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=n,o&&o.q&&o.q.forEach((e=>c(e,"onReady callback threw an error:")()))}(y(),"FC_LOGS",Dn)})(); | ||
| (()=>{const e={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},t=console,n={};Object.keys(e).forEach((e=>{n[e]=t[e]}));const o="Datadog Browser SDK:",r={debug:n.debug.bind(t,o),log:n.log.bind(t,o),info:n.info.bind(t,o),warn:n.warn.bind(t,o),error:n.error.bind(t,o)},s="https://docs.datadoghq.com",i=s+"/real_user_monitoring/browser/troubleshooting",a="More details:";function c(e,t){return(...n)=>{try{return e(...n)}catch(e){r.error(t,e)}}}let u,l=!1;function d(e){l=e}function f(e){return function(){return p(e,this,arguments)}}function p(e,t,n){try{return e.apply(t,n)}catch(e){g(e)}}function g(e){if(m(e),u)try{u(e)}catch(e){m(e)}}function m(...e){l&&r.error("[MONITOR]",...e)}function y(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let e=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof e&&(e="object"==typeof self?self:"object"==typeof window?window:{}),e}function h(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function b(e,t,n=function(){if("undefined"!=typeof WeakSet){const e=new WeakSet;return{hasAlreadyBeenSeen(t){const n=e.has(t);return n||e.add(t),n}}}const e=[];return{hasAlreadyBeenSeen(t){const n=e.indexOf(t)>=0;return n||e.push(t),n}}}()){if(void 0===t)return e;if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){const e=t.flags||(t.global?"g":"")+(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.sticky?"y":"")+(t.unicode?"u":"");return RegExp(t.source,e)}if(n.hasAlreadyBeenSeen(t))return;if(Array.isArray(t)){const o=Array.isArray(e)?e:[];for(let e=0;e<t.length;++e)o[e]=b(o[e],t[e],n);return o}const o="object"===h(e)?e:{};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(o[e]=b(o[e],t[e],n));return o}function v(e){return b(void 0,e)}function w(...e){let t;for(const n of e)null!=n&&(t=b(t,n));return t}const S=/[^\u0000-\u007F]/;function k(e){return S.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length}function x(e,t){const n=y();let o;return n.Zone&&"function"==typeof n.Zone.__symbol__&&(o=e[n.Zone.__symbol__(t)]),o||(o=e[t]),o}function C(e,t){return x(y(),"setTimeout")(f(e),t)}function _(e){x(y(),"clearTimeout")(e)}function E(e,t){return x(y(),"setInterval")(f(e),t)}function T(e){x(y(),"clearInterval")(e)}function R(){}function O(e,t,n){if("object"!=typeof e||null===e)return JSON.stringify(e);const o=L(Object.prototype),r=L(Array.prototype),s=L(Object.getPrototypeOf(e)),i=L(e);try{return JSON.stringify(e,t,n)}catch(e){return"<error: unable to serialize object>"}finally{o(),r(),s(),i()}}function L(e){const t=e,n=t.toJSON;return n?(delete t.toJSON,()=>{t.toJSON=n}):R}function A(e,t=225280){const n=L(Object.prototype),o=L(Array.prototype),r=[],s=new WeakMap,i=I(e,"$",void 0,r,s),a=JSON.stringify(i);let c=a?a.length:0;if(!(c>t)){for(;r.length>0&&c<t;){const n=r.shift();let o=0;if(Array.isArray(n.source))for(let i=0;i<n.source.length;i++){const a=I(n.source[i],n.path,i,r,s);if(c+=void 0!==a?JSON.stringify(a).length:4,c+=o,o=1,c>t){P(t,"truncated",e);break}n.target[i]=a}else for(const i in n.source)if(Object.prototype.hasOwnProperty.call(n.source,i)){const a=I(n.source[i],n.path,i,r,s);if(void 0!==a&&(c+=JSON.stringify(a).length+o+i.length+3,o=1),c>t){P(t,"truncated",e);break}n.target[i]=a}}return n(),o(),i}P(t,"discarded",e)}function I(e,t,n,o,r){const s=function(e){const t=e;if(t&&"function"==typeof t.toJSON)try{return t.toJSON()}catch(e){}return e}(e);if(!s||"object"!=typeof s)return"bigint"==typeof(i=s)?"[BigInt] "+i.toString():"function"==typeof i?"[Function] "+(i.name||"unknown"):"symbol"==typeof i?"[Symbol] "+(i.description||i.toString()):i;var i;const a=$(s);if("[Object]"!==a&&"[Array]"!==a&&"[Error]"!==a)return a;const c=e;if(r.has(c))return`[Reference seen at ${r.get(c)}]`;const u=void 0!==n?`${t}.${n}`:t,l=Array.isArray(s)?[]:{};return r.set(c,u),o.push({source:s,target:l,path:u}),l}function $(e){try{if(e instanceof Event)return{type:(t=e).type,isTrusted:t.isTrusted,currentTarget:t.currentTarget?$(t.currentTarget):null,target:t.target?$(t.target):null};if(e instanceof RegExp)return"[RegExp] "+e.toString();const n=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(n&&n[1])return`[${n[1]}]`}catch(e){}var t;return"[Unserializable]"}function P(e,t,n){r.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,n)}class M{constructor(e){this.onFirstSubscribe=e,this.observers=[]}subscribe(e){return this.observers.push(e),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),{unsubscribe:()=>{this.observers=this.observers.filter((t=>e!==t)),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}}}notify(e){this.observers.forEach((t=>t(e)))}}function U(...e){return new M((t=>{const n=e.map((e=>e.subscribe((e=>t.notify(e)))));return()=>n.forEach((e=>e.unsubscribe()))}))}function B(e,t,n){const o={...e};for(const[e,{required:s,type:i}]of Object.entries(t))"string"!==i||q(o[e])||(o[e]=o[e]+""),s&&q(o[e])&&r.warn(`The property ${e} of ${n} is required; context will not be sent to the intake.`);return o}function q(e){return null==e||""===e}function D(e="",{propertiesConfig:t={}}={}){let n={};const o=new M,s={getContext:()=>v(n),setContext(i){!function(e){const t="object"===h(e);return t||r.error("Unsupported context:",e),t}(i)?s.clearContext():n=A(B(i,t,e)),o.notify()},setContextProperty(r,s){n=A(B({...n,[r]:s},t,e)),o.notify()},removeContextProperty(r){delete n[r],B(n,t,e),o.notify()},clearContext(){n={},o.notify()},changeObservable:o};return s}const j={GRANTED:"granted",NOT_GRANTED:"not-granted"};function N(e,t,n,o,r){return F(e,t,[n],o,r)}function F(e,t,n,o,{once:r,capture:s,passive:i}={}){const a=f((t=>{(t.isTrusted||t.__ddIsTrusted||e.allowUntrustedEvents)&&(r&&d(),o(t))})),c=i?{capture:s,passive:i}:s,u=window.EventTarget&&t instanceof EventTarget?window.EventTarget.prototype:t,l=x(u,"addEventListener");function d(){const e=x(u,"removeEventListener");n.forEach((n=>e.call(t,n,a,c)))}return n.forEach((e=>l.call(t,e,a,c))),{stop:d}}function H(e,t){return Object.keys(e).some((n=>e[n]===t))}function G(e){return 0===Object.keys(e).length}const z=[];function J(e,t,n,o){const r=function(e,t){return`_dd_c_${e}_${t}`}(n,o);z.push(N(e,window,"storage",(({key:e})=>{r===e&&t.setContext(i())}))),t.changeObservable.subscribe((function(){localStorage.setItem(r,JSON.stringify(t.getContext()))}));const s=w(i(),t.getContext());function i(){const e=localStorage.getItem(r);return e?JSON.parse(e):{}}G(s)||t.setContext(s)}const W="?";function V(e){const t=[];let n=oe(e,"stack");const o=e+"";return n&&n.startsWith(o)&&(n=n.slice(o.length)),n&&n.split("\n").forEach((e=>{const n=function(e){const t=X.exec(e);if(!t)return;const n=t[2]&&0===t[2].indexOf("native"),o=t[2]&&0===t[2].indexOf("eval"),r=Y.exec(t[2]);return o&&r&&(t[2]=r[1],t[3]=r[2],t[4]=r[3]),{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||W,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){const t=Q.exec(e);if(t)return{args:[],column:t[3]?+t[3]:void 0,func:W,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){const t=ee.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||W,line:+t[3],url:t[2]}}(e)||function(e){const t=te.exec(e);if(!t)return;const n=t[3]&&t[3].indexOf(" > eval")>-1,o=ne.exec(t[3]);return n&&o&&(t[3]=o[1],t[4]=o[2],t[5]=void 0),{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||W,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=W),t.push(n))})),{message:oe(e,"message"),name:oe(e,"name"),stack:t}}const K="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",Z="(?::(\\d+))",X=RegExp(`^\\s*at (.*?) ?\\(${K}${Z}?${Z}?\\)?\\s*$`,"i"),Y=RegExp(`\\((\\S*)${Z}${Z}\\)`),Q=RegExp(`^\\s*at ?${K}${Z}?${Z}??\\s*$`,"i"),ee=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,te=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?\s*$/i,ne=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function oe(e,t){if("object"!=typeof e||!e||!(t in e))return;const n=e[t];return"string"==typeof n?n:void 0}const re=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function se(e){const t=Error(e);let n;return t.name="HandlingStack",p((()=>{const e=V(t);e.stack=e.stack.slice(2),n=ie(e)})),n}function ie(e){let t=ae(e);return e.stack.forEach((e=>{const n="?"===e.func?"<anonymous>":e.func,o=e.args&&e.args.length>0?`(${e.args.join(", ")})`:"",r=e.line?":"+e.line:"",s=e.line&&e.column?":"+e.column:"";t+=`\n at ${n}${o} @ ${e.url}${r}${s}`})),t}function ae(e){return`${e.name||"Error"}: ${e.message}`}const ce="No stack, consider using an instance of Error";function ue({stackTrace:e,originalError:t,handlingStack:n,componentStack:o,startClocks:r,nonErrorPrefix:s,useFallbackStack:i=!0,source:a,handling:c}){const u=pe(t);return!e&&u&&(e=V(t)),{startClocks:r,source:a,handling:c,handlingStack:n,componentStack:o,originalError:t,type:e?e.name:void 0,message:le(e,u,s,t),stack:e?ie(e):i?ce:void 0,causes:u?ge(t,a):void 0,fingerprint:de(t),context:fe(t)}}function le(e,t,n,o){return(null==e?void 0:e.message)&&(null==e?void 0:e.name)?e.message:t?"Empty message":`${n} ${O(A(o))}`}function de(e){return pe(e)&&"dd_fingerprint"in e?e.dd_fingerprint+"":void 0}function fe(e){if(null!==e&&"object"==typeof e&&"dd_context"in e)return e.dd_context}function pe(e){return e instanceof Error||"[object Error]"===Object.prototype.toString.call(e)}function ge(e,t){let n=e;const o=[];for(;pe(null==n?void 0:n.cause)&&o.length<10;){const e=V(n.cause);o.push({message:n.cause.message,source:t,type:null==e?void 0:e.name,stack:e&&ie(e)}),n=n.cause}return o.length?o:void 0}var me;!function(e){e.PROFILING="profiling",e.TRACK_INTAKE_REQUESTS="track_intake_requests",e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.DOM_MUTATION_IGNORING="dom_mutation_ignoring"}(me||(me={}));const ye=new Set,he="browser.flashcat.cloud",be=["ddsource","ddtags"];function ve(){return(new Date).getTime()}function we(){return ve()}function Se(){return performance.now()}function ke(){return{relative:Se(),timeStamp:we()}}let xe;function Ce(){return void 0===xe&&(xe=performance.timing.navigationStart),xe}function _e(e,t){const n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function Ee(e){return 0!==e&&100*Math.random()<=e}function Te(){var e;const t=window.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:null===(e=t.connection)||void 0===e?void 0:e.effectiveType}}function Re(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}function Oe(){const e=[];return{add(t){e.push(t)>500&&e.splice(0,1)},remove(t){Re(e,t)},drain(t){e.forEach((e=>e(t))),e.length=0}}}const Le="log",Ae="configuration",Ie="usage",$e=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Pe=[];let Me=Oe(),Ue=e=>{Me.add((()=>Ue(e)))};function Be(t,n){m(e.debug,t,n),Ue({type:Le,message:t,status:"debug",...n})}function qe(e,t){Ue({type:Le,status:"error",...De(e),...t})}function De(e){if(pe(e)){const t=V(e);return{error:{kind:t.name,stack:ie(je(t))},message:t.message}}return{error:{stack:ce},message:"Uncaught "+O(e)}}function je(e){return e.stack=e.stack.filter((e=>!e.url||$e.some((t=>e.url.startsWith(t))))),e}function Ne(e,t){t.silentMultipleInit||r.error(e+" is already initialized.")}const Fe="agent",He="console",Ge="logger",ze="source",Je="report";function We(e,t,n){const o=n.getHandler(),r=Array.isArray(o)?o:[o];return Ke[e]>=Ke[n.getLevel()]&&r.includes(t)}const Ve={ok:"ok",debug:"debug",info:"info",notice:"notice",warn:"warn",error:"error",critical:"critical",alert:"alert",emerg:"emerg"},Ke={[Ve.ok]:0,[Ve.debug]:1,[Ve.info]:2,[Ve.notice]:4,[Ve.warn]:5,[Ve.error]:6,[Ve.critical]:7,[Ve.alert]:8,[Ve.emerg]:9};function Ze(e,{includeMessage:t=!1}={}){return{stack:e.stack,kind:e.type,message:t?e.message:void 0,causes:e.causes,fingerprint:e.fingerprint,handling:e.handling}}const Xe="http",Ye=Object.keys(Ve);class Qe{constructor(e,t,n=Xe,o=Ve.debug,r={}){this.handleLogStrategy=e,this.handlerType=n,this.level=o,this.contextManager=D("logger"),this.contextManager.setContext(r),t&&this.contextManager.setContextProperty("logger",{name:t})}logImplementation(e,t,n=Ve.info,o,r){const s=A(t);let i;i=null!=o?w({error:Ze(ue({originalError:o,nonErrorPrefix:"Provided",source:Ge,handling:"handled",startClocks:ke()}),{includeMessage:!0})},s):s,this.handleLogStrategy({message:A(e),context:i,status:n},this,r)}log(e,t,n=Ve.info,o){let r;We(n,Xe,this)&&(r=se("log")),this.logImplementation(e,t,n,o,r)}setContext(e){this.contextManager.setContext(e)}getContext(){return this.contextManager.getContext()}setContextProperty(e,t){this.contextManager.setContextProperty(e,t)}removeContextProperty(e){this.contextManager.removeContextProperty(e)}clearContext(){this.contextManager.clearContext()}setHandler(e){this.handlerType=e}getHandler(){return this.handlerType}setLevel(e){this.level=e}getLevel(){return this.level}}function et(e){return function(t,n,o){let r;We(e,Xe,this)&&(r=se("log")),this.logImplementation(t,n,e,o,r)}}function tt(){const e=y().DatadogEventBridge;if(e)return{getCapabilities(){var t;return JSON.parse((null===(t=e.getCapabilities)||void 0===t?void 0:t.call(e))||"[]")},getPrivacyLevel(){var t;return null===(t=e.getPrivacyLevel)||void 0===t?void 0:t.call(e)},getAllowedWebViewHosts(){return JSON.parse(e.getAllowedWebViewHosts())},send(t,n,o){const r=o?{id:o}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:r}))}}}function nt(e){var t;void 0===e&&(e=null===(t=y().location)||void 0===t?void 0:t.hostname);const n=tt();return!!n&&n.getAllowedWebViewHosts().some((t=>e===t||e.endsWith("."+t)))}function ot(e,t,n,{computeHandlingStack:o}={}){let r=e[t];if("function"!=typeof r){if(!(t in e)||!t.startsWith("on"))return{stop:R};r=R}let s=!1;const i=function(){if(s)return r.apply(this,arguments);const e=Array.from(arguments);let t;p(n,null,[{target:this,parameters:e,onPostCall(e){t=e},handlingStack:o?se("instrumented method"):void 0}]);const i=r.apply(this,e);return t&&p(t,null,[i]),i};return e[t]=i,{stop(){s=!0,e[t]===i&&(e[t]=r)}}}function rt(e){return function(e,t){const n=function(){if(void 0===it)try{const e=new st("http://test/path");it="http://test/path"===e.href}catch(e){it=!1}return it?st:void 0}();if(n)try{return void 0!==t?new n(e,t):new n(e)}catch(n){throw Error(`Failed to construct URL: ${n+""} ${O({url:e,base:t})}`)}if(void 0===t&&!/:/.test(e))throw Error(`Invalid URL: '${e}'`);let o=document;const r=o.createElement("a");if(void 0!==t){o=document.implementation.createHTMLDocument("");const e=o.createElement("base");e.href=t,o.head.appendChild(e),o.body.appendChild(r)}return r.href=e,r}(e,location.href).href}(function(e,t,n,o){var r,s=arguments.length,i=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(i=(s<3?r(i):s>3?r(t,n,i):r(t,n))||i);s>3&&i&&Object.defineProperty(t,n,i)})([function(e,t,n){const o=n.value;n.value=function(...e){return(u?f(o):o).apply(this,e)}}],Qe.prototype,"logImplementation",null),Qe.prototype.ok=et(Ve.ok),Qe.prototype.debug=et(Ve.debug),Qe.prototype.info=et(Ve.info),Qe.prototype.notice=et(Ve.notice),Qe.prototype.warn=et(Ve.warn),Qe.prototype.error=et(Ve.error),Qe.prototype.critical=et(Ve.critical),Qe.prototype.alert=et(Ve.alert),Qe.prototype.emerg=et(Ve.emerg);const st=URL;let it,at;function ct(){return at||(at=new M((e=>{if(!window.fetch)return;const{stop:t}=ot(window,"fetch",(t=>function({parameters:e,onPostCall:t,handlingStack:n},o){const[r,s]=e;let i=s&&s.method;void 0===i&&r instanceof Request&&(i=r.method);const a=void 0!==i?(i+"").toUpperCase():"GET",c=r instanceof Request?r.url:rt(r+""),u={state:"start",init:s,input:r,method:a,startClocks:ke(),url:c,handlingStack:n};o.notify(u),e[0]=u.input,e[1]=u.init,t((e=>function(e,t,n){const o=n;function r(t){o.state="resolve",Object.assign(o,t),e.notify(o)}t.then(f((e=>{r({response:e,responseType:e.type,status:e.status,isAborted:!1})})),f((e=>{var t,n;r({status:0,isAborted:(null===(n=null===(t=o.init)||void 0===t?void 0:t.signal)||void 0===n?void 0:n.aborted)||e instanceof DOMException&&e.code===DOMException.ABORT_ERR,error:e})})))}(o,e,u)))}(t,e)),{computeHandlingStack:!0});return t}))),at}function ut(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,ut)}const lt=/([\w-]+)\s*=\s*([^;]+)/g;function dt(e,t,n=""){const o=e.charCodeAt(t-1),r=o>=55296&&o<=56319?t+1:t;return e.length<=r?e:`${e.slice(0,r)}${n}`}let ft,pt,gt;function mt(e,t,n=0,o){const r=new Date;r.setTime(r.getTime()+n);const s="expires="+r.toUTCString(),i=o&&o.crossSite?"none":"strict",a=o&&o.domain?";domain="+o.domain:"",c=o&&o.secure?";secure":"",u=o&&o.partitioned?";partitioned":"";document.cookie=`${e}=${t};${s};path=/;samesite=${i}${a}${c}${u}`}function yt(e){return function(e,t){for(lt.lastIndex=0;;){const n=lt.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}function ht(e){return pt||(pt=function(e){const t=new Map;for(lt.lastIndex=0;;){const n=lt.exec(e);if(!n)break;t.set(n[1],n[2])}return t}(document.cookie)),pt.get(e)}function bt(e,t){mt(e,"",0,t)}const vt="_dd_s";function wt(e){return Object.values(e)}const St=144e5,kt=9e5,xt="cookie",Ct="local-storage",_t=/^([a-zA-Z]+)=([a-z0-9-]+)$/;function Et(e,t){const n={isExpired:"1"};return t.trackAnonymousUser&&((null==e?void 0:e.anonymousId)?n.anonymousId=null==e?void 0:e.anonymousId:n.anonymousId=ut()),n}function Tt(e){return G(e)}function Rt(e){return!Tt(e)}function Ot(e){return void 0!==e.isExpired||!((void 0===(t=e).created||ve()-Number(t.created)<St)&&(void 0===t.expire||ve()<Number(t.expire)));var t}function Lt(e){e.expire=ve()+kt+""}function At(e){return(t=e,Object.entries(t)).map((([e,t])=>"anonymousId"===e?"aid="+t:`${e}=${t}`)).join("&");var t}function It(e){const t={};return function(e){return!!e&&(-1!==e.indexOf("&")||_t.test(e))}(e)&&e.split("&").forEach((e=>{const n=_t.exec(e);if(null!==n){const[,e,o]=n;"aid"===e?t.anonymousId=o:t[e]=o}})),t}function $t(e){const t=function(e){const t={};return t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===gt){const e="dd_site_test_"+ut(),t="test",n=window.location.hostname.split(".");let o=n.pop();for(;n.length&&!yt(e);)o=`${n.pop()}.${o}`,mt(e,t,1e3,{domain:o});bt(e,{domain:o}),gt=o}return gt}()),t}(e);return function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{const t="dd_cookie_test_"+ut(),n="test";mt(t,n,6e4,e);const o=yt(t)===n;return bt(t,e),o}catch(e){return r.error(e),!1}}(t)?{type:xt,cookieOptions:t}:void 0}function Pt(e,t,n,o){mt(vt,At(n),t.trackAnonymousUser?31536e6:o,e)}function Mt(){return It(yt(vt))}function Ut(){try{const e=ut(),t="_dd_test_"+e;localStorage.setItem(t,e);const n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:Ct}:void 0}catch(e){return}}function Bt(e){localStorage.setItem(vt,At(e))}function qt(){return It(localStorage.getItem(vt))}const Dt=[];let jt;function Nt(e,t,n=0){var o;const{isLockEnabled:r,persistSession:s,expireSession:i}=t,a=e=>s({...e,lock:u}),c=()=>{const e=t.retrieveSession(),n=e.lock;return e.lock&&delete e.lock,{session:e,lock:n}};if(jt||(jt=e),e!==jt)return void Dt.push(e);if(r&&n>=100)return void Ht(t);let u,l=c();if(r){if(l.lock)return void Ft(e,t,n);if(u=ut(),a(l.session),l=c(),l.lock!==u)return void Ft(e,t,n)}let d=e.process(l.session);if(r&&(l=c(),l.lock!==u))Ft(e,t,n);else{if(d&&(Ot(d)?i(d):(Lt(d),r?a(d):s(d))),r&&(!d||!Ot(d))){if(l=c(),l.lock!==u)return void Ft(e,t,n);s(l.session),d=l.session}null===(o=e.after)||void 0===o||o.call(e,d||l.session),Ht(t)}}function Ft(e,t,n){C((()=>{Nt(e,t,n+1)}),10)}function Ht(e){jt=void 0;const t=Dt.shift();t&&Nt(t,e)}function Gt(e){switch(e.sessionPersistence){case xt:return $t(e);case Ct:return Ut();case void 0:{let t=$t(e);return!t&&e.allowFallbackToLocalStorage&&(t=Ut()),t}default:r.error(`Invalid session persistence '${e.sessionPersistence+""}'`)}}function zt(e,t,n){const o=function(e,t){const n="/api/v2/"+t,o=e.proxy;if("string"==typeof o){const e=rt(o);return t=>`${e}?ddforward=${encodeURIComponent(`${n}?${t}`)}`}if("function"==typeof o)return e=>o({path:n,parameters:e});const r=function(e,t){const{site:n=he,internalAnalyticsSubdomain:o}=t;return"logs"===e&&t.usePciIntake&&n===he?"pci.browser-intake-datadoghq.com":o&&n===he?`${o}.${he}`:"http://10.99.1.110:11300"===n?"http-intake.logs."+n:n}(t,e);return e=>`https://${r}${n}?${e}`}(e,t);return{build(r,s){const i=function({clientToken:e,internalAnalyticsSubdomain:t},n,o,r,{retry:s,encoding:i}){const a=["sdk_version:0.0.5","api:"+r].concat(o);s&&a.push("retry_count:"+s.count,"retry_after:"+s.lastFailureStatus);const c=["ddsource=browser","ddtags="+encodeURIComponent(a.join(",")),"dd-api-key="+e,"dd-evp-origin-version="+encodeURIComponent("0.0.5"),"dd-evp-origin=browser","dd-request-id="+ut()];return i&&c.push("dd-evp-encoding="+i),"rum"===n&&c.push("batch_time="+we()),t&&c.reverse(),c.join("&")}(e,t,n,r,s);return o(i)},tags:n,urlPrefix:o(""),trackType:t}}function Jt(e,t){const n=200-e.length-1;return(t.length>n||function(e){return!!function(){try{return RegExp("[\\p{Ll}]","u"),!0}catch(e){return!1}}()&&RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e)}(t))&&r.warn(`${e} value doesn't meet tag requirements and will be sanitized. ${a} ${s}/getting_started/tagging/#defining-tags`),`${e}:${t.replace(/,/g,"_")}`}function Wt(e){const t=e.site||he,n=function(e){const{env:t,service:n,version:o,datacenter:r}=e,s=[];return t&&s.push(Jt("env",t)),n&&s.push(Jt("service",n)),o&&s.push(Jt("version",o)),r&&s.push(Jt("datacenter",r)),s}(e),o=function(e,t){return{logsEndpointBuilder:zt(e,"logs",t),rumEndpointBuilder:zt(e,"rum",t),profilingEndpointBuilder:zt(e,"profile",t),sessionReplayEndpointBuilder:zt(e,"replay",t)}}(e,n),r=function(e,t){if(!e.replica)return;const n={...e,site:he,clientToken:e.replica.clientToken},o={logsEndpointBuilder:zt(n,"logs",t),rumEndpointBuilder:zt(n,"rum",t)};return{applicationId:e.replica.applicationId,...o}}(e,n);return{replica:r,site:t,...o}}function Vt(e,t){return null==e||"string"==typeof e||(r.error(t+" must be defined as a string"),!1)}function Kt(e,t){return!!(void 0===e||(n=e,function(e){return"number"==typeof e}(n)&&n>=0&&n<=100))||(r.error(t+" Sample Rate should be a number between 0 and 100"),!1);var n}const Zt={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Xt(e){return{startClocks:ke(),source:Je,handling:"unhandled",...e}}function Yt(e,t,n,o,r){return n?ie({name:e,message:t,stack:[{func:"?",url:n,line:null!=o?o:void 0,column:null!=r?r:void 0}]}):void 0}function Qt(e,t,n){return void 0===e?[]:"all"===e||Array.isArray(e)&&e.every((e=>t.includes(e)))?"all"===e?t:function(e){const t=new Set;return e.forEach((e=>t.add(e))),Array.from(t)}(e):void r.error(`${n} should be "all" or an array with allowed values "${t.join('", "')}"`)}const en="logs",tn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function nn(){return!(!window._DATADOG_SYNTHETICS_INJECTS_RUM&&!ht("datadog-synthetics-injects-rum"))}function on(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||ht("datadog-synthetics-public-id");return"string"==typeof e?e:void 0}function rn(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||ht("datadog-synthetics-result-id");return"string"==typeof e?e:void 0}const sn=1/0;let an=null;const cn=new Set,un=St;let ln=[];function dn(e,t,n,o){const r=new M,s=new M,i=function(e,t,n,o){const r=new M,s=new M,i=new M,a=e.type===xt?function(e,t){const n={isLockEnabled:0===(null!=ft?ft:ft=function(e=window){var t;const n=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(n)?0:0===(null===(t=e.navigator.vendor)||void 0===t?void 0:t.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n)?1:2}()),persistSession:n=>Pt(t,e,n,kt),retrieveSession:Mt,expireSession:n=>Pt(t,e,Et(n,e),St)};return function(e){if(!ht(vt)){const t=ht("_dd"),n=ht("_dd_r"),o=ht("_dd_l"),r={};t&&(r.id=t),o&&/^[01]$/.test(o)&&(r.logs=o),n&&/^[012]$/.test(n)&&(r.rum=n),Rt(r)&&(Lt(r),e.persistSession(r))}}(n),n}(t,e.cookieOptions):function(e){return{isLockEnabled:!1,persistSession:Bt,retrieveSession:qt,expireSession:t=>function(e,t){Bt(Et(e,t))}(t,e)}}(t),{expireSession:c}=a,u=E((function(){Nt({process(e){return Ot(e)?Et(e,t):void 0},after:p},a)}),1e3);let l;g();const{throttled:d,cancel:f}=function(e){let t,n,o=!1;return{throttled(...r){o?t=r:(e(...r),o=!0,n=C((()=>{t&&e(...t),o=!1,t=void 0}),1e3))},cancel(){_(n),o=!1,t=void 0}}}((()=>{Nt({process(e){if(Tt(e))return;const t=p(e);return function(e){if(Tt(e))return!1;const{trackingType:t,isTracked:r}=o(e[n]);e[n]=t,delete e.isExpired,r&&!e.id&&(e.id=ut(),e.created=ve()+"")}(t),t},after(e){Rt(e)&&!m()&&function(e){l=e,r.notify()}(e),l=e}},a)}));function p(e){return Ot(e)&&(e=Et(e,t)),m()&&(function(e){return l.id!==e.id||l[n]!==e[n]}(e)?(l=Et(l,t),s.notify()):(i.notify({previousState:l,newState:e}),l=e)),e}function g(){Nt({process(e){if(Tt(e))return Et(e,t)},after(e){l=e}},a)}function m(){return void 0!==l[n]}return{expandOrRenewSession:d,expandSession(){Nt({process(e){return m()?p(e):void 0}},a)},getSession(){return l},renewObservable:r,expireObservable:s,sessionStateUpdateObservable:i,restartSession:g,expire(){f(),c(l),p(Et(l,t))},stop(){T(u)},updateSessionState(e){Nt({process(t){return{...t,...e}},after:p},a)}}}(e.sessionStoreStrategyType,e,t,n);ln.push((()=>i.stop()));const a=function({expireDelay:e,maxEntries:t}){let n=[];an||(an=E((()=>{cn.forEach((e=>e()))}),6e4));const o=()=>{const t=Se()-e;for(;n.length>0&&n[n.length-1].endTime<t;)n.pop()};return cn.add(o),{add(e,o){const r={value:e,startTime:o,endTime:sn,remove(){Re(n,r)},close(e){r.endTime=e}};return t&&n.length>=t&&n.pop(),n.unshift(r),r},find(e=1/0,t={returnInactive:!1}){for(const o of n)if(o.startTime<=e){if(t.returnInactive||e<=o.endTime)return o.value;break}},closeActive(e){const t=n[0];t&&t.endTime===sn&&t.close(e)},findAll(e=1/0,t=0){const o=e+t;return n.filter((t=>t.startTime<=o&&e<=t.endTime)).map((e=>e.value))},reset(){n=[]},stop(){cn.delete(o),0===cn.size&&an&&(T(an),an=null)}}}({expireDelay:un});function c(){return{id:i.getSession().id,trackingType:i.getSession()[t],isReplayForced:!!i.getSession().forcedReplay,anonymousId:i.getSession().anonymousId}}return ln.push((()=>a.stop())),i.renewObservable.subscribe((()=>{a.add(c(),Se()),r.notify()})),i.expireObservable.subscribe((()=>{s.notify(),a.closeActive(Se())})),i.expandOrRenewSession(),a.add(c(),[0,Ce()][0]),o.observable.subscribe((()=>{o.isGranted()?i.expandOrRenewSession():i.expire()})),function(e){const{stop:t}=F(e,window,["click","touchstart","keydown","scroll"],(()=>{o.isGranted()&&i.expandOrRenewSession()}),{capture:!0,passive:!0});ln.push(t)}(e),function(e){const t=()=>{"visible"===document.visibilityState&&i.expandSession()},{stop:n}=N(e,document,"visibilitychange",t);ln.push(n);const o=E(t,6e4);ln.push((()=>{T(o)}))}(e),function(e){const{stop:t}=N(e,window,"resume",(()=>i.restartSession()),{capture:!0});ln.push(t)}(e),{findSession:(e,t)=>a.find(e,t),renewObservable:r,expireObservable:s,sessionStateUpdateObservable:i.sessionStateUpdateObservable,expire:i.expire,updateSessionState:i.updateSessionState}}function fn(e){return Ee(e.sessionSampleRate)?"1":"0"}let pn={};const gn={[e.log]:Ve.info,[e.debug]:Ve.debug,[e.info]:Ve.info,[e.warn]:Ve.warn,[e.error]:Ve.error};let mn;const yn=new WeakMap;function hn({target:e,parameters:[t,n]}){yn.set(e,{state:"open",method:(t+"").toUpperCase(),url:rt(n+"")})}function bn({target:e}){const t=yn.get(e);t&&(t.isAborted=!0)}function vn(e){return e>=500}function wn(e,t){return e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function Sn(e){return"xhr"===e?"XHR":"Fetch"}const kn=class{constructor(){this.callbacks={}}notify(e,t){const n=this.callbacks[e];n&&n.forEach((e=>e(t)))}subscribe(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:()=>{this.callbacks[e]=this.callbacks[e].filter((e=>t!==e))}}}},xn={[Ve.ok]:e.debug,[Ve.debug]:e.debug,[Ve.info]:e.info,[Ve.notice]:e.info,[Ve.warn]:e.warn,[Ve.error]:e.error,[Ve.critical]:e.error,[Ve.alert]:e.error,[Ve.emerg]:e.error};function Cn({encoder:e,request:t,flushController:n,messageBytesLimit:o}){let s={};const c=n.flushObservable.subscribe((n=>function(n){const o=wt(s).join("\n");s={};const r=(a=n.reason,wt(tn).includes(a)),i=r?t.sendOnExit:t.send;var a;if(r&&e.isAsync){const t=e.finishSync();t.outputBytesCount&&i(_n(t));const n=[t.pendingData,o].filter(Boolean).join("\n");n&&i({data:n,bytesCount:k(n)})}else o&&e.write(e.isEmpty?o:"\n"+o),e.finish((e=>{i(_n(e))}))}(n)));function u(t,c){const u=O(t),l=e.estimateEncodedBytesCount(u);l>=o?r.warn(`Discarded a message whose size was bigger than the maximum allowed size ${o}KB. ${a} ${i}/#technical-limitations`):(function(e){return void 0!==e&&void 0!==s[e]}(c)&&function(t){const o=s[t];delete s[t];const r=e.estimateEncodedBytesCount(o);n.notifyAfterRemoveMessage(r)}(c),function(t,o,r){n.notifyBeforeAddMessage(o),void 0!==r?(s[r]=t,n.notifyAfterAddMessage()):e.write(e.isEmpty?t:"\n"+t,(e=>{n.notifyAfterAddMessage(e-o)}))}(u,l,c))}return{flushController:n,add:u,upsert:u,stop:c.unsubscribe}}function _n(e){let t;return t="string"==typeof e.output?e.output:new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function En(e,t,n,o,r){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?Rn(e,t,n,{onSuccess:()=>On(0,t,n,o,r),onFailure(){t.queuedPayloads.enqueue(e),Tn(t,n,o,r)}}):t.queuedPayloads.enqueue(e)}function Tn(e,t,n,o){2===e.transportStatus&&C((()=>{Rn(e.queuedPayloads.first(),e,t,{onSuccess(){e.queuedPayloads.dequeue(),e.currentBackoffTime=1e3,On(1,e,t,n,o)},onFailure(){e.currentBackoffTime=Math.min(6e4,2*e.currentBackoffTime),Tn(e,t,n,o)}})}),e.currentBackoffTime)}function Rn(e,t,n,{onSuccess:o,onFailure:r}){t.bandwidthMonitor.add(e),n(e,(n=>{t.bandwidthMonitor.remove(e),function(e){return"opaque"!==e.type&&(0===e.status&&!navigator.onLine||408===e.status||429===e.status||vn(e.status))}(n)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:n.status},r()):(t.transportStatus=0,o())}))}function On(e,t,n,o,r){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(r({message:`Reached max ${o} events size queued for upload: 3MiB`,source:Fe,startClocks:ke()}),t.queueFullReported=!0);const s=t.queuedPayloads;for(t.queuedPayloads=Ln();s.size()>0;)En(s.dequeue(),t,n,o,r)}function Ln(){const e=[];return{bytesCount:0,enqueue(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first(){return e[0]},dequeue(){const t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size(){return e.length},isFull(){return this.bytesCount>=3145728}}}function An(e,t,n){const o={transportStatus:0,currentBackoffTime:1e3,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=81920&&this.ongoingRequestCount<32},add(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:Ln(),queueFullReported:!1},r=(n,o)=>function(e,t,n,o){if(function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(e){return!1}}()&&n.bytesCount<t){const t=e.build("fetch-keepalive",n);fetch(t,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(f((e=>null==o?void 0:o({status:e.status,type:e.type})))).catch(f((()=>$n(e,n,o))))}else $n(e,n,o)}(e,t,n,o);return{send(t){En(t,o,r,e.trackType,n)},sendOnExit(n){!function(e,t,n){if(navigator.sendBeacon&&n.bytesCount<t)try{const t=e.build("beacon",n);if(navigator.sendBeacon(t,n.data))return}catch(e){!function(e){In||(In=!0,g(e))}(e)}$n(e,n)}(e,t,n)}}}let In=!1;function $n(e,t,n){const o=e.build("fetch",t);fetch(o,{method:"POST",body:t.data,mode:"cors"}).then(f((e=>null==n?void 0:n({status:e.status,type:e.type})))).catch(f((()=>null==n?void 0:n({status:0}))))}function Pn({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:o,sessionExpireObservable:r}){const s=o.subscribe((e=>d(e.reason))),i=r.subscribe((()=>d("session_expire"))),a=new M((()=>()=>{s.unsubscribe(),i.unsubscribe()}));let c,u=0,l=0;function d(e){if(0===l)return;const t=l,n=u;l=0,u=0,f(),a.notify({reason:e,messagesCount:t,bytesCount:n})}function f(){_(c),c=void 0}return{flushObservable:a,get messagesCount(){return l},notifyBeforeAddMessage(e){u+e>=t&&d("bytes_limit"),l+=1,u+=e,void 0===c&&(c=C((()=>{d("duration_limit")}),n))},notifyAfterAddMessage(n=0){u+=n,l>=e?d("messages_limit"):u>=t&&d("bytes_limit")},notifyAfterRemoveMessage(e){u-=e,l-=1,0===l&&f()}}}function Mn(e,t,n,o,r,s,i=Cn){const a=u(e,t),c=n&&u(e,n);function u(e,{endpoint:t,encoder:n}){return i({encoder:n,request:An(t,e.batchBytesLimit,o),flushController:Pn({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:r,sessionExpireObservable:s}),messageBytesLimit:e.messageBytesLimit})}return{flushObservable:a.flushController.flushObservable,add(e,t=!0){a.add(e),c&&t&&c.add(n.transformMessage?n.transformMessage(e):e)},upsert(e,t){a.upsert(e,t),c&&c.upsert(n.transformMessage?n.transformMessage(e):e,t)},stop(){a.stop(),c&&c.stop()}}}function Un(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,o){const r=k(n);t+=r,e+=n,o&&o(r)},finish(e){e(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(e){return e.length}}}const Bn="DISCARDED",qn="SKIPPED",Dn=function(){const o=D("global context"),i=D("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}}),l=D("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}}),g=function(e){const t=new M;return{tryToInit(t){e||(e=t)},update(n){e=n,t.notify()},isGranted:()=>e===j.GRANTED,observable:t}}();function m(){return function(e,t,n){return{view:{referrer:document.referrer,url:window.location.href},context:e.getContext(),user:t.getContext(),account:n.getContext()}}(o,i,l)}let y=function(t,n,o){const i=Oe();let u,l;const d=n.observable.subscribe(f);function f(){if(!l||!u||!n.isGranted())return;d.unsubscribe();const e=o(u,l);i.drain(e)}return{init(t){if(!t)return void r.error("Missing configuration");if(o=t.enableExperimentalFeatures,Array.isArray(o)&&o.filter((e=>H(me,e))).forEach((e=>{ye.add(e)})),nt()&&(t=function(e){return{...e,clientToken:"empty"}}(t)),u=t,l)return void Ne("FC_LOGS",t);var o;const i=function(t){!0===t.usePciIntake&&t.site&&"browser.flashcat.cloud"!==t.site&&r.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");const n=function(e){var t,n,o,i,u,l;if(e&&e.clientToken){if((!(d=e.site)||"string"!=typeof d||/(flashcat)/.test(d)||(r.error(`Site should be a valid Flashcat site. ${a} ${s}/getting_started/site/.`),0))&&Kt(e.sessionSampleRate,"Session")&&Kt(e.telemetrySampleRate,"Telemetry")&&Kt(e.telemetryConfigurationSampleRate,"Telemetry Configuration")&&Kt(e.telemetryUsageSampleRate,"Telemetry Usage")&&Vt(e.version,"Version")&&Vt(e.env,"Env")&&Vt(e.service,"Service")){var d;if(void 0===e.trackingConsent||H(j,e.trackingConsent))return{beforeSend:e.beforeSend&&c(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Gt(e),sessionSampleRate:null!==(t=e.sessionSampleRate)&&void 0!==t?t:100,telemetrySampleRate:null!==(n=e.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(o=e.telemetryConfigurationSampleRate)&&void 0!==o?o:5,telemetryUsageSampleRate:null!==(i=e.telemetryUsageSampleRate)&&void 0!==i?i:5,service:e.service||void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:null!==(u=e.trackingConsent)&&void 0!==u?u:j.GRANTED,trackAnonymousUser:null===(l=e.trackAnonymousUser)||void 0===l||l,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16384,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:3e4,batchMessagesLimit:50,messageBytesLimit:262144,...Wt(e)};r.error('Tracking Consent should be either "granted" or "not-granted"')}}else r.error("Client Token is not configured, we will not send any data.")}(t),o=Qt(t.forwardConsoleLogs,wt(e),"Forward Console Logs"),i=Qt(t.forwardReports,wt(Zt),"Forward Reports");if(n&&o&&i)return t.forwardErrorsToLogs&&!o.includes(e.error)&&o.push(e.error),{forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:o,forwardReports:i,requestErrorResponseLengthLimit:32768,...n}}(t);i&&(l=i,ct().subscribe(R),n.tryToInit(i.trackingConsent),f())},get initConfiguration(){return u},getInternalContext:R,handleLog(e,n,o,r=t(),s=we()){i.add((t=>t.handleLog(e,n,o,r,s)))}}}(m,g,((r,s)=>{r.storeContextsAcrossPages&&(J(s,o,en,2),J(s,i,en,1),J(s,l,en,4));const a=function(o,r,s,i){const a=new kn,c=function(){const e={};return{register:(t,n)=>(e[t]||(e[t]=[]),e[t].push(n),{unregister(){e[t]=e[t].filter((e=>e!==n))}}),triggerHook(t,n){const o=e[t]||[],r=[];for(const e of o){const t=e(n);if(t===Bn)return Bn;t!==qn&&r.push(t)}return w(...r)}}}(),l=[];a.subscribe(1,(e=>_e("logs",e)));const d=function(e){return t=>{e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,origin:Fe,status:Ve.error}}),Be("Error reported to customer",{"error.message":t.message})}}(a),g=function(e){return new M((t=>{const{stop:n}=F(e,window,["visibilitychange","freeze"],(e=>{"visibilitychange"===e.type&&"hidden"===document.visibilityState?t.notify({reason:tn.HIDDEN}):"freeze"===e.type&&t.notify({reason:tn.FROZEN})}),{capture:!0}),o=N(e,window,"beforeunload",(()=>{t.notify({reason:tn.UNLOADING})})).stop;return()=>{n(),o()}}))}(r),m=!r.sessionStoreStrategyType||nt()||nn()?function(e){const t="1"===fn(e)?{}:void 0;return{findTrackedSession(){return t},expireObservable:new M}}(r):function(e,t){const n=dn(e,"logs",(t=>function(e,t){const n=function(e){return"0"===e||"1"===e}(t)?t:fn(e);return{trackingType:n,isTracked:"1"===n}}(e,t)),t);return{findTrackedSession(e,t={returnInactive:!1}){const o=n.findSession(e,t);return o&&"1"===o.trackingType?{id:o.id,anonymousId:o.anonymousId}:void 0},expireObservable:n.expireObservable}}(r,i),{stop:y,getRUMInternalContext:h}=function(e){const t=window;let n=!1;function o(e){const o=nn(),r=function(e,t){if(t&&t.getInternalContext)return t.getInternalContext(e)}(e,o?t.DD_RUM_SYNTHETICS:t.FC_RUM);if(r)return r;o&&!n&&(n=!0,Be("Logs sent before RUM is injected by the synthetics worker",{testId:on(),resultId:rn()}))}return e.register(0,(({startTime:e})=>o(e)||qn)),{getRUMInternalContext:o,stop(){n=!1}}}(c),{stop:b}=function(e,t,n,o,r,s){const i=function(e,t){let n;const o=new M,r=new Set,s=!Pe.includes(t.site)&&Ee(t.telemetrySampleRate),i={[Le]:s,[Ae]:s&&Ee(t.telemetryConfigurationSampleRate),[Ie]:s&&Ee(t.telemetryUsageSampleRate)},a={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return Ue=e=>{const s=O(e);if(i[e.type]&&r.size<t.maxTelemetryEventsPerPage&&!r.has(s)){const t=function(e,t,o){return w({type:"telemetry",date:we(),service:"browser-logs-sdk",version:"0.0.5",source:"browser",_dd:{format_version:2},telemetry:w(t,{runtime_env:o,connectivity:Te(),sdk_setup:"cdn"}),experimental_features:Array.from(ye)},void 0!==n?n():{})}(0,e,a);o.notify(t),_e("telemetry",t),r.add(s)}},u=qe,{setContextProvider(e){n=e},observable:o,enabled:s}}(0,t);i.setContextProvider((()=>{var e,t,n,o,i,a;return{application:{id:null===(e=s())||void 0===e?void 0:e.application_id},session:{id:null===(t=r.findTrackedSession())||void 0===t?void 0:t.id},view:{id:null===(o=null===(n=s())||void 0===n?void 0:n.view)||void 0===o?void 0:o.id},action:{id:null===(a=null===(i=s())||void 0===i?void 0:i.user_action)||void 0===a?void 0:a.id}}}));const a=[];if(nt()){const e=tt(),t=i.observable.subscribe((t=>e.send("internal_telemetry",t)));a.push((()=>t.unsubscribe()))}else{const e=Mn(t,{endpoint:t.rumEndpointBuilder,encoder:Un()},t.replica&&{endpoint:t.replica.rumEndpointBuilder,encoder:Un()},n,o,r.expireObservable);a.push((()=>e.stop()));const s=i.observable.subscribe((n=>e.add(n,function(e){return"http://10.99.1.110:11300"===e.site}(t))));a.push((()=>s.unsubscribe()))}return Me.drain(),function(e){Ue({type:Ae,configuration:e})}(function(e){const t={session_sample_rate:(n=e).sessionSampleRate,telemetry_sample_rate:n.telemetrySampleRate,telemetry_configuration_sample_rate:n.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:n.telemetryUsageSampleRate,use_before_send:!!n.beforeSend,use_partitioned_cross_site_session_cookie:n.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:n.useSecureSessionCookie,use_proxy:!!n.proxy,silent_multiple_init:n.silentMultipleInit,track_session_across_subdomains:n.trackSessionAcrossSubdomains,track_anonymous_user:n.trackAnonymousUser,session_persistence:n.sessionPersistence,allow_fallback_to_local_storage:!!n.allowFallbackToLocalStorage,store_contexts_across_pages:!!n.storeContextsAcrossPages,allow_untrusted_events:!!n.allowUntrustedEvents,tracking_consent:n.trackingConsent};var n;return{forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports,use_pci_intake:e.usePciIntake,...t}}(e)),{telemetry:i,stop(){a.forEach((e=>e()))}}}(o,r,d,g,m,h);l.push((()=>b())),function(e,t){if(!e.forwardErrorsToLogs)return{stop:R};(function(e){return mn||(mn=function(e){return new M((t=>{const{stop:n}=ot(XMLHttpRequest.prototype,"open",hn),{stop:o}=ot(XMLHttpRequest.prototype,"send",(n=>{!function({target:e,handlingStack:t},n,o){const r=yn.get(e);if(!r)return;const s=r;s.state="start",s.startClocks=ke(),s.isAborted=!1,s.xhr=e,s.handlingStack=t;let i=!1;const{stop:a}=ot(e,"onreadystatechange",(()=>{e.readyState===XMLHttpRequest.DONE&&c()})),c=()=>{if(u(),a(),i)return;i=!0;const t=r;var n,c;t.state="complete",t.duration=(n=s.startClocks.timeStamp,we()-n),t.status=e.status,o.notify((c=t,{...c}))},{stop:u}=N(n,e,"loadend",c);o.notify(s)}(n,e,t)}),{computeHandlingStack:!0}),{stop:r}=ot(XMLHttpRequest.prototype,"abort",bn);return()=>{n(),o(),r()}}))}(e)),mn})(e).subscribe((e=>{"complete"===e.state&&n("xhr",e)})),ct().subscribe((e=>{"resolve"===e.state&&n("fetch",e)}));function n(n,o){var r;function s(e){const r={isAborted:o.isAborted,handlingStack:o.handlingStack};t.notify(0,{rawLogsEvent:{message:`${Sn(n)} error ${o.method} ${o.url}`,date:o.startClocks.timeStamp,error:{stack:e||"Failed to load",handling:void 0},http:{method:o.method,status_code:o.status,url:o.url},status:Ve.error,origin:"network"},domainContext:r})}r=o.url,be.every((e=>r.includes(e)))||!function(e){return 0===e.status&&"opaque"!==e.responseType}(o)&&!vn(o.status)||("xhr"in o?function(e,t,n){"string"==typeof e.response?n(wn(e.response,t)):n(e.response)}(o.xhr,e,s):o.response?function(e,t,n){const o=function(e){try{return e.clone()}catch(e){return}}(e);o&&o.body?window.TextDecoder?function(e,t,n){!function(e,t,n){const o=e.getReader(),r=[];let s=0;function i(){let e,i;if(o.cancel().catch(R),n.collectStreamBody){let t;if(1===r.length)t=r[0];else{t=new Uint8Array(s);let e=0;r.forEach((n=>{t.set(n,e),e+=n.length}))}e=t.slice(0,n.bytesLimit),i=t.length>n.bytesLimit}t(void 0,e,i)}!function e(){o.read().then(f((t=>{t.done?i():(n.collectStreamBody&&r.push(t.value),s+=t.value.length,s>n.bytesLimit?i():e())})),f((e=>t(e))))}()}(e,((e,t,o)=>{if(e)n(e);else{let e=(new TextDecoder).decode(t);o&&(e+="..."),n(void 0,e)}}),{bytesLimit:t,collectStreamBody:!0})}(o.body,t.requestErrorResponseLengthLimit,((e,t)=>{n(e?"Unable to retrieve response: "+e:t)})):o.text().then(f((e=>n(wn(e,t)))),f((e=>n("Unable to retrieve response: "+e)))):n()}(o.response,e,s):o.error&&function(e,t,n){n(wn(ie(V(e)),t))}(o.error,e,s))}}(r,a),function(e,t){if(!e.forwardErrorsToLogs)return{stop:R};const n=new M,{stop:o}=function(e){const t=(t,n)=>{const o=ue({stackTrace:n,originalError:t,startClocks:ke(),nonErrorPrefix:"Uncaught",source:ze,handling:"unhandled"});e.notify(o)},{stop:n}=(o=t,ot(window,"onerror",(({parameters:[e,t,n,r,s]})=>{let i;pe(s)||(i=function(e,t,n,o){if(void 0===t)return;const{name:r,message:s}=function(e){let t,n;return"[object String]"==={}.toString.call(e)&&([,t,n]=re.exec(e)),{name:t,message:n}}(e);return{name:r,message:s,stack:[{url:t,column:o,line:n}]}}(e,t,n,r)),o(null!=s?s:e,i)})));var o;const{stop:r}=function(e){return ot(window,"onunhandledrejection",(({parameters:[t]})=>{e(t.reason||"Empty reason")}))}(t);return{stop(){n(),r()}}}(n);n.subscribe((e=>{t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:Ze(e),origin:ze,status:Ve.error},messageContext:e.context})}))}(r,a),function(n,o){var r;(r=n.forwardConsoleLogs,U(...r.map((n=>(pn[n]||(pn[n]=function(n){return new M((o=>{const r=t[n];return t[n]=(...t)=>{r.apply(console,t);const s=se("console error");p((()=>{o.notify(function(t,n,o){const r=t.map((e=>function(e){return"string"==typeof e?A(e):pe(e)?ae(V(e)):O(A(e),void 0,2)}(e))).join(" ");if(n===e.error){const e=ue({originalError:t.find(pe),handlingStack:o,startClocks:ke(),source:He,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return e.message=r,{api:n,message:r,handlingStack:o,error:e}}return{api:n,message:r,error:void 0,handlingStack:o}}(t,n,s))}))},()=>{t[n]=r}}))}(n)),pn[n]))))).subscribe((e=>{var t;const n={rawLogsEvent:{date:we(),message:e.message,origin:He,error:e.error&&Ze(e.error),status:gn[e.api]},messageContext:null===(t=e.error)||void 0===t?void 0:t.context,domainContext:{handlingStack:e.handlingStack}};o.notify(0,n)}))}(r,a),function(e,t){(function(e,t){const n=[];t.includes(Zt.cspViolation)&&n.push(function(e){return new M((t=>{const{stop:n}=N(e,document,"securitypolicyviolation",(e=>{t.notify(function(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return Xt({type:e.effectiveDirective,message:`${Zt.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:Yt(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${dt(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}(e))}));return n}))}(e));const o=t.filter((e=>e!==Zt.cspViolation));return o.length&&n.push(function(e){return new M((t=>{if(!window.ReportingObserver)return;const n=f(((e,n)=>e.forEach((e=>t.notify(function(e){const{type:t,body:n}=e;return Xt({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:Yt(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}(e)))))),o=new window.ReportingObserver(n,{types:e,buffered:!0});return o.observe(),()=>{o.disconnect()}}))}(o)),U(...n)})(e,e.forwardReports).subscribe((e=>{let n,o=e.message;const r="deprecation"===e.originalError.type?Ve.warn:Ve.error;var s,i;r===Ve.error?n=Ze(e):e.stack&&(o+=" Found in "+(s=e.stack,null===(i=/@ (.+)/.exec(s))||void 0===i?void 0:i[1])),t.notify(0,{rawLogsEvent:{date:we(),message:o,origin:Je,error:n,status:r}})}))}(r,a);const{handleLog:v}=function(e){return{handleLog(o,r,s,i,a){const c=w(r.getContext(),o.context);if(We(o.status,"console",r)&&function({status:e,message:o},r){n[xn[e]].call(t,o,r)}(o,c),We(o.status,Xe,r)){const t={rawLogsEvent:{date:a||we(),message:o.message,status:o.status,origin:Ge},messageContext:c,savedCommonContext:i};s&&(t.domainContext={handlingStack:s}),e.notify(0,t)}}}}(a);if(function(e,t,n,o,r,s){const i=Ye.concat(["custom"]),a={};i.forEach((e=>{a[e]=function(e,t,n){let o=0,r=!1;return{isLimitReached(){if(0===o&&C((()=>{o=0}),6e4),o+=1,o<=t||r)return r=!1,!1;if(o===t+1){r=!0;try{n({message:`Reached max number of ${e}s by minute: ${t}`,source:Fe,startClocks:ke()})}finally{r=!1}}return!0}}}(e,t.eventRateLimiterThreshold,s)})),n.subscribe(0,(({rawLogsEvent:s,messageContext:i,savedCommonContext:c,domainContext:u})=>{var l,d;const f=s.date-Ce(),p=e.findTrackedSession(f);if(!e.findTrackedSession(f,{returnInactive:!0}))return;const g=c||r();let m;!G(g.account)&&g.account.id&&(m=g.account),p&&p.anonymousId&&!g.user.anonymous_id&&(g.user.id=G(g.user)?p.anonymousId:g.user.id,g.user.anonymous_id=p.anonymousId);const y=o.triggerHook(0,{startTime:f}),h=w({service:t.service,session_id:p?p.id:void 0,session:p?{id:p.id}:void 0,usr:G(g.user)?void 0:g.user,account:m,view:g.view},g.context,y,s,i);!1===(null===(l=t.beforeSend)||void 0===l?void 0:l.call(t,h,u))||h.origin!==Fe&&(null!==(d=a[h.status])&&void 0!==d?d:a.custom).isLimitReached()||n.notify(1,h)}))}(m,r,a,c,s,d),nt())!function(e){const t=tt();e.subscribe(1,(e=>{t.send("log",e)}))}(a);else{const{stop:e}=function(e,t,n,o,r){const s=Mn(e,{endpoint:e.logsEndpointBuilder,encoder:Un()},e.replica&&{endpoint:e.replica.logsEndpointBuilder,encoder:Un()},n,o,r.expireObservable);return t.subscribe(1,(e=>{s.add(e)})),s}(r,a,d,g,m);l.push((()=>e()))}var S;return{handleLog:v,getInternalContext:(S=m,{get(e){const t=S.findTrackedSession(e);if(t)return{session_id:t.id}}}).get,stop(){l.forEach((e=>e())),y()}}}(r,s,m,g);return y=function(e,t){return{init(e){Ne("FC_LOGS",e)},initConfiguration:e,...t}}(r,a),a}));const h={};return function(e){const t={version:"0.0.5",onReady(e){e()},...e};return Object.defineProperty(t,"_setDebug",{get:()=>d,enumerable:!1}),t}({logger:new Qe(((...e)=>y.handleLog(...e))),init:f((e=>y.init(e))),setTrackingConsent:f((e=>{g.update(e),Ue({type:Ie,usage:{feature:"set-tracking-consent",tracking_consent:e}})})),getGlobalContext:f((()=>o.getContext())),setGlobalContext:f((e=>o.setContext(e))),setGlobalContextProperty:f(((e,t)=>o.setContextProperty(e,t))),removeGlobalContextProperty:f((e=>o.removeContextProperty(e))),clearGlobalContext:f((()=>o.clearContext())),createLogger:f(((e,t={})=>(h[e]=new Qe(((...e)=>y.handleLog(...e)),A(e),t.handler,t.level,A(t.context)),h[e]))),getLogger:f((e=>h[e])),getInitConfiguration:f((()=>v(y.initConfiguration))),getInternalContext:f((e=>y.getInternalContext(e))),setUser:f(i.setContext),getUser:f(i.getContext),setUserProperty:f(i.setContextProperty),removeUserProperty:f(i.removeContextProperty),clearUser:f(i.clearContext),setAccount:f(l.setContext),getAccount:f(l.getContext),setAccountProperty:f(l.setContextProperty),removeAccountProperty:f(l.removeContextProperty),clearAccount:f(l.clearContext)})}();!function(e,t,n){const o=e[t];o&&!o.q&&o.version&&r.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=n,o&&o.q&&o.q.forEach((e=>c(e,"onReady callback threw an error:")()))}(y(),"FC_LOGS",Dn)})(); |
@@ -13,3 +13,5 @@ "use strict"; | ||
| function validateAndBuildLogsConfiguration(initConfiguration) { | ||
| if (initConfiguration.usePciIntake === true && initConfiguration.site && initConfiguration.site !== 'browser.flashcat.cloud') { | ||
| if (initConfiguration.usePciIntake === true && | ||
| initConfiguration.site && | ||
| initConfiguration.site !== 'browser.flashcat.cloud') { | ||
| browser_core_1.display.warn('PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.'); | ||
@@ -16,0 +18,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../src/domain/configuration.ts"],"names":[],"mappings":";;;AAyDA,8EAsCC;AAED,sEAeC;AAED,gEAUC;AA3HD,8DASoC;AA0CpC;;GAEG;AACU,QAAA,2CAA2C,GAAG,EAAE,GAAG,4BAAa,CAAA;AAE7E,SAAgB,iCAAiC,CAC/C,iBAAwC;IAExC,IAAI,iBAAiB,CAAC,YAAY,KAAK,IAAI,IAAI,iBAAiB,CAAC,IAAI,IAAI,iBAAiB,CAAC,IAAI,KAAK,wBAAwB,EAAE,CAAC;QAC7H,sBAAO,CAAC,IAAI,CACV,mHAAmH,CACpH,CAAA;IACH,CAAC;IAED,MAAM,iBAAiB,GAAG,IAAA,4CAA6B,EAAC,iBAAiB,CAAC,CAAA;IAE1E,MAAM,kBAAkB,GAAG,6BAA6B,CACtD,iBAAiB,CAAC,kBAAkB,EACpC,IAAA,2BAAY,EAAC,6BAAc,CAAC,EAC5B,sBAAsB,CACvB,CAAA;IAED,MAAM,cAAc,GAAG,6BAA6B,CAClD,iBAAiB,CAAC,cAAc,EAChC,IAAA,2BAAY,EAAC,4BAAa,CAAC,EAC3B,iBAAiB,CAClB,CAAA;IAED,IAAI,CAAC,iBAAiB,IAAI,CAAC,kBAAkB,IAAI,CAAC,cAAc,EAAE,CAAC;QACjE,OAAM;IACR,CAAC;IAED,IAAI,iBAAiB,CAAC,mBAAmB,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,6BAAc,CAAC,KAAK,CAAC,EAAE,CAAC;QAChG,kBAAkB,CAAC,IAAI,CAAC,6BAAc,CAAC,KAAK,CAAC,CAAA;IAC/C,CAAC;IAED,OAAO;QACL,mBAAmB,EAAE,iBAAiB,CAAC,mBAAm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AK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACzG,sBAAO,CAAC,KAAK,CAAC,GAAG,KAAK,qDAAqD,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACzG,OAAM;IACR,CAAC;IAED,OAAO,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,IAAA,+BAAgB,EAAI,MAAM,CAAC,CAAA;AACvE,CAAC;AAED,SAAgB,0BAA0B,CAAC,aAAoC;IAC7E,MAAM,+BAA+B,GAAG,IAAA,qCAAsB,EAAC,aAAa,CAAC,CAAA;IAE7E,OAAO;QACL,sBAAsB,EAAE,aAAa,CAAC,mBAAmB;QACzD,oBAAoB,EAAE,aAAa,CAAC,kBAAkB;QACtD,eAAe,EAAE,aAAa,CAAC,cAAc;QAC7C,cAAc,EAAE,aAAa,CAAC,YAAY;QAC1C,GAAG,+BAA+B;KACC,CAAA;AACvC,CAAC"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/domain/hooks.ts"],"names":[],"mappings":";;;AACA,8DAA2D;AAW9C,QAAA,WAAW,GAAG,CAAA,4BAA0D,CAAA,CAAA"} | ||
| {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/domain/hooks.ts"],"names":[],"mappings":";;;AAOA,8DAA2D;AAW9C,QAAA,WAAW,GAAG,CAAA,4BAA0D,CAAA,CAAA"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"reportCollection.js","sourceRoot":"","sources":["../../../src/domain/report/reportCollection.ts"],"names":[],"mappings":";;AAeA,sDA4BC;AA1CD,8DAA0H;AAI1H,yDAAmD;AACnD,kFAA8E;AAS9E,SAAgB,qBAAqB,CAAC,aAAgC,EAAE,SAAoB;IAC1F,MAAM,kBAAkB,GAAG,IAAA,mCAAoB,EA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AAG,QAAQ,CAAC,OAAO,CAAA;QAC9B,IAAI,KAAK,CAAA;QACT,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,yBAAU,CAAC,IAAI,CAAC,CAAC,CAAC,yBAAU,CAAC,KAAK,CAAA;QAEjG,IAAI,MAAM,KAAK,yBAAU,CAAC,KAAK,EAAE,CAAC;YAChC,KAAK,GAAG,IAAA,2DAA4B,EAAC,QAAQ,CAAC,CAAA;QAChD,CAAC;aAAM,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YAC1B,OAAO,IAAI,aAAa,IAAA,0CAA2B,EAAC,QAAQ,CAAC,KAAK,CAAE,EAAE,CAAA;QACxE,CAAC;QAED,SAAS,CAAC,MAAM,+CAAuC;YACrD,YAAY,EAAE;gBACZ,IAAI,EAAE,IAAA,2BAAY,GAAE;gBACpB,OAAO;gBACP,MAAM,EAAE,0BAAW,CAAC,MAAM;gBAC1B,KAAK;gBACL,MAAM;aACP;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,kBAAkB,CAAC,WAAW,EAAE,CAAA;QAClC,CAAC;KACF,CAAA;AACH,CAAC"} |
@@ -7,3 +7,5 @@ import { serializeConfiguration, ONE_KIBI_BYTE, validateAndBuildConfiguration, display, removeDuplicates, ConsoleApiName, RawReportType, objectValues, } from '@flashcatcloud/browser-core'; | ||
| export function validateAndBuildLogsConfiguration(initConfiguration) { | ||
| if (initConfiguration.usePciIntake === true && initConfiguration.site && initConfiguration.site !== 'browser.flashcat.cloud') { | ||
| if (initConfiguration.usePciIntake === true && | ||
| initConfiguration.site && | ||
| initConfiguration.site !== 'browser.flashcat.cloud') { | ||
| display.warn('PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.'); | ||
@@ -10,0 +12,0 @@ } |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"configuration.js","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a,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACzG,OAAO,CAAC,KAAK,CAAC,GAAG,KAAK,qDAAqD,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACzG,OAAM;IACR,CAAC;IAED,OAAO,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,CAAI,MAAM,CAAC,CAAA;AACvE,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,aAAoC;IAC7E,MAAM,+BAA+B,GAAG,sBAAsB,CAAC,aAAa,CAAC,CAAA;IAE7E,OAAO;QACL,sBAAsB,EAAE,aAAa,CAAC,mBAAmB;QACzD,oBAAoB,EAAE,aAAa,CAAC,kBAAkB;QACtD,eAAe,EAAE,aAAa,CAAC,cAAc;QAC7C,cAAc,EAAE,aAAa,CAAC,YAAY;QAC1C,GAAG,+BAA+B;KACC,CAAA;AACvC,CAAC"} |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/domain/hooks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAW3D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAA,aAA0D,CAAA,CAAA"} | ||
| {"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../src/domain/hooks.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAW3D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAA,aAA0D,CAAA,CAAA"} |
@@ -1,2 +0,2 @@ | ||
| import { timeStampNow, ErrorSource, getFileFromStackTraceString, initReportObservable } from '@flashcatcloud/browser-core'; | ||
| import { timeStampNow, ErrorSource, getFileFromStackTraceString, initReportObservable, } from '@flashcatcloud/browser-core'; | ||
| import { StatusType } from '../logger/isAuthorized'; | ||
@@ -3,0 +3,0 @@ import { createErrorFieldFromRawError } from '../createErrorFieldFromRawError'; |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"reportCollection.js","sourceRoot":"","sources":["../../../src/domain/report/reportCollection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAI1H,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAA;AAS9E,MAAM,UAAU,qBAAqB,CAAC,aAAgC,EAAE,SAAoB;IAC1F,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,aAAa,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,EAAE;QAClH,IAAI,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAA;QAC9B,IAAI,KAAK,CAAA;QACT,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAA;QAEjG,IAAI,MAAM,KAAK,UAAU,CAAC,KAAK,EAAE,CAAC;YAChC,KAAK,GAAG,4BAA4B,CAAC,QAAQ,CAAC,CAAA;QAChD,CAAC;aAAM,IAAI,QAAQ,CAAC,KAAK,EAAE,CAAC;YAC1B,OAAO,IAAI,aAAa,2BAA2B,CAAC,QAAQ,CAAC,KAAK,CAAE,EAAE,CAAA;QACxE,CAAC;QAED,SAAS,CAAC,MAAM,+CAAuC;YACrD,YAAY,EAAE;gBACZ,IAAI,EAAE,YAAY,EAAE;gBACpB,OAAO;gBACP,MAAM,EAAE,WAAW,CAAC,MAAM;gBAC1B,KAAK;gBACL,MAAM;aACP;SACF,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,OAAO;QACL,IAAI,EAAE,GAAG,EAAE;YACT,kBAAkB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AkB,CAAC,WAAW,EAAE,CAAA;QAClC,CAAC;KACF,CAAA;AACH,CAAC"} |
+4
-4
| { | ||
| "name": "@flashcatcloud/browser-logs", | ||
| "version": "0.0.4-alpha.2", | ||
| "version": "0.0.5", | ||
| "license": "Apache-2.0", | ||
@@ -17,6 +17,6 @@ "main": "cjs/entries/main.js", | ||
| "dependencies": { | ||
| "@flashcatcloud/browser-core": "0.0.4-alpha.2" | ||
| "@flashcatcloud/browser-core": "0.0.5" | ||
| }, | ||
| "peerDependencies": { | ||
| "@flashcatcloud/browser-rum": "0.0.4-alpha.2" | ||
| "@flashcatcloud/browser-rum": "0.0.5" | ||
| }, | ||
@@ -42,3 +42,3 @@ "peerDependenciesMeta": { | ||
| }, | ||
| "gitHead": "47ccf1e6a719c63d0e77907bc92917c36058abfb" | ||
| "gitHead": "60048ccbac99c2cfc987df6891985ac27d3b0a53" | ||
| } |
+0
-1
@@ -5,3 +5,2 @@ # Browser Log Collection | ||
| ## Usage | ||
@@ -8,0 +7,0 @@ |
@@ -61,3 +61,7 @@ import type { Configuration, InitConfiguration, RawTelemetryConfiguration } from '@flashcatcloud/browser-core' | ||
| ): LogsConfiguration | undefined { | ||
| if (initConfiguration.usePciIntake === true && initConfiguration.site && initConfiguration.site !== 'browser.flashcat.cloud') { | ||
| if ( | ||
| initConfiguration.usePciIntake === true && | ||
| initConfiguration.site && | ||
| initConfiguration.site !== 'browser.flashcat.cloud' | ||
| ) { | ||
| display.warn( | ||
@@ -64,0 +68,0 @@ 'PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.' |
@@ -1,2 +0,8 @@ | ||
| import type { DISCARDED, HookNamesAsConst, RecursivePartialExcept, RelativeTime, SKIPPED } from '@flashcatcloud/browser-core' | ||
| import type { | ||
| DISCARDED, | ||
| HookNamesAsConst, | ||
| RecursivePartialExcept, | ||
| RelativeTime, | ||
| SKIPPED, | ||
| } from '@flashcatcloud/browser-core' | ||
| import { abstractHooks } from '@flashcatcloud/browser-core' | ||
@@ -3,0 +9,0 @@ import type { LogsEvent } from '../logsEvent.types' |
| import type { Context, ClocksState } from '@flashcatcloud/browser-core' | ||
| import { timeStampNow, ErrorSource, getFileFromStackTraceString, initReportObservable } from '@flashcatcloud/browser-core' | ||
| import { | ||
| timeStampNow, | ||
| ErrorSource, | ||
| getFileFromStackTraceString, | ||
| initReportObservable, | ||
| } from '@flashcatcloud/browser-core' | ||
| import type { LogsConfiguration } from '../configuration' | ||
@@ -4,0 +9,0 @@ import type { LifeCycle } from '../lifeCycle' |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
5039
0.38%351933
039
-2.5%4
33.33%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed