@grafana/faro-web-sdk 1.14.1 → 1.14.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.
- package/dist/bundle/faro-web-sdk.iife.js +1 -1
- package/dist/bundle/types/index.d.ts +4 -3
- package/dist/bundle/types/instrumentations/console/instrumentation.d.ts +1 -1
- package/dist/bundle/types/instrumentations/errors/instrumentation.d.ts +1 -1
- package/dist/bundle/types/instrumentations/index.d.ts +1 -0
- package/dist/bundle/types/instrumentations/performance/instrumentation.d.ts +4 -3
- package/dist/bundle/types/instrumentations/performance/navigation.d.ts +1 -1
- package/dist/bundle/types/instrumentations/performance/performanceUtils.d.ts +0 -1
- package/dist/bundle/types/instrumentations/performance/resource.d.ts +3 -2
- package/dist/bundle/types/instrumentations/performance/types.d.ts +4 -0
- package/dist/bundle/types/instrumentations/session/instrumentation.d.ts +1 -1
- package/dist/bundle/types/instrumentations/userActions/const.d.ts +7 -0
- package/dist/bundle/types/instrumentations/userActions/domMutationMonitor.d.ts +2 -0
- package/dist/bundle/types/instrumentations/userActions/httpRequestMonitor.d.ts +5 -0
- package/dist/bundle/types/instrumentations/userActions/index.d.ts +3 -0
- package/dist/bundle/types/instrumentations/userActions/instrumentation.d.ts +6 -0
- package/dist/bundle/types/instrumentations/userActions/performanceEntriesMonitor.d.ts +2 -0
- package/dist/bundle/types/instrumentations/userActions/processUserActionEventHandler.d.ts +2 -0
- package/dist/bundle/types/instrumentations/userActions/types.d.ts +12 -0
- package/dist/bundle/types/instrumentations/userActions/util.d.ts +8 -0
- package/dist/bundle/types/instrumentations/view/instrumentation.d.ts +1 -1
- package/dist/bundle/types/instrumentations/webVitals/instrumentation.d.ts +1 -1
- package/dist/bundle/types/transports/console/transport.d.ts +1 -1
- package/dist/bundle/types/transports/fetch/transport.d.ts +1 -1
- package/dist/bundle/types/utils/index.d.ts +1 -1
- package/dist/bundle/types/utils/url.d.ts +12 -2
- package/dist/cjs/config/getWebInstrumentations.js +1 -0
- package/dist/cjs/config/getWebInstrumentations.js.map +1 -1
- package/dist/cjs/config/makeCoreConfig.js +20 -7
- package/dist/cjs/config/makeCoreConfig.js.map +1 -1
- package/dist/cjs/index.js +11 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/instrumentations/index.js +4 -1
- package/dist/cjs/instrumentations/index.js.map +1 -1
- package/dist/cjs/instrumentations/performance/instrumentation.js +5 -9
- package/dist/cjs/instrumentations/performance/instrumentation.js.map +1 -1
- package/dist/cjs/instrumentations/performance/navigation.js +3 -2
- package/dist/cjs/instrumentations/performance/navigation.js.map +1 -1
- package/dist/cjs/instrumentations/performance/performanceUtils.js +1 -6
- package/dist/cjs/instrumentations/performance/performanceUtils.js.map +1 -1
- package/dist/cjs/instrumentations/performance/resource.js +8 -2
- package/dist/cjs/instrumentations/performance/resource.js.map +1 -1
- package/dist/cjs/instrumentations/performance/types.js.map +1 -1
- package/dist/cjs/instrumentations/userActions/const.js +11 -0
- package/dist/cjs/instrumentations/userActions/const.js.map +1 -0
- package/dist/cjs/instrumentations/userActions/domMutationMonitor.js +20 -0
- package/dist/cjs/instrumentations/userActions/domMutationMonitor.js.map +1 -0
- package/dist/cjs/instrumentations/userActions/httpRequestMonitor.js +88 -0
- package/dist/cjs/instrumentations/userActions/httpRequestMonitor.js.map +1 -0
- package/dist/cjs/instrumentations/userActions/index.js +11 -0
- package/dist/cjs/instrumentations/userActions/index.js.map +1 -0
- package/dist/cjs/instrumentations/userActions/instrumentation.js +37 -0
- package/dist/cjs/instrumentations/userActions/instrumentation.js.map +1 -0
- package/dist/cjs/instrumentations/userActions/performanceEntriesMonitor.js +18 -0
- package/dist/cjs/instrumentations/userActions/performanceEntriesMonitor.js.map +1 -0
- package/dist/cjs/instrumentations/userActions/processUserActionEventHandler.js +130 -0
- package/dist/cjs/instrumentations/userActions/processUserActionEventHandler.js.map +1 -0
- package/dist/cjs/instrumentations/userActions/types.js +3 -0
- package/dist/cjs/instrumentations/userActions/types.js.map +1 -0
- package/dist/cjs/instrumentations/userActions/util.js +17 -0
- package/dist/cjs/instrumentations/userActions/util.js.map +1 -0
- package/dist/cjs/utils/index.js +3 -3
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/url.js +15 -2
- package/dist/cjs/utils/url.js.map +1 -1
- package/dist/esm/config/getWebInstrumentations.js +2 -1
- package/dist/esm/config/getWebInstrumentations.js.map +1 -1
- package/dist/esm/config/makeCoreConfig.js +20 -8
- package/dist/esm/config/makeCoreConfig.js.map +1 -1
- package/dist/esm/index.js +3 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/instrumentations/index.js +1 -0
- package/dist/esm/instrumentations/index.js.map +1 -1
- package/dist/esm/instrumentations/performance/instrumentation.js +4 -8
- package/dist/esm/instrumentations/performance/instrumentation.js.map +1 -1
- package/dist/esm/instrumentations/performance/navigation.js +4 -3
- package/dist/esm/instrumentations/performance/navigation.js.map +1 -1
- package/dist/esm/instrumentations/performance/performanceUtils.js +0 -3
- package/dist/esm/instrumentations/performance/performanceUtils.js.map +1 -1
- package/dist/esm/instrumentations/performance/resource.js +9 -3
- package/dist/esm/instrumentations/performance/resource.js.map +1 -1
- package/dist/esm/instrumentations/performance/types.js.map +1 -1
- package/dist/esm/instrumentations/userActions/const.js +8 -0
- package/dist/esm/instrumentations/userActions/const.js.map +1 -0
- package/dist/esm/instrumentations/userActions/domMutationMonitor.js +16 -0
- package/dist/esm/instrumentations/userActions/domMutationMonitor.js.map +1 -0
- package/dist/esm/instrumentations/userActions/httpRequestMonitor.js +84 -0
- package/dist/esm/instrumentations/userActions/httpRequestMonitor.js.map +1 -0
- package/dist/esm/instrumentations/userActions/index.js +3 -0
- package/dist/esm/instrumentations/userActions/index.js.map +1 -0
- package/dist/esm/instrumentations/userActions/instrumentation.js +15 -0
- package/dist/esm/instrumentations/userActions/instrumentation.js.map +1 -0
- package/dist/esm/instrumentations/userActions/performanceEntriesMonitor.js +14 -0
- package/dist/esm/instrumentations/userActions/performanceEntriesMonitor.js.map +1 -0
- package/dist/esm/instrumentations/userActions/processUserActionEventHandler.js +126 -0
- package/dist/esm/instrumentations/userActions/processUserActionEventHandler.js.map +1 -0
- package/dist/esm/instrumentations/userActions/types.js +2 -0
- package/dist/esm/instrumentations/userActions/types.js.map +1 -0
- package/dist/esm/instrumentations/userActions/util.js +13 -0
- package/dist/esm/instrumentations/userActions/util.js.map +1 -0
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/url.js +12 -1
- package/dist/esm/utils/url.js.map +1 -1
- package/dist/types/index.d.ts +4 -3
- package/dist/types/instrumentations/console/instrumentation.d.ts +1 -1
- package/dist/types/instrumentations/errors/instrumentation.d.ts +1 -1
- package/dist/types/instrumentations/index.d.ts +1 -0
- package/dist/types/instrumentations/performance/instrumentation.d.ts +4 -3
- package/dist/types/instrumentations/performance/navigation.d.ts +1 -1
- package/dist/types/instrumentations/performance/performanceUtils.d.ts +0 -1
- package/dist/types/instrumentations/performance/resource.d.ts +3 -2
- package/dist/types/instrumentations/performance/types.d.ts +4 -0
- package/dist/types/instrumentations/session/instrumentation.d.ts +1 -1
- package/dist/types/instrumentations/userActions/const.d.ts +7 -0
- package/dist/types/instrumentations/userActions/domMutationMonitor.d.ts +2 -0
- package/dist/types/instrumentations/userActions/httpRequestMonitor.d.ts +5 -0
- package/dist/types/instrumentations/userActions/index.d.ts +3 -0
- package/dist/types/instrumentations/userActions/instrumentation.d.ts +6 -0
- package/dist/types/instrumentations/userActions/performanceEntriesMonitor.d.ts +2 -0
- package/dist/types/instrumentations/userActions/processUserActionEventHandler.d.ts +2 -0
- package/dist/types/instrumentations/userActions/types.d.ts +12 -0
- package/dist/types/instrumentations/userActions/util.d.ts +8 -0
- package/dist/types/instrumentations/view/instrumentation.d.ts +1 -1
- package/dist/types/instrumentations/webVitals/instrumentation.d.ts +1 -1
- package/dist/types/transports/console/transport.d.ts +1 -1
- package/dist/types/transports/fetch/transport.d.ts +1 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/url.d.ts +12 -2
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
var GrafanaFaroWebSdk=function(e){"use strict";class t{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=[]}}function n(e,n,i,r){var o;n.debug("Initializing transports");const s=[];let a=i.paused,u=[];const l=e=>{let t=e;for(const e of u){const n=t.map(e).filter(Boolean);if(0===n.length)return[];t=n}return t},c=e=>{const t=l(e);if(0!==t.length)for(const e of s)n.debug(`Transporting item using ${e.name}\n`,t),e.isBatched()&&e.send(t)};let d;(null===(o=i.batching)||void 0===o?void 0:o.enabled)&&(d=new t(c,{sendTimeout:i.batching.sendTimeout,itemLimit:i.batching.itemLimit,paused:a}));return{add:(...t)=>{n.debug("Adding transports"),t.forEach((t=>{n.debug(`Adding "${t.name}" transport`);s.some((e=>e===t))?n.warn(`Transport ${t.name} is already added`):(t.unpatchedConsole=e,t.internalLogger=n,t.config=i,t.metas=r,s.push(t))}))},addBeforeSendHooks:(...e)=>{n.debug("Adding beforeSendHooks\n",u),e.forEach((e=>{e&&u.push(e)}))},getBeforeSendHooks:()=>[...u],execute:e=>{var t;a||((null===(t=i.batching)||void 0===t?void 0:t.enabled)&&(null==d||d.addItem(e)),(e=>{var t,r;if((null===(t=i.batching)||void 0===t?void 0:t.enabled)&&s.every((e=>e.isBatched())))return;const[o]=l([e]);if(void 0!==o)for(const e of s)n.debug(`Transporting item using ${e.name}\n`,o),e.isBatched()?(null===(r=i.batching)||void 0===r?void 0:r.enabled)||e.send([o]):e.send(o)})(e))},isPaused:()=>a,pause:()=>{n.debug("Pausing transports"),null==d||d.pause(),a=!0},remove:(...e)=>{n.debug("Removing transports"),e.forEach((e=>{n.debug(`Removing "${e.name}" transport`);const t=s.indexOf(e);-1!==t?s.splice(t,1):n.warn(`Transport "${e.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{u.filter((t=>!e.includes(t)))},get transports(){return[...s]},unpause:()=>{n.debug("Unpausing transports"),null==d||d.start(),a=!1}}}function i(e,t){return typeof e===t}function r(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function o(e,t){try{return e instanceof t}catch(e){return!1}}const s=e=>i(e,"null"),a=e=>i(e,"string"),u=e=>i(e,"number")&&!isNaN(e)||i(e,"bigint"),l=e=>!s(e)&&i(e,"object"),c=e=>i(e,"function"),d=e=>r(e,"Array"),f=e=>!l(e)&&!c(e),p="undefined"!=typeof Event,g=e=>p&&o(e,Event),v="undefined"!=typeof Error,m=e=>v&&o(e,Error),h=e=>r(e,"ErrorEvent"),b=e=>r(e,"DOMError"),w=e=>r(e,"DOMException"),y="undefined"!=typeof Element,S="undefined"!=typeof Map;function T(e){return null==e||(d(e)||a(e)?0===e.length:!!l(e)&&0===Object.keys(e).length)}function E(e,t){if(e===t)return!0;if(i(e,"number")&&isNaN(e))return i(t,"number")&&isNaN(t);const n=d(e),r=d(t);if(n!==r)return!1;if(n&&r){const n=e.length;if(n!==t.length)return!1;for(let i=n;0!=i--;)if(!E(e[i],t[i]))return!1;return!0}const o=l(e),s=l(t);if(o!==s)return!1;if(e&&t&&o&&s){const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(let e of n)if(!i.includes(e))return!1;for(let i of n)if(!E(e[i],t[i]))return!1;return!0}return!1}function I(){return Date.now()}function k(){return(new Date).toISOString()}function x(e){return new Date(e).toISOString()}var O;e.LogLevel=void 0,(O=e.LogLevel||(e.LogLevel={})).TRACE="trace",O.DEBUG="debug",O.INFO="info",O.LOG="log",O.WARN="warn",O.ERROR="error";const L=e.LogLevel.LOG,C=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function P(){}function A(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 j="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function _(e=10){return Array.from(Array(e)).map((()=>j[Math.floor(Math.random()*j.length)])).join("")}const N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;function M(e={}){return JSON.stringify(null!=e?e:{},function(){const e=new WeakSet;return function(t,n){if(l(n)&&null!==n){if(e.has(n))return null;e.add(n)}return n}}())}function D(e={}){const t={};for(const[n,i]of Object.entries(e))t[n]=l(i)&&null!==i?M(i):String(i);return t}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 U={debug:P,error:P,info:P,prefix:"Faro",warn:P},F=e.InternalLoggerLevel.ERROR,B=Object.assign({},console);let z=B;function V(e){var t;return z=null!==(t=e.unpatchedConsole)&&void 0!==t?t:z,z}function $(t=B,n=F){const i=U;return n>e.InternalLoggerLevel.OFF&&(i.error=n>=e.InternalLoggerLevel.ERROR?function(...e){t.error(`${i.prefix}\n`,...e)}:P,i.warn=n>=e.InternalLoggerLevel.WARN?function(...e){t.warn(`${i.prefix}\n`,...e)}:P,i.info=n>=e.InternalLoggerLevel.INFO?function(...e){t.info(`${i.prefix}\n`,...e)}:P,i.debug=n>=e.InternalLoggerLevel.VERBOSE?function(...e){t.debug(`${i.prefix}\n`,...e)}:P),i}let q=U;function G(e,t){return q=$(e,t.internalLoggerLevel),q}class H{constructor(){this.unpatchedConsole=B,this.internalLogger=U,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 W extends H{isBatched(){return!1}getIgnoreUrls(){return[]}}var K;e.TransportItemType=void 0,(K=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",K.LOG="log",K.MEASUREMENT="measurement",K.TRACE="trace",K.EVENT="event";const X={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function J(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 Z(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=X[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:J(n.traces,t.payload.resourceSpans)})}})),n}const Y="Error",Q=e=>e.map((e=>l(e)?M(e):String(e))).join(" ");let ee;function te(t,n,i,r,o,u){var l;n.debug("Initializing exceptions API");let c=null;ee=null!==(l=i.parseStacktrace)&&void 0!==l?l:ee;const d=e=>{n.debug("Changing stacktrace parser"),ee=null!=e?e:ee},{ignoreErrors:f=[]}=i;return d(i.parseStacktrace),{changeStacktraceParser:d,getStacktraceParser:()=>ee,pushError:(t,{skipDedupe:l,stackFrames:d,type:p,context:g,spanContext:v,timestampOverwriteMs:m}={})=>{if(function(e,t){const{message:n,name:i,stack:r}=t;return o=e,s=n+" "+i+" "+r,o.some((e=>a(e)?s.includes(e):!!s.match(e)));var o,s}(f,t))return;const h={meta:r.value,payload:{type:p||t.name||Y,value:t.message,timestamp:m?x(m):k(),trace:v?{trace_id:v.traceId,span_id:v.spanId}:u.getTraceContext(),context:D(Object.assign(Object.assign({},ne(t)),null!=g?g:{}))},type:e.TransportItemType.EXCEPTION};(null==(d=null!=d?d:t.stack?null==ee?void 0:ee(t).frames:void 0)?void 0:d.length)&&(h.payload.stacktrace={frames:d});const b={type:h.payload.type,value:h.payload.value,stackTrace:h.payload.stacktrace,context:h.payload.context};l||!i.dedupe||s(c)||!E(b,c)?(c=b,n.debug("Pushing exception\n",h),o.execute(h)):n.debug("Skipping error push because it is the same as the last one\n",h.payload)}}}function ne(e){let t=e.cause;return m(t)?t=e.cause.toString():null!==t&&(l(e.cause)||d(e.cause))?t=M(e.cause):null!=t&&(t=e.cause.toString()),null==t?{}:{cause:t}}const ie=e=>e.map((e=>{try{return String(e)}catch(e){return""}})).join(" ");function re(t,n,i,r,o){n.debug("Initializing API");const u=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,r,o);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},u),te(0,n,i,r,o,u)),function(e,t,n,i){let r,o,s,u;t.debug("Initializing meta API");const l=e=>{o&&i.remove(o),o={user:e},i.add(o)},c=(e,t)=>{var n;const o=null==t?void 0:t.overrides,s=o?{overrides:Object.assign(Object.assign({},null===(n=null==r?void 0:r.session)||void 0===n?void 0:n.overrides),o)}:{};r&&i.remove(r),r={session:Object.assign(Object.assign({},T(e)?void 0:e),s)},i.add(r)},d=()=>i.value.session,f=()=>i.value.page;return{setUser:l,resetUser:l,setSession:c,resetSession:c,getSession:d,setView:(e,t)=>{var n;if((null==t?void 0:t.overrides)&&c(d(),{overrides:t.overrides}),(null===(n=null==s?void 0:s.view)||void 0===n?void 0:n.name)===(null==e?void 0:e.name))return;const r=s;s={view:e},i.add(s),r&&i.remove(r)},getView:()=>i.value.view,setPage:e=>{var t;const n=a(e)?Object.assign(Object.assign({},null!==(t=null==u?void 0:u.page)&&void 0!==t?t:f()),{id:e}):e;u&&i.remove(u),u={page:n},i.add(u)},getPage:f}}(0,n,0,r)),function(t,n,i,r,o,a){var u;n.debug("Initializing logs API");let l=null;const c=null!==(u=i.logArgsSerializer)&&void 0!==u?u:ie;return{pushLog:(t,{context:u,level:d,skipDedupe:f,spanContext:p,timestampOverwriteMs:g}={})=>{try{const v={type:e.TransportItemType.LOG,payload:{message:c(t),level:null!=d?d:L,context:D(u),timestamp:g?x(g):k(),trace:p?{trace_id:p.traceId,span_id:p.spanId}:a.getTraceContext()},meta:r.value},m={message:v.payload.message,level:v.payload.level,context:v.payload.context};if(!f&&i.dedupe&&!s(l)&&E(m,l))return void n.debug("Skipping log push because it is the same as the last one\n",v.payload);l=m,n.debug("Pushing log\n",v),o.execute(v)}catch(e){n.error("Error pushing log\n",e)}}}}(0,n,i,r,o,u)),function(t,n,i,r,o,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?x(f):k(),context:D(c)}),meta:r.value},g={type:p.payload.type,values:p.payload.values,context:p.payload.context};if(!l&&i.dedupe&&!s(u)&&E(g,u))return void n.debug("Skipping measurement push because it is the same as the last one\n",p.payload);u=g,n.debug("Pushing measurement\n",p),o.execute(p)}catch(e){n.error("Error pushing measurement\n",e)}}}}(0,n,i,r,o,u)),function(t,n,i,r,o,a){let u=null;return{pushEvent:(t,l,c,{skipDedupe:d,spanContext:f,timestampOverwriteMs:p}={})=>{try{const g={meta:r.value,payload:{name:t,domain:null!=c?c:i.eventDomain,attributes:D(l),timestamp:p?x(p):k(),trace:f?{trace_id:f.traceId,span_id:f.spanId}:a.getTraceContext()},type:e.TransportItemType.EVENT},v={name:g.payload.name,attributes:g.payload.attributes,domain:g.payload.domain};if(!d&&i.dedupe&&!s(u)&&E(v,u))return void n.debug("Skipping event push because it is the same as the last one\n",g.payload);u=v,n.debug("Pushing event\n",g),o.execute(g)}catch(e){n.error("Error pushing event",e)}}}}(0,n,i,r,o,u))}class oe extends H{constructor(){super(...arguments),this.api={},this.transports={}}}const se="1.14.1";const ae="_faroInternal";function ue(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(N,ae,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function le(){return ae in N}function ce(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},ue(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 N)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(N,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}function de(e){const t=V(e),i=G(t,e);if(le()&&!e.isolate)return void i.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');i.debug("Initializing");const r=function(e,t){let n=[],i=[];const r=()=>n.reduce(((e,t)=>Object.assign(e,c(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,i),o=n(t,i,e,r),s=re(0,i,e,r,o),a=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,i,e,r,o,s),u=ce(t,i,e,r,o,s,a);return function(e){var t,n;const i={sdk:{version:se},app:{bundleId:e.config.app.name&&(r=e.config.app.name,null==N?void 0:N[`__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:[])}(u),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend)}(u),function(e){e.instrumentations.add(...e.config.instrumentations)}(u),u}e.faro={};const fe="faro",pe={enabled:!0,sendTimeout:250,itemLimit:50},ge="view_changed",ve="session_start",me="session_resume",he="session_extend",be="service_name_override",we="unknown";var ye,Se={exports:{}},Te=Se.exports;var Ee=(ye||(ye=1,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",g="architecture",v="console",m="mobile",h="tablet",b="smarttv",w="wearable",y="embedded",S="Amazon",T="Apple",E="ASUS",I="BlackBerry",k="Browser",x="Chrome",O="Firefox",L="Google",C="Huawei",P="LG",A="Microsoft",j="Motorola",_="Opera",N="Samsung",M="Sharp",D="Sony",R="Xiaomi",U="Zebra",F="Facebook",B="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()},H=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,500)},W=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,_+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[p,[c,_+" GX"]],[/\bopr\/([\w\.]+)/i],[p,[c,_]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[c,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[p,[c,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/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|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)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,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[c,_+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[c,_+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[c,"MIUI"+V]],[/fxios\/([\w\.-]+)/i],[p,[c,O]],[/\bqihoobrowser\/?([\w\.]*)/i],[p,[c,"360"]],[/\b(qq)\/([\w\.]+)/i],[[c,/(.+)/,"$1Browser"],p],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1"+V],p],[/samsungbrowser\/([\w\.]+)/i],[p,[c,N+" Internet"]],[/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|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[c,p],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[c],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[p,c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,F],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|librewolf)\/([\w\.]+)/i],[c,p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[c,O+" 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],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,G]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",G]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,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,N],[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,N],[d,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[f,T],[d,m]],[/\((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,M],[d,m]],[/(?:honor)([-\w ]+)[;\)]/i],[l,[f,"Honor"],[d,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[f,C],[d,h]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[f,C],[d,m]],[/\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,m]],[/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,m]],[/\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,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[l,[f,"Realme"],[d,m]],[/\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,j],[d,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[f,j],[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,m]],[/(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,m]],[/(pixel c)\b/i],[l,[f,L],[d,h]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[f,L],[d,m]],[/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,D],[d,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[f,D],[d,h]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[f,"OnePlus"],[d,m]],[/(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,m]],[/(playbook);[-\w\),; ]+(rim)/i],[l,f,[d,h]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[f,I],[d,m]],[/(?:\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,m]],[/(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,m]],[/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,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[l,[f,"Ulefone"],[d,m]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[l,[f,"Energizer"],[d,m]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[l,[f,"Cat"],[d,m]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[l,[f,"Smartfren"],[d,m]],[/droid.+; (a(?:015|06[35]|142p?))/i],[l,[f,"Nothing"],[d,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[f,l,[d,m]],[/(imo) (tab \w+)/i,/(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,A],[d,h]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[f,"Fairphone"],[d,m]],[/(u304aa)/i],[l,[f,"AT&T"],[d,m]],[/\bsie-(\w*)/i],[l,[f,"Siemens"],[d,m]],[/\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,m]],[/\b(gen\d{3}) b.+49h/i],[l,[f,"Swiss"],[d,m]],[/\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,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],l,[d,m]],[/\b(ph-1) /i],[l,[f,"Essential"],[d,m]],[/\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,m]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[f,A],[d,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[f,U],[d,h]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[f,U],[d,m]],[/smart-tv.+(samsung)/i],[f,[d,b]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[f,N],[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,L],[d,b]],[/droid.+aft(\w+)( bui|\))/i],[l,[f,S],[d,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[f,M],[d,b]],[/(bravia[\w ]+)( bui|\))/i],[l,[f,D],[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,H],[l,H],[d,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,l,[d,v]],[/droid.+; (shield) bui/i],[l,[f,"Nvidia"],[d,v]],[/(playstation [345portablevi]+)/i],[l,[f,D],[d,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[f,A],[d,v]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[l,[f,N],[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,L],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[l,[f,U],[d,w]],[/droid.+; (glass) \d/i],[l,[f,L],[d,w]],[/(pico) (4|neo3(?: link|pro)?)/i],[f,l,[d,w]],[/; (quest( \d| pro)?)/i],[l,[f,F],[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,m]],[/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,m]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[c,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[c,p],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\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|openharmony)[-\/ ]?([\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,O+" 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,B],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 v=typeof n!==o&&n.navigator?n.navigator:i,b=e||(v&&v.userAgent?v.userAgent:""),w=v&&v.userAgentData?v.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=v&&v.userAgent==b;return this.getBrowser=function(){var e,t={};return t[c]=i,t[p]=i,W.call(t,b,y.browser),t[u]=typeof(e=t[p])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:i,S&&v&&v.brave&&typeof v.brave.isBrave==r&&(t[c]="Brave"),t},this.getCPU=function(){var e={};return e[g]=i,W.call(e,b,y.cpu),e},this.getDevice=function(){var e={};return e[f]=i,e[l]=i,e[d]=i,W.call(e,b,y.device),S&&!e[d]&&w&&w.mobile&&(e[d]=m),S&&"Macintosh"==e[l]&&v&&typeof v.standalone!==o&&v.maxTouchPoints&&v.maxTouchPoints>2&&(e[l]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[c]=i,e[p]=i,W.call(e,b,y.engine),e},this.getOS=function(){var e={};return e[c]=i,e[p]=i,W.call(e,b,y.os),S&&!e[c]&&w&&w.platform&&"Unknown"!=w.platform&&(e[c]=w.platform.replace(/chrome os/i,B).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?H(e,500):e,this},this.setUA(b),this};Z.VERSION="1.0.40",Z.BROWSER=$([c,p,u]),Z.CPU=$([g]),Z.DEVICE=$([l,f,d,v,m,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:Te)}(Se,Se.exports)),Se.exports);const Ie=()=>{const e=new Ee.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:we,version:null!=n?n:we,os:`${null!=i?i:we} ${null!=r?r:we}`,userAgent:null!=o?o:we,language:null!=s?s:we,mobile:a,brands:null!=u?u:we,viewportWidth:`${window.innerWidth}`,viewportHeight:`${window.innerHeight}`}}};function ke(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:_(),attributes:t}}const xe={session:"sessionStorage",local:"localStorage"};function Oe(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 Le(e,t){return _e(t)?window[t].getItem(e):null}function Ce(e,t,n){if(_e(n))try{window[n].setItem(e,t)}catch(e){}}function Pe(e,t){_e(t)&&window[t].removeItem(e)}const Ae=Oe(xe.local),je=Oe(xe.session);function _e(e){return e===xe.local?Ae:e===xe.session&&je}function Ne(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))}}const Me="com.grafana.faro.session",De=144e5,Re=9e5,Ue=Re,Fe={enabled:!0,persistent:!1,maxSessionPersistenceTime:Ue};function Be(){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}function ze({sessionId:t,started:n,lastActivity:i,isSampled:r=!0}={}){var o,s;const a=I(),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():_()),{sessionId:t,lastActivity:null!=i?i:a,started:null!=n?n:a,isSampled:r}}function Ve(e){if(null==e)return!1;const t=I();if(!(t-e.started<De))return!1;return t-e.lastActivity<Re}function $e({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&&!Ae||!u&&!je)return;const l=t();if(!1===i&&Ve(l))n(Object.assign(Object.assign({},l),{lastActivity:I()}));else{let t=qe(ze({isSampled:Be()}),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 qe(t,n){var i,r,o,s,a,u,l;const c=Object.assign(Object.assign({},t),{sessionMeta:{id:t.sessionId,attributes: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:{}),{isSampled:t.isSampled.toString()})}}),d=null!==(u=null===(a=e.faro.metas.value.session)||void 0===a?void 0:a.overrides)&&void 0!==u?u:null===(l=null==n?void 0:n.sessionMeta)||void 0===l?void 0:l.overrides;T(d)||(c.sessionMeta.overrides=d);const f=null==n?void 0:n.sessionId;return null!=f&&(c.sessionMeta.attributes.previousSession=f),c}function Ge({fetchUserSession:t,storeUserSession:n}){return function(i){const r=i.session,o=t();let s=null==r?void 0:r.id;const a=null==r?void 0:r.attributes,u=null==r?void 0:r.overrides,l=null==o?void 0:o.sessionMeta,c=null==l?void 0:l.overrides,d=!!u&&!E(u,c),f=!!a&&!E(a,null==l?void 0:l.attributes);if(!!r&&s!==(null==o?void 0:o.sessionId)||f||d){const t=qe(ze({sessionId:s,isSampled:Be()}),o);n(t),function(t,n={},i={}){var r,o,s;if(!t)return;const a=n.serviceName,u=null!==(s=null!==(r=i.serviceName)&&void 0!==r?r:null===(o=e.faro.metas.value.app)||void 0===o?void 0:o.name)&&void 0!==s?s:"";a&&a!==u&&e.faro.api.pushEvent(be,{serviceName:a,previousServiceName:u})}(d,u,c),e.faro.api.setSession(t.sessionMeta)}}}class He{constructor(){this.updateSession=Ne((()=>this.updateUserSession()),1e3),this.updateUserSession=$e({fetchUserSession:He.fetchUserSession,storeUserSession:He.storeUserSession}),this.init()}static removeUserSession(){Pe(Me,He.storageTypeLocal)}static storeUserSession(e){Ce(Me,M(e),He.storageTypeLocal)}static fetchUserSession(){const e=Le(Me,He.storageTypeLocal);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener(Ge({fetchUserSession:He.fetchUserSession,storeUserSession:He.storeUserSession}))}}He.storageTypeLocal=xe.local;class We{constructor(){this.updateSession=Ne((()=>this.updateUserSession()),1e3),this.updateUserSession=$e({fetchUserSession:We.fetchUserSession,storeUserSession:We.storeUserSession}),this.init()}static removeUserSession(){Pe(Me,We.storageTypeSession)}static storeUserSession(e){Ce(Me,M(e),We.storageTypeSession)}static fetchUserSession(){const e=Le(Me,We.storageTypeSession);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener(Ge({fetchUserSession:We.fetchUserSession,storeUserSession:We.storeUserSession}))}}function Ke(e){return(null==e?void 0:e.persistent)?He:We}We.storageTypeSession=xe.session;class Xe extends oe{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=se}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(he,{},void 0,{skipDedupe:!0}),void(this.notifiedSession=i);this.notifiedSession=i,this.api.pushEvent(ve,{},void 0,{skipDedupe:!0})}}createInitialSession(e,t){var n,i,r,o,s,a;let u,l,c=e.fetchUserSession();if(t.persistent&&t.maxSessionPersistenceTime&&c){const e=I();c.lastActivity<e-t.maxSessionPersistenceTime&&(He.removeUserSession(),c=null)}if(Ve(c)){const e=null==c?void 0:c.sessionId;l=ze({sessionId:e,isSampled:c.isSampled||!1,started:null==c?void 0:c.started});const r=null==c?void 0:c.sessionMeta,o=Object.assign(Object.assign({},null===(n=t.session)||void 0===n?void 0:n.overrides),null==r?void 0:r.overrides);l.sessionMeta=Object.assign(Object.assign({},t.session),{id:e,attributes:Object.assign(Object.assign(Object.assign({},null===(i=t.session)||void 0===i?void 0:i.attributes),null==r?void 0:r.attributes),{isSampled:l.isSampled.toString()}),overrides:o}),u=me}else{const e=null!==(o=null===(r=t.session)||void 0===r?void 0:r.id)&&void 0!==o?o:ke().id;l=ze({sessionId:e,isSampled:Be()});const n=null===(s=t.session)||void 0===s?void 0:s.overrides;l.sessionMeta=Object.assign({id:e,attributes:Object.assign({isSampled:l.isSampled.toString()},null===(a=t.session)||void 0===a?void 0:a.attributes)},n?{overrides:n}:{}),u=ve}return{initialSession:l,lifecycleType:u}}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=Ke(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===ve&&this.api.pushEvent(ve,{},void 0,{skipDedupe:!0}),i===me&&this.api.pushEvent(me,{},void 0,{skipDedupe:!0})}this.metas.addListener(this.sendSessionStartEvent.bind(this))}}const Je="DOMError",Ze="DOMException",Ye="Non-Error exception captured with keys:",Qe="?",et=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;const tt="\n",nt="eval",it="?",rt="@",ot=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,st=/\((\S*)(?::(\d+))(?::(\d+))\)/,at="eval",ut="address at ",lt=ut.length,ct=/^\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,dt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ft=" > eval",pt="safari-extension",gt="safari-web-extension",vt=/Minified React error #\d+;/i;function mt(e,t,n,i){const r={filename:e||document.location.href,function:t||it};return void 0!==n&&(r.lineno=n),void 0!==i&&(r.colno=i),r}function ht(e,t){const n=null==e?void 0:e.includes(pt),i=!n&&(null==e?void 0:e.includes(gt));return n||i?[(null==e?void 0:e.includes(rt))?e.split(rt)[0]:e,n?`${pt}:${t}`:`${gt}:${t}`]:[e,t]}function bt(e){let t=[];e.stacktrace?t=e.stacktrace.split(tt).filter(((e,t)=>t%2==0)):e.stack&&(t=e.stack.split(tt));const n=t.reduce(((t,n,i)=>{let r,o,s,a,l;if(r=ot.exec(n)){if(o=r[1],s=r[2],a=r[3],l=r[4],null==s?void 0:s.startsWith(at)){const e=st.exec(s);e&&(s=e[1],a=e[2],l=e[3])}s=(null==s?void 0:s.startsWith(ut))?s.substring(lt):s,[o,s]=ht(o,s)}else if(r=ct.exec(n)){if(o=r[1],s=r[3],a=r[4],l=r[5],s&&s.includes(ft)){const e=dt.exec(s);e&&(o=o||nt,s=e[1],a=e[2])}else 0===i&&!l&&u(e.columnNumber)&&(l=String(e.columnNumber+1));[o,s]=ht(o,s)}return(s||o)&&t.push(mt(s,o,a?Number(a):void 0,l?Number(l):void 0)),t}),[]);return vt.test(e.message)?n.slice(1):n}function wt(e){return{frames:bt(e)}}function yt(e){let t,n,i,r,o=[];if(h(e)&&e.error)t=e.error.message,n=e.error.name,o=bt(e.error);else if((i=b(e))||w(e)){const{name:r,message:o}=e;n=null!=r?r:i?Je:Ze,t=o?`${n}: ${o}`:n}else m(e)?(t=e.message,o=bt(e)):(l(e)||(r=g(e)))&&(n=r?e.constructor.name:void 0,t=`${Ye} ${Object.keys(e)}`);return[t,n,o]}function St(e){const[t,n,i,r,o]=e;let s,u,l=[];const c=a(t),d=mt(n,Qe,i,r);return o||!c?([s,u,l]=yt(null!=o?o:t),0===l.length&&(l=[d])):c&&([s,u]=function(e){var t,n;const i=e.match(et),r=null!==(t=null==i?void 0:i[1])&&void 0!==t?t:Y;return[null!==(n=null==i?void 0:i[2])&&void 0!==n?n:e,r]}(t),l=[d]),{value:s,type:u,stackFrames:l}}function Tt(e,t){return m(e[0])?St(e):{value:t(e)}}class Et extends oe{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=se,this.errorSerializer=ie}initialize(){var t,n,i,r;this.options=Object.assign(Object.assign({},this.options),this.config.consoleInstrumentation);const o=(null===(t=this.options)||void 0===t?void 0:t.serializeErrors)||!!(null===(n=this.options)||void 0===n?void 0:n.errorSerializer);this.errorSerializer=o?null!==(r=null===(i=this.options)||void 0===i?void 0:i.errorSerializer)&&void 0!==r?r:Q:ie,C.filter((e=>{var t,n;return!(null!==(n=null===(t=this.options)||void 0===t?void 0:t.disabledLevels)&&void 0!==n?n:Et.defaultDisabledLevels).includes(e)})).forEach((t=>{console[t]=(...n)=>{var i,r;try{if(t!==e.LogLevel.ERROR||(null===(i=this.options)||void 0===i?void 0:i.consoleErrorAsLog))if(t===e.LogLevel.ERROR&&(null===(r=this.options)||void 0===r?void 0:r.consoleErrorAsLog)){const{value:e,type:i,stackFrames:r}=Tt(n,this.errorSerializer);this.api.pushLog(e?[Et.consoleErrorPrefix+e]:n,{level:t,context:{value:null!=e?e:"",type:null!=i?i:"",stackFrames:(null==r?void 0:r.length)?Q(r):""}})}else this.api.pushLog(n,{level:t});else{const{value:e,type:t,stackFrames:i}=Tt(n,this.errorSerializer);if(e&&!t&&!i)return void this.api.pushError(new Error(Et.consoleErrorPrefix+e));this.api.pushError(new Error(Et.consoleErrorPrefix+e),{type:t,stackFrames:i})}}catch(e){this.logError(e)}finally{this.unpatchedConsole[t](...n)}}}))}}Et.defaultDisabledLevels=[e.LogLevel.DEBUG,e.LogLevel.TRACE,e.LogLevel.LOG],Et.consoleErrorPrefix="console.error: ";class It extends oe{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=se}initialize(){var e;this.logDebug("Initializing"),function(e){const t=window.onerror;window.onerror=(...n)=>{try{const{value:t,type:i,stackFrames:r}=St(n);t&&e.pushError(new Error(t),{type:i,stackFrames:r})}finally{null==t||t.apply(window,n)}}}(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=[];f(s)?(r=`Non-Error promise rejection captured with value: ${String(s)}`,o="UnhandledRejection"):[r,o,a]=yt(s),r&&e.pushError(new Error(r),{type:o,stackFrames:a})}))}}class kt extends oe{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=se}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(ge,{fromView:null!==(i=null===(n=this.notifiedView)||void 0===n?void 0:n.name)&&void 0!==i?i:we,toView:null!==(r=o.name)&&void 0!==r?r:we},void 0,{skipDedupe:!0}),this.notifiedView=o)}initialize(){this.metas.addListener(this.sendViewChangedEvent.bind(this))}}var xt,Ot,Lt,Ct,Pt,At=-1,jt=function(e){addEventListener("pageshow",(function(t){t.persisted&&(At=t.timeStamp,e(t))}),!0)},_t=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Nt=function(){var e=_t();return e&&e.activationStart||0},Mt=function(e,t){var n=_t(),i="navigate";return At>=0?i="back-forward-cache":n&&(document.prerendering||Nt()>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}},Dt=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){}},Rt=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))}},Ut=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Ft=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Bt=function(e){var t=!1;return function(){t||(e(),t=!0)}},zt=-1,Vt=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},$t=function(e){"hidden"===document.visibilityState&&zt>-1&&(zt="visibilitychange"===e.type?e.timeStamp:0,Gt())},qt=function(){addEventListener("visibilitychange",$t,!0),addEventListener("prerenderingchange",$t,!0)},Gt=function(){removeEventListener("visibilitychange",$t,!0),removeEventListener("prerenderingchange",$t,!0)},Ht=function(){return zt<0&&(zt=Vt(),qt(),jt((function(){setTimeout((function(){zt=Vt(),qt()}),0)}))),{get firstHiddenTime(){return zt}}},Wt=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Kt=[1800,3e3],Xt=function(e,t){t=t||{},Wt((function(){var n,i=Ht(),r=Mt("FCP"),o=Dt("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Nt(),0),r.entries.push(e),n(!0)))}))}));o&&(n=Rt(e,r,Kt,t.reportAllChanges),jt((function(i){r=Mt("FCP"),n=Rt(e,r,Kt,t.reportAllChanges),Ut((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},Jt=[.1,.25],Zt=0,Yt=1/0,Qt=0,en=function(e){e.forEach((function(e){e.interactionId&&(Yt=Math.min(Yt,e.interactionId),Qt=Math.max(Qt,e.interactionId),Zt=Qt?(Qt-Yt)/7+1:0)}))},tn=function(){return xt?Zt:performance.interactionCount||0},nn=[],rn=new Map,on=0,sn=[],an=function(e){if(sn.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=nn[nn.length-1],n=rn.get(e.interactionId);if(n||nn.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]};rn.set(i.id,i),nn.push(i)}nn.sort((function(e,t){return t.latency-e.latency})),nn.length>10&&nn.splice(10).forEach((function(e){return rn.delete(e.id)}))}}},un=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Bt(e),"hidden"===document.visibilityState?e():(n=t(e),Ft(e)),n},ln=[200,500],cn=[2500,4e3],dn={},fn=[800,1800],pn=function e(t){document.prerendering?Wt((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},gn={passive:!0,capture:!0},vn=new Date,mn=function(e,t){Ot||(Ot=t,Lt=e,Ct=new Date,wn(removeEventListener),hn())},hn=function(){if(Lt>=0&&Lt<Ct-vn){var e={entryType:"first-input",name:Ot.type,target:Ot.target,cancelable:Ot.cancelable,startTime:Ot.timeStamp,processingStart:Ot.timeStamp+Lt};Pt.forEach((function(t){t(e)})),Pt=[]}},bn=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(){mn(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,gn),removeEventListener("pointercancel",i,gn)};addEventListener("pointerup",n,gn),addEventListener("pointercancel",i,gn)}(t,e):mn(t,e)}},wn=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,bn,gn)}))},yn=[100,300];class Sn{constructor(e,t){this.pushMeasurement=e,this.webVitalConfig=t}initialize(){Object.entries(Sn.mapping).forEach((([e,t])=>{var n;t((t=>{this.pushMeasurement({type:"web-vitals",values:{[e]:t.value}})}),{reportAllChanges:null===(n=this.webVitalConfig)||void 0===n?void 0:n.reportAllChanges})}))}}Sn.mapping={cls:function(e,t){t=t||{},Xt(Bt((function(){var n,i=Mt("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=Dt("layout-shift",s);a&&(n=Rt(e,i,Jt,t.reportAllChanges),Ft((function(){s(a.takeRecords()),n(!0)})),jt((function(){r=0,i=Mt("CLS",0),n=Rt(e,i,Jt,t.reportAllChanges),Ut((function(){return n()}))})),setTimeout(n,0))})))},fcp:Xt,fid:function(e,t){t=t||{},Wt((function(){var n,i=Ht(),r=Mt("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=Dt("first-input",s);n=Rt(e,r,yn,t.reportAllChanges),a&&(Ft(Bt((function(){s(a.takeRecords()),a.disconnect()}))),jt((function(){var i;r=Mt("FID"),n=Rt(e,r,yn,t.reportAllChanges),Pt=[],Lt=-1,Ot=null,wn(addEventListener),i=o,Pt.push(i),hn()})))}))},inp:function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},Wt((function(){var n;"interactionCount"in performance||xt||(xt=Dt("event",en,{type:"event",buffered:!0,durationThreshold:0}));var i,r=Mt("INP"),o=function(e){un((function(){e.forEach(an);var t=function(){var e=Math.min(nn.length-1,Math.floor((tn()-on)/50));return nn[e]}();t&&t.latency!==r.value&&(r.value=t.latency,r.entries=t.entries,i())}))},s=Dt("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=Rt(e,r,ln,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Ft((function(){o(s.takeRecords()),i(!0)})),jt((function(){on=tn(),nn.length=0,rn.clear(),r=Mt("INP"),i=Rt(e,r,ln,t.reportAllChanges)})))})))},lcp:function(e,t){t=t||{},Wt((function(){var n,i=Ht(),r=Mt("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-Nt(),0),r.entries=[e],n())}))},s=Dt("largest-contentful-paint",o);if(s){n=Rt(e,r,cn,t.reportAllChanges);var a=Bt((function(){dn[r.id]||(o(s.takeRecords()),s.disconnect(),dn[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return un(a)}),{once:!0,capture:!0})})),Ft(a),jt((function(i){r=Mt("LCP"),n=Rt(e,r,cn,t.reportAllChanges),Ut((function(){r.value=performance.now()-i.timeStamp,dn[r.id]=!0,n(!0)}))}))}}))},ttfb:function(e,t){t=t||{};var n=Mt("TTFB"),i=Rt(e,n,fn,t.reportAllChanges);pn((function(){var r=_t();r&&(n.value=Math.max(r.responseStart-Nt(),0),n.entries=[r],i(!0),jt((function(){n=Mt("TTFB",0),(i=Rt(e,n,fn,t.reportAllChanges))(!0)})))}))}};var Tn,En,In=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},kn=function(e){if("loading"===document.readyState)return"loading";var t=In();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"},xn=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},On=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var i=e,r=i.id?"#"+i.id:xn(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},Ln=-1,Cn=function(){return Ln},Pn=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Ln=t.timeStamp,e(t))}),!0)},An=function(){var e=In();return e&&e.activationStart||0},jn=function(e,t){var n=In(),i="navigate";return Cn()>=0?i="back-forward-cache":n&&(document.prerendering||An()>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}},_n=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){}},Nn=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))}},Mn=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Dn=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Rn=function(e){var t=!1;return function(){t||(e(),t=!0)}},Un=-1,Fn=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Bn=function(e){"hidden"===document.visibilityState&&Un>-1&&(Un="visibilitychange"===e.type?e.timeStamp:0,Vn())},zn=function(){addEventListener("visibilitychange",Bn,!0),addEventListener("prerenderingchange",Bn,!0)},Vn=function(){removeEventListener("visibilitychange",Bn,!0),removeEventListener("prerenderingchange",Bn,!0)},$n=function(){return Un<0&&(Un=Fn(),zn(),Pn((function(){setTimeout((function(){Un=Fn(),zn()}),0)}))),{get firstHiddenTime(){return Un}}},qn=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Gn=[1800,3e3],Hn=function(e,t){t=t||{},qn((function(){var n,i=$n(),r=jn("FCP"),o=_n("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-An(),0),r.entries.push(e),n(!0)))}))}));o&&(n=Nn(e,r,Gn,t.reportAllChanges),Pn((function(i){r=jn("FCP"),n=Nn(e,r,Gn,t.reportAllChanges),Mn((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},Wn=[.1,.25],Kn=0,Xn=1/0,Jn=0,Zn=function(e){e.forEach((function(e){e.interactionId&&(Xn=Math.min(Xn,e.interactionId),Jn=Math.max(Jn,e.interactionId),Kn=Jn?(Jn-Xn)/7+1:0)}))},Yn=function(){return Tn?Kn:performance.interactionCount||0},Qn=function(){"interactionCount"in performance||Tn||(Tn=_n("event",Zn,{type:"event",buffered:!0,durationThreshold:0}))},ei=[],ti=new Map,ni=0,ii=[],ri=function(e){if(ii.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=ei[ei.length-1],n=ti.get(e.interactionId);if(n||ei.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]};ti.set(i.id,i),ei.push(i)}ei.sort((function(e,t){return t.latency-e.latency})),ei.length>10&&ei.splice(10).forEach((function(e){return ti.delete(e.id)}))}}},oi=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Rn(e),"hidden"===document.visibilityState?e():(n=t(e),Dn(e)),n},si=[200,500],ai=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},qn((function(){var n;Qn();var i,r=jn("INP"),o=function(e){oi((function(){e.forEach(ri);var t=function(){var e=Math.min(ei.length-1,Math.floor((Yn()-ni)/50));return ei[e]}();t&&t.latency!==r.value&&(r.value=t.latency,r.entries=t.entries,i())}))},s=_n("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=Nn(e,r,si,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Dn((function(){o(s.takeRecords()),i(!0)})),Pn((function(){ni=Yn(),ei.length=0,ti.clear(),r=jn("INP"),i=Nn(e,r,si,t.reportAllChanges)})))})))},ui=[],li=[],ci=0,di=new WeakMap,fi=new Map,pi=-1,gi=function(e){ui=ui.concat(e),vi()},vi=function(){pi<0&&(pi=oi(mi))},mi=function(){fi.size>10&&fi.forEach((function(e,t){ti.has(t)||fi.delete(t)}));var e=ei.map((function(e){return di.get(e.entries[0])})),t=li.length-50;li=li.filter((function(n,i){return i>=t||e.includes(n)}));for(var n=new Set,i=0;i<li.length;i++){var r=li[i];Si(r.startTime,r.processingEnd).forEach((function(e){n.add(e)}))}var o=ui.length-1-50;ui=ui.filter((function(e,t){return e.startTime>ci&&t>o||n.has(e)})),pi=-1};ii.push((function(e){e.interactionId&&e.target&&!fi.has(e.interactionId)&&fi.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;ci=Math.max(ci,e.processingEnd);for(var i=li.length-1;i>=0;i--){var r=li[i];if(Math.abs(n-r.renderTime)<=8){(t=r).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},li.push(t)),(e.interactionId||"first-input"===e.entryType)&&di.set(e,t),vi()}));var hi,bi,wi,yi,Si=function(e,t){for(var n,i=[],r=0;n=ui[r];r++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;i.push(n)}return i},Ti=[2500,4e3],Ei={},Ii=[800,1800],ki=function e(t){document.prerendering?qn((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},xi=function(e,t){t=t||{};var n=jn("TTFB"),i=Nn(e,n,Ii,t.reportAllChanges);ki((function(){var r=In();r&&(n.value=Math.max(r.responseStart-An(),0),n.entries=[r],i(!0),Pn((function(){n=jn("TTFB",0),(i=Nn(e,n,Ii,t.reportAllChanges))(!0)})))}))},Oi={passive:!0,capture:!0},Li=new Date,Ci=function(e,t){hi||(hi=t,bi=e,wi=new Date,ji(removeEventListener),Pi())},Pi=function(){if(bi>=0&&bi<wi-Li){var e={entryType:"first-input",name:hi.type,target:hi.target,cancelable:hi.cancelable,startTime:hi.timeStamp,processingStart:hi.timeStamp+bi};yi.forEach((function(t){t(e)})),yi=[]}},Ai=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(){Ci(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,Oi),removeEventListener("pointercancel",i,Oi)};addEventListener("pointerup",n,Oi),addEventListener("pointercancel",i,Oi)}(t,e):Ci(t,e)}},ji=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,Ai,Oi)}))},_i=[100,300],Ni=function(e,t){!function(e,t){t=t||{},qn((function(){var n,i=$n(),r=jn("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=_n("first-input",s);n=Nn(e,r,_i,t.reportAllChanges),a&&(Dn(Rn((function(){s(a.takeRecords()),a.disconnect()}))),Pn((function(){var i;r=jn("FID"),n=Nn(e,r,_i,t.reportAllChanges),yi=[],bi=-1,hi=null,ji(addEventListener),i=o,yi.push(i),Pi()})))}))}((function(t){var n=function(e){var t=e.entries[0],n={eventTarget:On(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:kn(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)}),t)};const Mi="com.grafana.faro.lastNavigationId",Di="load_state",Ri="time_to_first_byte";class Ui{constructor(e,t){this.corePushMeasurement=e,this.webVitalConfig=t}initialize(){this.measureCLS(),this.measureFCP(),this.measureFID(),this.measureINP(),this.measureLCP(),this.measureTTFB()}measureCLS(){var e;!function(e,t){!function(e,t){t=t||{},Hn(Rn((function(){var n,i=jn("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=_n("layout-shift",s);a&&(n=Nn(e,i,Wn,t.reportAllChanges),Dn((function(){s(a.takeRecords()),n(!0)})),Pn((function(){r=0,i=jn("CLS",0),n=Nn(e,i,Wn,t.reportAllChanges),Mn((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:On(r.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:r,largestShiftEntry:i,loadState:kn(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,Di,t),this.addIfPresent(s,"largest_shift_target",r),this.pushMeasurement(o,s)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureFCP(){var e;!function(e,t){Hn((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:kn(Cn())};if(e.entries.length){var n=In(),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:kn(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,Ri,n);const o=this.buildInitialContext(e);this.addIfPresent(o,Di,i),this.pushMeasurement(r,o)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureFID(){var e;Ni((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,Di,r),this.pushMeasurement(o,s)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureINP(){var e;!function(e,t){En||(En=_n("long-animation-frame",gi)),ai((function(t){var n=function(e){var t=e.entries[0],n=di.get(t),i=t.processingStart,r=n.processingEnd,o=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=Si(t.startTime,r),a=e.entries.find((function(e){return e.target})),u=a&&a.target||fi.get(t.interactionId),l=[t.startTime+t.duration,r].concat(s.map((function(e){return e.startTime+e.duration}))),c=Math.max.apply(Math,l),d={interactionTarget:On(u),interactionTargetElement:u,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:c,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:i-t.startTime,processingDuration:r-i,presentationDelay:Math.max(c-r,0),loadState:kn(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}((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,Di,s),this.addIfPresent(c,"interaction_target",a),this.addIfPresent(c,"interaction_type",u),this.pushMeasurement(l,c)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureLCP(){var e;!function(e,t){!function(e,t){t=t||{},qn((function(){var n,i=$n(),r=jn("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-An(),0),r.entries=[e],n())}))},s=_n("largest-contentful-paint",o);if(s){n=Nn(e,r,Ti,t.reportAllChanges);var a=Rn((function(){Ei[r.id]||(o(s.takeRecords()),s.disconnect(),Ei[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return oi(a)}),{once:!0,capture:!0})})),Dn(a),Pn((function(i){r=jn("LCP"),n=Nn(e,r,Ti,t.reportAllChanges),Mn((function(){r.value=performance.now()-i.timeStamp,Ei[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=In();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:On(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,Ri,r);const a=this.buildInitialContext(e);this.addIfPresent(a,"element",o),this.pushMeasurement(s,a)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureTTFB(){var e;!function(e,t){xi((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)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}buildInitialValues(e){const t=e.name.toLowerCase();return{[t]:e.value,delta:e.delta}}buildInitialContext(e){var t;const n=null!==(t=Le(Mi,xe.session))&&void 0!==t?t:we;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 Fi extends oe{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=se}initialize(){this.logDebug("Initializing");this.intializeWebVitalsInstrumentation().initialize()}intializeWebVitalsInstrumentation(){var e;return(null===(e=this.config)||void 0===e?void 0:e.trackWebVitalsAttribution)?new Ui(this.api.pushMeasurement,this.config.webVitalsInstrumentation):new Sn(this.api.pushMeasurement,this.config.webVitalsInstrumentation)}}function Bi(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 zi=/^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/;function Vi(e=[]){for(const t of e)if("traceparent"===t.name){if(!zi.test(t.description))continue;const[,e,n]=t.description.split("-");if(null!=e&&null!=n)return{traceId:e,spanId:n};break}}function $i(e=[],t){return e.some((e=>e&&null!=t.match(e)))}function qi(e,t={}){for(const[n,i]of Object.entries(t)){const t=e[n];return null!=t&&(d(i)?i.includes(t):t===i)}return!0}function Gi(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:g,requestStart:v,responseEnd:m,responseStart:h,responseStatus:b,secureConnectionStart:w,transferSize:y,workerStart:S}=e;return{name:c,duration:Wi(s),tcpHandshakeTime:Wi(t-n),dnsLookupTime:Wi(r-o),tlsNegotiationTime:Wi(v-w),responseStatus:Wi(b),redirectTime:Wi(f-p),requestTime:Wi(h-v),responseTime:Wi(m-h),fetchTime:Wi(m-u),serviceWorkerTime:Wi(u-S),decodedBodySize:Wi(i),encodedBodySize:Wi(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:Wi(g),protocol:d,initiatorType:l,visibilityState:document.visibilityState,ttfb:Wi(h-v)}}function Hi(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({},Gi(e)),{pageLoadTime:Wi(n-s),documentParsingTime:Wi(d?o-d:null),domProcessingTime:Wi(n-o),domContentLoadHandlerTime:Wi(i-r),onLoadTime:Wi(a-u),ttfb:Wi(Math.max(l-(null!=t?t:0),0)),type:c})}function Wi(e){return null==e?we:"number"==typeof e?Math.round(e).toString():e.toString()}const Ki={initiatorType:["xmlhttprequest","fetch"]};class Xi extends oe{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-performance",this.version=se}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)}}((()=>Bi(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||$i(t,o.name))return;const s=o.toJSON();let a=Vi(null==s?void 0:s.serverTiming);const u=null!==(r=Le(Mi,xe.session))&&void 0!==r?r:we,l=Object.assign(Object.assign({},Hi(s)),{faroNavigationId:_(),faroPreviousNavigationId:u});Ce(Mi,l.faroNavigationId,xe.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($i(i,e.name))return;const o=e.toJSON();let s=Vi(null==o?void 0:o.serverTiming);if(null==r&&qi(o,Ki)||r){const e=Object.assign(Object.assign({},Gi(o)),{faroNavigationId:t,faroResourceId:_()});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 Ji(e={}){const t=[new It,new Fi,new Xe,new kt];return!1!==e.enablePerformanceInstrumentation&&t.unshift(new Xi),!1!==e.captureConsole&&t.push(new Et({disabledLevels:e.captureConsoleDisabledLevels})),t}const Zi="browser",Yi=()=>{const e=window.k6;return{k6:Object.assign({isK6Browser:!0},(null==e?void 0:e.testRunId)&&{testRunId:null==e?void 0:e.testRunId})}};let Qi,er;function tr({generatePageId:e,initialPageMeta:t}={}){return()=>{const n=location.href;return c(e)&&Qi!==n&&(Qi=n,er=e(location)),{page:Object.assign(Object.assign({url:n},er?{id:er}:{}),t)}}}class nr extends W{constructor(e){var t,n,i,r;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=se,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=A({size:null!==(i=e.bufferSize)&&void 0!==i?i:30,concurrency:null!==(r=e.concurrency)&&void 0!==r?r:5})}send(e){return Bi(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(Z(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=>Bi(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(P),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}=Ke(i);$e({fetchUserSession:e,storeUserSession:r})({forceSessionExtend:!0}),t(`${n} created new session.`)}else t(`${n}.`)}}function ir(e){var t;const n=[],i=$(e.unpatchedConsole,e.internalLoggerLevel);e.transports?((e.url||e.apiKey)&&i.error('if "transports" is defined, "url" and "apiKey" should not be defined'),n.push(...e.transports)):e.url?n.push(new nr({url:e.url,apiKey:e.apiKey})):i.error('either "url" or "transports" must be defined');const{app:r,batching:o,beforeSend:s,consoleInstrumentation:a,ignoreErrors:u,sessionTracking:l,trackResources:c,trackWebVitalsAttribution:d,user:f,view:p,geoLocationTracking:g,dedupe:v=!0,eventDomain:m=Zi,globalObjectKey:h=fe,instrumentations:b=Ji(),internalLoggerLevel:w=F,isolate:y=!1,logArgsSerializer:S=ie,metas:T=rr(e),paused:E=!1,preventGlobalExposure:I=!1,unpatchedConsole:k=B,webVitalsInstrumentation:x}=e;return{app:r,batching:Object.assign(Object.assign({},pe),o),dedupe:v,globalObjectKey:h,instrumentations:b,internalLoggerLevel:w,isolate:y,logArgsSerializer:S,metas:T,parseStacktrace:wt,paused:E,preventGlobalExposure:I,transports:n,unpatchedConsole:k,beforeSend:s,eventDomain:m,ignoreErrors:u,ignoreUrls:(null!==(t=e.ignoreUrls)&&void 0!==t?t:[]).concat([/\/collect(?:\/[\w]*)?$/]),sessionTracking:Object.assign(Object.assign(Object.assign({},Fe),l),or({geoLocationTracking:g,sessionTracking:l})),user:f,view:p,trackResources:c,trackWebVitalsAttribution:d,consoleInstrumentation:a,webVitalsInstrumentation:x}}function rr(e){var t,n;const{page:i,generatePageId:r}=null!==(t=null==e?void 0:e.pageTracking)&&void 0!==t?t:{},o=[Ie,tr({generatePageId:r,initialPageMeta:i}),...null!==(n=e.metas)&&void 0!==n?n:[]];return l(window.k6)?[...o,Yi]:o}function or({geoLocationTracking:e,sessionTracking:t}){var n;const i={};return null!=(null==e?void 0:e.enabled)&&(i.geoLocationTrackingEnabled=e.enabled),T(i)?{}:{session:Object.assign(Object.assign({},null!==(n=null==t?void 0:t.session)&&void 0!==n?n:{}),{overrides:i})}}return e.BaseExtension=H,e.BaseInstrumentation=oe,e.BaseTransport=W,e.ConsoleInstrumentation=Et,e.ConsoleTransport=class extends W{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-console",this.version=se}send(t){var n;return this.unpatchedConsole[null!==(n=this.options.level)&&void 0!==n?n:e.LogLevel.DEBUG]("New event",Z([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=he,e.EVENT_SESSION_RESUME=me,e.EVENT_SESSION_START=ve,e.EVENT_VIEW_CHANGED=ge,e.ErrorsInstrumentation=It,e.FetchTransport=nr,e.MAX_SESSION_PERSISTENCE_TIME=Ue,e.MAX_SESSION_PERSISTENCE_TIME_BUFFER=6e4,e.PerformanceInstrumentation=Xi,e.PersistentSessionsManager=He,e.SESSION_EXPIRATION_TIME=De,e.SESSION_INACTIVITY_TIME=Re,e.STORAGE_KEY=Me,e.SessionInstrumentation=Xe,e.VERSION=se,e.ViewInstrumentation=kt,e.VolatileSessionsManager=We,e.WebVitalsInstrumentation=Fi,e.allLogLevels=C,e.browserMeta=Ie,e.buildStackFrame=mt,e.createInternalLogger=$,e.createPromiseBuffer=A,e.createSession=ke,e.deepEqual=E,e.defaultEventDomain=Zi,e.defaultExceptionType=Y,e.defaultGlobalObjectKey=fe,e.defaultInternalLoggerLevel=F,e.defaultLogLevel=L,e.genShortID=_,e.getCurrentTimestamp=k,e.getDataFromSafariExtensions=ht,e.getIgnoreUrls=function(){return e.faro.transports.transports.flatMap((e=>e.getIgnoreUrls()))},e.getInternalFaroFromGlobalObject=function(){return N[ae]},e.getStackFramesFromError=bt,e.getTransportBody=Z,e.getWebInstrumentations=Ji,e.globalObject=N,e.initializeFaro=function(e){const t=ir(e);if(t)return de(t)},e.internalGlobalObjectKey=ae,e.isArray=d,e.isBoolean=e=>i(e,"boolean"),e.isDomError=b,e.isDomException=w,e.isElement=e=>y&&o(e,Element),e.isElementDefined=y,e.isEmpty=T,e.isError=m,e.isErrorDefined=v,e.isErrorEvent=h,e.isEvent=g,e.isEventDefined=p,e.isFunction=c,e.isInstanceOf=o,e.isInt=e=>u(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=le,e.isMap=e=>S&&o(e,Map),e.isMapDefined=S,e.isNull=s,e.isNumber=u,e.isObject=l,e.isPrimitive=f,e.isRegExp=e=>r(e,"RegExp"),e.isString=a,e.isSymbol=e=>i(e,"symbol"),e.isSyntheticEvent=e=>l(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>c(null==e?void 0:e.then),e.isToString=r,e.isTypeof=i,e.isUndefined=e=>i(e,"undefined"),e.makeCoreConfig=ir,e.noop=P,e.parseStacktrace=wt,e.sdkMeta=()=>({sdk:{name:"@grafana/faro-core",version:se,integrations:e.faro.config.instrumentations.map((({name:e,version:t})=>({name:e,version:t})))}}),e.setInternalFaroOnGlobalObject=ue,e.transportItemTypeToBodyKey=X,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=>t(e,"boolean"),u=e=>!r(e)&&t(e,"object"),c=e=>t(e,"function"),l=e=>n(e,"Array"),d=e=>!u(e)&&!c(e),f="undefined"!=typeof Event,p=e=>f&&i(e,Event),g="undefined"!=typeof Error,v=e=>g&&i(e,Error),m=e=>n(e,"ErrorEvent"),h=e=>n(e,"DOMError"),b=e=>n(e,"DOMException"),w="undefined"!=typeof Element,y="undefined"!=typeof Map;function S(e){return null==e||(l(e)||o(e)?0===e.length:!!u(e)&&0===Object.keys(e).length)}function E(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(!E(e[i],n[i]))return!1;return!0}const o=u(e),s=u(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(!E(e[i],n[i]))return!1;return!0}return!1}function T(){return Date.now()}function I(){return(new Date).toISOString()}function k(e){return new Date(e).toISOString()}var x;e.LogLevel=void 0,(x=e.LogLevel||(e.LogLevel={})).TRACE="trace",x.DEBUG="debug",x.INFO="info",x.LOG="log",x.WARN="warn",x.ERROR="error";const O=e.LogLevel.LOG,L=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function A(){}function C(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 P="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function M(e=10){return Array.from(Array(e)).map((()=>P[Math.floor(Math.random()*P.length)])).join("")}const _="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;function N(e={}){return JSON.stringify(null!=e?e:{},function(){const e=new WeakSet;return function(t,n){if(u(n)&&null!==n){if(e.has(n))return null;e.add(n)}return n}}())}function j(e={}){const t={};for(const[n,i]of Object.entries(e))t[n]=u(i)&&null!==i?N(i):String(i);return t}class D{constructor(){this.subscribers=[]}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>this.unsubscribe(e)}}notify(e){this.subscribers.forEach((t=>t(e)))}first(e){const t=this.subscribe((n=>{e(n),t.unsubscribe()}));return t}takeWhile(e){const t=new D,n=this.subscribe((i=>{e(i)?t.notify(i):n.unsubscribe()}));return t}unsubscribeAll(){this.subscribers=[]}unsubscribe(e){this.subscribers=this.subscribers.filter((t=>t!==e))}}function R(...e){const t=new D;return e.forEach((e=>{e.subscribe((e=>{t.notify(e)}))})),{subscribe:t.subscribe.bind(t),takeWhile:t.takeWhile.bind(t),first:t.first.bind(t),notify:t.notify.bind(t),unsubscribeAll:()=>{e.forEach((e=>{e.unsubscribeAll()}))}}}class U{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=[]}}function B(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},c=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 l;(null===(r=n.batching)||void 0===r?void 0:r.enabled)&&(l=new U(c,{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)}))},getBeforeSendHooks:()=>[...a],execute:e=>{var i;s||((null===(i=n.batching)||void 0===i?void 0:i.enabled)&&(null==l||l.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==l||l.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==l||l.start(),s=!1}}}var F;e.InternalLoggerLevel=void 0,(F=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[F.OFF=0]="OFF",F[F.ERROR=1]="ERROR",F[F.WARN=2]="WARN",F[F.INFO=3]="INFO",F[F.VERBOSE=4]="VERBOSE";const z={debug:A,error:A,info:A,prefix:"Faro",warn:A},V=e.InternalLoggerLevel.ERROR,q=Object.assign({},console);let $=q;function G(e){var t;return $=null!==(t=e.unpatchedConsole)&&void 0!==t?t:$,$}function H(t=q,n=V){const i=z;return n>e.InternalLoggerLevel.OFF&&(i.error=n>=e.InternalLoggerLevel.ERROR?function(...e){t.error(`${i.prefix}\n`,...e)}:A,i.warn=n>=e.InternalLoggerLevel.WARN?function(...e){t.warn(`${i.prefix}\n`,...e)}:A,i.info=n>=e.InternalLoggerLevel.INFO?function(...e){t.info(`${i.prefix}\n`,...e)}:A,i.debug=n>=e.InternalLoggerLevel.VERBOSE?function(...e){t.debug(`${i.prefix}\n`,...e)}:A),i}let W=z;function K(e,t){return W=H(e,t.internalLoggerLevel),W}class X{constructor(){this.unpatchedConsole=q,this.internalLogger=z,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 J extends X{isBatched(){return!1}getIgnoreUrls(){return[]}}var Y;e.TransportItemType=void 0,(Y=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",Y.LOG="log",Y.MEASUREMENT="measurement",Y.TRACE="trace",Y.EVENT="event";const Z={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function Q(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 ee(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=Z[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:Q(n.traces,t.payload.resourceSpans)})}})),n}const te="user-action-start",ne="user-action-end",ie="user-action-cancel";const re="Error",oe=e=>e.map((e=>u(e)?N(e):String(e))).join(" ");let se;function ae({internalLogger:t,config:n,metas:i,transports:s,tracesApi:a,actionBuffer:c,getMessage:d}){var f;t.debug("Initializing exceptions API");let p=null;se=null!==(f=n.parseStacktrace)&&void 0!==f?f:se;const g=e=>{t.debug("Changing stacktrace parser"),se=null!=e?e:se},{ignoreErrors:m=[]}=n;return g(n.parseStacktrace),{changeStacktraceParser:g,getStacktraceParser:()=>se,pushError:(f,{skipDedupe:g,stackFrames:h,type:b,context:w,spanContext:y,timestampOverwriteMs:T}={})=>{if(!function(e,t){const{message:n,name:i,stack:r}=t;return s=e,a=n+" "+i+" "+r,s.some((e=>o(e)?a.includes(e):!!a.match(e)));var s,a}(m,f))try{const o=j(Object.assign(Object.assign({},function(e){let t=e.cause;v(t)?t=e.cause.toString():null!==t&&(u(e.cause)||l(e.cause))?t=N(e.cause):null!=t&&(t=e.cause.toString());return null==t?{}:{cause:t}}(f)),null!=w?w:{})),m={meta:i.value,payload:{type:b||f.name||re,value:f.message,timestamp:T?k(T):I(),trace:y?{trace_id:y.traceId,span_id:y.spanId}:a.getTraceContext(),context:S(o)?void 0:o},type:e.TransportItemType.EXCEPTION};(null==(h=null!=h?h:f.stack?null==se?void 0:se(f).frames:void 0)?void 0:h.length)&&(m.payload.stacktrace={frames:h});const x={type:m.payload.type,value:m.payload.value,stackTrace:m.payload.stacktrace,context:m.payload.context};if(!g&&n.dedupe&&!r(p)&&E(x,p))return void t.debug("Skipping error push because it is the same as the last one\n",m.payload);p=x,t.debug("Pushing exception\n",m);const O=d();O&&O.type===te?c.addItem(m):s.execute(m)}catch(e){t.error("Error pushing event",e)}}}}const ue=e=>e.map((e=>{try{return String(e)}catch(e){return""}})).join(" ");class ce{constructor(){this.buffer=[]}addItem(e){this.buffer.push(e)}flushBuffer(e){if(c(e))for(const t of this.buffer)e(t);this.buffer.length=0}size(){return this.buffer.length}}function le({apiMessageBus:t,transports:n,config:i}){const r=new ce,o=i.trackUserActionsExcludeItem;let s;t.subscribe((t=>{if(t.type!==te){if(t.type===ne){const{id:i,name:a}=t;return r.flushBuffer((t=>{if(function(t,n){return(null==n?void 0:n(t))||t.type===e.TransportItemType.MEASUREMENT&&"web-vitals"===t.payload.type}(t,o))return void n.execute(t);const r=Object.assign(Object.assign({},t),{payload:Object.assign(Object.assign({},t.payload),{action:{parentId:i,name:a}})});n.execute(r)})),void(s=void 0)}t.type===ie&&(s=void 0,r.flushBuffer((e=>{n.execute(e)})))}else s=t}));return{actionBuffer:r,getMessage:()=>s}}const de=new D;function fe(t,n,i,s,a){n.debug("Initializing API");const{actionBuffer:u,getMessage:c}=le({apiMessageBus:de,transports:a,config:i}),l=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,s,a),d={unpatchedConsole:t,internalLogger:n,config:i,metas:s,transports:a,tracesApi:l,actionBuffer:u,getMessage:c};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},l),ae(d)),function({internalLogger:e,metas:t}){let n,i,r,s;e.debug("Initializing meta API");const a=e=>{i&&t.remove(i),i={user:e},t.add(i)},u=(e,i)=>{var r;const o=null==i?void 0:i.overrides,s=o?{overrides:Object.assign(Object.assign({},null===(r=null==n?void 0:n.session)||void 0===r?void 0:r.overrides),o)}:{};n&&t.remove(n),n={session:Object.assign(Object.assign({},S(e)?void 0:e),s)},t.add(n)},c=()=>t.value.session,l=()=>t.value.page;return{setUser:a,resetUser:a,setSession:u,resetSession:u,getSession:c,setView:(e,n)=>{var i;if((null==n?void 0:n.overrides)&&u(c(),{overrides:n.overrides}),(null===(i=null==r?void 0:r.view)||void 0===i?void 0:i.name)===(null==e?void 0:e.name))return;const o=r;r={view:e},t.add(r),o&&t.remove(o)},getView:()=>t.value.view,setPage:e=>{var n;const i=o(e)?Object.assign(Object.assign({},null!==(n=null==s?void 0:s.page)&&void 0!==n?n:l()),{id:e}):e;s&&t.remove(s),s={page:i},t.add(s)},getPage:l}}(d)),function({internalLogger:t,config:n,metas:i,transports:o,tracesApi:s,actionBuffer:a,getMessage:u}){var c;t.debug("Initializing logs API");let l=null;const d=null!==(c=n.logArgsSerializer)&&void 0!==c?c:ue;return{pushLog:(c,{context:f,level:p,skipDedupe:g,spanContext:v,timestampOverwriteMs:m}={})=>{try{const h=j(f),b={type:e.TransportItemType.LOG,payload:{message:d(c),level:null!=p?p:O,context:S(h)?void 0:h,timestamp:m?k(m):I(),trace:v?{trace_id:v.traceId,span_id:v.spanId}:s.getTraceContext()},meta:i.value},w={message:b.payload.message,level:b.payload.level,context:b.payload.context};if(!g&&n.dedupe&&!r(l)&&E(w,l))return void t.debug("Skipping log push because it is the same as the last one\n",b.payload);l=w,t.debug("Pushing log\n",b);const y=u();y&&y.type===te?a.addItem(b):o.execute(b)}catch(e){t.error("Error pushing log\n",e)}}}}(d)),function({internalLogger:t,config:n,metas:i,transports:o,tracesApi:s,actionBuffer:a,getMessage:u}){t.debug("Initializing measurements API");let c=null;return{pushMeasurement:(l,{skipDedupe:d,context:f,spanContext:p,timestampOverwriteMs:g}={})=>{try{const v=j(f),m={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},l),{trace:p?{trace_id:p.traceId,span_id:p.spanId}:s.getTraceContext(),timestamp:g?k(g):I(),context:S(v)?void 0:v}),meta:i.value},h={type:m.payload.type,values:m.payload.values,context:m.payload.context};if(!d&&n.dedupe&&!r(c)&&E(h,c))return void t.debug("Skipping measurement push because it is the same as the last one\n",m.payload);c=h,t.debug("Pushing measurement\n",m);const b=u();b&&b.type===te?a.addItem(m):o.execute(m)}catch(e){t.error("Error pushing measurement\n",e)}}}}(d)),function({internalLogger:t,config:n,metas:i,transports:o,tracesApi:s,actionBuffer:a,getMessage:u}){let c=null;return{pushEvent:(l,d,f,{skipDedupe:p,spanContext:g,timestampOverwriteMs:v,customPayloadTransformer:m=e=>e}={})=>{try{const h=j(d),b={meta:i.value,payload:m({name:l,domain:null!=f?f:n.eventDomain,attributes:S(h)?void 0:h,timestamp:v?k(v):I(),trace:g?{trace_id:g.traceId,span_id:g.spanId}:s.getTraceContext()}),type:e.TransportItemType.EVENT},w={name:b.payload.name,attributes:b.payload.attributes,domain:b.payload.domain};if(!p&&n.dedupe&&!r(c)&&E(w,c))return void t.debug("Skipping event push because it is the same as the last one\n",b.payload);c=w,t.debug("Pushing event\n",b);const y=u();y&&y.type===te?a.addItem(b):o.execute(b)}catch(e){t.error("Error pushing event",e)}}}}(d))}class pe extends X{constructor(){super(...arguments),this.api={},this.transports={}}}const ge="1.14.2";const ve="_faroInternal";function me(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(_,ve,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function he(){return ve in _}function be(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},me(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 we(e){const t=G(e),n=K(t,e);if(he()&&!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,c(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=B(t,n,e,i),o=fe(t,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=be(t,n,e,i,r,o,s);return function(e){var t,n;const i={sdk:{version:ge},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)}(a),function(e){e.instrumentations.add(...e.config.instrumentations)}(a),a}e.faro={};const ye="faro",Se={enabled:!0,sendTimeout:250,itemLimit:50},Ee="view_changed",Te="session_start",Ie="session_resume",ke="session_extend",xe="service_name_override",Oe="unknown";var Le,Ae={exports:{}},Ce=Ae.exports;var Pe=(Le||(Le=1,function(e,t){!function(n,i){var r="function",o="undefined",s="object",a="string",u="major",c="model",l="name",d="type",f="vendor",p="version",g="architecture",v="console",m="mobile",h="tablet",b="smarttv",w="wearable",y="embedded",S="Amazon",E="Apple",T="ASUS",I="BlackBerry",k="Browser",x="Chrome",O="Firefox",L="Google",A="Huawei",C="LG",P="Microsoft",M="Motorola",_="Opera",N="Samsung",j="Sharp",D="Sony",R="Xiaomi",U="Zebra",B="Facebook",F="Chromium OS",z="Mac OS",V=" Browser",q=function(e){for(var t={},n=0;n<e.length;n++)t[e[n].toUpperCase()]=e[n];return t},$=function(e,t){return typeof e===a&&-1!==G(t).indexOf(G(e))},G=function(e){return e.toLowerCase()},H=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===o?e:e.substring(0,500)},W=function(e,t){for(var n,o,a,u,c,l,d=0;d<t.length&&!c;){var f=t[d],p=t[d+1];for(n=o=0;n<f.length&&!c&&f[n];)if(c=f[n++].exec(e))for(a=0;a<p.length;a++)l=c[++o],typeof(u=p[a])===s&&u.length>0?2===u.length?typeof u[1]==r?this[u[0]]=u[1].call(this,l):this[u[0]]=u[1]:3===u.length?typeof u[1]!==r||u[1].exec&&u[1].test?this[u[0]]=l?l.replace(u[1],u[2]):i:this[u[0]]=l?u[1].call(this,l,u[2]):i:4===u.length&&(this[u[0]]=l?u[3].call(this,l.replace(u[1],u[2])):i):this[u]=l||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($(t[n][r],e))return"?"===n?i:n}else if($(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,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,p],[/opios[\/ ]+([\w\.]+)/i],[p,[l,_+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[p,[l,_+" GX"]],[/\bopr\/([\w\.]+)/i],[p,[l,_]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[l,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[p,[l,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/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|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[l,p],[/quark(?:pc)?\/([-\w\.]+)/i],[p,[l,"Quark"]],[/\bddg\/([\w\.]+)/i],[p,[l,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[l,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[p,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[l,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[p,[l,"Smart Lenovo "+k]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+k],p],[/\bfocus\/([\w\.]+)/i],[p,[l,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[l,_+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[l,_+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI"+V]],[/fxios\/([\w\.-]+)/i],[p,[l,O]],[/\bqihoobrowser\/?([\w\.]*)/i],[p,[l,"360"]],[/\b(qq)\/([\w\.]+)/i],[[l,/(.+)/,"$1Browser"],p],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1"+V],p],[/samsungbrowser\/([\w\.]+)/i],[p,[l,N+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[p,[l,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[l,"Sogou Mobile"],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[l,p],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[l],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[p,l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,B],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],[l,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[l,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[p,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[l,x+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,x+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[l,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[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],[l,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],p],[/(wolvic|librewolf)\/([\w\.]+)/i],[l,p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[l,O+" 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],[l,[p,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[l,[p,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,G]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",G]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,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],[c,[f,N],[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],[c,[f,N],[d,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[c,[f,E],[d,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[c,[f,E],[d,h]],[/(macintosh);/i],[c,[f,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[c,[f,j],[d,m]],[/(?:honor)([-\w ]+)[;\)]/i],[c,[f,"Honor"],[d,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[c,[f,A],[d,h]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[c,[f,A],[d,m]],[/\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],[[c,/_/g," "],[f,R],[d,m]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[c,/_/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],[c,[f,"OPPO"],[d,m]],[/\b(opd2\d{3}a?) bui/i],[c,[f,"OPPO"],[d,h]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[c,[f,"Vivo"],[d,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[c,[f,"Realme"],[d,m]],[/\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],[c,[f,M],[d,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[c,[f,M],[d,h]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[c,[f,C],[d,h]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[c,[f,C],[d,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[c,[f,"Lenovo"],[d,h]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[c,/_/g," "],[f,"Nokia"],[d,m]],[/(pixel c)\b/i],[c,[f,L],[d,h]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[c,[f,L],[d,m]],[/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],[c,[f,D],[d,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[c,"Xperia Tablet"],[f,D],[d,h]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[c,[f,"OnePlus"],[d,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[c,[f,S],[d,h]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[c,/(.+)/g,"Fire Phone $1"],[f,S],[d,m]],[/(playbook);[-\w\),; ]+(rim)/i],[c,f,[d,h]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[c,[f,I],[d,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[c,[f,T],[d,h]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[c,[f,T],[d,m]],[/(nexus 9)/i],[c,[f,"HTC"],[d,h]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[c,/_/g," "],[d,m]],[/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],[c,[f,"TCL"],[d,h]],[/(itel) ((\w+))/i],[[f,G],c,[d,K,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[c,[f,"Acer"],[d,h]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[c,[f,"Meizu"],[d,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[c,[f,"Ulefone"],[d,m]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[c,[f,"Energizer"],[d,m]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[c,[f,"Cat"],[d,m]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[c,[f,"Smartfren"],[d,m]],[/droid.+; (a(?:015|06[35]|142p?))/i],[c,[f,"Nothing"],[d,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[f,c,[d,m]],[/(imo) (tab \w+)/i,/(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,c,[d,h]],[/(surface duo)/i],[c,[f,P],[d,h]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[c,[f,"Fairphone"],[d,m]],[/(u304aa)/i],[c,[f,"AT&T"],[d,m]],[/\bsie-(\w*)/i],[c,[f,"Siemens"],[d,m]],[/\b(rct\w+) b/i],[c,[f,"RCA"],[d,h]],[/\b(venue[\d ]{2,7}) b/i],[c,[f,"Dell"],[d,h]],[/\b(q(?:mv|ta)\w+) b/i],[c,[f,"Verizon"],[d,h]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[c,[f,"Barnes & Noble"],[d,h]],[/\b(tm\d{3}\w+) b/i],[c,[f,"NuVision"],[d,h]],[/\b(k88) b/i],[c,[f,"ZTE"],[d,h]],[/\b(nx\d{3}j) b/i],[c,[f,"ZTE"],[d,m]],[/\b(gen\d{3}) b.+49h/i],[c,[f,"Swiss"],[d,m]],[/\b(zur\d{3}) b/i],[c,[f,"Swiss"],[d,h]],[/\b((zeki)?tb.*\b) b/i],[c,[f,"Zeki"],[d,h]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],c,[d,h]],[/\b(ns-?\w{0,9}) b/i],[c,[f,"Insignia"],[d,h]],[/\b((nxa|next)-?\w{0,9}) b/i],[c,[f,"NextBook"],[d,h]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],c,[d,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],c,[d,m]],[/\b(ph-1) /i],[c,[f,"Essential"],[d,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[c,[f,"Envizen"],[d,h]],[/\b(trio[-\w\. ]+) b/i],[c,[f,"MachSpeed"],[d,h]],[/\btu_(1491) b/i],[c,[f,"Rotor"],[d,h]],[/(shield[\w ]+) b/i],[c,[f,"Nvidia"],[d,h]],[/(sprint) (\w+)/i],[f,c,[d,m]],[/(kin\.[onetw]{3})/i],[[c,/\./g," "],[f,P],[d,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[c,[f,U],[d,h]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[c,[f,U],[d,m]],[/smart-tv.+(samsung)/i],[f,[d,b]],[/hbbtv.+maple;(\d+)/i],[[c,/^/,"SmartTV"],[f,N],[d,b]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,C],[d,b]],[/(apple) ?tv/i],[f,[c,E+" TV"],[d,b]],[/crkey/i],[[c,x+"cast"],[f,L],[d,b]],[/droid.+aft(\w+)( bui|\))/i],[c,[f,S],[d,b]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[c,[f,j],[d,b]],[/(bravia[\w ]+)( bui|\))/i],[c,[f,D],[d,b]],[/(mitv-\w{5}) bui/i],[c,[f,R],[d,b]],[/Hbbtv.*(technisat) (.*);/i],[f,c,[d,b]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[f,H],[c,H],[d,b]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,c,[d,v]],[/droid.+; (shield) bui/i],[c,[f,"Nvidia"],[d,v]],[/(playstation [345portablevi]+)/i],[c,[f,D],[d,v]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[c,[f,P],[d,v]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[c,[f,N],[d,w]],[/((pebble))app/i],[f,c,[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[c,[f,E],[d,w]],[/droid.+; (glass) \d/i],[c,[f,L],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[c,[f,U],[d,w]],[/droid.+; (glass) \d/i],[c,[f,L],[d,w]],[/(pico) (4|neo3(?: link|pro)?)/i],[f,c,[d,w]],[/; (quest( \d| pro)?)/i],[c,[f,B],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[d,y]],[/(aeobc)\b/i],[c,[f,S],[d,y]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[c,[d,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[c,[d,h]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,h]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,m]],[/(android[-\w\. ]{0,9});.+buil/i],[c,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[l,p],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[l,p],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,p],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[l,[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],[l,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,z],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,p],[/\(bb(10);/i],[p,[l,I]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[p,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[l,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[l,x+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,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],[l,p],[/(sunos) ?([\w\.\d]*)/i],[[l,"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],[l,p]]},Y=function(e,t){if(typeof e===s&&(t=e,e=i),!(this instanceof Y))return new Y(e,t).getResult();var v=typeof n!==o&&n.navigator?n.navigator:i,b=e||(v&&v.userAgent?v.userAgent:""),w=v&&v.userAgentData?v.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=v&&v.userAgent==b;return this.getBrowser=function(){var e,t={};return t[l]=i,t[p]=i,W.call(t,b,y.browser),t[u]=typeof(e=t[p])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:i,S&&v&&v.brave&&typeof v.brave.isBrave==r&&(t[l]="Brave"),t},this.getCPU=function(){var e={};return e[g]=i,W.call(e,b,y.cpu),e},this.getDevice=function(){var e={};return e[f]=i,e[c]=i,e[d]=i,W.call(e,b,y.device),S&&!e[d]&&w&&w.mobile&&(e[d]=m),S&&"Macintosh"==e[c]&&v&&typeof v.standalone!==o&&v.maxTouchPoints&&v.maxTouchPoints>2&&(e[c]="iPad",e[d]=h),e},this.getEngine=function(){var e={};return e[l]=i,e[p]=i,W.call(e,b,y.engine),e},this.getOS=function(){var e={};return e[l]=i,e[p]=i,W.call(e,b,y.os),S&&!e[l]&&w&&w.platform&&"Unknown"!=w.platform&&(e[l]=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?H(e,500):e,this},this.setUA(b),this};Y.VERSION="1.0.40",Y.BROWSER=q([l,p,u]),Y.CPU=q([g]),Y.DEVICE=q([c,f,d,v,m,b,h,w,y]),Y.ENGINE=Y.OS=q([l,p]),e.exports&&(t=e.exports=Y),t.UAParser=Y;var Z=typeof n!==o&&(n.jQuery||n.Zepto);if(Z&&!Z.ua){var Q=new Y;Z.ua=Q.getResult(),Z.ua.get=function(){return Q.getUA()},Z.ua.set=function(e){Q.setUA(e);var t=Q.getResult();for(var n in t)Z.ua[n]=t[n]}}}("object"==typeof window?window:Ce)}(Ae,Ae.exports)),Ae.exports);const Me=()=>{const e=new Pe.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:Oe,version:null!=n?n:Oe,os:`${null!=i?i:Oe} ${null!=r?r:Oe}`,userAgent:null!=o?o:Oe,language:null!=s?s:Oe,mobile:a,brands:null!=u?u:Oe,viewportWidth:`${window.innerWidth}`,viewportHeight:`${window.innerHeight}`}}};function _e(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:M(),attributes:t}}const Ne={session:"sessionStorage",local:"localStorage"};function je(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 De(e,t){return ze(t)?window[t].getItem(e):null}function Re(e,t,n){if(ze(n))try{window[n].setItem(e,t)}catch(e){}}function Ue(e,t){ze(t)&&window[t].removeItem(e)}const Be=je(Ne.local),Fe=je(Ne.session);function ze(e){return e===Ne.local?Be:e===Ne.session&&Fe}function Ve(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 qe(){return e.faro.transports.transports.flatMap((e=>e.getIgnoreUrls()))}function $e(e=""){return qe().some((t=>e&&null!=e.match(t)))}const Ge="com.grafana.faro.session",He=144e5,We=9e5,Ke=We,Xe={enabled:!0,persistent:!1,maxSessionPersistenceTime:Ke};function Je(){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}function Ye({sessionId:t,started:n,lastActivity:i,isSampled:r=!0}={}){var o,s;const a=T(),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():M()),{sessionId:t,lastActivity:null!=i?i:a,started:null!=n?n:a,isSampled:r}}function Ze(e){if(null==e)return!1;const t=T();if(!(t-e.started<He))return!1;return t-e.lastActivity<We}function Qe({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&&!Be||!u&&!Fe)return;const c=t();if(!1===i&&Ze(c))n(Object.assign(Object.assign({},c),{lastActivity:T()}));else{let t=et(Ye({isSampled:Je()}),c);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==c?void 0:c.sessionMeta)&&void 0!==s?s:null,t.sessionMeta)}}}function et(t,n){var i,r,o,s,a,u,c;const l=Object.assign(Object.assign({},t),{sessionMeta:{id:t.sessionId,attributes: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:{}),{isSampled:t.isSampled.toString()})}}),d=null!==(u=null===(a=e.faro.metas.value.session)||void 0===a?void 0:a.overrides)&&void 0!==u?u:null===(c=null==n?void 0:n.sessionMeta)||void 0===c?void 0:c.overrides;S(d)||(l.sessionMeta.overrides=d);const f=null==n?void 0:n.sessionId;return null!=f&&(l.sessionMeta.attributes.previousSession=f),l}function tt({fetchUserSession:t,storeUserSession:n}){return function(i){const r=i.session,o=t();let s=null==r?void 0:r.id;const a=null==r?void 0:r.attributes,u=null==r?void 0:r.overrides,c=null==o?void 0:o.sessionMeta,l=null==c?void 0:c.overrides,d=!!u&&!E(u,l),f=!!a&&!E(a,null==c?void 0:c.attributes);if(!!r&&s!==(null==o?void 0:o.sessionId)||f||d){const t=et(Ye({sessionId:s,isSampled:Je()}),o);n(t),function(t,n={},i={}){var r,o,s;if(!t)return;const a=n.serviceName,u=null!==(s=null!==(r=i.serviceName)&&void 0!==r?r:null===(o=e.faro.metas.value.app)||void 0===o?void 0:o.name)&&void 0!==s?s:"";a&&a!==u&&e.faro.api.pushEvent(xe,{serviceName:a,previousServiceName:u})}(d,u,l),e.faro.api.setSession(t.sessionMeta)}}}class nt{constructor(){this.updateSession=Ve((()=>this.updateUserSession()),1e3),this.updateUserSession=Qe({fetchUserSession:nt.fetchUserSession,storeUserSession:nt.storeUserSession}),this.init()}static removeUserSession(){Ue(Ge,nt.storageTypeLocal)}static storeUserSession(e){Re(Ge,N(e),nt.storageTypeLocal)}static fetchUserSession(){const e=De(Ge,nt.storageTypeLocal);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener(tt({fetchUserSession:nt.fetchUserSession,storeUserSession:nt.storeUserSession}))}}nt.storageTypeLocal=Ne.local;class it{constructor(){this.updateSession=Ve((()=>this.updateUserSession()),1e3),this.updateUserSession=Qe({fetchUserSession:it.fetchUserSession,storeUserSession:it.storeUserSession}),this.init()}static removeUserSession(){Ue(Ge,it.storageTypeSession)}static storeUserSession(e){Re(Ge,N(e),it.storageTypeSession)}static fetchUserSession(){const e=De(Ge,it.storageTypeSession);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener(tt({fetchUserSession:it.fetchUserSession,storeUserSession:it.storeUserSession}))}}function rt(e){return(null==e?void 0:e.persistent)?nt:it}it.storageTypeSession=Ne.session;class ot extends pe{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=ge}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(ke,{},void 0,{skipDedupe:!0}),void(this.notifiedSession=i);this.notifiedSession=i,this.api.pushEvent(Te,{},void 0,{skipDedupe:!0})}}createInitialSession(e,t){var n,i,r,o,s,a;let u,c,l=e.fetchUserSession();if(t.persistent&&t.maxSessionPersistenceTime&&l){const e=T();l.lastActivity<e-t.maxSessionPersistenceTime&&(nt.removeUserSession(),l=null)}if(Ze(l)){const e=null==l?void 0:l.sessionId;c=Ye({sessionId:e,isSampled:l.isSampled||!1,started:null==l?void 0:l.started});const r=null==l?void 0:l.sessionMeta,o=Object.assign(Object.assign({},null===(n=t.session)||void 0===n?void 0:n.overrides),null==r?void 0:r.overrides);c.sessionMeta=Object.assign(Object.assign({},t.session),{id:e,attributes:Object.assign(Object.assign(Object.assign({},null===(i=t.session)||void 0===i?void 0:i.attributes),null==r?void 0:r.attributes),{isSampled:c.isSampled.toString()}),overrides:o}),u=Ie}else{const e=null!==(o=null===(r=t.session)||void 0===r?void 0:r.id)&&void 0!==o?o:_e().id;c=Ye({sessionId:e,isSampled:Je()});const n=null===(s=t.session)||void 0===s?void 0:s.overrides;c.sessionMeta=Object.assign({id:e,attributes:Object.assign({isSampled:c.isSampled.toString()},null===(a=t.session)||void 0===a?void 0:a.attributes)},n?{overrides:n}:{}),u=Te}return{initialSession:c,lifecycleType:u}}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=rt(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===Te&&this.api.pushEvent(Te,{},void 0,{skipDedupe:!0}),i===Ie&&this.api.pushEvent(Ie,{},void 0,{skipDedupe:!0})}this.metas.addListener(this.sendSessionStartEvent.bind(this))}}const st="DOMError",at="DOMException",ut="Non-Error exception captured with keys:",ct="?",lt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;const dt="\n",ft="eval",pt="?",gt="@",vt=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,mt=/\((\S*)(?::(\d+))(?::(\d+))\)/,ht="eval",bt="address at ",wt=bt.length,yt=/^\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,St=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Et=" > eval",Tt="safari-extension",It="safari-web-extension",kt=/Minified React error #\d+;/i;function xt(e,t,n,i){const r={filename:e||document.location.href,function:t||pt};return void 0!==n&&(r.lineno=n),void 0!==i&&(r.colno=i),r}function Ot(e,t){const n=null==e?void 0:e.includes(Tt),i=!n&&(null==e?void 0:e.includes(It));return n||i?[(null==e?void 0:e.includes(gt))?e.split(gt)[0]:e,n?`${Tt}:${t}`:`${It}:${t}`]:[e,t]}function Lt(e){let t=[];e.stacktrace?t=e.stacktrace.split(dt).filter(((e,t)=>t%2==0)):e.stack&&(t=e.stack.split(dt));const n=t.reduce(((t,n,i)=>{let r,o,a,u,c;if(r=vt.exec(n)){if(o=r[1],a=r[2],u=r[3],c=r[4],null==a?void 0:a.startsWith(ht)){const e=mt.exec(a);e&&(a=e[1],u=e[2],c=e[3])}a=(null==a?void 0:a.startsWith(bt))?a.substring(wt):a,[o,a]=Ot(o,a)}else if(r=yt.exec(n)){if(o=r[1],a=r[3],u=r[4],c=r[5],a&&a.includes(Et)){const e=St.exec(a);e&&(o=o||ft,a=e[1],u=e[2])}else 0===i&&!c&&s(e.columnNumber)&&(c=String(e.columnNumber+1));[o,a]=Ot(o,a)}return(a||o)&&t.push(xt(a,o,u?Number(u):void 0,c?Number(c):void 0)),t}),[]);return kt.test(e.message)?n.slice(1):n}function At(e){return{frames:Lt(e)}}function Ct(e){let t,n,i,r,o=[];if(m(e)&&e.error)t=e.error.message,n=e.error.name,o=Lt(e.error);else if((i=h(e))||b(e)){const{name:r,message:o}=e;n=null!=r?r:i?st:at,t=o?`${n}: ${o}`:n}else v(e)?(t=e.message,o=Lt(e)):(u(e)||(r=p(e)))&&(n=r?e.constructor.name:void 0,t=`${ut} ${Object.keys(e)}`);return[t,n,o]}function Pt(e){const[t,n,i,r,s]=e;let a,u,c=[];const l=o(t),d=xt(n,ct,i,r);return s||!l?([a,u,c]=Ct(null!=s?s:t),0===c.length&&(c=[d])):l&&([a,u]=function(e){var t,n;const i=e.match(lt),r=null!==(t=null==i?void 0:i[1])&&void 0!==t?t:re;return[null!==(n=null==i?void 0:i[2])&&void 0!==n?n:e,r]}(t),c=[d]),{value:a,type:u,stackFrames:c}}function Mt(e,t){return v(e[0])?Pt(e):{value:t(e)}}class _t extends pe{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=ge,this.errorSerializer=ue}initialize(){var t,n,i,r;this.options=Object.assign(Object.assign({},this.options),this.config.consoleInstrumentation);const o=(null===(t=this.options)||void 0===t?void 0:t.serializeErrors)||!!(null===(n=this.options)||void 0===n?void 0:n.errorSerializer);this.errorSerializer=o?null!==(r=null===(i=this.options)||void 0===i?void 0:i.errorSerializer)&&void 0!==r?r:oe:ue,L.filter((e=>{var t,n;return!(null!==(n=null===(t=this.options)||void 0===t?void 0:t.disabledLevels)&&void 0!==n?n:_t.defaultDisabledLevels).includes(e)})).forEach((t=>{console[t]=(...n)=>{var i,r;try{if(t!==e.LogLevel.ERROR||(null===(i=this.options)||void 0===i?void 0:i.consoleErrorAsLog))if(t===e.LogLevel.ERROR&&(null===(r=this.options)||void 0===r?void 0:r.consoleErrorAsLog)){const{value:e,type:i,stackFrames:r}=Mt(n,this.errorSerializer);this.api.pushLog(e?[_t.consoleErrorPrefix+e]:n,{level:t,context:{value:null!=e?e:"",type:null!=i?i:"",stackFrames:(null==r?void 0:r.length)?oe(r):""}})}else this.api.pushLog(n,{level:t});else{const{value:e,type:t,stackFrames:i}=Mt(n,this.errorSerializer);if(e&&!t&&!i)return void this.api.pushError(new Error(_t.consoleErrorPrefix+e));this.api.pushError(new Error(_t.consoleErrorPrefix+e),{type:t,stackFrames:i})}}catch(e){this.logError(e)}finally{this.unpatchedConsole[t](...n)}}}))}}_t.defaultDisabledLevels=[e.LogLevel.DEBUG,e.LogLevel.TRACE,e.LogLevel.LOG],_t.consoleErrorPrefix="console.error: ";class Nt extends pe{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=ge}initialize(){var e;this.logDebug("Initializing"),function(e){const t=window.onerror;window.onerror=(...n)=>{try{const{value:t,type:i,stackFrames:r}=Pt(n);t&&e.pushError(new Error(t),{type:i,stackFrames:r})}finally{null==t||t.apply(window,n)}}}(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=[];d(s)?(r=`Non-Error promise rejection captured with value: ${String(s)}`,o="UnhandledRejection"):[r,o,a]=Ct(s),r&&e.pushError(new Error(r),{type:o,stackFrames:a})}))}}class jt extends pe{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=ge}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(Ee,{fromView:null!==(i=null===(n=this.notifiedView)||void 0===n?void 0:n.name)&&void 0!==i?i:Oe,toView:null!==(r=o.name)&&void 0!==r?r:Oe},void 0,{skipDedupe:!0}),this.notifiedView=o)}initialize(){this.metas.addListener(this.sendViewChangedEvent.bind(this))}}var Dt,Rt,Ut,Bt,Ft,zt=-1,Vt=function(e){addEventListener("pageshow",(function(t){t.persisted&&(zt=t.timeStamp,e(t))}),!0)},qt=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},$t=function(){var e=qt();return e&&e.activationStart||0},Gt=function(e,t){var n=qt(),i="navigate";return zt>=0?i="back-forward-cache":n&&(document.prerendering||$t()>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}},Ht=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){}},Wt=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))}},Kt=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Xt=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Jt=function(e){var t=!1;return function(){t||(e(),t=!0)}},Yt=-1,Zt=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Qt=function(e){"hidden"===document.visibilityState&&Yt>-1&&(Yt="visibilitychange"===e.type?e.timeStamp:0,tn())},en=function(){addEventListener("visibilitychange",Qt,!0),addEventListener("prerenderingchange",Qt,!0)},tn=function(){removeEventListener("visibilitychange",Qt,!0),removeEventListener("prerenderingchange",Qt,!0)},nn=function(){return Yt<0&&(Yt=Zt(),en(),Vt((function(){setTimeout((function(){Yt=Zt(),en()}),0)}))),{get firstHiddenTime(){return Yt}}},rn=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},on=[1800,3e3],sn=function(e,t){t=t||{},rn((function(){var n,i=nn(),r=Gt("FCP"),o=Ht("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-$t(),0),r.entries.push(e),n(!0)))}))}));o&&(n=Wt(e,r,on,t.reportAllChanges),Vt((function(i){r=Gt("FCP"),n=Wt(e,r,on,t.reportAllChanges),Kt((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},an=[.1,.25],un=0,cn=1/0,ln=0,dn=function(e){e.forEach((function(e){e.interactionId&&(cn=Math.min(cn,e.interactionId),ln=Math.max(ln,e.interactionId),un=ln?(ln-cn)/7+1:0)}))},fn=function(){return Dt?un:performance.interactionCount||0},pn=[],gn=new Map,vn=0,mn=[],hn=function(e){if(mn.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=pn[pn.length-1],n=gn.get(e.interactionId);if(n||pn.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]};gn.set(i.id,i),pn.push(i)}pn.sort((function(e,t){return t.latency-e.latency})),pn.length>10&&pn.splice(10).forEach((function(e){return gn.delete(e.id)}))}}},bn=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Jt(e),"hidden"===document.visibilityState?e():(n=t(e),Xt(e)),n},wn=[200,500],yn=[2500,4e3],Sn={},En=[800,1800],Tn=function e(t){document.prerendering?rn((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},In={passive:!0,capture:!0},kn=new Date,xn=function(e,t){Rt||(Rt=t,Ut=e,Bt=new Date,An(removeEventListener),On())},On=function(){if(Ut>=0&&Ut<Bt-kn){var e={entryType:"first-input",name:Rt.type,target:Rt.target,cancelable:Rt.cancelable,startTime:Rt.timeStamp,processingStart:Rt.timeStamp+Ut};Ft.forEach((function(t){t(e)})),Ft=[]}},Ln=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(){xn(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,In),removeEventListener("pointercancel",i,In)};addEventListener("pointerup",n,In),addEventListener("pointercancel",i,In)}(t,e):xn(t,e)}},An=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,Ln,In)}))},Cn=[100,300];class Pn{constructor(e,t){this.pushMeasurement=e,this.webVitalConfig=t}initialize(){Object.entries(Pn.mapping).forEach((([e,t])=>{var n;t((t=>{this.pushMeasurement({type:"web-vitals",values:{[e]:t.value}})}),{reportAllChanges:null===(n=this.webVitalConfig)||void 0===n?void 0:n.reportAllChanges})}))}}Pn.mapping={cls:function(e,t){t=t||{},sn(Jt((function(){var n,i=Gt("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=Ht("layout-shift",s);a&&(n=Wt(e,i,an,t.reportAllChanges),Xt((function(){s(a.takeRecords()),n(!0)})),Vt((function(){r=0,i=Gt("CLS",0),n=Wt(e,i,an,t.reportAllChanges),Kt((function(){return n()}))})),setTimeout(n,0))})))},fcp:sn,fid:function(e,t){t=t||{},rn((function(){var n,i=nn(),r=Gt("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=Ht("first-input",s);n=Wt(e,r,Cn,t.reportAllChanges),a&&(Xt(Jt((function(){s(a.takeRecords()),a.disconnect()}))),Vt((function(){var i;r=Gt("FID"),n=Wt(e,r,Cn,t.reportAllChanges),Ft=[],Ut=-1,Rt=null,An(addEventListener),i=o,Ft.push(i),On()})))}))},inp:function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},rn((function(){var n;"interactionCount"in performance||Dt||(Dt=Ht("event",dn,{type:"event",buffered:!0,durationThreshold:0}));var i,r=Gt("INP"),o=function(e){bn((function(){e.forEach(hn);var t=function(){var e=Math.min(pn.length-1,Math.floor((fn()-vn)/50));return pn[e]}();t&&t.latency!==r.value&&(r.value=t.latency,r.entries=t.entries,i())}))},s=Ht("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=Wt(e,r,wn,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Xt((function(){o(s.takeRecords()),i(!0)})),Vt((function(){vn=fn(),pn.length=0,gn.clear(),r=Gt("INP"),i=Wt(e,r,wn,t.reportAllChanges)})))})))},lcp:function(e,t){t=t||{},rn((function(){var n,i=nn(),r=Gt("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-$t(),0),r.entries=[e],n())}))},s=Ht("largest-contentful-paint",o);if(s){n=Wt(e,r,yn,t.reportAllChanges);var a=Jt((function(){Sn[r.id]||(o(s.takeRecords()),s.disconnect(),Sn[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return bn(a)}),{once:!0,capture:!0})})),Xt(a),Vt((function(i){r=Gt("LCP"),n=Wt(e,r,yn,t.reportAllChanges),Kt((function(){r.value=performance.now()-i.timeStamp,Sn[r.id]=!0,n(!0)}))}))}}))},ttfb:function(e,t){t=t||{};var n=Gt("TTFB"),i=Wt(e,n,En,t.reportAllChanges);Tn((function(){var r=qt();r&&(n.value=Math.max(r.responseStart-$t(),0),n.entries=[r],i(!0),Vt((function(){n=Gt("TTFB",0),(i=Wt(e,n,En,t.reportAllChanges))(!0)})))}))}};var Mn,_n,Nn=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},jn=function(e){if("loading"===document.readyState)return"loading";var t=Nn();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"},Dn=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Rn=function(e,t){var n="";try{for(;e&&9!==e.nodeType;){var i=e,r=i.id?"#"+i.id:Dn(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},Un=-1,Bn=function(){return Un},Fn=function(e){addEventListener("pageshow",(function(t){t.persisted&&(Un=t.timeStamp,e(t))}),!0)},zn=function(){var e=Nn();return e&&e.activationStart||0},Vn=function(e,t){var n=Nn(),i="navigate";return Bn()>=0?i="back-forward-cache":n&&(document.prerendering||zn()>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}},qn=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){}},$n=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))}},Gn=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Hn=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Wn=function(e){var t=!1;return function(){t||(e(),t=!0)}},Kn=-1,Xn=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Jn=function(e){"hidden"===document.visibilityState&&Kn>-1&&(Kn="visibilitychange"===e.type?e.timeStamp:0,Zn())},Yn=function(){addEventListener("visibilitychange",Jn,!0),addEventListener("prerenderingchange",Jn,!0)},Zn=function(){removeEventListener("visibilitychange",Jn,!0),removeEventListener("prerenderingchange",Jn,!0)},Qn=function(){return Kn<0&&(Kn=Xn(),Yn(),Fn((function(){setTimeout((function(){Kn=Xn(),Yn()}),0)}))),{get firstHiddenTime(){return Kn}}},ei=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},ti=[1800,3e3],ni=function(e,t){t=t||{},ei((function(){var n,i=Qn(),r=Vn("FCP"),o=qn("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-zn(),0),r.entries.push(e),n(!0)))}))}));o&&(n=$n(e,r,ti,t.reportAllChanges),Fn((function(i){r=Vn("FCP"),n=$n(e,r,ti,t.reportAllChanges),Gn((function(){r.value=performance.now()-i.timeStamp,n(!0)}))})))}))},ii=[.1,.25],ri=0,oi=1/0,si=0,ai=function(e){e.forEach((function(e){e.interactionId&&(oi=Math.min(oi,e.interactionId),si=Math.max(si,e.interactionId),ri=si?(si-oi)/7+1:0)}))},ui=function(){return Mn?ri:performance.interactionCount||0},ci=function(){"interactionCount"in performance||Mn||(Mn=qn("event",ai,{type:"event",buffered:!0,durationThreshold:0}))},li=[],di=new Map,fi=0,pi=[],gi=function(e){if(pi.forEach((function(t){return t(e)})),e.interactionId||"first-input"===e.entryType){var t=li[li.length-1],n=di.get(e.interactionId);if(n||li.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]};di.set(i.id,i),li.push(i)}li.sort((function(e,t){return t.latency-e.latency})),li.length>10&&li.splice(10).forEach((function(e){return di.delete(e.id)}))}}},vi=function(e){var t=self.requestIdleCallback||self.setTimeout,n=-1;return e=Wn(e),"hidden"===document.visibilityState?e():(n=t(e),Hn(e)),n},mi=[200,500],hi=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},ei((function(){var n;ci();var i,r=Vn("INP"),o=function(e){vi((function(){e.forEach(gi);var t=function(){var e=Math.min(li.length-1,Math.floor((ui()-fi)/50));return li[e]}();t&&t.latency!==r.value&&(r.value=t.latency,r.entries=t.entries,i())}))},s=qn("event",o,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});i=$n(e,r,mi,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),Hn((function(){o(s.takeRecords()),i(!0)})),Fn((function(){fi=ui(),li.length=0,di.clear(),r=Vn("INP"),i=$n(e,r,mi,t.reportAllChanges)})))})))},bi=[],wi=[],yi=0,Si=new WeakMap,Ei=new Map,Ti=-1,Ii=function(e){bi=bi.concat(e),ki()},ki=function(){Ti<0&&(Ti=vi(xi))},xi=function(){Ei.size>10&&Ei.forEach((function(e,t){di.has(t)||Ei.delete(t)}));var e=li.map((function(e){return Si.get(e.entries[0])})),t=wi.length-50;wi=wi.filter((function(n,i){return i>=t||e.includes(n)}));for(var n=new Set,i=0;i<wi.length;i++){var r=wi[i];Pi(r.startTime,r.processingEnd).forEach((function(e){n.add(e)}))}var o=bi.length-1-50;bi=bi.filter((function(e,t){return e.startTime>yi&&t>o||n.has(e)})),Ti=-1};pi.push((function(e){e.interactionId&&e.target&&!Ei.has(e.interactionId)&&Ei.set(e.interactionId,e.target)}),(function(e){var t,n=e.startTime+e.duration;yi=Math.max(yi,e.processingEnd);for(var i=wi.length-1;i>=0;i--){var r=wi[i];if(Math.abs(n-r.renderTime)<=8){(t=r).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:n,entries:[e]},wi.push(t)),(e.interactionId||"first-input"===e.entryType)&&Si.set(e,t),ki()}));var Oi,Li,Ai,Ci,Pi=function(e,t){for(var n,i=[],r=0;n=bi[r];r++)if(!(n.startTime+n.duration<e)){if(n.startTime>t)break;i.push(n)}return i},Mi=[2500,4e3],_i={},Ni=[800,1800],ji=function e(t){document.prerendering?ei((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},Di=function(e,t){t=t||{};var n=Vn("TTFB"),i=$n(e,n,Ni,t.reportAllChanges);ji((function(){var r=Nn();r&&(n.value=Math.max(r.responseStart-zn(),0),n.entries=[r],i(!0),Fn((function(){n=Vn("TTFB",0),(i=$n(e,n,Ni,t.reportAllChanges))(!0)})))}))},Ri={passive:!0,capture:!0},Ui=new Date,Bi=function(e,t){Oi||(Oi=t,Li=e,Ai=new Date,Vi(removeEventListener),Fi())},Fi=function(){if(Li>=0&&Li<Ai-Ui){var e={entryType:"first-input",name:Oi.type,target:Oi.target,cancelable:Oi.cancelable,startTime:Oi.timeStamp,processingStart:Oi.timeStamp+Li};Ci.forEach((function(t){t(e)})),Ci=[]}},zi=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(){Bi(e,t),r()},i=function(){r()},r=function(){removeEventListener("pointerup",n,Ri),removeEventListener("pointercancel",i,Ri)};addEventListener("pointerup",n,Ri),addEventListener("pointercancel",i,Ri)}(t,e):Bi(t,e)}},Vi=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,zi,Ri)}))},qi=[100,300],$i=function(e,t){!function(e,t){t=t||{},ei((function(){var n,i=Qn(),r=Vn("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=qn("first-input",s);n=$n(e,r,qi,t.reportAllChanges),a&&(Hn(Wn((function(){s(a.takeRecords()),a.disconnect()}))),Fn((function(){var i;r=Vn("FID"),n=$n(e,r,qi,t.reportAllChanges),Ci=[],Li=-1,Oi=null,Vi(addEventListener),i=o,Ci.push(i),Fi()})))}))}((function(t){var n=function(e){var t=e.entries[0],n={eventTarget:Rn(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:jn(t.startTime)};return Object.assign(e,{attribution:n})}(t);e(n)}),t)};const Gi="com.grafana.faro.lastNavigationId",Hi="load_state",Wi="time_to_first_byte";class Ki{constructor(e,t){this.corePushMeasurement=e,this.webVitalConfig=t}initialize(){this.measureCLS(),this.measureFCP(),this.measureFID(),this.measureINP(),this.measureLCP(),this.measureTTFB()}measureCLS(){var e;!function(e,t){!function(e,t){t=t||{},ni(Wn((function(){var n,i=Vn("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=qn("layout-shift",s);a&&(n=$n(e,i,ii,t.reportAllChanges),Hn((function(){s(a.takeRecords()),n(!0)})),Fn((function(){r=0,i=Vn("CLS",0),n=$n(e,i,ii,t.reportAllChanges),Gn((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:Rn(r.node),largestShiftTime:i.startTime,largestShiftValue:i.value,largestShiftSource:r,largestShiftEntry:i,loadState:jn(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,Hi,t),this.addIfPresent(s,"largest_shift_target",r),this.pushMeasurement(o,s)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureFCP(){var e;!function(e,t){ni((function(t){var n=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:jn(Bn())};if(e.entries.length){var n=Nn(),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:jn(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,Wi,n);const o=this.buildInitialContext(e);this.addIfPresent(o,Hi,i),this.pushMeasurement(r,o)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureFID(){var e;$i((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,Hi,r),this.pushMeasurement(o,s)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureINP(){var e;!function(e,t){_n||(_n=qn("long-animation-frame",Ii)),hi((function(t){var n=function(e){var t=e.entries[0],n=Si.get(t),i=t.processingStart,r=n.processingEnd,o=n.entries.sort((function(e,t){return e.processingStart-t.processingStart})),s=Pi(t.startTime,r),a=e.entries.find((function(e){return e.target})),u=a&&a.target||Ei.get(t.interactionId),c=[t.startTime+t.duration,r].concat(s.map((function(e){return e.startTime+e.duration}))),l=Math.max.apply(Math,c),d={interactionTarget:Rn(u),interactionTargetElement:u,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:l,processedEventEntries:o,longAnimationFrameEntries:s,inputDelay:i-t.startTime,processingDuration:r-i,presentationDelay:Math.max(l-r,0),loadState:jn(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(n)}),t)}((e=>{const{interactionTime:t,presentationDelay:n,inputDelay:i,processingDuration:r,nextPaintTime:o,loadState:s,interactionTarget:a,interactionType:u}=e.attribution,c=this.buildInitialValues(e);this.addIfPresent(c,"interaction_time",t),this.addIfPresent(c,"presentation_delay",n),this.addIfPresent(c,"input_delay",i),this.addIfPresent(c,"processing_duration",r),this.addIfPresent(c,"next_paint_time",o);const l=this.buildInitialContext(e);this.addIfPresent(l,Hi,s),this.addIfPresent(l,"interaction_target",a),this.addIfPresent(l,"interaction_type",u),this.pushMeasurement(c,l)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureLCP(){var e;!function(e,t){!function(e,t){t=t||{},ei((function(){var n,i=Qn(),r=Vn("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-zn(),0),r.entries=[e],n())}))},s=qn("largest-contentful-paint",o);if(s){n=$n(e,r,Mi,t.reportAllChanges);var a=Wn((function(){_i[r.id]||(o(s.takeRecords()),s.disconnect(),_i[r.id]=!0,n(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return vi(a)}),{once:!0,capture:!0})})),Hn(a),Fn((function(i){r=Vn("LCP"),n=$n(e,r,Mi,t.reportAllChanges),Gn((function(){r.value=performance.now()-i.timeStamp,_i[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=Nn();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),c=Math.max(u,r.startTime-i);t={element:Rn(r.element),timeToFirstByte:s,resourceLoadDelay:a-s,resourceLoadDuration:u-a,elementRenderDelay:c-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,Wi,r);const a=this.buildInitialContext(e);this.addIfPresent(a,"element",o),this.pushMeasurement(s,a)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}measureTTFB(){var e;!function(e,t){Di((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)}),{reportAllChanges:null===(e=this.webVitalConfig)||void 0===e?void 0:e.reportAllChanges})}buildInitialValues(e){const t=e.name.toLowerCase();return{[t]:e.value,delta:e.delta}}buildInitialContext(e){var t;const n=null!==(t=De(Gi,Ne.session))&&void 0!==t?t:Oe;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 Xi extends pe{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=ge}initialize(){this.logDebug("Initializing");this.intializeWebVitalsInstrumentation().initialize()}intializeWebVitalsInstrumentation(){var e;return(null===(e=this.config)||void 0===e?void 0:e.trackWebVitalsAttribution)?new Ki(this.api.pushMeasurement,this.config.webVitalsInstrumentation):new Pn(this.api.pushMeasurement,this.config.webVitalsInstrumentation)}}function Ji(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 Yi="resource",Zi=/^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/;function Qi(e=[]){for(const t of e)if("traceparent"===t.name){if(!Zi.test(t.description))continue;const[,e,n]=t.description.split("-");if(null!=e&&null!=n)return{traceId:e,spanId:n};break}}function er(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 tr(e){const{connectEnd:t,connectStart:n,decodedBodySize:i,domainLookupEnd:r,domainLookupStart:o,duration:s,encodedBodySize:a,fetchStart:u,initiatorType:c,name:l,nextHopProtocol:d,redirectEnd:f,redirectStart:p,renderBlockingStatus:g,requestStart:v,responseEnd:m,responseStart:h,responseStatus:b,secureConnectionStart:w,transferSize:y,workerStart:S}=e;return{name:l,duration:ir(s),tcpHandshakeTime:ir(t-n),dnsLookupTime:ir(r-o),tlsNegotiationTime:ir(v-w),responseStatus:ir(b),redirectTime:ir(f-p),requestTime:ir(h-v),responseTime:ir(m-h),fetchTime:ir(m-u),serviceWorkerTime:ir(u-S),decodedBodySize:ir(i),encodedBodySize:ir(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:ir(g),protocol:d,initiatorType:c,visibilityState:document.visibilityState,ttfb:ir(h-v)}}function nr(e){const{activationStart:t,domComplete:n,domContentLoadedEventEnd:i,domContentLoadedEventStart:r,domInteractive:o,fetchStart:s,loadEventEnd:a,loadEventStart:u,responseStart:c,type:l}=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({},tr(e)),{pageLoadTime:ir(n-s),documentParsingTime:ir(d?o-d:null),domProcessingTime:ir(n-o),domContentLoadHandlerTime:ir(i-r),onLoadTime:ir(a-u),ttfb:ir(Math.max(c-(null!=t?t:0),0)),type:l})}function ir(e){return null==e?Oe:"number"==typeof e?Math.round(e).toString():e.toString()}const rr={initiatorType:["xmlhttprequest","fetch"]};const or=new D;class sr extends pe{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-performance",this.version=ge}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)}}((()=>Ji(this,void 0,void 0,(function*(){const t=this.api.pushEvent,{faroNavigationId:n}=yield function(e){let t;const n=new Promise((e=>{t=e}));return new PerformanceObserver((n=>{var i;const[r]=n.getEntries();if(null==r||$e(r.name))return;const o=r.toJSON();let s=Qi(null==o?void 0:o.serverTiming);const a=null!==(i=De(Gi,Ne.session))&&void 0!==i?i:Oe,u=Object.assign(Object.assign({},nr(o)),{faroNavigationId:M(),faroPreviousNavigationId:a});Re(Gi,u.faroNavigationId,Ne.session),e("faro.performance.navigation",u,void 0,{spanContext:s,timestampOverwriteMs:performance.timeOrigin+o.startTime}),t(u)})).observe({type:"navigation",buffered:!0}),n}(t);null!=n&&function(t,n,i){const r=e.faro.config.trackResources;new PerformanceObserver((o=>{const s=o.getEntries();for(const o of s){if($e(o.name))return;const s=o.toJSON();let a=Qi(null==s?void 0:s.serverTiming);if(null==r&&er(s,rr)||r){const r=Object.assign(Object.assign({},tr(s)),{faroNavigationId:t,faroResourceId:M()});e.faro.config.trackUserActionsPreview&&(null==i||i.notify({type:Yi})),n("faro.performance.resource",r,void 0,{spanContext:a,timestampOverwriteMs:performance.timeOrigin+s.startTime})}}})).observe({type:Yi,buffered:!0})}(n,t,or)})))):this.logDebug("performance observer not supported. Disable performance instrumentation.")}}const ar="resource-entry",ur="http-request-start",cr="http-request-end",lr="dom-mutation",dr="data-faro-user-action-name";function fr(){const e=new D;let t=0,n=0;function i(){e.notify({type:ur,pending:t+n})}function r(){e.notify({type:cr,pending:t+n})}return function(e,t){const n=window.fetch;window.fetch=function(){const i=$e(function(e){if(o(e))return e;if(e instanceof URL)return e.href;if(c(null==e?void 0:e.toString))return e.toString();return}(arguments[0]));return i||e(),n.apply(this,arguments).finally((()=>{i||t()}))}}((()=>{n++,i()}),(()=>{n--,r()})),function(e,t){const n=XMLHttpRequest.prototype.open,i=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(){const i=$e(arguments[1]);this.addEventListener("loadstart",(()=>{i||e()})),this.addEventListener("loadend",(()=>{i||t()})),n.apply(this,arguments)},XMLHttpRequest.prototype.send=function(){i.apply(this,arguments)}}((()=>{t++,i()}),(()=>{t--,r()})),e}function pr(e){const{api:t,config:n}=e,i=fr(),r=function(){const e=new D;return new MutationObserver(((t,n)=>{e.notify({type:lr})})).observe(document,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),e}(),o=function(){const e=new D;return or.subscribe((t=>{t.type===Yi&&e.notify({type:ar})})),e}();let s,a,u,c=!1;return function(e,t){document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&(null==e||e.unsubscribe(),e=void 0,null==t||t.unsubscribeAll(),t=void 0)}))}(s,a),function(e){var l;const d=function(e,t){const n=function(e){const t=e.split("data-")[1],n=null==t?void 0:t.replace(/-(.)/g,((e,t)=>t.toUpperCase()));return null==n?void 0:n.replace(/-/g,"")}(t),i=e.dataset;for(const e in i)if(e===n)return i[e];return}(e.target,null!==(l=n.trackUserActionsDataAttributeName)&&void 0!==l?l:"faroUserActionName");if(c||null==d)return;c=!0;const f=T();let p;const g=M();de.notify({type:te,name:d,startTime:f,parentId:g}),u=gr(u,(()=>{p=T(),c=!1,function(e,t){de.notify({type:ie,name:e,parentId:t})}(d,g)})),a=R(i,r,o),s=a.takeWhile((()=>c)).subscribe((()=>{u=gr(u,(()=>{p=T();const n=p-f,i=e.type;de.notify({type:ne,name:d,id:g,startTime:f,endTime:p,duration:n,eventType:i}),t.pushEvent(d,{userActionStartTime:f.toString(),userActionEndTime:p.toString(),userActionDuration:n.toString(),userActionEventType:i},void 0,{timestampOverwriteMs:f,customPayloadTransformer:e=>(e.action={id:g,name:d},e)}),c=!1,null==s||s.unsubscribe(),null==a||a.unsubscribeAll()}))}))}}function gr(e,t){return e&&clearTimeout(e),e=setTimeout((()=>{t()}),100)}class vr extends pe{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-user-action",this.version=ge}initialize(){const t=pr(e.faro);window.addEventListener("pointerdown",t),window.addEventListener("keydown",t)}}function mr(e={}){const t=[new vr,new Nt,new Xi,new ot,new jt];return!1!==e.enablePerformanceInstrumentation&&t.unshift(new sr),!1!==e.captureConsole&&t.push(new _t({disabledLevels:e.captureConsoleDisabledLevels})),t}const hr="browser",br=()=>{const e=window.k6;return{k6:Object.assign({isK6Browser:!0},(null==e?void 0:e.testRunId)&&{testRunId:null==e?void 0:e.testRunId})}};let wr,yr;function Sr({generatePageId:e,initialPageMeta:t}={}){return()=>{const n=location.href;return c(e)&&wr!==n&&(wr=n,yr=e(location)),{page:Object.assign(Object.assign({url:n},yr?{id:yr}:{}),t)}}}class Er extends J{constructor(e){var t,n,i,r;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=ge,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=C({size:null!==(i=e.bufferSize)&&void 0!==i?i:30,concurrency:null!==(r=e.concurrency)&&void 0!==r?r:5})}send(e){return Ji(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(ee(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 c=this.metas.value.session;return null!=c&&(u=c.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=>Ji(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(A),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}=rt(i);Qe({fetchUserSession:e,storeUserSession:r})({forceSessionExtend:!0}),t(`${n} created new session.`)}else t(`${n}.`)}}function Tr(e){var t;const n=[],i=H(e.unpatchedConsole,e.internalLoggerLevel);e.transports?((e.url||e.apiKey)&&i.error('if "transports" is defined, "url" and "apiKey" should not be defined'),n.push(...e.transports)):e.url?n.push(new Er({url:e.url,apiKey:e.apiKey})):i.error('either "url" or "transports" must be defined');const{app:r,batching:o,beforeSend:s,consoleInstrumentation:a,ignoreErrors:u,sessionTracking:c,trackResources:l,trackWebVitalsAttribution:d,user:f,view:p,trackGeolocation:g,dedupe:v=!0,eventDomain:m=hr,globalObjectKey:h=ye,instrumentations:b=mr(),internalLoggerLevel:w=V,isolate:y=!1,logArgsSerializer:S=ue,metas:E=kr(e),paused:T=!1,preventGlobalExposure:I=!1,unpatchedConsole:k=q,webVitalsInstrumentation:x,trackUserActionsPreview:O=!1,trackUserActionsDataAttributeName:L=dr,trackUserActionsExcludeItem:A}=e;return{app:r,batching:Object.assign(Object.assign({},Se),o),dedupe:v,globalObjectKey:h,instrumentations:Ir(b,e),internalLoggerLevel:w,isolate:y,logArgsSerializer:S,metas:E,parseStacktrace:At,paused:T,preventGlobalExposure:I,transports:n,unpatchedConsole:k,beforeSend:s,eventDomain:m,ignoreErrors:u,ignoreUrls:(null!==(t=e.ignoreUrls)&&void 0!==t?t:[]).concat([/\/collect(?:\/[\w]*)?$/]),sessionTracking:Object.assign(Object.assign(Object.assign({},Xe),c),xr({trackGeolocation:g,sessionTracking:c})),user:f,view:p,trackResources:l,trackWebVitalsAttribution:d,consoleInstrumentation:a,webVitalsInstrumentation:x,trackUserActionsPreview:O,trackUserActionsDataAttributeName:L,trackUserActionsExcludeItem:A}}function Ir(e,{trackUserActionsPreview:t}){return e.filter((e=>!("@grafana/faro-web-sdk:instrumentation-user-action"===e.name&&!t)))}function kr(e){var t,n;const{page:i,generatePageId:r}=null!==(t=null==e?void 0:e.pageTracking)&&void 0!==t?t:{},o=[Me,Sr({generatePageId:r,initialPageMeta:i}),...null!==(n=e.metas)&&void 0!==n?n:[]];return u(window.k6)?[...o,br]:o}function xr({trackGeolocation:e,sessionTracking:t}){var n;const i={};return a(e)&&(i.geoLocationTrackingEnabled=e),S(i)?{}:{session:Object.assign(Object.assign({},null!==(n=null==t?void 0:t.session)&&void 0!==n?n:{}),{overrides:i})}}return e.BaseExtension=X,e.BaseInstrumentation=pe,e.BaseTransport=J,e.ConsoleInstrumentation=_t,e.ConsoleTransport=class extends J{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-console",this.version=ge}send(t){var n;return this.unpatchedConsole[null!==(n=this.options.level)&&void 0!==n?n:e.LogLevel.DEBUG]("New event",ee([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=ke,e.EVENT_SESSION_RESUME=Ie,e.EVENT_SESSION_START=Te,e.EVENT_VIEW_CHANGED=Ee,e.ErrorsInstrumentation=Nt,e.FetchTransport=Er,e.MAX_SESSION_PERSISTENCE_TIME=Ke,e.MAX_SESSION_PERSISTENCE_TIME_BUFFER=6e4,e.Observable=D,e.PerformanceInstrumentation=sr,e.PersistentSessionsManager=nt,e.SESSION_EXPIRATION_TIME=He,e.SESSION_INACTIVITY_TIME=We,e.STORAGE_KEY=Ge,e.SessionInstrumentation=ot,e.USER_ACTION_CANCEL_MESSAGE_TYPE=ie,e.USER_ACTION_END_MESSAGE_TYPE=ne,e.USER_ACTION_START_MESSAGE_TYPE=te,e.UserActionInstrumentation=vr,e.VERSION=ge,e.ViewInstrumentation=jt,e.VolatileSessionsManager=it,e.WebVitalsInstrumentation=Xi,e.allLogLevels=L,e.apiMessageBus=de,e.browserMeta=Me,e.buildStackFrame=xt,e.createInternalLogger=H,e.createPromiseBuffer=C,e.createSession=_e,e.deepEqual=E,e.defaultEventDomain=hr,e.defaultExceptionType=re,e.defaultGlobalObjectKey=ye,e.defaultInternalLoggerLevel=V,e.defaultLogLevel=O,e.genShortID=M,e.getCurrentTimestamp=I,e.getDataFromSafariExtensions=Ot,e.getIgnoreUrls=qe,e.getInternalFaroFromGlobalObject=function(){return _[ve]},e.getStackFramesFromError=Lt,e.getTransportBody=ee,e.getWebInstrumentations=mr,e.globalObject=_,e.initializeFaro=function(e){const t=Tr(e);if(t)return we(t)},e.internalGlobalObjectKey=ve,e.isArray=l,e.isBoolean=a,e.isDomError=h,e.isDomException=b,e.isElement=e=>w&&i(e,Element),e.isElementDefined=w,e.isEmpty=S,e.isError=v,e.isErrorDefined=g,e.isErrorEvent=m,e.isEvent=p,e.isEventDefined=f,e.isFunction=c,e.isInstanceOf=i,e.isInt=e=>s(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=he,e.isMap=e=>y&&i(e,Map),e.isMapDefined=y,e.isNull=r,e.isNumber=s,e.isObject=u,e.isPrimitive=d,e.isRegExp=e=>n(e,"RegExp"),e.isString=o,e.isSymbol=e=>t(e,"symbol"),e.isSyntheticEvent=e=>u(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>c(null==e?void 0:e.then),e.isToString=n,e.isTypeof=t,e.isUndefined=e=>t(e,"undefined"),e.makeCoreConfig=Tr,e.merge=R,e.noop=A,e.parseStacktrace=At,e.sdkMeta=()=>({sdk:{name:"@grafana/faro-core",version:ge,integrations:e.faro.config.instrumentations.map((({name:e,version:t})=>({name:e,version:t})))}}),e.setInternalFaroOnGlobalObject=me,e.transportItemTypeToBodyKey=Z,e.userActionDataAttribute=dr,e}({});
|
|
@@ -2,12 +2,13 @@ export { getWebInstrumentations, makeCoreConfig } from './config';
|
|
|
2
2
|
export type { BrowserConfig } from './config';
|
|
3
3
|
export { defaultEventDomain } from './consts';
|
|
4
4
|
export { initializeFaro } from './initialize';
|
|
5
|
-
export { buildStackFrame, ConsoleInstrumentation, ErrorsInstrumentation, getDataFromSafariExtensions, getStackFramesFromError, parseStacktrace, ViewInstrumentation, WebVitalsInstrumentation, SessionInstrumentation, PerformanceInstrumentation, } from './instrumentations';
|
|
5
|
+
export { buildStackFrame, ConsoleInstrumentation, ErrorsInstrumentation, getDataFromSafariExtensions, getStackFramesFromError, parseStacktrace, ViewInstrumentation, WebVitalsInstrumentation, SessionInstrumentation, PerformanceInstrumentation, UserActionInstrumentation, } from './instrumentations';
|
|
6
6
|
export type { ConsoleInstrumentationOptions, ErrorEvent, ExtendedPromiseRejectionEvent } from './instrumentations';
|
|
7
7
|
export { browserMeta, createSession, sdkMeta } from './metas';
|
|
8
8
|
export { ConsoleTransport, FetchTransport } from './transports';
|
|
9
9
|
export type { ClockFn, ConsoleTransportOptions, FetchTransportOptions, FetchTransportRequestOptions, } from './transports';
|
|
10
|
-
export { faro, allLogLevels, BaseExtension, BaseInstrumentation, BaseTransport, Conventions, createInternalLogger, createPromiseBuffer, deepEqual, defaultExceptionType, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogLevel, genShortID, getCurrentTimestamp, getInternalFaroFromGlobalObject, getTransportBody, globalObject, internalGlobalObjectKey, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isInternalFaroOnGlobalObject, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, isEmpty, InternalLoggerLevel, LogLevel, noop, setInternalFaroOnGlobalObject, TransportItemType, transportItemTypeToBodyKey, VERSION, EVENT_CLICK, EVENT_NAVIGATION, EVENT_ROUTE_CHANGE, EVENT_SESSION_EXTEND, EVENT_SESSION_RESUME, EVENT_SESSION_START, EVENT_VIEW_CHANGED, } from '@grafana/faro-core';
|
|
11
|
-
export type { Faro, API, APIEvent, BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue, BeforeSendHook, BufferItem, Config, EventAttributes, EventEvent, EventsAPI, ExceptionEvent, ExceptionStackFrame, ExceptionsAPI, ExtendedError, Extension, GlobalObject, Instrumentation, Instrumentations, InternalLogger, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, Meta, MetaAPI, MetaApp, MetaAttributes, MetaBrowser, MetaGetter, MetaItem, MetaPage, Metas, MetaSDK, MetaSDKIntegration, MetaSession, MetaUser, MetaView, OTELApi, Patterns, PromiseBuffer, PromiseBufferOptions, PromiseProducer, PushErrorOptions, PushLogOptions, PushMeasurementOptions, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, Transport, TransportBody, TransportItem, TransportItemPayload, Transports, UnpatchedConsole, } from '@grafana/faro-core';
|
|
10
|
+
export { faro, allLogLevels, BaseExtension, BaseInstrumentation, BaseTransport, Conventions, createInternalLogger, createPromiseBuffer, deepEqual, defaultExceptionType, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultLogLevel, genShortID, getCurrentTimestamp, getInternalFaroFromGlobalObject, getTransportBody, globalObject, internalGlobalObjectKey, isArray, isBoolean, isDomError, isDomException, isElement, isElementDefined, isError, isErrorDefined, isErrorEvent, isEvent, isEventDefined, isFunction, isInstanceOf, isInt, isInternalFaroOnGlobalObject, isMap, isMapDefined, isNull, isNumber, isObject, isPrimitive, isRegExp, isString, isSymbol, isSyntheticEvent, isThenable, isToString, isTypeof, isUndefined, isEmpty, InternalLoggerLevel, LogLevel, noop, setInternalFaroOnGlobalObject, TransportItemType, transportItemTypeToBodyKey, VERSION, EVENT_CLICK, EVENT_NAVIGATION, EVENT_ROUTE_CHANGE, EVENT_SESSION_EXTEND, EVENT_SESSION_RESUME, EVENT_SESSION_START, EVENT_VIEW_CHANGED, apiMessageBus, Observable, merge, USER_ACTION_CANCEL_MESSAGE_TYPE, USER_ACTION_END_MESSAGE_TYPE, USER_ACTION_START_MESSAGE_TYPE, } from '@grafana/faro-core';
|
|
11
|
+
export type { Faro, API, APIEvent, BaseObject, BaseObjectKey, BaseObjectPrimitiveValue, BaseObjectValue, BeforeSendHook, BufferItem, Config, EventAttributes, EventEvent, EventsAPI, ExceptionEvent, ExceptionStackFrame, ExceptionsAPI, ExtendedError, Extension, GlobalObject, Instrumentation, Instrumentations, InternalLogger, LogContext, LogEvent, LogsAPI, MeasurementEvent, MeasurementsAPI, Meta, MetaAPI, MetaApp, MetaAttributes, MetaBrowser, MetaGetter, MetaItem, MetaPage, Metas, MetaSDK, MetaSDKIntegration, MetaSession, MetaUser, MetaView, OTELApi, Patterns, PromiseBuffer, PromiseBufferOptions, PromiseProducer, PushErrorOptions, PushLogOptions, PushMeasurementOptions, Stacktrace, StacktraceParser, TraceContext, TraceEvent, TracesAPI, Transport, TransportBody, TransportItem, TransportItemPayload, Transports, UnpatchedConsole, ApiMessageBusMessages, UserActionStartMessage, UserActionEndMessage, UserActionCancelMessage, UserAction, } from '@grafana/faro-core';
|
|
12
12
|
export { PersistentSessionsManager, VolatileSessionsManager, MAX_SESSION_PERSISTENCE_TIME, MAX_SESSION_PERSISTENCE_TIME_BUFFER, SESSION_EXPIRATION_TIME, SESSION_INACTIVITY_TIME, STORAGE_KEY, } from './instrumentations/session';
|
|
13
13
|
export { getIgnoreUrls } from './utils/url';
|
|
14
|
+
export { userActionDataAttribute } from './instrumentations/userActions/const';
|
|
@@ -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.14.
|
|
6
|
+
readonly version = "1.14.2";
|
|
7
7
|
static defaultDisabledLevels: LogLevel[];
|
|
8
8
|
static consoleErrorPrefix: string;
|
|
9
9
|
private errorSerializer;
|
|
@@ -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.14.
|
|
4
|
+
readonly version = "1.14.2";
|
|
5
5
|
initialize(): void;
|
|
6
6
|
}
|
|
@@ -7,3 +7,4 @@ export { ViewInstrumentation } from './view';
|
|
|
7
7
|
export { WebVitalsInstrumentation } from './webVitals';
|
|
8
8
|
export { PersistentSessionsManager, VolatileSessionsManager, MAX_SESSION_PERSISTENCE_TIME, MAX_SESSION_PERSISTENCE_TIME_BUFFER, SESSION_EXPIRATION_TIME, SESSION_INACTIVITY_TIME, STORAGE_KEY, } from './session';
|
|
9
9
|
export { PerformanceInstrumentation } from './performance';
|
|
10
|
+
export { UserActionInstrumentation, userActionDataAttribute } from './userActions';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { BaseInstrumentation } from '@grafana/faro-core';
|
|
1
|
+
import { BaseInstrumentation, Observable } from '@grafana/faro-core';
|
|
2
|
+
import type { ResourceEntryMessage } from './types';
|
|
3
|
+
export declare const performanceEntriesSubscription: Observable<ResourceEntryMessage>;
|
|
2
4
|
export declare class PerformanceInstrumentation extends BaseInstrumentation {
|
|
3
5
|
readonly name = "@grafana/faro-web-sdk:instrumentation-performance";
|
|
4
|
-
readonly version = "1.14.
|
|
6
|
+
readonly version = "1.14.2";
|
|
5
7
|
initialize(): void;
|
|
6
|
-
private getIgnoreUrls;
|
|
7
8
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { EventsAPI } from '@grafana/faro-core';
|
|
2
2
|
import type { FaroNavigationItem } from './types';
|
|
3
|
-
export declare function getNavigationTimings(pushEvent: EventsAPI['pushEvent']
|
|
3
|
+
export declare function getNavigationTimings(pushEvent: EventsAPI['pushEvent']): Promise<FaroNavigationItem>;
|
|
@@ -3,7 +3,6 @@ import type { FaroNavigationTiming, FaroResourceTiming } from './types';
|
|
|
3
3
|
type SpanContext = PushEventOptions['spanContext'];
|
|
4
4
|
export declare function getSpanContextFromServerTiming(serverTimings?: PerformanceServerTiming[]): SpanContext | undefined;
|
|
5
5
|
export declare function performanceObserverSupported(): boolean;
|
|
6
|
-
export declare function entryUrlIsIgnored(ignoredUrls: (string | RegExp)[] | undefined, entryName: string): boolean;
|
|
7
6
|
export declare function onDocumentReady(handleReady: () => void): void;
|
|
8
7
|
type PerformanceEntryAllowProperties = Record<string, Array<string | number> | string | number>;
|
|
9
8
|
export declare function includePerformanceEntry(performanceEntryJSON: Record<string, any>, allowProps?: PerformanceEntryAllowProperties): boolean;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import type { EventsAPI } from '@grafana/faro-core';
|
|
2
|
-
|
|
1
|
+
import type { EventsAPI, Observable } from '@grafana/faro-core';
|
|
2
|
+
import type { ResourceEntryMessage } from './types';
|
|
3
|
+
export declare function observeResourceTimings(faroNavigationId: string, pushEvent: EventsAPI['pushEvent'], observable: Observable<ResourceEntryMessage>): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { unknownString } from '@grafana/faro-core';
|
|
2
|
+
import type { RESOURCE_ENTRY } from './performanceConstants';
|
|
2
3
|
export type FaroNavigationTiming = Readonly<{
|
|
3
4
|
duration: string;
|
|
4
5
|
documentParsingTime: string;
|
|
@@ -38,3 +39,6 @@ export type FaroResourceItem = {
|
|
|
38
39
|
faroResourceId: string;
|
|
39
40
|
} & FaroResourceTiming;
|
|
40
41
|
export type CacheType = 'cache' | 'conditionalFetch' | 'fullLoad';
|
|
42
|
+
export type ResourceEntryMessage = {
|
|
43
|
+
type: typeof RESOURCE_ENTRY;
|
|
44
|
+
};
|
|
@@ -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.14.
|
|
4
|
+
readonly version = "1.14.2";
|
|
5
5
|
private notifiedSession;
|
|
6
6
|
private sendSessionStartEvent;
|
|
7
7
|
private createInitialSession;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const MESSAGE_TYPE_RESOURCE_ENTRY = "resource-entry";
|
|
2
|
+
export declare const MESSAGE_TYPE_HTTP_REQUEST_START = "http-request-start";
|
|
3
|
+
export declare const MESSAGE_TYPE_HTTP_REQUEST_END = "http-request-end";
|
|
4
|
+
export declare const MESSAGE_TYPE_HTTP_REQUEST_PENDING = "http-request-pending";
|
|
5
|
+
export declare const MESSAGE_TYPE_DOM_MUTATION = "dom-mutation";
|
|
6
|
+
export declare const userActionDataAttributeParsed = "faroUserActionName";
|
|
7
|
+
export declare const userActionDataAttribute = "data-faro-user-action-name";
|