@grafana/faro-web-sdk
Advanced tools
Comparing version 1.2.4 to 1.2.5
@@ -1,1 +0,1 @@ | ||
var GrafanaFaroWebSdk=function(e){"use strict";function n(e,n){return typeof e===n}function t(e,n){return Object.prototype.toString.call(e)===`[object ${n}]`}function i(e,n){try{return e instanceof n}catch(e){return!1}}const r=e=>n(e,"undefined"),o=e=>n(e,"null"),s=e=>n(e,"string"),a=e=>n(e,"number")&&!isNaN(e)||n(e,"bigint"),l=e=>!o(e)&&n(e,"object"),u=e=>n(e,"function"),c=e=>t(e,"Array"),d=e=>!l(e)&&!u(e),p=!r(Event),f=e=>p&&i(e,Event),g="undefined"!=typeof Error,b=e=>g&&i(e,Error),m=e=>t(e,"ErrorEvent"),v=e=>t(e,"DOMError"),h=e=>t(e,"DOMException"),w="undefined"!=typeof Element,y="undefined"!=typeof Map;function S(e,t){if(e===t)return!0;if(n(e,"number")&&isNaN(e))return n(t,"number")&&isNaN(t);const i=c(e),r=c(t);if(i!==r)return!1;if(i&&r){const n=e.length;if(n!==t.length)return!1;for(let i=n;0!=i--;)if(!S(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(!S(e[i],t[i]))return!1;return!0}return!1}function E(){return(new Date).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 T=e.LogLevel.LOG,k=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function I(){}function O(e){const{size:n,concurrency:t}=e,i=[];let r=0;const o=()=>{if(r<t&&i.length){const{producer:e,resolve:n,reject:t}=i.shift();r++,e().then((e=>{r--,o(),n(e)}),(e=>{r--,o(),t(e)}))}};return{add:e=>{if(i.length+r>=n)throw new Error("Task buffer full");return new Promise(((n,t)=>{i.push({producer:e,resolve:n,reject:t}),o()}))}}}const L="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function A(e=10){return Array.from(Array(e)).map((()=>L[Math.floor(Math.random()*L.length)])).join("")}function C(){return Date.now()}var N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},j={exports:{}},R={exports:{}};R.exports=function(e,n){var t,i,r,o,s,a,l,u;for(t=3&e.length,i=e.length-t,r=n,s=3432918353,a=461845907,u=0;u<i;)l=255&e.charCodeAt(u)|(255&e.charCodeAt(++u))<<8|(255&e.charCodeAt(++u))<<16|(255&e.charCodeAt(++u))<<24,++u,r=27492+(65535&(o=5*(65535&(r=(r^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,t){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(u)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return r^=e.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0};var D=R.exports,U={exports:{}};!function(e){e.exports=function(e,n){for(var t,i=e.length,r=n^i,o=0;i>=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),i-=4,++o;switch(i){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0}}(U);var M=D,P=U.exports;j.exports=M;var B=j.exports.murmur3=M;j.exports.murmur2=P;class _{constructor(e,n){var t,i;this.signalBuffer=[],this.itemLimit=null!==(t=null==n?void 0:n.itemLimit)&&void 0!==t?t:50,this.sendTimeout=null!==(i=null==n?void 0:n.sendTimeout)&&void 0!==i?i:250,this.paused=(null==n?void 0:n.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 n=new Map;return e.forEach((e=>{const t=B(JSON.stringify(e.meta));let i=n.get(t);i=void 0===i?[e]:[...i,e],n.set(t,i)})),Array.from(n.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}var z;e.TransportItemType=void 0,(z=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",z.LOG="log",z.MEASUREMENT="measurement",z.TRACE="trace",z.EVENT="event";const F={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function $(n){return t=>{if(t.type===e.TransportItemType.EXCEPTION&&t.payload){const e=t.payload,i=`${e.type}: ${e.value}`;if(function(e,n){return e.some((e=>s(e)?n.includes(e):!!n.match(e)))}(n,i))return null}return t}}var V;e.InternalLoggerLevel=void 0,(V=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[V.OFF=0]="OFF",V[V.ERROR=1]="ERROR",V[V.WARN=2]="WARN",V[V.INFO=3]="INFO",V[V.VERBOSE=4]="VERBOSE";const q={debug:I,error:I,info:I,prefix:"Faro",warn:I},G=e.InternalLoggerLevel.ERROR,W=Object.assign({},console);let H=W;function K(e){var n;return H=null!==(n=e.unpatchedConsole)&&void 0!==n?n:H,H}function J(n=W,t=G){const i=q;return t>e.InternalLoggerLevel.OFF&&(i.error=t>=e.InternalLoggerLevel.ERROR?function(...e){n.error(`${i.prefix}\n`,...e)}:I,i.warn=t>=e.InternalLoggerLevel.WARN?function(...e){n.warn(`${i.prefix}\n`,...e)}:I,i.info=t>=e.InternalLoggerLevel.INFO?function(...e){n.info(`${i.prefix}\n`,...e)}:I,i.debug=t>=e.InternalLoggerLevel.VERBOSE?function(...e){n.debug(`${i.prefix}\n`,...e)}:I),i}let X=q;function Z(e,n){return X=J(e,n.internalLoggerLevel),X}class Q{constructor(){this.unpatchedConsole=W,this.internalLogger=q,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 Y extends Q{isBatched(){return!1}getIgnoreUrls(){return[]}}function ee(e,n){var t,i;if(void 0===n)return e;if(void 0===e)return{resourceSpans:n};const r=null===(t=e.resourceSpans)||void 0===t?void 0:t[0];if(void 0===r)return e;const o=(null==r?void 0:r.scopeSpans)||[],s=(null===(i=null==n?void 0:n[0])||void 0===i?void 0:i.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},r),{scopeSpans:[...o,...s]})]})}function ne(n){let t={meta:{}};return void 0!==n[0]&&(t.meta=n[0].meta),n.forEach((n=>{switch(n.type){case e.TransportItemType.LOG:case e.TransportItemType.EVENT:case e.TransportItemType.EXCEPTION:case e.TransportItemType.MEASUREMENT:const i=F[n.type],r=t[i];t=Object.assign(Object.assign({},t),{[i]:void 0===r?[n.payload]:[...r,n.payload]});break;case e.TransportItemType.TRACE:t=Object.assign(Object.assign({},t),{traces:ee(t.traces,n.payload.resourceSpans)})}})),t}const te="Error";let ie;function re(n,t,i,r,s){t.debug("Initializing API");const a=function(n,t,i,r,o){let s;return t.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,n)=>{t.debug("Initializing OpenTelemetry"),s={trace:e,context:n}},isOTELInitialized:()=>!!s,pushTraces:n=>{try{const i={type:e.TransportItemType.TRACE,payload:n,meta:r.value};t.debug("Pushing trace\n",i),o.execute(i)}catch(e){t.error("Error pushing trace\n",e)}}}}(0,t,0,r,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),function(n,t,i,r,s,a){var l;t.debug("Initializing exceptions API");let u=null;ie=null!==(l=i.parseStacktrace)&&void 0!==l?l:ie;const c=e=>{t.debug("Changing stacktrace parser"),ie=null!=e?e:ie};return c(i.parseStacktrace),{changeStacktraceParser:c,getStacktraceParser:()=>ie,pushError:(n,{skipDedupe:l,stackFrames:c,type:d,context:p}={})=>{d=d||n.name||te;const f={meta:r.value,payload:{type:d,value:n.message,timestamp:E(),trace:a.getTraceContext(),context:null!=p?p:{}},type:e.TransportItemType.EXCEPTION};(null==(c=null!=c?c:n.stack?null==ie?void 0:ie(n).frames:void 0)?void 0:c.length)&&(f.payload.stacktrace={frames:c});const g={type:f.payload.type,value:f.payload.value,stackTrace:f.payload.stacktrace,context:f.payload.context};l||!i.dedupe||o(u)||!S(g,u)?(u=g,t.debug("Pushing exception\n",f),s.execute(f)):t.debug("Skipping error push because it is the same as the last one\n",f.payload)}}}(0,t,i,r,s,a)),function(e,n,t,i,r){let o,s,a;n.debug("Initializing meta API");const l=e=>{s&&i.remove(s),s={user:e},i.add(s)},u=e=>{o&&i.remove(o),o={session:e},i.add(o)};return{setUser:l,resetUser:l,setSession:u,resetSession:u,getSession:()=>i.value.session,setView:e=>{a&&i.remove(a),a={view:e},i.add(a)},getView:()=>i.value.view}}(0,t,0,r)),function(n,t,i,r,s,a){t.debug("Initializing logs API");let l=null;return{pushLog:(n,{context:u,level:c,skipDedupe:d}={})=>{try{const p={type:e.TransportItemType.LOG,payload:{message:n.map((e=>{try{return String(e)}catch(e){return""}})).join(" "),level:null!=c?c:T,context:null!=u?u:{},timestamp:E(),trace:a.getTraceContext()},meta:r.value},f={message:p.payload.message,level:p.payload.level,context:p.payload.context};if(!d&&i.dedupe&&!o(l)&&S(f,l))return void t.debug("Skipping log push because it is the same as the last one\n",p.payload);l=f,t.debug("Pushing log\n",p),s.execute(p)}catch(e){t.error("Error pushing log\n",e)}}}}(0,t,i,r,s,a)),function(n,t,i,r,s,a){t.debug("Initializing measurements API");let l=null;return{pushMeasurement:(n,{skipDedupe:u,context:c}={})=>{var d;try{const p={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},n),{trace:a.getTraceContext(),timestamp:null!==(d=n.timestamp)&&void 0!==d?d:E(),context:null!=c?c:{}}),meta:r.value},f={type:p.payload.type,values:p.payload.values,context:p.payload.context};if(!u&&i.dedupe&&!o(l)&&S(f,l))return void t.debug("Skipping measurement push because it is the same as the last one\n",p.payload);l=f,t.debug("Pushing measurement\n",p),s.execute(p)}catch(e){t.error("Error pushing measurement\n",e)}}}}(0,t,i,r,s,a)),function(n,t,i,r,s,a){let l=null;return{pushEvent:(n,u,c,{skipDedupe:d}={})=>{try{const p={meta:r.value,payload:{name:n,domain:null!=c?c:i.eventDomain,attributes:u,timestamp:E(),trace:a.getTraceContext()},type:e.TransportItemType.EVENT},f={name:p.payload.name,attributes:p.payload.attributes,domain:p.payload.domain};if(!d&&i.dedupe&&!o(l)&&S(f,l))return void t.debug("Skipping event push because it is the same as the last one\n",p.payload);l=f,t.debug("Pushing event\n",p),s.execute(p)}catch(e){t.error("Error pushing event",e)}}}}(0,t,i,r,s,a))}const oe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;class se extends Q{constructor(){super(...arguments),this.api={},this.transports={}}}const ae="1.2.4";const le="_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(oe,le,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function ce(){return le in oe}function de(n,t,i,r,o,s,a){return t.debug("Initializing Faro"),e.faro={api:s,config:i,instrumentations:a,internalLogger:t,metas:r,pause:o.pause,transports:o,unpatchedConsole:n,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 oe)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(oe,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}function pe(e){const n=K(e),t=Z(n,e);if(ce()&&!e.isolate)return void t.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');t.debug("Initializing");const i=function(e,n,t){let i=[],r=[];const o=()=>i.reduce(((e,n)=>Object.assign(e,u(n)?n():n)),{}),s=()=>{if(r.length){const e=o();r.forEach((n=>n(e)))}};return{add:(...e)=>{n.debug("Adding metas\n",e),i.push(...e),s()},remove:(...e)=>{n.debug("Removing metas\n",e),i=i.filter((n=>!e.includes(n))),s()},addListener:e=>{n.debug("Adding metas listener\n",e),r.push(e)},removeListener:e=>{n.debug("Removing metas listener\n",e),r=r.filter((n=>n!==e))},get value(){return o()}}}(0,t),r=function(e,n,t,i){var r;n.debug("Initializing transports");const o=[];let s=t.paused,a=[];const l=e=>{let n=e;for(const e of a){const t=n.map(e).filter(Boolean);if(0===t.length)return[];n=t}return n},u=e=>{const t=l(e);if(0!==t.length)for(const e of o)n.debug(`Transporting item using ${e.name}\n`,t),e.isBatched()&&e.send(t)},c=e=>{var i;const[r]=l([e]);if(void 0!==r)for(const e of o)n.debug(`Transporting item using ${e.name}\n`,r),e.isBatched()?(null===(i=t.batching)||void 0===i?void 0:i.enabled)||e.send([r]):e.send(r)};let d;return(null===(r=t.batching)||void 0===r?void 0:r.enabled)&&(d=new _(u,{sendTimeout:t.batching.sendTimeout,itemLimit:t.batching.itemLimit,paused:s})),{add:(...r)=>{n.debug("Adding transports"),r.forEach((r=>{n.debug(`Adding "${r.name}" transport`),o.some((e=>e===r))?n.warn(`Transport ${r.name} is already added`):(r.unpatchedConsole=e,r.internalLogger=n,r.config=t,r.metas=i,o.push(r))}))},addBeforeSendHooks:(...e)=>{n.debug("Adding beforeSendHooks\n",a),e.forEach((e=>{e&&a.push(e)}))},addIgnoreErrorsPatterns:(...e)=>{n.debug("Adding ignoreErrorsPatterns\n",e),e.forEach((e=>{e&&a.push($(e))}))},getBeforeSendHooks:()=>[...a],execute:e=>{var n;s||((null===(n=t.batching)||void 0===n?void 0:n.enabled)?(null==d||d.addItem(e),c(e)):c(e))},isPaused:()=>s,pause:()=>{n.debug("Pausing transports"),null==d||d.pause(),s=!0},remove:(...e)=>{n.debug("Removing transports"),e.forEach((e=>{n.debug(`Removing "${e.name}" transport`);const t=o.indexOf(e);-1!==t?o.splice(t,1):n.warn(`Transport "${e.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{a.filter((n=>!e.includes(n)))},get transports(){return[...o]},unpause:()=>{n.debug("Unpausing transports"),null==d||d.start(),s=!1}}}(n,t,e,i),o=re(0,t,e,i,r),s=function(e,n,t,i,r,o){n.debug("Initializing instrumentations");const s=[];return{add:(...a)=>{n.debug("Adding instrumentations"),a.forEach((a=>{n.debug(`Adding "${a.name}" instrumentation`),s.some((e=>e.name===a.name))?n.warn(`Instrumentation ${a.name} is already added`):(a.unpatchedConsole=e,a.internalLogger=n,a.config=t,a.metas=i,a.transports=r,a.api=o,s.push(a),a.initialize())}))},get instrumentations(){return[...s]},remove:(...e)=>{n.debug("Removing instrumentations"),e.forEach((e=>{var t,i;n.debug(`Removing "${e.name}" instrumentation`);const r=s.reduce(((n,t,i)=>null===n&&t.name===e.name?i:null),null);r?(null===(i=(t=s[r]).destroy)||void 0===i||i.call(t),s.splice(r,1)):n.warn(`Instrumentation "${e.name}" is not added`)}))}}}(n,t,e,i,r,o),a=de(n,t,e,i,r,o,s);return function(e){var n,t;const i={sdk:{version:ae}};let r=e.config.session;(null===(n=e.config.experimentalSessions)||void 0===n?void 0:n.enabled)&&(r=e.config.experimentalSessions.session),r&&e.api.setSession(r),e.config.app&&(i.app=e.config.app),e.config.user&&(i.user=e.config.user),e.config.view&&(i.view=e.config.view),e.metas.add(i,...null!==(t=e.config.metas)&&void 0!==t?t:[])}(a),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend),e.transports.addIgnoreErrorsPatterns(e.config.ignoreErrors)}(a),function(e){e.instrumentations.add(...e.config.instrumentations)}(a),a}e.faro={};const fe="faro",ge={enabled:!0,sendTimeout:250,itemLimit:50},be={EventNames:{CLICK:"click",NAVIGATION:"navigation",SESSION_START:"session_start",VIEW_CHANGED:"view_changed"}},me="sessionStorage",ve="localStorage";function he(n){var t;try{let e;e=window[n];const t="__faro_storage_test__";return e.setItem(t,t),e.removeItem(t),!0}catch(i){return null===(t=e.faro.internalLogger)||void 0===t||t.info(`Web storage of type ${n} is not available. Reason: ${i}`),!1}}function we(e,n){return Te(n)?window[n].getItem(e):null}function ye(e,n,t){if(Te(t))try{window[t].setItem(e,n)}catch(e){}}function Se(e,n){Te(n)&&window[n].removeItem(e)}const Ee=he(ve),xe=he(me);function Te(e){return e===ve?Ee:e===me&&xe}function ke(e,n){let t,i=!1;const r=()=>{null!=t?(e(...t),t=null,setTimeout(r,n)):i=!1};return(...o)=>{i?t=o:(e(...o),i=!0,setTimeout(r,n))}}const Ie="__FARO_SESSION__",Oe=144e5;function Le(e){const n=C();return{sessionId:null!=e?e:A(),lastActivity:n,started:n}}function Ae(e){if(null==e)return!1;const n=C();if(!(n-e.started<Oe))return!1;return n-e.lastActivity<9e5}function Ce({fetchUserSession:n,storeUserSession:t}){return function(){var i,r,o,s;if(!n||!t)return;const a=n();if(Ae(a))t(Object.assign(Object.assign({},a),{lastActivity:C()}));else{let n=Ne(Le(),a);t(n),null===(i=e.faro.api)||void 0===i||i.setSession(n.sessionMeta),null===(o=null===(r=e.faro.config.experimentalSessions)||void 0===r?void 0:r.onSessionChange)||void 0===o||o.call(r,null!==(s=null==a?void 0:a.sessionMeta)&&void 0!==s?s:null,n.sessionMeta)}}}function Ne(n,t){var i;const r=Object.assign(Object.assign({},n),{sessionMeta:{id:n.sessionId}}),o=null===(i=e.faro.metas.value.session)||void 0===i?void 0:i.attributes;return(o||null!=t)&&(r.sessionMeta.attributes=Object.assign(Object.assign({},null!=o?o:{}),null!=t?{previousSession:t.sessionId}:{})),r}class je{constructor(e){this.initialSessionId=e,this.updateSession=ke((()=>this.updateUserSession()),1e3),this.updateUserSession=Ce({fetchUserSession:je.fetchUserSession,storeUserSession:je.storeUserSession}),this.init()}static removeUserSession(){Se(Ie,je.storageTypeLocal)}static storeUserSession(e){ye(Ie,JSON.stringify(e),je.storageTypeLocal)}static fetchUserSession(){const e=we(Ie,je.storageTypeLocal);return e?JSON.parse(e):null}init(){je.storeUserSession(Le(this.initialSessionId)),document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),window.addEventListener("storage",(n=>{var t,i,r;if(n.key!==Ie)return;const o=JSON.parse(null!==(t=n.newValue)&&void 0!==t?t:""),s=JSON.parse(null!==(i=n.oldValue)&&void 0!==i?i:"");o.sessionId!==s.sessionId&&(null===(r=e.faro.api)||void 0===r||r.setSession(o.sessionMeta))})),e.faro.metas.addListener((function(n){const t=n.session,i=je.fetchUserSession();if(t&&t.id!==(null==i?void 0:i.sessionId)){const n=Ne(Le(t.id),i);je.storeUserSession(n),e.faro.api.setSession(n.sessionMeta)}}))}}je.storageTypeLocal=ve;class Re{constructor(e){this.initialSessionId=e,this.updateSession=ke((()=>this.updateUserSession()),1e3),this.updateUserSession=Ce({fetchUserSession:Re.fetchUserSession,storeUserSession:Re.storeUserSession}),this.init()}static removeUserSession(){Se(Ie,Re.storageTypeSession)}static storeUserSession(e){ye(Ie,JSON.stringify(e),Re.storageTypeSession)}static fetchUserSession(){const e=we(Ie,Re.storageTypeSession);return e?JSON.parse(e):null}init(){Re.storeUserSession(Le(this.initialSessionId)),document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener((function(n){const t=n.session,i=Re.fetchUserSession();if(t&&t.id!==(null==i?void 0:i.sessionId)){const n=Ne(Le(t.id),i);Re.storeUserSession(n),e.faro.api.setSession(n.sessionMeta)}}))}}Re.storageTypeSession=me;class De extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=ae}sendSessionStartEvent(e){var n;const t=e.session;t&&t.id!==(null===(n=this.notifiedSession)||void 0===n?void 0:n.id)&&(this.notifiedSession=t,this.api.pushEvent(be.EventNames.SESSION_START,{},void 0,{skipDedupe:!0}))}getSessionManagerInstanceByConfiguredStrategy(e){var n;return(null===(n=this.config.experimentalSessions)||void 0===n?void 0:n.persistent)&&Ee?new je(e):xe?new Re(e):null}initialize(){var e,n,t;if(this.logDebug("init session instrumentation"),this.sendSessionStartEvent(this.metas.value),this.metas.addListener(this.sendSessionStartEvent.bind(this)),null===(e=this.config.experimentalSessions)||void 0===e?void 0:e.enabled){const e=this.getSessionManagerInstanceByConfiguredStrategy(null===(n=this.metas.value.session)||void 0===n?void 0:n.id);null!=e&&(null===(t=this.transports)||void 0===t||t.addBeforeSendHooks(...this.transports.getBeforeSendHooks(),(n=>(null==e||e.updateSession(),n))))}}}class Ue extends se{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=ae}initialize(){this.logDebug("Initializing\n",this.options),k.filter((e=>{var n;return!(null!==(n=this.options.disabledLevels)&&void 0!==n?n:Ue.defaultDisabledLevels).includes(e)})).forEach((e=>{console[e]=(...n)=>{try{this.api.pushLog(n,{level:e})}catch(e){this.logError(e)}finally{this.unpatchedConsole[e](...n)}}}))}}Ue.defaultDisabledLevels=[e.LogLevel.DEBUG,e.LogLevel.TRACE,e.LogLevel.LOG];const Me=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Pe=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Be=/\((\S*)(?::(\d+))(?::(\d+))\)/,_e="address at ",ze=_e.length,Fe=/^\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,$e=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ve="safari-extension",qe="safari-web-extension",Ge=/Minified React error #\d+;/i;function We(e,n,t,i){const r={filename:e||document.location.href,function:n||"?"};return void 0!==t&&(r.lineno=t),void 0!==i&&(r.colno=i),r}function He(e,n){const t=null==e?void 0:e.includes(Ve),i=!t&&(null==e?void 0:e.includes(qe));return t||i?[(null==e?void 0:e.includes("@"))?e.split("@")[0]:e,t?`${Ve}:${n}`:`${qe}:${n}`]:[e,n]}function Ke(e){let n=[];e.stacktrace?n=e.stacktrace.split("\n").filter(((e,n)=>n%2==0)):e.stack&&(n=e.stack.split("\n"));const t=n.reduce(((n,t,i)=>{let r,o,s,l,u;if(r=Pe.exec(t)){if(o=r[1],s=r[2],l=r[3],u=r[4],null==s?void 0:s.startsWith("eval")){const e=Be.exec(s);e&&(s=e[1],l=e[2],u=e[3])}s=(null==s?void 0:s.startsWith(_e))?s.substring(ze):s,[o,s]=He(o,s)}else if(r=Fe.exec(t)){if(o=r[1],s=r[3],l=r[4],u=r[5],s&&s.includes(" > eval")){const e=$e.exec(s);e&&(o=o||"eval",s=e[1],l=e[2])}else 0===i&&!u&&a(e.columnNumber)&&(u=String(e.columnNumber+1));[o,s]=He(o,s)}return(s||o)&&n.push(We(s,o,l?Number(l):void 0,u?Number(u):void 0)),n}),[]);return Ge.test(e.message)?t.slice(1):t}function Je(e){return{frames:Ke(e)}}function Xe(e){let n,t,i,r,o=[];if(m(e)&&e.error)n=e.error.message,t=e.error.name,o=Ke(e.error);else if((i=v(e))||h(e)){const{name:r,message:o}=e;t=null!=r?r:i?"DOMError":"DOMException",n=o?`${t}: ${o}`:t}else b(e)?(n=e.message,o=Ke(e)):(l(e)||(r=f(e)))&&(t=r?e.constructor.name:void 0,n=`Non-Error exception captured with keys: ${Object.keys(e)}`);return[n,t,o]}function Ze(e){const n=window.onerror;window.onerror=(...t)=>{try{const[i,r,o,a,l]=t;let u,c,d=[];const p=s(i),f=We(r,"?",o,a);l||!p?([u,c,d]=Xe(null!=l?l:i),0===d.length&&(d=[f])):p&&([u,c]=function(e){var n,t;const i=e.match(Me),r=null!==(n=null==i?void 0:i[1])&&void 0!==n?n:te;return[null!==(t=null==i?void 0:i[2])&&void 0!==t?t:e,r]}(i),d=[f]),u&&e.pushError(new Error(u),{type:c,stackFrames:d})}finally{null==n||n.apply(window,t)}}}class Qe extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=ae}initialize(){var e;this.logDebug("Initializing"),Ze(this.api),e=this.api,window.addEventListener("unhandledrejection",(n=>{var t,i;let r,o,s=n;s.reason?s=n.reason:(null===(t=n.detail)||void 0===t?void 0:t.reason)&&(s=null===(i=n.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]=Xe(s),r&&e.pushError(new Error(r),{type:o,stackFrames:a})}))}}class Ye extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=ae}sendViewChangedEvent(e){const n=e.view;n&&n!==this.notifiedView&&(this.notifiedView=n,this.api.pushEvent(be.EventNames.VIEW_CHANGED,{},void 0,{skipDedupe:!0}))}initialize(){this.sendViewChangedEvent(this.metas.value),this.metas.addListener(this.sendViewChangedEvent.bind(this))}}var en,nn,tn,rn,on,sn=-1,an=function(e){addEventListener("pageshow",(function(n){n.persisted&&(sn=n.timeStamp,e(n))}),!0)},ln=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},un=function(){var e=ln();return e&&e.activationStart||0},cn=function(e,n){var t=ln(),i="navigate";return sn>=0?i="back-forward-cache":t&&(document.prerendering||un()>0?i="prerender":document.wasDiscarded?i="restore":t.type&&(i=t.type.replace(/_/g,"-"))),{name:e,value:void 0===n?-1:n,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},dn=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},t||{})),i}}catch(e){}},pn=function(e,n,t,i){var r,o;return function(s){n.value>=0&&(s||i)&&((o=n.value-(r||0))||void 0===r)&&(r=n.value,n.delta=o,n.rating=function(e,n){return e>n[1]?"poor":e>n[0]?"needs-improvement":"good"}(n.value,t),e(n))}},fn=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},gn=function(e){var n=function(n){"pagehide"!==n.type&&"hidden"!==document.visibilityState||e(n)};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},bn=function(e){var n=!1;return function(t){n||(e(t),n=!0)}},mn=-1,vn=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},hn=function(e){"hidden"===document.visibilityState&&mn>-1&&(mn="visibilitychange"===e.type?e.timeStamp:0,yn())},wn=function(){addEventListener("visibilitychange",hn,!0),addEventListener("prerenderingchange",hn,!0)},yn=function(){removeEventListener("visibilitychange",hn,!0),removeEventListener("prerenderingchange",hn,!0)},Sn=function(){return mn<0&&(mn=vn(),wn(),an((function(){setTimeout((function(){mn=vn(),wn()}),0)}))),{get firstHiddenTime(){return mn}}},En=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},xn=[1800,3e3],Tn=function(e,n){n=n||{},En((function(){var t,i=Sn(),r=cn("FCP"),o=dn("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-un(),0),r.entries.push(e),t(!0)))}))}));o&&(t=pn(e,r,xn,n.reportAllChanges),an((function(i){r=cn("FCP"),t=pn(e,r,xn,n.reportAllChanges),fn((function(){r.value=performance.now()-i.timeStamp,t(!0)}))})))}))},kn=[.1,.25],In={passive:!0,capture:!0},On=new Date,Ln=function(e,n){en||(en=n,nn=e,tn=new Date,Nn(removeEventListener),An())},An=function(){if(nn>=0&&nn<tn-On){var e={entryType:"first-input",name:en.type,target:en.target,cancelable:en.cancelable,startTime:en.timeStamp,processingStart:en.timeStamp+nn};rn.forEach((function(n){n(e)})),rn=[]}},Cn=function(e){if(e.cancelable){var n=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,n){var t=function(){Ln(e,n),r()},i=function(){r()},r=function(){removeEventListener("pointerup",t,In),removeEventListener("pointercancel",i,In)};addEventListener("pointerup",t,In),addEventListener("pointercancel",i,In)}(n,e):Ln(n,e)}},Nn=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(n){return e(n,Cn,In)}))},jn=[100,300],Rn=0,Dn=1/0,Un=0,Mn=function(e){e.forEach((function(e){e.interactionId&&(Dn=Math.min(Dn,e.interactionId),Un=Math.max(Un,e.interactionId),Rn=Un?(Un-Dn)/7+1:0)}))},Pn=function(){return on?Rn:performance.interactionCount||0},Bn=function(){"interactionCount"in performance||on||(on=dn("event",Mn,{type:"event",buffered:!0,durationThreshold:0}))},_n=[200,500],zn=0,Fn=function(){return Pn()-zn},$n=[],Vn={},qn=function(e){var n=$n[$n.length-1],t=Vn[e.interactionId];if(t||$n.length<10||e.duration>n.latency){if(t)t.entries.push(e),t.latency=Math.max(t.latency,e.duration);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Vn[i.id]=i,$n.push(i)}$n.sort((function(e,n){return n.latency-e.latency})),$n.splice(10).forEach((function(e){delete Vn[e.id]}))}},Gn=[2500,4e3],Wn={},Hn=[800,1800],Kn=function e(n){document.prerendering?En((function(){return e(n)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(n)}),!0):setTimeout(n,0)};class Jn extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=ae}initialize(){this.logDebug("Initializing"),Object.entries(Jn.mapping).forEach((([e,n])=>{n((n=>{this.api.pushMeasurement({type:"web-vitals",values:{[e]:n.value}})}))}))}}function Xn(e={}){const n=[new Qe,new Jn,new De,new Ye];return!1!==e.captureConsole&&n.push(new Ue({disabledLevels:e.captureConsoleDisabledLevels})),n}Jn.mapping={cls:function(e,n){n=n||{},Tn(bn((function(){var t,i=cn("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var n=o[0],t=o[o.length-1];r&&e.startTime-t.startTime<1e3&&e.startTime-n.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,t())},a=dn("layout-shift",s);a&&(t=pn(e,i,kn,n.reportAllChanges),gn((function(){s(a.takeRecords()),t(!0)})),an((function(){r=0,i=cn("CLS",0),t=pn(e,i,kn,n.reportAllChanges),fn((function(){return t()}))})),setTimeout(t,0))})))},fcp:Tn,fid:function(e,n){n=n||{},En((function(){var t,i=Sn(),r=cn("FID"),o=function(e){e.startTime<i.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),t(!0))},s=function(e){e.forEach(o)},a=dn("first-input",s);t=pn(e,r,jn,n.reportAllChanges),a&&gn(bn((function(){s(a.takeRecords()),a.disconnect()}))),a&&an((function(){var i;r=cn("FID"),t=pn(e,r,jn,n.reportAllChanges),rn=[],nn=-1,en=null,Nn(addEventListener),i=o,rn.push(i),An()}))}))},inp:function(e,n){n=n||{},En((function(){var t;Bn();var i,r=cn("INP"),o=function(e){e.forEach((function(e){e.interactionId&&qn(e),"first-input"===e.entryType&&!$n.some((function(n){return n.entries.some((function(n){return e.duration===n.duration&&e.startTime===n.startTime}))}))&&qn(e)}));var n,t=(n=Math.min($n.length-1,Math.floor(Fn()/50)),$n[n]);t&&t.latency!==r.value&&(r.value=t.latency,r.entries=t.entries,i())},s=dn("event",o,{durationThreshold:null!==(t=n.durationThreshold)&&void 0!==t?t:40});i=pn(e,r,_n,n.reportAllChanges),s&&("interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),gn((function(){o(s.takeRecords()),r.value<0&&Fn()>0&&(r.value=0,r.entries=[]),i(!0)})),an((function(){$n=[],zn=Pn(),r=cn("INP"),i=pn(e,r,_n,n.reportAllChanges)})))}))},lcp:function(e,n){n=n||{},En((function(){var t,i=Sn(),r=cn("LCP"),o=function(e){var n=e[e.length-1];n&&n.startTime<i.firstHiddenTime&&(r.value=Math.max(n.startTime-un(),0),r.entries=[n],t())},s=dn("largest-contentful-paint",o);if(s){t=pn(e,r,Gn,n.reportAllChanges);var a=bn((function(){Wn[r.id]||(o(s.takeRecords()),s.disconnect(),Wn[r.id]=!0,t(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return setTimeout(a,0)}),!0)})),gn(a),an((function(i){r=cn("LCP"),t=pn(e,r,Gn,n.reportAllChanges),fn((function(){r.value=performance.now()-i.timeStamp,Wn[r.id]=!0,t(!0)}))}))}}))},ttfb:function(e,n){n=n||{};var t=cn("TTFB"),i=pn(e,t,Hn,n.reportAllChanges);Kn((function(){var r=ln();if(r){var o=r.responseStart;if(o<=0||o>performance.now())return;t.value=Math.max(o-un(),0),t.entries=[r],i(!0),an((function(){t=cn("TTFB",0),(i=pn(e,t,Hn,n.reportAllChanges))(!0)}))}}))}};const Zn="browser";var Qn={exports:{}};!function(e,n){!function(t,i){var r="function",o="undefined",s="object",a="string",l="major",u="model",c="name",d="type",p="vendor",f="version",g="architecture",b="console",m="mobile",v="tablet",h="smarttv",w="wearable",y="embedded",S="Amazon",E="Apple",x="ASUS",T="BlackBerry",k="Browser",I="Chrome",O="Firefox",L="Google",A="Huawei",C="LG",N="Microsoft",j="Motorola",R="Opera",D="Samsung",U="Sharp",M="Sony",P="Xiaomi",B="Zebra",_="Facebook",z="Chromium OS",F="Mac OS",$=function(e){for(var n={},t=0;t<e.length;t++)n[e[t].toUpperCase()]=e[t];return n},V=function(e,n){return typeof e===a&&-1!==q(n).indexOf(q(e))},q=function(e){return e.toLowerCase()},G=function(e,n){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof n===o?e:e.substring(0,350)},W=function(e,n){for(var t,o,a,l,u,c,d=0;d<n.length&&!u;){var p=n[d],f=n[d+1];for(t=o=0;t<p.length&&!u&&p[t];)if(u=p[t++].exec(e))for(a=0;a<f.length;a++)c=u[++o],typeof(l=f[a])===s&&l.length>0?2===l.length?typeof l[1]==r?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==r||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):i:this[l[0]]=c?l[1].call(this,c,l[2]):i:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):i):this[l]=c||i;d+=2}},H=function(e,n){for(var t in n)if(typeof n[t]===s&&n[t].length>0){for(var r=0;r<n[t].length;r++)if(V(n[t][r],e))return"?"===t?i:t}else if(V(n[t],e))return"?"===t?i:t;return e},K={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],[f,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,f],[/opios[\/ ]+([\w\.]+)/i],[f,[c,R+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[c,R]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[c,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+k],f],[/\bfocus\/([\w\.]+)/i],[f,[c,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[c,R+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[c,R+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[c,"MIUI "+k]],[/fxios\/([-\w\.]+)/i],[f,[c,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+k]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+k],f],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,_],f],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[c,I+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,I+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[f,H,{"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,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[c,O+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\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|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[c,f],[/(cobalt)\/([\w\.]+)/i],[c,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,q]],[/((?: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/,"",q]],[/(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,q]]],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],[u,[p,D],[d,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,D],[d,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[p,E],[d,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[p,E],[d,v]],[/(macintosh);/i],[u,[p,E]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[p,U],[d,m]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[p,A],[d,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[p,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,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[p,P],[d,m]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[p,P],[d,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[p,"OPPO"],[d,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[p,"Vivo"],[d,m]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[p,"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],[u,[p,j],[d,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,j],[d,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[p,C],[d,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[p,C],[d,m]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[p,"Lenovo"],[d,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[p,"Nokia"],[d,m]],[/(pixel c)\b/i],[u,[p,L],[d,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[p,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],[u,[p,M],[d,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[p,M],[d,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[p,"OnePlus"],[d,m]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[p,S],[d,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[p,S],[d,m]],[/(playbook);[-\w\),; ]+(rim)/i],[u,p,[d,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[p,T],[d,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[p,x],[d,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[p,x],[d,m]],[/(nexus 9)/i],[u,[p,"HTC"],[d,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[u,/_/g," "],[d,m]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[p,"Acer"],[d,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[p,"Meizu"],[d,m]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,u,[d,m]],[/(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],[p,u,[d,v]],[/(surface duo)/i],[u,[p,N],[d,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[p,"Fairphone"],[d,m]],[/(u304aa)/i],[u,[p,"AT&T"],[d,m]],[/\bsie-(\w*)/i],[u,[p,"Siemens"],[d,m]],[/\b(rct\w+) b/i],[u,[p,"RCA"],[d,v]],[/\b(venue[\d ]{2,7}) b/i],[u,[p,"Dell"],[d,v]],[/\b(q(?:mv|ta)\w+) b/i],[u,[p,"Verizon"],[d,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[p,"Barnes & Noble"],[d,v]],[/\b(tm\d{3}\w+) b/i],[u,[p,"NuVision"],[d,v]],[/\b(k88) b/i],[u,[p,"ZTE"],[d,v]],[/\b(nx\d{3}j) b/i],[u,[p,"ZTE"],[d,m]],[/\b(gen\d{3}) b.+49h/i],[u,[p,"Swiss"],[d,m]],[/\b(zur\d{3}) b/i],[u,[p,"Swiss"],[d,v]],[/\b((zeki)?tb.*\b) b/i],[u,[p,"Zeki"],[d,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],u,[d,v]],[/\b(ns-?\w{0,9}) b/i],[u,[p,"Insignia"],[d,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[p,"NextBook"],[d,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],u,[d,m]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],u,[d,m]],[/\b(ph-1) /i],[u,[p,"Essential"],[d,m]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[p,"Envizen"],[d,v]],[/\b(trio[-\w\. ]+) b/i],[u,[p,"MachSpeed"],[d,v]],[/\btu_(1491) b/i],[u,[p,"Rotor"],[d,v]],[/(shield[\w ]+) b/i],[u,[p,"Nvidia"],[d,v]],[/(sprint) (\w+)/i],[p,u,[d,m]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[p,N],[d,m]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,B],[d,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,B],[d,m]],[/smart-tv.+(samsung)/i],[p,[d,h]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,D],[d,h]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,C],[d,h]],[/(apple) ?tv/i],[p,[u,E+" TV"],[d,h]],[/crkey/i],[[u,I+"cast"],[p,L],[d,h]],[/droid.+aft(\w+)( bui|\))/i],[u,[p,S],[d,h]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[p,U],[d,h]],[/(bravia[\w ]+)( bui|\))/i],[u,[p,M],[d,h]],[/(mitv-\w{5}) bui/i],[u,[p,P],[d,h]],[/Hbbtv.*(technisat) (.*);/i],[p,u,[d,h]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,G],[u,G],[d,h]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,h]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,u,[d,b]],[/droid.+; (shield) bui/i],[u,[p,"Nvidia"],[d,b]],[/(playstation [345portablevi]+)/i],[u,[p,M],[d,b]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[p,N],[d,b]],[/((pebble))app/i],[p,u,[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[p,E],[d,w]],[/droid.+; (glass) \d/i],[u,[p,L],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[u,[p,B],[d,w]],[/(quest( 2| pro)?)/i],[u,[p,_],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[d,y]],[/(aeobc)\b/i],[u,[p,S],[d,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[d,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[d,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,v]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,m]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[f,H,K]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,H,K]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,F],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,f],[/\(bb(10);/i],[f,[c,T]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[c,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[c,I+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,z],f],[/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,f],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,f]]},X=function(e,n){if(typeof e===s&&(n=e,e=i),!(this instanceof X))return new X(e,n).getResult();var b=typeof t!==o&&t.navigator?t.navigator:i,h=e||(b&&b.userAgent?b.userAgent:""),w=b&&b.userAgentData?b.userAgentData:i,y=n?function(e,n){var t={};for(var i in e)n[i]&&n[i].length%2==0?t[i]=n[i].concat(e[i]):t[i]=e[i];return t}(J,n):J,S=b&&b.userAgent==h;return this.getBrowser=function(){var e,n={};return n[c]=i,n[f]=i,W.call(n,h,y.browser),n[l]=typeof(e=n[f])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:i,S&&b&&b.brave&&typeof b.brave.isBrave==r&&(n[c]="Brave"),n},this.getCPU=function(){var e={};return e[g]=i,W.call(e,h,y.cpu),e},this.getDevice=function(){var e={};return e[p]=i,e[u]=i,e[d]=i,W.call(e,h,y.device),S&&!e[d]&&w&&w.mobile&&(e[d]=m),S&&"Macintosh"==e[u]&&b&&typeof b.standalone!==o&&b.maxTouchPoints&&b.maxTouchPoints>2&&(e[u]="iPad",e[d]=v),e},this.getEngine=function(){var e={};return e[c]=i,e[f]=i,W.call(e,h,y.engine),e},this.getOS=function(){var e={};return e[c]=i,e[f]=i,W.call(e,h,y.os),S&&!e[c]&&w&&"Unknown"!=w.platform&&(e[c]=w.platform.replace(/chrome os/i,z).replace(/macos/i,F)),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 h},this.setUA=function(e){return h=typeof e===a&&e.length>350?G(e,350):e,this},this.setUA(h),this};X.VERSION="1.0.36",X.BROWSER=$([c,f,l]),X.CPU=$([g]),X.DEVICE=$([u,p,d,b,m,h,v,w,y]),X.ENGINE=X.OS=$([c,f]),e.exports&&(n=e.exports=X),n.UAParser=X;var Z=typeof t!==o&&(t.jQuery||t.Zepto);if(Z&&!Z.ua){var Q=new X;Z.ua=Q.getResult(),Z.ua.get=function(){return Q.getUA()},Z.ua.set=function(e){Q.setUA(e);var n=Q.getResult();for(var t in n)Z.ua[t]=n[t]}}}("object"==typeof window?window:N)}(Qn,Qn.exports);var Yn=Qn.exports;const et=()=>{const e=new Yn.UAParser,{name:n,version:t}=e.getBrowser(),{name:i,version:r}=e.getOS(),o=e.getUA(),s=navigator.language,a=navigator.userAgent.includes("Mobi"),l=function(){if(!n||!t)return;if("userAgentData"in navigator)return navigator.userAgentData.brands;return}(),u="unknown";return{browser:{name:null!=n?n:u,version:null!=t?t:u,os:`${null!=i?i:u} ${null!=r?r:u}`,userAgent:null!=o?o:u,language:null!=s?s:u,mobile:a,brands:null!=l?l:u}}},nt=()=>({page:{url:location.href}}),tt=[et,nt];function it(e){return{id:A(),attributes:e}}const rt={name:"default"},ot=()=>({k6:{isK6Browser:!0}});function st(e,n,t,i){return new(t||(t=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,a)}l((i=i.apply(e,n||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class at extends Y{constructor(e){var n,t,i,r;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=ae,this.disabledUntil=new Date,this.rateLimitBackoffMs=null!==(n=e.defaultRateLimitBackoffMs)&&void 0!==n?n:5e3,this.getNow=null!==(t=e.getNow)&&void 0!==t?t:()=>Date.now(),this.promiseBuffer=O({size:null!==(i=e.bufferSize)&&void 0!==i?i:30,concurrency:null!==(r=e.concurrency)&&void 0!==r?r:5})}send(e){return st(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((()=>{var n,t,i;const r=JSON.stringify(ne(e)),{url:o,requestOptions:s,apiKey:a}=this.options,l=null!=s?s:{},{headers:u}=l,c=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]])}return t}(l,["headers"]);return fetch(o,Object.assign({method:"POST",headers:Object.assign(Object.assign(Object.assign({"Content-Type":"application/json"},null!=u?u:{}),a?{"x-api-key":a}:{}),(null===(n=this.config.experimentalSessions)||void 0===n?void 0:n.enabled)&&(null===(t=this.metas.value.session)||void 0===t?void 0:t.id)?{"x-faro-session-id":null===(i=this.metas.value.session)||void 0===i?void 0:i.id}:{}),body:r,keepalive:r.length<=6e4},null!=c?c:{})).then((e=>(429===e.status&&(this.disabledUntil=this.getRetryAfterDate(e),this.logWarn(`Too many requests, backing off until ${this.disabledUntil}`)),e.text().catch(I),e))).catch((e=>{this.logError("Failed sending payload to the receiver\n",JSON.parse(r),e)}))}))}catch(e){this.logError(e)}}))}getIgnoreUrls(){return[this.options.url]}isBatched(){return!0}getRetryAfterDate(e){const n=this.getNow(),t=e.headers.get("Retry-After");if(t){const e=Number(t);if(!isNaN(e))return new Date(1e3*e+n);const i=Date.parse(t);if(!isNaN(i))return new Date(i)}return new Date(n+this.rateLimitBackoffMs)}}const lt={persistent:!1,maxSessionPersistenceTime:147e5};function ut(e){var n,t,i,r,o,s,a,u,c,d;const p=[],f=J(e.unpatchedConsole,e.internalLoggerLevel);return e.transports?((e.url||e.apiKey)&&f.error('if "transports" is defined, "url" and "apiKey" should not be defined'),p.push(...e.transports)):e.url?p.push(new at({url:e.url,apiKey:e.apiKey})):f.error('either "url" or "transports" must be defined'),{app:e.app,batching:Object.assign(Object.assign({},ge),e.batching),dedupe:null===(n=e.dedupe)||void 0===n||n,globalObjectKey:e.globalObjectKey||fe,instrumentations:null!==(t=e.instrumentations)&&void 0!==t?t:Xn(),internalLoggerLevel:null!==(i=e.internalLoggerLevel)&&void 0!==i?i:G,isolate:null!==(r=e.isolate)&&void 0!==r&&r,metas:function(){const n=tt;return e.metas&&n.push(...e.metas),l(window.k6)?[...n,ot]:n}(),parseStacktrace:Je,paused:null!==(o=e.paused)&&void 0!==o&&o,preventGlobalExposure:null!==(s=e.preventGlobalExposure)&&void 0!==s&&s,transports:p,unpatchedConsole:null!==(a=e.unpatchedConsole)&&void 0!==a?a:W,beforeSend:e.beforeSend,eventDomain:null!==(u=e.eventDomain)&&void 0!==u?u:Zn,ignoreErrors:e.ignoreErrors,experimentalSessions:Object.assign(Object.assign(Object.assign({enabled:!1},lt),{session:ct(e.experimentalSessions)}),e.experimentalSessions),session:null!==(c=e.session)&&void 0!==c?c:it(),user:e.user,view:null!==(d=e.view)&&void 0!==d?d:rt}}function ct(e){const n=Object.assign(Object.assign({},lt),e);let t;if(n.persistent){const e=je.fetchUserSession(),i=C();e&&e.lastActivity<i-n.maxSessionPersistenceTime&&je.removeUserSession(),t=Ae(e)?null==e?void 0:e.sessionId:it().id}return{id:null!=t?t:it().id}}return e.BaseExtension=Q,e.BaseInstrumentation=se,e.BaseTransport=Y,e.ConsoleInstrumentation=Ue,e.ConsoleTransport=class extends Y{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-console",this.version=ae}send(n){var t;return this.unpatchedConsole[null!==(t=this.options.level)&&void 0!==t?t:e.LogLevel.DEBUG]("New event",ne([n]))}},e.Conventions=be,e.ErrorsInstrumentation=Qe,e.FetchTransport=at,e.SessionInstrumentation=De,e.VERSION=ae,e.ViewInstrumentation=Ye,e.WebVitalsInstrumentation=Jn,e.allLogLevels=k,e.browserMeta=et,e.buildStackFrame=We,e.createInternalLogger=J,e.createPromiseBuffer=O,e.createSession=it,e.deepEqual=S,e.defaultEventDomain=Zn,e.defaultExceptionType=te,e.defaultGlobalObjectKey=fe,e.defaultInternalLoggerLevel=G,e.defaultLogLevel=T,e.defaultMetas=tt,e.defaultViewMeta=rt,e.genShortID=A,e.getCurrentTimestamp=E,e.getDataFromSafariExtensions=He,e.getInternalFaroFromGlobalObject=function(){return oe[le]},e.getStackFramesFromError=Ke,e.getTransportBody=ne,e.getWebInstrumentations=Xn,e.globalObject=oe,e.initializeFaro=function(e){const n=ut(e);if(n)return pe(n)},e.internalGlobalObjectKey=le,e.isArray=c,e.isBoolean=e=>n(e,"boolean"),e.isDomError=v,e.isDomException=h,e.isElement=e=>w&&i(e,Element),e.isElementDefined=w,e.isError=b,e.isErrorDefined=g,e.isErrorEvent=m,e.isEvent=f,e.isEventDefined=p,e.isFunction=u,e.isInstanceOf=i,e.isInt=e=>a(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=ce,e.isMap=e=>y&&i(e,Map),e.isMapDefined=y,e.isNull=o,e.isNumber=a,e.isObject=l,e.isPrimitive=d,e.isRegExp=e=>t(e,"RegExp"),e.isString=s,e.isSymbol=e=>n(e,"symbol"),e.isSyntheticEvent=e=>l(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>u(null==e?void 0:e.then),e.isToString=t,e.isTypeof=n,e.isUndefined=r,e.makeCoreConfig=ut,e.noop=I,e.pageMeta=nt,e.parseStacktrace=Je,e.sdkMeta=()=>({sdk:{name:"@grafana/faro-core",version:ae,integrations:e.faro.config.instrumentations.map((({name:e,version:n})=>({name:e,version:n})))}}),e.setInternalFaroOnGlobalObject=ue,e.transportItemTypeToBodyKey=F,e}({}); | ||
var GrafanaFaroWebSdk=function(e){"use strict";function n(e,n){return typeof e===n}function t(e,n){return Object.prototype.toString.call(e)===`[object ${n}]`}function i(e,n){try{return e instanceof n}catch(e){return!1}}const r=e=>n(e,"undefined"),o=e=>n(e,"null"),s=e=>n(e,"string"),a=e=>n(e,"number")&&!isNaN(e)||n(e,"bigint"),l=e=>!o(e)&&n(e,"object"),u=e=>n(e,"function"),c=e=>t(e,"Array"),d=e=>!l(e)&&!u(e),p=!r(Event),f=e=>p&&i(e,Event),g="undefined"!=typeof Error,b=e=>g&&i(e,Error),v=e=>t(e,"ErrorEvent"),m=e=>t(e,"DOMError"),h=e=>t(e,"DOMException"),w="undefined"!=typeof Element,y="undefined"!=typeof Map;function E(e,t){if(e===t)return!0;if(n(e,"number")&&isNaN(e))return n(t,"number")&&isNaN(t);const i=c(e),r=c(t);if(i!==r)return!1;if(i&&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 S(){return(new Date).toISOString()}var T;e.LogLevel=void 0,(T=e.LogLevel||(e.LogLevel={})).TRACE="trace",T.DEBUG="debug",T.INFO="info",T.LOG="log",T.WARN="warn",T.ERROR="error";const x=e.LogLevel.LOG,k=[e.LogLevel.TRACE,e.LogLevel.DEBUG,e.LogLevel.INFO,e.LogLevel.LOG,e.LogLevel.WARN,e.LogLevel.ERROR];function I(){}function O(e){const{size:n,concurrency:t}=e,i=[];let r=0;const o=()=>{if(r<t&&i.length){const{producer:e,resolve:n,reject:t}=i.shift();r++,e().then((e=>{r--,o(),n(e)}),(e=>{r--,o(),t(e)}))}};return{add:e=>{if(i.length+r>=n)throw new Error("Task buffer full");return new Promise(((n,t)=>{i.push({producer:e,resolve:n,reject:t}),o()}))}}}const L="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function A(e=10){return Array.from(Array(e)).map((()=>L[Math.floor(Math.random()*L.length)])).join("")}function C(){return Date.now()}var N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},j={exports:{}},R={exports:{}};R.exports=function(e,n){var t,i,r,o,s,a,l,u;for(t=3&e.length,i=e.length-t,r=n,s=3432918353,a=461845907,u=0;u<i;)l=255&e.charCodeAt(u)|(255&e.charCodeAt(++u))<<8|(255&e.charCodeAt(++u))<<16|(255&e.charCodeAt(++u))<<24,++u,r=27492+(65535&(o=5*(65535&(r=(r^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,t){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(u)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return r^=e.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0};var D=R.exports,U={exports:{}};!function(e){e.exports=function(e,n){for(var t,i=e.length,r=n^i,o=0;i>=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),i-=4,++o;switch(i){case 3:r^=(255&e.charCodeAt(o+2))<<16;case 2:r^=(255&e.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0}}(U);var M=D,P=U.exports;j.exports=M;var B=j.exports.murmur3=M;j.exports.murmur2=P;class _{constructor(e,n){var t,i;this.signalBuffer=[],this.itemLimit=null!==(t=null==n?void 0:n.itemLimit)&&void 0!==t?t:50,this.sendTimeout=null!==(i=null==n?void 0:n.sendTimeout)&&void 0!==i?i:250,this.paused=(null==n?void 0:n.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 n=new Map;return e.forEach((e=>{const t=B(JSON.stringify(e.meta));let i=n.get(t);i=void 0===i?[e]:[...i,e],n.set(t,i)})),Array.from(n.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}var z;e.TransportItemType=void 0,(z=e.TransportItemType||(e.TransportItemType={})).EXCEPTION="exception",z.LOG="log",z.MEASUREMENT="measurement",z.TRACE="trace",z.EVENT="event";const F={[e.TransportItemType.EXCEPTION]:"exceptions",[e.TransportItemType.LOG]:"logs",[e.TransportItemType.MEASUREMENT]:"measurements",[e.TransportItemType.TRACE]:"traces",[e.TransportItemType.EVENT]:"events"};function $(n){return t=>{if(t.type===e.TransportItemType.EXCEPTION&&t.payload){const e=t.payload,i=`${e.type}: ${e.value}`;if(function(e,n){return e.some((e=>s(e)?n.includes(e):!!n.match(e)))}(n,i))return null}return t}}var V;e.InternalLoggerLevel=void 0,(V=e.InternalLoggerLevel||(e.InternalLoggerLevel={}))[V.OFF=0]="OFF",V[V.ERROR=1]="ERROR",V[V.WARN=2]="WARN",V[V.INFO=3]="INFO",V[V.VERBOSE=4]="VERBOSE";const q={debug:I,error:I,info:I,prefix:"Faro",warn:I},G=e.InternalLoggerLevel.ERROR,W=Object.assign({},console);let H=W;function K(e){var n;return H=null!==(n=e.unpatchedConsole)&&void 0!==n?n:H,H}function J(n=W,t=G){const i=q;return t>e.InternalLoggerLevel.OFF&&(i.error=t>=e.InternalLoggerLevel.ERROR?function(...e){n.error(`${i.prefix}\n`,...e)}:I,i.warn=t>=e.InternalLoggerLevel.WARN?function(...e){n.warn(`${i.prefix}\n`,...e)}:I,i.info=t>=e.InternalLoggerLevel.INFO?function(...e){n.info(`${i.prefix}\n`,...e)}:I,i.debug=t>=e.InternalLoggerLevel.VERBOSE?function(...e){n.debug(`${i.prefix}\n`,...e)}:I),i}let X=q;function Z(e,n){return X=J(e,n.internalLoggerLevel),X}class Q{constructor(){this.unpatchedConsole=W,this.internalLogger=q,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 Y extends Q{isBatched(){return!1}getIgnoreUrls(){return[]}}function ee(e,n){var t,i;if(void 0===n)return e;if(void 0===e)return{resourceSpans:n};const r=null===(t=e.resourceSpans)||void 0===t?void 0:t[0];if(void 0===r)return e;const o=(null==r?void 0:r.scopeSpans)||[],s=(null===(i=null==n?void 0:n[0])||void 0===i?void 0:i.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},r),{scopeSpans:[...o,...s]})]})}function ne(n){let t={meta:{}};return void 0!==n[0]&&(t.meta=n[0].meta),n.forEach((n=>{switch(n.type){case e.TransportItemType.LOG:case e.TransportItemType.EVENT:case e.TransportItemType.EXCEPTION:case e.TransportItemType.MEASUREMENT:const i=F[n.type],r=t[i];t=Object.assign(Object.assign({},t),{[i]:void 0===r?[n.payload]:[...r,n.payload]});break;case e.TransportItemType.TRACE:t=Object.assign(Object.assign({},t),{traces:ee(t.traces,n.payload.resourceSpans)})}})),t}const te="Error";let ie;function re(n,t,i,r,s){t.debug("Initializing API");const a=function(n,t,i,r,o){let s;return t.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,n)=>{t.debug("Initializing OpenTelemetry"),s={trace:e,context:n}},isOTELInitialized:()=>!!s,pushTraces:n=>{try{const i={type:e.TransportItemType.TRACE,payload:n,meta:r.value};t.debug("Pushing trace\n",i),o.execute(i)}catch(e){t.error("Error pushing trace\n",e)}}}}(0,t,0,r,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),function(n,t,i,r,s,a){var l;t.debug("Initializing exceptions API");let u=null;ie=null!==(l=i.parseStacktrace)&&void 0!==l?l:ie;const c=e=>{t.debug("Changing stacktrace parser"),ie=null!=e?e:ie};return c(i.parseStacktrace),{changeStacktraceParser:c,getStacktraceParser:()=>ie,pushError:(n,{skipDedupe:l,stackFrames:c,type:d,context:p}={})=>{d=d||n.name||te;const f={meta:r.value,payload:{type:d,value:n.message,timestamp:S(),trace:a.getTraceContext(),context:null!=p?p:{}},type:e.TransportItemType.EXCEPTION};(null==(c=null!=c?c:n.stack?null==ie?void 0:ie(n).frames:void 0)?void 0:c.length)&&(f.payload.stacktrace={frames:c});const g={type:f.payload.type,value:f.payload.value,stackTrace:f.payload.stacktrace,context:f.payload.context};l||!i.dedupe||o(u)||!E(g,u)?(u=g,t.debug("Pushing exception\n",f),s.execute(f)):t.debug("Skipping error push because it is the same as the last one\n",f.payload)}}}(0,t,i,r,s,a)),function(e,n,t,i,r){let o,s,a;n.debug("Initializing meta API");const l=e=>{s&&i.remove(s),s={user:e},i.add(s)},u=e=>{o&&i.remove(o),o={session:e},i.add(o)};return{setUser:l,resetUser:l,setSession:u,resetSession:u,getSession:()=>i.value.session,setView:e=>{a&&i.remove(a),a={view:e},i.add(a)},getView:()=>i.value.view}}(0,t,0,r)),function(n,t,i,r,s,a){t.debug("Initializing logs API");let l=null;return{pushLog:(n,{context:u,level:c,skipDedupe:d}={})=>{try{const p={type:e.TransportItemType.LOG,payload:{message:n.map((e=>{try{return String(e)}catch(e){return""}})).join(" "),level:null!=c?c:x,context:null!=u?u:{},timestamp:S(),trace:a.getTraceContext()},meta:r.value},f={message:p.payload.message,level:p.payload.level,context:p.payload.context};if(!d&&i.dedupe&&!o(l)&&E(f,l))return void t.debug("Skipping log push because it is the same as the last one\n",p.payload);l=f,t.debug("Pushing log\n",p),s.execute(p)}catch(e){t.error("Error pushing log\n",e)}}}}(0,t,i,r,s,a)),function(n,t,i,r,s,a){t.debug("Initializing measurements API");let l=null;return{pushMeasurement:(n,{skipDedupe:u,context:c}={})=>{var d;try{const p={type:e.TransportItemType.MEASUREMENT,payload:Object.assign(Object.assign({},n),{trace:a.getTraceContext(),timestamp:null!==(d=n.timestamp)&&void 0!==d?d:S(),context:null!=c?c:{}}),meta:r.value},f={type:p.payload.type,values:p.payload.values,context:p.payload.context};if(!u&&i.dedupe&&!o(l)&&E(f,l))return void t.debug("Skipping measurement push because it is the same as the last one\n",p.payload);l=f,t.debug("Pushing measurement\n",p),s.execute(p)}catch(e){t.error("Error pushing measurement\n",e)}}}}(0,t,i,r,s,a)),function(n,t,i,r,s,a){let l=null;return{pushEvent:(n,u,c,{skipDedupe:d}={})=>{try{const p={meta:r.value,payload:{name:n,domain:null!=c?c:i.eventDomain,attributes:u,timestamp:S(),trace:a.getTraceContext()},type:e.TransportItemType.EVENT},f={name:p.payload.name,attributes:p.payload.attributes,domain:p.payload.domain};if(!d&&i.dedupe&&!o(l)&&E(f,l))return void t.debug("Skipping event push because it is the same as the last one\n",p.payload);l=f,t.debug("Pushing event\n",p),s.execute(p)}catch(e){t.error("Error pushing event",e)}}}}(0,t,i,r,s,a))}const oe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:void 0;class se extends Q{constructor(){super(...arguments),this.api={},this.transports={}}}const ae="1.2.5";const le="_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(oe,le,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function ce(){return le in oe}function de(n,t,i,r,o,s,a){return t.debug("Initializing Faro"),e.faro={api:s,config:i,instrumentations:a,internalLogger:t,metas:r,pause:o.pause,transports:o,unpatchedConsole:n,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 oe)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(oe,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(e.faro),e.faro}function pe(e){const n=K(e),t=Z(n,e);if(ce()&&!e.isolate)return void t.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');t.debug("Initializing");const i=function(e,n,t){let i=[],r=[];const o=()=>i.reduce(((e,n)=>Object.assign(e,u(n)?n():n)),{}),s=()=>{if(r.length){const e=o();r.forEach((n=>n(e)))}};return{add:(...e)=>{n.debug("Adding metas\n",e),i.push(...e),s()},remove:(...e)=>{n.debug("Removing metas\n",e),i=i.filter((n=>!e.includes(n))),s()},addListener:e=>{n.debug("Adding metas listener\n",e),r.push(e)},removeListener:e=>{n.debug("Removing metas listener\n",e),r=r.filter((n=>n!==e))},get value(){return o()}}}(0,t),r=function(e,n,t,i){var r;n.debug("Initializing transports");const o=[];let s=t.paused,a=[];const l=e=>{let n=e;for(const e of a){const t=n.map(e).filter(Boolean);if(0===t.length)return[];n=t}return n},u=e=>{const t=l(e);if(0!==t.length)for(const e of o)n.debug(`Transporting item using ${e.name}\n`,t),e.isBatched()&&e.send(t)},c=e=>{var i;const[r]=l([e]);if(void 0!==r)for(const e of o)n.debug(`Transporting item using ${e.name}\n`,r),e.isBatched()?(null===(i=t.batching)||void 0===i?void 0:i.enabled)||e.send([r]):e.send(r)};let d;return(null===(r=t.batching)||void 0===r?void 0:r.enabled)&&(d=new _(u,{sendTimeout:t.batching.sendTimeout,itemLimit:t.batching.itemLimit,paused:s})),{add:(...r)=>{n.debug("Adding transports"),r.forEach((r=>{n.debug(`Adding "${r.name}" transport`),o.some((e=>e===r))?n.warn(`Transport ${r.name} is already added`):(r.unpatchedConsole=e,r.internalLogger=n,r.config=t,r.metas=i,o.push(r))}))},addBeforeSendHooks:(...e)=>{n.debug("Adding beforeSendHooks\n",a),e.forEach((e=>{e&&a.push(e)}))},addIgnoreErrorsPatterns:(...e)=>{n.debug("Adding ignoreErrorsPatterns\n",e),e.forEach((e=>{e&&a.push($(e))}))},getBeforeSendHooks:()=>[...a],execute:e=>{var n;s||((null===(n=t.batching)||void 0===n?void 0:n.enabled)?(null==d||d.addItem(e),c(e)):c(e))},isPaused:()=>s,pause:()=>{n.debug("Pausing transports"),null==d||d.pause(),s=!0},remove:(...e)=>{n.debug("Removing transports"),e.forEach((e=>{n.debug(`Removing "${e.name}" transport`);const t=o.indexOf(e);-1!==t?o.splice(t,1):n.warn(`Transport "${e.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{a.filter((n=>!e.includes(n)))},get transports(){return[...o]},unpause:()=>{n.debug("Unpausing transports"),null==d||d.start(),s=!1}}}(n,t,e,i),o=re(0,t,e,i,r),s=function(e,n,t,i,r,o){n.debug("Initializing instrumentations");const s=[];return{add:(...a)=>{n.debug("Adding instrumentations"),a.forEach((a=>{n.debug(`Adding "${a.name}" instrumentation`),s.some((e=>e.name===a.name))?n.warn(`Instrumentation ${a.name} is already added`):(a.unpatchedConsole=e,a.internalLogger=n,a.config=t,a.metas=i,a.transports=r,a.api=o,s.push(a),a.initialize())}))},get instrumentations(){return[...s]},remove:(...e)=>{n.debug("Removing instrumentations"),e.forEach((e=>{var t,i;n.debug(`Removing "${e.name}" instrumentation`);const r=s.reduce(((n,t,i)=>null===n&&t.name===e.name?i:null),null);r?(null===(i=(t=s[r]).destroy)||void 0===i||i.call(t),s.splice(r,1)):n.warn(`Instrumentation "${e.name}" is not added`)}))}}}(n,t,e,i,r,o),a=de(n,t,e,i,r,o,s);return function(e){var n,t;const i={sdk:{version:ae}};let r=e.config.session;(null===(n=e.config.sessionTracking)||void 0===n?void 0:n.enabled)&&(r=e.config.sessionTracking.session),r&&e.api.setSession(r),e.config.app&&(i.app=e.config.app),e.config.user&&(i.user=e.config.user),e.config.view&&(i.view=e.config.view),e.metas.add(i,...null!==(t=e.config.metas)&&void 0!==t?t:[])}(a),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend),e.transports.addIgnoreErrorsPatterns(e.config.ignoreErrors)}(a),function(e){e.instrumentations.add(...e.config.instrumentations)}(a),a}e.faro={};const fe="faro",ge={enabled:!0,sendTimeout:250,itemLimit:50},be={EventNames:{CLICK:"click",NAVIGATION:"navigation",SESSION_START:"session_start",VIEW_CHANGED:"view_changed"}},ve="sessionStorage",me="localStorage";function he(n){var t;try{let e;e=window[n];const t="__faro_storage_test__";return e.setItem(t,t),e.removeItem(t),!0}catch(i){return null===(t=e.faro.internalLogger)||void 0===t||t.info(`Web storage of type ${n} is not available. Reason: ${i}`),!1}}function we(e,n){return xe(n)?window[n].getItem(e):null}function ye(e,n,t){if(xe(t))try{window[t].setItem(e,n)}catch(e){}}function Ee(e,n){xe(n)&&window[n].removeItem(e)}const Se=he(me),Te=he(ve);function xe(e){return e===me?Se:e===ve&&Te}function ke(e,n){let t,i=!1;const r=()=>{null!=t?(e(...t),t=null,setTimeout(r,n)):i=!1};return(...o)=>{i?t=o:(e(...o),i=!0,setTimeout(r,n))}}const Ie="__FARO_SESSION__",Oe=144e5;function Le(e){const n=C();return{sessionId:null!=e?e:A(),lastActivity:n,started:n}}function Ae(e){if(null==e)return!1;const n=C();if(!(n-e.started<Oe))return!1;return n-e.lastActivity<9e5}function Ce({fetchUserSession:n,storeUserSession:t}){return function(){var i,r,o,s;if(!n||!t)return;const a=n();if(Ae(a))t(Object.assign(Object.assign({},a),{lastActivity:C()}));else{let n=Ne(Le(),a);t(n),null===(i=e.faro.api)||void 0===i||i.setSession(n.sessionMeta),null===(o=null===(r=e.faro.config.sessionTracking)||void 0===r?void 0:r.onSessionChange)||void 0===o||o.call(r,null!==(s=null==a?void 0:a.sessionMeta)&&void 0!==s?s:null,n.sessionMeta)}}}function Ne(n,t){var i;const r=Object.assign(Object.assign({},n),{sessionMeta:{id:n.sessionId}}),o=null===(i=e.faro.metas.value.session)||void 0===i?void 0:i.attributes;return(o||null!=t)&&(r.sessionMeta.attributes=Object.assign(Object.assign({},null!=o?o:{}),null!=t?{previousSession:t.sessionId}:{})),r}class je{constructor(e){this.initialSessionId=e,this.updateSession=ke((()=>this.updateUserSession()),1e3),this.updateUserSession=Ce({fetchUserSession:je.fetchUserSession,storeUserSession:je.storeUserSession}),this.init()}static removeUserSession(){Ee(Ie,je.storageTypeLocal)}static storeUserSession(e){ye(Ie,JSON.stringify(e),je.storageTypeLocal)}static fetchUserSession(){const e=we(Ie,je.storageTypeLocal);return e?JSON.parse(e):null}init(){je.storeUserSession(Le(this.initialSessionId)),document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),window.addEventListener("storage",(n=>{var t,i,r;if(n.key!==Ie)return;const o=JSON.parse(null!==(t=n.newValue)&&void 0!==t?t:""),s=JSON.parse(null!==(i=n.oldValue)&&void 0!==i?i:"");o.sessionId!==s.sessionId&&(null===(r=e.faro.api)||void 0===r||r.setSession(o.sessionMeta))})),e.faro.metas.addListener((function(n){const t=n.session,i=je.fetchUserSession();if(t&&t.id!==(null==i?void 0:i.sessionId)){const n=Ne(Le(t.id),i);je.storeUserSession(n),e.faro.api.setSession(n.sessionMeta)}}))}}je.storageTypeLocal=me;class Re{constructor(e){this.initialSessionId=e,this.updateSession=ke((()=>this.updateUserSession()),1e3),this.updateUserSession=Ce({fetchUserSession:Re.fetchUserSession,storeUserSession:Re.storeUserSession}),this.init()}static removeUserSession(){Ee(Ie,Re.storageTypeSession)}static storeUserSession(e){ye(Ie,JSON.stringify(e),Re.storageTypeSession)}static fetchUserSession(){const e=we(Ie,Re.storageTypeSession);return e?JSON.parse(e):null}init(){Re.storeUserSession(Le(this.initialSessionId)),document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),e.faro.metas.addListener((function(n){const t=n.session,i=Re.fetchUserSession();if(t&&t.id!==(null==i?void 0:i.sessionId)){const n=Ne(Le(t.id),i);Re.storeUserSession(n),e.faro.api.setSession(n.sessionMeta)}}))}}Re.storageTypeSession=ve;class De extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=ae}sendSessionStartEvent(e){var n;const t=e.session;t&&t.id!==(null===(n=this.notifiedSession)||void 0===n?void 0:n.id)&&(this.notifiedSession=t,this.api.pushEvent(be.EventNames.SESSION_START,{},void 0,{skipDedupe:!0}))}getSessionManagerInstanceByConfiguredStrategy(e){var n;return(null===(n=this.config.sessionTracking)||void 0===n?void 0:n.persistent)&&Se?new je(e):Te?new Re(e):null}initialize(){var e,n,t;if(this.logDebug("init session instrumentation"),this.sendSessionStartEvent(this.metas.value),this.metas.addListener(this.sendSessionStartEvent.bind(this)),null===(e=this.config.sessionTracking)||void 0===e?void 0:e.enabled){const e=this.getSessionManagerInstanceByConfiguredStrategy(null===(n=this.metas.value.session)||void 0===n?void 0:n.id);null!=e&&(null===(t=this.transports)||void 0===t||t.addBeforeSendHooks(...this.transports.getBeforeSendHooks(),(n=>(null==e||e.updateSession(),n))))}}}class Ue extends se{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=ae}initialize(){this.logDebug("Initializing\n",this.options),k.filter((e=>{var n;return!(null!==(n=this.options.disabledLevels)&&void 0!==n?n:Ue.defaultDisabledLevels).includes(e)})).forEach((e=>{console[e]=(...n)=>{try{this.api.pushLog(n,{level:e})}catch(e){this.logError(e)}finally{this.unpatchedConsole[e](...n)}}}))}}Ue.defaultDisabledLevels=[e.LogLevel.DEBUG,e.LogLevel.TRACE,e.LogLevel.LOG];const Me=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Pe=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Be=/\((\S*)(?::(\d+))(?::(\d+))\)/,_e="address at ",ze=_e.length,Fe=/^\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,$e=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ve="safari-extension",qe="safari-web-extension",Ge=/Minified React error #\d+;/i;function We(e,n,t,i){const r={filename:e||document.location.href,function:n||"?"};return void 0!==t&&(r.lineno=t),void 0!==i&&(r.colno=i),r}function He(e,n){const t=null==e?void 0:e.includes(Ve),i=!t&&(null==e?void 0:e.includes(qe));return t||i?[(null==e?void 0:e.includes("@"))?e.split("@")[0]:e,t?`${Ve}:${n}`:`${qe}:${n}`]:[e,n]}function Ke(e){let n=[];e.stacktrace?n=e.stacktrace.split("\n").filter(((e,n)=>n%2==0)):e.stack&&(n=e.stack.split("\n"));const t=n.reduce(((n,t,i)=>{let r,o,s,l,u;if(r=Pe.exec(t)){if(o=r[1],s=r[2],l=r[3],u=r[4],null==s?void 0:s.startsWith("eval")){const e=Be.exec(s);e&&(s=e[1],l=e[2],u=e[3])}s=(null==s?void 0:s.startsWith(_e))?s.substring(ze):s,[o,s]=He(o,s)}else if(r=Fe.exec(t)){if(o=r[1],s=r[3],l=r[4],u=r[5],s&&s.includes(" > eval")){const e=$e.exec(s);e&&(o=o||"eval",s=e[1],l=e[2])}else 0===i&&!u&&a(e.columnNumber)&&(u=String(e.columnNumber+1));[o,s]=He(o,s)}return(s||o)&&n.push(We(s,o,l?Number(l):void 0,u?Number(u):void 0)),n}),[]);return Ge.test(e.message)?t.slice(1):t}function Je(e){return{frames:Ke(e)}}function Xe(e){let n,t,i,r,o=[];if(v(e)&&e.error)n=e.error.message,t=e.error.name,o=Ke(e.error);else if((i=m(e))||h(e)){const{name:r,message:o}=e;t=null!=r?r:i?"DOMError":"DOMException",n=o?`${t}: ${o}`:t}else b(e)?(n=e.message,o=Ke(e)):(l(e)||(r=f(e)))&&(t=r?e.constructor.name:void 0,n=`Non-Error exception captured with keys: ${Object.keys(e)}`);return[n,t,o]}function Ze(e){const n=window.onerror;window.onerror=(...t)=>{try{const[i,r,o,a,l]=t;let u,c,d=[];const p=s(i),f=We(r,"?",o,a);l||!p?([u,c,d]=Xe(null!=l?l:i),0===d.length&&(d=[f])):p&&([u,c]=function(e){var n,t;const i=e.match(Me),r=null!==(n=null==i?void 0:i[1])&&void 0!==n?n:te;return[null!==(t=null==i?void 0:i[2])&&void 0!==t?t:e,r]}(i),d=[f]),u&&e.pushError(new Error(u),{type:c,stackFrames:d})}finally{null==n||n.apply(window,t)}}}class Qe extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=ae}initialize(){var e;this.logDebug("Initializing"),Ze(this.api),e=this.api,window.addEventListener("unhandledrejection",(n=>{var t,i;let r,o,s=n;s.reason?s=n.reason:(null===(t=n.detail)||void 0===t?void 0:t.reason)&&(s=null===(i=n.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]=Xe(s),r&&e.pushError(new Error(r),{type:o,stackFrames:a})}))}}class Ye extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=ae}sendViewChangedEvent(e){const n=e.view;n&&n!==this.notifiedView&&(this.notifiedView=n,this.api.pushEvent(be.EventNames.VIEW_CHANGED,{},void 0,{skipDedupe:!0}))}initialize(){this.sendViewChangedEvent(this.metas.value),this.metas.addListener(this.sendViewChangedEvent.bind(this))}}var en,nn,tn,rn,on,sn=-1,an=function(e){addEventListener("pageshow",(function(n){n.persisted&&(sn=n.timeStamp,e(n))}),!0)},ln=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},un=function(){var e=ln();return e&&e.activationStart||0},cn=function(e,n){var t=ln(),i="navigate";return sn>=0?i="back-forward-cache":t&&(document.prerendering||un()>0?i="prerender":document.wasDiscarded?i="restore":t.type&&(i=t.type.replace(/_/g,"-"))),{name:e,value:void 0===n?-1:n,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:i}},dn=function(e,n,t){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var i=new PerformanceObserver((function(e){Promise.resolve().then((function(){n(e.getEntries())}))}));return i.observe(Object.assign({type:e,buffered:!0},t||{})),i}}catch(e){}},pn=function(e,n,t,i){var r,o;return function(s){n.value>=0&&(s||i)&&((o=n.value-(r||0))||void 0===r)&&(r=n.value,n.delta=o,n.rating=function(e,n){return e>n[1]?"poor":e>n[0]?"needs-improvement":"good"}(n.value,t),e(n))}},fn=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},gn=function(e){var n=function(n){"pagehide"!==n.type&&"hidden"!==document.visibilityState||e(n)};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},bn=function(e){var n=!1;return function(t){n||(e(t),n=!0)}},vn=-1,mn=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},hn=function(e){"hidden"===document.visibilityState&&vn>-1&&(vn="visibilitychange"===e.type?e.timeStamp:0,yn())},wn=function(){addEventListener("visibilitychange",hn,!0),addEventListener("prerenderingchange",hn,!0)},yn=function(){removeEventListener("visibilitychange",hn,!0),removeEventListener("prerenderingchange",hn,!0)},En=function(){return vn<0&&(vn=mn(),wn(),an((function(){setTimeout((function(){vn=mn(),wn()}),0)}))),{get firstHiddenTime(){return vn}}},Sn=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Tn=[1800,3e3],xn=function(e,n){n=n||{},Sn((function(){var t,i=En(),r=cn("FCP"),o=dn("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<i.firstHiddenTime&&(r.value=Math.max(e.startTime-un(),0),r.entries.push(e),t(!0)))}))}));o&&(t=pn(e,r,Tn,n.reportAllChanges),an((function(i){r=cn("FCP"),t=pn(e,r,Tn,n.reportAllChanges),fn((function(){r.value=performance.now()-i.timeStamp,t(!0)}))})))}))},kn=[.1,.25],In={passive:!0,capture:!0},On=new Date,Ln=function(e,n){en||(en=n,nn=e,tn=new Date,Nn(removeEventListener),An())},An=function(){if(nn>=0&&nn<tn-On){var e={entryType:"first-input",name:en.type,target:en.target,cancelable:en.cancelable,startTime:en.timeStamp,processingStart:en.timeStamp+nn};rn.forEach((function(n){n(e)})),rn=[]}},Cn=function(e){if(e.cancelable){var n=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,n){var t=function(){Ln(e,n),r()},i=function(){r()},r=function(){removeEventListener("pointerup",t,In),removeEventListener("pointercancel",i,In)};addEventListener("pointerup",t,In),addEventListener("pointercancel",i,In)}(n,e):Ln(n,e)}},Nn=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(n){return e(n,Cn,In)}))},jn=[100,300],Rn=0,Dn=1/0,Un=0,Mn=function(e){e.forEach((function(e){e.interactionId&&(Dn=Math.min(Dn,e.interactionId),Un=Math.max(Un,e.interactionId),Rn=Un?(Un-Dn)/7+1:0)}))},Pn=function(){return on?Rn:performance.interactionCount||0},Bn=function(){"interactionCount"in performance||on||(on=dn("event",Mn,{type:"event",buffered:!0,durationThreshold:0}))},_n=[200,500],zn=0,Fn=function(){return Pn()-zn},$n=[],Vn={},qn=function(e){var n=$n[$n.length-1],t=Vn[e.interactionId];if(t||$n.length<10||e.duration>n.latency){if(t)t.entries.push(e),t.latency=Math.max(t.latency,e.duration);else{var i={id:e.interactionId,latency:e.duration,entries:[e]};Vn[i.id]=i,$n.push(i)}$n.sort((function(e,n){return n.latency-e.latency})),$n.splice(10).forEach((function(e){delete Vn[e.id]}))}},Gn=[2500,4e3],Wn={},Hn=[800,1800],Kn=function e(n){document.prerendering?Sn((function(){return e(n)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(n)}),!0):setTimeout(n,0)};class Jn extends se{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=ae}initialize(){this.logDebug("Initializing"),Object.entries(Jn.mapping).forEach((([e,n])=>{n((n=>{this.api.pushMeasurement({type:"web-vitals",values:{[e]:n.value}})}))}))}}function Xn(e={}){const n=[new Qe,new Jn,new De,new Ye];return!1!==e.captureConsole&&n.push(new Ue({disabledLevels:e.captureConsoleDisabledLevels})),n}Jn.mapping={cls:function(e,n){n=n||{},xn(bn((function(){var t,i=cn("CLS",0),r=0,o=[],s=function(e){e.forEach((function(e){if(!e.hadRecentInput){var n=o[0],t=o[o.length-1];r&&e.startTime-t.startTime<1e3&&e.startTime-n.startTime<5e3?(r+=e.value,o.push(e)):(r=e.value,o=[e])}})),r>i.value&&(i.value=r,i.entries=o,t())},a=dn("layout-shift",s);a&&(t=pn(e,i,kn,n.reportAllChanges),gn((function(){s(a.takeRecords()),t(!0)})),an((function(){r=0,i=cn("CLS",0),t=pn(e,i,kn,n.reportAllChanges),fn((function(){return t()}))})),setTimeout(t,0))})))},fcp:xn,fid:function(e,n){n=n||{},Sn((function(){var t,i=En(),r=cn("FID"),o=function(e){e.startTime<i.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),t(!0))},s=function(e){e.forEach(o)},a=dn("first-input",s);t=pn(e,r,jn,n.reportAllChanges),a&&gn(bn((function(){s(a.takeRecords()),a.disconnect()}))),a&&an((function(){var i;r=cn("FID"),t=pn(e,r,jn,n.reportAllChanges),rn=[],nn=-1,en=null,Nn(addEventListener),i=o,rn.push(i),An()}))}))},inp:function(e,n){n=n||{},Sn((function(){var t;Bn();var i,r=cn("INP"),o=function(e){e.forEach((function(e){e.interactionId&&qn(e),"first-input"===e.entryType&&!$n.some((function(n){return n.entries.some((function(n){return e.duration===n.duration&&e.startTime===n.startTime}))}))&&qn(e)}));var n,t=(n=Math.min($n.length-1,Math.floor(Fn()/50)),$n[n]);t&&t.latency!==r.value&&(r.value=t.latency,r.entries=t.entries,i())},s=dn("event",o,{durationThreshold:null!==(t=n.durationThreshold)&&void 0!==t?t:40});i=pn(e,r,_n,n.reportAllChanges),s&&("interactionId"in PerformanceEventTiming.prototype&&s.observe({type:"first-input",buffered:!0}),gn((function(){o(s.takeRecords()),r.value<0&&Fn()>0&&(r.value=0,r.entries=[]),i(!0)})),an((function(){$n=[],zn=Pn(),r=cn("INP"),i=pn(e,r,_n,n.reportAllChanges)})))}))},lcp:function(e,n){n=n||{},Sn((function(){var t,i=En(),r=cn("LCP"),o=function(e){var n=e[e.length-1];n&&n.startTime<i.firstHiddenTime&&(r.value=Math.max(n.startTime-un(),0),r.entries=[n],t())},s=dn("largest-contentful-paint",o);if(s){t=pn(e,r,Gn,n.reportAllChanges);var a=bn((function(){Wn[r.id]||(o(s.takeRecords()),s.disconnect(),Wn[r.id]=!0,t(!0))}));["keydown","click"].forEach((function(e){addEventListener(e,(function(){return setTimeout(a,0)}),!0)})),gn(a),an((function(i){r=cn("LCP"),t=pn(e,r,Gn,n.reportAllChanges),fn((function(){r.value=performance.now()-i.timeStamp,Wn[r.id]=!0,t(!0)}))}))}}))},ttfb:function(e,n){n=n||{};var t=cn("TTFB"),i=pn(e,t,Hn,n.reportAllChanges);Kn((function(){var r=ln();if(r){var o=r.responseStart;if(o<=0||o>performance.now())return;t.value=Math.max(o-un(),0),t.entries=[r],i(!0),an((function(){t=cn("TTFB",0),(i=pn(e,t,Hn,n.reportAllChanges))(!0)}))}}))}};const Zn="browser";var Qn={exports:{}};!function(e,n){!function(t,i){var r="function",o="undefined",s="object",a="string",l="major",u="model",c="name",d="type",p="vendor",f="version",g="architecture",b="console",v="mobile",m="tablet",h="smarttv",w="wearable",y="embedded",E="Amazon",S="Apple",T="ASUS",x="BlackBerry",k="Browser",I="Chrome",O="Firefox",L="Google",A="Huawei",C="LG",N="Microsoft",j="Motorola",R="Opera",D="Samsung",U="Sharp",M="Sony",P="Xiaomi",B="Zebra",_="Facebook",z="Chromium OS",F="Mac OS",$=function(e){for(var n={},t=0;t<e.length;t++)n[e[t].toUpperCase()]=e[t];return n},V=function(e,n){return typeof e===a&&-1!==q(n).indexOf(q(e))},q=function(e){return e.toLowerCase()},G=function(e,n){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof n===o?e:e.substring(0,350)},W=function(e,n){for(var t,o,a,l,u,c,d=0;d<n.length&&!u;){var p=n[d],f=n[d+1];for(t=o=0;t<p.length&&!u&&p[t];)if(u=p[t++].exec(e))for(a=0;a<f.length;a++)c=u[++o],typeof(l=f[a])===s&&l.length>0?2===l.length?typeof l[1]==r?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==r||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):i:this[l[0]]=c?l[1].call(this,c,l[2]):i:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):i):this[l]=c||i;d+=2}},H=function(e,n){for(var t in n)if(typeof n[t]===s&&n[t].length>0){for(var r=0;r<n[t].length;r++)if(V(n[t][r],e))return"?"===t?i:t}else if(V(n[t],e))return"?"===t?i:t;return e},K={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],[f,[c,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[c,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,f],[/opios[\/ ]+([\w\.]+)/i],[f,[c,R+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[c,R]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[c,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[c,"UC"+k]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[c,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[c,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[c,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[c,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[c,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,"$1 Secure "+k],f],[/\bfocus\/([\w\.]+)/i],[f,[c,O+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[c,R+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[c,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[c,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[c,R+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[c,"MIUI "+k]],[/fxios\/([-\w\.]+)/i],[f,[c,O]],[/\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+k]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[c,/(.+)/,"$1 "+k],f],[/(comodo_dragon)\/([\w\.]+)/i],[[c,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[c,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,_],f],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[c,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[c,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[c,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[c,I+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,I+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[c,"Android "+k]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[c,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[f,H,{"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,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[c,O+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\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|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[c,f],[/(cobalt)\/([\w\.]+)/i],[c,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,q]],[/((?: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/,"",q]],[/(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,q]]],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],[u,[p,D],[d,m]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[p,D],[d,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[p,S],[d,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[p,S],[d,m]],[/(macintosh);/i],[u,[p,S]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[p,U],[d,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[p,A],[d,m]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[p,A],[d,v]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[p,P],[d,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[p,P],[d,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[p,"OPPO"],[d,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[p,"Vivo"],[d,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[p,"Realme"],[d,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[p,j],[d,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[p,j],[d,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[p,C],[d,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[p,C],[d,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[p,"Lenovo"],[d,m]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[p,"Nokia"],[d,v]],[/(pixel c)\b/i],[u,[p,L],[d,m]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[p,L],[d,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[p,M],[d,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[p,M],[d,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[p,"OnePlus"],[d,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[p,E],[d,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[p,E],[d,v]],[/(playbook);[-\w\),; ]+(rim)/i],[u,p,[d,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[p,x],[d,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[p,T],[d,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[p,T],[d,v]],[/(nexus 9)/i],[u,[p,"HTC"],[d,m]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[p,[u,/_/g," "],[d,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[p,"Acer"],[d,m]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[p,"Meizu"],[d,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[p,u,[d,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[p,u,[d,m]],[/(surface duo)/i],[u,[p,N],[d,m]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[p,"Fairphone"],[d,v]],[/(u304aa)/i],[u,[p,"AT&T"],[d,v]],[/\bsie-(\w*)/i],[u,[p,"Siemens"],[d,v]],[/\b(rct\w+) b/i],[u,[p,"RCA"],[d,m]],[/\b(venue[\d ]{2,7}) b/i],[u,[p,"Dell"],[d,m]],[/\b(q(?:mv|ta)\w+) b/i],[u,[p,"Verizon"],[d,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[p,"Barnes & Noble"],[d,m]],[/\b(tm\d{3}\w+) b/i],[u,[p,"NuVision"],[d,m]],[/\b(k88) b/i],[u,[p,"ZTE"],[d,m]],[/\b(nx\d{3}j) b/i],[u,[p,"ZTE"],[d,v]],[/\b(gen\d{3}) b.+49h/i],[u,[p,"Swiss"],[d,v]],[/\b(zur\d{3}) b/i],[u,[p,"Swiss"],[d,m]],[/\b((zeki)?tb.*\b) b/i],[u,[p,"Zeki"],[d,m]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[p,"Dragon Touch"],u,[d,m]],[/\b(ns-?\w{0,9}) b/i],[u,[p,"Insignia"],[d,m]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[p,"NextBook"],[d,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[p,"Voice"],u,[d,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[p,"LvTel"],u,[d,v]],[/\b(ph-1) /i],[u,[p,"Essential"],[d,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[p,"Envizen"],[d,m]],[/\b(trio[-\w\. ]+) b/i],[u,[p,"MachSpeed"],[d,m]],[/\btu_(1491) b/i],[u,[p,"Rotor"],[d,m]],[/(shield[\w ]+) b/i],[u,[p,"Nvidia"],[d,m]],[/(sprint) (\w+)/i],[p,u,[d,v]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[p,N],[d,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[p,B],[d,m]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[p,B],[d,v]],[/smart-tv.+(samsung)/i],[p,[d,h]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[p,D],[d,h]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[p,C],[d,h]],[/(apple) ?tv/i],[p,[u,S+" TV"],[d,h]],[/crkey/i],[[u,I+"cast"],[p,L],[d,h]],[/droid.+aft(\w+)( bui|\))/i],[u,[p,E],[d,h]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[p,U],[d,h]],[/(bravia[\w ]+)( bui|\))/i],[u,[p,M],[d,h]],[/(mitv-\w{5}) bui/i],[u,[p,P],[d,h]],[/Hbbtv.*(technisat) (.*);/i],[p,u,[d,h]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[p,G],[u,G],[d,h]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,h]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[p,u,[d,b]],[/droid.+; (shield) bui/i],[u,[p,"Nvidia"],[d,b]],[/(playstation [345portablevi]+)/i],[u,[p,M],[d,b]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[p,N],[d,b]],[/((pebble))app/i],[p,u,[d,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[p,S],[d,w]],[/droid.+; (glass) \d/i],[u,[p,L],[d,w]],[/droid.+; (wt63?0{2,3})\)/i],[u,[p,B],[d,w]],[/(quest( 2| pro)?)/i],[u,[p,_],[d,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[p,[d,y]],[/(aeobc)\b/i],[u,[p,E],[d,y]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[d,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[d,m]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,m]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,v]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[p,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[c,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[c,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[c,[f,H,K]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[c,"Windows"],[f,H,K]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[c,F],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[c,f],[/\(bb(10);/i],[f,[c,x]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[c,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[c,O+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[c,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[c,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[c,I+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,z],f],[/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,f],[/(sunos) ?([\w\.\d]*)/i],[[c,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,f]]},X=function(e,n){if(typeof e===s&&(n=e,e=i),!(this instanceof X))return new X(e,n).getResult();var b=typeof t!==o&&t.navigator?t.navigator:i,h=e||(b&&b.userAgent?b.userAgent:""),w=b&&b.userAgentData?b.userAgentData:i,y=n?function(e,n){var t={};for(var i in e)n[i]&&n[i].length%2==0?t[i]=n[i].concat(e[i]):t[i]=e[i];return t}(J,n):J,E=b&&b.userAgent==h;return this.getBrowser=function(){var e,n={};return n[c]=i,n[f]=i,W.call(n,h,y.browser),n[l]=typeof(e=n[f])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:i,E&&b&&b.brave&&typeof b.brave.isBrave==r&&(n[c]="Brave"),n},this.getCPU=function(){var e={};return e[g]=i,W.call(e,h,y.cpu),e},this.getDevice=function(){var e={};return e[p]=i,e[u]=i,e[d]=i,W.call(e,h,y.device),E&&!e[d]&&w&&w.mobile&&(e[d]=v),E&&"Macintosh"==e[u]&&b&&typeof b.standalone!==o&&b.maxTouchPoints&&b.maxTouchPoints>2&&(e[u]="iPad",e[d]=m),e},this.getEngine=function(){var e={};return e[c]=i,e[f]=i,W.call(e,h,y.engine),e},this.getOS=function(){var e={};return e[c]=i,e[f]=i,W.call(e,h,y.os),E&&!e[c]&&w&&"Unknown"!=w.platform&&(e[c]=w.platform.replace(/chrome os/i,z).replace(/macos/i,F)),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 h},this.setUA=function(e){return h=typeof e===a&&e.length>350?G(e,350):e,this},this.setUA(h),this};X.VERSION="1.0.36",X.BROWSER=$([c,f,l]),X.CPU=$([g]),X.DEVICE=$([u,p,d,b,v,h,m,w,y]),X.ENGINE=X.OS=$([c,f]),e.exports&&(n=e.exports=X),n.UAParser=X;var Z=typeof t!==o&&(t.jQuery||t.Zepto);if(Z&&!Z.ua){var Q=new X;Z.ua=Q.getResult(),Z.ua.get=function(){return Q.getUA()},Z.ua.set=function(e){Q.setUA(e);var n=Q.getResult();for(var t in n)Z.ua[t]=n[t]}}}("object"==typeof window?window:N)}(Qn,Qn.exports);var Yn=Qn.exports;const et=()=>{const e=new Yn.UAParser,{name:n,version:t}=e.getBrowser(),{name:i,version:r}=e.getOS(),o=e.getUA(),s=navigator.language,a=navigator.userAgent.includes("Mobi"),l=function(){if(!n||!t)return;if("userAgentData"in navigator)return navigator.userAgentData.brands;return}(),u="unknown";return{browser:{name:null!=n?n:u,version:null!=t?t:u,os:`${null!=i?i:u} ${null!=r?r:u}`,userAgent:null!=o?o:u,language:null!=s?s:u,mobile:a,brands:null!=l?l:u}}},nt=()=>({page:{url:location.href}}),tt=[et,nt];function it(e){return{id:A(),attributes:e}}const rt={name:"default"},ot=()=>({k6:{isK6Browser:!0}});function st(e,n,t,i){return new(t||(t=Promise))((function(r,o){function s(e){try{l(i.next(e))}catch(e){o(e)}}function a(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,a)}l((i=i.apply(e,n||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class at extends Y{constructor(e){var n,t,i,r;super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-fetch",this.version=ae,this.disabledUntil=new Date,this.rateLimitBackoffMs=null!==(n=e.defaultRateLimitBackoffMs)&&void 0!==n?n:5e3,this.getNow=null!==(t=e.getNow)&&void 0!==t?t:()=>Date.now(),this.promiseBuffer=O({size:null!==(i=e.bufferSize)&&void 0!==i?i:30,concurrency:null!==(r=e.concurrency)&&void 0!==r?r:5})}send(e){return st(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((()=>{var n,t,i;const r=JSON.stringify(ne(e)),{url:o,requestOptions:s,apiKey:a}=this.options,l=null!=s?s:{},{headers:u}=l,c=function(e,n){var t={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&n.indexOf(i)<0&&(t[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)n.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(t[i[r]]=e[i[r]])}return t}(l,["headers"]);return fetch(o,Object.assign({method:"POST",headers:Object.assign(Object.assign(Object.assign({"Content-Type":"application/json"},null!=u?u:{}),a?{"x-api-key":a}:{}),(null===(n=this.config.sessionTracking)||void 0===n?void 0:n.enabled)&&(null===(t=this.metas.value.session)||void 0===t?void 0:t.id)?{"x-faro-session-id":null===(i=this.metas.value.session)||void 0===i?void 0:i.id}:{}),body:r,keepalive:r.length<=6e4},null!=c?c:{})).then((e=>(429===e.status&&(this.disabledUntil=this.getRetryAfterDate(e),this.logWarn(`Too many requests, backing off until ${this.disabledUntil}`)),e.text().catch(I),e))).catch((e=>{this.logError("Failed sending payload to the receiver\n",JSON.parse(r),e)}))}))}catch(e){this.logError(e)}}))}getIgnoreUrls(){return[this.options.url]}isBatched(){return!0}getRetryAfterDate(e){const n=this.getNow(),t=e.headers.get("Retry-After");if(t){const e=Number(t);if(!isNaN(e))return new Date(1e3*e+n);const i=Date.parse(t);if(!isNaN(i))return new Date(i)}return new Date(n+this.rateLimitBackoffMs)}}const lt={persistent:!1,maxSessionPersistenceTime:147e5};function ut(e){var n,t,i,r,o,s,a,u,c,d,p,f;const g=[],b=J(e.unpatchedConsole,e.internalLoggerLevel);e.transports?((e.url||e.apiKey)&&b.error('if "transports" is defined, "url" and "apiKey" should not be defined'),g.push(...e.transports)):e.url?g.push(new at({url:e.url,apiKey:e.apiKey})):b.error('either "url" or "transports" must be defined');const v={app:e.app,batching:Object.assign(Object.assign({},ge),e.batching),dedupe:null===(n=e.dedupe)||void 0===n||n,globalObjectKey:e.globalObjectKey||fe,instrumentations:null!==(t=e.instrumentations)&&void 0!==t?t:Xn(),internalLoggerLevel:null!==(i=e.internalLoggerLevel)&&void 0!==i?i:G,isolate:null!==(r=e.isolate)&&void 0!==r&&r,metas:function(){const n=tt;return e.metas&&n.push(...e.metas),l(window.k6)?[...n,ot]:n}(),parseStacktrace:Je,paused:null!==(o=e.paused)&&void 0!==o&&o,preventGlobalExposure:null!==(s=e.preventGlobalExposure)&&void 0!==s&&s,transports:g,unpatchedConsole:null!==(a=e.unpatchedConsole)&&void 0!==a?a:W,beforeSend:e.beforeSend,eventDomain:null!==(u=e.eventDomain)&&void 0!==u?u:Zn,ignoreErrors:e.ignoreErrors,sessionTracking:Object.assign(Object.assign(Object.assign({enabled:!1},lt),{session:(null===(c=e.sessionTracking)||void 0===c?void 0:c.enabled)?ct(e.sessionTracking):void 0}),e.sessionTracking),session:null!==(d=e.session)&&void 0!==d?d:it(),user:e.user,view:null!==(p=e.view)&&void 0!==p?p:rt};return(null===(f=v.sessionTracking)||void 0===f?void 0:f.enabled)&&delete v.session,v}function ct(e){var n,t,i,r;const o=Object.assign(Object.assign({},lt),e);let s=(o.persistent?je:Re).fetchUserSession();if(o.persistent){const e=C();s&&s.lastActivity<e-o.maxSessionPersistenceTime&&(je.removeUserSession(),s=null)}let a=null!==(t=null===(n=o.session)||void 0===n?void 0:n.id)&&void 0!==t?t:it().id,l=null===(i=o.session)||void 0===i?void 0:i.attributes;Ae(s)&&(a=null==s?void 0:s.sessionId,l=null===(r=null==s?void 0:s.sessionMeta)||void 0===r?void 0:r.attributes);const u={id:null!=a?a:it().id};return l&&(u.attributes=l),u}return e.BaseExtension=Q,e.BaseInstrumentation=se,e.BaseTransport=Y,e.ConsoleInstrumentation=Ue,e.ConsoleTransport=class extends Y{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:transport-console",this.version=ae}send(n){var t;return this.unpatchedConsole[null!==(t=this.options.level)&&void 0!==t?t:e.LogLevel.DEBUG]("New event",ne([n]))}},e.Conventions=be,e.ErrorsInstrumentation=Qe,e.FetchTransport=at,e.SessionInstrumentation=De,e.VERSION=ae,e.ViewInstrumentation=Ye,e.WebVitalsInstrumentation=Jn,e.allLogLevels=k,e.browserMeta=et,e.buildStackFrame=We,e.createInternalLogger=J,e.createPromiseBuffer=O,e.createSession=it,e.deepEqual=E,e.defaultEventDomain=Zn,e.defaultExceptionType=te,e.defaultGlobalObjectKey=fe,e.defaultInternalLoggerLevel=G,e.defaultLogLevel=x,e.defaultMetas=tt,e.defaultViewMeta=rt,e.genShortID=A,e.getCurrentTimestamp=S,e.getDataFromSafariExtensions=He,e.getInternalFaroFromGlobalObject=function(){return oe[le]},e.getStackFramesFromError=Ke,e.getTransportBody=ne,e.getWebInstrumentations=Xn,e.globalObject=oe,e.initializeFaro=function(e){const n=ut(e);if(n)return pe(n)},e.internalGlobalObjectKey=le,e.isArray=c,e.isBoolean=e=>n(e,"boolean"),e.isDomError=m,e.isDomException=h,e.isElement=e=>w&&i(e,Element),e.isElementDefined=w,e.isError=b,e.isErrorDefined=g,e.isErrorEvent=v,e.isEvent=f,e.isEventDefined=p,e.isFunction=u,e.isInstanceOf=i,e.isInt=e=>a(e)&&Number.isInteger(e),e.isInternalFaroOnGlobalObject=ce,e.isMap=e=>y&&i(e,Map),e.isMapDefined=y,e.isNull=o,e.isNumber=a,e.isObject=l,e.isPrimitive=d,e.isRegExp=e=>t(e,"RegExp"),e.isString=s,e.isSymbol=e=>n(e,"symbol"),e.isSyntheticEvent=e=>l(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e,e.isThenable=e=>u(null==e?void 0:e.then),e.isToString=t,e.isTypeof=n,e.isUndefined=r,e.makeCoreConfig=ut,e.noop=I,e.pageMeta=nt,e.parseStacktrace=Je,e.sdkMeta=()=>({sdk:{name:"@grafana/faro-core",version:ae,integrations:e.faro.config.instrumentations.map((({name:e,version:n})=>({name:e,version:n})))}}),e.setInternalFaroOnGlobalObject=ue,e.transportItemTypeToBodyKey=F,e}({}); |
@@ -6,3 +6,3 @@ import { BaseInstrumentation, LogLevel } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-console"; | ||
readonly version = "1.2.4"; | ||
readonly version = "1.2.5"; | ||
static defaultDisabledLevels: LogLevel[]; | ||
@@ -9,0 +9,0 @@ constructor(options?: ConsoleInstrumentationOptions); |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class ErrorsInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-errors"; | ||
readonly version = "1.2.4"; | ||
readonly version = "1.2.5"; | ||
initialize(): void; | ||
} |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class SessionInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-session"; | ||
readonly version = "1.2.4"; | ||
readonly version = "1.2.5"; | ||
private notifiedSession; | ||
@@ -6,0 +6,0 @@ private sendSessionStartEvent; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class ViewInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-view"; | ||
readonly version = "1.2.4"; | ||
readonly version = "1.2.5"; | ||
private notifiedView; | ||
@@ -6,0 +6,0 @@ private sendViewChangedEvent; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class WebVitalsInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-web-vitals"; | ||
readonly version = "1.2.4"; | ||
readonly version = "1.2.5"; | ||
static mapping: { | ||
@@ -6,0 +6,0 @@ cls: (onReport: import("web-vitals").CLSReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void; |
@@ -7,5 +7,5 @@ import { BaseTransport } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:transport-console"; | ||
readonly version = "1.2.4"; | ||
readonly version = "1.2.5"; | ||
constructor(options?: ConsoleTransportOptions); | ||
send(item: TransportItem): void; | ||
} |
@@ -7,3 +7,3 @@ import { BaseTransport, PromiseBuffer } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:transport-fetch"; | ||
readonly version = "1.2.4"; | ||
readonly version = "1.2.5"; | ||
promiseBuffer: PromiseBuffer<Response | void>; | ||
@@ -10,0 +10,0 @@ private readonly rateLimitBackoffMs; |
@@ -39,3 +39,3 @@ "use strict"; | ||
function makeCoreConfig(browserConfig) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; | ||
var transports = []; | ||
@@ -69,3 +69,3 @@ var internalLogger = (0, faro_core_1.createInternalLogger)(browserConfig.unpatchedConsole, browserConfig.internalLoggerLevel); | ||
} | ||
return { | ||
var config = { | ||
app: browserConfig.app, | ||
@@ -87,18 +87,22 @@ batching: __assign(__assign({}, faro_core_1.defaultBatchingConfig), browserConfig.batching), | ||
ignoreErrors: browserConfig.ignoreErrors, | ||
// The new session management feature is a PoC and still under development and IS NOT READY for any production use! | ||
experimentalSessions: __assign(__assign(__assign({ | ||
// TODO: will be true on release | ||
enabled: false }, defaultSessionPersistenceConfig), { session: createSessionMeta(browserConfig.experimentalSessions) }), browserConfig.experimentalSessions), | ||
// TODO: deprecate/remove old init code or maybe rename to legacy_session? | ||
session: (_j = browserConfig.session) !== null && _j !== void 0 ? _j : (0, metas_1.createSession)(), | ||
sessionTracking: __assign(__assign(__assign({ enabled: false }, defaultSessionPersistenceConfig), { | ||
// TODO: Remove condition at ga | ||
session: ((_j = browserConfig.sessionTracking) === null || _j === void 0 ? void 0 : _j.enabled) ? createSessionMeta(browserConfig.sessionTracking) : undefined }), browserConfig.sessionTracking), | ||
// TODO: deprecate/remove legacy session object at ga | ||
session: (_k = browserConfig.session) !== null && _k !== void 0 ? _k : (0, metas_1.createSession)(), | ||
user: browserConfig.user, | ||
view: (_k = browserConfig.view) !== null && _k !== void 0 ? _k : metas_1.defaultViewMeta, | ||
view: (_l = browserConfig.view) !== null && _l !== void 0 ? _l : metas_1.defaultViewMeta, | ||
}; | ||
if ((_m = config.sessionTracking) === null || _m === void 0 ? void 0 : _m.enabled) { | ||
delete config.session; | ||
} | ||
return config; | ||
} | ||
exports.makeCoreConfig = makeCoreConfig; | ||
function createSessionMeta(sessionsConfig) { | ||
var _a, _b, _c, _d; | ||
var _sessionsConfig = __assign(__assign({}, defaultSessionPersistenceConfig), sessionsConfig); | ||
var sessionId; | ||
var sessionManager = _sessionsConfig.persistent ? sessionManager_1.PersistentSessionsManager : sessionManager_1.VolatileSessionsManager; | ||
var userSession = sessionManager.fetchUserSession(); | ||
if (_sessionsConfig.persistent) { | ||
var userSession = sessionManager_1.PersistentSessionsManager.fetchUserSession(); | ||
var now = (0, faro_core_1.dateNow)(); | ||
@@ -108,9 +112,19 @@ var shouldClearPersistentSession = userSession && userSession.lastActivity < now - _sessionsConfig.maxSessionPersistenceTime; | ||
sessionManager_1.PersistentSessionsManager.removeUserSession(); | ||
userSession = null; | ||
} | ||
sessionId = (0, sessionManagerUtils_1.isUserSessionValid)(userSession) ? userSession === null || userSession === void 0 ? void 0 : userSession.sessionId : (0, metas_1.createSession)().id; | ||
} | ||
return { | ||
var sessionId = (_b = (_a = _sessionsConfig.session) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : (0, metas_1.createSession)().id; | ||
var sessionAttributes = (_c = _sessionsConfig.session) === null || _c === void 0 ? void 0 : _c.attributes; | ||
if ((0, sessionManagerUtils_1.isUserSessionValid)(userSession)) { | ||
sessionId = userSession === null || userSession === void 0 ? void 0 : userSession.sessionId; | ||
sessionAttributes = (_d = userSession === null || userSession === void 0 ? void 0 : userSession.sessionMeta) === null || _d === void 0 ? void 0 : _d.attributes; | ||
} | ||
var sessionMeta = { | ||
id: sessionId !== null && sessionId !== void 0 ? sessionId : (0, metas_1.createSession)().id, | ||
}; | ||
if (sessionAttributes) { | ||
sessionMeta.attributes = sessionAttributes; | ||
} | ||
return sessionMeta; | ||
} | ||
//# sourceMappingURL=makeCoreConfig.js.map |
@@ -52,3 +52,3 @@ "use strict"; | ||
var _a; | ||
if (((_a = this.config.experimentalSessions) === null || _a === void 0 ? void 0 : _a.persistent) && webStorage_1.isLocalStorageAvailable) { | ||
if (((_a = this.config.sessionTracking) === null || _a === void 0 ? void 0 : _a.persistent) && webStorage_1.isLocalStorageAvailable) { | ||
return new PersistentSessionsManager_1.PersistentSessionsManager(initialSessionId); | ||
@@ -66,3 +66,3 @@ } | ||
this.metas.addListener(this.sendSessionStartEvent.bind(this)); | ||
if ((_a = this.config.experimentalSessions) === null || _a === void 0 ? void 0 : _a.enabled) { | ||
if ((_a = this.config.sessionTracking) === null || _a === void 0 ? void 0 : _a.enabled) { | ||
var sessionManager_1 = this.getSessionManagerInstanceByConfiguredStrategy((_b = this.metas.value.session) === null || _b === void 0 ? void 0 : _b.id); | ||
@@ -69,0 +69,0 @@ if (sessionManager_1 != null) { |
@@ -60,3 +60,3 @@ "use strict"; | ||
(_a = faro_core_1.faro.api) === null || _a === void 0 ? void 0 : _a.setSession(newSession.sessionMeta); | ||
(_c = (_b = faro_core_1.faro.config.experimentalSessions) === null || _b === void 0 ? void 0 : _b.onSessionChange) === null || _c === void 0 ? void 0 : _c.call(_b, (_d = sessionFromStorage === null || sessionFromStorage === void 0 ? void 0 : sessionFromStorage.sessionMeta) !== null && _d !== void 0 ? _d : null, newSession.sessionMeta); | ||
(_c = (_b = faro_core_1.faro.config.sessionTracking) === null || _b === void 0 ? void 0 : _b.onSessionChange) === null || _c === void 0 ? void 0 : _c.call(_b, (_d = sessionFromStorage === null || sessionFromStorage === void 0 ? void 0 : sessionFromStorage.sessionMeta) !== null && _d !== void 0 ? _d : null, newSession.sessionMeta); | ||
} | ||
@@ -63,0 +63,0 @@ }; |
@@ -116,3 +116,3 @@ "use strict"; | ||
var _e = requestOptions !== null && requestOptions !== void 0 ? requestOptions : {}, headers = _e.headers, restOfRequestOptions = __rest(_e, ["headers"]); | ||
return fetch(url, __assign({ method: 'POST', headers: __assign(__assign(__assign({ 'Content-Type': 'application/json' }, (headers !== null && headers !== void 0 ? headers : {})), (apiKey ? { 'x-api-key': apiKey } : {})), (((_a = _this.config.experimentalSessions) === null || _a === void 0 ? void 0 : _a.enabled) && ((_b = _this.metas.value.session) === null || _b === void 0 ? void 0 : _b.id) | ||
return fetch(url, __assign({ method: 'POST', headers: __assign(__assign(__assign({ 'Content-Type': 'application/json' }, (headers !== null && headers !== void 0 ? headers : {})), (apiKey ? { 'x-api-key': apiKey } : {})), (((_a = _this.config.sessionTracking) === null || _a === void 0 ? void 0 : _a.enabled) && ((_b = _this.metas.value.session) === null || _b === void 0 ? void 0 : _b.id) | ||
? { 'x-faro-session-id': (_c = _this.metas.value.session) === null || _c === void 0 ? void 0 : _c.id } | ||
@@ -119,0 +119,0 @@ : {})), body: body, keepalive: body.length <= 60000 }, (restOfRequestOptions !== null && restOfRequestOptions !== void 0 ? restOfRequestOptions : {}))) |
import { createInternalLogger, dateNow, defaultBatchingConfig, defaultGlobalObjectKey, defaultInternalLoggerLevel, defaultUnpatchedConsole, isObject, } from '@grafana/faro-core'; | ||
import { defaultEventDomain } from '../consts'; | ||
import { parseStacktrace } from '../instrumentations'; | ||
import { PersistentSessionsManager } from '../instrumentations/session/sessionManager'; | ||
import { PersistentSessionsManager, VolatileSessionsManager, } from '../instrumentations/session/sessionManager'; | ||
import { isUserSessionValid, MAX_SESSION_PERSISTENCE_TIME, } from '../instrumentations/session/sessionManager/sessionManagerUtils'; | ||
@@ -16,3 +16,3 @@ import { createSession, defaultMetas, defaultViewMeta } from '../metas'; | ||
export function makeCoreConfig(browserConfig) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; | ||
const transports = []; | ||
@@ -46,3 +46,3 @@ const internalLogger = createInternalLogger(browserConfig.unpatchedConsole, browserConfig.internalLoggerLevel); | ||
} | ||
return { | ||
const config = { | ||
app: browserConfig.app, | ||
@@ -64,17 +64,21 @@ batching: Object.assign(Object.assign({}, defaultBatchingConfig), browserConfig.batching), | ||
ignoreErrors: browserConfig.ignoreErrors, | ||
// The new session management feature is a PoC and still under development and IS NOT READY for any production use! | ||
experimentalSessions: Object.assign(Object.assign(Object.assign({ | ||
// TODO: will be true on release | ||
enabled: false }, defaultSessionPersistenceConfig), { session: createSessionMeta(browserConfig.experimentalSessions) }), browserConfig.experimentalSessions), | ||
// TODO: deprecate/remove old init code or maybe rename to legacy_session? | ||
session: (_j = browserConfig.session) !== null && _j !== void 0 ? _j : createSession(), | ||
sessionTracking: Object.assign(Object.assign(Object.assign({ enabled: false }, defaultSessionPersistenceConfig), { | ||
// TODO: Remove condition at ga | ||
session: ((_j = browserConfig.sessionTracking) === null || _j === void 0 ? void 0 : _j.enabled) ? createSessionMeta(browserConfig.sessionTracking) : undefined }), browserConfig.sessionTracking), | ||
// TODO: deprecate/remove legacy session object at ga | ||
session: (_k = browserConfig.session) !== null && _k !== void 0 ? _k : createSession(), | ||
user: browserConfig.user, | ||
view: (_k = browserConfig.view) !== null && _k !== void 0 ? _k : defaultViewMeta, | ||
view: (_l = browserConfig.view) !== null && _l !== void 0 ? _l : defaultViewMeta, | ||
}; | ||
if ((_m = config.sessionTracking) === null || _m === void 0 ? void 0 : _m.enabled) { | ||
delete config.session; | ||
} | ||
return config; | ||
} | ||
function createSessionMeta(sessionsConfig) { | ||
var _a, _b, _c, _d; | ||
const _sessionsConfig = Object.assign(Object.assign({}, defaultSessionPersistenceConfig), sessionsConfig); | ||
let sessionId; | ||
const sessionManager = _sessionsConfig.persistent ? PersistentSessionsManager : VolatileSessionsManager; | ||
let userSession = sessionManager.fetchUserSession(); | ||
if (_sessionsConfig.persistent) { | ||
const userSession = PersistentSessionsManager.fetchUserSession(); | ||
const now = dateNow(); | ||
@@ -84,9 +88,19 @@ const shouldClearPersistentSession = userSession && userSession.lastActivity < now - _sessionsConfig.maxSessionPersistenceTime; | ||
PersistentSessionsManager.removeUserSession(); | ||
userSession = null; | ||
} | ||
sessionId = isUserSessionValid(userSession) ? userSession === null || userSession === void 0 ? void 0 : userSession.sessionId : createSession().id; | ||
} | ||
return { | ||
let sessionId = (_b = (_a = _sessionsConfig.session) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : createSession().id; | ||
let sessionAttributes = (_c = _sessionsConfig.session) === null || _c === void 0 ? void 0 : _c.attributes; | ||
if (isUserSessionValid(userSession)) { | ||
sessionId = userSession === null || userSession === void 0 ? void 0 : userSession.sessionId; | ||
sessionAttributes = (_d = userSession === null || userSession === void 0 ? void 0 : userSession.sessionMeta) === null || _d === void 0 ? void 0 : _d.attributes; | ||
} | ||
const sessionMeta = { | ||
id: sessionId !== null && sessionId !== void 0 ? sessionId : createSession().id, | ||
}; | ||
if (sessionAttributes) { | ||
sessionMeta.attributes = sessionAttributes; | ||
} | ||
return sessionMeta; | ||
} | ||
//# sourceMappingURL=makeCoreConfig.js.map |
@@ -23,3 +23,3 @@ import { BaseInstrumentation, Conventions, VERSION } from '@grafana/faro-core'; | ||
var _a; | ||
if (((_a = this.config.experimentalSessions) === null || _a === void 0 ? void 0 : _a.persistent) && isLocalStorageAvailable) { | ||
if (((_a = this.config.sessionTracking) === null || _a === void 0 ? void 0 : _a.persistent) && isLocalStorageAvailable) { | ||
return new PersistentSessionsManager(initialSessionId); | ||
@@ -37,3 +37,3 @@ } | ||
this.metas.addListener(this.sendSessionStartEvent.bind(this)); | ||
if ((_a = this.config.experimentalSessions) === null || _a === void 0 ? void 0 : _a.enabled) { | ||
if ((_a = this.config.sessionTracking) === null || _a === void 0 ? void 0 : _a.enabled) { | ||
const sessionManager = this.getSessionManagerInstanceByConfiguredStrategy((_b = this.metas.value.session) === null || _b === void 0 ? void 0 : _b.id); | ||
@@ -40,0 +40,0 @@ if (sessionManager != null) { |
@@ -43,3 +43,3 @@ import { dateNow, faro, genShortID } from '@grafana/faro-core'; | ||
(_a = faro.api) === null || _a === void 0 ? void 0 : _a.setSession(newSession.sessionMeta); | ||
(_c = (_b = faro.config.experimentalSessions) === null || _b === void 0 ? void 0 : _b.onSessionChange) === null || _c === void 0 ? void 0 : _c.call(_b, (_d = sessionFromStorage === null || sessionFromStorage === void 0 ? void 0 : sessionFromStorage.sessionMeta) !== null && _d !== void 0 ? _d : null, newSession.sessionMeta); | ||
(_c = (_b = faro.config.sessionTracking) === null || _b === void 0 ? void 0 : _b.onSessionChange) === null || _c === void 0 ? void 0 : _c.call(_b, (_d = sessionFromStorage === null || sessionFromStorage === void 0 ? void 0 : sessionFromStorage.sessionMeta) !== null && _d !== void 0 ? _d : null, newSession.sessionMeta); | ||
} | ||
@@ -46,0 +46,0 @@ }; |
@@ -52,3 +52,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
const _d = requestOptions !== null && requestOptions !== void 0 ? requestOptions : {}, { headers } = _d, restOfRequestOptions = __rest(_d, ["headers"]); | ||
return fetch(url, Object.assign({ method: 'POST', headers: Object.assign(Object.assign(Object.assign({ 'Content-Type': 'application/json' }, (headers !== null && headers !== void 0 ? headers : {})), (apiKey ? { 'x-api-key': apiKey } : {})), (((_a = this.config.experimentalSessions) === null || _a === void 0 ? void 0 : _a.enabled) && ((_b = this.metas.value.session) === null || _b === void 0 ? void 0 : _b.id) | ||
return fetch(url, Object.assign({ method: 'POST', headers: Object.assign(Object.assign(Object.assign({ 'Content-Type': 'application/json' }, (headers !== null && headers !== void 0 ? headers : {})), (apiKey ? { 'x-api-key': apiKey } : {})), (((_a = this.config.sessionTracking) === null || _a === void 0 ? void 0 : _a.enabled) && ((_b = this.metas.value.session) === null || _b === void 0 ? void 0 : _b.id) | ||
? { 'x-faro-session-id': (_c = this.metas.value.session) === null || _c === void 0 ? void 0 : _c.id } | ||
@@ -55,0 +55,0 @@ : {})), body, keepalive: body.length <= 60000 }, (restOfRequestOptions !== null && restOfRequestOptions !== void 0 ? restOfRequestOptions : {}))) |
@@ -6,3 +6,3 @@ import { BaseInstrumentation, LogLevel } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-console"; | ||
readonly version = "1.2.4"; | ||
readonly version = "1.2.5"; | ||
static defaultDisabledLevels: LogLevel[]; | ||
@@ -9,0 +9,0 @@ constructor(options?: ConsoleInstrumentationOptions); |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class ErrorsInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-errors"; | ||
readonly version = "1.2.4"; | ||
readonly version = "1.2.5"; | ||
initialize(): void; | ||
} |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class SessionInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-session"; | ||
readonly version = "1.2.4"; | ||
readonly version = "1.2.5"; | ||
private notifiedSession; | ||
@@ -6,0 +6,0 @@ private sendSessionStartEvent; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class ViewInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-view"; | ||
readonly version = "1.2.4"; | ||
readonly version = "1.2.5"; | ||
private notifiedView; | ||
@@ -6,0 +6,0 @@ private sendViewChangedEvent; |
import { BaseInstrumentation } from '@grafana/faro-core'; | ||
export declare class WebVitalsInstrumentation extends BaseInstrumentation { | ||
readonly name = "@grafana/faro-web-sdk:instrumentation-web-vitals"; | ||
readonly version = "1.2.4"; | ||
readonly version = "1.2.5"; | ||
static mapping: { | ||
@@ -6,0 +6,0 @@ cls: (onReport: import("web-vitals").CLSReportCallback, opts?: import("web-vitals").ReportOpts | undefined) => void; |
@@ -7,5 +7,5 @@ import { BaseTransport } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:transport-console"; | ||
readonly version = "1.2.4"; | ||
readonly version = "1.2.5"; | ||
constructor(options?: ConsoleTransportOptions); | ||
send(item: TransportItem): void; | ||
} |
@@ -7,3 +7,3 @@ import { BaseTransport, PromiseBuffer } from '@grafana/faro-core'; | ||
readonly name = "@grafana/faro-web-sdk:transport-fetch"; | ||
readonly version = "1.2.4"; | ||
readonly version = "1.2.5"; | ||
promiseBuffer: PromiseBuffer<Response | void>; | ||
@@ -10,0 +10,0 @@ private readonly rateLimitBackoffMs; |
{ | ||
"name": "@grafana/faro-web-sdk", | ||
"version": "1.2.4", | ||
"version": "1.2.5", | ||
"description": "Faro instrumentations, metas, transports for web.", | ||
@@ -55,3 +55,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@grafana/faro-core": "^1.2.4", | ||
"@grafana/faro-core": "^1.2.5", | ||
"ua-parser-js": "^1.0.32", | ||
@@ -67,3 +67,3 @@ "web-vitals": "^3.1.1" | ||
}, | ||
"gitHead": "72cda534dc953ddaa37a0192ef956ac6ea505962" | ||
"gitHead": "bcd8917f3623f070b13361a081d050ba16e7e050" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
439529
3515
Updated@grafana/faro-core@^1.2.5