@grafana/faro-web-sdk 1.12.1 → 1.12.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. package/dist/bundle/faro-web-sdk.iife.js +1 -1
  2. package/dist/bundle/types/instrumentations/console/instrumentation.d.ts +1 -1
  3. package/dist/bundle/types/instrumentations/errors/instrumentation.d.ts +1 -1
  4. package/dist/bundle/types/instrumentations/performance/instrumentation.d.ts +1 -1
  5. package/dist/bundle/types/instrumentations/session/instrumentation.d.ts +1 -1
  6. package/dist/bundle/types/instrumentations/view/instrumentation.d.ts +1 -1
  7. package/dist/bundle/types/instrumentations/webVitals/instrumentation.d.ts +1 -1
  8. package/dist/bundle/types/transports/console/transport.d.ts +1 -1
  9. package/dist/bundle/types/transports/fetch/transport.d.ts +1 -1
  10. package/dist/cjs/instrumentations/console/instrumentation.js +2 -6
  11. package/dist/cjs/instrumentations/console/instrumentation.js.map +1 -1
  12. package/dist/esm/instrumentations/console/instrumentation.js +3 -7
  13. package/dist/esm/instrumentations/console/instrumentation.js.map +1 -1
  14. package/dist/types/instrumentations/console/instrumentation.d.ts +1 -1
  15. package/dist/types/instrumentations/errors/instrumentation.d.ts +1 -1
  16. package/dist/types/instrumentations/performance/instrumentation.d.ts +1 -1
  17. package/dist/types/instrumentations/session/instrumentation.d.ts +1 -1
  18. package/dist/types/instrumentations/view/instrumentation.d.ts +1 -1
  19. package/dist/types/instrumentations/webVitals/instrumentation.d.ts +1 -1
  20. package/dist/types/transports/console/transport.d.ts +1 -1
  21. package/dist/types/transports/fetch/transport.d.ts +1 -1
  22. package/package.json +3 -3
@@ -1 +1 @@
1
- var GrafanaFaroWebSdk=function(e){"use strict";function t(e,t){return typeof e===t}function n(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function i(e,t){try{return e instanceof t}catch(e){return!1}}const r=e=>t(e,"null"),o=e=>t(e,"string"),s=e=>t(e,"number")&&!isNaN(e)||t(e,"bigint"),a=e=>!r(e)&&t(e,"object"),u=e=>t(e,"function"),l=e=>n(e,"Array"),c=e=>!a(e)&&!u(e),d="undefined"!=typeof Event,f=e=>d&&i(e,Event),p="undefined"!=typeof Error,m=e=>p&&i(e,Error),g=e=>n(e,"ErrorEvent"),v=e=>n(e,"DOMError"),h=e=>n(e,"DOMException"),b="undefined"!=typeof Element,w="undefined"!=typeof Map;function y(e,n){if(e===n)return!0;if(t(e,"number")&&isNaN(e))return t(n,"number")&&isNaN(n);const i=l(e),r=l(n);if(i!==r)return!1;if(i&&r){const t=e.length;if(t!==n.length)return!1;for(let i=t;0!=i--;)if(!y(e[i],n[i]))return!1;return!0}const o=a(e),s=a(n);if(o!==s)return!1;if(e&&n&&o&&s){const t=Object.keys(e),i=Object.keys(n);if(t.length!==i.length)return!1;for(let e of t)if(!i.includes(e))return!1;for(let i of t)if(!y(e[i],n[i]))return!1;return!0}return!1}function S(){return Date.now()}function T(){return(new Date).toISOString()}function E(e){return new Date(e).toISOString()}var I;e.LogLevel=void 0,(I=e.LogLevel||(e.LogLevel={})).TRACE="trace",I.DEBUG="debug",I.INFO="info",I.LOG="log",I.WARN="warn",I.ERROR="error";const k=e.LogLevel.LOG,x=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function L(){}function O(e){const{size:t,concurrency:n}=e,i=[];let r=0;const o=()=>{if(r<n&&i.length){const{producer:e,resolve:t,reject:n}=i.shift();r++,e().then((e=>{r--,o(),t(e)}),(e=>{r--,o(),n(e)}))}};return{add:e=>{if(i.length+r>=t)throw new Error("Task buffer full");return new Promise(((t,n)=>{i.push({producer:e,resolve:t,reject:n}),o()}))}}}const C="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function P(e=10){return Array.from(Array(e)).map((()=>C[Math.floor(Math.random()*C.length)])).join("")}const _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;class N{constructor(e,t){var n,i;this.signalBuffer=[],this.itemLimit=null!==(n=null==t?void 0:t.itemLimit)&&void 0!==n?n:50,this.sendTimeout=null!==(i=null==t?void 0:t.sendTimeout)&&void 0!==i?i:250,this.paused=(null==t?void 0:t.paused)||!1,this.sendFn=e,this.flushInterval=-1,this.paused||this.start(),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&this.flush()}))}addItem(e){this.paused||(this.signalBuffer.push(e),this.signalBuffer.length>=this.itemLimit&&this.flush())}start(){this.paused=!1,this.sendTimeout>0&&(this.flushInterval=window.setInterval((()=>this.flush()),this.sendTimeout))}pause(){this.paused=!0,clearInterval(this.flushInterval)}groupItems(e){const t=new Map;return e.forEach((e=>{const n=JSON.stringify(e.meta);let i=t.get(n);i=void 0===i?[e]:[...i,e],t.set(n,i)})),Array.from(t.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}var A;e.TransportItemType=void 0,(A=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",A.LOG="log",A.MEASUREMENT="measurement",A.TRACE="trace",A.EVENT="event";const M={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function D(t){return n=>{if(n.type===e.TransportItemType.EXCEPTION&&n.payload){const e=n.payload,i=`${e.type}: ${e.value}`;if(function(e,t){return e.some((e=>o(e)?t.includes(e):!!t.match(e)))}(t,i))return null}return n}}function j(e,t,n,i){var r;t.debug("Initializing transports");const o=[];let s=n.paused,a=[];const u=e=>{let t=e;for(const e of a){const n=t.map(e).filter(Boolean);if(0===n.length)return[];t=n}return t},l=e=>{const n=u(e);if(0!==n.length)for(const e of o)t.debug(`Transporting item using ${e.name}\n`,n),e.isBatched()&&e.send(n)};let c;(null===(r=n.batching)||void 0===r?void 0:r.enabled)&&(c=new N(l,{sendTimeout:n.batching.sendTimeout,itemLimit:n.batching.itemLimit,paused:s}));return{add:(...r)=>{t.debug("Adding transports"),r.forEach((r=>{t.debug(`Adding "${r.name}" transport`);o.some((e=>e===r))?t.warn(`Transport ${r.name} is already added`):(r.unpatchedConsole=e,r.internalLogger=t,r.config=n,r.metas=i,o.push(r))}))},addBeforeSendHooks:(...e)=>{t.debug("Adding beforeSendHooks\n",a),e.forEach((e=>{e&&a.push(e)}))},addIgnoreErrorsPatterns:(...e)=>{t.debug("Adding ignoreErrorsPatterns\n",e),e.forEach((e=>{e&&a.push(D(e))}))},getBeforeSendHooks:()=>[...a],execute:e=>{var i;s||((null===(i=n.batching)||void 0===i?void 0:i.enabled)&&(null==c||c.addItem(e)),(e=>{var i,r;if((null===(i=n.batching)||void 0===i?void 0:i.enabled)&&o.every((e=>e.isBatched())))return;const[s]=u([e]);if(void 0!==s)for(const e of o)t.debug(`Transporting item using ${e.name}\n`,s),e.isBatched()?(null===(r=n.batching)||void 0===r?void 0:r.enabled)||e.send([s]):e.send(s)})(e))},isPaused:()=>s,pause:()=>{t.debug("Pausing transports"),null==c||c.pause(),s=!0},remove:(...e)=>{t.debug("Removing transports"),e.forEach((e=>{t.debug(`Removing "${e.name}" transport`);const n=o.indexOf(e);-1!==n?o.splice(n,1):t.warn(`Transport "${e.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{a.filter((t=>!e.includes(t)))},get transports(){return[...o]},unpause:()=>{t.debug("Unpausing transports"),null==c||c.start(),s=!1}}}var R;e.InternalLoggerLevel=void 0,(R=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[R.OFF=0]="OFF",R[R.ERROR=1]="ERROR",R[R.WARN=2]="WARN",R[R.INFO=3]="INFO",R[R.VERBOSE=4]="VERBOSE";const B={debug:L,error:L,info:L,prefix:"Faro",warn:L},U=e.InternalLoggerLevel.ERROR,F=Object.assign({},console);let z=F;function V(e){var t;return z=null!==(t=e.unpatchedConsole)&&void 0!==t?t:z,z}function $(t=F,n=U){const i=B;return n>e.InternalLoggerLevel.OFF&&(i.error=n>=e.InternalLoggerLevel.ERROR?function(...e){t.error(`${i.prefix}\n`,...e)}:L,i.warn=n>=e.InternalLoggerLevel.WARN?function(...e){t.warn(`${i.prefix}\n`,...e)}:L,i.info=n>=e.InternalLoggerLevel.INFO?function(...e){t.info(`${i.prefix}\n`,...e)}:L,i.debug=n>=e.InternalLoggerLevel.VERBOSE?function(...e){t.debug(`${i.prefix}\n`,...e)}:L),i}let q=B;function G(e,t){return q=$(e,t.internalLoggerLevel),q}class W{constructor(){this.unpatchedConsole=F,this.internalLogger=B,this.config={},this.metas={}}logDebug(...e){this.internalLogger.debug(`${this.name}\n`,...e)}logInfo(...e){this.internalLogger.info(`${this.name}\n`,...e)}logWarn(...e){this.internalLogger.warn(`${this.name}\n`,...e)}logError(...e){this.internalLogger.error(`${this.name}\n`,...e)}}class H extends W{isBatched(){return!1}getIgnoreUrls(){return[]}}function K(e,t){var n,i;if(void 0===t)return e;if(void 0===e)return{resourceSpans:t};const r=null===(n=e.resourceSpans)||void 0===n?void 0:n[0];if(void 0===r)return e;const o=(null==r?void 0:r.scopeSpans)||[],s=(null===(i=null==t?void 0:t[0])||void 0===i?void 0:i.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},r),{scopeSpans:[...o,...s]})]})}function X(t){let n={meta:{}};return void 0!==t[0]&&(n.meta=t[0].meta),t.forEach((t=>{switch(t.type){case e.TransportItemType.LOG:case e.TransportItemType.EVENT:case e.TransportItemType.EXCEPTION:case e.TransportItemType.MEASUREMENT:const i=M[t.type],r=n[i];n=Object.assign(Object.assign({},n),{[i]:void 0===r?[t.payload]:[...r,t.payload]});break;case e.TransportItemType.TRACE:n=Object.assign(Object.assign({},n),{traces:K(n.traces,t.payload.resourceSpans)})}})),n}const J="Error";let Z;function Y(e){let t=e.cause;return m(t)?t=e.cause.toString():null!==t&&(a(e.cause)||l(e.cause))?t=JSON.stringify(e.cause):null!=t&&(t=e.cause.toString()),null==t?{}:{cause:t}}const Q=e=>e.map((e=>{try{return String(e)}catch(e){return""}})).join(" ");function ee(t,n,i,o,s){n.debug("Initializing API");const a=function(t,n,i,r,o){let s;return n.debug("Initializing traces API"),{getOTEL:()=>s,getTraceContext:()=>{const e=null==s?void 0:s.trace.getSpanContext(s.context.active());return e?{trace_id:e.traceId,span_id:e.spanId}:void 0},initOTEL:(e,t)=>{n.debug("Initializing OpenTelemetry"),s={trace:e,context:t}},isOTELInitialized:()=>!!s,pushTraces:t=>{try{const i={type:e.TransportItemType.TRACE,payload:t,meta:r.value};n.debug("Pushing trace\n",i),o.execute(i)}catch(e){n.error("Error pushing trace\n",e)}}}}(0,n,0,o,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),function(t,n,i,o,s,a){var u;n.debug("Initializing exceptions API");let l=null;Z=null!==(u=i.parseStacktrace)&&void 0!==u?u:Z;const c=e=>{n.debug("Changing stacktrace parser"),Z=null!=e?e:Z};return c(i.parseStacktrace),{changeStacktraceParser:c,getStacktraceParser:()=>Z,pushError:(t,{skipDedupe:u,stackFrames:c,type:d,context:f,spanContext:p,timestampOverwriteMs:m}={})=>{d=d||t.name||J;const g={meta:o.value,payload:{type:d,value:t.message,timestamp:m?E(m):T(),trace:p?{trace_id:p.traceId,span_id:p.spanId}:a.getTraceContext(),context:Object.assign(Object.assign({},Y(t)),null!=f?f:{})},type:e.TransportItemType.EXCEPTION};(null==(c=null!=c?c:t.stack?null==Z?void 0:Z(t).frames:void 0)?void 0:c.length)&&(g.payload.stacktrace={frames:c});const v={type:g.payload.type,value:g.payload.value,stackTrace:g.payload.stacktrace,context:g.payload.context};u||!i.dedupe||r(l)||!y(v,l)?(l=v,n.debug("Pushing exception\n",g),s.execute(g)):n.debug("Skipping error push because it is the same as the last one\n",g.payload)}}}(0,n,i,o,s,a)),function(e,t,n,i){let r,o,s;t.debug("Initializing meta API");const a=e=>{o&&i.remove(o),o={user:e},i.add(o)},u=e=>{r&&i.remove(r),r={session:e},i.add(r)};return{setUser:a,resetUser:a,setSession:u,resetSession:u,getSession:()=>i.value.session,setView:e=>{var t;if((null===(t=null==s?void 0:s.view)||void 0===t?void 0:t.name)===(null==e?void 0:e.name))return;const n=s;s={view:e},i.add(s),n&&i.remove(n)},getView:()=>i.value.view}}(0,n,0,o)),function(t,n,i,o,s,a){var u;n.debug("Initializing logs API");let l=null;const c=null!==(u=i.logArgsSerializer)&&void 0!==u?u:Q;return{pushLog:(t,{context:u,level:d,skipDedupe:f,spanContext:p,timestampOverwriteMs:m}={})=>{try{const g={type:e.TransportItemType.LOG,payload:{message:c(t),level:null!=d?d:k,context:null!=u?u:{},timestamp:m?E(m):T(),trace:p?{trace_id:p.traceId,span_id:p.spanId}:a.getTraceContext()},meta:o.value},v={message:g.payload.message,level:g.payload.level,context:g.payload.context};if(!f&&i.dedupe&&!r(l)&&y(v,l))return void n.debug("Skipping log push because it is the same as the last one\n",g.payload);l=v,n.debug("Pushing log\n",g),s.execute(g)}catch(e){n.error("Error pushing log\n",e)}}}}(0,n,i,o,s,a)),function(t,n,i,o,s,a){n.debug("Initializing measurements API");let u=null;return{pushMeasurement:(t,{skipDedupe:l,context:c,spanContext:d,timestampOverwriteMs:f}={})=>{try{const p={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},t),{trace:d?{trace_id:d.traceId,span_id:d.spanId}:a.getTraceContext(),timestamp:f?E(f):T(),context:null!=c?c:{}}),meta:o.value},m={type:p.payload.type,values:p.payload.values,context:p.payload.context};if(!l&&i.dedupe&&!r(u)&&y(m,u))return void n.debug("Skipping measurement push because it is the same as the last one\n",p.payload);u=m,n.debug("Pushing measurement\n",p),s.execute(p)}catch(e){n.error("Error pushing measurement\n",e)}}}}(0,n,i,o,s,a)),function(t,n,i,o,s,a){let u=null;return{pushEvent:(t,l,c,{skipDedupe:d,spanContext:f,timestampOverwriteMs:p}={})=>{try{const m={meta:o.value,payload:{name:t,domain:null!=c?c:i.eventDomain,attributes:l,timestamp:p?E(p):T(),trace:f?{trace_id:f.traceId,span_id:f.spanId}:a.getTraceContext()},type:e.TransportItemType.EVENT},g={name:m.payload.name,attributes:m.payload.attributes,domain:m.payload.domain};if(!d&&i.dedupe&&!r(u)&&y(g,u))return void n.debug("Skipping event push because it is the same as the last one\n",m.payload);u=g,n.debug("Pushing event\n",m),s.execute(m)}catch(e){n.error("Error pushing event",e)}}}}(0,n,i,o,s,a))}class te extends W{constructor(){super(...arguments),this.api={},this.transports={}}}const ne="1.12.1";const ie="_faroInternal";function re(e){e.config.isolate?e.internalLogger.debug("Skipping registering internal Faro instance on global object"):(e.internalLogger.debug("Registering internal Faro instance on global object"),Object.defineProperty(_,ie,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function oe(){return ie in _}function se(t,n,i,r,o,s,a){return n.debug("Initializing Faro"),e.faro={api:s,config:i,instrumentations:a,internalLogger:n,metas:r,pause:o.pause,transports:o,unpatchedConsole:t,unpause:o.unpause},re(e.faro),function(e){if(e.config.preventGlobalExposure)e.internalLogger.debug("Skipping registering public Faro instance in the global scope");else{if(e.internalLogger.debug(`Registering public faro reference in the global scope using "${e.config.globalObjectKey}" key`),e.config.globalObjectKey in _)return void e.internalLogger.warn(`Skipping global registration due to key "${e.config.globalObjectKey}" being used already. Please set "globalObjectKey" to something else or set "preventGlobalExposure" to "true"`);Object.defineProperty(_,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}function ae(e){const t=V(e),n=G(t,e);if(oe()&&!e.isolate)return void n.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');n.debug("Initializing");const i=function(e,t){let n=[],i=[];const r=()=>n.reduce(((e,t)=>Object.assign(e,u(t)?t():t)),{}),o=()=>{if(i.length){const e=r();i.forEach((t=>t(e)))}};return{add:(...e)=>{t.debug("Adding metas\n",e),n.push(...e),o()},remove:(...e)=>{t.debug("Removing metas\n",e),n=n.filter((t=>!e.includes(t))),o()},addListener:e=>{t.debug("Adding metas listener\n",e),i.push(e)},removeListener:e=>{t.debug("Removing metas listener\n",e),i=i.filter((t=>t!==e))},get value(){return r()}}}(0,n),r=j(t,n,e,i),o=ee(0,n,e,i,r),s=function(e,t,n,i,r,o){t.debug("Initializing instrumentations");const s=[];return{add:(...a)=>{t.debug("Adding instrumentations"),a.forEach((a=>{t.debug(`Adding "${a.name}" instrumentation`),s.some((e=>e.name===a.name))?t.warn(`Instrumentation ${a.name} is already added`):(a.unpatchedConsole=e,a.internalLogger=t,a.config=n,a.metas=i,a.transports=r,a.api=o,s.push(a),a.initialize())}))},get instrumentations(){return[...s]},remove:(...e)=>{t.debug("Removing instrumentations"),e.forEach((e=>{var n,i;t.debug(`Removing "${e.name}" instrumentation`);const r=s.reduce(((t,n,i)=>null===t&&n.name===e.name?i:null),null);r?(null===(i=(n=s[r]).destroy)||void 0===i||i.call(n),s.splice(r,1)):t.warn(`Instrumentation "${e.name}" is not added`)}))}}}(t,n,e,i,r,o),a=se(t,n,e,i,r,o,s);return function(e){var t,n;const i={sdk:{version:ne},app:{bundleId:e.config.app.name&&(r=e.config.app.name,null==_?void 0:_[`__faroBundleId_${r}`])}};var r;const o=null===(t=e.config.sessionTracking)||void 0===t?void 0:t.session;o&&e.api.setSession(o),e.config.app&&(i.app=Object.assign(Object.assign({},e.config.app),i.app)),e.config.user&&(i.user=e.config.user),e.config.view&&(i.view=e.config.view),e.metas.add(i,...null!==(n=e.config.metas)&&void 0!==n?n:[])}(a),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend),e.transports.addIgnoreErrorsPatterns(e.config.ignoreErrors)}(a),function(e){e.instrumentations.add(...e.config.instrumentations)}(a),a}e.faro={};const ue="faro",le={enabled:!0,sendTimeout:250,itemLimit:50},ce="view_changed",de="session_start",fe="session_resume",pe="session_extend",me="unknown";var ge="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ve={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",s="object",a="string",u="major",l="model",c="name",d="type",f="vendor",p="version",m="architecture",g="console",v="mobile",h="tablet",b="smarttv",w="wearable",y="embedded",S="Amazon",T="Apple",E="ASUS",I="BlackBerry",k="Browser",x="Chrome",L="Firefox",O="Google",C="Huawei",P="LG",_="Microsoft",N="Motorola",A="Opera",M="Samsung",D="Sharp",j="Sony",R="Xiaomi",B="Zebra",U="Facebook",F="Chromium OS",z="Mac OS",V=" Browser",$=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},q=function(e,t){return typeof e===a&&-1!==G(t).indexOf(G(e))},G=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,500)},H=function(e,t){for(var n,o,a,u,l,c,d=0;d<t.length&&!l;){var f=t[d],p=t[d+1];for(n=o=0;n<f.length&&!l&&f[n];)if(l=f[n++].exec(e))for(a=0;a<p.length;a++)c=l[++o],typeof(u=p[a])===s&&u.length>0?2===u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,c):this[u[0]]=u[1]:3===u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=c?c.replace(u[1],u[2]):i:this[u[0]]=c?u[1].call(this,c,u[2]):i:4===u.length&&(this[u[0]]=c?u[3].call(this,c.replace(u[1],u[2])):i):this[u]=c||i;d+=2}},K=function(e,t){for(var n in t)if(typeof t[n]===s&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(q(t[n][r],e))return"?"===n?i:n}else if(q(t[n],e))return"?"===n?i:n;return t.hasOwnProperty("*")?t["*"]:e},X={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,p],[/opios[\/ ]+([\w\.]+)/i],[p,[c,A+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[p,[c,A+" GX"]],[/\bopr\/([\w\.]+)/i],[p,[c,A]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[c,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,p],[/quark(?:pc)?\/([-\w\.]+)/i],[p,[c,"Quark"]],[/\bddg\/([\w\.]+)/i],[p,[c,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[c,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[p,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[c,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[p,[c,"Smart Lenovo "+k]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+k],p],[/\bfocus\/([\w\.]+)/i],[p,[c,L+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[c,A+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[c,A+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[c,"MIUI "+k]],[/fxios\/([-\w\.]+)/i],[p,[c,L]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360"+V]],[/\b(qq)\/([\w\.]+)/i],[[c,/(.+)/,"$1Browser"],p],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1"+V],p],[/samsungbrowser\/([\w\.]+)/i],[p,[c,M+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],p],[/metasr[\/ ]?([\d\.]+)/i],[p,[c,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[c,"Sogou Mobile"],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[c,p],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,U],p],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[c,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,x+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[c,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[p,K,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],p],[/(wolvic)\/([\w\.]+)/i],[c,p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[c,L+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,[p,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[c,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,G]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/windows (ce|mobile); ppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[m,/ower/,"",G]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[m,G]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[f,M],[d,h]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[l,[f,M],[d,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[f,T],[d,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[f,T],[d,h]],[/(macintosh);/i],[l,[f,T]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[f,D],[d,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[f,C],[d,h]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[f,C],[d,v]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[l,/_/g," "],[f,R],[d,v]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[f,R],[d,h]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[f,"OPPO"],[d,v]],[/\b(opd2\d{3}a?) bui/i],[l,[f,"OPPO"],[d,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[f,"Vivo"],[d,v]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[l,[f,"Realme"],[d,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[f,N],[d,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[f,N],[d,h]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[f,P],[d,h]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[f,P],[d,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[f,"Lenovo"],[d,h]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[f,"Nokia"],[d,v]],[/(pixel c)\b/i],[l,[f,O],[d,h]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[f,O],[d,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[f,j],[d,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[f,j],[d,h]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[f,"OnePlus"],[d,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[f,S],[d,h]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[f,S],[d,v]],[/(playbook);[-\w\),; ]+(rim)/i],[l,f,[d,h]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[f,I],[d,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[f,E],[d,h]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[f,E],[d,v]],[/(nexus 9)/i],[l,[f,"HTC"],[d,h]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[l,/_/g," "],[d,v]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[l,[f,"TCL"],[d,h]],[/(itel) ((\w+))/i],[[f,G],l,[d,K,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[f,"Acer"],[d,h]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[f,"Meizu"],[d,v]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[l,[f,"Ulefone"],[d,v]],[/droid.+; (a(?:015|06[35]|142p?))/i],[l,[f,"Nothing"],[d,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[f,l,[d,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[f,l,[d,h]],[/(surface duo)/i],[l,[f,_],[d,h]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[f,"Fairphone"],[d,v]],[/(u304aa)/i],[l,[f,"AT&T"],[d,v]],[/\bsie-(\w*)/i],[l,[f,"Siemens"],[d,v]],[/\b(rct\w+) b/i],[l,[f,"RCA"],[d,h]],[/\b(venue[\d ]{2,7}) b/i],[l,[f,"Dell"],[d,h]],[/\b(q(?:mv|ta)\w+) b/i],[l,[f,"Verizon"],[d,h]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[f,"Barnes & Noble"],[d,h]],[/\b(tm\d{3}\w+) b/i],[l,[f,"NuVision"],[d,h]],[/\b(k88) b/i],[l,[f,"ZTE"],[d,h]],[/\b(nx\d{3}j) b/i],[l,[f,"ZTE"],[d,v]],[/\b(gen\d{3}) b.+49h/i],[l,[f,"Swiss"],[d,v]],[/\b(zur\d{3}) b/i],[l,[f,"Swiss"],[d,h]],[/\b((zeki)?tb.*\b) b/i],[l,[f,"Zeki"],[d,h]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],l,[d,h]],[/\b(ns-?\w{0,9}) b/i],[l,[f,"Insignia"],[d,h]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[f,"NextBook"],[d,h]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],l,[d,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],l,[d,v]],[/\b(ph-1) /i],[l,[f,"Essential"],[d,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[f,"Envizen"],[d,h]],[/\b(trio[-\w\. ]+) b/i],[l,[f,"MachSpeed"],[d,h]],[/\btu_(1491) b/i],[l,[f,"Rotor"],[d,h]],[/(shield[\w ]+) b/i],[l,[f,"Nvidia"],[d,h]],[/(sprint) (\w+)/i],[f,l,[d,v]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[f,_],[d,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[f,B],[d,h]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[f,B],[d,v]],[/smart-tv.+(samsung)/i],[f,[d,b]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[f,M],[d,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,P],[d,b]],[/(apple) ?tv/i],[f,[l,T+" TV"],[d,b]],[/crkey/i],[[l,x+"cast"],[f,O],[d,b]],[/droid.+aft(\w+)( bui|\))/i],[l,[f,S],[d,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[f,D],[d,b]],[/(bravia[\w ]+)( bui|\))/i],[l,[f,j],[d,b]],[/(mitv-\w{5}) bui/i],[l,[f,R],[d,b]],[/Hbbtv.*(technisat) (.*);/i],[f,l,[d,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[f,W],[l,W],[d,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,l,[d,g]],[/droid.+; (shield) bui/i],[l,[f,"Nvidia"],[d,g]],[/(playstation [345portablevi]+)/i],[l,[f,j],[d,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[f,_],[d,g]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[l,[f,M],[d,w]],[/((pebble))app/i],[f,l,[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[f,T],[d,w]],[/droid.+; (glass) \d/i],[l,[f,O],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[l,[f,B],[d,w]],[/(quest( \d| pro)?)/i],[l,[f,U],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[d,y]],[/(aeobc)\b/i],[l,[f,S],[d,y]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[l,[d,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[d,h]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,h]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,v]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,p],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[c,[p,K,X]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,K,X],[c,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,z],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,p],[/\(bb(10);/i],[p,[c,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[c,L+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[c,x+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,F],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,p],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,p]]},Z=function(e,t){if(typeof e===s&&(t=e,e=i),!(this instanceof Z))return new Z(e,t).getResult();var g=typeof n!==o&&n.navigator?n.navigator:i,b=e||(g&&g.userAgent?g.userAgent:""),w=g&&g.userAgentData?g.userAgentData:i,y=t?function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n}(J,t):J,S=g&&g.userAgent==b;return this.getBrowser=function(){var e,t={};return t[c]=i,t[p]=i,H.call(t,b,y.browser),t[u]=typeof(e=t[p])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:i,S&&g&&g.brave&&typeof g.brave.isBrave==r&&(t[c]="Brave"),t},this.getCPU=function(){var e={};return e[m]=i,H.call(e,b,y.cpu),e},this.getDevice=function(){var e={};return e[f]=i,e[l]=i,e[d]=i,H.call(e,b,y.device),S&&!e[d]&&w&&w.mobile&&(e[d]=v),S&&"Macintosh"==e[l]&&g&&typeof g.standalone!==o&&g.maxTouchPoints&&g.maxTouchPoints>2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[c]=i,e[p]=i,H.call(e,b,y.engine),e},this.getOS=function(){var e={};return e[c]=i,e[p]=i,H.call(e,b,y.os),S&&!e[c]&&w&&w.platform&&"Unknown"!=w.platform&&(e[c]=w.platform.replace(/chrome os/i,F).replace(/macos/i,z)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return b},this.setUA=function(e){return b=typeof e===a&&e.length>500?W(e,500):e,this},this.setUA(b),this};Z.VERSION="1.0.39",Z.BROWSER=$([c,p,u]),Z.CPU=$([m]),Z.DEVICE=$([l,f,d,g,v,b,h,w,y]),Z.ENGINE=Z.OS=$([c,p]),e.exports&&(t=e.exports=Z),t.UAParser=Z;var Y=typeof n!==o&&(n.jQuery||n.Zepto);if(Y&&!Y.ua){var Q=new Z;Y.ua=Q.getResult(),Y.ua.get=function(){return Q.getUA()},Y.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var n in t)Y.ua[n]=t[n]}}}("object"==typeof window?window:ge)}(ve,ve.exports);var he=ve.exports;const be=()=>{const e=new he.UAParser,{name:t,version:n}=e.getBrowser(),{name:i,version:r}=e.getOS(),o=e.getUA(),s=navigator.language,a=navigator.userAgent.includes("Mobi"),u=function(){if(!t||!n)return;if("userAgentData"in navigator&&navigator.userAgentData)return navigator.userAgentData.brands;return}();return{browser:{name:null!=t?t:me,version:null!=n?n:me,os:`${null!=i?i:me} ${null!=r?r:me}`,userAgent:null!=o?o:me,language:null!=s?s:me,mobile:a,brands:null!=u?u:me,viewportWidth:`${window.innerWidth}`,viewportHeight:`${window.innerHeight}`}}},we=()=>({page:{url:location.href}}),ye=[be,we];function Se(t){var n,i,r,o;return{id:null!==(o=null===(r=null===(i=null===(n=e.faro.config)||void 0===n?void 0:n.sessionTracking)||void 0===i?void 0:i.generateSessionId)||void 0===r?void 0:r.call(i))&&void 0!==o?o:P(),attributes:t}}const Te={session:"sessionStorage",local:"localStorage"};function Ee(t){var n;try{let e;e=window[t];const n="__faro_storage_test__";return e.setItem(n,n),e.removeItem(n),!0}catch(i){return null===(n=e.faro.internalLogger)||void 0===n||n.info(`Web storage of type ${t} is not available. Reason: ${i}`),!1}}function Ie(e,t){return Ce(t)?window[t].getItem(e):null}function ke(e,t,n){if(Ce(n))try{window[n].setItem(e,t)}catch(e){}}function xe(e,t){Ce(t)&&window[t].removeItem(e)}const Le=Ee(Te.local),Oe=Ee(Te.session);function Ce(e){return e===Te.local?Le:e===Te.session&&Oe}function Pe(e,t){let n,i=!1;const r=()=>{null!=n?(e(...n),n=null,setTimeout(r,t)):i=!1};return(...o)=>{i?n=o:(e(...o),i=!0,setTimeout(r,t))}}function _e(e={}){return JSON.stringify(null!=e?e:{},function(){const e=new WeakSet;return function(t,n){if("object"==typeof n&&null!==n){if(e.has(n))return null;e.add(n)}return n}}())}function Ne(){var t,n,i;const r=e.faro.config.sessionTracking;let o=null!==(i=null!==(n=null===(t=null==r?void 0:r.sampler)||void 0===t?void 0:t.call(r,{metas:e.faro.metas.value}))&&void 0!==n?n:null==r?void 0:r.samplingRate)&&void 0!==i?i:1;if("number"!=typeof o){o=0}return Math.random()<o}const Ae="com.grafana.faro.session",Me=144e5,De=9e5,je=De,Re={enabled:!0,persistent:!1,maxSessionPersistenceTime:je};function Be({sessionId:t,started:n,lastActivity:i,isSampled:r=!0}={}){var o,s;const a=S(),u=null===(s=null===(o=e.faro.config)||void 0===o?void 0:o.sessionTracking)||void 0===s?void 0:s.generateSessionId;return null==t&&(t="function"==typeof u?u():P()),{sessionId:t,lastActivity:null!=i?i:a,started:null!=n?n:a,isSampled:r}}function Ue(e){if(null==e)return!1;const t=S();if(!(t-e.started<Me))return!1;return t-e.lastActivity<De}function Fe({fetchUserSession:t,storeUserSession:n}){return function({forceSessionExtend:i}={forceSessionExtend:!1}){var r,o,s;if(!t||!n)return;const a=e.faro.config.sessionTracking,u=null==a?void 0:a.persistent;if(u&&!Le||!u&&!Oe)return;const l=t();if(!1===i&&Ue(l))n(Object.assign(Object.assign({},l),{lastActivity:S()}));else{let t=ze(Be({isSampled:Ne()}),l);n(t),null===(r=e.faro.api)||void 0===r||r.setSession(t.sessionMeta),null===(o=null==a?void 0:a.onSessionChange)||void 0===o||o.call(a,null!==(s=null==l?void 0:l.sessionMeta)&&void 0!==s?s:null,t.sessionMeta)}}}function ze(t,n){var i,r,o,s;return Object.assign(Object.assign({},t),{sessionMeta:{id:t.sessionId,attributes:Object.assign(Object.assign(Object.assign(Object.assign({},null===(r=null===(i=e.faro.config.sessionTracking)||void 0===i?void 0:i.session)||void 0===r?void 0:r.attributes),null!==(s=null===(o=e.faro.metas.value.session)||void 0===o?void 0:o.attributes)&&void 0!==s?s:{}),null!=n?{previousSession:n.sessionId}:{}),{isSampled:t.isSampled.toString()})}})}class Ve{constructor(){this.updateSession=Pe((()=>this.updateUserSession()),1e3),this.updateUserSession=Fe({fetchUserSession:Ve.fetchUserSession,storeUserSession:Ve.storeUserSession}),this.init()}static removeUserSession(){xe(Ae,Ve.storageTypeLocal)}static storeUserSession(e){ke(Ae,_e(e),Ve.storageTypeLocal)}static fetchUserSession(){const e=Ie(Ae,Ve.storageTypeLocal);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener((function(t){const n=t.session,i=Ve.fetchUserSession();if(n&&n.id!==(null==i?void 0:i.sessionId)){const t=ze(Be({sessionId:n.id,isSampled:Ne()}),i);Ve.storeUserSession(t),e.faro.api.setSession(t.sessionMeta)}}))}}Ve.storageTypeLocal=Te.local;class $e{constructor(){this.updateSession=Pe((()=>this.updateUserSession()),1e3),this.updateUserSession=Fe({fetchUserSession:$e.fetchUserSession,storeUserSession:$e.storeUserSession}),this.init()}static removeUserSession(){xe(Ae,$e.storageTypeSession)}static storeUserSession(e){ke(Ae,_e(e),$e.storageTypeSession)}static fetchUserSession(){const e=Ie(Ae,$e.storageTypeSession);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener((function(t){const n=t.session,i=$e.fetchUserSession();if(n&&n.id!==(null==i?void 0:i.sessionId)){const t=ze(Be({sessionId:n.id,isSampled:Ne()}),i);$e.storeUserSession(t),e.faro.api.setSession(t.sessionMeta)}}))}}function qe(e){return(null==e?void 0:e.persistent)?Ve:$e}$e.storageTypeSession=Te.session;class Ge extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=ne}sendSessionStartEvent(e){var t,n;const i=e.session;if(i&&i.id!==(null===(t=this.notifiedSession)||void 0===t?void 0:t.id)){if(this.notifiedSession&&this.notifiedSession.id===(null===(n=i.attributes)||void 0===n?void 0:n.previousSession))return this.api.pushEvent(pe,{},void 0,{skipDedupe:!0}),void(this.notifiedSession=i);this.notifiedSession=i,this.api.pushEvent(de,{},void 0,{skipDedupe:!0})}}createInitialSession(e,t){var n,i,r,o,s;let a,u,l=e.fetchUserSession();if(t.persistent&&t.maxSessionPersistenceTime&&l){const e=S();l.lastActivity<e-t.maxSessionPersistenceTime&&(Ve.removeUserSession(),l=null)}if(Ue(l)){const e=null==l?void 0:l.sessionId;u=Be({sessionId:e,isSampled:l.isSampled||!1,started:null==l?void 0:l.started}),u.sessionMeta={id:e,attributes:Object.assign(Object.assign(Object.assign({},null===(n=t.session)||void 0===n?void 0:n.attributes),null===(i=null==l?void 0:l.sessionMeta)||void 0===i?void 0:i.attributes),{isSampled:u.isSampled.toString()})},a=fe}else{const e=null!==(o=null===(r=t.session)||void 0===r?void 0:r.id)&&void 0!==o?o:Se().id;u=Be({sessionId:e,isSampled:Ne()}),u.sessionMeta={id:e,attributes:Object.assign({isSampled:u.isSampled.toString()},null===(s=t.session)||void 0===s?void 0:s.attributes)},a=de}return{initialSession:u,lifecycleType:a}}registerBeforeSendHook(e){var t;const{updateSession:n}=new e;null===(t=this.transports)||void 0===t||t.addBeforeSendHooks((e=>{var t,i,r;n();const o=null===(t=e.meta.session)||void 0===t?void 0:t.attributes;if(o&&"true"===(null==o?void 0:o.isSampled)){let t=JSON.parse(JSON.stringify(e));const n=null===(i=t.meta.session)||void 0===i?void 0:i.attributes;return null==n||delete n.isSampled,0===Object.keys(null!=n?n:{}).length&&(null===(r=t.meta.session)||void 0===r||delete r.attributes),t}return null}))}initialize(){this.logDebug("init session instrumentation");const e=this.config.sessionTracking;if(null==e?void 0:e.enabled){const t=qe(e);this.registerBeforeSendHook(t);const{initialSession:n,lifecycleType:i}=this.createInitialSession(t,e);t.storeUserSession(n);const r=n.sessionMeta;this.notifiedSession=r,this.api.setSession(r),i===de&&this.api.pushEvent(de,{},void 0,{skipDedupe:!0}),i===fe&&this.api.pushEvent(fe,{},void 0,{skipDedupe:!0})}this.metas.addListener(this.sendSessionStartEvent.bind(this))}}class We extends te{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=ne}initialize(){this.logDebug("Initializing\n",this.options),this.options=Object.assign(Object.assign({},this.options),this.config.consoleInstrumentation),x.filter((e=>{var t,n;return!(null!==(n=null===(t=this.options)||void 0===t?void 0:t.disabledLevels)&&void 0!==n?n:We.defaultDisabledLevels).includes(e)})).forEach((t=>{console[t]=(...n)=>{var i;try{t!==e.LogLevel.ERROR||(null===(i=this.options)||void 0===i?void 0:i.consoleErrorAsLog)?this.api.pushLog([He(n)],{level:t}):this.api.pushError(new Error("console.error: "+He(n)))}catch(e){this.logError(e)}finally{this.unpatchedConsole[t](...n)}}}))}}function He(e){return e.map((e=>a(e)||l(e)?_e(e):e)).join(" ")}We.defaultDisabledLevels=[e.LogLevel.DEBUG,e.LogLevel.TRACE,e.LogLevel.LOG];const Ke="DOMError",Xe="DOMException",Je="Non-Error exception captured with keys:",Ze=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Ye="\n",Qe="eval",et="?",tt="@",nt=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,it=/\((\S*)(?::(\d+))(?::(\d+))\)/,rt="eval",ot="address at ",st=ot.length,at=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ut=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,lt=" > eval",ct="safari-extension",dt="safari-web-extension",ft=/Minified React error #\d+;/i;function pt(e,t,n,i){const r={filename:e||document.location.href,function:t||et};return void 0!==n&&(r.lineno=n),void 0!==i&&(r.colno=i),r}function mt(e,t){const n=null==e?void 0:e.includes(ct),i=!n&&(null==e?void 0:e.includes(dt));return n||i?[(null==e?void 0:e.includes(tt))?e.split(tt)[0]:e,n?`${ct}:${t}`:`${dt}:${t}`]:[e,t]}function gt(e){let t=[];e.stacktrace?t=e.stacktrace.split(Ye).filter(((e,t)=>t%2==0)):e.stack&&(t=e.stack.split(Ye));const n=t.reduce(((t,n,i)=>{let r,o,a,u,l;if(r=nt.exec(n)){if(o=r[1],a=r[2],u=r[3],l=r[4],null==a?void 0:a.startsWith(rt)){const e=it.exec(a);e&&(a=e[1],u=e[2],l=e[3])}a=(null==a?void 0:a.startsWith(ot))?a.substring(st):a,[o,a]=mt(o,a)}else if(r=at.exec(n)){if(o=r[1],a=r[3],u=r[4],l=r[5],a&&a.includes(lt)){const e=ut.exec(a);e&&(o=o||Qe,a=e[1],u=e[2])}else 0===i&&!l&&s(e.columnNumber)&&(l=String(e.columnNumber+1));[o,a]=mt(o,a)}return(a||o)&&t.push(pt(a,o,u?Number(u):void 0,l?Number(l):void 0)),t}),[]);return ft.test(e.message)?n.slice(1):n}function vt(e){return{frames:gt(e)}}function ht(e){let t,n,i,r,o=[];if(g(e)&&e.error)t=e.error.message,n=e.error.name,o=gt(e.error);else if((i=v(e))||h(e)){const{name:r,message:o}=e;n=null!=r?r:i?Ke:Xe,t=o?`${n}: ${o}`:n}else m(e)?(t=e.message,o=gt(e)):(a(e)||(r=f(e)))&&(n=r?e.constructor.name:void 0,t=`${Je} ${Object.keys(e)}`);return[t,n,o]}function bt(e){const t=window.onerror;window.onerror=(...n)=>{try{const[t,i,r,s,a]=n;let u,l,c=[];const d=o(t),f=pt(i,"?",r,s);a||!d?([u,l,c]=ht(null!=a?a:t),0===c.length&&(c=[f])):d&&([u,l]=function(e){var t,n;const i=e.match(Ze),r=null!==(t=null==i?void 0:i[1])&&void 0!==t?t:J;return[null!==(n=null==i?void 0:i[2])&&void 0!==n?n:e,r]}(t),c=[f]),u&&e.pushError(new Error(u),{type:l,stackFrames:c})}finally{null==t||t.apply(window,n)}}}class wt extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=ne}initialize(){var e;this.logDebug("Initializing"),bt(this.api),e=this.api,window.addEventListener("unhandledrejection",(t=>{var n,i;let r,o,s=t;s.reason?s=t.reason:(null===(n=t.detail)||void 0===n?void 0:n.reason)&&(s=null===(i=t.detail)||void 0===i?void 0:i.reason);let a=[];c(s)?(r=`Non-Error promise rejection captured with value: ${String(s)}`,o="UnhandledRejection"):[r,o,a]=ht(s),r&&e.pushError(new Error(r),{type:o,stackFrames:a})}))}}class yt extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=ne}sendViewChangedEvent(e){var t,n,i,r;const o=e.view;o&&o.name!==(null===(t=this.notifiedView)||void 0===t?void 0:t.name)&&(this.api.pushEvent(ce,{fromView:null!==(i=null===(n=this.notifiedView)||void 0===n?void 0:n.name)&&void 0!==i?i:me,toView:null!==(r=o.name)&&void 0!==r?r:me},void 0,{skipDedupe:!0}),this.notifiedView=o)}initialize(){this.metas.addListener(this.sendViewChangedEvent.bind(this))}}var St,Tt,Et,It,kt,xt=-1,Lt=function(e){addEventListener("pageshow",(function(t){t.persisted&&(xt=t.timeStamp,e(t))}),!0)},Ot=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Ct=function(){var e=Ot();return e&&e.activationStart||0},Pt=function(e,t){var n=Ot(),i="navigate";return xt>=0?i="back-forward-cache":n&&(document.prerendering||Ct()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},_t=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},Nt=function(e,t,n,i){var r,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},At=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Mt=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Dt=function(e){var t=!1;return function(){t||(e(),t=!0)}},jt=-1,Rt=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Bt=function(e){"hidden"===document.visibilityState&&jt>-1&&(jt="visibilitychange"===e.type?e.timeStamp:0,Ft())},Ut=function(){addEventListener("visibilitychange",Bt,!0),addEventListener("prerenderingchange",Bt,!0)},Ft=function(){removeEventListener("visibilitychange",Bt,!0),removeEventListener("prerenderingchange",Bt,!0)},zt=function(){return jt<0&&(jt=Rt(),Ut(),Lt((function(){setTimeout((function(){jt=Rt(),Ut()}),0)}))),{get firstHiddenTime(){return jt}}},Vt=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},$t=[1800,3e3],qt=function(e,t){t=t||{},Vt((function(){var n,i=zt(),r=Pt("FCP"),o=_t("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Ct(),0),r.entries.push(e),n(!0)))}))}));o&&(n=Nt(e,r,$t,t.reportAllChanges),Lt((function(i){r=Pt("FCP"),n=Nt(e,r,$t,t.reportAllChanges),At((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},Gt=[.1,.25],Wt=0,Ht=1/0,Kt=0,Xt=function(e){e.forEach((function(e){e.interactionId&&(Ht=Math.min(Ht,e.interactionId),Kt=Math.max(Kt,e.interactionId),Wt=Kt?(Kt-Ht)/7+1:0)}))},Jt=[],Zt=new Map,Yt=0,Qt=[],en=function(e){if(Qt.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Jt[Jt.length-1],n=Zt.get(e.interactionId);if(n||Jt.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Zt.set(i.id,i),Jt.push(i)}Jt.sort((function(e,t){return t.latency-e.latency})),Jt.length>10&&Jt.splice(10).forEach((function(e){return Zt.delete(e.id)}))}}},tn=[200,500],nn=[2500,4e3],rn={},on=[800,1800],sn=function e(t){document.prerendering?Vt((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},an={passive:!0,capture:!0},un=new Date,ln=function(e,t){Tt||(Tt=t,Et=e,It=new Date,fn(removeEventListener),cn())},cn=function(){if(Et>=0&&Et<It-un){var e={entryType:"first-input",name:Tt.type,target:Tt.target,cancelable:Tt.cancelable,startTime:Tt.timeStamp,processingStart:Tt.timeStamp+Et};kt.forEach((function(t){t(e)})),kt=[]}},dn=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){ln(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,an),removeEventListener("pointercancel",i,an)};addEventListener("pointerup",n,an),addEventListener("pointercancel",i,an)}(t,e):ln(t,e)}},fn=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,dn,an)}))},pn=[100,300];class mn{constructor(e){this.pushMeasurement=e}initialize(){Object.entries(mn.mapping).forEach((([e,t])=>{t((t=>{this.pushMeasurement({type:"web-vitals",values:{[e]:t.value}})}))}))}}mn.mapping={cls:function(e,t){t=t||{},qt(Dt((function(){var n,i=Pt("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,n())},a=_t("layout-shift",s);a&&(n=Nt(e,i,Gt,t.reportAllChanges),Mt((function(){s(a.takeRecords()),n(!0)})),Lt((function(){r=0,i=Pt("CLS",0),n=Nt(e,i,Gt,t.reportAllChanges),At((function(){return n()}))})),setTimeout(n,0))})))},fcp:qt,fid:function(e,t){t=t||{},Vt((function(){var n,i=zt(),r=Pt("FID"),o=function(e){e.startTime<i.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),n(!0))},s=function(e){e.forEach(o)},a=_t("first-input",s);n=Nt(e,r,pn,t.reportAllChanges),a&&(Mt(Dt((function(){s(a.takeRecords()),a.disconnect()}))),Lt((function(){var i;r=Pt("FID"),n=Nt(e,r,pn,t.reportAllChanges),kt=[],Et=-1,Tt=null,fn(addEventListener),i=o,kt.push(i),cn()})))}))},inp:function(e,t){t=t||{},Vt((function(){var n;"interactionCount"in performance||St||(St=_t("event",Xt,{type:"event",buffered:!0,durationThreshold:0}));var i,r=Pt("INP"),o=function(e){e.forEach(en);var t,n=(t=Math.min(Jt.length-1,Math.floor(((St?Wt:performance.interactionCount||0)-Yt)/50)),Jt[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())},s=_t("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=Nt(e,r,tn,t.reportAllChanges),s&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),Mt((function(){o(s.takeRecords()),i(!0)})),Lt((function(){Yt=0,Jt.length=0,Zt.clear(),r=Pt("INP"),i=Nt(e,r,tn,t.reportAllChanges)})))}))},lcp:function(e,t){t=t||{},Vt((function(){var n,i=zt(),r=Pt("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Ct(),0),r.entries=[e],n())}))},s=_t("largest-contentful-paint",o);if(s){n=Nt(e,r,nn,t.reportAllChanges);var a=Dt((function(){rn[r.id]||(o(s.takeRecords()),s.disconnect(),rn[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return e=a,t=self.requestIdleCallback||self.setTimeout,n=-1,e=Dt(e),"hidden"===document.visibilityState?e():(n=t(e),Mt(e)),n;var e,t,n}),!0)})),Mt(a),Lt((function(i){r=Pt("LCP"),n=Nt(e,r,nn,t.reportAllChanges),At((function(){r.value=performance.now()-i.timeStamp,rn[r.id]=!0,n(!0)}))}))}}))},ttfb:function(e,t){t=t||{};var n=Pt("TTFB"),i=Nt(e,n,on,t.reportAllChanges);sn((function(){var r=Ot();r&&(n.value=Math.max(r.responseStart-Ct(),0),n.entries=[r],i(!0),Lt((function(){n=Pt("TTFB",0),(i=Nt(e,n,on,t.reportAllChanges))(!0)})))}))}};var gn,vn,hn=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},bn=function(e){if("loading"===document.readyState)return"loading";var t=hn();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},wn=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},yn=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var i=e,r=i.id?"#"+i.id:wn(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+r.length>(t||100)-1)return n||r;if(n=n?r+">"+n:r,i.id)break;e=i.parentNode}}catch(e){}return n},Sn=-1,Tn=function(){return Sn},En=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Sn=t.timeStamp,e(t))}),!0)},In=function(){var e=hn();return e&&e.activationStart||0},kn=function(e,t){var n=hn(),i="navigate";return Tn()>=0?i="back-forward-cache":n&&(document.prerendering||In()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},xn=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},Ln=function(e,t,n,i){var r,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},On=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Cn=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Pn=function(e){var t=!1;return function(){t||(e(),t=!0)}},_n=-1,Nn=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},An=function(e){"hidden"===document.visibilityState&&_n>-1&&(_n="visibilitychange"===e.type?e.timeStamp:0,Dn())},Mn=function(){addEventListener("visibilitychange",An,!0),addEventListener("prerenderingchange",An,!0)},Dn=function(){removeEventListener("visibilitychange",An,!0),removeEventListener("prerenderingchange",An,!0)},jn=function(){return _n<0&&(_n=Nn(),Mn(),En((function(){setTimeout((function(){_n=Nn(),Mn()}),0)}))),{get firstHiddenTime(){return _n}}},Rn=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Bn=[1800,3e3],Un=function(e,t){t=t||{},Rn((function(){var n,i=jn(),r=kn("FCP"),o=xn("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-In(),0),r.entries.push(e),n(!0)))}))}));o&&(n=Ln(e,r,Bn,t.reportAllChanges),En((function(i){r=kn("FCP"),n=Ln(e,r,Bn,t.reportAllChanges),On((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},Fn=[.1,.25],zn=0,Vn=1/0,$n=0,qn=function(e){e.forEach((function(e){e.interactionId&&(Vn=Math.min(Vn,e.interactionId),$n=Math.max($n,e.interactionId),zn=$n?($n-Vn)/7+1:0)}))},Gn=function(){"interactionCount"in performance||gn||(gn=xn("event",qn,{type:"event",buffered:!0,durationThreshold:0}))},Wn=[],Hn=new Map,Kn=0,Xn=function(){return(gn?zn:performance.interactionCount||0)-Kn},Jn=[],Zn=function(e){if(Jn.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Wn[Wn.length-1],n=Hn.get(e.interactionId);if(n||Wn.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Hn.set(i.id,i),Wn.push(i)}Wn.sort((function(e,t){return t.latency-e.latency})),Wn.length>10&&Wn.splice(10).forEach((function(e){return Hn.delete(e.id)}))}}},Yn=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Pn(e),"hidden"===document.visibilityState?e():(n=t(e),Cn(e)),n},Qn=[200,500],ei=[],ti=new Map,ni=[],ii=new WeakMap,ri=new Map,oi=-1,si=function(e){e.forEach((function(e){return ei.push(e)}))},ai=function(){ri.size>10&&ri.forEach((function(e,t){Hn.has(t)||ri.delete(t)})),ni=ni.slice(-50);var e=new Set(ni.concat(Wn.map((function(e){return ii.get(e.entries[0])}))));ti.forEach((function(t,n){e.has(n)||ti.delete(n)}));var t=new Set;ti.forEach((function(e){fi(e.startTime,e.processingEnd).forEach((function(e){t.add(e)}))})),ei=Array.from(t),oi=-1};Jn.push((function(e){e.interactionId&&e.target&&!ri.has(e.interactionId)&&ri.set(e.interactionId,e.target)}),(function(e){for(var t,n=e.startTime+e.duration,i=ni.length-1;i>=0;i--)if(t=ni[i],Math.abs(n-t)<=8){var r=ti.get(t);r.startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),r.entries.push(e),n=t;break}n!==t&&(ni.push(n),ti.set(n,{startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,entries:[e]})),(e.interactionId||"first-input"===e.entryType)&&ii.set(e,n)}),(function(){oi<0&&(oi=Yn(ai))}));var ui,li,ci,di,fi=function(e,t){for(var n,i=[],r=0;n=ei[r];r++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;i.push(n)}return i},pi=function(e,t){vn||(vn=xn("long-animation-frame",si)),function(e,t){t=t||{},Rn((function(){var n;Gn();var i,r=kn("INP"),o=function(e){e.forEach(Zn);var t,n=(t=Math.min(Wn.length-1,Math.floor(Xn()/50)),Wn[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())},s=xn("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=Ln(e,r,Qn,t.reportAllChanges),s&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),Cn((function(){o(s.takeRecords()),i(!0)})),En((function(){Kn=0,Wn.length=0,Hn.clear(),r=kn("INP"),i=Ln(e,r,Qn,t.reportAllChanges)})))}))}((function(t){Yn((function(){var n=function(e){var t=e.entries[0],n=ii.get(t),i=ti.get(n),r=t.processingStart,o=i.processingEnd,s=i.entries.sort((function(e,t){return e.processingStart-t.processingStart})),a=fi(t.startTime,o),u=e.entries.find((function(e){return e.target})),l=u&&u.target||ri.get(t.interactionId),c=[t.startTime+t.duration,o].concat(a.map((function(e){return e.startTime+e.duration}))),d=Math.max.apply(Math,c),f={interactionTarget:yn(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:d,processedEventEntries:s,longAnimationFrameEntries:a,inputDelay:r-t.startTime,processingDuration:o-r,presentationDelay:Math.max(d-o,0),loadState:bn(t.startTime)};return Object.assign(e,{attribution:f})}(t);e(n)}))}),t)},mi=[2500,4e3],gi={},vi=[800,1800],hi=function e(t){document.prerendering?Rn((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},bi=function(e,t){t=t||{};var n=kn("TTFB"),i=Ln(e,n,vi,t.reportAllChanges);hi((function(){var r=hn();r&&(n.value=Math.max(r.responseStart-In(),0),n.entries=[r],i(!0),En((function(){n=kn("TTFB",0),(i=Ln(e,n,vi,t.reportAllChanges))(!0)})))}))},wi={passive:!0,capture:!0},yi=new Date,Si=function(e,t){ui||(ui=t,li=e,ci=new Date,Ii(removeEventListener),Ti())},Ti=function(){if(li>=0&&li<ci-yi){var e={entryType:"first-input",name:ui.type,target:ui.target,cancelable:ui.cancelable,startTime:ui.timeStamp,processingStart:ui.timeStamp+li};di.forEach((function(t){t(e)})),di=[]}},Ei=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){Si(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,wi),removeEventListener("pointercancel",i,wi)};addEventListener("pointerup",n,wi),addEventListener("pointercancel",i,wi)}(t,e):Si(t,e)}},Ii=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,Ei,wi)}))},ki=[100,300],xi=function(e,t){!function(e,t){t=t||{},Rn((function(){var n,i=jn(),r=kn("FID"),o=function(e){e.startTime<i.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),n(!0))},s=function(e){e.forEach(o)},a=xn("first-input",s);n=Ln(e,r,ki,t.reportAllChanges),a&&(Cn(Pn((function(){s(a.takeRecords()),a.disconnect()}))),En((function(){var i;r=kn("FID"),n=Ln(e,r,ki,t.reportAllChanges),di=[],li=-1,ui=null,Ii(addEventListener),i=o,di.push(i),Ti()})))}))}((function(t){var n=function(e){var t=e.entries[0],n={eventTarget:yn(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:bn(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)}),t)};const Li="com.grafana.faro.lastNavigationId",Oi="load_state",Ci="time_to_first_byte";class Pi{constructor(e){this.corePushMeasurement=e}initialize(){this.measureCLS(),this.measureFCP(),this.measureFID(),this.measureINP(),this.measureLCP(),this.measureTTFB()}measureCLS(){!function(e,t){!function(e,t){t=t||{},Un(Pn((function(){var n,i=kn("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,n())},a=xn("layout-shift",s);a&&(n=Ln(e,i,Fn,t.reportAllChanges),Cn((function(){s(a.takeRecords()),n(!0)})),En((function(){r=0,i=kn("CLS",0),n=Ln(e,i,Fn,t.reportAllChanges),On((function(){return n()}))})),setTimeout(n,0))})))}((function(t){var n=function(e){var t,n={};if(e.entries.length){var i=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(i&&i.sources&&i.sources.length){var r=(t=i.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];r&&(n={largestShiftTarget:yn(r.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:r,largestShiftEntry:i,loadState:bn(i.startTime)})}}return Object.assign(e,{attribution:n})}(t);e(n)}),t)}((e=>{const{loadState:t,largestShiftValue:n,largestShiftTime:i,largestShiftTarget:r}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"largest_shift_value",n),this.addIfPresent(o,"largest_shift_time",i);const s=this.buildInitialContext(e);this.addIfPresent(s,Oi,t),this.addIfPresent(s,"largest_shift_target",r),this.pushMeasurement(o,s)}))}measureFCP(){!function(e,t){Un((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:bn(Tn())};if(e.entries.length){var n=hn(),i=e.entries[e.entries.length-1];if(n){var r=n.activationStart||0,o=Math.max(0,n.responseStart-r);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:bn(e.entries[0].startTime),navigationEntry:n,fcpEntry:i}}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{firstByteToFCP:t,timeToFirstByte:n,loadState:i}=e.attribution,r=this.buildInitialValues(e);this.addIfPresent(r,"first_byte_to_fcp",t),this.addIfPresent(r,Ci,n);const o=this.buildInitialContext(e);this.addIfPresent(o,Oi,i),this.pushMeasurement(r,o)}))}measureFID(){xi((e=>{const{eventTime:t,eventTarget:n,eventType:i,loadState:r}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"event_time",t);const s=this.buildInitialContext(e);this.addIfPresent(s,"event_target",n),this.addIfPresent(s,"event_type",i),this.addIfPresent(s,Oi,r),this.pushMeasurement(o,s)}))}measureINP(){pi((e=>{const{interactionTime:t,presentationDelay:n,inputDelay:i,processingDuration:r,nextPaintTime:o,loadState:s,interactionTarget:a,interactionType:u}=e.attribution,l=this.buildInitialValues(e);this.addIfPresent(l,"interaction_time",t),this.addIfPresent(l,"presentation_delay",n),this.addIfPresent(l,"input_delay",i),this.addIfPresent(l,"processing_duration",r),this.addIfPresent(l,"next_paint_time",o);const c=this.buildInitialContext(e);this.addIfPresent(c,Oi,s),this.addIfPresent(c,"interaction_target",a),this.addIfPresent(c,"interaction_type",u),this.pushMeasurement(l,c)}))}measureLCP(){!function(e,t){!function(e,t){t=t||{},Rn((function(){var n,i=jn(),r=kn("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-In(),0),r.entries=[e],n())}))},s=xn("largest-contentful-paint",o);if(s){n=Ln(e,r,mi,t.reportAllChanges);var a=Pn((function(){gi[r.id]||(o(s.takeRecords()),s.disconnect(),gi[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Yn(a)}),!0)})),Cn(a),En((function(i){r=kn("LCP"),n=Ln(e,r,mi,t.reportAllChanges),On((function(){r.value=performance.now()-i.timeStamp,gi[r.id]=!0,n(!0)}))}))}}))}((function(t){var n=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n=hn();if(n){var i=n.activationStart||0,r=e.entries[e.entries.length-1],o=r.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===r.url}))[0],s=Math.max(0,n.responseStart-i),a=Math.max(s,o?(o.requestStart||o.startTime)-i:0),u=Math.max(a,o?o.responseEnd-i:0),l=Math.max(u,r.startTime-i);t={element:yn(r.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:u-a,elementRenderDelay:l-u,navigationEntry:n,lcpEntry:r},r.url&&(t.url=r.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{elementRenderDelay:t,resourceLoadDelay:n,resourceLoadDuration:i,timeToFirstByte:r,element:o}=e.attribution,s=this.buildInitialValues(e);this.addIfPresent(s,"element_render_delay",t),this.addIfPresent(s,"resource_load_delay",n),this.addIfPresent(s,"resource_load_duration",i),this.addIfPresent(s,Ci,r);const a=this.buildInitialContext(e);this.addIfPresent(a,"element",o),this.pushMeasurement(s,a)}))}measureTTFB(){!function(e,t){bi((function(t){var n=function(e){var t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){var n=e.entries[0],i=n.activationStart||0,r=Math.max((n.workerStart||n.fetchStart)-i,0),o=Math.max(n.domainLookupStart-i,0),s=Math.max(n.connectStart-i,0),a=Math.max(n.connectEnd-i,0);t={waitingDuration:r,cacheDuration:o-r,dnsDuration:s-o,connectionDuration:a-s,requestDuration:e.value-a,navigationEntry:n}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{dnsDuration:t,connectionDuration:n,requestDuration:i,waitingDuration:r,cacheDuration:o}=e.attribution,s=this.buildInitialValues(e);this.addIfPresent(s,"dns_duration",t),this.addIfPresent(s,"connection_duration",n),this.addIfPresent(s,"request_duration",i),this.addIfPresent(s,"waiting_duration",r),this.addIfPresent(s,"cache_duration",o);const a=this.buildInitialContext(e);this.pushMeasurement(s,a)}))}buildInitialValues(e){const t=e.name.toLowerCase();return{[t]:e.value,delta:e.delta}}buildInitialContext(e){var t;const n=null!==(t=Ie(Li,Te.session))&&void 0!==t?t:me;return{id:e.id,rating:e.rating,navigation_type:e.navigationType,navigation_entry_id:n}}pushMeasurement(e,t){this.corePushMeasurement({type:"web-vitals",values:e},{context:t})}addIfPresent(e,t,n){n&&(e[t]=n)}}class _i extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=ne}initialize(){this.logDebug("Initializing");this.intializeWebVitalsInstrumentation().initialize()}intializeWebVitalsInstrumentation(){return this.config.trackWebVitalsAttribution?new Pi(this.api.pushMeasurement):new mn(this.api.pushMeasurement)}}function Ni(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const Ai=/^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/;function Mi(e=[]){for(const t of e)if("traceparent"===t.name){if(!Ai.test(t.description))continue;const[,e,n]=t.description.split("-");if(null!=e&&null!=n)return{traceId:e,spanId:n};break}}function Di(e=[],t){return e.some((e=>e&&null!=t.match(e)))}function ji(e,t={}){for(const[n,i]of Object.entries(t)){const t=e[n];return null!=t&&(l(i)?i.includes(t):t===i)}return!0}function Ri(e){const{connectEnd:t,connectStart:n,decodedBodySize:i,domainLookupEnd:r,domainLookupStart:o,duration:s,encodedBodySize:a,fetchStart:u,initiatorType:l,name:c,nextHopProtocol:d,redirectEnd:f,redirectStart:p,renderBlockingStatus:m,requestStart:g,responseEnd:v,responseStart:h,responseStatus:b,secureConnectionStart:w,transferSize:y,workerStart:S}=e;return{name:c,duration:Ui(s),tcpHandshakeTime:Ui(t-n),dnsLookupTime:Ui(r-o),tlsNegotiationTime:Ui(g-w),responseStatus:Ui(b),redirectTime:Ui(f-p),requestTime:Ui(h-g),responseTime:Ui(v-h),fetchTime:Ui(v-u),serviceWorkerTime:Ui(u-S),decodedBodySize:Ui(i),encodedBodySize:Ui(a),cacheHitStatus:function(){let e="fullLoad";0===y?i>0&&(e="cache"):null!=b?304===b&&(e="conditionalFetch"):a>0&&y<a&&(e="conditionalFetch");return e}(),renderBlockingStatus:Ui(m),protocol:d,initiatorType:l,visibilityState:document.visibilityState,ttfb:Ui(h-g)}}function Bi(e){const{activationStart:t,domComplete:n,domContentLoadedEventEnd:i,domContentLoadedEventStart:r,domInteractive:o,fetchStart:s,loadEventEnd:a,loadEventStart:u,responseStart:l,type:c}=e,d=function(){var e;if(null!=(null===(e=performance.timing)||void 0===e?void 0:e.domLoading))return performance.timing.domLoading-performance.timeOrigin;return null}();return Object.assign(Object.assign({},Ri(e)),{pageLoadTime:Ui(n-s),documentParsingTime:Ui(d?o-d:null),domProcessingTime:Ui(n-o),domContentLoadHandlerTime:Ui(i-r),onLoadTime:Ui(a-u),ttfb:Ui(Math.max(l-(null!=t?t:0),0)),type:c})}function Ui(e){return null==e?me:"number"==typeof e?Math.round(e).toString():e.toString()}const Fi={initiatorType:["xmlhttprequest","fetch"]};class zi extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-performance",this.version=ne}initialize(){"PerformanceObserver"in window?function(e){if("complete"===document.readyState)e();else{const t=()=>{"complete"===document.readyState&&(e(),document.removeEventListener("readystatechange",t))};document.addEventListener("readystatechange",t)}}((()=>Ni(this,void 0,void 0,(function*(){const t=this.api.pushEvent,n=this.getIgnoreUrls(),{faroNavigationId:i}=yield function(e,t){let n;const i=new Promise((e=>{n=e}));return new PerformanceObserver((i=>{var r;const[o]=i.getEntries();if(null==o||Di(t,o.name))return;const s=o.toJSON();let a=Mi(null==s?void 0:s.serverTiming);const u=null!==(r=Ie(Li,Te.session))&&void 0!==r?r:me,l=Object.assign(Object.assign({},Bi(s)),{faroNavigationId:P(),faroPreviousNavigationId:u});ke(Li,l.faroNavigationId,Te.session),e("faro.performance.navigation",l,void 0,{spanContext:a,timestampOverwriteMs:performance.timeOrigin+s.startTime}),n(l)})).observe({type:"navigation",buffered:!0}),i}(t,n);null!=i&&function(t,n,i){const r=e.faro.config.trackResources;new PerformanceObserver((e=>{const o=e.getEntries();for(const e of o){if(Di(i,e.name))return;const o=e.toJSON();let s=Mi(null==o?void 0:o.serverTiming);if(null==r&&ji(o,Fi)||r){const e=Object.assign(Object.assign({},Ri(o)),{faroNavigationId:t,faroResourceId:P()});n("faro.performance.resource",e,void 0,{spanContext:s,timestampOverwriteMs:performance.timeOrigin+o.startTime})}}})).observe({type:"resource",buffered:!0})}(i,t,n)})))):this.logDebug("performance observer not supported. Disable performance instrumentation.")}getIgnoreUrls(){var e;return null===(e=this.transports.transports)||void 0===e?void 0:e.flatMap((e=>e.getIgnoreUrls()))}}function Vi(e={}){const t=[new wt,new _i,new Ge,new yt];return!1!==e.enablePerformanceInstrumentation&&t.unshift(new zi),!1!==e.captureConsole&&t.push(new We({disabledLevels:e.captureConsoleDisabledLevels})),t}const $i="browser",qi=()=>{const e=window.k6;return{k6:Object.assign({isK6Browser:!0},(null==e?void 0:e.testRunId)&&{testRunId:null==e?void 0:e.testRunId})}};class Gi extends H{constructor(e){var t,n,i,r;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=ne,this.disabledUntil=new Date,this.rateLimitBackoffMs=null!==(t=e.defaultRateLimitBackoffMs)&&void 0!==t?t:5e3,this.getNow=null!==(n=e.getNow)&&void 0!==n?n:()=>Date.now(),this.promiseBuffer=O({size:null!==(i=e.bufferSize)&&void 0!==i?i:30,concurrency:null!==(r=e.concurrency)&&void 0!==r?r:5})}send(e){return Ni(this,void 0,void 0,(function*(){try{if(this.disabledUntil>new Date(this.getNow()))return this.logWarn(`Dropping transport item due to too many requests. Backoff until ${this.disabledUntil}`),Promise.resolve();yield this.promiseBuffer.add((()=>{const t=JSON.stringify(X(e)),{url:n,requestOptions:i,apiKey:r}=this.options,o=null!=i?i:{},{headers:s}=o,a=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(o,["headers"]);let u;const l=this.metas.value.session;return null!=l&&(u=l.id),fetch(n,Object.assign({method:"POST",headers:Object.assign(Object.assign(Object.assign({"Content-Type":"application/json"},null!=s?s:{}),r?{"x-api-key":r}:{}),u?{"x-faro-session-id":u}:{}),body:t,keepalive:t.length<=6e4},null!=a?a:{})).then((e=>Ni(this,void 0,void 0,(function*(){if(202===e.status){"invalid"===e.headers.get("X-Faro-Session-Status")&&this.extendFaroSession(this.config,this.logDebug)}return 429===e.status&&(this.disabledUntil=this.getRetryAfterDate(e),this.logWarn(`Too many requests, backing off until ${this.disabledUntil}`)),e.text().catch(L),e})))).catch((e=>{this.logError("Failed sending payload to the receiver\n",JSON.parse(t),e)}))}))}catch(e){this.logError(e)}}))}getIgnoreUrls(){var e;return[this.options.url].concat(null!==(e=this.config.ignoreUrls)&&void 0!==e?e:[])}isBatched(){return!0}getRetryAfterDate(e){const t=this.getNow(),n=e.headers.get("Retry-After");if(n){const e=Number(n);if(!isNaN(e))return new Date(1e3*e+t);const i=Date.parse(n);if(!isNaN(i))return new Date(i)}return new Date(t+this.rateLimitBackoffMs)}extendFaroSession(e,t){const n="Session expired",i=e.sessionTracking;if(null==i?void 0:i.enabled){const{fetchUserSession:e,storeUserSession:r}=qe(i);Fe({fetchUserSession:e,storeUserSession:r})({forceSessionExtend:!0}),t(`${n} created new session.`)}else t(`${n}.`)}}function Wi(e){var t,n,i,r,o,s,u,l,c,d;const f=[],p=$(e.unpatchedConsole,e.internalLoggerLevel);e.transports?((e.url||e.apiKey)&&p.error('if "transports" is defined, "url" and "apiKey" should not be defined'),f.push(...e.transports)):e.url?f.push(new Gi({url:e.url,apiKey:e.apiKey})):p.error('either "url" or "transports" must be defined');return{app:e.app,batching:Object.assign(Object.assign({},le),e.batching),dedupe:null===(t=e.dedupe)||void 0===t||t,globalObjectKey:e.globalObjectKey||ue,instrumentations:null!==(n=e.instrumentations)&&void 0!==n?n:Vi(),internalLoggerLevel:null!==(i=e.internalLoggerLevel)&&void 0!==i?i:U,isolate:null!==(r=e.isolate)&&void 0!==r&&r,logArgsSerializer:null!==(o=e.logArgsSerializer)&&void 0!==o?o:Q,metas:function(){const t=ye;return e.metas&&t.push(...e.metas),a(window.k6)?[...t,qi]:t}(),parseStacktrace:vt,paused:null!==(s=e.paused)&&void 0!==s&&s,preventGlobalExposure:null!==(u=e.preventGlobalExposure)&&void 0!==u&&u,transports:f,unpatchedConsole:null!==(l=e.unpatchedConsole)&&void 0!==l?l:F,beforeSend:e.beforeSend,eventDomain:null!==(c=e.eventDomain)&&void 0!==c?c:$i,ignoreErrors:e.ignoreErrors,ignoreUrls:(null!==(d=e.ignoreUrls)&&void 0!==d?d:[]).concat([/\/collect(?:\/[\w]*)?$/]),sessionTracking:Object.assign(Object.assign({},Re),e.sessionTracking),user:e.user,view:e.view,trackResources:e.trackResources,trackWebVitalsAttribution:e.trackWebVitalsAttribution,consoleInstrumentation:e.consoleInstrumentation}}return e.BaseExtension=W,e.BaseInstrumentation=te,e.BaseTransport=H,e.ConsoleInstrumentation=We,e.ConsoleTransport=class extends H{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-console",this.version=ne}send(t){var n;return this.unpatchedConsole[null!==(n=this.options.level)&&void 0!==n?n:e.LogLevel.DEBUG]("New event",X([t]))}},e.Conventions={EventNames:{CLICK:"click",NAVIGATION:"navigation",SESSION_START:"session_start",VIEW_CHANGED:"view_changed"}},e.EVENT_CLICK="click",e.EVENT_NAVIGATION="navigation",e.EVENT_ROUTE_CHANGE="route_change",e.EVENT_SESSION_EXTEND=pe,e.EVENT_SESSION_RESUME=fe,e.EVENT_SESSION_START=de,e.EVENT_VIEW_CHANGED=ce,e.ErrorsInstrumentation=wt,e.FetchTransport=Gi,e.MAX_SESSION_PERSISTENCE_TIME=je,e.MAX_SESSION_PERSISTENCE_TIME_BUFFER=6e4,e.PerformanceInstrumentation=zi,e.PersistentSessionsManager=Ve,e.SESSION_EXPIRATION_TIME=Me,e.SESSION_INACTIVITY_TIME=De,e.STORAGE_KEY=Ae,e.SessionInstrumentation=Ge,e.VERSION=ne,e.ViewInstrumentation=yt,e.VolatileSessionsManager=$e,e.WebVitalsInstrumentation=_i,e.allLogLevels=x,e.browserMeta=be,e.buildStackFrame=pt,e.createInternalLogger=$,e.createPromiseBuffer=O,e.createSession=Se,e.deepEqual=y,e.defaultEventDomain=$i,e.defaultExceptionType=J,e.defaultGlobalObjectKey=ue,e.defaultInternalLoggerLevel=U,e.defaultLogLevel=k,e.defaultMetas=ye,e.genShortID=P,e.getCurrentTimestamp=T,e.getDataFromSafariExtensions=mt,e.getIgnoreUrls=function(){return e.faro.transports.transports.flatMap((e=>e.getIgnoreUrls()))},e.getInternalFaroFromGlobalObject=function(){return _[ie]},e.getStackFramesFromError=gt,e.getTransportBody=X,e.getWebInstrumentations=Vi,e.globalObject=_,e.initializeFaro=function(e){const t=Wi(e);if(t)return ae(t)},e.internalGlobalObjectKey=ie,e.isArray=l,e.isBoolean=e=>t(e,"boolean"),e.isDomError=v,e.isDomException=h,e.isElement=e=>b&&i(e,Element),e.isElementDefined=b,e.isError=m,e.isErrorDefined=p,e.isErrorEvent=g,e.isEvent=f,e.isEventDefined=d,e.isFunction=u,e.isInstanceOf=i,e.isInt=e=>s(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=oe,e.isMap=e=>w&&i(e,Map),e.isMapDefined=w,e.isNull=r,e.isNumber=s,e.isObject=a,e.isPrimitive=c,e.isRegExp=e=>n(e,"RegExp"),e.isString=o,e.isSymbol=e=>t(e,"symbol"),e.isSyntheticEvent=e=>a(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>u(null==e?void 0:e.then),e.isToString=n,e.isTypeof=t,e.isUndefined=e=>t(e,"undefined"),e.makeCoreConfig=Wi,e.noop=L,e.pageMeta=we,e.parseStacktrace=vt,e.sdkMeta=()=>({sdk:{name:"@grafana/faro-core",version:ne,integrations:e.faro.config.instrumentations.map((({name:e,version:t})=>({name:e,version:t})))}}),e.setInternalFaroOnGlobalObject=re,e.transportItemTypeToBodyKey=M,e}({});
1
+ var GrafanaFaroWebSdk=function(e){"use strict";function t(e,t){return typeof e===t}function n(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function i(e,t){try{return e instanceof t}catch(e){return!1}}const r=e=>t(e,"null"),o=e=>t(e,"string"),s=e=>t(e,"number")&&!isNaN(e)||t(e,"bigint"),a=e=>!r(e)&&t(e,"object"),u=e=>t(e,"function"),l=e=>n(e,"Array"),c=e=>!a(e)&&!u(e),d="undefined"!=typeof Event,f=e=>d&&i(e,Event),p="undefined"!=typeof Error,m=e=>p&&i(e,Error),g=e=>n(e,"ErrorEvent"),v=e=>n(e,"DOMError"),h=e=>n(e,"DOMException"),b="undefined"!=typeof Element,w="undefined"!=typeof Map;function y(e,n){if(e===n)return!0;if(t(e,"number")&&isNaN(e))return t(n,"number")&&isNaN(n);const i=l(e),r=l(n);if(i!==r)return!1;if(i&&r){const t=e.length;if(t!==n.length)return!1;for(let i=t;0!=i--;)if(!y(e[i],n[i]))return!1;return!0}const o=a(e),s=a(n);if(o!==s)return!1;if(e&&n&&o&&s){const t=Object.keys(e),i=Object.keys(n);if(t.length!==i.length)return!1;for(let e of t)if(!i.includes(e))return!1;for(let i of t)if(!y(e[i],n[i]))return!1;return!0}return!1}function S(){return Date.now()}function T(){return(new Date).toISOString()}function E(e){return new Date(e).toISOString()}var I;e.LogLevel=void 0,(I=e.LogLevel||(e.LogLevel={})).TRACE="trace",I.DEBUG="debug",I.INFO="info",I.LOG="log",I.WARN="warn",I.ERROR="error";const k=e.LogLevel.LOG,x=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function L(){}function O(e){const{size:t,concurrency:n}=e,i=[];let r=0;const o=()=>{if(r<n&&i.length){const{producer:e,resolve:t,reject:n}=i.shift();r++,e().then((e=>{r--,o(),t(e)}),(e=>{r--,o(),n(e)}))}};return{add:e=>{if(i.length+r>=t)throw new Error("Task buffer full");return new Promise(((t,n)=>{i.push({producer:e,resolve:t,reject:n}),o()}))}}}const C="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function P(e=10){return Array.from(Array(e)).map((()=>C[Math.floor(Math.random()*C.length)])).join("")}const _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;class N{constructor(e,t){var n,i;this.signalBuffer=[],this.itemLimit=null!==(n=null==t?void 0:t.itemLimit)&&void 0!==n?n:50,this.sendTimeout=null!==(i=null==t?void 0:t.sendTimeout)&&void 0!==i?i:250,this.paused=(null==t?void 0:t.paused)||!1,this.sendFn=e,this.flushInterval=-1,this.paused||this.start(),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&this.flush()}))}addItem(e){this.paused||(this.signalBuffer.push(e),this.signalBuffer.length>=this.itemLimit&&this.flush())}start(){this.paused=!1,this.sendTimeout>0&&(this.flushInterval=window.setInterval((()=>this.flush()),this.sendTimeout))}pause(){this.paused=!0,clearInterval(this.flushInterval)}groupItems(e){const t=new Map;return e.forEach((e=>{const n=JSON.stringify(e.meta);let i=t.get(n);i=void 0===i?[e]:[...i,e],t.set(n,i)})),Array.from(t.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}var A;e.TransportItemType=void 0,(A=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",A.LOG="log",A.MEASUREMENT="measurement",A.TRACE="trace",A.EVENT="event";const M={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function D(t){return n=>{if(n.type===e.TransportItemType.EXCEPTION&&n.payload){const e=n.payload,i=`${e.type}: ${e.value}`;if(function(e,t){return e.some((e=>o(e)?t.includes(e):!!t.match(e)))}(t,i))return null}return n}}function j(e,t,n,i){var r;t.debug("Initializing transports");const o=[];let s=n.paused,a=[];const u=e=>{let t=e;for(const e of a){const n=t.map(e).filter(Boolean);if(0===n.length)return[];t=n}return t},l=e=>{const n=u(e);if(0!==n.length)for(const e of o)t.debug(`Transporting item using ${e.name}\n`,n),e.isBatched()&&e.send(n)};let c;(null===(r=n.batching)||void 0===r?void 0:r.enabled)&&(c=new N(l,{sendTimeout:n.batching.sendTimeout,itemLimit:n.batching.itemLimit,paused:s}));return{add:(...r)=>{t.debug("Adding transports"),r.forEach((r=>{t.debug(`Adding "${r.name}" transport`);o.some((e=>e===r))?t.warn(`Transport ${r.name} is already added`):(r.unpatchedConsole=e,r.internalLogger=t,r.config=n,r.metas=i,o.push(r))}))},addBeforeSendHooks:(...e)=>{t.debug("Adding beforeSendHooks\n",a),e.forEach((e=>{e&&a.push(e)}))},addIgnoreErrorsPatterns:(...e)=>{t.debug("Adding ignoreErrorsPatterns\n",e),e.forEach((e=>{e&&a.push(D(e))}))},getBeforeSendHooks:()=>[...a],execute:e=>{var i;s||((null===(i=n.batching)||void 0===i?void 0:i.enabled)&&(null==c||c.addItem(e)),(e=>{var i,r;if((null===(i=n.batching)||void 0===i?void 0:i.enabled)&&o.every((e=>e.isBatched())))return;const[s]=u([e]);if(void 0!==s)for(const e of o)t.debug(`Transporting item using ${e.name}\n`,s),e.isBatched()?(null===(r=n.batching)||void 0===r?void 0:r.enabled)||e.send([s]):e.send(s)})(e))},isPaused:()=>s,pause:()=>{t.debug("Pausing transports"),null==c||c.pause(),s=!0},remove:(...e)=>{t.debug("Removing transports"),e.forEach((e=>{t.debug(`Removing "${e.name}" transport`);const n=o.indexOf(e);-1!==n?o.splice(n,1):t.warn(`Transport "${e.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{a.filter((t=>!e.includes(t)))},get transports(){return[...o]},unpause:()=>{t.debug("Unpausing transports"),null==c||c.start(),s=!1}}}var R;e.InternalLoggerLevel=void 0,(R=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[R.OFF=0]="OFF",R[R.ERROR=1]="ERROR",R[R.WARN=2]="WARN",R[R.INFO=3]="INFO",R[R.VERBOSE=4]="VERBOSE";const B={debug:L,error:L,info:L,prefix:"Faro",warn:L},U=e.InternalLoggerLevel.ERROR,F=Object.assign({},console);let z=F;function V(e){var t;return z=null!==(t=e.unpatchedConsole)&&void 0!==t?t:z,z}function $(t=F,n=U){const i=B;return n>e.InternalLoggerLevel.OFF&&(i.error=n>=e.InternalLoggerLevel.ERROR?function(...e){t.error(`${i.prefix}\n`,...e)}:L,i.warn=n>=e.InternalLoggerLevel.WARN?function(...e){t.warn(`${i.prefix}\n`,...e)}:L,i.info=n>=e.InternalLoggerLevel.INFO?function(...e){t.info(`${i.prefix}\n`,...e)}:L,i.debug=n>=e.InternalLoggerLevel.VERBOSE?function(...e){t.debug(`${i.prefix}\n`,...e)}:L),i}let q=B;function G(e,t){return q=$(e,t.internalLoggerLevel),q}class W{constructor(){this.unpatchedConsole=F,this.internalLogger=B,this.config={},this.metas={}}logDebug(...e){this.internalLogger.debug(`${this.name}\n`,...e)}logInfo(...e){this.internalLogger.info(`${this.name}\n`,...e)}logWarn(...e){this.internalLogger.warn(`${this.name}\n`,...e)}logError(...e){this.internalLogger.error(`${this.name}\n`,...e)}}class H extends W{isBatched(){return!1}getIgnoreUrls(){return[]}}function K(e,t){var n,i;if(void 0===t)return e;if(void 0===e)return{resourceSpans:t};const r=null===(n=e.resourceSpans)||void 0===n?void 0:n[0];if(void 0===r)return e;const o=(null==r?void 0:r.scopeSpans)||[],s=(null===(i=null==t?void 0:t[0])||void 0===i?void 0:i.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},r),{scopeSpans:[...o,...s]})]})}function X(t){let n={meta:{}};return void 0!==t[0]&&(n.meta=t[0].meta),t.forEach((t=>{switch(t.type){case e.TransportItemType.LOG:case e.TransportItemType.EVENT:case e.TransportItemType.EXCEPTION:case e.TransportItemType.MEASUREMENT:const i=M[t.type],r=n[i];n=Object.assign(Object.assign({},n),{[i]:void 0===r?[t.payload]:[...r,t.payload]});break;case e.TransportItemType.TRACE:n=Object.assign(Object.assign({},n),{traces:K(n.traces,t.payload.resourceSpans)})}})),n}const J="Error";let Z;function Y(e){let t=e.cause;return m(t)?t=e.cause.toString():null!==t&&(a(e.cause)||l(e.cause))?t=JSON.stringify(e.cause):null!=t&&(t=e.cause.toString()),null==t?{}:{cause:t}}const Q=e=>e.map((e=>{try{return String(e)}catch(e){return""}})).join(" ");function ee(t,n,i,o,s){n.debug("Initializing API");const a=function(t,n,i,r,o){let s;return n.debug("Initializing traces API"),{getOTEL:()=>s,getTraceContext:()=>{const e=null==s?void 0:s.trace.getSpanContext(s.context.active());return e?{trace_id:e.traceId,span_id:e.spanId}:void 0},initOTEL:(e,t)=>{n.debug("Initializing OpenTelemetry"),s={trace:e,context:t}},isOTELInitialized:()=>!!s,pushTraces:t=>{try{const i={type:e.TransportItemType.TRACE,payload:t,meta:r.value};n.debug("Pushing trace\n",i),o.execute(i)}catch(e){n.error("Error pushing trace\n",e)}}}}(0,n,0,o,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),function(t,n,i,o,s,a){var u;n.debug("Initializing exceptions API");let l=null;Z=null!==(u=i.parseStacktrace)&&void 0!==u?u:Z;const c=e=>{n.debug("Changing stacktrace parser"),Z=null!=e?e:Z};return c(i.parseStacktrace),{changeStacktraceParser:c,getStacktraceParser:()=>Z,pushError:(t,{skipDedupe:u,stackFrames:c,type:d,context:f,spanContext:p,timestampOverwriteMs:m}={})=>{d=d||t.name||J;const g={meta:o.value,payload:{type:d,value:t.message,timestamp:m?E(m):T(),trace:p?{trace_id:p.traceId,span_id:p.spanId}:a.getTraceContext(),context:Object.assign(Object.assign({},Y(t)),null!=f?f:{})},type:e.TransportItemType.EXCEPTION};(null==(c=null!=c?c:t.stack?null==Z?void 0:Z(t).frames:void 0)?void 0:c.length)&&(g.payload.stacktrace={frames:c});const v={type:g.payload.type,value:g.payload.value,stackTrace:g.payload.stacktrace,context:g.payload.context};u||!i.dedupe||r(l)||!y(v,l)?(l=v,n.debug("Pushing exception\n",g),s.execute(g)):n.debug("Skipping error push because it is the same as the last one\n",g.payload)}}}(0,n,i,o,s,a)),function(e,t,n,i){let r,o,s;t.debug("Initializing meta API");const a=e=>{o&&i.remove(o),o={user:e},i.add(o)},u=e=>{r&&i.remove(r),r={session:e},i.add(r)};return{setUser:a,resetUser:a,setSession:u,resetSession:u,getSession:()=>i.value.session,setView:e=>{var t;if((null===(t=null==s?void 0:s.view)||void 0===t?void 0:t.name)===(null==e?void 0:e.name))return;const n=s;s={view:e},i.add(s),n&&i.remove(n)},getView:()=>i.value.view}}(0,n,0,o)),function(t,n,i,o,s,a){var u;n.debug("Initializing logs API");let l=null;const c=null!==(u=i.logArgsSerializer)&&void 0!==u?u:Q;return{pushLog:(t,{context:u,level:d,skipDedupe:f,spanContext:p,timestampOverwriteMs:m}={})=>{try{const g={type:e.TransportItemType.LOG,payload:{message:c(t),level:null!=d?d:k,context:null!=u?u:{},timestamp:m?E(m):T(),trace:p?{trace_id:p.traceId,span_id:p.spanId}:a.getTraceContext()},meta:o.value},v={message:g.payload.message,level:g.payload.level,context:g.payload.context};if(!f&&i.dedupe&&!r(l)&&y(v,l))return void n.debug("Skipping log push because it is the same as the last one\n",g.payload);l=v,n.debug("Pushing log\n",g),s.execute(g)}catch(e){n.error("Error pushing log\n",e)}}}}(0,n,i,o,s,a)),function(t,n,i,o,s,a){n.debug("Initializing measurements API");let u=null;return{pushMeasurement:(t,{skipDedupe:l,context:c,spanContext:d,timestampOverwriteMs:f}={})=>{try{const p={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},t),{trace:d?{trace_id:d.traceId,span_id:d.spanId}:a.getTraceContext(),timestamp:f?E(f):T(),context:null!=c?c:{}}),meta:o.value},m={type:p.payload.type,values:p.payload.values,context:p.payload.context};if(!l&&i.dedupe&&!r(u)&&y(m,u))return void n.debug("Skipping measurement push because it is the same as the last one\n",p.payload);u=m,n.debug("Pushing measurement\n",p),s.execute(p)}catch(e){n.error("Error pushing measurement\n",e)}}}}(0,n,i,o,s,a)),function(t,n,i,o,s,a){let u=null;return{pushEvent:(t,l,c,{skipDedupe:d,spanContext:f,timestampOverwriteMs:p}={})=>{try{const m={meta:o.value,payload:{name:t,domain:null!=c?c:i.eventDomain,attributes:l,timestamp:p?E(p):T(),trace:f?{trace_id:f.traceId,span_id:f.spanId}:a.getTraceContext()},type:e.TransportItemType.EVENT},g={name:m.payload.name,attributes:m.payload.attributes,domain:m.payload.domain};if(!d&&i.dedupe&&!r(u)&&y(g,u))return void n.debug("Skipping event push because it is the same as the last one\n",m.payload);u=g,n.debug("Pushing event\n",m),s.execute(m)}catch(e){n.error("Error pushing event",e)}}}}(0,n,i,o,s,a))}class te extends W{constructor(){super(...arguments),this.api={},this.transports={}}}const ne="1.12.2";const ie="_faroInternal";function re(e){e.config.isolate?e.internalLogger.debug("Skipping registering internal Faro instance on global object"):(e.internalLogger.debug("Registering internal Faro instance on global object"),Object.defineProperty(_,ie,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function oe(){return ie in _}function se(t,n,i,r,o,s,a){return n.debug("Initializing Faro"),e.faro={api:s,config:i,instrumentations:a,internalLogger:n,metas:r,pause:o.pause,transports:o,unpatchedConsole:t,unpause:o.unpause},re(e.faro),function(e){if(e.config.preventGlobalExposure)e.internalLogger.debug("Skipping registering public Faro instance in the global scope");else{if(e.internalLogger.debug(`Registering public faro reference in the global scope using "${e.config.globalObjectKey}" key`),e.config.globalObjectKey in _)return void e.internalLogger.warn(`Skipping global registration due to key "${e.config.globalObjectKey}" being used already. Please set "globalObjectKey" to something else or set "preventGlobalExposure" to "true"`);Object.defineProperty(_,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}function ae(e){const t=V(e),n=G(t,e);if(oe()&&!e.isolate)return void n.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');n.debug("Initializing");const i=function(e,t){let n=[],i=[];const r=()=>n.reduce(((e,t)=>Object.assign(e,u(t)?t():t)),{}),o=()=>{if(i.length){const e=r();i.forEach((t=>t(e)))}};return{add:(...e)=>{t.debug("Adding metas\n",e),n.push(...e),o()},remove:(...e)=>{t.debug("Removing metas\n",e),n=n.filter((t=>!e.includes(t))),o()},addListener:e=>{t.debug("Adding metas listener\n",e),i.push(e)},removeListener:e=>{t.debug("Removing metas listener\n",e),i=i.filter((t=>t!==e))},get value(){return r()}}}(0,n),r=j(t,n,e,i),o=ee(0,n,e,i,r),s=function(e,t,n,i,r,o){t.debug("Initializing instrumentations");const s=[];return{add:(...a)=>{t.debug("Adding instrumentations"),a.forEach((a=>{t.debug(`Adding "${a.name}" instrumentation`),s.some((e=>e.name===a.name))?t.warn(`Instrumentation ${a.name} is already added`):(a.unpatchedConsole=e,a.internalLogger=t,a.config=n,a.metas=i,a.transports=r,a.api=o,s.push(a),a.initialize())}))},get instrumentations(){return[...s]},remove:(...e)=>{t.debug("Removing instrumentations"),e.forEach((e=>{var n,i;t.debug(`Removing "${e.name}" instrumentation`);const r=s.reduce(((t,n,i)=>null===t&&n.name===e.name?i:null),null);r?(null===(i=(n=s[r]).destroy)||void 0===i||i.call(n),s.splice(r,1)):t.warn(`Instrumentation "${e.name}" is not added`)}))}}}(t,n,e,i,r,o),a=se(t,n,e,i,r,o,s);return function(e){var t,n;const i={sdk:{version:ne},app:{bundleId:e.config.app.name&&(r=e.config.app.name,null==_?void 0:_[`__faroBundleId_${r}`])}};var r;const o=null===(t=e.config.sessionTracking)||void 0===t?void 0:t.session;o&&e.api.setSession(o),e.config.app&&(i.app=Object.assign(Object.assign({},e.config.app),i.app)),e.config.user&&(i.user=e.config.user),e.config.view&&(i.view=e.config.view),e.metas.add(i,...null!==(n=e.config.metas)&&void 0!==n?n:[])}(a),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend),e.transports.addIgnoreErrorsPatterns(e.config.ignoreErrors)}(a),function(e){e.instrumentations.add(...e.config.instrumentations)}(a),a}e.faro={};const ue="faro",le={enabled:!0,sendTimeout:250,itemLimit:50},ce="view_changed",de="session_start",fe="session_resume",pe="session_extend",me="unknown";var ge="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},ve={exports:{}};!function(e,t){!function(n,i){var r="function",o="undefined",s="object",a="string",u="major",l="model",c="name",d="type",f="vendor",p="version",m="architecture",g="console",v="mobile",h="tablet",b="smarttv",w="wearable",y="embedded",S="Amazon",T="Apple",E="ASUS",I="BlackBerry",k="Browser",x="Chrome",L="Firefox",O="Google",C="Huawei",P="LG",_="Microsoft",N="Motorola",A="Opera",M="Samsung",D="Sharp",j="Sony",R="Xiaomi",B="Zebra",U="Facebook",F="Chromium OS",z="Mac OS",V=" Browser",$=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},q=function(e,t){return typeof e===a&&-1!==G(t).indexOf(G(e))},G=function(e){return e.toLowerCase()},W=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,500)},H=function(e,t){for(var n,o,a,u,l,c,d=0;d<t.length&&!l;){var f=t[d],p=t[d+1];for(n=o=0;n<f.length&&!l&&f[n];)if(l=f[n++].exec(e))for(a=0;a<p.length;a++)c=l[++o],typeof(u=p[a])===s&&u.length>0?2===u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,c):this[u[0]]=u[1]:3===u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=c?c.replace(u[1],u[2]):i:this[u[0]]=c?u[1].call(this,c,u[2]):i:4===u.length&&(this[u[0]]=c?u[3].call(this,c.replace(u[1],u[2])):i):this[u]=c||i;d+=2}},K=function(e,t){for(var n in t)if(typeof t[n]===s&&t[n].length>0){for(var r=0;r<t[n].length;r++)if(q(t[n][r],e))return"?"===n?i:n}else if(q(t[n],e))return"?"===n?i:n;return t.hasOwnProperty("*")?t["*"]:e},X={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,p],[/opios[\/ ]+([\w\.]+)/i],[p,[c,A+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[p,[c,A+" GX"]],[/\bopr\/([\w\.]+)/i],[p,[c,A]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[c,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,p],[/quark(?:pc)?\/([-\w\.]+)/i],[p,[c,"Quark"]],[/\bddg\/([\w\.]+)/i],[p,[c,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[c,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[p,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[c,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[p,[c,"Smart Lenovo "+k]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+k],p],[/\bfocus\/([\w\.]+)/i],[p,[c,L+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[c,A+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[c,A+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[c,"MIUI "+k]],[/fxios\/([-\w\.]+)/i],[p,[c,L]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360"+V]],[/\b(qq)\/([\w\.]+)/i],[[c,/(.+)/,"$1Browser"],p],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1"+V],p],[/samsungbrowser\/([\w\.]+)/i],[p,[c,M+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],p],[/metasr[\/ ]?([\d\.]+)/i],[p,[c,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[c,"Sogou Mobile"],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[c,p],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,U],p],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[c,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,x+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[c,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[p,K,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[c,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],p],[/(wolvic)\/([\w\.]+)/i],[c,p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[c,L+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[c,[p,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[c,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[m,"amd64"]],[/(ia32(?=;))/i],[[m,G]],[/((?:i[346]|x)86)[;\)]/i],[[m,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[m,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[m,"armhf"]],[/windows (ce|mobile); ppc;/i],[[m,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[m,/ower/,"",G]],[/(sun4\w)[;\)]/i],[[m,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[m,G]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[f,M],[d,h]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[l,[f,M],[d,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[f,T],[d,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[f,T],[d,h]],[/(macintosh);/i],[l,[f,T]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[f,D],[d,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[f,C],[d,h]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[f,C],[d,v]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[l,/_/g," "],[f,R],[d,v]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[f,R],[d,h]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[f,"OPPO"],[d,v]],[/\b(opd2\d{3}a?) bui/i],[l,[f,"OPPO"],[d,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[f,"Vivo"],[d,v]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[l,[f,"Realme"],[d,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[f,N],[d,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[f,N],[d,h]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[f,P],[d,h]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[f,P],[d,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[f,"Lenovo"],[d,h]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[f,"Nokia"],[d,v]],[/(pixel c)\b/i],[l,[f,O],[d,h]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[f,O],[d,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[f,j],[d,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[f,j],[d,h]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[f,"OnePlus"],[d,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[f,S],[d,h]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[f,S],[d,v]],[/(playbook);[-\w\),; ]+(rim)/i],[l,f,[d,h]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[f,I],[d,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[f,E],[d,h]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[f,E],[d,v]],[/(nexus 9)/i],[l,[f,"HTC"],[d,h]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[l,/_/g," "],[d,v]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[l,[f,"TCL"],[d,h]],[/(itel) ((\w+))/i],[[f,G],l,[d,K,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[f,"Acer"],[d,h]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[f,"Meizu"],[d,v]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[l,[f,"Ulefone"],[d,v]],[/droid.+; (a(?:015|06[35]|142p?))/i],[l,[f,"Nothing"],[d,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[f,l,[d,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[f,l,[d,h]],[/(surface duo)/i],[l,[f,_],[d,h]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[f,"Fairphone"],[d,v]],[/(u304aa)/i],[l,[f,"AT&T"],[d,v]],[/\bsie-(\w*)/i],[l,[f,"Siemens"],[d,v]],[/\b(rct\w+) b/i],[l,[f,"RCA"],[d,h]],[/\b(venue[\d ]{2,7}) b/i],[l,[f,"Dell"],[d,h]],[/\b(q(?:mv|ta)\w+) b/i],[l,[f,"Verizon"],[d,h]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[f,"Barnes & Noble"],[d,h]],[/\b(tm\d{3}\w+) b/i],[l,[f,"NuVision"],[d,h]],[/\b(k88) b/i],[l,[f,"ZTE"],[d,h]],[/\b(nx\d{3}j) b/i],[l,[f,"ZTE"],[d,v]],[/\b(gen\d{3}) b.+49h/i],[l,[f,"Swiss"],[d,v]],[/\b(zur\d{3}) b/i],[l,[f,"Swiss"],[d,h]],[/\b((zeki)?tb.*\b) b/i],[l,[f,"Zeki"],[d,h]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],l,[d,h]],[/\b(ns-?\w{0,9}) b/i],[l,[f,"Insignia"],[d,h]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[f,"NextBook"],[d,h]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],l,[d,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],l,[d,v]],[/\b(ph-1) /i],[l,[f,"Essential"],[d,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[f,"Envizen"],[d,h]],[/\b(trio[-\w\. ]+) b/i],[l,[f,"MachSpeed"],[d,h]],[/\btu_(1491) b/i],[l,[f,"Rotor"],[d,h]],[/(shield[\w ]+) b/i],[l,[f,"Nvidia"],[d,h]],[/(sprint) (\w+)/i],[f,l,[d,v]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[f,_],[d,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[f,B],[d,h]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[f,B],[d,v]],[/smart-tv.+(samsung)/i],[f,[d,b]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[f,M],[d,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,P],[d,b]],[/(apple) ?tv/i],[f,[l,T+" TV"],[d,b]],[/crkey/i],[[l,x+"cast"],[f,O],[d,b]],[/droid.+aft(\w+)( bui|\))/i],[l,[f,S],[d,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[f,D],[d,b]],[/(bravia[\w ]+)( bui|\))/i],[l,[f,j],[d,b]],[/(mitv-\w{5}) bui/i],[l,[f,R],[d,b]],[/Hbbtv.*(technisat) (.*);/i],[f,l,[d,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[f,W],[l,W],[d,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,l,[d,g]],[/droid.+; (shield) bui/i],[l,[f,"Nvidia"],[d,g]],[/(playstation [345portablevi]+)/i],[l,[f,j],[d,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[f,_],[d,g]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[l,[f,M],[d,w]],[/((pebble))app/i],[f,l,[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[f,T],[d,w]],[/droid.+; (glass) \d/i],[l,[f,O],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[l,[f,B],[d,w]],[/(quest( \d| pro)?)/i],[l,[f,U],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[d,y]],[/(aeobc)\b/i],[l,[f,S],[d,y]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[l,[d,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[d,h]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,h]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,v]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,p],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[c,[p,K,X]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,K,X],[c,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,z],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,p],[/\(bb(10);/i],[p,[c,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[c,L+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[c,x+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,F],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[c,p],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,p]]},Z=function(e,t){if(typeof e===s&&(t=e,e=i),!(this instanceof Z))return new Z(e,t).getResult();var g=typeof n!==o&&n.navigator?n.navigator:i,b=e||(g&&g.userAgent?g.userAgent:""),w=g&&g.userAgentData?g.userAgentData:i,y=t?function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n}(J,t):J,S=g&&g.userAgent==b;return this.getBrowser=function(){var e,t={};return t[c]=i,t[p]=i,H.call(t,b,y.browser),t[u]=typeof(e=t[p])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:i,S&&g&&g.brave&&typeof g.brave.isBrave==r&&(t[c]="Brave"),t},this.getCPU=function(){var e={};return e[m]=i,H.call(e,b,y.cpu),e},this.getDevice=function(){var e={};return e[f]=i,e[l]=i,e[d]=i,H.call(e,b,y.device),S&&!e[d]&&w&&w.mobile&&(e[d]=v),S&&"Macintosh"==e[l]&&g&&typeof g.standalone!==o&&g.maxTouchPoints&&g.maxTouchPoints>2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[c]=i,e[p]=i,H.call(e,b,y.engine),e},this.getOS=function(){var e={};return e[c]=i,e[p]=i,H.call(e,b,y.os),S&&!e[c]&&w&&w.platform&&"Unknown"!=w.platform&&(e[c]=w.platform.replace(/chrome os/i,F).replace(/macos/i,z)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return b},this.setUA=function(e){return b=typeof e===a&&e.length>500?W(e,500):e,this},this.setUA(b),this};Z.VERSION="1.0.39",Z.BROWSER=$([c,p,u]),Z.CPU=$([m]),Z.DEVICE=$([l,f,d,g,v,b,h,w,y]),Z.ENGINE=Z.OS=$([c,p]),e.exports&&(t=e.exports=Z),t.UAParser=Z;var Y=typeof n!==o&&(n.jQuery||n.Zepto);if(Y&&!Y.ua){var Q=new Z;Y.ua=Q.getResult(),Y.ua.get=function(){return Q.getUA()},Y.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var n in t)Y.ua[n]=t[n]}}}("object"==typeof window?window:ge)}(ve,ve.exports);var he=ve.exports;const be=()=>{const e=new he.UAParser,{name:t,version:n}=e.getBrowser(),{name:i,version:r}=e.getOS(),o=e.getUA(),s=navigator.language,a=navigator.userAgent.includes("Mobi"),u=function(){if(!t||!n)return;if("userAgentData"in navigator&&navigator.userAgentData)return navigator.userAgentData.brands;return}();return{browser:{name:null!=t?t:me,version:null!=n?n:me,os:`${null!=i?i:me} ${null!=r?r:me}`,userAgent:null!=o?o:me,language:null!=s?s:me,mobile:a,brands:null!=u?u:me,viewportWidth:`${window.innerWidth}`,viewportHeight:`${window.innerHeight}`}}},we=()=>({page:{url:location.href}}),ye=[be,we];function Se(t){var n,i,r,o;return{id:null!==(o=null===(r=null===(i=null===(n=e.faro.config)||void 0===n?void 0:n.sessionTracking)||void 0===i?void 0:i.generateSessionId)||void 0===r?void 0:r.call(i))&&void 0!==o?o:P(),attributes:t}}const Te={session:"sessionStorage",local:"localStorage"};function Ee(t){var n;try{let e;e=window[t];const n="__faro_storage_test__";return e.setItem(n,n),e.removeItem(n),!0}catch(i){return null===(n=e.faro.internalLogger)||void 0===n||n.info(`Web storage of type ${t} is not available. Reason: ${i}`),!1}}function Ie(e,t){return Ce(t)?window[t].getItem(e):null}function ke(e,t,n){if(Ce(n))try{window[n].setItem(e,t)}catch(e){}}function xe(e,t){Ce(t)&&window[t].removeItem(e)}const Le=Ee(Te.local),Oe=Ee(Te.session);function Ce(e){return e===Te.local?Le:e===Te.session&&Oe}function Pe(e,t){let n,i=!1;const r=()=>{null!=n?(e(...n),n=null,setTimeout(r,t)):i=!1};return(...o)=>{i?n=o:(e(...o),i=!0,setTimeout(r,t))}}function _e(e={}){return JSON.stringify(null!=e?e:{},function(){const e=new WeakSet;return function(t,n){if("object"==typeof n&&null!==n){if(e.has(n))return null;e.add(n)}return n}}())}function Ne(){var t,n,i;const r=e.faro.config.sessionTracking;let o=null!==(i=null!==(n=null===(t=null==r?void 0:r.sampler)||void 0===t?void 0:t.call(r,{metas:e.faro.metas.value}))&&void 0!==n?n:null==r?void 0:r.samplingRate)&&void 0!==i?i:1;if("number"!=typeof o){o=0}return Math.random()<o}const Ae="com.grafana.faro.session",Me=144e5,De=9e5,je=De,Re={enabled:!0,persistent:!1,maxSessionPersistenceTime:je};function Be({sessionId:t,started:n,lastActivity:i,isSampled:r=!0}={}){var o,s;const a=S(),u=null===(s=null===(o=e.faro.config)||void 0===o?void 0:o.sessionTracking)||void 0===s?void 0:s.generateSessionId;return null==t&&(t="function"==typeof u?u():P()),{sessionId:t,lastActivity:null!=i?i:a,started:null!=n?n:a,isSampled:r}}function Ue(e){if(null==e)return!1;const t=S();if(!(t-e.started<Me))return!1;return t-e.lastActivity<De}function Fe({fetchUserSession:t,storeUserSession:n}){return function({forceSessionExtend:i}={forceSessionExtend:!1}){var r,o,s;if(!t||!n)return;const a=e.faro.config.sessionTracking,u=null==a?void 0:a.persistent;if(u&&!Le||!u&&!Oe)return;const l=t();if(!1===i&&Ue(l))n(Object.assign(Object.assign({},l),{lastActivity:S()}));else{let t=ze(Be({isSampled:Ne()}),l);n(t),null===(r=e.faro.api)||void 0===r||r.setSession(t.sessionMeta),null===(o=null==a?void 0:a.onSessionChange)||void 0===o||o.call(a,null!==(s=null==l?void 0:l.sessionMeta)&&void 0!==s?s:null,t.sessionMeta)}}}function ze(t,n){var i,r,o,s;return Object.assign(Object.assign({},t),{sessionMeta:{id:t.sessionId,attributes:Object.assign(Object.assign(Object.assign(Object.assign({},null===(r=null===(i=e.faro.config.sessionTracking)||void 0===i?void 0:i.session)||void 0===r?void 0:r.attributes),null!==(s=null===(o=e.faro.metas.value.session)||void 0===o?void 0:o.attributes)&&void 0!==s?s:{}),null!=n?{previousSession:n.sessionId}:{}),{isSampled:t.isSampled.toString()})}})}class Ve{constructor(){this.updateSession=Pe((()=>this.updateUserSession()),1e3),this.updateUserSession=Fe({fetchUserSession:Ve.fetchUserSession,storeUserSession:Ve.storeUserSession}),this.init()}static removeUserSession(){xe(Ae,Ve.storageTypeLocal)}static storeUserSession(e){ke(Ae,_e(e),Ve.storageTypeLocal)}static fetchUserSession(){const e=Ie(Ae,Ve.storageTypeLocal);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener((function(t){const n=t.session,i=Ve.fetchUserSession();if(n&&n.id!==(null==i?void 0:i.sessionId)){const t=ze(Be({sessionId:n.id,isSampled:Ne()}),i);Ve.storeUserSession(t),e.faro.api.setSession(t.sessionMeta)}}))}}Ve.storageTypeLocal=Te.local;class $e{constructor(){this.updateSession=Pe((()=>this.updateUserSession()),1e3),this.updateUserSession=Fe({fetchUserSession:$e.fetchUserSession,storeUserSession:$e.storeUserSession}),this.init()}static removeUserSession(){xe(Ae,$e.storageTypeSession)}static storeUserSession(e){ke(Ae,_e(e),$e.storageTypeSession)}static fetchUserSession(){const e=Ie(Ae,$e.storageTypeSession);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener((function(t){const n=t.session,i=$e.fetchUserSession();if(n&&n.id!==(null==i?void 0:i.sessionId)){const t=ze(Be({sessionId:n.id,isSampled:Ne()}),i);$e.storeUserSession(t),e.faro.api.setSession(t.sessionMeta)}}))}}function qe(e){return(null==e?void 0:e.persistent)?Ve:$e}$e.storageTypeSession=Te.session;class Ge extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=ne}sendSessionStartEvent(e){var t,n;const i=e.session;if(i&&i.id!==(null===(t=this.notifiedSession)||void 0===t?void 0:t.id)){if(this.notifiedSession&&this.notifiedSession.id===(null===(n=i.attributes)||void 0===n?void 0:n.previousSession))return this.api.pushEvent(pe,{},void 0,{skipDedupe:!0}),void(this.notifiedSession=i);this.notifiedSession=i,this.api.pushEvent(de,{},void 0,{skipDedupe:!0})}}createInitialSession(e,t){var n,i,r,o,s;let a,u,l=e.fetchUserSession();if(t.persistent&&t.maxSessionPersistenceTime&&l){const e=S();l.lastActivity<e-t.maxSessionPersistenceTime&&(Ve.removeUserSession(),l=null)}if(Ue(l)){const e=null==l?void 0:l.sessionId;u=Be({sessionId:e,isSampled:l.isSampled||!1,started:null==l?void 0:l.started}),u.sessionMeta={id:e,attributes:Object.assign(Object.assign(Object.assign({},null===(n=t.session)||void 0===n?void 0:n.attributes),null===(i=null==l?void 0:l.sessionMeta)||void 0===i?void 0:i.attributes),{isSampled:u.isSampled.toString()})},a=fe}else{const e=null!==(o=null===(r=t.session)||void 0===r?void 0:r.id)&&void 0!==o?o:Se().id;u=Be({sessionId:e,isSampled:Ne()}),u.sessionMeta={id:e,attributes:Object.assign({isSampled:u.isSampled.toString()},null===(s=t.session)||void 0===s?void 0:s.attributes)},a=de}return{initialSession:u,lifecycleType:a}}registerBeforeSendHook(e){var t;const{updateSession:n}=new e;null===(t=this.transports)||void 0===t||t.addBeforeSendHooks((e=>{var t,i,r;n();const o=null===(t=e.meta.session)||void 0===t?void 0:t.attributes;if(o&&"true"===(null==o?void 0:o.isSampled)){let t=JSON.parse(JSON.stringify(e));const n=null===(i=t.meta.session)||void 0===i?void 0:i.attributes;return null==n||delete n.isSampled,0===Object.keys(null!=n?n:{}).length&&(null===(r=t.meta.session)||void 0===r||delete r.attributes),t}return null}))}initialize(){this.logDebug("init session instrumentation");const e=this.config.sessionTracking;if(null==e?void 0:e.enabled){const t=qe(e);this.registerBeforeSendHook(t);const{initialSession:n,lifecycleType:i}=this.createInitialSession(t,e);t.storeUserSession(n);const r=n.sessionMeta;this.notifiedSession=r,this.api.setSession(r),i===de&&this.api.pushEvent(de,{},void 0,{skipDedupe:!0}),i===fe&&this.api.pushEvent(fe,{},void 0,{skipDedupe:!0})}this.metas.addListener(this.sendSessionStartEvent.bind(this))}}class We extends te{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=ne}initialize(){this.logDebug("Initializing\n",this.options),this.options=Object.assign(Object.assign({},this.options),this.config.consoleInstrumentation),x.filter((e=>{var t,n;return!(null!==(n=null===(t=this.options)||void 0===t?void 0:t.disabledLevels)&&void 0!==n?n:We.defaultDisabledLevels).includes(e)})).forEach((t=>{console[t]=(...n)=>{var i;try{t!==e.LogLevel.ERROR||(null===(i=this.options)||void 0===i?void 0:i.consoleErrorAsLog)?this.api.pushLog(n,{level:t}):this.api.pushError(new Error("console.error: "+Q(n)))}catch(e){this.logError(e)}finally{this.unpatchedConsole[t](...n)}}}))}}We.defaultDisabledLevels=[e.LogLevel.DEBUG,e.LogLevel.TRACE,e.LogLevel.LOG];const He="DOMError",Ke="DOMException",Xe="Non-Error exception captured with keys:",Je=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Ze="\n",Ye="eval",Qe="?",et="@",tt=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,nt=/\((\S*)(?::(\d+))(?::(\d+))\)/,it="eval",rt="address at ",ot=rt.length,st=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,at=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ut=" > eval",lt="safari-extension",ct="safari-web-extension",dt=/Minified React error #\d+;/i;function ft(e,t,n,i){const r={filename:e||document.location.href,function:t||Qe};return void 0!==n&&(r.lineno=n),void 0!==i&&(r.colno=i),r}function pt(e,t){const n=null==e?void 0:e.includes(lt),i=!n&&(null==e?void 0:e.includes(ct));return n||i?[(null==e?void 0:e.includes(et))?e.split(et)[0]:e,n?`${lt}:${t}`:`${ct}:${t}`]:[e,t]}function mt(e){let t=[];e.stacktrace?t=e.stacktrace.split(Ze).filter(((e,t)=>t%2==0)):e.stack&&(t=e.stack.split(Ze));const n=t.reduce(((t,n,i)=>{let r,o,a,u,l;if(r=tt.exec(n)){if(o=r[1],a=r[2],u=r[3],l=r[4],null==a?void 0:a.startsWith(it)){const e=nt.exec(a);e&&(a=e[1],u=e[2],l=e[3])}a=(null==a?void 0:a.startsWith(rt))?a.substring(ot):a,[o,a]=pt(o,a)}else if(r=st.exec(n)){if(o=r[1],a=r[3],u=r[4],l=r[5],a&&a.includes(ut)){const e=at.exec(a);e&&(o=o||Ye,a=e[1],u=e[2])}else 0===i&&!l&&s(e.columnNumber)&&(l=String(e.columnNumber+1));[o,a]=pt(o,a)}return(a||o)&&t.push(ft(a,o,u?Number(u):void 0,l?Number(l):void 0)),t}),[]);return dt.test(e.message)?n.slice(1):n}function gt(e){return{frames:mt(e)}}function vt(e){let t,n,i,r,o=[];if(g(e)&&e.error)t=e.error.message,n=e.error.name,o=mt(e.error);else if((i=v(e))||h(e)){const{name:r,message:o}=e;n=null!=r?r:i?He:Ke,t=o?`${n}: ${o}`:n}else m(e)?(t=e.message,o=mt(e)):(a(e)||(r=f(e)))&&(n=r?e.constructor.name:void 0,t=`${Xe} ${Object.keys(e)}`);return[t,n,o]}function ht(e){const t=window.onerror;window.onerror=(...n)=>{try{const[t,i,r,s,a]=n;let u,l,c=[];const d=o(t),f=ft(i,"?",r,s);a||!d?([u,l,c]=vt(null!=a?a:t),0===c.length&&(c=[f])):d&&([u,l]=function(e){var t,n;const i=e.match(Je),r=null!==(t=null==i?void 0:i[1])&&void 0!==t?t:J;return[null!==(n=null==i?void 0:i[2])&&void 0!==n?n:e,r]}(t),c=[f]),u&&e.pushError(new Error(u),{type:l,stackFrames:c})}finally{null==t||t.apply(window,n)}}}class bt extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=ne}initialize(){var e;this.logDebug("Initializing"),ht(this.api),e=this.api,window.addEventListener("unhandledrejection",(t=>{var n,i;let r,o,s=t;s.reason?s=t.reason:(null===(n=t.detail)||void 0===n?void 0:n.reason)&&(s=null===(i=t.detail)||void 0===i?void 0:i.reason);let a=[];c(s)?(r=`Non-Error promise rejection captured with value: ${String(s)}`,o="UnhandledRejection"):[r,o,a]=vt(s),r&&e.pushError(new Error(r),{type:o,stackFrames:a})}))}}class wt extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=ne}sendViewChangedEvent(e){var t,n,i,r;const o=e.view;o&&o.name!==(null===(t=this.notifiedView)||void 0===t?void 0:t.name)&&(this.api.pushEvent(ce,{fromView:null!==(i=null===(n=this.notifiedView)||void 0===n?void 0:n.name)&&void 0!==i?i:me,toView:null!==(r=o.name)&&void 0!==r?r:me},void 0,{skipDedupe:!0}),this.notifiedView=o)}initialize(){this.metas.addListener(this.sendViewChangedEvent.bind(this))}}var yt,St,Tt,Et,It,kt=-1,xt=function(e){addEventListener("pageshow",(function(t){t.persisted&&(kt=t.timeStamp,e(t))}),!0)},Lt=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Ot=function(){var e=Lt();return e&&e.activationStart||0},Ct=function(e,t){var n=Lt(),i="navigate";return kt>=0?i="back-forward-cache":n&&(document.prerendering||Ot()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},Pt=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},_t=function(e,t,n,i){var r,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Nt=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},At=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Mt=function(e){var t=!1;return function(){t||(e(),t=!0)}},Dt=-1,jt=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Rt=function(e){"hidden"===document.visibilityState&&Dt>-1&&(Dt="visibilitychange"===e.type?e.timeStamp:0,Ut())},Bt=function(){addEventListener("visibilitychange",Rt,!0),addEventListener("prerenderingchange",Rt,!0)},Ut=function(){removeEventListener("visibilitychange",Rt,!0),removeEventListener("prerenderingchange",Rt,!0)},Ft=function(){return Dt<0&&(Dt=jt(),Bt(),xt((function(){setTimeout((function(){Dt=jt(),Bt()}),0)}))),{get firstHiddenTime(){return Dt}}},zt=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Vt=[1800,3e3],$t=function(e,t){t=t||{},zt((function(){var n,i=Ft(),r=Ct("FCP"),o=Pt("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Ot(),0),r.entries.push(e),n(!0)))}))}));o&&(n=_t(e,r,Vt,t.reportAllChanges),xt((function(i){r=Ct("FCP"),n=_t(e,r,Vt,t.reportAllChanges),Nt((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},qt=[.1,.25],Gt=0,Wt=1/0,Ht=0,Kt=function(e){e.forEach((function(e){e.interactionId&&(Wt=Math.min(Wt,e.interactionId),Ht=Math.max(Ht,e.interactionId),Gt=Ht?(Ht-Wt)/7+1:0)}))},Xt=[],Jt=new Map,Zt=0,Yt=[],Qt=function(e){if(Yt.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Xt[Xt.length-1],n=Jt.get(e.interactionId);if(n||Xt.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Jt.set(i.id,i),Xt.push(i)}Xt.sort((function(e,t){return t.latency-e.latency})),Xt.length>10&&Xt.splice(10).forEach((function(e){return Jt.delete(e.id)}))}}},en=[200,500],tn=[2500,4e3],nn={},rn=[800,1800],on=function e(t){document.prerendering?zt((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},sn={passive:!0,capture:!0},an=new Date,un=function(e,t){St||(St=t,Tt=e,Et=new Date,dn(removeEventListener),ln())},ln=function(){if(Tt>=0&&Tt<Et-an){var e={entryType:"first-input",name:St.type,target:St.target,cancelable:St.cancelable,startTime:St.timeStamp,processingStart:St.timeStamp+Tt};It.forEach((function(t){t(e)})),It=[]}},cn=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){un(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,sn),removeEventListener("pointercancel",i,sn)};addEventListener("pointerup",n,sn),addEventListener("pointercancel",i,sn)}(t,e):un(t,e)}},dn=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,cn,sn)}))},fn=[100,300];class pn{constructor(e){this.pushMeasurement=e}initialize(){Object.entries(pn.mapping).forEach((([e,t])=>{t((t=>{this.pushMeasurement({type:"web-vitals",values:{[e]:t.value}})}))}))}}pn.mapping={cls:function(e,t){t=t||{},$t(Mt((function(){var n,i=Ct("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,n())},a=Pt("layout-shift",s);a&&(n=_t(e,i,qt,t.reportAllChanges),At((function(){s(a.takeRecords()),n(!0)})),xt((function(){r=0,i=Ct("CLS",0),n=_t(e,i,qt,t.reportAllChanges),Nt((function(){return n()}))})),setTimeout(n,0))})))},fcp:$t,fid:function(e,t){t=t||{},zt((function(){var n,i=Ft(),r=Ct("FID"),o=function(e){e.startTime<i.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),n(!0))},s=function(e){e.forEach(o)},a=Pt("first-input",s);n=_t(e,r,fn,t.reportAllChanges),a&&(At(Mt((function(){s(a.takeRecords()),a.disconnect()}))),xt((function(){var i;r=Ct("FID"),n=_t(e,r,fn,t.reportAllChanges),It=[],Tt=-1,St=null,dn(addEventListener),i=o,It.push(i),ln()})))}))},inp:function(e,t){t=t||{},zt((function(){var n;"interactionCount"in performance||yt||(yt=Pt("event",Kt,{type:"event",buffered:!0,durationThreshold:0}));var i,r=Ct("INP"),o=function(e){e.forEach(Qt);var t,n=(t=Math.min(Xt.length-1,Math.floor(((yt?Gt:performance.interactionCount||0)-Zt)/50)),Xt[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())},s=Pt("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=_t(e,r,en,t.reportAllChanges),s&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),At((function(){o(s.takeRecords()),i(!0)})),xt((function(){Zt=0,Xt.length=0,Jt.clear(),r=Ct("INP"),i=_t(e,r,en,t.reportAllChanges)})))}))},lcp:function(e,t){t=t||{},zt((function(){var n,i=Ft(),r=Ct("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Ot(),0),r.entries=[e],n())}))},s=Pt("largest-contentful-paint",o);if(s){n=_t(e,r,tn,t.reportAllChanges);var a=Mt((function(){nn[r.id]||(o(s.takeRecords()),s.disconnect(),nn[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return e=a,t=self.requestIdleCallback||self.setTimeout,n=-1,e=Mt(e),"hidden"===document.visibilityState?e():(n=t(e),At(e)),n;var e,t,n}),!0)})),At(a),xt((function(i){r=Ct("LCP"),n=_t(e,r,tn,t.reportAllChanges),Nt((function(){r.value=performance.now()-i.timeStamp,nn[r.id]=!0,n(!0)}))}))}}))},ttfb:function(e,t){t=t||{};var n=Ct("TTFB"),i=_t(e,n,rn,t.reportAllChanges);on((function(){var r=Lt();r&&(n.value=Math.max(r.responseStart-Ot(),0),n.entries=[r],i(!0),xt((function(){n=Ct("TTFB",0),(i=_t(e,n,rn,t.reportAllChanges))(!0)})))}))}};var mn,gn,vn=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},hn=function(e){if("loading"===document.readyState)return"loading";var t=vn();if(t){if(e<t.domInteractive)return"loading";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return"dom-interactive";if(0===t.domComplete||e<t.domComplete)return"dom-content-loaded"}return"complete"},bn=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},wn=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var i=e,r=i.id?"#"+i.id:bn(i)+(i.classList&&i.classList.value&&i.classList.value.trim()&&i.classList.value.trim().length?"."+i.classList.value.trim().replace(/\s+/g,"."):"");if(n.length+r.length>(t||100)-1)return n||r;if(n=n?r+">"+n:r,i.id)break;e=i.parentNode}}catch(e){}return n},yn=-1,Sn=function(){return yn},Tn=function(e){addEventListener("pageshow",(function(t){t.persisted&&(yn=t.timeStamp,e(t))}),!0)},En=function(){var e=vn();return e&&e.activationStart||0},In=function(e,t){var n=vn(),i="navigate";return Sn()>=0?i="back-forward-cache":n&&(document.prerendering||En()>0?i="prerender":document.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},kn=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},n||{})),i}}catch(e){}},xn=function(e,t,n,i){var r,o;return function(s){t.value>=0&&(s||i)&&((o=t.value-(r||0))||void 0===r)&&(r=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},Ln=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},On=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Cn=function(e){var t=!1;return function(){t||(e(),t=!0)}},Pn=-1,_n=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Nn=function(e){"hidden"===document.visibilityState&&Pn>-1&&(Pn="visibilitychange"===e.type?e.timeStamp:0,Mn())},An=function(){addEventListener("visibilitychange",Nn,!0),addEventListener("prerenderingchange",Nn,!0)},Mn=function(){removeEventListener("visibilitychange",Nn,!0),removeEventListener("prerenderingchange",Nn,!0)},Dn=function(){return Pn<0&&(Pn=_n(),An(),Tn((function(){setTimeout((function(){Pn=_n(),An()}),0)}))),{get firstHiddenTime(){return Pn}}},jn=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Rn=[1800,3e3],Bn=function(e,t){t=t||{},jn((function(){var n,i=Dn(),r=In("FCP"),o=kn("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-En(),0),r.entries.push(e),n(!0)))}))}));o&&(n=xn(e,r,Rn,t.reportAllChanges),Tn((function(i){r=In("FCP"),n=xn(e,r,Rn,t.reportAllChanges),Ln((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},Un=[.1,.25],Fn=0,zn=1/0,Vn=0,$n=function(e){e.forEach((function(e){e.interactionId&&(zn=Math.min(zn,e.interactionId),Vn=Math.max(Vn,e.interactionId),Fn=Vn?(Vn-zn)/7+1:0)}))},qn=function(){"interactionCount"in performance||mn||(mn=kn("event",$n,{type:"event",buffered:!0,durationThreshold:0}))},Gn=[],Wn=new Map,Hn=0,Kn=function(){return(mn?Fn:performance.interactionCount||0)-Hn},Xn=[],Jn=function(e){if(Xn.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=Gn[Gn.length-1],n=Wn.get(e.interactionId);if(n||Gn.length<10||e.duration>t.latency){if(n)e.duration>n.latency?(n.entries=[e],n.latency=e.duration):e.duration===n.latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Wn.set(i.id,i),Gn.push(i)}Gn.sort((function(e,t){return t.latency-e.latency})),Gn.length>10&&Gn.splice(10).forEach((function(e){return Wn.delete(e.id)}))}}},Zn=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Cn(e),"hidden"===document.visibilityState?e():(n=t(e),On(e)),n},Yn=[200,500],Qn=[],ei=new Map,ti=[],ni=new WeakMap,ii=new Map,ri=-1,oi=function(e){e.forEach((function(e){return Qn.push(e)}))},si=function(){ii.size>10&&ii.forEach((function(e,t){Wn.has(t)||ii.delete(t)})),ti=ti.slice(-50);var e=new Set(ti.concat(Gn.map((function(e){return ni.get(e.entries[0])}))));ei.forEach((function(t,n){e.has(n)||ei.delete(n)}));var t=new Set;ei.forEach((function(e){di(e.startTime,e.processingEnd).forEach((function(e){t.add(e)}))})),Qn=Array.from(t),ri=-1};Xn.push((function(e){e.interactionId&&e.target&&!ii.has(e.interactionId)&&ii.set(e.interactionId,e.target)}),(function(e){for(var t,n=e.startTime+e.duration,i=ti.length-1;i>=0;i--)if(t=ti[i],Math.abs(n-t)<=8){var r=ei.get(t);r.startTime=Math.min(e.startTime,r.startTime),r.processingStart=Math.min(e.processingStart,r.processingStart),r.processingEnd=Math.max(e.processingEnd,r.processingEnd),r.entries.push(e),n=t;break}n!==t&&(ti.push(n),ei.set(n,{startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,entries:[e]})),(e.interactionId||"first-input"===e.entryType)&&ni.set(e,n)}),(function(){ri<0&&(ri=Zn(si))}));var ai,ui,li,ci,di=function(e,t){for(var n,i=[],r=0;n=Qn[r];r++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;i.push(n)}return i},fi=function(e,t){gn||(gn=kn("long-animation-frame",oi)),function(e,t){t=t||{},jn((function(){var n;qn();var i,r=In("INP"),o=function(e){e.forEach(Jn);var t,n=(t=Math.min(Gn.length-1,Math.floor(Kn()/50)),Gn[t]);n&&n.latency!==r.value&&(r.value=n.latency,r.entries=n.entries,i())},s=kn("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=xn(e,r,Yn,t.reportAllChanges),s&&("PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),On((function(){o(s.takeRecords()),i(!0)})),Tn((function(){Hn=0,Gn.length=0,Wn.clear(),r=In("INP"),i=xn(e,r,Yn,t.reportAllChanges)})))}))}((function(t){Zn((function(){var n=function(e){var t=e.entries[0],n=ni.get(t),i=ei.get(n),r=t.processingStart,o=i.processingEnd,s=i.entries.sort((function(e,t){return e.processingStart-t.processingStart})),a=di(t.startTime,o),u=e.entries.find((function(e){return e.target})),l=u&&u.target||ii.get(t.interactionId),c=[t.startTime+t.duration,o].concat(a.map((function(e){return e.startTime+e.duration}))),d=Math.max.apply(Math,c),f={interactionTarget:wn(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:d,processedEventEntries:s,longAnimationFrameEntries:a,inputDelay:r-t.startTime,processingDuration:o-r,presentationDelay:Math.max(d-o,0),loadState:hn(t.startTime)};return Object.assign(e,{attribution:f})}(t);e(n)}))}),t)},pi=[2500,4e3],mi={},gi=[800,1800],vi=function e(t){document.prerendering?jn((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},hi=function(e,t){t=t||{};var n=In("TTFB"),i=xn(e,n,gi,t.reportAllChanges);vi((function(){var r=vn();r&&(n.value=Math.max(r.responseStart-En(),0),n.entries=[r],i(!0),Tn((function(){n=In("TTFB",0),(i=xn(e,n,gi,t.reportAllChanges))(!0)})))}))},bi={passive:!0,capture:!0},wi=new Date,yi=function(e,t){ai||(ai=t,ui=e,li=new Date,Ei(removeEventListener),Si())},Si=function(){if(ui>=0&&ui<li-wi){var e={entryType:"first-input",name:ai.type,target:ai.target,cancelable:ai.cancelable,startTime:ai.timeStamp,processingStart:ai.timeStamp+ui};ci.forEach((function(t){t(e)})),ci=[]}},Ti=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){yi(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,bi),removeEventListener("pointercancel",i,bi)};addEventListener("pointerup",n,bi),addEventListener("pointercancel",i,bi)}(t,e):yi(t,e)}},Ei=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,Ti,bi)}))},Ii=[100,300],ki=function(e,t){!function(e,t){t=t||{},jn((function(){var n,i=Dn(),r=In("FID"),o=function(e){e.startTime<i.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),n(!0))},s=function(e){e.forEach(o)},a=kn("first-input",s);n=xn(e,r,Ii,t.reportAllChanges),a&&(On(Cn((function(){s(a.takeRecords()),a.disconnect()}))),Tn((function(){var i;r=In("FID"),n=xn(e,r,Ii,t.reportAllChanges),ci=[],ui=-1,ai=null,Ei(addEventListener),i=o,ci.push(i),Si()})))}))}((function(t){var n=function(e){var t=e.entries[0],n={eventTarget:wn(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:hn(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)}),t)};const xi="com.grafana.faro.lastNavigationId",Li="load_state",Oi="time_to_first_byte";class Ci{constructor(e){this.corePushMeasurement=e}initialize(){this.measureCLS(),this.measureFCP(),this.measureFID(),this.measureINP(),this.measureLCP(),this.measureTTFB()}measureCLS(){!function(e,t){!function(e,t){t=t||{},Bn(Cn((function(){var n,i=In("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=o[0],n=o[o.length-1];r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,n())},a=kn("layout-shift",s);a&&(n=xn(e,i,Un,t.reportAllChanges),On((function(){s(a.takeRecords()),n(!0)})),Tn((function(){r=0,i=In("CLS",0),n=xn(e,i,Un,t.reportAllChanges),Ln((function(){return n()}))})),setTimeout(n,0))})))}((function(t){var n=function(e){var t,n={};if(e.entries.length){var i=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(i&&i.sources&&i.sources.length){var r=(t=i.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];r&&(n={largestShiftTarget:wn(r.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:r,largestShiftEntry:i,loadState:hn(i.startTime)})}}return Object.assign(e,{attribution:n})}(t);e(n)}),t)}((e=>{const{loadState:t,largestShiftValue:n,largestShiftTime:i,largestShiftTarget:r}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"largest_shift_value",n),this.addIfPresent(o,"largest_shift_time",i);const s=this.buildInitialContext(e);this.addIfPresent(s,Li,t),this.addIfPresent(s,"largest_shift_target",r),this.pushMeasurement(o,s)}))}measureFCP(){!function(e,t){Bn((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:hn(Sn())};if(e.entries.length){var n=vn(),i=e.entries[e.entries.length-1];if(n){var r=n.activationStart||0,o=Math.max(0,n.responseStart-r);t={timeToFirstByte:o,firstByteToFCP:e.value-o,loadState:hn(e.entries[0].startTime),navigationEntry:n,fcpEntry:i}}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{firstByteToFCP:t,timeToFirstByte:n,loadState:i}=e.attribution,r=this.buildInitialValues(e);this.addIfPresent(r,"first_byte_to_fcp",t),this.addIfPresent(r,Oi,n);const o=this.buildInitialContext(e);this.addIfPresent(o,Li,i),this.pushMeasurement(r,o)}))}measureFID(){ki((e=>{const{eventTime:t,eventTarget:n,eventType:i,loadState:r}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"event_time",t);const s=this.buildInitialContext(e);this.addIfPresent(s,"event_target",n),this.addIfPresent(s,"event_type",i),this.addIfPresent(s,Li,r),this.pushMeasurement(o,s)}))}measureINP(){fi((e=>{const{interactionTime:t,presentationDelay:n,inputDelay:i,processingDuration:r,nextPaintTime:o,loadState:s,interactionTarget:a,interactionType:u}=e.attribution,l=this.buildInitialValues(e);this.addIfPresent(l,"interaction_time",t),this.addIfPresent(l,"presentation_delay",n),this.addIfPresent(l,"input_delay",i),this.addIfPresent(l,"processing_duration",r),this.addIfPresent(l,"next_paint_time",o);const c=this.buildInitialContext(e);this.addIfPresent(c,Li,s),this.addIfPresent(c,"interaction_target",a),this.addIfPresent(c,"interaction_type",u),this.pushMeasurement(l,c)}))}measureLCP(){!function(e,t){!function(e,t){t=t||{},jn((function(){var n,i=Dn(),r=In("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-En(),0),r.entries=[e],n())}))},s=kn("largest-contentful-paint",o);if(s){n=xn(e,r,pi,t.reportAllChanges);var a=Cn((function(){mi[r.id]||(o(s.takeRecords()),s.disconnect(),mi[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return Zn(a)}),!0)})),On(a),Tn((function(i){r=In("LCP"),n=xn(e,r,pi,t.reportAllChanges),Ln((function(){r.value=performance.now()-i.timeStamp,mi[r.id]=!0,n(!0)}))}))}}))}((function(t){var n=function(e){var t={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:e.value};if(e.entries.length){var n=vn();if(n){var i=n.activationStart||0,r=e.entries[e.entries.length-1],o=r.url&&performance.getEntriesByType("resource").filter((function(e){return e.name===r.url}))[0],s=Math.max(0,n.responseStart-i),a=Math.max(s,o?(o.requestStart||o.startTime)-i:0),u=Math.max(a,o?o.responseEnd-i:0),l=Math.max(u,r.startTime-i);t={element:wn(r.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:u-a,elementRenderDelay:l-u,navigationEntry:n,lcpEntry:r},r.url&&(t.url=r.url),o&&(t.lcpResourceEntry=o)}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{elementRenderDelay:t,resourceLoadDelay:n,resourceLoadDuration:i,timeToFirstByte:r,element:o}=e.attribution,s=this.buildInitialValues(e);this.addIfPresent(s,"element_render_delay",t),this.addIfPresent(s,"resource_load_delay",n),this.addIfPresent(s,"resource_load_duration",i),this.addIfPresent(s,Oi,r);const a=this.buildInitialContext(e);this.addIfPresent(a,"element",o),this.pushMeasurement(s,a)}))}measureTTFB(){!function(e,t){hi((function(t){var n=function(e){var t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){var n=e.entries[0],i=n.activationStart||0,r=Math.max((n.workerStart||n.fetchStart)-i,0),o=Math.max(n.domainLookupStart-i,0),s=Math.max(n.connectStart-i,0),a=Math.max(n.connectEnd-i,0);t={waitingDuration:r,cacheDuration:o-r,dnsDuration:s-o,connectionDuration:a-s,requestDuration:e.value-a,navigationEntry:n}}return Object.assign(e,{attribution:t})}(t);e(n)}),t)}((e=>{const{dnsDuration:t,connectionDuration:n,requestDuration:i,waitingDuration:r,cacheDuration:o}=e.attribution,s=this.buildInitialValues(e);this.addIfPresent(s,"dns_duration",t),this.addIfPresent(s,"connection_duration",n),this.addIfPresent(s,"request_duration",i),this.addIfPresent(s,"waiting_duration",r),this.addIfPresent(s,"cache_duration",o);const a=this.buildInitialContext(e);this.pushMeasurement(s,a)}))}buildInitialValues(e){const t=e.name.toLowerCase();return{[t]:e.value,delta:e.delta}}buildInitialContext(e){var t;const n=null!==(t=Ie(xi,Te.session))&&void 0!==t?t:me;return{id:e.id,rating:e.rating,navigation_type:e.navigationType,navigation_entry_id:n}}pushMeasurement(e,t){this.corePushMeasurement({type:"web-vitals",values:e},{context:t})}addIfPresent(e,t,n){n&&(e[t]=n)}}class Pi extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=ne}initialize(){this.logDebug("Initializing");this.intializeWebVitalsInstrumentation().initialize()}intializeWebVitalsInstrumentation(){return this.config.trackWebVitalsAttribution?new Ci(this.api.pushMeasurement):new pn(this.api.pushMeasurement)}}function _i(e,t,n,i){return new(n||(n=Promise))((function(r,o){function s(e){try{u(i.next(e))}catch(e){o(e)}}function a(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;const Ni=/^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/;function Ai(e=[]){for(const t of e)if("traceparent"===t.name){if(!Ni.test(t.description))continue;const[,e,n]=t.description.split("-");if(null!=e&&null!=n)return{traceId:e,spanId:n};break}}function Mi(e=[],t){return e.some((e=>e&&null!=t.match(e)))}function Di(e,t={}){for(const[n,i]of Object.entries(t)){const t=e[n];return null!=t&&(l(i)?i.includes(t):t===i)}return!0}function ji(e){const{connectEnd:t,connectStart:n,decodedBodySize:i,domainLookupEnd:r,domainLookupStart:o,duration:s,encodedBodySize:a,fetchStart:u,initiatorType:l,name:c,nextHopProtocol:d,redirectEnd:f,redirectStart:p,renderBlockingStatus:m,requestStart:g,responseEnd:v,responseStart:h,responseStatus:b,secureConnectionStart:w,transferSize:y,workerStart:S}=e;return{name:c,duration:Bi(s),tcpHandshakeTime:Bi(t-n),dnsLookupTime:Bi(r-o),tlsNegotiationTime:Bi(g-w),responseStatus:Bi(b),redirectTime:Bi(f-p),requestTime:Bi(h-g),responseTime:Bi(v-h),fetchTime:Bi(v-u),serviceWorkerTime:Bi(u-S),decodedBodySize:Bi(i),encodedBodySize:Bi(a),cacheHitStatus:function(){let e="fullLoad";0===y?i>0&&(e="cache"):null!=b?304===b&&(e="conditionalFetch"):a>0&&y<a&&(e="conditionalFetch");return e}(),renderBlockingStatus:Bi(m),protocol:d,initiatorType:l,visibilityState:document.visibilityState,ttfb:Bi(h-g)}}function Ri(e){const{activationStart:t,domComplete:n,domContentLoadedEventEnd:i,domContentLoadedEventStart:r,domInteractive:o,fetchStart:s,loadEventEnd:a,loadEventStart:u,responseStart:l,type:c}=e,d=function(){var e;if(null!=(null===(e=performance.timing)||void 0===e?void 0:e.domLoading))return performance.timing.domLoading-performance.timeOrigin;return null}();return Object.assign(Object.assign({},ji(e)),{pageLoadTime:Bi(n-s),documentParsingTime:Bi(d?o-d:null),domProcessingTime:Bi(n-o),domContentLoadHandlerTime:Bi(i-r),onLoadTime:Bi(a-u),ttfb:Bi(Math.max(l-(null!=t?t:0),0)),type:c})}function Bi(e){return null==e?me:"number"==typeof e?Math.round(e).toString():e.toString()}const Ui={initiatorType:["xmlhttprequest","fetch"]};class Fi extends te{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-performance",this.version=ne}initialize(){"PerformanceObserver"in window?function(e){if("complete"===document.readyState)e();else{const t=()=>{"complete"===document.readyState&&(e(),document.removeEventListener("readystatechange",t))};document.addEventListener("readystatechange",t)}}((()=>_i(this,void 0,void 0,(function*(){const t=this.api.pushEvent,n=this.getIgnoreUrls(),{faroNavigationId:i}=yield function(e,t){let n;const i=new Promise((e=>{n=e}));return new PerformanceObserver((i=>{var r;const[o]=i.getEntries();if(null==o||Mi(t,o.name))return;const s=o.toJSON();let a=Ai(null==s?void 0:s.serverTiming);const u=null!==(r=Ie(xi,Te.session))&&void 0!==r?r:me,l=Object.assign(Object.assign({},Ri(s)),{faroNavigationId:P(),faroPreviousNavigationId:u});ke(xi,l.faroNavigationId,Te.session),e("faro.performance.navigation",l,void 0,{spanContext:a,timestampOverwriteMs:performance.timeOrigin+s.startTime}),n(l)})).observe({type:"navigation",buffered:!0}),i}(t,n);null!=i&&function(t,n,i){const r=e.faro.config.trackResources;new PerformanceObserver((e=>{const o=e.getEntries();for(const e of o){if(Mi(i,e.name))return;const o=e.toJSON();let s=Ai(null==o?void 0:o.serverTiming);if(null==r&&Di(o,Ui)||r){const e=Object.assign(Object.assign({},ji(o)),{faroNavigationId:t,faroResourceId:P()});n("faro.performance.resource",e,void 0,{spanContext:s,timestampOverwriteMs:performance.timeOrigin+o.startTime})}}})).observe({type:"resource",buffered:!0})}(i,t,n)})))):this.logDebug("performance observer not supported. Disable performance instrumentation.")}getIgnoreUrls(){var e;return null===(e=this.transports.transports)||void 0===e?void 0:e.flatMap((e=>e.getIgnoreUrls()))}}function zi(e={}){const t=[new bt,new Pi,new Ge,new wt];return!1!==e.enablePerformanceInstrumentation&&t.unshift(new Fi),!1!==e.captureConsole&&t.push(new We({disabledLevels:e.captureConsoleDisabledLevels})),t}const Vi="browser",$i=()=>{const e=window.k6;return{k6:Object.assign({isK6Browser:!0},(null==e?void 0:e.testRunId)&&{testRunId:null==e?void 0:e.testRunId})}};class qi extends H{constructor(e){var t,n,i,r;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=ne,this.disabledUntil=new Date,this.rateLimitBackoffMs=null!==(t=e.defaultRateLimitBackoffMs)&&void 0!==t?t:5e3,this.getNow=null!==(n=e.getNow)&&void 0!==n?n:()=>Date.now(),this.promiseBuffer=O({size:null!==(i=e.bufferSize)&&void 0!==i?i:30,concurrency:null!==(r=e.concurrency)&&void 0!==r?r:5})}send(e){return _i(this,void 0,void 0,(function*(){try{if(this.disabledUntil>new Date(this.getNow()))return this.logWarn(`Dropping transport item due to too many requests. Backoff until ${this.disabledUntil}`),Promise.resolve();yield this.promiseBuffer.add((()=>{const t=JSON.stringify(X(e)),{url:n,requestOptions:i,apiKey:r}=this.options,o=null!=i?i:{},{headers:s}=o,a=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}(o,["headers"]);let u;const l=this.metas.value.session;return null!=l&&(u=l.id),fetch(n,Object.assign({method:"POST",headers:Object.assign(Object.assign(Object.assign({"Content-Type":"application/json"},null!=s?s:{}),r?{"x-api-key":r}:{}),u?{"x-faro-session-id":u}:{}),body:t,keepalive:t.length<=6e4},null!=a?a:{})).then((e=>_i(this,void 0,void 0,(function*(){if(202===e.status){"invalid"===e.headers.get("X-Faro-Session-Status")&&this.extendFaroSession(this.config,this.logDebug)}return 429===e.status&&(this.disabledUntil=this.getRetryAfterDate(e),this.logWarn(`Too many requests, backing off until ${this.disabledUntil}`)),e.text().catch(L),e})))).catch((e=>{this.logError("Failed sending payload to the receiver\n",JSON.parse(t),e)}))}))}catch(e){this.logError(e)}}))}getIgnoreUrls(){var e;return[this.options.url].concat(null!==(e=this.config.ignoreUrls)&&void 0!==e?e:[])}isBatched(){return!0}getRetryAfterDate(e){const t=this.getNow(),n=e.headers.get("Retry-After");if(n){const e=Number(n);if(!isNaN(e))return new Date(1e3*e+t);const i=Date.parse(n);if(!isNaN(i))return new Date(i)}return new Date(t+this.rateLimitBackoffMs)}extendFaroSession(e,t){const n="Session expired",i=e.sessionTracking;if(null==i?void 0:i.enabled){const{fetchUserSession:e,storeUserSession:r}=qe(i);Fe({fetchUserSession:e,storeUserSession:r})({forceSessionExtend:!0}),t(`${n} created new session.`)}else t(`${n}.`)}}function Gi(e){var t,n,i,r,o,s,u,l,c,d;const f=[],p=$(e.unpatchedConsole,e.internalLoggerLevel);e.transports?((e.url||e.apiKey)&&p.error('if "transports" is defined, "url" and "apiKey" should not be defined'),f.push(...e.transports)):e.url?f.push(new qi({url:e.url,apiKey:e.apiKey})):p.error('either "url" or "transports" must be defined');return{app:e.app,batching:Object.assign(Object.assign({},le),e.batching),dedupe:null===(t=e.dedupe)||void 0===t||t,globalObjectKey:e.globalObjectKey||ue,instrumentations:null!==(n=e.instrumentations)&&void 0!==n?n:zi(),internalLoggerLevel:null!==(i=e.internalLoggerLevel)&&void 0!==i?i:U,isolate:null!==(r=e.isolate)&&void 0!==r&&r,logArgsSerializer:null!==(o=e.logArgsSerializer)&&void 0!==o?o:Q,metas:function(){const t=ye;return e.metas&&t.push(...e.metas),a(window.k6)?[...t,$i]:t}(),parseStacktrace:gt,paused:null!==(s=e.paused)&&void 0!==s&&s,preventGlobalExposure:null!==(u=e.preventGlobalExposure)&&void 0!==u&&u,transports:f,unpatchedConsole:null!==(l=e.unpatchedConsole)&&void 0!==l?l:F,beforeSend:e.beforeSend,eventDomain:null!==(c=e.eventDomain)&&void 0!==c?c:Vi,ignoreErrors:e.ignoreErrors,ignoreUrls:(null!==(d=e.ignoreUrls)&&void 0!==d?d:[]).concat([/\/collect(?:\/[\w]*)?$/]),sessionTracking:Object.assign(Object.assign({},Re),e.sessionTracking),user:e.user,view:e.view,trackResources:e.trackResources,trackWebVitalsAttribution:e.trackWebVitalsAttribution,consoleInstrumentation:e.consoleInstrumentation}}return e.BaseExtension=W,e.BaseInstrumentation=te,e.BaseTransport=H,e.ConsoleInstrumentation=We,e.ConsoleTransport=class extends H{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-console",this.version=ne}send(t){var n;return this.unpatchedConsole[null!==(n=this.options.level)&&void 0!==n?n:e.LogLevel.DEBUG]("New event",X([t]))}},e.Conventions={EventNames:{CLICK:"click",NAVIGATION:"navigation",SESSION_START:"session_start",VIEW_CHANGED:"view_changed"}},e.EVENT_CLICK="click",e.EVENT_NAVIGATION="navigation",e.EVENT_ROUTE_CHANGE="route_change",e.EVENT_SESSION_EXTEND=pe,e.EVENT_SESSION_RESUME=fe,e.EVENT_SESSION_START=de,e.EVENT_VIEW_CHANGED=ce,e.ErrorsInstrumentation=bt,e.FetchTransport=qi,e.MAX_SESSION_PERSISTENCE_TIME=je,e.MAX_SESSION_PERSISTENCE_TIME_BUFFER=6e4,e.PerformanceInstrumentation=Fi,e.PersistentSessionsManager=Ve,e.SESSION_EXPIRATION_TIME=Me,e.SESSION_INACTIVITY_TIME=De,e.STORAGE_KEY=Ae,e.SessionInstrumentation=Ge,e.VERSION=ne,e.ViewInstrumentation=wt,e.VolatileSessionsManager=$e,e.WebVitalsInstrumentation=Pi,e.allLogLevels=x,e.browserMeta=be,e.buildStackFrame=ft,e.createInternalLogger=$,e.createPromiseBuffer=O,e.createSession=Se,e.deepEqual=y,e.defaultEventDomain=Vi,e.defaultExceptionType=J,e.defaultGlobalObjectKey=ue,e.defaultInternalLoggerLevel=U,e.defaultLogLevel=k,e.defaultMetas=ye,e.genShortID=P,e.getCurrentTimestamp=T,e.getDataFromSafariExtensions=pt,e.getIgnoreUrls=function(){return e.faro.transports.transports.flatMap((e=>e.getIgnoreUrls()))},e.getInternalFaroFromGlobalObject=function(){return _[ie]},e.getStackFramesFromError=mt,e.getTransportBody=X,e.getWebInstrumentations=zi,e.globalObject=_,e.initializeFaro=function(e){const t=Gi(e);if(t)return ae(t)},e.internalGlobalObjectKey=ie,e.isArray=l,e.isBoolean=e=>t(e,"boolean"),e.isDomError=v,e.isDomException=h,e.isElement=e=>b&&i(e,Element),e.isElementDefined=b,e.isError=m,e.isErrorDefined=p,e.isErrorEvent=g,e.isEvent=f,e.isEventDefined=d,e.isFunction=u,e.isInstanceOf=i,e.isInt=e=>s(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=oe,e.isMap=e=>w&&i(e,Map),e.isMapDefined=w,e.isNull=r,e.isNumber=s,e.isObject=a,e.isPrimitive=c,e.isRegExp=e=>n(e,"RegExp"),e.isString=o,e.isSymbol=e=>t(e,"symbol"),e.isSyntheticEvent=e=>a(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>u(null==e?void 0:e.then),e.isToString=n,e.isTypeof=t,e.isUndefined=e=>t(e,"undefined"),e.makeCoreConfig=Gi,e.noop=L,e.pageMeta=we,e.parseStacktrace=gt,e.sdkMeta=()=>({sdk:{name:"@grafana/faro-core",version:ne,integrations:e.faro.config.instrumentations.map((({name:e,version:t})=>({name:e,version:t})))}}),e.setInternalFaroOnGlobalObject=re,e.transportItemTypeToBodyKey=M,e}({});
@@ -3,7 +3,7 @@ import type { ConsoleInstrumentationOptions } from './types';
3
3
  export declare class ConsoleInstrumentation extends BaseInstrumentation {
4
4
  private options;
5
5
  readonly name = "@grafana/faro-web-sdk:instrumentation-console";
6
- readonly version = "1.12.1";
6
+ readonly version = "1.12.2";
7
7
  static defaultDisabledLevels: LogLevel[];
8
8
  constructor(options?: ConsoleInstrumentationOptions);
9
9
  initialize(): void;
@@ -1,6 +1,6 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class ErrorsInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-errors";
4
- readonly version = "1.12.1";
4
+ readonly version = "1.12.2";
5
5
  initialize(): void;
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class PerformanceInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-performance";
4
- readonly version = "1.12.1";
4
+ readonly version = "1.12.2";
5
5
  initialize(): void;
6
6
  private getIgnoreUrls;
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class SessionInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-session";
4
- readonly version = "1.12.1";
4
+ readonly version = "1.12.2";
5
5
  private notifiedSession;
6
6
  private sendSessionStartEvent;
7
7
  private createInitialSession;
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class ViewInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-view";
4
- readonly version = "1.12.1";
4
+ readonly version = "1.12.2";
5
5
  private notifiedView;
6
6
  private sendViewChangedEvent;
7
7
  initialize(): void;
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class WebVitalsInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-web-vitals";
4
- readonly version = "1.12.1";
4
+ readonly version = "1.12.2";
5
5
  initialize(): void;
6
6
  private intializeWebVitalsInstrumentation;
7
7
  }
@@ -4,7 +4,7 @@ import type { ConsoleTransportOptions } from './types';
4
4
  export declare class ConsoleTransport extends BaseTransport {
5
5
  private options;
6
6
  readonly name = "@grafana/faro-web-sdk:transport-console";
7
- readonly version = "1.12.1";
7
+ readonly version = "1.12.2";
8
8
  constructor(options?: ConsoleTransportOptions);
9
9
  send(item: TransportItem): void;
10
10
  }
@@ -4,7 +4,7 @@ import type { FetchTransportOptions } from './types';
4
4
  export declare class FetchTransport extends BaseTransport {
5
5
  private options;
6
6
  readonly name = "@grafana/faro-web-sdk:transport-fetch";
7
- readonly version = "1.12.1";
7
+ readonly version = "1.12.2";
8
8
  promiseBuffer: PromiseBuffer<Response | void>;
9
9
  private readonly rateLimitBackoffMs;
10
10
  private readonly getNow;
@@ -28,7 +28,6 @@ var __assign = (this && this.__assign) || function () {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.ConsoleInstrumentation = void 0;
30
30
  var faro_core_1 = require("@grafana/faro-core");
31
- var utils_1 = require("../../utils");
32
31
  var ConsoleInstrumentation = /** @class */ (function (_super) {
33
32
  __extends(ConsoleInstrumentation, _super);
34
33
  function ConsoleInstrumentation(options) {
@@ -56,10 +55,10 @@ var ConsoleInstrumentation = /** @class */ (function (_super) {
56
55
  }
57
56
  try {
58
57
  if (level === faro_core_1.LogLevel.ERROR && !((_b = _this.options) === null || _b === void 0 ? void 0 : _b.consoleErrorAsLog)) {
59
- _this.api.pushError(new Error('console.error: ' + formatConsoleArgs(args)));
58
+ _this.api.pushError(new Error('console.error: ' + (0, faro_core_1.defaultLogArgsSerializer)(args)));
60
59
  }
61
60
  else {
62
- _this.api.pushLog([formatConsoleArgs(args)], { level: level });
61
+ _this.api.pushLog(args, { level: level });
63
62
  }
64
63
  }
65
64
  catch (err) {
@@ -75,7 +74,4 @@ var ConsoleInstrumentation = /** @class */ (function (_super) {
75
74
  return ConsoleInstrumentation;
76
75
  }(faro_core_1.BaseInstrumentation));
77
76
  exports.ConsoleInstrumentation = ConsoleInstrumentation;
78
- function formatConsoleArgs(args) {
79
- return args.map(function (arg) { return ((0, faro_core_1.isObject)(arg) || (0, faro_core_1.isArray)(arg) ? (0, utils_1.stringifyExternalJson)(arg) : arg); }).join(' ');
80
- }
81
77
  //# sourceMappingURL=instrumentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../../../src/instrumentations/console/instrumentation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA6G;AAE7G,qCAAoD;AAIpD;IAA4C,0CAAmB;IAM7D,gCAAoB,OAA2C;QAA3C,wBAAA,EAAA,YAA2C;QAA/D,YACE,iBAAO,SACR;QAFmB,aAAO,GAAP,OAAO,CAAoC;QALtD,UAAI,GAAG,+CAA+C,CAAC;QACvD,aAAO,GAAG,mBAAO,CAAC;;IAM3B,CAAC;IAED,2CAAU,GAAV;QAAA,iBAwBC;QAvBC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,yBAAQ,IAAI,CAAC,OAAO,GAAK,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAE,CAAC;QAE1E,wBAAY;aACT,MAAM,CACL,UAAC,KAAK,gBAAK,OAAA,CAAC,CAAC,MAAA,MAAA,KAAI,CAAC,OAAO,0CAAE,cAAc,mCAAI,sBAAsB,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA,EAAA,CAC3G;aACA,OAAO,CAAC,UAAC,KAAK;YACb,yCAAyC;YACzC,OAAO,CAAC,KAAK,CAAC,GAAG;;;gBAAC,cAAO;qBAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;oBAAP,yBAAO;;gBACvB,IAAI;oBACF,IAAI,KAAK,KAAK,oBAAQ,CAAC,KAAK,IAAI,CAAC,CAAA,MAAA,KAAI,CAAC,OAAO,0CAAE,iBAAiB,CAAA,EAAE;wBAChE,KAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;qBAC5E;yBAAM;wBACL,KAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,KAAK,OAAA,EAAE,CAAC,CAAC;qBACxD;iBACF;gBAAC,OAAO,GAAG,EAAE;oBACZ,KAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;iBACpB;wBAAS;oBACR,CAAA,KAAA,KAAI,CAAC,gBAAgB,CAAA,CAAC,KAAK,CAAC,WAAI,IAAI,EAAE;iBACvC;YACH,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACP,CAAC;IA9BM,4CAAqB,GAAe,CAAC,oBAAQ,CAAC,KAAK,EAAE,oBAAQ,CAAC,KAAK,EAAE,oBAAQ,CAAC,GAAG,CAAC,CAAC;IA+B5F,6BAAC;CAAA,AAnCD,CAA4C,+BAAmB,GAmC9D;AAnCY,wDAAsB;AAqCnC,SAAS,iBAAiB,CAAC,IAAsB;IAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,UAAC,GAAG,IAAK,OAAA,CAAC,IAAA,oBAAQ,EAAC,GAAG,CAAC,IAAI,IAAA,mBAAO,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAA,6BAAqB,EAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAlE,CAAkE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzG,CAAC","sourcesContent":["import { allLogLevels, BaseInstrumentation, isArray, isObject, LogLevel, VERSION } from '@grafana/faro-core';\n\nimport { stringifyExternalJson } from '../../utils';\n\nimport type { ConsoleInstrumentationOptions } from './types';\n\nexport class ConsoleInstrumentation extends BaseInstrumentation {\n readonly name = '@grafana/faro-web-sdk:instrumentation-console';\n readonly version = VERSION;\n\n static defaultDisabledLevels: LogLevel[] = [LogLevel.DEBUG, LogLevel.TRACE, LogLevel.LOG];\n\n constructor(private options: ConsoleInstrumentationOptions = {}) {\n super();\n }\n\n initialize() {\n this.logDebug('Initializing\\n', this.options);\n this.options = { ...this.options, ...this.config.consoleInstrumentation };\n\n allLogLevels\n .filter(\n (level) => !(this.options?.disabledLevels ?? ConsoleInstrumentation.defaultDisabledLevels).includes(level)\n )\n .forEach((level) => {\n /* eslint-disable-next-line no-console */\n console[level] = (...args) => {\n try {\n if (level === LogLevel.ERROR && !this.options?.consoleErrorAsLog) {\n this.api.pushError(new Error('console.error: ' + formatConsoleArgs(args)));\n } else {\n this.api.pushLog([formatConsoleArgs(args)], { level });\n }\n } catch (err) {\n this.logError(err);\n } finally {\n this.unpatchedConsole[level](...args);\n }\n };\n });\n }\n}\n\nfunction formatConsoleArgs(args: [any?, ...any[]]) {\n return args.map((arg) => (isObject(arg) || isArray(arg) ? stringifyExternalJson(arg) : arg)).join(' ');\n}\n"]}
1
+ {"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../../../src/instrumentations/console/instrumentation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAoH;AAIpH;IAA4C,0CAAmB;IAM7D,gCAAoB,OAA2C;QAA3C,wBAAA,EAAA,YAA2C;QAA/D,YACE,iBAAO,SACR;QAFmB,aAAO,GAAP,OAAO,CAAoC;QALtD,UAAI,GAAG,+CAA+C,CAAC;QACvD,aAAO,GAAG,mBAAO,CAAC;;IAM3B,CAAC;IAED,2CAAU,GAAV;QAAA,iBAwBC;QAvBC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,yBAAQ,IAAI,CAAC,OAAO,GAAK,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAE,CAAC;QAE1E,wBAAY;aACT,MAAM,CACL,UAAC,KAAK,gBAAK,OAAA,CAAC,CAAC,MAAA,MAAA,KAAI,CAAC,OAAO,0CAAE,cAAc,mCAAI,sBAAsB,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA,EAAA,CAC3G;aACA,OAAO,CAAC,UAAC,KAAK;YACb,yCAAyC;YACzC,OAAO,CAAC,KAAK,CAAC,GAAG;;;gBAAC,cAAO;qBAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;oBAAP,yBAAO;;gBACvB,IAAI;oBACF,IAAI,KAAK,KAAK,oBAAQ,CAAC,KAAK,IAAI,CAAC,CAAA,MAAA,KAAI,CAAC,OAAO,0CAAE,iBAAiB,CAAA,EAAE;wBAChE,KAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,iBAAiB,GAAG,IAAA,oCAAwB,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC;qBACnF;yBAAM;wBACL,KAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,OAAA,EAAE,CAAC,CAAC;qBACnC;iBACF;gBAAC,OAAO,GAAG,EAAE;oBACZ,KAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;iBACpB;wBAAS;oBACR,CAAA,KAAA,KAAI,CAAC,gBAAgB,CAAA,CAAC,KAAK,CAAC,WAAI,IAAI,EAAE;iBACvC;YACH,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACP,CAAC;IA9BM,4CAAqB,GAAe,CAAC,oBAAQ,CAAC,KAAK,EAAE,oBAAQ,CAAC,KAAK,EAAE,oBAAQ,CAAC,GAAG,CAAC,CAAC;IA+B5F,6BAAC;CAAA,AAnCD,CAA4C,+BAAmB,GAmC9D;AAnCY,wDAAsB","sourcesContent":["import { allLogLevels, BaseInstrumentation, defaultLogArgsSerializer, LogLevel, VERSION } from '@grafana/faro-core';\n\nimport type { ConsoleInstrumentationOptions } from './types';\n\nexport class ConsoleInstrumentation extends BaseInstrumentation {\n readonly name = '@grafana/faro-web-sdk:instrumentation-console';\n readonly version = VERSION;\n\n static defaultDisabledLevels: LogLevel[] = [LogLevel.DEBUG, LogLevel.TRACE, LogLevel.LOG];\n\n constructor(private options: ConsoleInstrumentationOptions = {}) {\n super();\n }\n\n initialize() {\n this.logDebug('Initializing\\n', this.options);\n this.options = { ...this.options, ...this.config.consoleInstrumentation };\n\n allLogLevels\n .filter(\n (level) => !(this.options?.disabledLevels ?? ConsoleInstrumentation.defaultDisabledLevels).includes(level)\n )\n .forEach((level) => {\n /* eslint-disable-next-line no-console */\n console[level] = (...args) => {\n try {\n if (level === LogLevel.ERROR && !this.options?.consoleErrorAsLog) {\n this.api.pushError(new Error('console.error: ' + defaultLogArgsSerializer(args)));\n } else {\n this.api.pushLog(args, { level });\n }\n } catch (err) {\n this.logError(err);\n } finally {\n this.unpatchedConsole[level](...args);\n }\n };\n });\n }\n}\n"]}
@@ -1,5 +1,4 @@
1
- import { allLogLevels, BaseInstrumentation, isArray, isObject, LogLevel, VERSION } from '@grafana/faro-core';
2
- import { stringifyExternalJson } from '../../utils';
1
+ import { allLogLevels, BaseInstrumentation, defaultLogArgsSerializer, LogLevel, VERSION } from '@grafana/faro-core';
3
2
  export class ConsoleInstrumentation extends BaseInstrumentation {
4
3
  constructor(options = {}) {
5
4
  super();
@@ -18,10 +17,10 @@ export class ConsoleInstrumentation extends BaseInstrumentation {
18
17
  var _a;
19
18
  try {
20
19
  if (level === LogLevel.ERROR && !((_a = this.options) === null || _a === void 0 ? void 0 : _a.consoleErrorAsLog)) {
21
- this.api.pushError(new Error('console.error: ' + formatConsoleArgs(args)));
20
+ this.api.pushError(new Error('console.error: ' + defaultLogArgsSerializer(args)));
22
21
  }
23
22
  else {
24
- this.api.pushLog([formatConsoleArgs(args)], { level });
23
+ this.api.pushLog(args, { level });
25
24
  }
26
25
  }
27
26
  catch (err) {
@@ -35,7 +34,4 @@ export class ConsoleInstrumentation extends BaseInstrumentation {
35
34
  }
36
35
  }
37
36
  ConsoleInstrumentation.defaultDisabledLevels = [LogLevel.DEBUG, LogLevel.TRACE, LogLevel.LOG];
38
- function formatConsoleArgs(args) {
39
- return args.map((arg) => (isObject(arg) || isArray(arg) ? stringifyExternalJson(arg) : arg)).join(' ');
40
- }
41
37
  //# sourceMappingURL=instrumentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../../../src/instrumentations/console/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7G,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAIpD,MAAM,OAAO,sBAAuB,SAAQ,mBAAmB;IAM7D,YAAoB,UAAyC,EAAE;QAC7D,KAAK,EAAE,CAAC;QADU,YAAO,GAAP,OAAO,CAAoC;QALtD,SAAI,GAAG,+CAA+C,CAAC;QACvD,YAAO,GAAG,OAAO,CAAC;IAM3B,CAAC;IAED,UAAU;QACR,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,mCAAQ,IAAI,CAAC,OAAO,GAAK,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAE,CAAC;QAE1E,YAAY;aACT,MAAM,CACL,CAAC,KAAK,EAAE,EAAE,eAAC,OAAA,CAAC,CAAC,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,cAAc,mCAAI,sBAAsB,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA,EAAA,CAC3G;aACA,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACjB,yCAAyC;YACzC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE;;gBAC3B,IAAI;oBACF,IAAI,KAAK,KAAK,QAAQ,CAAC,KAAK,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,iBAAiB,CAAA,EAAE;wBAChE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;qBAC5E;yBAAM;wBACL,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;qBACxD;iBACF;gBAAC,OAAO,GAAG,EAAE;oBACZ,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;iBACpB;wBAAS;oBACR,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;iBACvC;YACH,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACP,CAAC;;AA9BM,4CAAqB,GAAe,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;AAiC5F,SAAS,iBAAiB,CAAC,IAAsB;IAC/C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzG,CAAC","sourcesContent":["import { allLogLevels, BaseInstrumentation, isArray, isObject, LogLevel, VERSION } from '@grafana/faro-core';\n\nimport { stringifyExternalJson } from '../../utils';\n\nimport type { ConsoleInstrumentationOptions } from './types';\n\nexport class ConsoleInstrumentation extends BaseInstrumentation {\n readonly name = '@grafana/faro-web-sdk:instrumentation-console';\n readonly version = VERSION;\n\n static defaultDisabledLevels: LogLevel[] = [LogLevel.DEBUG, LogLevel.TRACE, LogLevel.LOG];\n\n constructor(private options: ConsoleInstrumentationOptions = {}) {\n super();\n }\n\n initialize() {\n this.logDebug('Initializing\\n', this.options);\n this.options = { ...this.options, ...this.config.consoleInstrumentation };\n\n allLogLevels\n .filter(\n (level) => !(this.options?.disabledLevels ?? ConsoleInstrumentation.defaultDisabledLevels).includes(level)\n )\n .forEach((level) => {\n /* eslint-disable-next-line no-console */\n console[level] = (...args) => {\n try {\n if (level === LogLevel.ERROR && !this.options?.consoleErrorAsLog) {\n this.api.pushError(new Error('console.error: ' + formatConsoleArgs(args)));\n } else {\n this.api.pushLog([formatConsoleArgs(args)], { level });\n }\n } catch (err) {\n this.logError(err);\n } finally {\n this.unpatchedConsole[level](...args);\n }\n };\n });\n }\n}\n\nfunction formatConsoleArgs(args: [any?, ...any[]]) {\n return args.map((arg) => (isObject(arg) || isArray(arg) ? stringifyExternalJson(arg) : arg)).join(' ');\n}\n"]}
1
+ {"version":3,"file":"instrumentation.js","sourceRoot":"","sources":["../../../../src/instrumentations/console/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAIpH,MAAM,OAAO,sBAAuB,SAAQ,mBAAmB;IAM7D,YAAoB,UAAyC,EAAE;QAC7D,KAAK,EAAE,CAAC;QADU,YAAO,GAAP,OAAO,CAAoC;QALtD,SAAI,GAAG,+CAA+C,CAAC;QACvD,YAAO,GAAG,OAAO,CAAC;IAM3B,CAAC;IAED,UAAU;QACR,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9C,IAAI,CAAC,OAAO,mCAAQ,IAAI,CAAC,OAAO,GAAK,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAE,CAAC;QAE1E,YAAY;aACT,MAAM,CACL,CAAC,KAAK,EAAE,EAAE,eAAC,OAAA,CAAC,CAAC,MAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,cAAc,mCAAI,sBAAsB,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA,EAAA,CAC3G;aACA,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACjB,yCAAyC;YACzC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE;;gBAC3B,IAAI;oBACF,IAAI,KAAK,KAAK,QAAQ,CAAC,KAAK,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,OAAO,0CAAE,iBAAiB,CAAA,EAAE;wBAChE,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,iBAAiB,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;qBACnF;yBAAM;wBACL,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;qBACnC;iBACF;gBAAC,OAAO,GAAG,EAAE;oBACZ,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;iBACpB;wBAAS;oBACR,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;iBACvC;YACH,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACP,CAAC;;AA9BM,4CAAqB,GAAe,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC","sourcesContent":["import { allLogLevels, BaseInstrumentation, defaultLogArgsSerializer, LogLevel, VERSION } from '@grafana/faro-core';\n\nimport type { ConsoleInstrumentationOptions } from './types';\n\nexport class ConsoleInstrumentation extends BaseInstrumentation {\n readonly name = '@grafana/faro-web-sdk:instrumentation-console';\n readonly version = VERSION;\n\n static defaultDisabledLevels: LogLevel[] = [LogLevel.DEBUG, LogLevel.TRACE, LogLevel.LOG];\n\n constructor(private options: ConsoleInstrumentationOptions = {}) {\n super();\n }\n\n initialize() {\n this.logDebug('Initializing\\n', this.options);\n this.options = { ...this.options, ...this.config.consoleInstrumentation };\n\n allLogLevels\n .filter(\n (level) => !(this.options?.disabledLevels ?? ConsoleInstrumentation.defaultDisabledLevels).includes(level)\n )\n .forEach((level) => {\n /* eslint-disable-next-line no-console */\n console[level] = (...args) => {\n try {\n if (level === LogLevel.ERROR && !this.options?.consoleErrorAsLog) {\n this.api.pushError(new Error('console.error: ' + defaultLogArgsSerializer(args)));\n } else {\n this.api.pushLog(args, { level });\n }\n } catch (err) {\n this.logError(err);\n } finally {\n this.unpatchedConsole[level](...args);\n }\n };\n });\n }\n}\n"]}
@@ -3,7 +3,7 @@ import type { ConsoleInstrumentationOptions } from './types';
3
3
  export declare class ConsoleInstrumentation extends BaseInstrumentation {
4
4
  private options;
5
5
  readonly name = "@grafana/faro-web-sdk:instrumentation-console";
6
- readonly version = "1.12.1";
6
+ readonly version = "1.12.2";
7
7
  static defaultDisabledLevels: LogLevel[];
8
8
  constructor(options?: ConsoleInstrumentationOptions);
9
9
  initialize(): void;
@@ -1,6 +1,6 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class ErrorsInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-errors";
4
- readonly version = "1.12.1";
4
+ readonly version = "1.12.2";
5
5
  initialize(): void;
6
6
  }
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class PerformanceInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-performance";
4
- readonly version = "1.12.1";
4
+ readonly version = "1.12.2";
5
5
  initialize(): void;
6
6
  private getIgnoreUrls;
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class SessionInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-session";
4
- readonly version = "1.12.1";
4
+ readonly version = "1.12.2";
5
5
  private notifiedSession;
6
6
  private sendSessionStartEvent;
7
7
  private createInitialSession;
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class ViewInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-view";
4
- readonly version = "1.12.1";
4
+ readonly version = "1.12.2";
5
5
  private notifiedView;
6
6
  private sendViewChangedEvent;
7
7
  initialize(): void;
@@ -1,7 +1,7 @@
1
1
  import { BaseInstrumentation } from '@grafana/faro-core';
2
2
  export declare class WebVitalsInstrumentation extends BaseInstrumentation {
3
3
  readonly name = "@grafana/faro-web-sdk:instrumentation-web-vitals";
4
- readonly version = "1.12.1";
4
+ readonly version = "1.12.2";
5
5
  initialize(): void;
6
6
  private intializeWebVitalsInstrumentation;
7
7
  }
@@ -4,7 +4,7 @@ import type { ConsoleTransportOptions } from './types';
4
4
  export declare class ConsoleTransport extends BaseTransport {
5
5
  private options;
6
6
  readonly name = "@grafana/faro-web-sdk:transport-console";
7
- readonly version = "1.12.1";
7
+ readonly version = "1.12.2";
8
8
  constructor(options?: ConsoleTransportOptions);
9
9
  send(item: TransportItem): void;
10
10
  }
@@ -4,7 +4,7 @@ import type { FetchTransportOptions } from './types';
4
4
  export declare class FetchTransport extends BaseTransport {
5
5
  private options;
6
6
  readonly name = "@grafana/faro-web-sdk:transport-fetch";
7
- readonly version = "1.12.1";
7
+ readonly version = "1.12.2";
8
8
  promiseBuffer: PromiseBuffer<Response | void>;
9
9
  private readonly rateLimitBackoffMs;
10
10
  private readonly getNow;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/faro-web-sdk",
3
- "version": "1.12.1",
3
+ "version": "1.12.2",
4
4
  "description": "Faro instrumentations, metas, transports for web.",
5
5
  "keywords": [
6
6
  "observability",
@@ -52,7 +52,7 @@
52
52
  "quality:circular-deps": "madge --circular ."
53
53
  },
54
54
  "dependencies": {
55
- "@grafana/faro-core": "^1.12.1",
55
+ "@grafana/faro-core": "^1.12.2",
56
56
  "ua-parser-js": "^1.0.32",
57
57
  "web-vitals": "^4.0.1"
58
58
  },
@@ -63,5 +63,5 @@
63
63
  "publishConfig": {
64
64
  "access": "public"
65
65
  },
66
- "gitHead": "6d6b06892399e281df87c7b9d4f055464e649073"
66
+ "gitHead": "f71b569b84d6aaa7d1cfe51d24ab0b6387d03812"
67
67
  }